Skip to content
Browse files

List post template generator:

options for "post entry" ready to use!
  • Loading branch information...
1 parent e7789cf commit 2481f4b68d7664622f34eb7a97c42a47137aa03a konradsroka committed Apr 19, 2012
Showing with 92 additions and 28 deletions.
  1. +17 −18 core/custom-community.php
  2. +72 −9 core/includes/shortcodes.php
  3. +3 −1 core/includes/theme-generator/style.php
View
35 core/custom-community.php
@@ -442,11 +442,11 @@ function togglediv(showHideDiv, switchTextDiv) {
var widgetarea_lines = jQuery('#list_post_template').sheepIt({
separator: '',
- allowRemoveLast: true,
+ allowRemoveLast: false,
allowRemoveCurrent: true,
allowRemoveAll: true,
allowAdd: true,
- allowAddN: true,
+ allowAddN: false,
maxFormsCount: 10,
minFormsCount: 0,
@@ -729,34 +729,34 @@ function togglediv(showHideDiv, switchTextDiv) {
<!-- post entry: clickable box or not? -->
<div class="tk_field_row">
- post entry: clickable box:
+ make the post a clickable box:
<input type="checkbox" id="list_post_template_entry_clickable" name="cc-config_values[list_post_template_entry_clickable]">
</div>
- <!-- post entry: background color fade -->
+ <!-- post entry: background color or fade -->
<div class="tk_field_row">
<div class="tk_field_label">
- <label for="" title=" Background Color "> Background color fade</label>
+ <label for="" title=" Background Color ">Background color</label>
</div>
<div class="tk_field">
<input onfocus="ColorPicker('.entryimage76576566764#index#');" id="list_post_template_#index#_cc-config_values[list_post_template_background_color]" class="entryimage76576566764#index#" type="text" name="cc-config_values[list_post_template_background_color][#index#]">
</div>
</div>
<div class="tk_field_row">
<div class="tk_field_label">
- <label for="" title=" Background Color "> Background Color fade top </label>
+ <label for="" title=" Background Color ">Background color (fade top) </label>
</div>
<div class="tk_field">
- <input onfocus="ColorPicker('.entryimage76576566764#index#');" id="list_post_template_#index#_cc-config_values[list_post_template_background_color_top]" class="entryimage76576566764#index#" type="text" name="cc-config_values[list_post_template_background_color_top][#index#]">
+ <input onfocus="ColorPicker('.entryimage76576566764#index#');" id="list_post_template_#index#_cc-config_values[list_post_template_background_color_top]" class="entryimage76576566764#index#" type="text" name="cc-config_values[list_post_template_background_color_top][#index#]">
</div>
</div>
<!-- post entry: background image -->
<div class="tk_field_row">
<div class="tk_field_label">
- <label for="" title=" Background Image "> Background image </label>
+ <label for="" title=" Background Image ">Background image</label>
</div>
<div class="tk_field">
@@ -783,15 +783,15 @@ function togglediv(showHideDiv, switchTextDiv) {
<div class="tk_field_row">
<div class="tk_field_label">
- <label for="" title=" Template width: "> List post width: </label>
+ <label for="" title=" Template width, in pixel or %, example: 200px or 50%">List post width <br><span style="font-size:10px; color: #999999;">example: 200px or 50%</span> </label>
</div>
<div class="tk_field">
<input id="list_post_template_#index#_cc-config_values[list_post_template_width]" type="text" value="" name="cc-config_values[list_post_template_width][#index#]">
</div>
</div>
<div class="tk_field_row">
<div class="tk_field_label">
- <label for="" title=" Template height: "> List post height: </label>
+ <label for="" title=" Template height, in pixel, example: 120px">List post height <br><span style="font-size:10px; color: #999999;">in px, just enter a number</span> </label>
</div>
<div class="tk_field">
<input id="list_post_template_#index#_cc-config_values[list_post_template_height]" type="text" value="" name="cc-config_values[list_post_template_height][#index#]">
@@ -802,7 +802,7 @@ function togglediv(showHideDiv, switchTextDiv) {
<div class="tk_field_row">
<div class="tk_field_label">
- <label for="" title=" post entry: corner radius: "> post entry: corner radius: </label>
+ <label for="" title="post entries with rounded corners? example: 11px **note: IE doesn't support Rounded Corners..">Corner radius <br><span style="font-size:10px; color: #999999;">in px, just enter a number</span> </label>
</div>
<div class="tk_field">
<input id="list_post_template_#index#_cc-config_values[list_post_template_corner_radius]" type="text" value="" name="cc-config_values[list_post_template_corner_radius][#index#]">
@@ -813,7 +813,7 @@ function togglediv(showHideDiv, switchTextDiv) {
<div class="tk_field_row">
<div class="tk_field_label">
- <label for="" title=" border color "> border color </label>
+ <label for="" title=" border color ">Border color</label>
</div>
<div class="tk_field">
<input onfocus="ColorPicker('.entryimage76576566764#index#');" id="list_post_template_#index#_cc-config_values[list_post_template_border_color]" class="entryimage76576566764#index#" type="text" name="cc-config_values[list_post_template_border_color][#index#]">
@@ -824,22 +824,21 @@ function togglediv(showHideDiv, switchTextDiv) {
<div class="tk_field_row">
<div class="tk_field_label">
- <label for="" title=" border color "> box shadows color </label>
+ <label for="" title=" border color ">Box shadow color </label>
</div>
<div class="tk_field">
<input onfocus="ColorPicker('.entryimage76576566764#index#');" id="list_post_template_#index#_cc-config_values[list_post_template_box_shadow_color]" class="entryimage76576566764#index#" type="text" name="cc-config_values[list_post_template_box_shadow_color][#index#]">
</div>
</div>
<div class="tk_field_row">
<div class="tk_field_label">
- <label for="" title="background image repeat">box shadow style</label>
+ <label for="" title="Box shadow style, inside or outside? **note for inside effect: the shadowcolor should be brighter than the post-entry and background color">Box shadow style</label>
</div>
<div class="tk_field">
<select id="list_post_template_#index#_cc-config_values[list_post_template_box_shadow_style]" name="list_post_template_#index#_cc-config_values[list_post_template_box_shadow_style][#index#]">
- <option value="no-repeat">no repeat</option>
- <option value="repeat-x">repeat horizontal</option>
- <option value="repeat-y">repeat vertical</option>
- <option value="repeat">repeat both</option></select>
+ <option value="outside">outside</option>
+ <option value="inside">inside</option>
+ </select>
</div>
</div>
View
81 core/includes/shortcodes.php
@@ -363,25 +363,86 @@ function cc_list_posts($atts,$content = null) {
), $atts));
+ if($featured_id == '') {
+ $featured_id = substr(md5(rand()), 0, 10);
+ $featured_id;
+ }
+
+
if(is_numeric($img_position)){
$arrayindex = $img_position;
+ $img_position = $tkf->list_post_template_image_position[$arrayindex];
$featured_posts_image_width = $tkf->list_post_template_width[$arrayindex];
$featured_posts_image_height = $tkf->list_post_template_height[$arrayindex];
-
- $img_position = $tkf->list_post_template_image_position[$arrayindex];
-
+ $template_name = sanitize_title($tkf->list_post_template_name[$arrayindex]);
ob_start(); ?>
<style>
- div.posts-img-right-content-left {
- background: none repeat scroll 0 0 #<?php echo $tkf->list_post_template_background_color[$arrayindex] ?>;
- float: right;
- padding: 20px 0 0;
+ div.listposts.<?php echo $template_name; ?> {
+ <?php if ( $tkf->list_post_template_background_color[$arrayindex] != '' ) { ?>
+ /* BG color fallback */
+ background: none repeat scroll 0 0 #<?php echo $tkf->list_post_template_background_color[$arrayindex] ?>;
+ <?php if ( $tkf->list_post_template_background_color_top[$arrayindex] != '' ) { ?>
+ /* Firefox: */
+ background: -moz-linear-gradient(center top, #<?php echo $tkf->list_post_template_background_color_top[$arrayindex]; ?>, #<?php echo $tkf->list_post_template_background_color[$arrayindex]; ?>);
+ /* Chrome, Safari:*/
+ background: -webkit-gradient(linear, left top, left center, from(#<?php echo $tkf->list_post_template_background_color_top[$arrayindex]; ?>), to(#<?php echo $tkf->list_post_template_background_color[$arrayindex]; ?>));
+ /* Opera */
+ background: -o-linear-gradient(top, #<?php echo $tkf->list_post_template_background_color_top[$arrayindex]; ?>, #<?php echo $tkf->list_post_template_background_color_top[$arrayindex]; ?> 75%, #<?php echo $tkf->list_post_template_background_color[$arrayindex]; ?> 75%, #<?php echo $tkf->list_post_template_background_color[$arrayindex]; ?>);
+ /* IE */
+ filter: progid:DXImageTransform.Microsoft.Gradient(
+ StartColorStr='#<?php echo $tkf->list_post_template_background_color_top[$arrayindex]; ?>', EndColorStr='#<?php echo $tkf->list_post_template_background_color[$arrayindex]; ?>', GradientType=0);
+ <?php } ?>
+ <?php } ?>
+ <?php if ( $tkf->list_post_template_background_image[$arrayindex] != '' ) { ?>
+ background-image: url('<?php echo $tkf->list_post_template_background_image[$arrayindex] ?>');
+ <?php } ?>
+ <?php if ( $tkf->list_post_template_background_image_repeat[$arrayindex] != '' ) { ?>
+ background-repeat: no-repeat;
+ <?php } ?>
+ <?php if ( $tkf->list_post_template_height[$arrayindex] != '' || $tkf->list_post_template_width[$arrayindex] != '' ) { ?>
+ overflow: hidden;
+ <?php if ( $tkf->list_post_template_height[$arrayindex] != '' ) { ?>
+ height: <?php echo $tkf->list_post_template_height[$arrayindex] ?>px;
+ <?php } ?>
+ <?php if ( $tkf->list_post_template_width[$arrayindex] != '' ) { ?>
+ width: <?php echo $tkf->list_post_template_width[$arrayindex] ?>;
+ <?php } ?>
+ <?php } else { ?>
+ height: auto;
+ width: auto;
+ overflow: auto;
+ <?php } ?>
+ <?php if ( $tkf->list_post_template_corner_radius[$arrayindex] != '' ) { ?>
+ border-radius: <?php echo $tkf->list_post_template_corner_radius[$arrayindex]; ?>px;
+ -webkit-border-radius: <?php echo $tkf->list_post_template_corner_radius[$arrayindex]; ?>px;
+ -moz-border-radius: <?php echo $tkf->list_post_template_corner_radius[$arrayindex]; ?>px;
+ <?php } ?>
+ <?php if ( $tkf->list_post_template_border_color[$arrayindex] != '' ) { ?>
+ border: 1px solid #<?php echo $tkf->list_post_template_border_color[$arrayindex]; ?>;
+ <?php } ?>
+ <?php if ( $tkf->list_post_template_box_shadow_color[$arrayindex] != '' ) {
+ $shadowstyle = "";
+ if ( $tkf->list_post_template_box_shadow_style[$arrayindex] == "inside" )
+ $shadowstyle = "-"; ?>
+ -webkit-box-shadow: <?php echo $shadowstyle; ?>1px 1px 2px 0px #<?php echo $tkf->list_post_template_box_shadow_color[$arrayindex]; ?>; /* Safari 3+, iOS 4.0.2 - 4.2, Android 2.3+ */
+ -moz-box-shadow: <?php echo $shadowstyle; ?>1px 1px 2px 0px #<?php echo $tkf->list_post_template_box_shadow_color[$arrayindex]; ?>; /* Firefox 3.5 - 3.6 */
+ box-shadow: <?php echo $shadowstyle; ?>1px 1px 2px 0px #<?php echo $tkf->list_post_template_box_shadow_color[$arrayindex]; ?>; /* Opera 10.5+, IE9+, Firefox 4+, Chrome 6+, iOS 5 */
+ <?php } ?>
+ margin-bottom: 20px;
+ padding: 10px;
}
+
+
+
+
+
+
+
</style>
@@ -499,7 +560,7 @@ function cc_list_posts($atts,$content = null) {
$tmp .= featured_post_loop($tmp);
break;
default:
- $tmp .= '<div class="listposts '.$img_position.'">';
+ $tmp .= '<div class="listposts '.$img_position.' '. $template_name .'">';
if($img_position != 'posts-img-under-content') $tmp .= '<a href="'.get_permalink().'" title="'.get_the_title().'">'.get_the_post_thumbnail( $post->ID, array($featured_posts_image_width,$featured_posts_image_height),"class={$reflect}" ).'</a>';
$tmp .= '<h3><a href="'.get_permalink().'" title="'.get_the_title().'">'.get_the_title().'</a></h3>';
if($height != 'auto'){ $height = $height.'px'; }
@@ -535,8 +596,10 @@ function cc_list_posts($atts,$content = null) {
wp_reset_postdata();
+
+
- return $tmp_js.'<div id="featured_posts'.$featured_id.'"><div id="list_posts'.$featured_id.'" class="list-posts-all '. $img_position .' ">'.$tmp.'</div></div>';
+ return $tmp_js.'<div id="featured_posts'.$featured_id.'"><div id="list_posts'.$featured_id.'" class="list-posts-all '. $template_name .' '. $img_position .' ">'.$tmp.'</div></div>';
}
add_shortcode('cc_list_posts', 'cc_list_posts');
View
4 core/includes/theme-generator/style.php
@@ -3414,10 +3414,12 @@ function dynamic_css(){
/* List Posts Templates :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: */
+ /* that's the post entry */
.listposts {
- width: 100%;
+ width: auto;
}
+ /* that's the wrap around */
.list-posts-all {
width: 100%;
margin-bottom: 25px;

0 comments on commit 2481f4b

Please sign in to comment.
Something went wrong with that request. Please try again.