WordPress.org

Plugin Directory

Changeset 492167 for theme-tuner


Ignore:
Timestamp:
01/19/12 15:45:45 (6 years ago)
Author:
erikpbogaerts
Message:

0.8

Location:
theme-tuner/trunk
Files:
4 added
1 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • theme-tuner/trunk

    • Property svn:ignore
      •  

        old new  
        33build.xml 
        44.externalToolBuilders 
         5.settings 
  • theme-tuner/trunk/ajax/savetag.php

    r250646 r492167  
    11<?php 
    2 require($_POST['tt-abspath'].'/wp-blog-header.php'); 
    32 
    43$tt=new ttCss(); 
    54$tt->add($_REQUEST); 
    65echo $tt->render(); 
     6 
    77?> 
  • theme-tuner/trunk/extensions/posts_table.php

    r365317 r492167  
    1919 
    2020function tt_posts_table_content($content) { 
     21    global $post; 
    2122    if (preg_match('/\[theme-tuner:(.*)\]/',$content,$matches)==1) { 
    2223        $new=''; 
     
    2425        if ($params[0]=='posts_table') { 
    2526            $new.='<table class="tt-posts_table">'; 
    26             $my_query = new WP_Query('category_name= '.$params[1]); 
     27            if ($params[1]) $my_query = new WP_Query('category_name= '.$params[1]); 
     28            else $my_query = new WP_Query('cat=0'); 
    2729            while ($my_query->have_posts()) { 
    28                 $my_query->the_post(); 
     30                $p=$my_query->the_post(); 
    2931                $post_id=get_the_ID(); 
     32                $custom_field_keys = get_post_custom($post_id); 
    3033                $new.='<tr>'; 
    31                 $new.='<td class="tt_col_id">'; 
    32                 $new.=get_the_ID(); 
    33                 $new.='</td>'; 
     34                $idSet=false; 
     35                foreach ( $custom_field_keys as $key => $values ) { 
     36                    if ( '_' != $key{0} && $key == 'ID') { 
     37                        $new.='<td class="tt_col_'.$key.'">'; 
     38                        $new.=$values[0]; 
     39                        $new.='</td>'; 
     40                        $idSet=true; 
     41                    } 
     42                } 
     43                if (!$idSet) { 
     44                    $new.='<td class="tt_col_id">'; 
     45                    $new.=get_the_ID(); 
     46                    $new.='</td>'; 
     47                } 
    3448                $new.='<td class="tt_col_image">'; 
    3549                $new.='<img src="'.catch_that_image(get_the_content()).'" />'; 
    3650                $new.='</td>'; 
    37                 $new.='<td class="tt_col_title"><a href="'.get_permalink().'" title="'.get_the_title().'">'.get_the_title().'</a></td>'; 
     51                $pdf=tt_get_post_pdf(); 
     52                if ($pdf) $new.='<td class="tt_col_title"><a href="'.$pdf.'" target="_blank" title="'.get_the_title().'">'.get_the_title().'</a></td>'; 
     53                else $new.='<td class="tt_col_title"><a href="'.get_permalink().'" title="'.get_the_title().'">'.get_the_title().'</a></td>'; 
    3854                $new.='<td class="tt_col_excerpt">'; 
    39                 $new.=get_the_excerpt(); 
     55                $new.=$post->post_excerpt; 
    4056                $new.='</td>'; 
    41                 $custom_field_keys = get_post_custom($post_id); 
    4257                foreach ( $custom_field_keys as $key => $values ) { 
    43                     if ( '_' != $key{0} ) { 
     58                    if ( '_' != $key{0} && $key != 'ID') { 
    4459                        $new.='<td class="tt_col_'.$key.'">'; 
    4560                        $new.=$values[0]; 
     
    6580    return $first_img; 
    6681} 
     82 
     83// get the first PDF attached to the current post 
     84function tt_get_post_pdf() { 
     85    global $post; 
     86 
     87    $attachments = get_children( array('post_parent' => $post->ID, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'application/pdf', 'order' => 'ASC', 'orderby' => 'menu_order ID') ); 
     88 
     89    if ($attachments) { 
     90        $attachment = array_shift($attachments); 
     91        return wp_get_attachment_url($attachment->ID); 
     92    } 
     93 
     94    return false; 
     95} 
  • theme-tuner/trunk/extensions/subpages.php

    r343943 r492167  
    3333function tt_subpages_init() 
    3434{ 
    35     register_sidebar_widget(__('Theme Tuner Subpages'), 'tt_subpages'); 
     35    wp_register_sidebar_widget('theme-tuner',__('Theme Tuner Subpages'), 'tt_subpages'); 
    3636} 
    3737add_action("plugins_loaded", "tt_subpages_init"); 
  • theme-tuner/trunk/index.php

    r365317 r492167  
    1 <?php 
    2 /*  index.php 
    3  Copyright 2010,2011 Erik Bogaerts 
    4  Support site: http://www.choppedcode.com 
    5  
    6  This file is part of Theme Tuner. 
    7  
    8  Theme Tuner is free software; you can redistribute it and/or modify 
    9  it under the terms of the GNU General Public License as published by 
    10  the Free Software Foundation; either version 2 of the License, or 
    11  (at your option) any later version. 
    12  
    13  Theme Tuner is distributed in the hope that it will be useful, 
    14  but WITHOUT ANY WARRANTY; without even the implied warranty of 
    15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    16  GNU General Public License for more details. 
    17  
    18  You should have received a copy of the GNU General Public License 
    19  along with Theme Tuner; if not, write to the Free Software 
    20  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA 
    21  */ 
    22 ?> 
    231<?php 
    242/* 
    253 Plugin Name: Theme Tuner 
    26  Plugin URI: http://www.choppedcode.com 
     4 Plugin URI: http://www.zingiri.com 
    275 Description: Theme Tuner is a plugin that allows you to edit in real-time the look-and-feel of your site. 
    28  Author: EBO 
    29  Version: 0.7 
    30  Author URI: http://www.choppedcode.com/ 
     6 Author: Zingiri 
     7 Version: 0.8 
     8 Author URI: http://www.zingiri.com/ 
    319 */ 
    32  
    33 //error_reporting(E_ALL & ~E_NOTICE); 
    34 //ini_set('display_errors', '1'); 
    35  
    3610 
    3711if (!defined("ZING_THEMEZ_PLUGIN")) { 
     
    6135    if (!$zing_tt) return; 
    6236    echo '<script type="text/javascript" language="javascript">'; 
    63     echo "var ttURL='".ZING_THEMEZ_URL."';"; 
     37    echo "var ttURL='".get_home_url()."/';"; 
    6438    echo "var ttABSPATH='".ABSPATH."';"; 
    6539    echo '</script>'; 
     
    7953function zing_themez_init() { 
    8054    global $zing_tt; 
    81     session_start(); 
    82     if ($_SESSION['zing']['tt']['status']=="On") $zing_tt=true; else $zing_tt=false; 
     55    if (!session_id()) session_start(); 
     56    if (isset($_REQUEST['tt-page']) && ($_REQUEST['tt-page']=='savetag')) { 
     57        ob_end_clean(); 
     58        require(dirname(__FILE__).'/ajax/savetag.php'); 
     59        die(); 
     60    } 
     61    if (isset($_SESSION['zing']['tt']['status']) && ($_SESSION['zing']['tt']['status']=="On")) $zing_tt=true; else $zing_tt=false; 
    8362    if ($zing_tt) { 
    8463        wp_enqueue_script('jquery'); 
  • theme-tuner/trunk/js/themez.jquery.js

    r336175 r492167  
     1jQuery.fn.tagName = function() { 
     2    return this.get(0).tagName; 
     3} 
     4 
    15var themez = { 
    26    t : false, 
     
    6367        form = jQuery('#tt-sidebar-form'); 
    6468        new jQuery.ajax({ 
    65             url : ttURL+'ajax/savetag.php', 
     69            url : ttURL+'?tt-page=savetag', 
    6670            type : "post", 
    6771            data : form.serialize(true), 
     
    8185        this.curdiv=e; 
    8286        this.curclr=e.css('background-color'); 
    83         var tag=e.attr('tagName').toLowerCase(); 
    84         jQuery('#tt-tag').attr('value',tag); 
     87        if (e.tagName()) { 
     88            var tag=e.tagName().toLowerCase(); 
     89            jQuery('#tt-tag').attr('value',tag); 
     90        } else { 
     91            this.t=false; 
     92            return false; 
     93        } 
    8594        jQuery('#tt-id').attr('value',id); 
    8695        jQuery('#tt-class').attr('value',cls); 
     
    98107    themez.init(); 
    99108}); 
     109 
  • theme-tuner/trunk/readme.txt

    r365317 r492167  
    11=== Theme Tuner === 
    22Contributors: EBO 
    3 Donate link: http://www.choppedcode.com/ 
     3Donate link: http://www.zingiri.com/donations 
    44Tags: theme, css 
    55Requires at least: 2.1.7 
    6 Tested up to: 3.1 
    7 Stable tag: 0.7 
    8  
     6Tested up to: 3.3.1 
     7Stable tag: 0.8 
    98 
    109Theme Tuner is a plugin that allows you to edit in real-time the look-and-feel of your site. 
     
    24234. To use the extensions and widgets, please consult the respective tabs 
    2524 
    26 Please visit the [ChoppedCode](http://www.choppedcode.com "ChoppedCode") website for more information. 
     25Please visit the [Zingiri](http://www.zingiri.com "Zingiri") website for more information. 
    2726 
    2827== Frequently Asked Questions == 
    2928 
    30 Please visit the [ChoppedCode](http://www.choppedcode.com "ChoppedCode") website for more information. 
     29Please visit the [Zingiri](http://www.zingiri.com "Zingiri") website for more information. 
    3130 
    3231= Widgets area extension = 
     
    5756== Screenshots == 
    5857 
    59 Please visit the [ChoppedCode](http://www.choppedcode.com "ChoppedCode") website for more information. 
     58Please visit the [Zingiri](http://www.zingiri.com "Zingiri") website for more information. 
    6059 
    6160== Upgrade notice == 
     
    6665 
    6766== Changelog == 
     67 
     68= 0.8 = 
     69* Added option to specify ID special field in Posts Table extension 
     70* In Posts Table extension, excerpt displays now an empty field if no excerpt is defined 
     71* Fixed security issue 
     72* Verified compatibility with Wordpress 3.3.1 
    6873 
    6974= 0.7 = 
  • theme-tuner/trunk/tt_cp.php

    r348007 r492167  
    33 
    44function zing_tt_cp() { 
    5     add_options_page("Theme Tuner Options", "Theme Tuner", 8, 'choppedcode-tt', 'zing_tt_cp_settings'); 
     5    add_options_page("Theme Tuner Options", "Theme Tuner", 'manage_options', 'tt-admin', 'zing_tt_cp_settings'); 
    66} 
    77 
    88function zing_tt_cp_settings() { 
    9     session_start(); 
     9    if (!session_id()) @session_start(); 
    1010    echo '<div class="wrap">'; 
    1111    echo '<div id="cc-left" style="position:relative;float:left;width:70%">'; 
    1212    echo '<h3>Settings</h3>'; 
    1313    echo "You can turn the theme tuner editor on and off for the duration of a session.<br />"; 
    14     if ($_POST['tt-new-status']) $_SESSION['zing']['tt']['status']=$_POST['tt-new-status']; 
    15     if ($_SESSION['zing']['tt']['status']=='On') { 
     14    if (isset($_POST['tt-new-status']) && $_POST['tt-new-status']) $_SESSION['zing']['tt']['status']=$_POST['tt-new-status']; 
     15    if (isset($_SESSION['zing']['tt']['status']) && ($_SESSION['zing']['tt']['status']=='On')) { 
    1616        $newstatus='Off'; 
    1717    } else { 
    1818        $newstatus='On'; 
    1919    } 
    20     echo '<form method="post" action="?page=choppedcode-tt">'; 
     20    echo '<form method="post" action="?page=tt-admin">'; 
    2121    echo '<input type="submit" name="tt-new-status" value="'.$newstatus.'" />'; 
    2222    echo '</form>'; 
    2323    echo '<h3>Help</h3>'; 
    24     echo 'Shortcodes for using the extensions are documented on our site. Simply click the image below.<br /><br />'; 
    25     echo '<a href="http://www.choppedcode.com/products/theme-tuner/"><img src="http://www.choppedcode.com/wp/wp-content/uploads/code3.png"></img></a>'; 
     24    echo 'Shortcodes for using the extensions are <a href="http://www.zingiri.com/plugins-and-addons/theme-tuner/">documented on our site</a>.<br /><br />'; 
     25    echo '<img src="http://www.zingiri.com/logo.png"></img>'; 
    2626    echo '</div>'; 
    27     require(dirname(__FILE__).'/support-us.inc.php'); 
     27    require(dirname(__FILE__).'/includes/support-us.inc.php'); 
     28    //  function zing_support_us($shareName,$wpPluginName,$adminLink,$version,$donations=true) { 
     29    zing_support_us('Theme Tuner','theme-tuner','tt-admin',null); 
    2830    echo '</div>'; 
    2931} 
Note: See TracChangeset for help on using the changeset viewer.