PluginProbe
CryptX / 3.2
CryptX v3.2
4.2.0 4.1.1 trunk 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.9 2.0 2.1 2.2 2.3 2.3.1 2.3.2 2.3.3 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 All 92 releases
cryptx / admin.php

admin.php in CryptX 3.2, at admin.php

411 lines 19.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Admin Menue
4 **/
5
6 /**
7 * Don't load this file direct!
8 */
9 if (!defined('ABSPATH')) {
10 return ;
11 }
12
13 if (is_admin()) {
14 add_action('admin_menu', 'rw_cryptx_menu');
15 }
16
17 /**
18 * load admin notice after activate/update if needed
19 */
20 if(isset($cryptX_var['admin_notices_deprecated'])) {
21 add_action('admin_notices', 'rw_cryptx_showAdminMessages');
22 $cryptX_var['admin_notices_deprecated']=false;
23 update_option( 'cryptX', $cryptX_var);
24 }
25
26 /**
27 * print admin notice
28 */
29 function rw_cryptx_showAdminMessages()
30 {
31 $searcher = new rw_cryptx_FileSystemStringSearch(get_template_directory().'/', ' cryptx(');
32 $searcher->run();
33
34 if (current_user_can('manage_options')) {
35 if($searcher->getResultCount() > 0) {
36 $msg = '<p><strong>';
37 $msg .= __('You use the deprecated CryptX function cryptx() in your template. You should use the new function encryptx() described at the plugin', 'cryptx');
38 $msg .= sprintf(
39 ' <a href="options-general.php?page=%s">%s</a>',
40 plugin_basename( __FILE__ ),
41 __('Settings')
42 );
43 $msg .= '.</strong></p>';
44 $msg .= '<ul>';
45 foreach($searcher->getResults() as $result) {
46 $msg .= '<li><em>'.$result['filePath'].', line '.$result['lineNumber'].'</em></li>';
47 }
48 $msg .= '</ul>';
49 rw_cryptx_showMessage($msg, true);
50 } elseif(isset($_POST['cryptX_rescan_theme'])) {
51 rw_cryptx_showMessage('<p>'.__('Your theme is OK! You have nothing to do.','cryptx').'</p>');
52 }
53 }
54 }
55
56 /**
57 * add links to plugin site
58 */
59 function rw_cryptx_init_row_meta($links, $file) {
60 return array_merge(
61 $links,
62 array(
63 sprintf(
64 '<a href="options-general.php?page=%s">%s</a>',
65 plugin_basename( __FILE__ ),
66 __('Settings')
67 )
68 ),
69 array(
70 sprintf(
71 '<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4026696">%s</a>',
72 __('Donate', 'cryptx')
73 )
74 )
75 );
76 return $links;
77 }
78
79 /**
80 * add CryptX to Option menu
81 */
82 function rw_cryptx_menu() {
83 add_options_page(
84 'CryptX',
85 (version_compare($GLOBALS['wp_version'], '2.6.999', '>') ? '<img src="' .@plugins_url('cryptx/icon.png'). '" width="10" height="10" alt="CryptX Icon" />' : ''). 'CryptX',
86 'manage_options',
87 __FILE__,
88 'rw_cryptx_submenu'
89 );
90 }
91
92 /**
93 * print CryptX Option Page
94 */
95 function rw_cryptx_submenu() {
96 global $cryptX_var;
97 if (isset($_POST) && !empty($_POST)) {
98 if (function_exists('current_user_can') === true && (current_user_can('manage_options') === false || current_user_can('edit_plugins') === false)) {
99 wp_die("You don't have permission to access!");
100 }
101 $saveOptions = $_POST['cryptX_var'];
102 check_admin_referer('cryptX');
103 if(isset($_POST['cryptX_var_reset'])) {
104 delete_option('cryptX');
105 $saveOptions = rw_loadDefaults();
106 }
107 if(isset($_POST['cryptX_rescan_theme'])) {
108 rw_cryptx_showAdminMessages();
109 } else {
110 $checkboxes = array(
111 'the_content' => 0,
112 'the_meta_key' => 0,
113 'the_excerpt' => 0,
114 'comment_text' => 0,
115 'widget_text' => 0,
116 'autolink' => 0,
117 'metaBox' => 0,
118 );
119 $saveOptions = wp_parse_args( $saveOptions, $checkboxes );
120
121 update_option( 'cryptX', $saveOptions);
122 $cryptX_var = rw_loadDefaults();
123 ?>
124 <div id="message" class="updated fade">
125 <p><strong><?php _e('Settings saved.') ?></strong></p>
126 </div>
127 <?php } ?>
128 <?php } ?>
129
130 <div class="wrap">
131 <?php if (version_compare($GLOBALS['wp_version'], '2.6.999', '>')) { ?>
132 <div class="icon32" style="background: url(<?php echo @plugins_url('cryptx/icon32.png') ?>) no-repeat"><br /></div>
133 <?php } ?>
134 <h2>CryptX</h2>
135 <br class="clear" />
136 <form method="post" action="">
137 <?php wp_nonce_field('cryptX') ?>
138 <div id="poststuff" class="ui-sortable">
139 <div id="rw_cryptx_information_box" class="postbox">
140 <h3><?php _e("Information",'cryptx'); ?></h3>
141 <div class="inside">
142 <table class="form-table">
143 <tr>
144 <td valign="top" width="1%" nowrap><b><i><u>NEWS:</u></i>&nbsp;</b></td>
145 <td valign="top"><div id="cryptx-news-content" style="display:none;"></div></td>
146 <td valign="top" width="50%" style="border-left: 1px solid #999;"><?php
147 $data = get_plugin_data(__FILE__);
148 echo sprintf(
149 '%1$s: %2$s <br /> %3$s: %4$s <br /> %5$s: <a href="http://weber-nrw.de" target="_blank">Ralf Weber</a> | <a href="http://twitter.com/Weber_NRW" target="_blank">%6$s</a> | <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4026696">%7$s</a><br />',
150 __('Plugin'),
151 'CryptX',
152 __('Version'),
153 $data['Version'],
154 __('Author'),
155 __('Follow on Twitter', 'cryptx'),
156 __('Donate', 'cryptx')
157 );
158 ?>
159 </td>
160 </tr>
161 <tr>
162 <td colspan="3" align="center" style="font-weight: bold;"><?php _e("Please support me by translating CryptX into other languages. You can download the cryptx.pot file from my",'cryptx'); ?> <a href="http://weber-nrw.de/wordpress/cryptx/downloads/"><?php _e("site",'cryptx'); ?></a> <?php _e("and mail me the zipped language files. Thanks for it.",'cryptx'); ?>
163 </td>
164 </tr>
165 </table>
166 </div>
167 </div>
168
169 <div id="rw_cryptx_presentation_box" class="postbox">
170 <h3><?php _e("Presentation",'cryptx'); ?></h3>
171 <div class="inside">
172
173 <h4><?php _e("Define CSS Options",'cryptx'); ?></h4>
174 <div class="postbox">
175 <table class="form-table">
176 <tr valign="top">
177 <th><label for="cryptX_var[css_id]"><?php _e("CSS ID",'cryptx'); ?></label></th>
178 <td><input name="cryptX_var[css_id]" value="<?php echo $cryptX_var['css_id']; ?>" type="text" class="regular-text" /><br /><?php _e("Please be careful using this feature! IDs should be unique. You should prefer of using a css class instead.",'cryptx'); ?></td>
179 </tr>
180 <tr valign="top">
181 <th><label for="cryptX_var[css_class]"><?php _e("CSS Class",'cryptx'); ?></label></th>
182 <td><input name="cryptX_var[css_class]" value="<?php echo $cryptX_var['css_class']; ?>" type="text" class="regular-text" /></td>
183 </tr>
184 </table>
185 </div>
186
187 <h4><?php _e("Define Presentation Options",'cryptx'); ?></h4>
188 <div class="postbox">
189 <table class="form-table">
190 <tr valign="top">
191 <td><input name="cryptX_var[opt_linktext]" type="radio" id="opt_linktext" value="0" <?php checked( $cryptX_var['opt_linktext'], 0 ); ?> /></td>
192 <th scope="row"><label for="cryptX_var[at]"><?php _e("Replacement for '@'",'cryptx'); ?></label></th>
193 <td><input name="cryptX_var[at]" value="<?php echo $cryptX_var['at']; ?>" type="text" class="regular-text" /></td>
194 </tr>
195 <tr valign="top">
196 <td>&nbsp;</td>
197 <th scope="row"><label for="cryptX_var[dot]"><?php _e("Replacement for '.'",'cryptx'); ?></label></th>
198 <td><input name="cryptX_var[dot]" value="<?php echo $cryptX_var['dot']; ?>" type="text" class="regular-text" /></td>
199 </tr>
200 <tr valign="top" style="background: #efefef;">
201 <td scope="row"><input type="radio" name="cryptX_var[opt_linktext]" id="opt_linktext2" value="1" <?php checked( $cryptX_var['opt_linktext'], 1 ); ?> /></td>
202 <th><label for="cryptX_var[alt_linktext]"><?php _e("Text for link",'cryptx'); ?></label></th>
203 <td><input name="cryptX_var[alt_linktext]" value="<?php echo $cryptX_var['alt_linktext']; ?>" type="text" class="regular-text" /></td>
204 </tr>
205 <tr valign="top">
206 <td scope="row"><input type="radio" name="cryptX_var[opt_linktext]" id="opt_linktext3" value="2" <?php checked( $cryptX_var['opt_linktext'], 2 ); ?> /></td>
207 <th><label for="cryptX_var[alt_linkimage]"><?php _e("Image-URL",'cryptx'); ?></label></th>
208 <td><input name="cryptX_var[alt_linkimage]" value="<?php echo $cryptX_var['alt_linkimage']; ?>" type="text" class="regular-text" /></td>
209 </tr>
210 <tr valign="top">
211 <td scope="row">&nbsp;</td>
212 <th><label for="cryptX_var[http_linkimage_title]"><?php _e("Title-Tag for the Image",'cryptx'); ?></label></th>
213 <td><input name="cryptX_var[http_linkimage_title]" value="<?php echo $cryptX_var['http_linkimage_title']; ?>" type="text" class="regular-text" /></td>
214 </tr>
215 <tr valign="top" style="background: #efefef;">
216 <td scope="row"><input type="radio" name="cryptX_var[opt_linktext]" id="opt_linktext4" value="3" <?php checked( $cryptX_var['opt_linktext'], 3 ); ?> /></td>
217 <th><label for="cryptX_var[alt_uploadedimage]"><?php _e("Select image from folder",'cryptx'); ?></label></th>
218 <td> <select name="cryptX_var[alt_uploadedimage]" onchange="cryptX_bild_wechsel(this)">
219 <?php foreach(rw_cryptx_dirImages() as $image) {
220 ?>
221 <option value="<?php echo plugins_url('cryptx/images/').$image; ?>" <?php selected( $cryptX_var['alt_uploadedimage'], plugins_url('cryptx/images/').$image ); ?> ><?php echo $image; ?></option>
222 <?php } ?>
223 </select>
224 <br/><?php _e("the selected image: ",'cryptx'); ?><img src="<?php echo $cryptX_var['alt_uploadedimage']; ?>" id="cryptXmailTo" align="top" style="padding: 3px;"><br/>
225 <span class="setting-description"><?php echo sprintf( __("Upload your favorite email-image to '%s'. Only .jpg and .gif Supported!",'cryptx'), plugin_dir_path( __FILE__ ).'images/' ); ?></span></td>
226 </tr>
227 <tr valign="top" style="background: #efefef;">
228 <td>&nbsp;</td>
229 <th><label for="cryptX_var[alt_linkimage_title]"><?php _e("Title-Tag for the Image",'cryptx'); ?></label></th>
230 <td><input name="cryptX_var[alt_linkimage_title]" value="<?php echo $cryptX_var['alt_linkimage_title']; ?>" type="text" class="regular-text" /></td>
231 </tr>
232 <tr valign="top">
233 <td scope="row"><input type="radio" name="cryptX_var[opt_linktext]" id="opt_linktext4" value="4" <?php checked( $cryptX_var['opt_linktext'], 4 ); ?> /></td>
234 <th colspan="2"><?php _e("Text scrambled by AntiSpamBot (<small>Try it and look at your site and check the html source!</small>)",'cryptx'); ?></th>
235 </tr>
236 <tr valign="top" style="background: #efefef;">
237 <td scope="row"><input type="radio" name="cryptX_var[opt_linktext]" id="opt_linktext5" value="5" <?php checked( $cryptX_var['opt_linktext'], 5 ); ?> /></td>
238 <th><?php _e("Convert Email to PNG-image",'cryptx'); ?></th>
239 <td><?php _e("Example with the saved options: ",'cryptx'); ?><img src="<?php echo get_bloginfo('url'); ?>/<?php echo md5( get_bloginfo('url') ); ?>/<?php echo antispambot("test@example.com"); ?>" align="absmiddle" alt="<?php echo antispambot("test@example.com"); ?>" title="<?php echo antispambot("test@example.com"); ?>"></td>
240 </tr>
241 <tr valign="top" style="background: #efefef;">
242 <td>&nbsp;</td>
243 <th><label for="cryptX_var[c2i_font]"><?php _e("Choose a Font",'cryptx'); ?></label></th>
244 <td><select name="cryptX_var[c2i_font]">
245 <?php foreach(rw_cryptx_dirFonts() as $font) { ?>
246 <option value="<?php echo plugin_dir_path( __FILE__ ).'fonts/'.$font; ?>" <?php selected( $cryptX_var['c2i_font'], plugin_dir_path( __FILE__ ).'fonts/'.$font ); ?> ><?php echo $font; ?></option>
247 <?php } ?>
248 </select><br/>
249 <span class="setting-description"><?php echo sprintf( __("Upload your favorite font to '%s'. Only .ttf is Supported!",'cryptx'), plugin_dir_path( __FILE__ ).'fonts/' ); ?></span>
250 </td>
251 </tr>
252 <tr valign="top" style="background: #efefef;">
253 <td>&nbsp;</td>
254 <th><label for="cryptX_var[c2i_fontSize]"><?php _e("Font size (pixel)",'cryptx'); ?></label></th>
255 <td><input name="cryptX_var[c2i_fontSize]" value="<?php echo $cryptX_var['c2i_fontSize']; ?>" type="text" class="regular-text" /></td>
256 </tr>
257 <tr valign="top" style="background: #efefef;">
258 <td>&nbsp;</td>
259 <th><label for="cryptX_var[c2i_fontRGB]"><?php _e("Font color (RGB)",'cryptx'); ?></label></th>
260 <td><input name="cryptX_var[c2i_fontRGB]" value="<?php echo $cryptX_var['c2i_fontRGB']; ?>" type="text" class="regular-text" /></td>
261 </tr>
262 </table>
263 </div>
264 <p><input type="submit" name="cryptX" class="button-primary" value="<?php _e('Save Changes') ?>" /></p>
265 </div>
266 </div>
267
268
269 <div id="rw_cryptx_general_box" class="postbox">
270 <h3><?php _e("General",'cryptx'); ?></h3>
271 <div class="inside">
272 <table class="form-table">
273 <tr valign="top">
274 <th scope="row"><?php _e("Apply CryptX to...",'cryptx'); ?></th>
275 <td>
276 <input name="cryptX_var[the_content]" type="checkbox" value="1" <?php checked( $cryptX_var['the_content'], 1 ); ?> />&nbsp;&nbsp;<?php _e("Content",'cryptx'); ?> <?php _e("(<i>this can be disabled per Post by an Option</i>)",'cryptx'); ?><br/>
277 <input name="cryptX_var[the_meta_key]" type="checkbox" value="1" <?php checked( $cryptX_var['the_meta_key'], 1 ); ?> />&nbsp;&nbsp;<?php _e("Custom fields (<strong>works only with the_meta()!</strong>)",'cryptx'); ?><br/>
278 <input name="cryptX_var[the_excerpt]" type="checkbox" value="1" <?php checked( $cryptX_var['the_excerpt'], 1 ); ?> />&nbsp;&nbsp;<?php _e("Excerpt",'cryptx'); ?><br/>
279 <input name="cryptX_var[comment_text]" type="checkbox" value="1" <?php checked( $cryptX_var['comment_text'], 1 ); ?> />&nbsp;&nbsp;<?php _e("Comments",'cryptx'); ?><br/>
280 <input name="cryptX_var[widget_text]" type="checkbox" value="1" <?php checked( $cryptX_var['widget_text'], 1 ); ?> />&nbsp;&nbsp;<?php _e("Widgets",'cryptx'); ?> <?php _e("(<i>works only on all widgets, not on a single widget</i>!)",'cryptx'); ?>
281 </td>
282 </tr>
283 <tr valign="top">
284 <th scope="row"><?php _e("Excluded ID's...",'cryptx'); ?></th>
285 <td><input name="cryptX_var[excludedIDs]" value="<?php echo $cryptX_var['excludedIDs']; ?>" type="text" class="regular-text" />
286 <br/><span class="setting-description"><?php _e("Enter all Page/Post ID's to exclude from CryptX as comma seperated list.",'cryptx'); ?></span>
287 <br/><input name="cryptX_var[metaBox]" type="checkbox" value="1" <?php checked( $cryptX_var['metaBox'], 1 ); ?> />&nbsp;&nbsp;<?php _e("Enable the CryptX Widget on editing a post or page.",'cryptx'); ?></td>
288 </tr>
289 <tr valign="top">
290 <th scope="row"><?php _e("Type of decryption",'cryptx'); ?></th>
291 <td><input name="cryptX_var[java]" type="radio" value="1" <?php checked( $cryptX_var['java'], 1 ); ?>/>&nbsp;&nbsp;<?php _e("Use javascript to hide the Email-Link.",'cryptx'); ?><br/>
292 <input name="cryptX_var[java]" type="radio" value="0" <?php checked( $cryptX_var['java'], 0 ); ?>/>&nbsp;&nbsp;<?php _e("Use Unicode to hide the Email-Link.",'cryptx'); ?></td>
293 </tr>
294 <tr valign="top">
295 <th scope="row"><?php _e("Where to load the needed javascript...",'cryptx'); ?></th>
296 <td><input name="cryptX_var[load_java]" type="radio" value="0" <?php checked( $cryptX_var['load_java'], 0 ); ?>/>&nbsp;&nbsp;<?php _e("Load the javascript in the <b>header</b> of the page.",'cryptx'); ?><br/>
297 <input name="cryptX_var[load_java]" type="radio" value="1" <?php checked( $cryptX_var['load_java'], 1 ); ?>/>&nbsp;&nbsp;<?php _e("Load the javascript in the <b>footer</b> of the page.",'cryptx'); ?></td>
298 </tr>
299 <tr valign="top">
300 <th scope="row" colspan="2"><input name="cryptX_var[autolink]" type="checkbox" value="1" <?php checked( $cryptX_var['autolink'], 1 ); ?>/>&nbsp;&nbsp;<?php _e("Add mailto to all unlinked email addresses",'cryptx'); ?></th>
301 </tr>
302 <tr valign="top">
303 <th scope="row" colspan="2"><input name="cryptX_var_reset" type="checkbox" value="1"/>&nbsp;&nbsp;<?php _e("Reset CryptX options to defaults. Use it carefully and at your own risk. All changes will be deleted!",'cryptx'); ?></th>
304 </tr>
305 </table>
306 <p><input type="submit" name="cryptX" class="button-primary" value="<?php _e('Save Changes') ?>" /></p>
307 </div>
308 </div>
309
310
311 <div id="rw_encryptx_howto_box" class="postbox">
312 <h3><?php _e("How to use CryptX in your Template",'cryptx'); ?></h3>
313 <div class="inside">
314 <table class="form-table">
315 <tr>
316 <td><h4><?php _e("In your Template you can use the following function to encrypt a email address:",'cryptx'); ?></h4>
317 <p style="border:1px solid #000; background-color: #e9e9e9;padding: 10px;">
318 <i>&lt;?php <br/>
319 &nbsp;&nbsp;&nbsp;&nbsp;$content = "name@example.com"; <br/>
320 &nbsp;&nbsp;&nbsp;&nbsp;$args = array('text' => '',<br/>
321 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'css_class' => '',<br/>
322 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'css_id' => '',<br/>
323 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'echo' => 1); <br/>
324 &nbsp;&nbsp;&nbsp;&nbsp;if (function_exists('encryptx')) { <br/>
325 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;encryptx($content, $args); <br/>
326 &nbsp;&nbsp;&nbsp;&nbsp;} else { <br/>
327 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo sprintf('&lt;a href="mailto:%s" id="%s" class="%s"&gt;%s&lt;/a&gt;', $content, $args['css_id'], $args['css_class'], ($args['text'] != '' ? $args['text'] : $content)); <br/>
328 &nbsp;&nbsp;&nbsp;&nbsp;} <br/>
329 ?&gt;</i>
330 </p>
331 </td>
332 </tr>
333 <tr>
334 <td><h4><?php _e("In your Template you can use the following function to encrypt mail adresses at custom fields:",'cryptx'); ?></h4>
335 <?php _e("Replace the call of get_post_meta in yout template with the CryptX function <strong>get_encryptx_meta</strong>. The parameters are the same!<br/>1. Example:", 'cryptx'); ?><br/>
336 <p style="border:1px solid #000; background-color: #e9e9e9;padding: 10px;">
337 <i>
338 &lt;?php <br/>
339 &nbsp;&nbsp;&nbsp;&nbsp;foreach(get_encryptx_meta($post->ID, $key, false) as $mail) {<br/>
340 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo $mail.'&lt;br/&gt;';</br/>
341 &nbsp;&nbsp;&nbsp;&nbsp;}<br/>
342 ?&gt;
343 </i></p>
344 <?php _e("2. Example:", 'cryptx'); ?><br/>
345 <p style="border:1px solid #000; background-color: #e9e9e9;padding: 10px;">
346 <i>
347 &lt;?php echo get_encryptx_meta($post->ID, $key, true); ?&gt;
348 </i><br/>
349 </p>
350 <input type="submit" name="cryptX_rescan_theme" class="button-primary" value="<?php _e('Rescan current theme', 'cryptx') ?>" />
351 </td>
352 </tr>
353 </table>
354 </div>
355 </div>
356
357
358 <div id="rw_cryptx_howto_box" class="postbox">
359 <h3><?php _e("How to use CryptX in your Template",'cryptx'); ?></h3>
360 <div class="inside">
361 <div style="position: absolute; width: 100%; height: 100%; text-align: center; top: 40%; line-height: 200%; font-size: 200%; color: #ff0000;"><strong><?php _e("ATTENTION",'cryptx'); ?></strong><br/><?php _e("This function is deprecated and will be removed in future releases!",'cryptx'); ?></div>
362 <table class="form-table">
363 <tr>
364 <td><?php _e("In your Template you can use the following function to encrypt a email address:",'cryptx'); ?>
365 <p style="border:1px solid #000; background-color: #e9e9e9;padding: 10px;">
366 <i>
367 &lt;?php <br/>
368 &nbsp;&nbsp;&nbsp;&nbsp; $mail="name@example.com"; <br/>
369 &nbsp;&nbsp;&nbsp;&nbsp; $text="Contact"; <br/>
370 &nbsp;&nbsp;&nbsp;&nbsp; $css ="email"; <br/>
371 &nbsp;&nbsp;&nbsp;&nbsp; if (function_exists('cryptx')) { <br/>
372 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cryptx($mail, $text, $css, 1); <br/>
373 &nbsp;&nbsp;&nbsp;&nbsp; } else { <br/>
374 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo sprintf('&lt;a href="mailto:%s" class="%s"&gt;%s&lt;/a&gt;', $mail, $css, ($text != "" ? $text : $mail)); <br/>
375 &nbsp;&nbsp;&nbsp;&nbsp; } <br/>
376 ?&gt;
377 </i></p>
378 <ol>
379 <li><?php _e("parameter is the email address.",'cryptx'); ?></li>
380 <li><?php _e("parameter is the linktext. If none given the email address is used.",'cryptx'); ?></li>
381 <li><?php _e("parameter is a css class added to the link.",'cryptx'); ?></li>
382 <li><?php _e("parameter is 1 for echo the encrypted email address or 0 to return the result to a variable.",'cryptx'); ?></li>
383 </ol>
384 </td>
385 </tr>
386 </table>
387 </div>
388 </div>
389
390
391 </form>
392 <script type="text/javascript">
393 function cryptX_bild_wechsel(select){
394 document.getElementById("cryptXmailTo").src = select.options[select.options.selectedIndex].value;
395 return true;
396 }
397 </script>
398 <script type="text/javascript">
399 jQuery.ajax({
400 url: "<?php bloginfo('wpurl'); ?>?cryptx=news",
401 success: function(data) {
402 jQuery("#cryptx-news-content").html(data).fadeIn();
403 },
404 error: function() {
405 jQuery("#cryptx-news-content").html('An error ocured while loading News.').fadeIn();
406 }
407 });
408 </script>
409 </div>
410 </div>
411 <?php } ?>