Changeset 346475
- Timestamp:
- 02/16/2011 04:41:20 PM (15 years ago)
- Location:
- wordpress-title-cloud/trunk
- Files:
-
- 4 edited
-
readme.txt (modified) (2 diffs)
-
wordpress-title-cloud.php (modified) (4 diffs)
-
wp-titlecloud.php (modified) (3 diffs)
-
wp-titlecloudadmin.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wordpress-title-cloud/trunk/readme.txt
r344392 r346475 4 4 Tags: title cloud,tag cloud 5 5 Requires at least: 3.0 6 Tested up to: 3. 0.57 Stable tag: 0.9. 86 Tested up to: 3.1 7 Stable tag: 0.9.9 8 8 9 9 Act as a tag cloud but instead of showing tag, it shows the title of pages. … … 32 32 33 33 == Changelog == 34 35 = 0.9.9 = 36 *It is now accomodates both post types 37 *Checkbox controls in the admin to select pages to display 34 38 35 39 = 0.9.8 = -
wordpress-title-cloud/trunk/wordpress-title-cloud.php
r344392 r346475 6 6 7 7 $oStyle= json_decode(get_option('wp-titlecloud_styles')); 8 $ excludes=get_option('wp-titlecloud_excludes');8 $includes=get_option('wp-titlecloud_pages'); 9 9 global $wpdb; 10 10 … … 27 27 ON wposts.ID = wpostmeta.post_id 28 28 WHERE wpostmeta.meta_key = 'bezoekers' 29 AND wpostmeta.meta_value != '0' 30 AND wposts.post_type = 'page' 31 AND wposts.ID NOT IN ({$excludes}) 29 AND wposts.ID IN ({$includes}) 32 30 ORDER BY wposts.post_date DESC 33 31 "; … … 57 55 if($oStyle->auto=='1'){ 58 56 add_post_meta($id, "bezoekers", 1); 57 $included=get_option('wp-titlecloud_pages'); 58 if(strlen($included)>1){ 59 $included.=",".$id; 60 update_option('wp-titlecloud_pages', $included); 61 } 59 62 }else{ 60 63 add_post_meta($id, "bezoekers", 0); … … 75 78 "; 76 79 } 80 81 82 77 83 78 84 } -
wordpress-title-cloud/trunk/wp-titlecloud.php
r344392 r346475 2 2 /** 3 3 * @package Wordpress Title Cloud 4 * @version 0.9. 84 * @version 0.9.9 5 5 */ 6 6 /* … … 9 9 Description: An Idea of Displaying texts as tag cloud using your page titles. 10 10 Author: Burt Adem 11 Version: 0.9. 811 Version: 0.9.9 12 12 Author URI: http://burtadem.com/ 13 13 */ … … 15 15 $oTitleCloud = new wordpress_title_cloud(); 16 16 17 17 18 function wpttlcloud_headHook(){ 18 if(is_page() ){global $post,$oTitleCloud;$oTitleCloud->cloud_visit($post->ID); }19 if(is_page() || is_single()){global $post,$oTitleCloud;$oTitleCloud->cloud_visit($post->ID); } 19 20 } 20 21 add_action('wp_head', 'wpttlcloud_headHook'); -
wordpress-title-cloud/trunk/wp-titlecloudadmin.php
r344392 r346475 1 1 <?php 2 global $wpdb; 2 3 if($_POST['txtHidden'] == 'Y') { 3 4 //Form data sent … … 15 16 16 17 update_option('wp-titlecloud_area', $area); 17 update_option('wp-titlecloud_excludes', $excludes); 18 update_option('wp-titlecloud_styles',json_encode($aProperty)); 18 update_option('wp-titlecloud_styles',json_encode($aProperty)); 19 19 $jdata=json_encode($aProperty); 20 20 $oProperty=json_decode($jdata); 21 22 if($_POST['selectedID']){ 23 foreach($_POST['selectedID'] as $z){ 24 $includes.=$z.","; 25 } 26 $includes=substr($includes,0,-1); 27 update_option('wp-titlecloud_pages', $includes); 28 }else{ 29 update_option('wp-titlecloud_pages',0); 30 } 21 31 ?> 22 <div class="updated"><p><strong><?php _e('Options saved.' ); ?></strong></p></div>32 <?php $message="<div class=\"updated\"><p><strong>Options Saved</strong></p><p>$string</p></div>"; ?> 23 33 <?php 24 34 } else { 25 35 //Normal page display 26 36 $area=get_option('wp-titlecloud_area'); 27 $ excludes=get_option('wp-titlecloud_excludes');37 $includes=get_option('wp-titlecloud_pages'); 28 38 $oProperty= json_decode(get_option('wp-titlecloud_styles')); 29 39 30 40 } 31 41 42 43 $allactivepagesquery = "SELECT ID,post_title from $wpdb->posts where post_status='publish' 44 "; 45 $includesArray=explode(',',$includes); 46 $allactivepages = $wpdb->get_results($allactivepagesquery, OBJECT); 47 $options=""; 48 foreach($allactivepages as $x){ 49 if(in_array($x->ID,$includesArray)){ 50 $checked="checked='checked'"; 51 }else{ 52 $checked=""; 53 } 54 $options.="<input type='checkbox' name='selectedID[]' value='$x->ID' $checked />($x->ID)$x->post_title<br />"; 55 } 56 32 57 33 58 ?> 34 59 <?php echo $message;?> 35 60 <div class="wrap"> 36 61 <?php echo "<h2>" . __( 'Display Options', 'titlecloud_admin' ) . "</h2>"; ?> … … 47 72 48 73 Automatically Add Pages: <select name="ddlAuto"> 74 <option value="1" <?php echo ($oProperty->auto=='1')?'selected':'' ?> >True</option> 49 75 <option value="0" <?php echo ($oProperty->auto=='0')?'selected':'' ?> >False</option> 50 <option value="1" <?php echo ($oProperty->auto=='1')?'selected':'' ?> >True</option>51 76 </select><br /> 52 <p>If you want to set it to manual, just add bezoekers in postmeta inside the page and put a value of 1</p> 53 select pages to exclude: <input type="text" name="txtExcludes" value="<?php echo $excludes ?>" size="60" /> (e.g 1,2,4) 54 </p> 77 <table width="100%" style="min-height: 300px;" cellpadding="0" cellspacing="0" border="1"> 78 <tr> 79 <td width="50%"> 80 Please check the pages to include:<br /> 81 <?php echo $options; ?> 82 </td> 83 <td></td> 84 </tr> 85 </table> 86 87 </p> 55 88 <p> 56 89 <h2>Style options</h2>
Note: See TracChangeset
for help on using the changeset viewer.