/wp-blip-options.php
PHP | 213 lines | 200 code | 7 blank | 6 comment | 9 complexity | 3b1c4c27ff16d3cfe6483d1cd6ca1b85 MD5 | raw file
- <?php
- /*
- * Interface file for WP Blip! Wordpress plugin
- *
- * Author: Marcin Sztolcman (http://urzenia.net)
- * $Id: wp-blip-options.php 98 2010-04-14 23:54:13Z urzenia $
- */
- if (!defined ('WP_BLIP')) exit;
- if (!current_user_can ('manage_options') ) {
- wp_die (__ ('You do not have sufficient permissions to manage options for this blog.'));
- }
- require_once 'wp-blip-common.php';
- $wp_blip_options = wp_blip_get_options ();
- ?>
- <script type="text/javascript">
- function wp_blip_dateformat () {
- jQuery ('#wp_blip_dateformat').attr ('readonly', function () {
- if (jQuery ('#wp_blip_datetype_absolute').attr ('checked')) {
- jQuery ('#wp_blip_dateformat').css ('backgroundColor', 'transparent');
- return '';
- }
- else {
- jQuery ('#wp_blip_dateformat').css ('backgroundColor', '#ccc');
- return 'readonly';
- }
- });
- }
- function wp_blip_absolute_from () {
- jQuery ('#wp_blip_absolute_from').attr ('readonly', function () {
- if (jQuery ('#wp_blip_datetype_absolute').attr ('checked')) {
- jQuery ('#wp_blip_absolute_from').css ('backgroundColor', '#ccc');
- return 'readonly';
- }
- else {
- jQuery ('#wp_blip_absolute_from').css ('backgroundColor', 'transparent');
- return '';
- }
- });
- }
- function wp_blip__callback () {
- wp_blip_dateformat ();
- wp_blip_absolute_from ();
- }
- function init () {
- wp_blip__callback ();
- jQuery ('#wp_blip_datetype_relative').change (wp_blip__callback);
- jQuery ('#wp_blip_datetype_relative_simple').change (wp_blip__callback);
- jQuery ('#wp_blip_datetype_absolute').change (wp_blip__callback);
- }
- jQuery (init);
- </script>
- <style type="text/css">
- div.wp_blip dt {
- font-style: italic;
- }
- div.wp_blip dd {
- padding-left: 1em;
- }
- </style>
- <div class="wrap wp_blip">
- <h2>WP-Blip!</h2>
- <form method="post" action="options.php">
- <?php settings_fields( 'wp_blip_group' ); ?>
- <table class="form-table">
- <tr valign="top">
- <th scope="row"><label for="wp_blip_login">U?ytkownik w serwisie <a href="http://blip.pl">Blip!</a>:</label></th>
- <td><input type="text" name="wp_blip_login" id="wp_blip_login" value="<?php echo htmlentities2 ($wp_blip_options['login']) ?>" />
- </td>
- </tr>
- <tr valign="top">
- <th scope="row"><label for="wp_blip_quant">Ilo?? statusów do pobrania:</label></th>
- <td><input type="text" name="wp_blip_quant" id="wp_blip_quant" value="<?php echo htmlentities2 ($wp_blip_options['quant']) ?>" /></td>
- </tr>
- <tr valign="top">
- <th scope="row"><label for="wp_blip_time">Okres trwa?o?ci pami?ci podr?cznej:</label></th>
- <td><input type="text" name="wp_blip_time" id="wp_blip_time" value="<?php echo htmlentities2 ($wp_blip_options['time']) ?>" /><br />
- W sekundach</td>
- </tr>
- <tr valign="top">
- <th scope="row"><label for="wp_blip_tags">?led? tylko wymienione tagi:</label></th>
- <td><input type="text" name="wp_blip_tags" id="wp_blip_tags" value="<?php echo htmlentities2 ($wp_blip_options['tags']) ?>" /><br />
- rozdzielaj poszczególne tagi znakiem spacji lub zostaw puste je?li nie chcesz filtrowa? statusów</td>
- </tr>
- <tr valign="top">
- <th scope="row"><label for="wp_blip_tpl_container_pre">Przed list? statusów wstaw:</label></th>
- <td><input type="text" name="wp_blip_tpl_container_pre" id="wp_blip_tpl_container_pre" value="<?php echo htmlentities2 ($wp_blip_options['tpl_container_pre']) ?>" size="50"/><br />
- Przyk?ad: <ul class="blip_log">
- </td>
- </tr>
- <tr valign="top">
- <th scope="row"><label for="wp_blip_tpl_container_post">Po li?cie statusów wstaw:</label></th>
- <td><input type="text" name="wp_blip_tpl_container_post" id="wp_blip_tpl_container_post" value="<?php echo htmlentities2 ($wp_blip_options['tpl_container_post']) ?>" size="50"/><br />
- Przyk?ad: </ul>
- </td>
- </tr>
- <tr valign="top">
- <th scope="row"><label for="wp_blip_tpl">Szablon wiadomo?ci:</label></th>
- <td><input type="text" name="wp_blip_tpl" id="wp_blip_tpl" value="<?php echo htmlentities2 ($wp_blip_options['tpl']) ?>" size="50"/><br />
- %url - zostanie zast?pione permalinkiem do statusu<br />
- %body - tre?? statusu<br />
- %date - data ustawienia statusu<br />
- %picture - je?li status zawiera obrazek, zostanie w t miejsce wstawiona wype?niona zawarto?? szablonu obrazka<br />
- Przyk?ad: <li><h4><a href="%url">%date</a></h4><br />%picture<br />%body</li>
- </td>
- </tr>
- <tr valign="top">
- <th scope="row"><label for="wp_blip_picture_tpl">Szablon obrazka:</label></th>
- <td><input type="text" name="wp_blip_picture_tpl" id="wp_blip_picture_tpl" value="<?php echo htmlentities2 ($wp_blip_options['picture_tpl']) ?>" size="50"/><br />
- %src - zostanie zast?pione permalinkiem do obrazka<br />
- Przyk?ady:<br />
- <a href="%src" class="thickbox"><img src="%src" width="100px" /></a><br />
- <a href="%src" class="thickbox" rel="blip"><img src="%src" width="100px" /></a>
- </td>
- </tr>
- <tr valign="top">
- <th scope="row">Sposób wy?wietlania daty statusu:</th>
- <td>
- <label for="wp_blip_datetype_relative"><input
- type="radio" name="wp_blip_datetype" value="relative" id="wp_blip_datetype_relative"
- <?php echo $wp_blip_options['datetype'] == 'relative' ? 'checked="checked"' : ''; ?>
- /> relatywny</label>
- <label for="wp_blip_datetype_relative_simple"><input
- type="radio" name="wp_blip_datetype" value="relative_simple" id="wp_blip_datetype_relative_simple"
- <?php echo $wp_blip_options['datetype'] == 'relative_simple' ? 'checked="checked"' : ''; ?>
- /> relatywny (uproszczony)</label>
- <label for="wp_blip_datetype_absolute"><input
- type="radio" name="wp_blip_datetype" value="absolute" id="wp_blip_datetype_absolute"
- <?php echo $wp_blip_options['datetype'] == 'absolute' ? 'checked="checked"' : ''; ?>
- /> absolutny</label><br />
- Przyk?ady:
- <dl>
- <dt>relatywny:</dt>
- <dd>2 minuty</dd>
- <dd>3 godziny, 2 minuty</dd>
- <dd>4 dni, 7 godzin, 4 minuty</dd>
- <dt>relatywny uproszczony:</dt>
- <dd>2 minuty</dd>
- <dd>3 godziny</dd>
- <dd>4 dni</dd>
- <dt>absolutny:</dt>
- <dd>20.12.2009 20:01:37</dd>
- </dl>
- </td>
- </tr>
- <tr valign="top">
- <th scope="row"><label for="wp_blip_absolute_from">Absolutne od:</label></th>
- <td><input type="text" name="wp_blip_absolute_from" id="wp_blip_absolute_from"
- value="<?php echo htmlentities2 ($wp_blip_options['absolute_from']) ?>"
- size="50" /><br />
- Warto?? w dniach, po przekroczeniu której data relatywna b?dzie wy?wietlona jako absolutna
- </td>
- </tr>
- <tr valign="top">
- <th scope="row"><label for="wp_blip_dateformat">Szablon daty:</label></th>
- <td><input type="text" name="wp_blip_dateformat" id="wp_blip_dateformat"
- value="<?php echo htmlentities2 ($wp_blip_options['dateformat']) ?>"
- size="50" /><br />
- Szczegó?y: <a href="http://php.net/strftime">php.net/strftime</a> (domy?lnie: %Y-%m-%d %H:%M:%S)
- </td>
- </tr>
- <tr valign="top">
- <th scope="row">Rozwi? linki <code>rdir.pl</code>:</th>
- <td>
- <label for="wp_blip_expand_rdir_yes"><input
- type="radio" name="wp_blip_expand_rdir" id="wp_blip_expand_rdir_yes" value="1"
- <?php echo $wp_blip_options['expand_rdir'] ? 'checked="checked"' : ''; ?>
- /> rozwi?</label>
- <label for="wp_blip_expand_rdir_no"><input
- type="radio" name="wp_blip_expand_rdir" id="wp_blip_expand_rdir_no" value="0"
- <?php echo $wp_blip_options['expand_rdir'] ? '' : 'checked="checked"'; ?>
- /> nie rozwijaj</label><br />
- Rozwijanie linków nieco spowalnia pobieranie listy statusów.
- </td>
- </tr>
- <tr valign="top">
- <th scope="row">Wczytaj linkowane statusy:</th>
- <td>
- <label for="wp_blip_expand_linked_statuses_yes"><input
- type="radio" name="wp_blip_expand_linked_statuses" id="wp_blip_expand_linked_statuses_yes" value="1"
- <?php echo $wp_blip_options['expand_linked_statuses'] ? 'checked="checked"' : ''; ?>
- /> wczytaj</label>
- <label for="wp_blip_expand_linked_statuses_no"><input
- type="radio" name="wp_blip_expand_linked_statuses" id="wp_blip_expand_linked_statuses_no" value="0"
- <?php echo $wp_blip_options['expand_linked_statuses'] ? '' : 'checked="checked"'; ?>
- /> nie wczytuj</label><br />
- Wczytywanie linkowanych statusów nieco spowalnia pobieranie listy statusów.
- </td>
- </tr>
- <tr valign="top">
- <th scope="row"><label for="wp_blip_onerror_email">W razie b??du wy?lij powiadomienie na adres:</label></th>
- <td>
- <input type="text" name="wp_blip_onerror_email" id="wp_blip_onerror_email" value="<?php echo htmlentities2 ($wp_blip_options['onerror_email']) ?>" /><br />
- Zostaw puste je?li nie chcesz otrzymywa? powiadomie? o b??dach.
- </td>
- </tr>
- <tr valign="top">
- <th scope="row">Wyczy?? cache:</th>
- <td><a href="<?php echo get_bloginfo('wpurl'); ?>/wp-content/plugins/wp-blip/wp-blip-ajax.php?ajax=1&action=cache_invalidate"
- onclick="jQuery.get (this.href, {}, function (d, s) {alert (d);}); return false">wyczy??</a></td>
- </tr>
- </table>
- <p class="submit">
- <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
- </p>
- </form>
- </div>