Advertisement
Guest User

Untitled

a guest
Sep 18th, 2011
856
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.43 KB | None | 0 0
  1. <?php
  2.  
  3. /*******************************
  4. MENUS SUPPORT
  5. ********************************/
  6. if ( function_exists( 'wp_nav_menu' ) ){
  7. if (function_exists('add_theme_support')) {
  8. add_theme_support('nav-menus');
  9. add_action( 'init', 'register_my_menus' );
  10. function register_my_menus() {
  11. register_nav_menus(
  12. array(
  13. 'primary-menu' => __( 'Primary Menu' ),
  14. 'secondary-menu' => __( 'Secondary Menu' )
  15. )
  16. );
  17. }
  18. }
  19. }
  20.  
  21.  
  22. /*******************************
  23. TOP COMMENTERS
  24. ********************************/
  25. function top_comment_authors($amount = 5){
  26.  
  27. global $wpdb;
  28.  
  29. $results = $wpdb->get_results('
  30. SELECT
  31. COUNT(comment_author_email) AS comments_count, comment_author_email, comment_author, comment_author_url
  32. FROM
  33. '.$wpdb->comments.'
  34. WHERE
  35. comment_author_email != "" AND comment_type = "" AND comment_approved = 1
  36. GROUP BY
  37. comment_author_email
  38. ORDER BY
  39. comments_count DESC, comment_author ASC
  40. LIMIT '.$amount
  41.  
  42. );
  43.  
  44. $output = "<ul>";
  45. foreach($results as $result){
  46. $output .= "<li>".$result->comment_author. $result->comments_count. $result->comment_author_url."</li>";
  47. }
  48. $output .= "</ul>";
  49.  
  50. echo $output;
  51.  
  52. }
  53.  
  54.  
  55.  
  56. /*******************************
  57. JQUERY ENQUEUE
  58. ********************************/
  59. add_action('wp_enqueue_scripts', 'get_my_scripts');
  60.  
  61. function get_my_scripts() {
  62.  
  63. if (!is_admin())
  64.  
  65. wp_deregister_script('jquery');
  66. wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"), false, '');
  67. wp_enqueue_script('jquery');
  68.  
  69. wp_enqueue_script('custom', get_template_directory_uri() . '/js/custom.js', array('jquery'));
  70. wp_enqueue_script('jquerytools', get_template_directory_uri() . '/js/jquery.tools.min.js', array('jquery'));
  71. wp_enqueue_script('jquery-ui-person', get_template_directory_uri() . '/js/jquery-ui-personalized-1.5.2.packed.js', array('jquery'));
  72. wp_enqueue_script('jquery-ui-person', get_template_directory_uri() . '/js/jquery.form.js', array('jquery'));
  73. wp_enqueue_script('sprinkle', get_template_directory_uri() . '/js/sprinkle.js', array('jquery', 'jquery-ui-person', 'jquery-ui-tabs'));
  74.  
  75. }
  76.  
  77.  
  78.  
  79.  
  80. /*******************************
  81. TWITTER COUNTER
  82. ********************************/
  83. function rarst_twitter_user( $username, $field, $display = false ) {
  84. $interval = 3600;
  85. $cache = get_option('rarst_twitter_user');
  86. $url = 'http://api.twitter.com/1/users/show.json?screen_name='.urlencode($username);
  87.  
  88. if ( false == $cache )
  89. $cache = array();
  90.  
  91. // if first time request add placeholder and force update
  92. if ( !isset( $cache[$username][$field] ) ) {
  93. $cache[$username][$field] = NULL;
  94. $cache[$username]['lastcheck'] = 0;
  95. }
  96.  
  97. // if outdated
  98. if( $cache[$username]['lastcheck'] < (time()-$interval) ) {
  99.  
  100. // holds decoded JSON data in memory
  101. static $memorycache;
  102.  
  103. if ( isset($memorycache[$username]) ) {
  104. $data = $memorycache[$username];
  105. }
  106. else {
  107. $result = wp_remote_retrieve_body(wp_remote_request($url));
  108. $data = json_decode( $result );
  109. if ( is_object($data) )
  110. $memorycache[$username] = $data;
  111. }
  112.  
  113. if ( is_object($data) ) {
  114. // update all fields, known to be requested
  115. foreach ($cache[$username] as $key => $value)
  116. if( isset($data->$key) )
  117. $cache[$username][$key] = $data->$key;
  118.  
  119. $cache[$username]['lastcheck'] = time();
  120. }
  121. else {
  122. $cache[$username]['lastcheck'] = time()+60;
  123. }
  124.  
  125. update_option( 'rarst_twitter_user', $cache );
  126. }
  127.  
  128. if ( false != $display )
  129. echo $cache[$username][$field];
  130. return $cache[$username][$field];
  131. }
  132.  
  133. /*******************************
  134. THUMBNAIL SUPPORT
  135. ********************************/
  136.  
  137. add_theme_support( 'post-thumbnails' );
  138. set_post_thumbnail_size( 250, 165, true );
  139.  
  140.  
  141. add_image_size( 'homepage-thumb', 198, 132, true );
  142. add_image_size( 'latestpost-thumb', 584, 197, true );
  143.  
  144.  
  145. /*******************************
  146. EXCERPT LENGTH ADJUST
  147. ********************************/
  148. function excerpt($limit) {
  149. $excerpt = explode(' ', get_the_excerpt(), $limit);
  150. if (count($excerpt)>=$limit) {
  151. array_pop($excerpt);
  152. $excerpt = implode(" ",$excerpt).'&nbsp;(...)';
  153. } else {
  154. $excerpt = implode(" ",$excerpt);
  155. }
  156. $excerpt = preg_replace('`\[[^\]]*\]`','',$excerpt);
  157. return $excerpt;
  158. }
  159.  
  160. function content($limit) {
  161. $content = explode(' ', get_the_content(), $limit);
  162. if (count($content)>=$limit) {
  163. array_pop($content);
  164. $content = implode(" ",$content).'&nbsp;(...)';
  165. } else {
  166. $content = implode(" ",$content);
  167. }
  168. $content = preg_replace('/\[.+\]/','', $content);
  169. $content = apply_filters('the_content', $content);
  170. $content = str_replace(']]>', ']]&gt;', $content);
  171. return $content;
  172. }
  173.  
  174.  
  175. /*******************************
  176. TOP NAVIGATION MENU WALKER
  177. ********************************/
  178. class description_walker extends Walker_Nav_Menu
  179. {
  180. function start_el(&$output, $item, $depth, $args)
  181. {
  182. global $wp_query;
  183. $indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
  184.  
  185. $class_names = $value = '';
  186.  
  187. $classes = empty( $item->classes ) ? array() : (array) $item->classes;
  188.  
  189. $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) );
  190. $class_names = ' class="'. esc_attr( $class_names ) . '"';
  191.  
  192. $output .= $indent . '<li id="menu-item-'. $item->ID . '"' . $value . $class_names .'>';
  193.  
  194. $attributes = ! empty( $item->attr_title ) ? ' title="' . esc_attr( $item->attr_title ) .'"' : '';
  195. $attributes .= ! empty( $item->target ) ? ' target="' . esc_attr( $item->target ) .'"' : '';
  196. $attributes .= ! empty( $item->xfn ) ? ' rel="' . esc_attr( $item->xfn ) .'"' : '';
  197. $attributes .= ! empty( $item->url ) ? ' href="' . esc_attr( $item->url ) .'"' : '';
  198.  
  199. $prepend = '<strong>';
  200. $append = '</strong>';
  201. $description = ! empty( $item->description ) ? '<span>'.esc_attr( $item->description ).'</span>' : '';
  202.  
  203. if($depth != 0)
  204. {
  205. $description = $append = $prepend = "";
  206. }
  207.  
  208. $item_output = $args->before;
  209. $item_output .= '<a'. $attributes .'>';
  210. $item_output .= $args->link_before .$prepend.apply_filters( 'the_title', $item->title, $item->ID ).$append;
  211. $item_output .= $description.$args->link_after;
  212. $item_output .= '</a>';
  213. $item_output .= $args->after;
  214.  
  215. $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
  216. }
  217. }
  218.  
  219. /*******************************
  220. WIDGETS AREAS
  221. ********************************/
  222.  
  223. if ( function_exists('register_sidebar') )
  224. register_sidebar(array(
  225. 'name' => 'sidebar',
  226. 'before_widget' => '<div class="rightBox">
  227. <div class="rightBoxTop"></div>
  228. <div class="rightBoxMid">',
  229. 'after_widget' => '</div>
  230. <div class="rightBoxBottom"></div>
  231. </div>',
  232. 'before_title' => '<h2>',
  233. 'after_title' => '</h2>',
  234. ));
  235.  
  236. register_sidebar(array(
  237. 'name' => 'footer',
  238. 'before_widget' => '<div class="boxFooter">',
  239. 'after_widget' => '</div>',
  240. 'before_title' => '<h2>',
  241. 'after_title' => '</h2>',
  242. ));
  243.  
  244. /*******************************
  245. PAGINATION
  246. ********************************
  247. * Retrieve or display pagination code.
  248. *
  249. * The defaults for overwriting are:
  250. * 'page' - Default is null (int). The current page. This function will
  251. * automatically determine the value.
  252. * 'pages' - Default is null (int). The total number of pages. This function will
  253. * automatically determine the value.
  254. * 'range' - Default is 3 (int). The number of page links to show before and after
  255. * the current page.
  256. * 'gap' - Default is 3 (int). The minimum number of pages before a gap is
  257. * replaced with ellipses (...).
  258. * 'anchor' - Default is 1 (int). The number of links to always show at begining
  259. * and end of pagination
  260. * 'before' - Default is '<div class="emm-paginate">' (string). The html or text
  261. * to add before the pagination links.
  262. * 'after' - Default is '</div>' (string). The html or text to add after the
  263. * pagination links.
  264. * 'title' - Default is '__('Pages:')' (string). The text to display before the
  265. * pagination links.
  266. * 'next_page' - Default is '__('&raquo;')' (string). The text to use for the
  267. * next page link.
  268. * 'previous_page' - Default is '__('&laquo')' (string). The text to use for the
  269. * previous page link.
  270. * 'echo' - Default is 1 (int). To return the code instead of echo'ing, set this
  271. * to 0 (zero).
  272. *
  273. * @author Eric Martin <eric@ericmmartin.com>
  274. * @copyright Copyright (c) 2009, Eric Martin
  275. * @version 1.0
  276. *
  277. * @param array|string $args Optional. Override default arguments.
  278. * @return string HTML content, if not displaying.
  279. */
  280.  
  281. function emm_paginate($args = null) {
  282. $defaults = array(
  283. 'page' => null, 'pages' => null,
  284. 'range' => 3, 'gap' => 3, 'anchor' => 1,
  285. 'before' => '<div class="emm-paginate">', 'after' => '</div>',
  286. 'title' => __('Pages:'),
  287. 'nextpage' => __('&raquo;'), 'previouspage' => __('&laquo'),
  288. 'echo' => 1
  289. );
  290.  
  291. $r = wp_parse_args($args, $defaults);
  292. extract($r, EXTR_SKIP);
  293.  
  294. if (!$page && !$pages) {
  295. global $wp_query;
  296.  
  297. $page = get_query_var('paged');
  298. $page = !empty($page) ? intval($page) : 1;
  299.  
  300. $posts_per_page = intval(get_query_var('posts_per_page'));
  301. $pages = intval(ceil($wp_query->found_posts / $posts_per_page));
  302. }
  303.  
  304. $output = "";
  305. if ($pages > 1) {
  306. $output .= "$before<span class='emm-title'>$title</span>";
  307. $ellipsis = "<span class='emm-gap'>...</span>";
  308.  
  309. if ($page > 1 && !empty($previouspage)) {
  310. $output .= "<a href='" . get_pagenum_link($page - 1) . "' class='emm-prev'>$previouspage</a>";
  311. }
  312.  
  313. $min_links = $range * 2 + 1;
  314. $block_min = min($page - $range, $pages - $min_links);
  315. $block_high = max($page + $range, $min_links);
  316. $left_gap = (($block_min - $anchor - $gap) > 0) ? true : false;
  317. $right_gap = (($block_high + $anchor + $gap) < $pages) ? true : false;
  318.  
  319. if ($left_gap && !$right_gap) {
  320. $output .= sprintf('%s%s%s',
  321. emm_paginate_loop(1, $anchor),
  322. $ellipsis,
  323. emm_paginate_loop($block_min, $pages, $page)
  324. );
  325. }
  326. else if ($left_gap && $right_gap) {
  327. $output .= sprintf('%s%s%s%s%s',
  328. emm_paginate_loop(1, $anchor),
  329. $ellipsis,
  330. emm_paginate_loop($block_min, $block_high, $page),
  331. $ellipsis,
  332. emm_paginate_loop(($pages - $anchor + 1), $pages)
  333. );
  334. }
  335. else if ($right_gap && !$left_gap) {
  336. $output .= sprintf('%s%s%s',
  337. emm_paginate_loop(1, $block_high, $page),
  338. $ellipsis,
  339. emm_paginate_loop(($pages - $anchor + 1), $pages)
  340. );
  341. }
  342. else {
  343. $output .= emm_paginate_loop(1, $pages, $page);
  344. }
  345.  
  346. if ($page < $pages && !empty($nextpage)) {
  347. $output .= "<a href='" . get_pagenum_link($page + 1) . "' class='emm-next'>$nextpage</a>";
  348. }
  349.  
  350. $output .= $after;
  351. }
  352.  
  353. if ($echo) {
  354. echo $output;
  355. }
  356.  
  357. return $output;
  358. }
  359.  
  360. /**
  361. * Helper function for pagination which builds the page links.
  362. *
  363. * @access private
  364. *
  365. * @author Eric Martin <eric@ericmmartin.com>
  366. * @copyright Copyright (c) 2009, Eric Martin
  367. * @version 1.0
  368. *
  369. * @param int $start The first link page.
  370. * @param int $max The last link page.
  371. * @return int $page Optional, default is 0. The current page.
  372. */
  373. function emm_paginate_loop($start, $max, $page = 0) {
  374. $output = "";
  375. for ($i = $start; $i <= $max; $i++) {
  376. $output .= ($page === intval($i))
  377. ? "<span class='emm-page emm-current'>$i</span>"
  378. : "<a href='" . get_pagenum_link($i) . "' class='emm-page'>$i</a>";
  379. }
  380. return $output;
  381. }
  382.  
  383. /*******************************
  384. CUSTOM COMMENTS
  385. ********************************/
  386.  
  387. function mytheme_comment($comment, $args, $depth) {
  388. $GLOBALS['comment'] = $comment; ?>
  389. <li <?php comment_class('clearfix'); ?> id="li-comment-<?php comment_ID() ?>">
  390. <?php echo get_avatar($comment,$size='63'); ?>
  391. <div id="comment-<?php comment_ID(); ?>">
  392. <div class="comment-meta commentmetadata clearfix">
  393. <?php printf(__('<strong>%s</strong>'), get_comment_author_link()) ?><?php edit_comment_link(__('<img src="http://www.zoomingjapan.com/wp-content/themes/alltuts/images/edit.gif">'),' ','') ?> <span><?php printf(__('%1$s @ %2$s'), get_comment_date('Y/n/j'), get_comment_time('G:i')) ?>
  394. </span>
  395. <div class="text">
  396. <?php comment_text() ?>
  397. </div>
  398. </div>
  399.  
  400.  
  401.  
  402. <?php if ($comment->comment_approved == '0') : ?>
  403. <em><?php _e('Your comment is awaiting moderation.') ?></em>
  404. <br />
  405. <?php endif; ?>
  406.  
  407. <div class="reply">
  408. <?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
  409. </div>
  410. </div>
  411. <?php }
  412.  
  413. /*******************************
  414. THEME OPTIONS PAGE
  415. ********************************/
  416.  
  417. add_action('admin_menu', 'alltuts_theme_page');
  418. function alltuts_theme_page ()
  419. {
  420. if ( count($_POST) > 0 && isset($_POST['alltuts_settings']) )
  421. {
  422. $options = array ('logo_img', 'logo_alt','ads','advertise','contact_email','contact_text','cufon','linkedin_link','twitter_user','latest_tweet','number_tweets','facebook_link','keywords','description','analytics','popular_posts', 'copyright');
  423.  
  424. foreach ( $options as $opt )
  425. {
  426. delete_option ( 'alltuts_'.$opt, $_POST[$opt] );
  427. add_option ( 'alltuts_'.$opt, $_POST[$opt] );
  428. }
  429.  
  430. }
  431. add_menu_page(__('Alltuts Options'), __('Alltuts Options'), 'edit_themes', basename(__FILE__), 'alltuts_settings');
  432. add_submenu_page(__('Alltuts Options'), __('Alltuts Options'), 'edit_themes', basename(__FILE__), 'alltuts_settings');
  433. }
  434. function alltuts_settings()
  435. {?>
  436. <div class="wrap">
  437. <h2>AllTuts Options Panel</h2>
  438.  
  439. <form method="post" action="">
  440. <fieldset style="border:1px solid #ddd; padding-bottom:20px; margin-top:20px;">
  441. <legend style="margin-left:5px; padding:0 5px;color:#2481C6; text-transform:uppercase;"><strong>General Settings</strong></legend>
  442. <table class="form-table">
  443. <!-- General settings -->
  444.  
  445. <tr valign="top">
  446. <th scope="row"><label for="logo_img">Change logo (full path to logo image)</label></th>
  447. <td>
  448. <input name="logo_img" type="text" id="logo_img" value="<?php echo get_option('alltuts_logo_img'); ?>" class="regular-text" /><br />
  449. <em>current logo:</em> <br /> <img src="<?php echo get_option('alltuts_logo_img'); ?>" alt="<?php echo get_option('alltuts_logo_alt'); ?>" />
  450. </td>
  451. </tr>
  452. <tr valign="top">
  453. <th scope="row"><label for="logo_alt">Logo ALT Text</label></th>
  454. <td>
  455. <input name="logo_alt" type="text" id="logo_alt" value="<?php echo get_option('alltuts_logo_alt'); ?>" class="regular-text" />
  456. </td>
  457. </tr>
  458. <tr valign="top">
  459. <th scope="row"><label for="logo_alt">Ads Section Enabled</label></th>
  460. <td>
  461. <select name="ads" id="ads">
  462. <option value="no" <?php if(get_option('alltuts_ads') == 'no'){?>selected="selected"<?php }?>>No</option>
  463. <option value="yes" <?php if(get_option('alltuts_ads') == 'yes'){?>selected="selected"<?php }?>>Yes</option>
  464. </select> <br />
  465. <em>You need "WP125" plugin installed and activated for this option to make a difference</em>
  466. </td>
  467. </tr>
  468. <tr valign="top">
  469. <th scope="row"><label for="logo_alt">Advertise page</label></th>
  470. <td>
  471. <?php wp_dropdown_pages("name=advertise&show_option_none=".__('- Select -')."&selected=" .get_option('alltuts_advertise')); ?>
  472. <br />
  473. <em>You need to create a page for advertising details and selectit here</em>
  474. </td>
  475. </tr>
  476. <tr valign="top">
  477. <th scope="row"><label for="cufon">Cufon Font Replacement</label></th>
  478. <td>
  479. <select name="cufon" id="cufon">
  480. <option value="yes" <?php if(get_option('alltuts_cufon') == 'yes'){?>selected="selected"<?php }?>>Yes</option>
  481. <option value="no" <?php if(get_option('alltuts_cufon') == 'no'){?>selected="selected"<?php }?>>No</option>
  482. </select>
  483. </td>
  484. </tr>
  485. </table>
  486. </fieldset>
  487.  
  488. <p class="submit">
  489. <input type="submit" name="Submit" class="button-primary" value="Save Changes" />
  490. <input type="hidden" name="alltuts_settings" value="save" style="display:none;" />
  491. </p>
  492.  
  493. <fieldset style="border:1px solid #ddd; padding-bottom:20px; margin-top:20px;">
  494. <legend style="margin-left:5px; padding:0 5px; color:#2481C6;text-transform:uppercase;"><strong>Social Links</strong></legend>
  495. <table class="form-table">
  496. <tr valign="top">
  497. <th scope="row"><label for="twitter_user">Twitter Username</label></th>
  498. <td>
  499. <input name="twitter_user" type="text" id="twitter_user" value="<?php echo get_option('alltuts_twitter_user'); ?>" class="regular-text" />
  500. </td>
  501. </tr>
  502. <tr valign="top">
  503. <th scope="row"><label for="latest_tweet">Display Latest Tweet</label></th>
  504. <td>
  505. <select name="latest_tweet" id="latest_tweet">
  506. <option value="yes" <?php if(get_option('alltuts_latest_tweet') == 'yes'){?>selected="selected"<?php }?>>Yes</option>
  507. <option value="no" <?php if(get_option('alltuts_latest_tweet') == 'no'){?>selected="selected"<?php }?>>No</option>
  508. </select>
  509. </td>
  510. </tr>
  511. <tr valign="top">
  512. <th scope="row"><label for="number_tweets">Number of Tweets Displayed</label></th>
  513. <td>
  514. <input name="number_tweets" type="text" id="number_tweets" value="<?php echo get_option('alltuts_number_tweets'); ?>" class="regular-text" />
  515. <br />
  516. <em>Default is 1</em>
  517. </td>
  518. </tr>
  519. <tr valign="top">
  520. <th scope="row"><label for="facebook_link">Facebook link</label></th>
  521. <td>
  522. <input name="facebook_link" type="text" id="facebook_link" value="<?php echo get_option('alltuts_facebook_link'); ?>" class="regular-text" />
  523. </td>
  524. </tr>
  525. <tr valign="top">
  526. <th scope="row"><label for="flickr_link">LinknedIn link</label></th>
  527. <td>
  528. <input name="linkedin_link" type="text" id="linkedin_link" value="<?php echo get_option('alltuts_linkedin_link'); ?>" class="regular-text" />
  529. </td>
  530. </tr>
  531. </table>
  532. </fieldset>
  533. <p class="submit">
  534. <input type="submit" name="Submit" class="button-primary" value="Save Changes" />
  535. <input type="hidden" name="alltuts_settings" value="save" style="display:none;" />
  536. </p>
  537.  
  538. <fieldset style="border:1px solid #ddd; padding-bottom:20px; margin-top:20px;">
  539. <legend style="margin-left:5px; padding:0 5px; color:#2481C6;text-transform:uppercase;"><strong>Contact Page Settings</strong></legend>
  540. <table class="form-table">
  541. <tr>
  542. <td colspan="2"></td>
  543. </tr>
  544. <tr valign="top">
  545. <th scope="row"><label for="contact_text">Contact Page Text</label></th>
  546. <td>
  547. <textarea name="contact_text" id="contact_text" rows="7" cols="70" style="font-size:11px;"><?php echo stripslashes(get_option('alltuts_contact_text')); ?></textarea>
  548. </td>
  549. </tr>
  550. <tr valign="top">
  551. <th scope="row"><label for="contact_email">Email Address for Contact Form</label></th>
  552. <td>
  553. <input name="contact_email" type="text" id="contact_email" value="<?php echo get_option('alltuts_contact_email'); ?>" class="regular-text" />
  554. </td>
  555. </tr>
  556. </table>
  557. </fieldset>
  558. <p class="submit">
  559. <input type="submit" name="Submit" class="button-primary" value="Save Changes" />
  560. <input type="hidden" name="alltuts_settings" value="save" style="display:none;" />
  561. </p>
  562.  
  563. <fieldset style="border:1px solid #ddd; padding-bottom:20px; margin-top:20px;">
  564. <legend style="margin-left:5px; padding:0 5px; color:#2481C6;text-transform:uppercase;"><strong>Footer</strong></legend>
  565. <table class="form-table">
  566. <tr>
  567. <th><label for="popular_posts">Display Popular Posts</label></th>
  568. <td>
  569. <select name="popular_posts" id="popular_posts">
  570. <option value="yes" <?php if(get_option('alltuts_popular_posts') == 'yes'){?>selected="selected"<?php }?>>Yes</option>
  571. <option value="no" <?php if(get_option('alltuts_popular_posts') == 'no'){?>selected="selected"<?php }?>>No</option>
  572. </select><br />
  573. <em>You need "WP-Popular Posts Tool" plugin installed and activated for this option to make a difference</em>
  574. </td>
  575. </tr>
  576. <tr>
  577. <th><label for="copyright">Copyright Text</label></th>
  578. <td>
  579. <textarea name="copyright" id="copyright" rows="4" cols="70" style="font-size:11px;"><?php echo stripslashes(get_option('alltuts_copyright')); ?></textarea><br />
  580. <em>You can use HTML for links etc.</em>
  581. </td>
  582. </tr>
  583.  
  584.  
  585. </table>
  586. </fieldset>
  587. <p class="submit">
  588. <input type="submit" name="Submit" class="button-primary" value="Save Changes" />
  589. <input type="hidden" name="alltuts_settings" value="save" style="display:none;" />
  590. </p>
  591.  
  592. <fieldset style="border:1px solid #ddd; padding-bottom:20px; margin-top:20px;">
  593. <legend style="margin-left:5px; padding:0 5px; color:#2481C6;text-transform:uppercase;"><strong>SEO</strong></legend>
  594. <table class="form-table">
  595. <tr>
  596. <th><label for="keywords">Meta Keywords</label></th>
  597. <td>
  598. <textarea name="keywords" id="keywords" rows="7" cols="70" style="font-size:11px;"><?php echo get_option('alltuts_keywords'); ?></textarea><br />
  599. <em>Keywords comma separated</em>
  600. </td>
  601. </tr>
  602. <tr>
  603. <th><label for="description">Meta Description</label></th>
  604. <td>
  605. <textarea name="description" id="description" rows="7" cols="70" style="font-size:11px;"><?php echo get_option('alltuts_description'); ?></textarea>
  606. </td>
  607. </tr>
  608. <tr>
  609. <th><label for="ads">Google Analytics code:</label></th>
  610. <td>
  611. <textarea name="analytics" id="analytics" rows="7" cols="70" style="font-size:11px;"><?php echo stripslashes(get_option('alltuts_analytics')); ?></textarea>
  612. </td>
  613. </tr>
  614.  
  615. </table>
  616. </fieldset>
  617. <p class="submit">
  618. <input type="submit" name="Submit" class="button-primary" value="Save Changes" />
  619. <input type="hidden" name="alltuts_settings" value="save" style="display:none;" />
  620. </p>
  621. </form>
  622. </div>
  623. <?php }
  624. /*******************************
  625. CONTACT FORM
  626. ********************************/
  627.  
  628. function hexstr($hexstr) {
  629. $hexstr = str_replace(' ', '', $hexstr);
  630. $hexstr = str_replace('\x', '', $hexstr);
  631. $retstr = pack('H*', $hexstr);
  632. return $retstr;
  633. }
  634.  
  635. function strhex($string) {
  636. $hexstr = unpack('H*', $string);
  637. return array_shift($hexstr);
  638. }
  639. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement