PluginProbe
SQL Chart Builder / 3.0.6
SQL Chart Builder v3.0.6
3.0.6 3.0.5 3.0.4 3.0.3 3.0.2 3.0.1 trunk 1.0.2 1.0.3 2.2.2 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.7.1 2.3.7.2 2.3.8 3.0.0
← All changes | admin_metabox.php +20 -0 3.0.23.0.6 View file →
@@ -172,8 +172,9 @@
172 172 <textarea name="guaven_sqlcharts_variables" id="guaven_sqlcharts_variables" class="gvnsql-raw" rows="2"><?php
173 173 echo esc_textarea(trim($gvnsql_meta('guaven_sqlcharts_variables')));
174 174 ?></textarea>
175 175 <p class="gvnsql-hint gvnsql-raw">Raw format: <i>name~default~label~type | name~default~label~type</i> (type: text, number or date)</p>
176 + <p class="gvnsql-hint">Tag names become URL parameters on your site, so avoid names WordPress already uses (for example <code>post_type</code>, <code>p</code>, <code>s</code>, <code>cat</code>, <code>author</code>, <code>name</code>); prefer something like <code>ptype</code>.</p>
176 177
177 178 <div class="gvnsql-grid2" style="margin-top:14px">
178 179 <div class="gvnsql-field">
179 180 <label>Visibility</label>
@@ -243,9 +244,14 @@
243 244 <label class="gvnsql-inlinecheck"><input type="checkbox" name="guaven_sqlcharts_round_y_values" value="1"
244 245 <?php echo $gvnsql_meta('guaven_sqlcharts_round_y_values') !== '' ? 'checked' : ''; ?>> Show only round numbers on the Y axis</label>
245 246 <label class="gvnsql-inlinecheck"><input type="checkbox" name="guaven_sqlcharts_nostacked" value="1"
246 247 <?php echo $gvnsql_meta('guaven_sqlcharts_nostacked') !== '' ? 'checked' : ''; ?>> Disable stacking of multiple datasets (Bar charts)</label>
248 + <label class="gvnsql-inlinecheck"><input type="checkbox" name="guaven_sqlcharts_timeaxis" value="1"
249 + <?php echo $gvnsql_meta('guaven_sqlcharts_timeaxis') !== '' ? 'checked' : ''; ?>> Scale X axis by date/time (Bar and Line charts)</label>
247 250 </div>
251 + <p class="gvnsql-hint">Date/time scaling places each point by real elapsed time instead of equal steps. X values must be dates such as
252 + <code>2024-02-23</code>, <code>2024-02</code>, <code>2024</code> or <code>2024-02-23 14:30</code>. If any X value is not a date, the normal axis is used.
253 + Bars are sized from the closest pair of dates, so very uneven gaps produce thin bars.</p>
248 254
249 255 <h4 class="gvnsql-step">Remote MySQL database (optional)</h4>
250 256 <p class="gvnsql-hint">Leave all fields empty to use this WordPress site's own database.</p>
251 257 <div class="gvnsql-grid2">
@@ -310,12 +316,26 @@
310 316 </h4>
311 317 <p>Note: Shortcodes support width and height attributes, f.e. [gvn_schart<?php
312 318 echo esc_attr($postfix);
313 319 ?> id="1" width="500" height="400"]. Without attributes, the width/height from the Style tab is used.
320 +<?php
321 + preg_match_all('/\{arg([0-9]+)\}/', guaven_sqlcharts_get_code($post->ID), $gvnsql_argtags);
322 + $gvnsql_argtags = array_unique($gvnsql_argtags[1]);
323 + sort($gvnsql_argtags);
324 + if (!empty($gvnsql_argtags)) {
325 + $gvnsql_argexample = '';
326 + foreach ($gvnsql_argtags as $gvnsql_argn) $gvnsql_argexample .= ' arg' . (int) $gvnsql_argn . '="..."';
327 +?>
328 +<br><br><strong>This query uses shortcode arguments.</strong> Pass the values in the shortcode:
329 +[gvn_schart<?php echo esc_attr($postfix); ?> id="<?php echo esc_attr($post->ID); ?>"<?php echo esc_html($gvnsql_argexample); ?>].
330 +The live preview below runs without them (every {arg} is 0), so check the real result on a page or post.
331 +<?php } ?>
314 332 </div>
315 333 <hr>
316 334 <h3 id="sqldemo" name="sqldemo">Live Preview <small style="font-weight:normal">(reflects the last saved state — press Update to refresh)</small></h3>
317 335 <?php
336 + $GLOBALS['guaven_sqlcharts_admin_preview'] = true; // filter inputs render disabled, see gvn_chart_top_form()
318 337 echo do_shortcode('[gvn_schart' . esc_attr($postfix) . ' id="' . esc_attr($post->ID) . '" ' . ($gvnsql_meta('guaven_sqlcharts_tablepart') !== '' ? ' table="1"' : '') . ']');
338 + $GLOBALS['guaven_sqlcharts_admin_preview'] = false;
319 339
320 340 }
321 341 ?>