Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2013
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.96 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 1.1.5.0
  8. * @ Author : DeZender
  9. * @ Release on : 09.06.2012
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. function post_excerpt_length($length) {
  15. return 18;
  16. }
  17.  
  18. function new_excerpt_more($more) {
  19. global $post;
  20.  
  21. return ' <a href="' . get_permalink( $post->ID ) . '" rel="#pin-' . $post->ID . '" class="whitebox more">read more</a>';
  22. }
  23.  
  24. function add_last_class($input) {
  25. if (!empty( $input )) {
  26. $pattern = '/<li class="(?!.*<li class=")/is';
  27. $replacement = '<li class="last ';
  28. $input = preg_replace( $pattern, $replacement, $input );
  29. echo $input;
  30. }
  31.  
  32. }
  33.  
  34. function curPageURL() {
  35. $pageURL = 'http';
  36.  
  37. if ($_SERVER['HTTPS'] == 'on') {
  38. $pageURL .= 's';
  39. }
  40.  
  41. $pageURL .= '://';
  42.  
  43. if ($_SERVER['SERVER_PORT'] != '80') {
  44. $pageURL .= $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI'];
  45. } else {
  46. $pageURL .= $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
  47. }
  48.  
  49. return $pageURL;
  50. }
  51.  
  52. function register_replacement() {
  53. if (!is_user_logged_in( )) {
  54. if (get_option( 'users_can_register' )) {
  55. $link = '<option value="' . site_url( 'wp-login.php?action=register', 'login' ) . '">' . __( 'Register' ) . '</option>';
  56. } else {
  57. $link = '';
  58. }
  59. } else {
  60. $link = '<option value="' . admin_url( ) . '">' . __( 'Site Admin' ) . '</option>';
  61. }
  62.  
  63. return $link;
  64. }
  65.  
  66. function check_user_approved_comments($author, $email) {
  67. global $wpdb;
  68.  
  69. $sql = $wpdb->query( '' . 'SELECT comment_approved FROM ' . $wpdb->comments . ' WHERE comment_author = \'' . $author . '\' AND comment_author_email = \'' . $email . '\' and comment_approved = \'1\' LIMIT 1' );
  70.  
  71. if (1 == $sql) {
  72. return true;
  73. }
  74.  
  75. return false;
  76. }
  77.  
  78. function next_posts_link_attributes() {
  79. return 'class="next"';
  80. }
  81.  
  82. function prev_posts_link_attributes() {
  83. return 'class="prev"';
  84. }
  85.  
  86. function autoset_featured() {
  87. global $post;
  88.  
  89. $already_has_thumb = has_post_thumbnail( $post->ID );
  90.  
  91. if (( !$already_has_thumb && get_option( 'pinclone_featured_image' ) == 1 )) {
  92. $attached_image = get_children( '' . 'post_parent=' . $post->ID . '&post_type=attachment&post_mime_type=image&numberposts=1' );
  93.  
  94. if ($attached_image) {
  95. foreach ($attached_image as $attachment_id => $attachment) {
  96. set_post_thumbnail( $post->ID, $attachment_id );
  97. }
  98. }
  99. }
  100.  
  101. }
  102.  
  103. function remove_first_image($content) {
  104. if (get_option( 'pinclone_featured_image' ) == 1) {
  105. $content = preg_replace( '/<img[^>]+\>/i', '', $content, 1 );
  106. }
  107.  
  108. return $content;
  109. }
  110.  
  111. function validate_gravatar($email) {
  112. }
  113.  
  114. function avatarcheck($userid, $useremail) {
  115. $avatarcount = 0;
  116.  
  117. if ($userid) {
  118. if (validate_gravatar( $useremail )) {
  119. ++$avatarcount;
  120. }
  121.  
  122. $local = get_usermeta( $userid, 'avatar' );
  123.  
  124. if (0 < strlen( $local )) {
  125. ++$avatarcount;
  126. }
  127.  
  128.  
  129. if ($avatarcount == 0) {
  130. $avatarmsg = false;
  131. } else {
  132. $avatarmsg = true;
  133. }
  134. }
  135.  
  136. return $avatarmsg;
  137. }
  138.  
  139. function my_theme_register_required_plugins() {
  140. $plugins = array( array( 'name' => 'Ads', 'slug' => 'ads', 'source' => get_stylesheet_directory( ) . '/plugins/ads.zip', 'required' => false, 'force_activation' => false, 'force_deactivation' => true ), array( 'name' => 'Wordpress Social Login', 'slug' => 'wordpress-social-login', 'source' => get_stylesheet_directory( ) . '/plugins/wordpress-social-login.zip', 'required' => true, 'force_activation' => true, 'force_deactivation' => true ), array( 'name' => 'Video Thumbnails', 'slug' => 'video-thumbnails', 'source' => get_stylesheet_directory( ) . '/plugins/video-thumbnails.1.8.1.zip', 'required' => true, 'force_activation' => true, 'force_deactivation' => true ) );
  141. $theme_text_domain = 'tgmpa';
  142. $config = array( 'domain' => $theme_text_domain, 'default_path' => '', 'parent_menu_slug' => 'themes.php', 'parent_url_slug' => 'themes.php', 'menu' => 'install-required-plugins', 'has_notices' => true, 'is_automatic' => true, 'message' => '', 'strings' => array( 'page_title' => __( 'Install Required Plugins', $theme_text_domain ), 'menu_title' => __( 'Install Plugins', $theme_text_domain ), 'installing' => __( 'Installing Plugin: %s', $theme_text_domain ), 'oops' => __( 'Something went wrong with the plugin API.', $theme_text_domain ), 'notice_can_install_required' => _n_noop( 'This theme requires the following plugin: %1$s.', 'This theme requires the following plugins: %1$s.' ), 'notice_can_install_recommended' => _n_noop( 'This theme recommends the following plugin: %1$s.', 'This theme recommends the following plugins: %1$s.' ), 'notice_cannot_install' => _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.' ), 'notice_can_activate_required' => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.' ), 'notice_can_activate_recommended' => _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.' ), 'notice_cannot_activate' => _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.' ), 'notice_ask_to_update' => _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.' ), 'notice_cannot_update' => _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.' ), 'install_link' => _n_noop( 'Begin installing plugin', 'Begin installing plugins' ), 'activate_link' => _n_noop( 'Activate installed plugin', 'Activate installed plugins' ), 'return' => __( 'Return to Required Plugins Installer', $theme_text_domain ), 'plugin_activated' => __( 'Plugin activated successfully.', $theme_text_domain ), 'complete' => __( 'All plugins installed and activated successfully. %s', $theme_text_domain ), 'nag_type' => 'updated' ) );
  143. tgmpa( $plugins, $config );
  144. }
  145. .......................................................................
  146. .........................................
  147. ................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement