Plugin Directory

Changeset 346475


Ignore:
Timestamp:
02/16/2011 04:41:20 PM (15 years ago)
Author:
burtadem
Message:
 
Location:
wordpress-title-cloud/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • wordpress-title-cloud/trunk/readme.txt

    r344392 r346475  
    44Tags: title cloud,tag cloud
    55Requires at least: 3.0
    6 Tested up to: 3.0.5
    7 Stable tag: 0.9.8
     6Tested up to: 3.1
     7Stable tag: 0.9.9
    88
    99Act as a tag cloud but instead of showing tag, it shows the title of pages.
     
    3232
    3333== 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
    3438
    3539= 0.9.8 =
  • wordpress-title-cloud/trunk/wordpress-title-cloud.php

    r344392 r346475  
    66   
    77    $oStyle= json_decode(get_option('wp-titlecloud_styles'));   
    8     $excludes=get_option('wp-titlecloud_excludes');
     8    $includes=get_option('wp-titlecloud_pages');
    99    global $wpdb;
    1010   
     
    2727        ON wposts.ID = wpostmeta.post_id
    2828        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})
    3230        ORDER BY wposts.post_date DESC
    3331        ";
     
    5755                    if($oStyle->auto=='1'){
    5856                    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                            }
    5962                    }else{
    6063                    add_post_meta($id, "bezoekers", 0);
     
    7578                ";
    7679        }
     80       
     81       
     82       
    7783           
    7884}
  • wordpress-title-cloud/trunk/wp-titlecloud.php

    r344392 r346475  
    22/**
    33 * @package Wordpress Title Cloud
    4  * @version 0.9.8
     4 * @version 0.9.9
    55 */
    66/*
     
    99Description: An Idea of Displaying texts as tag cloud using your page titles.
    1010Author: Burt Adem
    11 Version: 0.9.8
     11Version: 0.9.9
    1212Author URI: http://burtadem.com/
    1313*/
     
    1515$oTitleCloud = new wordpress_title_cloud();
    1616
     17
    1718function 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); }
    1920}
    2021add_action('wp_head', 'wpttlcloud_headHook');
  • wordpress-title-cloud/trunk/wp-titlecloudadmin.php

    r344392 r346475  
    11   <?php 
     2   global $wpdb;
    23       if($_POST['txtHidden'] == 'Y') { 
    34           //Form data sent 
     
    1516           
    1617            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));
    1919            $jdata=json_encode($aProperty);
    2020            $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            }
    2131           ?> 
    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>";  ?
    2333           <?php 
    2434       } else { 
    2535           //Normal page display 
    2636           $area=get_option('wp-titlecloud_area');
    27            $excludes=get_option('wp-titlecloud_excludes');
     37           $includes=get_option('wp-titlecloud_pages');
    2838           $oProperty= json_decode(get_option('wp-titlecloud_styles'));
    2939           
    3040       } 
    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       
    3257       
    3358   ?> 
    34 
     59    <?php echo $message;?>
    3560   <div class="wrap"> 
    3661      <?php    echo "<h2>" . __( 'Display Options', 'titlecloud_admin' ) . "</h2>"; ?> 
     
    4772               
    4873                Automatically Add Pages: <select name="ddlAuto">
     74                                        <option value="1" <?php echo ($oProperty->auto=='1')?'selected':'' ?> >True</option>
    4975                                        <option value="0" <?php echo ($oProperty->auto=='0')?'selected':'' ?> >False</option>
    50                                         <option value="1" <?php echo ($oProperty->auto=='1')?'selected':'' ?> >True</option>
    5176                                        </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>
    5588           <p>
    5689           <h2>Style options</h2>               
Note: See TracChangeset for help on using the changeset viewer.