PageRenderTime 26ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-blip-options.php

http://wp-blip.googlecode.com/
PHP | 213 lines | 200 code | 7 blank | 6 comment | 9 complexity | 3b1c4c27ff16d3cfe6483d1cd6ca1b85 MD5 | raw file
  1. <?php
  2. /*
  3. * Interface file for WP Blip! Wordpress plugin
  4. *
  5. * Author: Marcin Sztolcman (http://urzenia.net)
  6. * $Id: wp-blip-options.php 98 2010-04-14 23:54:13Z urzenia $
  7. */
  8. if (!defined ('WP_BLIP')) exit;
  9. if (!current_user_can ('manage_options') ) {
  10. wp_die (__ ('You do not have sufficient permissions to manage options for this blog.'));
  11. }
  12. require_once 'wp-blip-common.php';
  13. $wp_blip_options = wp_blip_get_options ();
  14. ?>
  15. <script type="text/javascript">
  16. function wp_blip_dateformat () {
  17. jQuery ('#wp_blip_dateformat').attr ('readonly', function () {
  18. if (jQuery ('#wp_blip_datetype_absolute').attr ('checked')) {
  19. jQuery ('#wp_blip_dateformat').css ('backgroundColor', 'transparent');
  20. return '';
  21. }
  22. else {
  23. jQuery ('#wp_blip_dateformat').css ('backgroundColor', '#ccc');
  24. return 'readonly';
  25. }
  26. });
  27. }
  28. function wp_blip_absolute_from () {
  29. jQuery ('#wp_blip_absolute_from').attr ('readonly', function () {
  30. if (jQuery ('#wp_blip_datetype_absolute').attr ('checked')) {
  31. jQuery ('#wp_blip_absolute_from').css ('backgroundColor', '#ccc');
  32. return 'readonly';
  33. }
  34. else {
  35. jQuery ('#wp_blip_absolute_from').css ('backgroundColor', 'transparent');
  36. return '';
  37. }
  38. });
  39. }
  40. function wp_blip__callback () {
  41. wp_blip_dateformat ();
  42. wp_blip_absolute_from ();
  43. }
  44. function init () {
  45. wp_blip__callback ();
  46. jQuery ('#wp_blip_datetype_relative').change (wp_blip__callback);
  47. jQuery ('#wp_blip_datetype_relative_simple').change (wp_blip__callback);
  48. jQuery ('#wp_blip_datetype_absolute').change (wp_blip__callback);
  49. }
  50. jQuery (init);
  51. </script>
  52. <style type="text/css">
  53. div.wp_blip dt {
  54. font-style: italic;
  55. }
  56. div.wp_blip dd {
  57. padding-left: 1em;
  58. }
  59. </style>
  60. <div class="wrap wp_blip">
  61. <h2>WP-Blip!</h2>
  62. <form method="post" action="options.php">
  63. <?php settings_fields( 'wp_blip_group' ); ?>
  64. <table class="form-table">
  65. <tr valign="top">
  66. <th scope="row"><label for="wp_blip_login">U?ytkownik w serwisie <a href="http://blip.pl">Blip!</a>:</label></th>
  67. <td><input type="text" name="wp_blip_login" id="wp_blip_login" value="<?php echo htmlentities2 ($wp_blip_options['login']) ?>" />
  68. </td>
  69. </tr>
  70. <tr valign="top">
  71. <th scope="row"><label for="wp_blip_quant">Ilo?? statusów do pobrania:</label></th>
  72. <td><input type="text" name="wp_blip_quant" id="wp_blip_quant" value="<?php echo htmlentities2 ($wp_blip_options['quant']) ?>" /></td>
  73. </tr>
  74. <tr valign="top">
  75. <th scope="row"><label for="wp_blip_time">Okres trwa?o?ci pami?ci podr?cznej:</label></th>
  76. <td><input type="text" name="wp_blip_time" id="wp_blip_time" value="<?php echo htmlentities2 ($wp_blip_options['time']) ?>" /><br />
  77. W sekundach</td>
  78. </tr>
  79. <tr valign="top">
  80. <th scope="row"><label for="wp_blip_tags">?led? tylko wymienione tagi:</label></th>
  81. <td><input type="text" name="wp_blip_tags" id="wp_blip_tags" value="<?php echo htmlentities2 ($wp_blip_options['tags']) ?>" /><br />
  82. rozdzielaj poszczególne tagi znakiem spacji lub zostaw puste je?li nie chcesz filtrowa? statusów</td>
  83. </tr>
  84. <tr valign="top">
  85. <th scope="row"><label for="wp_blip_tpl_container_pre">Przed list? statusów wstaw:</label></th>
  86. <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 />
  87. Przyk?ad: &lt;ul class=&quot;blip_log&quot;&gt;
  88. </td>
  89. </tr>
  90. <tr valign="top">
  91. <th scope="row"><label for="wp_blip_tpl_container_post">Po li?cie statusów wstaw:</label></th>
  92. <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 />
  93. Przyk?ad: &lt;/ul&gt;
  94. </td>
  95. </tr>
  96. <tr valign="top">
  97. <th scope="row"><label for="wp_blip_tpl">Szablon wiadomo?ci:</label></th>
  98. <td><input type="text" name="wp_blip_tpl" id="wp_blip_tpl" value="<?php echo htmlentities2 ($wp_blip_options['tpl']) ?>" size="50"/><br />
  99. %url - zostanie zast?pione permalinkiem do statusu<br />
  100. %body - tre?? statusu<br />
  101. %date - data ustawienia statusu<br />
  102. %picture - je?li status zawiera obrazek, zostanie w t miejsce wstawiona wype?niona zawarto?? szablonu obrazka<br />
  103. Przyk?ad: &lt;li&gt;&lt;h4&gt;&lt;a href=&quot;%url&quot;&gt;%date&lt;/a&gt;&lt;/h4&gt;&lt;br /&gt;%picture&lt;br /&gt;%body&lt;/li&gt;
  104. </td>
  105. </tr>
  106. <tr valign="top">
  107. <th scope="row"><label for="wp_blip_picture_tpl">Szablon obrazka:</label></th>
  108. <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 />
  109. %src - zostanie zast?pione permalinkiem do obrazka<br />
  110. Przyk?ady:<br />
  111. &lt;a href="%src" class="thickbox"&gt;&lt;img src="%src" width="100px" /&gt;&lt;/a&gt;<br />
  112. &lt;a href="%src" class="thickbox" rel="blip"&gt;&lt;img src="%src" width="100px" /&gt;&lt;/a&gt;
  113. </td>
  114. </tr>
  115. <tr valign="top">
  116. <th scope="row">Sposób wy?wietlania daty statusu:</th>
  117. <td>
  118. <label for="wp_blip_datetype_relative"><input
  119. type="radio" name="wp_blip_datetype" value="relative" id="wp_blip_datetype_relative"
  120. <?php echo $wp_blip_options['datetype'] == 'relative' ? 'checked="checked"' : ''; ?>
  121. /> relatywny</label>
  122. <label for="wp_blip_datetype_relative_simple"><input
  123. type="radio" name="wp_blip_datetype" value="relative_simple" id="wp_blip_datetype_relative_simple"
  124. <?php echo $wp_blip_options['datetype'] == 'relative_simple' ? 'checked="checked"' : ''; ?>
  125. /> relatywny (uproszczony)</label>
  126. <label for="wp_blip_datetype_absolute"><input
  127. type="radio" name="wp_blip_datetype" value="absolute" id="wp_blip_datetype_absolute"
  128. <?php echo $wp_blip_options['datetype'] == 'absolute' ? 'checked="checked"' : ''; ?>
  129. /> absolutny</label><br />
  130. Przyk?ady:
  131. <dl>
  132. <dt>relatywny:</dt>
  133. <dd>2 minuty</dd>
  134. <dd>3 godziny, 2 minuty</dd>
  135. <dd>4 dni, 7 godzin, 4 minuty</dd>
  136. <dt>relatywny uproszczony:</dt>
  137. <dd>2 minuty</dd>
  138. <dd>3 godziny</dd>
  139. <dd>4 dni</dd>
  140. <dt>absolutny:</dt>
  141. <dd>20.12.2009 20:01:37</dd>
  142. </dl>
  143. </td>
  144. </tr>
  145. <tr valign="top">
  146. <th scope="row"><label for="wp_blip_absolute_from">Absolutne od:</label></th>
  147. <td><input type="text" name="wp_blip_absolute_from" id="wp_blip_absolute_from"
  148. value="<?php echo htmlentities2 ($wp_blip_options['absolute_from']) ?>"
  149. size="50" /><br />
  150. Warto?? w dniach, po przekroczeniu której data relatywna b?dzie wy?wietlona jako absolutna
  151. </td>
  152. </tr>
  153. <tr valign="top">
  154. <th scope="row"><label for="wp_blip_dateformat">Szablon daty:</label></th>
  155. <td><input type="text" name="wp_blip_dateformat" id="wp_blip_dateformat"
  156. value="<?php echo htmlentities2 ($wp_blip_options['dateformat']) ?>"
  157. size="50" /><br />
  158. Szczegó?y: <a href="http://php.net/strftime">php.net/strftime</a> (domy?lnie: %Y-%m-%d %H:%M:%S)
  159. </td>
  160. </tr>
  161. <tr valign="top">
  162. <th scope="row">Rozwi? linki <code>rdir.pl</code>:</th>
  163. <td>
  164. <label for="wp_blip_expand_rdir_yes"><input
  165. type="radio" name="wp_blip_expand_rdir" id="wp_blip_expand_rdir_yes" value="1"
  166. <?php echo $wp_blip_options['expand_rdir'] ? 'checked="checked"' : ''; ?>
  167. /> rozwi?</label>
  168. <label for="wp_blip_expand_rdir_no"><input
  169. type="radio" name="wp_blip_expand_rdir" id="wp_blip_expand_rdir_no" value="0"
  170. <?php echo $wp_blip_options['expand_rdir'] ? '' : 'checked="checked"'; ?>
  171. /> nie rozwijaj</label><br />
  172. Rozwijanie linków nieco spowalnia pobieranie listy statusów.
  173. </td>
  174. </tr>
  175. <tr valign="top">
  176. <th scope="row">Wczytaj linkowane statusy:</th>
  177. <td>
  178. <label for="wp_blip_expand_linked_statuses_yes"><input
  179. type="radio" name="wp_blip_expand_linked_statuses" id="wp_blip_expand_linked_statuses_yes" value="1"
  180. <?php echo $wp_blip_options['expand_linked_statuses'] ? 'checked="checked"' : ''; ?>
  181. /> wczytaj</label>
  182. <label for="wp_blip_expand_linked_statuses_no"><input
  183. type="radio" name="wp_blip_expand_linked_statuses" id="wp_blip_expand_linked_statuses_no" value="0"
  184. <?php echo $wp_blip_options['expand_linked_statuses'] ? '' : 'checked="checked"'; ?>
  185. /> nie wczytuj</label><br />
  186. Wczytywanie linkowanych statusów nieco spowalnia pobieranie listy statusów.
  187. </td>
  188. </tr>
  189. <tr valign="top">
  190. <th scope="row"><label for="wp_blip_onerror_email">W razie b??du wy?lij powiadomienie na adres:</label></th>
  191. <td>
  192. <input type="text" name="wp_blip_onerror_email" id="wp_blip_onerror_email" value="<?php echo htmlentities2 ($wp_blip_options['onerror_email']) ?>" /><br />
  193. Zostaw puste je?li nie chcesz otrzymywa? powiadomie? o b??dach.
  194. </td>
  195. </tr>
  196. <tr valign="top">
  197. <th scope="row">Wyczy?? cache:</th>
  198. <td><a href="<?php echo get_bloginfo('wpurl'); ?>/wp-content/plugins/wp-blip/wp-blip-ajax.php?ajax=1&amp;action=cache_invalidate"
  199. onclick="jQuery.get (this.href, {}, function (d, s) {alert (d);}); return false">wyczy??</a></td>
  200. </tr>
  201. </table>
  202. <p class="submit">
  203. <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
  204. </p>
  205. </form>
  206. </div>