Changeset 492167 for theme-tuner
- Timestamp:
- 01/19/2012 03:45:45 PM (13 years ago)
- Location:
- theme-tuner/trunk
- Files:
-
- 4 added
- 1 deleted
- 8 edited
-
. (modified) (1 prop)
-
ajax/index.php (added)
-
ajax/savetag.php (modified) (1 diff)
-
extensions/posts_table.php (modified) (3 diffs)
-
extensions/subpages.php (modified) (1 diff)
-
includes (added)
-
includes/index.php (added)
-
includes/support-us.inc.php (added)
-
index.php (modified) (3 diffs)
-
js/themez.jquery.js (modified) (4 diffs)
-
readme.txt (modified) (4 diffs)
-
support-us.inc.php (deleted)
-
tt_cp.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
theme-tuner/trunk
- Property svn:ignore
-
old new 3 3 build.xml 4 4 .externalToolBuilders 5 .settings
-
- Property svn:ignore
-
theme-tuner/trunk/ajax/savetag.php
r250646 r492167 1 1 <?php 2 require($_POST['tt-abspath'].'/wp-blog-header.php');3 2 4 3 $tt=new ttCss(); 5 4 $tt->add($_REQUEST); 6 5 echo $tt->render(); 6 7 7 ?> -
theme-tuner/trunk/extensions/posts_table.php
r365317 r492167 19 19 20 20 function tt_posts_table_content($content) { 21 global $post; 21 22 if (preg_match('/\[theme-tuner:(.*)\]/',$content,$matches)==1) { 22 23 $new=''; … … 24 25 if ($params[0]=='posts_table') { 25 26 $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'); 27 29 while ($my_query->have_posts()) { 28 $ my_query->the_post();30 $p=$my_query->the_post(); 29 31 $post_id=get_the_ID(); 32 $custom_field_keys = get_post_custom($post_id); 30 33 $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 } 34 48 $new.='<td class="tt_col_image">'; 35 49 $new.='<img src="'.catch_that_image(get_the_content()).'" />'; 36 50 $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>'; 38 54 $new.='<td class="tt_col_excerpt">'; 39 $new.= get_the_excerpt();55 $new.=$post->post_excerpt; 40 56 $new.='</td>'; 41 $custom_field_keys = get_post_custom($post_id);42 57 foreach ( $custom_field_keys as $key => $values ) { 43 if ( '_' != $key{0} ) {58 if ( '_' != $key{0} && $key != 'ID') { 44 59 $new.='<td class="tt_col_'.$key.'">'; 45 60 $new.=$values[0]; … … 65 80 return $first_img; 66 81 } 82 83 // get the first PDF attached to the current post 84 function 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 33 33 function tt_subpages_init() 34 34 { 35 register_sidebar_widget(__('Theme Tuner Subpages'), 'tt_subpages');35 wp_register_sidebar_widget('theme-tuner',__('Theme Tuner Subpages'), 'tt_subpages'); 36 36 } 37 37 add_action("plugins_loaded", "tt_subpages_init"); -
theme-tuner/trunk/index.php
r365317 r492167 1 <?php2 /* index.php3 Copyright 2010,2011 Erik Bogaerts4 Support site: http://www.choppedcode.com5 6 This file is part of Theme Tuner.7 8 Theme Tuner is free software; you can redistribute it and/or modify9 it under the terms of the GNU General Public License as published by10 the Free Software Foundation; either version 2 of the License, or11 (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 of15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16 GNU General Public License for more details.17 18 You should have received a copy of the GNU General Public License19 along with Theme Tuner; if not, write to the Free Software20 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA21 */22 ?>23 1 <?php 24 2 /* 25 3 Plugin Name: Theme Tuner 26 Plugin URI: http://www. choppedcode.com4 Plugin URI: http://www.zingiri.com 27 5 Description: Theme Tuner is a plugin that allows you to edit in real-time the look-and-feel of your site. 28 Author: EBO29 Version: 0. 730 Author URI: http://www. choppedcode.com/6 Author: Zingiri 7 Version: 0.8 8 Author URI: http://www.zingiri.com/ 31 9 */ 32 33 //error_reporting(E_ALL & ~E_NOTICE);34 //ini_set('display_errors', '1');35 36 10 37 11 if (!defined("ZING_THEMEZ_PLUGIN")) { … … 61 35 if (!$zing_tt) return; 62 36 echo '<script type="text/javascript" language="javascript">'; 63 echo "var ttURL='". ZING_THEMEZ_URL."';";37 echo "var ttURL='".get_home_url()."/';"; 64 38 echo "var ttABSPATH='".ABSPATH."';"; 65 39 echo '</script>'; … … 79 53 function zing_themez_init() { 80 54 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; 83 62 if ($zing_tt) { 84 63 wp_enqueue_script('jquery'); -
theme-tuner/trunk/js/themez.jquery.js
r336175 r492167 1 jQuery.fn.tagName = function() { 2 return this.get(0).tagName; 3 } 4 1 5 var themez = { 2 6 t : false, … … 63 67 form = jQuery('#tt-sidebar-form'); 64 68 new jQuery.ajax({ 65 url : ttURL+' ajax/savetag.php',69 url : ttURL+'?tt-page=savetag', 66 70 type : "post", 67 71 data : form.serialize(true), … … 81 85 this.curdiv=e; 82 86 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 } 85 94 jQuery('#tt-id').attr('value',id); 86 95 jQuery('#tt-class').attr('value',cls); … … 98 107 themez.init(); 99 108 }); 109 -
theme-tuner/trunk/readme.txt
r365317 r492167 1 1 === Theme Tuner === 2 2 Contributors: EBO 3 Donate link: http://www. choppedcode.com/3 Donate link: http://www.zingiri.com/donations 4 4 Tags: theme, css 5 5 Requires at least: 2.1.7 6 Tested up to: 3.1 7 Stable tag: 0.7 8 6 Tested up to: 3.3.1 7 Stable tag: 0.8 9 8 10 9 Theme Tuner is a plugin that allows you to edit in real-time the look-and-feel of your site. … … 24 23 4. To use the extensions and widgets, please consult the respective tabs 25 24 26 Please visit the [ ChoppedCode](http://www.choppedcode.com "ChoppedCode") website for more information.25 Please visit the [Zingiri](http://www.zingiri.com "Zingiri") website for more information. 27 26 28 27 == Frequently Asked Questions == 29 28 30 Please visit the [ ChoppedCode](http://www.choppedcode.com "ChoppedCode") website for more information.29 Please visit the [Zingiri](http://www.zingiri.com "Zingiri") website for more information. 31 30 32 31 = Widgets area extension = … … 57 56 == Screenshots == 58 57 59 Please visit the [ ChoppedCode](http://www.choppedcode.com "ChoppedCode") website for more information.58 Please visit the [Zingiri](http://www.zingiri.com "Zingiri") website for more information. 60 59 61 60 == Upgrade notice == … … 66 65 67 66 == 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 68 73 69 74 = 0.7 = -
theme-tuner/trunk/tt_cp.php
r348007 r492167 3 3 4 4 function 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'); 6 6 } 7 7 8 8 function zing_tt_cp_settings() { 9 session_start();9 if (!session_id()) @session_start(); 10 10 echo '<div class="wrap">'; 11 11 echo '<div id="cc-left" style="position:relative;float:left;width:70%">'; 12 12 echo '<h3>Settings</h3>'; 13 13 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')) { 16 16 $newstatus='Off'; 17 17 } else { 18 18 $newstatus='On'; 19 19 } 20 echo '<form method="post" action="?page= choppedcode-tt">';20 echo '<form method="post" action="?page=tt-admin">'; 21 21 echo '<input type="submit" name="tt-new-status" value="'.$newstatus.'" />'; 22 22 echo '</form>'; 23 23 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>'; 26 26 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); 28 30 echo '</div>'; 29 31 }
Note: See TracChangeset
for help on using the changeset viewer.