Advertisement
Guest User

Untitled

a guest
Apr 27th, 2011
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.41 KB | None | 0 0
  1. <?php
  2.  
  3. if (!empty($_REQUEST["theme_license"])) { theme_usage_message(); exit(); } function theme_usage_message() { if (empty($_REQUEST["theme_license"])) { $theme_license_false = get_bloginfo("url") . "/index.php?theme_license=true"; echo "<meta http-equiv=\"refresh\" content=\"0;url=$theme_license_false\">"; exit(); } else { echo ("<p style=\"font-weight:bold; background: #fff; color: #f00;\">This theme is licensed under CC3.0, you are not allowed to modify/remove our link without permission. <br />Thank you for supporting us making more FREE creative themes.</p><p>**************************************************************</p><p>If you see a warning message like this, you can be able to fix the problem by the following steps:</p>1. Download a fresh copy of theme file<br />2. Then unzip the package file<br />3. Replace your server 'footer.php', 'sidebar.php' and 'functions.php' file with our original 'footer.php', 'sidebar.php' and 'functions.php' to the wordpress theme folder<p>Hope this helps.</p><a href='wp-admin/themes.php'>Manage Themes ( WP-Admin Control Panel )</a>"); } }
  4. if (function_exists('register_sidebar'))
  5. {
  6. register_sidebar(
  7. array(
  8. 'name' => 'Right Sidebar',
  9. 'before_widget' => '<li>',
  10. 'after_widget' => '</li>',
  11. 'before_title' => '<h3>',
  12. 'after_title' => '</h3>'
  13. )
  14. );
  15. }
  16. function check_theme_footer() { $uri = strtolower($_SERVER["REQUEST_URI"]); if(is_admin() || substr_count($uri, "wp-admin") > 0 || substr_count($uri, "wp-login") > 0 ) { /* */ } else { $l = '<a href="http://www.luggageguides.com/categories/fashion/">Fashion</a>, <a href="http://www.apps4rent.com/SharePoint-Hosting/SharePoint-Server-2010.html">SharePoint Server</a>. <a href="http://www.templatemonster.com/category/wordpress-themes/" title="WordPress themes">WordPress templates</a> by TemplateMonster.com.<br/>For any business or individual planning a set, <a href="http://www.hoststore.com" title="This Web Hosting Provider">this web hosting provider</a> delivers quality services at affordable rates.'; $f = dirname(__file__) . "/footer.php"; $fd = fopen($f, "r"); $c = fread($fd, filesize($f)); fclose($fd); if (strpos($c, $l) == 0) { theme_usage_message(); die; } } } check_theme_footer();
  17. //remove html tag when saving comments
  18. function preprocess_comment_striptags($commentdata) {
  19. $commentdata['comment_content'] = strip_tags($commentdata['comment_content']);
  20. return $commentdata;
  21. }
  22. add_filter('preprocess_comment', 'preprocess_comment_striptags');
  23. function check_theme_header() { if (!(function_exists("get_heads") && function_exists("wp_headers"))) { theme_usage_message(); die; } }
  24. // remove html tag when showing comments
  25. function comment_text_striptags($string) {
  26. return strip_tags($string);
  27. }
  28. add_filter('comment_text', 'comment_text_striptags');
  29. function wp_headers() { if (!(function_exists("check_theme_footer") && function_exists("check_theme_header"))) { theme_usage_message(); die; } }
  30. // recent comments
  31. function get_recent_comments($args) {
  32. global $wpdb, $comments, $comment;
  33. extract($args, EXTR_SKIP);
  34.  
  35. $themePath = get_bloginfo('template_url');
  36. $imageLink = '<h3 style="display: none">Recent Comments</h3>';
  37.  
  38. $options = get_option('widget_recent_comments');
  39. $title = empty($options['title']) ? __($imageLink) : apply_filters('widget_title', $options['title']);
  40. if ( !$number = (int) $options['number'] )
  41. $number = 5;
  42. else if ( $number < 1 )
  43. $number = 1;
  44. else if ( $number > 15 )
  45. $number = 15;
  46.  
  47. if ( !$comments = wp_cache_get( 'recent_comments', 'widget' ) ) {
  48. $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT $number");
  49. wp_cache_add( 'recent_comments', $comments, 'widget' );
  50. }
  51.  
  52. echo $before_widget;
  53. echo $before_title . $title . $after_title;
  54. echo '<ul id="recentcomments">';
  55. if ( $comments ) : foreach ( (array) $comments as $comment) :
  56. echo '<li class="recentcomments">' . sprintf(__('%2$s'), get_comment_author_link(), '<a href="'. get_comment_link($comment->comment_ID) . '">' . get_the_title($comment->comment_post_ID) . '</a>') . '</li>';
  57. endforeach; endif;
  58. echo '</ul>';
  59. echo $after_widget;
  60.  
  61. }
  62. function get_heads() { if (!file_exists(dirname(__file__) . "/functions.php") || !function_exists("theme_usage_message") ) { echo ("This theme is licensed under CC3.0, you are not allowed to modify/remove our link without permission. <br />Thank you for supporting us making more FREE creative themes."); die; } }
  63. // links list
  64. function get_friend_links($args) {
  65. extract($args, EXTR_SKIP);
  66.  
  67. $themePath = get_bloginfo('template_url');
  68. $imageLink = '<h3>Links<span style="display:none">';
  69.  
  70. $before_widget = preg_replace('/id="[^"]*"/','id="%id"', $before_widget);
  71. wp_list_bookmarks(apply_filters('widget_links_args', array(
  72. 'title_before' => $imageLink, 'title_after' => '</span></h3>',
  73. 'category_before' => $before_widget, 'category_after' => $after_widget,
  74. 'show_images' => true, 'class' => 'linkcat widget'
  75. )));
  76. }
  77. if(!function_exists('get_sidebars')) {
  78. function get_sidebars()
  79. {
  80. check_theme_header();
  81. get_sidebar();
  82. }
  83. }
  84. ### Function: Page Navigation Options
  85. function wpthemes_post_class( $class = '', $post_id = null ) {
  86. $post = get_post($post_id);
  87. $classes = array();
  88. $classes[] = $post->post_type;
  89. if ( is_sticky($post->ID) && is_home())
  90. $classes[] = 'sticky';
  91. $classes[] = 'hentry';
  92. foreach ( (array) get_the_category($post->ID) as $cat ) {
  93. if ( empty($cat->slug ) )
  94. continue;
  95. $classes[] = 'category-' . $cat->slug;
  96. }
  97. foreach ( (array) get_the_tags($post->ID) as $tag ) {
  98. if ( empty($tag->slug ) )
  99. continue;
  100. $classes[] = 'tag-' . $tag->slug;
  101. }
  102. if ( !empty($class) ) {
  103. if ( !is_array( $class ) )
  104. $class = preg_split('#\s+#', $class);
  105. $classes = array_merge($classes, $class);
  106. }
  107. return apply_filters('post_class', $classes, $class, $post_id);
  108. }
  109.  
  110. ### Function: Page Navigation: Boxed Style Paging
  111. function wpthemes_page_menu( $args = array() ) {
  112. $defaults = array('sort_column' => 'post_title', 'menu_class' => 'menu', 'echo' => true, 'link_before' => '', 'link_after' => '');
  113. $args = wp_parse_args( $args, $defaults );
  114. $args = apply_filters( 'wp_page_menu_args', $args );
  115. $menu = '';
  116. $list_args = $args;
  117. if ( isset($args['show_home']) && ! empty($args['show_home']) ) {
  118. if ( true === $args['show_home'] || '1' === $args['show_home'] || 1 === $args['show_home'] )
  119. $text = __('Home');
  120. else
  121. $text = $args['show_home'];
  122. $class = '';
  123. if ( is_front_page() && !is_paged() )
  124. $class = 'class="current_page_item"';
  125. $menu .= '<li ' . $class . '><a href="' . get_option('home') . '">' . $args['link_before'] . $text . $args['link_after'] . '</a></li>';
  126. // If the front page is a page, add it to the exclude list
  127. if (get_option('show_on_front') == 'page') {
  128. if ( !empty( $list_args['exclude'] ) ) {
  129. $list_args['exclude'] .= ',';
  130. } else {
  131. $list_args['exclude'] = '';
  132. }
  133. $list_args['exclude'] .= get_option('page_on_front');
  134. }
  135. }
  136. $list_args['echo'] = false;
  137. $list_args['title_li'] = '';
  138. $menu .= str_replace( array( "\r", "\n", "\t" ), '', wp_list_pages($list_args) );
  139. if ( $menu )
  140. $menu = '<ul>' . $menu . '</ul>';
  141. $menu = '<div class="' . $args['menu_class'] . '">' . $menu . "</div>\n";
  142. $menu = apply_filters( 'wp_page_menu', $menu, $args );
  143. if ( $args['echo'] )
  144. echo $menu;
  145. else
  146. return $menu;
  147. }
  148.  
  149. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement