Version Description
Download this release
Release Info
Developer | artstorm |
Plugin | Post Snippets |
Version | 1.4.1 |
Comparing to | |
See all releases |
Code changes from version 1.4 to 1.4.1
- post-snippets.php +7 -7
- readme.txt +4 -1
- tinymce/window.php +10 -10
post-snippets.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Post Snippets
|
4 |
Plugin URI: http://coding.cglounge.com/wordpress-plugins/post-snippets/
|
5 |
Description: Stores snippets of HTML code or reoccurring text that you often use in your posts. You can use predefined variables to replace parts of the snippet on insert. All snippets are available in the post editor with a TinyMCE button or Quicktags.
|
6 |
-
Version: 1.4
|
7 |
Author: Johan Steen
|
8 |
Author URI: http://coding.cglounge.com/
|
9 |
Text Domain: post-snippets
|
@@ -308,12 +308,12 @@ class postSnippets {
|
|
308 |
if (!empty($snippets)) {
|
309 |
for ($i=0; $i < count($snippets); $i++) { ?>
|
310 |
<tr class='recent'>
|
311 |
-
<th scope='row' class='check-column'><input type='checkbox' name='checked[]' value='
|
312 |
-
<td class='row-title'><input type='text' name='
|
313 |
-
<td class='name'><input type='text' name='
|
314 |
-
<td class='desc'><textarea name="
|
315 |
-
<td class='name'><input type='checkbox' name='
|
316 |
-
<td class='name'><input type='checkbox' name='
|
317 |
</tr>
|
318 |
<?php
|
319 |
}
|
3 |
Plugin Name: Post Snippets
|
4 |
Plugin URI: http://coding.cglounge.com/wordpress-plugins/post-snippets/
|
5 |
Description: Stores snippets of HTML code or reoccurring text that you often use in your posts. You can use predefined variables to replace parts of the snippet on insert. All snippets are available in the post editor with a TinyMCE button or Quicktags.
|
6 |
+
Version: 1.4.1
|
7 |
Author: Johan Steen
|
8 |
Author URI: http://coding.cglounge.com/
|
9 |
Text Domain: post-snippets
|
308 |
if (!empty($snippets)) {
|
309 |
for ($i=0; $i < count($snippets); $i++) { ?>
|
310 |
<tr class='recent'>
|
311 |
+
<th scope='row' class='check-column'><input type='checkbox' name='checked[]' value='<? echo $i; ?>' /></th>
|
312 |
+
<td class='row-title'><input type='text' name='<? echo $i; ?>_title' value='<? echo $snippets[$i]['title']; ?>' /></td>
|
313 |
+
<td class='name'><input type='text' name='<? echo $i; ?>_vars' value='<? echo $snippets[$i]['vars']; ?>' /></td>
|
314 |
+
<td class='desc'><textarea name="<? echo $i; ?>_snippet" class="large-text" rows="3"><? echo $snippets[$i]['snippet']; ?></textarea></td>
|
315 |
+
<td class='name'><input type='checkbox' name='<? echo $i; ?>_shortcode' value='true'<? if ($snippets[$i]['shortcode'] == true) { echo " checked"; }?> /></td>
|
316 |
+
<td class='name'><input type='checkbox' name='<? echo $i; ?>_quicktag' value='true'<? if ($snippets[$i]['quicktag'] == true) { echo " checked"; }?> /></td>
|
317 |
</tr>
|
318 |
<?php
|
319 |
}
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://coding.cglounge.com/wordpress-plugins/post-snippets/#pintwar
|
|
4 |
Tags: post, admin, snippet, html, custom, page, dynamic, editor, quicktag
|
5 |
Requires at least: 2.7
|
6 |
Tested up to: 2.7.1
|
7 |
-
Stable tag: 1.4
|
8 |
|
9 |
Store snippets of HTML code or reoccurring text that you often use in your posts. Custom variables can be used.
|
10 |
|
@@ -47,6 +47,9 @@ Meditation.
|
|
47 |
|
48 |
== Changelog ==
|
49 |
|
|
|
|
|
|
|
50 |
= Version 1.4 - 10 Apr 2009 =
|
51 |
* Added a checkbox for Shortcodes (SC) in the admin panel. When checking this one a dynamic shortcode will be generated and inserted instead of the snippet, which allows snippets to be updated later on for all posts it's been inserted into when using this option.
|
52 |
* Added a checkbox for Quicktags (QT) in the admin panel, so Quicktags are optional. Speeds up loading of the post editor if you don't need the quicktag support, and only use the visual editor. Defaults to off.
|
4 |
Tags: post, admin, snippet, html, custom, page, dynamic, editor, quicktag
|
5 |
Requires at least: 2.7
|
6 |
Tested up to: 2.7.1
|
7 |
+
Stable tag: 1.4.1
|
8 |
|
9 |
Store snippets of HTML code or reoccurring text that you often use in your posts. Custom variables can be used.
|
10 |
|
47 |
|
48 |
== Changelog ==
|
49 |
|
50 |
+
= Version 1.4.1 - 10 Apr 2009 =
|
51 |
+
* Bugfix: Removed all short syntax commands and replaced them with the full versions so the plugin also works on servers with the short_open_tag configuration setting disabled.
|
52 |
+
|
53 |
= Version 1.4 - 10 Apr 2009 =
|
54 |
* Added a checkbox for Shortcodes (SC) in the admin panel. When checking this one a dynamic shortcode will be generated and inserted instead of the snippet, which allows snippets to be updated later on for all posts it's been inserted into when using this option.
|
55 |
* Added a checkbox for Quicktags (QT) in the admin panel, so Quicktags are optional. Speeds up loading of the post editor if you don't need the quicktag support, and only use the visual editor. Defaults to off.
|
tinymce/window.php
CHANGED
@@ -42,7 +42,7 @@ if ( !is_user_logged_in() || !current_user_can('edit_posts') )
|
|
42 |
<?php
|
43 |
$snippets = get_option($postSnippets->plugin_options);
|
44 |
for ($i = 0; $i < count($snippets); $i++) { ?>
|
45 |
-
var panel
|
46 |
<?php } ?>
|
47 |
|
48 |
var rss = document.getElementById('ps_panel0');
|
@@ -54,7 +54,7 @@ if ( !is_user_logged_in() || !current_user_can('edit_posts') )
|
|
54 |
$theString = str_replace('"','\"',str_replace(Chr(13), '', str_replace(Chr(10), '', $snippets[$i]['snippet'])))
|
55 |
?>
|
56 |
|
57 |
-
if (panel
|
58 |
<?php
|
59 |
if ($snippets[$i]['shortcode']) {
|
60 |
$var_arr = explode(",",$snippets[$i]['vars']);
|
@@ -68,16 +68,16 @@ if ( !is_user_logged_in() || !current_user_can('edit_posts') )
|
|
68 |
}
|
69 |
}
|
70 |
echo "var variables" . $i ." = new Array(".$theVariables.");"; ?>
|
71 |
-
insertString = createShortcode("
|
72 |
<?php }else{ ?>
|
73 |
-
insertString = "
|
74 |
<?php } ?>
|
75 |
<?php
|
76 |
$var_arr = explode(",",$snippets[$i]['vars']);
|
77 |
if (!empty($var_arr[0])) {
|
78 |
for ($j = 0; $j < count($var_arr); $j++) { ?>
|
79 |
-
var var_
|
80 |
-
insertString = insertString.replace(/\{
|
81 |
<?php } } ?>
|
82 |
}
|
83 |
<?php } ?>
|
@@ -108,7 +108,7 @@ if ( !is_user_logged_in() || !current_user_can('edit_posts') )
|
|
108 |
<?php
|
109 |
$snippets = get_option($postSnippets->plugin_options);
|
110 |
for ($i = 0; $i < count($snippets); $i++) { ?>
|
111 |
-
<li id="ps_tab
|
112 |
<?php } ?>
|
113 |
</ul>
|
114 |
</div>
|
@@ -117,7 +117,7 @@ if ( !is_user_logged_in() || !current_user_can('edit_posts') )
|
|
117 |
<?php
|
118 |
$snippets = get_option($postSnippets->plugin_options);
|
119 |
for ($i = 0; $i < count($snippets); $i++) { ?>
|
120 |
-
<div id="ps_panel
|
121 |
<br />
|
122 |
<table border="0" cellpadding="4" cellspacing="0">
|
123 |
<?php
|
@@ -125,8 +125,8 @@ if ( !is_user_logged_in() || !current_user_can('edit_posts') )
|
|
125 |
if (!empty($var_arr[0])) {
|
126 |
for ($j = 0; $j < count($var_arr); $j++) { ?>
|
127 |
<tr>
|
128 |
-
<td nowrap="nowrap"><label for="var_
|
129 |
-
<td><input type="text" id="var_
|
130 |
</td>
|
131 |
</tr>
|
132 |
<?php } } ?>
|
42 |
<?php
|
43 |
$snippets = get_option($postSnippets->plugin_options);
|
44 |
for ($i = 0; $i < count($snippets); $i++) { ?>
|
45 |
+
var panel<? echo $i; ?> = document.getElementById('ps_panel<? echo $i; ?>');
|
46 |
<?php } ?>
|
47 |
|
48 |
var rss = document.getElementById('ps_panel0');
|
54 |
$theString = str_replace('"','\"',str_replace(Chr(13), '', str_replace(Chr(10), '', $snippets[$i]['snippet'])))
|
55 |
?>
|
56 |
|
57 |
+
if (panel<? echo $i; ?>.className.indexOf('current') != -1) {
|
58 |
<?php
|
59 |
if ($snippets[$i]['shortcode']) {
|
60 |
$var_arr = explode(",",$snippets[$i]['vars']);
|
68 |
}
|
69 |
}
|
70 |
echo "var variables" . $i ." = new Array(".$theVariables.");"; ?>
|
71 |
+
insertString = createShortcode("<? echo $snippets[$i]['title']; ?>", variables<? echo $i; ?>);
|
72 |
<?php }else{ ?>
|
73 |
+
insertString = "<? echo $theString; ?>";
|
74 |
<?php } ?>
|
75 |
<?php
|
76 |
$var_arr = explode(",",$snippets[$i]['vars']);
|
77 |
if (!empty($var_arr[0])) {
|
78 |
for ($j = 0; $j < count($var_arr); $j++) { ?>
|
79 |
+
var var_<? echo $i; ?>_<? echo $j; ?> = document.getElementById('var_<? echo $i; ?>_<? echo $j; ?>').value;
|
80 |
+
insertString = insertString.replace(/\{<? echo $var_arr[$j]; ?>\}/g, var_<? echo $i; ?>_<? echo $j; ?>);
|
81 |
<?php } } ?>
|
82 |
}
|
83 |
<?php } ?>
|
108 |
<?php
|
109 |
$snippets = get_option($postSnippets->plugin_options);
|
110 |
for ($i = 0; $i < count($snippets); $i++) { ?>
|
111 |
+
<li id="ps_tab<? echo $i; ?>"<?php if ($i == 0) {?> class="current"><?php } ?><span><a href="javascript:mcTabs.displayTab('ps_tab<? echo $i; ?>','ps_panel<? echo $i; ?>');" onmousedown="return false;"><?php echo $snippets[$i]['title']; ?></a></span></li>
|
112 |
<?php } ?>
|
113 |
</ul>
|
114 |
</div>
|
117 |
<?php
|
118 |
$snippets = get_option($postSnippets->plugin_options);
|
119 |
for ($i = 0; $i < count($snippets); $i++) { ?>
|
120 |
+
<div id="ps_panel<? echo $i; ?>" class="panel<?php if ($i == 0) {?> current<?php } ?>">
|
121 |
<br />
|
122 |
<table border="0" cellpadding="4" cellspacing="0">
|
123 |
<?php
|
125 |
if (!empty($var_arr[0])) {
|
126 |
for ($j = 0; $j < count($var_arr); $j++) { ?>
|
127 |
<tr>
|
128 |
+
<td nowrap="nowrap"><label for="var_<? echo $i; ?>_<? echo $j; ?>"><?php echo($var_arr[$j]);?>:</label></td>
|
129 |
+
<td><input type="text" id="var_<? echo $i; ?>_<? echo $j; ?>" name="var_<? echo $i; ?>_<? echo $j; ?>" style="width: 190px" />
|
130 |
</td>
|
131 |
</tr>
|
132 |
<?php } } ?>
|