lostyazilim
tr.link

Bu wordpress hatası nın çözümü nedir?

8 Mesajlar 2.045 Okunma
acebozum
tr.link

interplus interplus Üyeliği Durdurulmuş Banlı Kullanıcı
  • Üyelik 10.12.2012
  • Yaş/Cinsiyet 36 / E
  • Meslek Öğrenci
  • Konum Eskişehir
  • Ad Soyad ** **
  • Mesajlar 107
  • Beğeniler 40 / 21
  • Ticaret 1, (%100)
Merhaba arkadaşlar bu hatanın çözümünü bilen arkadaşlar yardımcı olursa sevinirim çok eşekkürler şimdiden.

Warning: Parameter 1 to update_comment_type_cache() expected to be a reference, value given in /home/djmaen5/public_html/wp-includes/plugin.php on line 230
 

 

wmaraci
reklam

blogger blogger Freelancer Kullanıcı
  • Üyelik 26.11.2011
  • Yaş/Cinsiyet 27 / E
  • Meslek Freelancer
  • Konum İstanbul Avrupa
  • Ad Soyad R** Ş**
  • Mesajlar 134
  • Beğeniler 19 / 21
  • Ticaret 1, (%100)
wp_supercache eklentisi bu hatayı meydana getiriyor sanırım, wp güncellediniz sonrasında mı çıkmaya başladı bu hata?
 

 

interplus interplus Üyeliği Durdurulmuş Banlı Kullanıcı
  • Üyelik 10.12.2012
  • Yaş/Cinsiyet 36 / E
  • Meslek Öğrenci
  • Konum Eskişehir
  • Ad Soyad ** **
  • Mesajlar 107
  • Beğeniler 40 / 21
  • Ticaret 1, (%100)

blogger adlı üyeden alıntı

wp_supercache eklentisi bu hatayı meydana getiriyor sanırım, wp güncellediniz sonrasında mı çıkmaya başladı bu hata?


öncelikle çok sağol cevabın için,
herhangi bir güncelleme yapmadım bu temayı yeni yukledim, sitenin üst tarafında bu hata çıktı
 

 

blogger blogger Freelancer Kullanıcı
  • Üyelik 26.11.2011
  • Yaş/Cinsiyet 27 / E
  • Meslek Freelancer
  • Konum İstanbul Avrupa
  • Ad Soyad R** Ş**
  • Mesajlar 134
  • Beğeniler 19 / 21
  • Ticaret 1, (%100)
Temanın functions.php dosyasında,
function update_comment_type_cache şöyle bir satır var mı, varsa functions php yi paylaşabilir misin.
 

 

wmaraci
wmaraci

interplus interplus Üyeliği Durdurulmuş Banlı Kullanıcı
  • Üyelik 10.12.2012
  • Yaş/Cinsiyet 36 / E
  • Meslek Öğrenci
  • Konum Eskişehir
  • Ad Soyad ** **
  • Mesajlar 107
  • Beğeniler 40 / 21
  • Ticaret 1, (%100)

blogger adlı üyeden alıntı

Temanın functions.php dosyasında,
şöyle bir satır var mı, varsa functions php yi paylaşabilir misin.



add_theme_support( 'post-thumbnails' );

function normalComments($comment, $args, $depth)
{
$GLOBALS['comment'] = $comment;
global $options;
foreach ($options as $value) {
if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); }
}

$adminid = explode (",",$wpzoom_admin_ids);
$oddcomment = 'guest';
$wrappeddate = wordwrap($comment->comment_date, 10,"
\n");
if (in_array($comment->user_id, $adminid)) {$oddcomment = 'author'; }

$gravatarsize = $wpzoom_comments_gravatar_size;
$gravatar_id = md5($comment->comment_author_email);
$gravatar = get_avatar($comment->comment_author_email, $gravatarsize,'');
echo"
  • $gravatar";
    if($args['max_depth']!=$depth) { ?>
    $depth, 'max_depth' => $args['max_depth']))) ?>

    echo"
    ";
    echo"
    "; if (strlen($comment->comment_author_url) > 10){ echo"comment_author_url."\" rel=\"external,nofollow\">" . $comment->comment_author .""; } else{ echo $comment->comment_author; } echo"

    $wrappeddate
    ";
    echo"
    comment_ID\">";
    echo"

    ".$comment->comment_content."

    ";
    if ($comment->comment_approved == '0') :
    echo"('Your comment is awaiting moderation.')";
    endif;
    echo"
    ";
    echo"
     
    ";
    }

    function normalPings($comment)
    {
    echo"
  • ";?>
    comment_ID\">"; if (strlen($comment->comment_author_url) > 10){ echo"comment_author_url."\" rel=\"external,nofollow\">" . $comment->comment_author .""; } else{ echo $comment->comment_author; } echo"$comment->comment_date";
    echo"

    ".$comment->comment_content."

    ";
    echo"
  • ";
    }

    /*
    Plugin Name: Limit Posts
    Plugin URI: http://labitacora.net/comunBlog/limit-post.phps
    Description: Limits the displayed text length on the index page entries and generates a link to a page to read the full content if its bigger than the selected maximum length.
    Usage: the_content_limit($max_charaters, $more_link)
    Version: 1.1
    Author: Alfonso Sanchez-Paus Diaz y Julian Simon de Castro
    Author URI: http://labitacora.net/
    License: GPL
    Download URL: http://labitacora.net/comunBlog/limit-post.phps
    Make:
    In file index.php
    replace the_content()
    with the_content_limit(1000, "more")
    */

    function the_content_limit($max_char, $more_link_text = '(more...)', $stripteaser = 0, $more_file = '') {
    $content = get_the_content($more_link_text, $stripteaser, $more_file);
    $content = apply_filters('the_content', $content);
    $content = str_replace(']]>', ']]>', $content);
    $content = strip_tags($content);

    if (strlen($_GET['p']) > 0 && $thisshouldnotapply) {
    echo $content;
    }
    else if ((strlen($content)>$max_char) && ($espacio = strpos($content, " ", $max_char ))) {
    $content = substr($content, 0, $espacio);
    $content = $content;
    echo $content;
    echo "...";
    }
    else {
    echo $content;
    }
    }

    function dp_recent_comments($no_comments = 10, $comment_len = 90) {
    global $wpdb;

    $request = "SELECT * FROM $wpdb->comments";
    $request .= " JOIN $wpdb->posts ON ID = comment_post_ID";
    $request .= " WHERE comment_approved = '1' AND post_status = 'publish' AND post_password ='' AND comment_type = ''";
    $request .= " ORDER BY comment_date DESC LIMIT $no_comments";

    $comments = $wpdb->get_results($request);

    echo "$before_title"."$settings[title]"."$after_title";
    if ($comments) {
    foreach ($comments as $comment) {

    // print_r($comment);
    ob_start();
    ?>



  •  


  • ob_end_flush();
    }
    } else {
    echo "
  • No comments
  • ";
    }
    }

    function dp_get_author($comment) {
    $author = "";

    if ( empty($comment->comment_author) )
    $author = __('Anonymous');
    else
    $author = $comment->comment_author;

    return $author;
    }

    function wp_get_related_posts() {
    global $wpdb, $post,$table_prefix;
    $wp_rp = get_option("wp_rp");

    $exclude = explode(",",$wp_rp["wp_rp_exclude"]);
    $limit = $wp_rp["wp_rp_limit"];
    $wp_rp_title = $wp_rp["wp_rp_title"];
    $wp_no_rp = $wp_rp["wp_no_rp"];
    $wp_no_rp_text = $wp_rp["wp_no_rp_text"];
    $show_date = $wp_rp["wp_rp_date"];
    $show_comments_count = $wp_rp["wp_rp_comments"];

    if ( $exclude != '' ) {
    $q = "SELECT tt.term_id FROM ". $table_prefix ."term_taxonomy tt, " . $table_prefix . "term_relationships tr WHERE tt.taxonomy = 'category' AND tt.term_taxonomy_id = tr.term_taxonomy_id AND tr.object_id = $post->ID";

    $cats = $wpdb->get_results($q);

    foreach(($cats) as $cat) {
    if (in_array($cat->term_id, $exclude) != false){
    return;
    }
    }
    }

    if(!$post->ID){return;}
    $now = current_time('mysql', 1);
    $tags = wp_get_post_tags($post->ID);

    //print_r($tags);

    $taglist = "'" . $tags[0]->term_id. "'";

    $tagcount = count($tags);
    if ($tagcount > 1) {
    for ($i = 1; $i <= $tagcount; $i++) {
    $taglist = $taglist . ", '" . $tags[$i]->term_id . "'";
    }
    }

    if ($limit) {
    $limitclause = "LIMIT $limit";
    } else {
    $limitclause = "LIMIT 10";
    }

    $q = "SELECT p.ID, p.post_title, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM $wpdb->term_taxonomy t_t, $wpdb->term_relationships t_r, $wpdb->posts p WHERE t_t.taxonomy ='post_tag' AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND (t_t.term_id IN ($taglist)) AND p.ID != $post->ID AND p.post_status = 'publish' AND p.post_date_gmt < '$now' GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC $limitclause;";

    //echo $q;

    $related_posts = $wpdb->get_results($q);
    $output = "";

    if (!$related_posts){

    if(!$wp_no_rp || ($wp_no_rp == "popularity" && !function_exists('akpc_most_popular'))) $wp_no_rp = "text";

    if($wp_no_rp == "text"){
    if(!$wp_no_rp_text) $wp_no_rp_text= __("No Related Post",'wp_related_posts');
    // $output .= '
  • '.$wp_no_rp_text .'
  • ';
    } else{
    if($wp_no_rp == "random"){
    if(!$wp_no_rp_text) $wp_no_rp_text= __("Random Posts",'wp_related_posts');
    $related_posts = wp_get_random_posts($limitclause);
    } elseif($wp_no_rp == "commented"){
    if(!$wp_no_rp_text) $wp_no_rp_text= __("Most Commented Posts",'wp_related_posts');
    $related_posts = wp_get_most_commented_posts($limitclause);
    } elseif($wp_no_rp == "popularity"){
    if(!$wp_no_rp_text) $wp_no_rp_text= __("Most Popular Posts",'wp_related_posts');
    $related_posts = wp_get_most_popular_posts($limitclause);
    }else{
    return __("Something wrong",'wp_related_posts');;
    }
    $wp_rp_title = $wp_no_rp_text;
    }
    }

    foreach ($related_posts as $related_post ){
    $output .= '
  • ';

    if ($show_date){
    $dateformat = get_option('date_format');
    $output .= mysql2date($dateformat, $related_post->post_date) . " -- ";
    }

    $output .= ''.wptexturize($related_post->post_title).'';

    if ($show_comments_count){
    $output .= " (" . $related_post->comment_count . ")";
    }

    $output .= '
  • ';
    }

    $output = '

    Related Posts:

      ' . $output . '
    ';

    if($wp_rp_title != '') $output = '

    '.$wp_rp_title .'

    '. $output;

    return $output;
    }

    function wp_related_posts(){

    $output = wp_get_related_posts() ;

    echo $output;
    }

    function wp_related_posts_auto($content=""){
    $wp_rp = get_option("wp_rp");
    $wp_rp_auto = ($wp_rp["wp_rp_auto"] == 'yes') ? 1 : 0;
    if ( (! is_single()) || (! $wp_rp_auto)) return $content;

    $output = wp_get_related_posts() ;
    $content = $content . $output;

    return $content;
    }

    /*
    Recent News Widget
    */

    function recent_news($args) {


    extract($args);
    $settings = get_option( 'widget_recent_news' );
    $number = $settings['number'];

    echo $before_widget;
    echo "$before_title"."$settings[title]"."$after_title";

    ?>
    $recent = new WP_Query("showposts=$number&orderby=id&order=DESC");
    while( $recent->have_posts() ) : $recent->the_post();
    global $post; global $wp_query;

    unset($img);
    if ($wpzoom_cf_use == 'Yes')
    {
    $img = get_post_meta($post->ID, $wpzoom_cf_photo, true);
    }
    else
    {
    if (!$img)
    {
    $img = catch_that_image($post->ID);
    }
    }
    ?>





    endwhile;
    wp_reset_query(); ?>
    echo $after_widget;
    }

    function recent_news_admin() {

    $settings = get_option( 'widget_recent_news' );

    if( isset( $_POST[ 'update_recent_news' ] ) ) {
    $settings[ 'title' ] = strip_tags( stripslashes( $_POST[ 'widget_recent_news_title' ] ) );
    $settings[ 'number' ] = strip_tags( stripslashes( $_POST[ 'widget_recent_news_number' ] ) );
    update_option( 'widget_recent_news', $settings );
    }
    ?>













    /* Recent Comments Widget
    -----------------------------*/

    function recent_comments($args) {

    extract($args);
    $settings = get_option( 'widget_recent_comments' );

    echo $before_widget;
    echo "$before_title"."$settings[title]"."$after_title";
    ?>



    echo $after_widget;

    }

    function recent_comments_admin() {
    $settings = get_option( 'widget_recent_comments' );

    if( isset( $_POST[ 'update_recent_news' ] ) ) {
    $settings[ 'title' ] = strip_tags( stripslashes( $_POST[ 'widget_rec_comments' ] ) );
    $settings[ 'number' ] = strip_tags( stripslashes( $_POST[ 'widget_rec_comments_num' ] ) );
    update_option( 'widget_recent_comments', $settings );
    }

    ?>












    /* Recent Comments Widget
    -----------------------------*/

    function connectWithMe($args) {

    extract($args);
    $settings = get_option( 'widget_social_connect' );

    echo $before_widget;
    echo "$before_title"."$settings[title]"."$after_title";
    ?>

     

    echo $after_widget;

    }

    function connectWithMe_admin() {
    $settings = get_option( 'widget_social_connect' );

    if( isset( $_POST[ 'update_social_connect' ] ) ) {
    $settings[ 'title' ] = strip_tags( stripslashes( $_POST[ 'widget_social_connect_title' ] ) );
    $settings[ 'delicious' ] = strip_tags( stripslashes( $_POST[ 'widget_social_connect_delicious' ] ) );
    $settings[ 'digg' ] = strip_tags( stripslashes( $_POST[ 'widget_social_connect_digg' ] ) );
    $settings[ 'facebook' ] = strip_tags( stripslashes( $_POST[ 'widget_social_connect_facebook' ] ) );
    $settings[ 'flickr' ] = strip_tags( stripslashes( $_POST[ 'widget_social_connect_flickr' ] ) );
    $settings[ 'lastfm' ] = strip_tags( stripslashes( $_POST[ 'widget_social_connect_lastfm' ] ) );
    $settings[ 'linkedin' ] = strip_tags( stripslashes( $_POST[ 'widget_social_connect_linkedin' ] ) );
    $settings[ 'myspace' ] = strip_tags( stripslashes( $_POST[ 'widget_social_connect_myspace' ] ) );
    $settings[ 'reddit' ] = strip_tags( stripslashes( $_POST[ 'widget_social_connect_reddit' ] ) );
    $settings[ 'stumble' ] = strip_tags( stripslashes( $_POST[ 'widget_social_connect_stumble' ] ) );
    $settings[ 'technorati' ] = strip_tags( stripslashes( $_POST[ 'widget_social_connect_technorati' ] ) );
    $settings[ 'twitter' ] = strip_tags( stripslashes( $_POST[ 'widget_social_connect_twitter' ] ) );
    $settings[ 'youtube' ] = strip_tags( stripslashes( $_POST[ 'widget_social_connect_youtube' ] ) );
    update_option( 'widget_social_connect', $settings );
    }

    ?>

























































    /* Popular News
    ----------------------*/

    function ft_popular_posts ($args) {

    extract($args);

    global $wpzoom_cf_photo;

    // Extract widget options
    $options = get_option('ft_popular_posts_options');
    $title = $options['title'];
    $maxposts = $options['maxposts'];
    $timeline = $options['sincewhen'];

    // Generate output
    echo $before_widget;
    echo "$before_title"."$title"."$after_title";
    echo "
      \n";

      global $wpdb;
      $sql = "SELECT ID, post_title, comment_count FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' ";

      // What's the chosen timeline?
      switch ($timeline) {
      case "thismonth":
      $sql .= "AND MONTH(post_date) = MONTH(NOW()) AND YEAR(post_date) = YEAR(NOW()) ";
      break;
      case "thisyear":
      $sql .= "AND YEAR(post_date) = YEAR(NOW()) ";
      break;
      default:
      $sql .= "";
      }

      // Make sure only integers are entered
      if (!ctype_digit($maxposts)) {
      $maxposts = 10;
      } else {
      // Reformat the submitted text value into an integer
      $maxposts = $maxposts + 0;
      // Only accept sane values
      if ($maxposts <= 0 or $maxposts > 10) {
      $maxposts = 10;
      }
      }

      $sql .= "AND comment_count > 0 ORDER BY comment_count DESC LIMIT ". $maxposts;

      $res = $wpdb->get_results($sql);

      if($res) {
      $mcpcounter = 1;
      foreach ($res as $r) {

      $img = get_post_meta($r->ID, "$wpzoom_cf_photo", true);

      ?>




    • post_title, ENT_QUOTES); ?>




       


    • }
      } else {
      echo "
    • ". __('No commented posts yet') . "
    • \n";
      }

      echo "
    \n";
    echo $after_widget;
    }


    function ft_popular_posts_admin() {

    // Get our options and see if we're handling a form submission.
    $options = get_option('ft_popular_posts_options');
    if ( !is_array($options) )
    $options = array(
    'title'=>__('Popular Posts'),
    'sincewhen' => 'forever',
    'maxposts'=> 10
    );
    if ( $_POST['htnetmcp-submit'] ) {

    // Remember to sanitize and format use input appropriately.
    $options['title'] = strip_tags(stripslashes($_POST['htnetmcp-title']));
    $options['sincewhen'] = strip_tags(stripslashes($_POST['htnetmcp-sincewhen']));
    $options['maxposts'] = strip_tags(stripslashes($_POST['htnetmcp-maxposts']));
    update_option('ft_popular_posts_options', $options);
    }

    // Be sure you format your options to be valid HTML attributes.
    $title = htmlspecialchars($options['title'], ENT_QUOTES);
    $sincewhen = htmlspecialchars($options['sincewhen'], ENT_QUOTES);
    $maxposts = htmlspecialchars($options['maxposts'], ENT_QUOTES);

    // Here is our little form segment. Notice that we don't need a form. This will be embedded into the existing form.
    echo '

    ';

    echo '

    ';

    echo '

    ';
    echo '';
    }

    // ADD OPTIONS FOR THE FEATURED POSTS WIDGET
    $widget_featured_posts_options = array(
    'featured_works_tag_slug' => "featured",
    'featured_works_side' => "6",
    'featured_works_title' => "Featured Posts");
    add_option('widget_featured_works_settings', $widget_featured_posts_options );

    function featured_works_side($args) {

    extract($args);

    $widget_settings = get_option( 'widget_featured_works_settings' );
    $breaking_tag = $widget_settings['featured_works_tag_slug'];
    $breaking_num = $widget_settings['featured_works_side'];

    $args = array('showposts' => $breaking_num, 'orderby' => 'date', 'order' => 'DESC', 'tag' => $breaking_tag);
    $featuredpostsright = new WP_Query($args);

    if ($featuredpostsright->have_posts()){


    global $wpzoom_cf_photo;
    // Generate output
    echo $before_widget;
    echo "$before_title"."$widget_settings[featured_works_title]"."$after_title";

    while ($featuredpostsright->have_posts()) : $featuredpostsright->the_post(); ?>

    global $post;
    unset($img);
    if ($wpzoom_cf_use == 'Yes')
    {
    $img = get_post_meta($post->ID, $wpzoom_cf_photo, true);
    }
    else
    {
    if (!$img)
    {
    $img = catch_that_image($post->ID);
    }
    }
    if ($img) : ?>
    <?php the_title(); ?>





     


    echo $after_widget;
    } // if have_posts
    wp_reset_query();
    }

    function featured_works_side_admin() {

    $widget_settings = get_option( 'widget_featured_works_settings' );
    if( isset( $_POST[ 'widget_update_featured' ] ) ) {
    $widget_settings['featured_works_side'] = strip_tags( stripslashes( $_POST[ 'featured_works_side' ] ) );
    $widget_settings['featured_works_tag_slug'] = strip_tags( stripslashes( $_POST[ 'featured_works_tag_slug' ] ) );
    $widget_settings['featured_works_title'] = strip_tags( stripslashes( $_POST[ 'featured_works_title' ] ) );
    update_option( 'widget_featured_works_settings', $widget_settings );
    }
    ?>


    " />



    " />



    " />




    }

    /*
    Plugin Name: Ping/Track/Comment Count
    Plugin URI: http://txfx.net/code/wordpress/ping-track-comment-count/
    Version: 1.1
    Description: Provides unctions that return or display the number of trackbacks, pingbacks, comments or combined pings recieved by a given post. Other authors: Chris J. Davis, Scott "Skippy" Merrill
    Author: Mark Jaquith
    Author URI: http://markjaquith.com/
    */

    /*

    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version 2
    of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

    */


    function get_comment_type_count($type='all', $post_id = 0) {
    global $cjd_comment_count_cache, $id, $post;
    if ( !$post_id )
    $post_id = $post->ID;
    if ( !$post_id )
    return;

    if ( !isset($cjd_comment_count_cache[$post_id]) ) {
    $p = get_post($post_id);
    $p = array($p);
    update_comment_type_cache($p);
    }

    if ( $type == 'pingback' || $type == 'trackback' || $type == 'comment' )
    return $cjd_comment_count_cache[$post_id][$type];
    elseif ( $type == 'ping' )
    return $cjd_comment_count_cache[$post_id]['pingback'] + $cjd_comment_count_cache[$post_id]['trackback'];
    else
    return array_sum((array) $cjd_comment_count_cache[$post_id]);

    }

    function comment_type_count($type = 'all', $post_id = 0) {
    echo get_comment_type_count($type, $post_id);
    }


    function update_comment_type_cache(&$queried_posts) {
    global $cjd_comment_count_cache, $wpdb;

    if ( !$queried_posts )
    return $queried_posts;


    foreach ( (array) $queried_posts as $post )
    if ( !isset($cjd_comment_count_cache[$post->ID]) )
    $post_id_list[] = $post->ID;

    if ( $post_id_list ) {
    $post_id_list = implode(',', $post_id_list);

    foreach ( array('', 'pingback', 'trackback') as $type ) {
    $counts = $wpdb->get_results("SELECT ID, COUNT( comment_ID ) AS ccount
    FROM $wpdb->posts
    LEFT JOIN $wpdb->comments ON ( comment_post_ID = ID AND comment_approved = '1' AND comment_type='$type' )
    WHERE post_status = 'publish' AND ID IN ($post_id_list)
    GROUP BY ID");

    if ( $counts ) {
    if ( '' == $type )
    $type = 'comment';
    foreach ( $counts as $count )
    $cjd_comment_count_cache[$count->ID][$type] = $count->ccount;
    }
    }
    }
    return $queried_posts;
    }
    add_filter('the_posts', 'update_comment_type_cache');

    function catch_that_image ($post_id=0, $width=60, $height=60, $img_script='') {
    global $wpdb;
    if($post_id > 0) {

    // select the post content from the db

    $sql = 'SELECT post_content FROM ' . $wpdb->posts . ' WHERE id = ' . $wpdb->escape($post_id);
    $row = $wpdb->get_row($sql);
    $the_content = $row->post_content;
    if(strlen($the_content)) {

    // use regex to find the src of the image

    preg_match("//", $the_content, $matches);
    if(!$matches) {
    preg_match("//U", $the_content, $matches);
    }

    $the_image = '';
    $the_image_src = $matches[2];
    $frags = preg_split("/(\"|')/", $the_image_src);
    if(count($frags)) {
    $the_image_src = $frags[0];
    }

    // if src found, then create a new img tag

    if(strlen($the_image_src)) {
    if(strlen($img_script)) {

    // if the src starts with http/https, then strip out server name

    if(preg_match("/^(http(|s):\/\/)/", $the_image_src)) {
    $the_image_src = preg_replace("/^(http(|s):\/\/)/", '', $the_image_src);
    $frags = split("\/", $the_image_src);
    array_shift($frags);
    $the_image_src = '/' . join("/", $frags);
    }
    $the_image = '';
    }
    else {
    $the_image = '';
    }
    }
    return $the_image_src;
    }
    }
    }

    function the_content_imgstrip($more_link_text = '', $stripteaser = 0, $more_file = '') {
    $content = get_the_content($more_link_text, $stripteaser, $more_file);
    $content = apply_filters('the_content', $content);
    $content = preg_replace("/]+\>/i", "", $content);
    echo $content;
    }


    /*
    Function Name: getCategories
    Version: 1.0
    Description: Gets the list of categories. Represents a workaround for the get_categories bug in WP 2.8
    Author: Dumitru Brinzan
    Author URI: http://www.brinzan.net
    */

    function getCategories($parent) {

    global $wpdb, $table_prefix;

    $tb1 = "$table_prefix"."terms";
    $tb2 = "$table_prefix"."term_taxonomy";

    if ($parent == '1')
    {
    $qqq = "AND $tb2".".parent = 0";
    }
    else
    {
    $qqq = "";
    }

    $q = "SELECT $tb1.term_id,$tb1.name,$tb1.slug FROM $tb1,$tb2 WHERE $tb1.term_id = $tb2.term_id AND $tb2.taxonomy = 'category' $qqq ORDER BY $tb1.name ASC";
    $q = $wpdb->get_results($q);

    foreach ($q as $cat) {
    $categories[$cat->term_id] = $cat->name;
    } // foreach
    return($categories);
    } // end func

    /*
    Function Name: getPages
    Version: 1.0
    Description: Gets the list of pages. Represents a workaround for the get_categories bug in WP 2.8
    Author: Dumitru Brinzan
    Author URI: http://www.brinzan.net
    */

    function getPages() {

    global $wpdb, $table_prefix;

    $tb1 = "$table_prefix"."posts";

    $q = "SELECT $tb1.ID,$tb1.post_title FROM $tb1 WHERE $tb1.post_type = 'page' AND $tb1.post_status = 'publish' ORDER BY $tb1.post_title ASC";
    $q = $wpdb->get_results($q);

    foreach ($q as $pag) {
    $pages[$pag->ID] = $pag->post_title;
    } // foreach
    return($pages);
    } // end func



    $functions_path = TEMPLATEPATH . '/admin_setup/';
    require_once ($functions_path . 'admin_functions.php');
    $homepath = get_bloginfo('stylesheet_directory');

    add_action('admin_menu', 'wpzoom_add_admin');

    register_sidebar_widget( 'FT: Featured Posts', 'featured_works_side' );
    register_widget_control( 'FT: Featured Posts', 'featured_works_side_admin', 300, 200 );
    register_sidebar_widget( 'FT: Authors List', 'listAuthors' );
    register_widget_control( 'FT: Authors List', 'listAuthors_admin', 300, 200 );
    register_sidebar_widget( 'FT: Recent Comments', 'recent_comments' );
    register_widget_control( 'FT: Recent Comments', 'recent_comments_admin', 300, 200 );
    register_sidebar_widget( 'FT: Recent News', 'recent_news' );
    register_widget_control( 'FT: Recent News', 'recent_news_admin', 300, 200 );
    register_sidebar_widget( 'FT: Social Connections', 'connectWithMe' );
    register_widget_control( 'FT: Social Connections', 'connectWithMe_admin', 300, 200 );

    if ( function_exists('register_sidebar') )

    register_sidebar(array('name'=>'Sidebar: Top Wide',
    'before_widget' => '
    ',
    'after_widget' => '
     
    ',
    'before_title' => '

    ',
    'after_title' => '

    ',
    ));

    register_sidebar(array('name'=>'Sidebar: Bottom Wide',
    'before_widget' => '
    ',
    'after_widget' => '
    ',
    'before_title' => '

    ',
    'after_title' => '

    ',
    ));

    register_sidebar(array('name'=>'Sidebar: Bottom Narrow',
    'before_widget' => '
    ',
    'after_widget' => '
    ',
    'before_title' => '

    ',
    'after_title' => '

    ',
    ));
    ?>
     

     

    blogger blogger Freelancer Kullanıcı
    • Üyelik 26.11.2011
    • Yaş/Cinsiyet 27 / E
    • Meslek Freelancer
    • Konum İstanbul Avrupa
    • Ad Soyad R** Ş**
    • Mesajlar 134
    • Beğeniler 19 / 21
    • Ticaret 1, (%100)
    Düzelmesi gerek.

    add_theme_support( 'post-thumbnails' );

    function normalComments($comment, $args, $depth)
    {
    $GLOBALS['comment'] = $comment;
    global $options;
    foreach ($options as $value) {
    if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); }
    }

    $adminid = explode (",",$wpzoom_admin_ids);
    $oddcomment = 'guest';
    $wrappeddate = wordwrap($comment->comment_date, 10,"
    \n");
    if (in_array($comment->user_id, $adminid)) {$oddcomment = 'author'; }

    $gravatarsize = $wpzoom_comments_gravatar_size;
    $gravatar_id = md5($comment->comment_author_email);
    $gravatar = get_avatar($comment->comment_author_email, $gravatarsize,'');
    echo"
  • $gravatar";
    if($args['max_depth']!=$depth) { ?>
    $depth, 'max_depth' => $args['max_depth']))) ?>

    echo"
    ";
    echo"
    "; if (strlen($comment->comment_author_url) > 10){ echo"comment_author_url."\" rel=\"external,nofollow\">" . $comment->comment_author .""; } else{ echo $comment->comment_author; } echo"

    $wrappeddate
    ";
    echo"
    comment_ID\">";
    echo"

    ".$comment->comment_content."

    ";
    if ($comment->comment_approved == '0') :
    echo"('Your comment is awaiting moderation.')";
    endif;
    echo"
    ";
    echo"
     
    ";
    }

    function normalPings($comment)
    {
    echo"
  • ";?>
    comment_ID\">"; if (strlen($comment->comment_author_url) > 10){ echo"comment_author_url."\" rel=\"external,nofollow\">" . $comment->comment_author .""; } else{ echo $comment->comment_author; } echo"$comment->comment_date";
    echo"

    ".$comment->comment_content."

    ";
    echo"
  • ";
    }

    /*
    Plugin Name: Limit Posts
    Plugin URI: http://labitacora.net/comunBlog/limit-post.phps
    Description: Limits the displayed text length on the index page entries and generates a link to a page to read the full content if its bigger than the selected maximum length.
    Usage: the_content_limit($max_charaters, $more_link)
    Version: 1.1
    Author: Alfonso Sanchez-Paus Diaz y Julian Simon de Castro
    Author URI: http://labitacora.net/
    License: GPL
    Download URL: http://labitacora.net/comunBlog/limit-post.phps
    Make:
    In file index.php
    replace the_content()
    with the_content_limit(1000, "more")
    */

    function the_content_limit($max_char, $more_link_text = '(more...)', $stripteaser = 0, $more_file = '') {
    $content = get_the_content($more_link_text, $stripteaser, $more_file);
    $content = apply_filters('the_content', $content);
    $content = str_replace(']]>', ']]>', $content);
    $content = strip_tags($content);

    if (strlen($_GET['p']) > 0 && $thisshouldnotapply) {
    echo $content;
    }
    else if ((strlen($content)>$max_char) && ($espacio = strpos($content, " ", $max_char ))) {
    $content = substr($content, 0, $espacio);
    $content = $content;
    echo $content;
    echo "...";
    }
    else {
    echo $content;
    }
    }

    function dp_recent_comments($no_comments = 10, $comment_len = 90) {
    global $wpdb;

    $request = "SELECT * FROM $wpdb->comments";
    $request .= " JOIN $wpdb->posts ON ID = comment_post_ID";
    $request .= " WHERE comment_approved = '1' AND post_status = 'publish' AND post_password ='' AND comment_type = ''";
    $request .= " ORDER BY comment_date DESC LIMIT $no_comments";

    $comments = $wpdb->get_results($request);

    echo "$before_title"."$settings[title]"."$after_title";
    if ($comments) {
    foreach ($comments as $comment) {

    // print_r($comment);
    ob_start();
    ?>



  •  


  • ob_end_flush();
    }
    } else {
    echo "
  • No comments
  • ";
    }
    }

    function dp_get_author($comment) {
    $author = "";

    if ( empty($comment->comment_author) )
    $author = __('Anonymous');
    else
    $author = $comment->comment_author;

    return $author;
    }

    function wp_get_related_posts() {
    global $wpdb, $post,$table_prefix;
    $wp_rp = get_option("wp_rp");

    $exclude = explode(",",$wp_rp["wp_rp_exclude"]);
    $limit = $wp_rp["wp_rp_limit"];
    $wp_rp_title = $wp_rp["wp_rp_title"];
    $wp_no_rp = $wp_rp["wp_no_rp"];
    $wp_no_rp_text = $wp_rp["wp_no_rp_text"];
    $show_date = $wp_rp["wp_rp_date"];
    $show_comments_count = $wp_rp["wp_rp_comments"];

    if ( $exclude != '' ) {
    $q = "SELECT tt.term_id FROM ". $table_prefix ."term_taxonomy tt, " . $table_prefix . "term_relationships tr WHERE tt.taxonomy = 'category' AND tt.term_taxonomy_id = tr.term_taxonomy_id AND tr.object_id = $post->ID";

    $cats = $wpdb->get_results($q);

    foreach(($cats) as $cat) {
    if (in_array($cat->term_id, $exclude) != false){
    return;
    }
    }
    }

    if(!$post->ID){return;}
    $now = current_time('mysql', 1);
    $tags = wp_get_post_tags($post->ID);

    //print_r($tags);

    $taglist = "'" . $tags[0]->term_id. "'";

    $tagcount = count($tags);
    if ($tagcount > 1) {
    for ($i = 1; $i <= $tagcount; $i++) {
    $taglist = $taglist . ", '" . $tags[$i]->term_id . "'";
    }
    }

    if ($limit) {
    $limitclause = "LIMIT $limit";
    } else {
    $limitclause = "LIMIT 10";
    }

    $q = "SELECT p.ID, p.post_title, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM $wpdb->term_taxonomy t_t, $wpdb->term_relationships t_r, $wpdb->posts p WHERE t_t.taxonomy ='post_tag' AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND (t_t.term_id IN ($taglist)) AND p.ID != $post->ID AND p.post_status = 'publish' AND p.post_date_gmt < '$now' GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC $limitclause;";

    //echo $q;

    $related_posts = $wpdb->get_results($q);
    $output = "";

    if (!$related_posts){

    if(!$wp_no_rp || ($wp_no_rp == "popularity" && !function_exists('akpc_most_popular'))) $wp_no_rp = "text";

    if($wp_no_rp == "text"){
    if(!$wp_no_rp_text) $wp_no_rp_text= __("No Related Post",'wp_related_posts');
    // $output .= '
  • '.$wp_no_rp_text .'
  • ';
    } else{
    if($wp_no_rp == "random"){
    if(!$wp_no_rp_text) $wp_no_rp_text= __("Random Posts",'wp_related_posts');
    $related_posts = wp_get_random_posts($limitclause);
    } elseif($wp_no_rp == "commented"){
    if(!$wp_no_rp_text) $wp_no_rp_text= __("Most Commented Posts",'wp_related_posts');
    $related_posts = wp_get_most_commented_posts($limitclause);
    } elseif($wp_no_rp == "popularity"){
    if(!$wp_no_rp_text) $wp_no_rp_text= __("Most Popular Posts",'wp_related_posts');
    $related_posts = wp_get_most_popular_posts($limitclause);
    }else{
    return __("Something wrong",'wp_related_posts');;
    }
    $wp_rp_title = $wp_no_rp_text;
    }
    }

    foreach ($related_posts as $related_post ){
    $output .= '
  • ';

    if ($show_date){
    $dateformat = get_option('date_format');
    $output .= mysql2date($dateformat, $related_post->post_date) . " -- ";
    }

    $output .= ''.wptexturize($related_post->post_title).'';

    if ($show_comments_count){
    $output .= " (" . $related_post->comment_count . ")";
    }

    $output .= '
  • ';
    }

    $output = '

    Related Posts:

      ' . $output . '
    ';

    if($wp_rp_title != '') $output = '

    '.$wp_rp_title .'

    '. $output;

    return $output;
    }

    function wp_related_posts(){

    $output = wp_get_related_posts() ;

    echo $output;
    }

    function wp_related_posts_auto($content=""){
    $wp_rp = get_option("wp_rp");
    $wp_rp_auto = ($wp_rp["wp_rp_auto"] == 'yes') ? 1 : 0;
    if ( (! is_single()) || (! $wp_rp_auto)) return $content;

    $output = wp_get_related_posts() ;
    $content = $content . $output;

    return $content;
    }

    /*
    Recent News Widget
    */

    function recent_news($args) {


    extract($args);
    $settings = get_option( 'widget_recent_news' );
    $number = $settings['number'];

    echo $before_widget;
    echo "$before_title"."$settings[title]"."$after_title";

    ?>
    $recent = new WP_Query("showposts=$number&orderby=id&order=DESC" );
    while( $recent->have_posts() ) : $recent->the_post();
    global $post; global $wp_query;

    unset($img);
    if ($wpzoom_cf_use == 'Yes')
    {
    $img = get_post_meta($post->ID, $wpzoom_cf_photo, true);
    }
    else
    {
    if (!$img)
    {
    $img = catch_that_image($post->ID);
    }
    }
    ?>





    endwhile;
    wp_reset_query(); ?>
    echo $after_widget;
    }

    function recent_news_admin() {

    $settings = get_option( 'widget_recent_news' );

    if( isset( $_POST[ 'update_recent_news' ] ) ) {
    $settings[ 'title' ] = strip_tags( stripslashes( $_POST[ 'widget_recent_news_title' ] ) );
    $settings[ 'number' ] = strip_tags( stripslashes( $_POST[ 'widget_recent_news_number' ] ) );
    update_option( 'widget_recent_news', $settings );
    }
    ?>













    /* Recent Comments Widget
    -----------------------------*/

    function recent_comments($args) {

    extract($args);
    $settings = get_option( 'widget_recent_comments' );

    echo $before_widget;
    echo "$before_title"."$settings[title]"."$after_title";
    ?>



    echo $after_widget;

    }

    function recent_comments_admin() {
    $settings = get_option( 'widget_recent_comments' );

    if( isset( $_POST[ 'update_recent_news' ] ) ) {
    $settings[ 'title' ] = strip_tags( stripslashes( $_POST[ 'widget_rec_comments' ] ) );
    $settings[ 'number' ] = strip_tags( stripslashes( $_POST[ 'widget_rec_comments_num' ] ) );
    update_option( 'widget_recent_comments', $settings );
    }

    ?>












    /* Recent Comments Widget
    -----------------------------*/

    function connectWithMe($args) {

    extract($args);
    $settings = get_option( 'widget_social_connect' );

    echo $before_widget;
    echo "$before_title"."$settings[title]"."$after_title";
    ?>

     

    echo $after_widget;

    }

    function connectWithMe_admin() {
    $settings = get_option( 'widget_social_connect' );

    if( isset( $_POST[ 'update_social_connect' ] ) ) {
    $settings[ 'title' ] = strip_tags( stripslashes( $_POST[ 'widget_social_connect_title' ] ) );
    $settings[ 'delicious' ] = strip_tags( stripslashes( $_POST[ 'widget_social_connect_delicious' ] ) );
    $settings[ 'digg' ] = strip_tags( stripslashes( $_POST[ 'widget_social_connect_digg' ] ) );
    $settings[ 'facebook' ] = strip_tags( stripslashes( $_POST[ 'widget_social_connect_facebook' ] ) );
    $settings[ 'flickr' ] = strip_tags( stripslashes( $_POST[ 'widget_social_connect_flickr' ] ) );
    $settings[ 'lastfm' ] = strip_tags( stripslashes( $_POST[ 'widget_social_connect_lastfm' ] ) );
    $settings[ 'linkedin' ] = strip_tags( stripslashes( $_POST[ 'widget_social_connect_linkedin' ] ) );
    $settings[ 'myspace' ] = strip_tags( stripslashes( $_POST[ 'widget_social_connect_myspace' ] ) );
    $settings[ 'reddit' ] = strip_tags( stripslashes( $_POST[ 'widget_social_connect_reddit' ] ) );
    $settings[ 'stumble' ] = strip_tags( stripslashes( $_POST[ 'widget_social_connect_stumble' ] ) );
    $settings[ 'technorati' ] = strip_tags( stripslashes( $_POST[ 'widget_social_connect_technorati' ] ) );
    $settings[ 'twitter' ] = strip_tags( stripslashes( $_POST[ 'widget_social_connect_twitter' ] ) );
    $settings[ 'youtube' ] = strip_tags( stripslashes( $_POST[ 'widget_social_connect_youtube' ] ) );
    update_option( 'widget_social_connect', $settings );
    }

    ?>

























































    /* Popular News
    ----------------------*/

    function ft_popular_posts ($args) {

    extract($args);

    global $wpzoom_cf_photo;

    // Extract widget options
    $options = get_option('ft_popular_posts_options');
    $title = $options['title'];
    $maxposts = $options['maxposts'];
    $timeline = $options['sincewhen'];

    // Generate output
    echo $before_widget;
    echo "$before_title"."$title"."$after_title";
    echo "
      \n";

      global $wpdb;
      $sql = "SELECT ID, post_title, comment_count FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' ";

      // What's the chosen timeline?
      switch ($timeline) {
      case "thismonth":
      $sql .= "AND MONTH(post_date) = MONTH(NOW()) AND YEAR(post_date) = YEAR(NOW()) ";
      break;
      case "thisyear":
      $sql .= "AND YEAR(post_date) = YEAR(NOW()) ";
      break;
      default:
      $sql .= "";
      }

      // Make sure only integers are entered
      if (!ctype_digit($maxposts)) {
      $maxposts = 10;
      } else {
      // Reformat the submitted text value into an integer
      $maxposts = $maxposts + 0;
      // Only accept sane values
      if ($maxposts <= 0 or $maxposts > 10) {
      $maxposts = 10;
      }
      }

      $sql .= "AND comment_count > 0 ORDER BY comment_count DESC LIMIT ". $maxposts;

      $res = $wpdb->get_results($sql);

      if($res) {
      $mcpcounter = 1;
      foreach ($res as $r) {

      $img = get_post_meta($r->ID, "$wpzoom_cf_photo", true);

      ?>




    • post_title, ENT_QUOTES); ?>




       


    • }
      } else {
      echo "
    • ". __('No commented posts yet') . "
    • \n";
      }

      echo "
    \n";
    echo $after_widget;
    }


    function ft_popular_posts_admin() {

    // Get our options and see if we're handling a form submission.
    $options = get_option('ft_popular_posts_options');
    if ( !is_array($options) )
    $options = array(
    'title'=>__('Popular Posts'),
    'sincewhen' => 'forever',
    'maxposts'=> 10
    );
    if ( $_POST['htnetmcp-submit'] ) {

    // Remember to sanitize and format use input appropriately.
    $options['title'] = strip_tags(stripslashes($_POST['htnetmcp-title']));
    $options['sincewhen'] = strip_tags(stripslashes($_POST['htnetmcp-sincewhen']));
    $options['maxposts'] = strip_tags(stripslashes($_POST['htnetmcp-maxposts']));
    update_option('ft_popular_posts_options', $options);
    }

    // Be sure you format your options to be valid HTML attributes.
    $title = htmlspecialchars($options['title'], ENT_QUOTES);
    $sincewhen = htmlspecialchars($options['sincewhen'], ENT_QUOTES);
    $maxposts = htmlspecialchars($options['maxposts'], ENT_QUOTES);

    // Here is our little form segment. Notice that we don't need a form. This will be embedded into the existing form.
    echo '

    ';

    echo '

    ';

    echo '

    ';
    echo '';
    }

    // ADD OPTIONS FOR THE FEATURED POSTS WIDGET
    $widget_featured_posts_options = array(
    'featured_works_tag_slug' => "featured",
    'featured_works_side' => "6",
    'featured_works_title' => "Featured Posts");
    add_option('widget_featured_works_settings', $widget_featured_posts_options );

    function featured_works_side($args) {

    extract($args);

    $widget_settings = get_option( 'widget_featured_works_settings' );
    $breaking_tag = $widget_settings['featured_works_tag_slug'];
    $breaking_num = $widget_settings['featured_works_side'];

    $args = array('showposts' => $breaking_num, 'orderby' => 'date', 'order' => 'DESC', 'tag' => $breaking_tag);
    $featuredpostsright = new WP_Query($args);

    if ($featuredpostsright->have_posts()){


    global $wpzoom_cf_photo;
    // Generate output
    echo $before_widget;
    echo "$before_title"."$widget_settings[featured_works_title]"."$after_title";

    while ($featuredpostsright->have_posts()) : $featuredpostsright->the_post(); ?>

    global $post;
    unset($img);
    if ($wpzoom_cf_use == 'Yes')
    {
    $img = get_post_meta($post->ID, $wpzoom_cf_photo, true);
    }
    else
    {
    if (!$img)
    {
    $img = catch_that_image($post->ID);
    }
    }
    if ($img) : ?>
    <?php the_title(); ?>





     


    echo $after_widget;
    } // if have_posts
    wp_reset_query();
    }

    function featured_works_side_admin() {

    $widget_settings = get_option( 'widget_featured_works_settings' );
    if( isset( $_POST[ 'widget_update_featured' ] ) ) {
    $widget_settings['featured_works_side'] = strip_tags( stripslashes( $_POST[ 'featured_works_side' ] ) );
    $widget_settings['featured_works_tag_slug'] = strip_tags( stripslashes( $_POST[ 'featured_works_tag_slug' ] ) );
    $widget_settings['featured_works_title'] = strip_tags( stripslashes( $_POST[ 'featured_works_title' ] ) );
    update_option( 'widget_featured_works_settings', $widget_settings );
    }
    ?>


    " />



    " />



    " />




    }

    /*
    Plugin Name: Ping/Track/Comment Count
    Plugin URI: http://txfx.net/code/wordpress/ping-...comment-count/
    Version: 1.1
    Description: Provides unctions that return or display the number of trackbacks, pingbacks, comments or combined pings recieved by a given post. Other authors: Chris J. Davis, Scott "Skippy" Merrill
    Author: Mark Jaquith
    Author URI: http://markjaquith.com/
    */

    /*

    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version 2
    of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

    */


    function get_comment_type_count($type='all', $post_id = 0) {
    global $cjd_comment_count_cache, $id, $post;
    if ( !$post_id )
    $post_id = $post->ID;
    if ( !$post_id )
    return;

    if ( !isset($cjd_comment_count_cache[$post_id]) ) {
    $p = get_post($post_id);
    $p = array($p);
    update_comment_type_cache($p);
    }

    if ( $type == 'pingback' || $type == 'trackback' || $type == 'comment' )
    return $cjd_comment_count_cache[$post_id][$type];
    elseif ( $type == 'ping' )
    return $cjd_comment_count_cache[$post_id]['pingback'] + $cjd_comment_count_cache[$post_id]['trackback'];
    else
    return array_sum((array) $cjd_comment_count_cache[$post_id]);

    }

    function comment_type_count($type = 'all', $post_id = 0) {
    echo get_comment_type_count($type, $post_id);
    }


    function update_comment_type_cache($queried_posts) {
    global $cjd_comment_count_cache, $wpdb;

    if ( !$queried_posts )
    return $queried_posts;


    foreach ( (array) $queried_posts as $post )
    if ( !isset($cjd_comment_count_cache[$post->ID]) )
    $post_id_list[] = $post->ID;

    if ( $post_id_list ) {
    $post_id_list = implode(',', $post_id_list);

    foreach ( array('', 'pingback', 'trackback') as $type ) {
    $counts = $wpdb->get_results("SELECT ID, COUNT( comment_ID ) AS ccount
    FROM $wpdb->posts
    LEFT JOIN $wpdb->comments ON ( comment_post_ID = ID AND comment_approved = '1' AND comment_type='$type' )
    WHERE post_status = 'publish' AND ID IN ($post_id_list)
    GROUP BY ID");

    if ( $counts ) {
    if ( '' == $type )
    $type = 'comment';
    foreach ( $counts as $count )
    $cjd_comment_count_cache[$count->ID][$type] = $count->ccount;
    }
    }
    }
    return $queried_posts;
    }
    add_filter('the_posts', 'update_comment_type_cache');

    function catch_that_image ($post_id=0, $width=60, $height=60, $img_script='') {
    global $wpdb;
    if($post_id > 0) {

    // select the post content from the db

    $sql = 'SELECT post_content FROM ' . $wpdb->posts . ' WHERE id = ' . $wpdb->escape($post_id);
    $row = $wpdb->get_row($sql);
    $the_content = $row->post_content;
    if(strlen($the_content)) {

    // use regex to find the src of the image

    preg_match("//", $the_content, $matches);
    if(!$matches) {
    preg_match("//U", $the_content, $matches);
    }

    $the_image = '';
    $the_image_src = $matches[2];
    $frags = preg_split("/(\"|')/", $the_image_src);
    if(count($frags)) {
    $the_image_src = $frags[0];
    }

    // if src found, then create a new img tag

    if(strlen($the_image_src)) {
    if(strlen($img_script)) {

    // if the src starts with http/https, then strip out server name

    if(preg_match("/^(http(|s):\/\/)/", $the_image_src)) {
    $the_image_src = preg_replace("/^(http(|s):\/\/)/", '', $the_image_src);
    $frags = split("\/", $the_image_src);
    array_shift($frags);
    $the_image_src = '/' . join("/", $frags);
    }
    $the_image = '';
    }
    else {
    $the_image = '';
    }
    }
    return $the_image_src;
    }
    }
    }

    function the_content_imgstrip($more_link_text = '', $stripteaser = 0, $more_file = '') {
    $content = get_the_content($more_link_text, $stripteaser, $more_file);
    $content = apply_filters('the_content', $content);
    $content = preg_replace("/]+\>/i", "", $content);
    echo $content;
    }


    /*
    Function Name: getCategories
    Version: 1.0
    Description: Gets the list of categories. Represents a workaround for the get_categories bug in WP 2.8
    Author: Dumitru Brinzan
    Author URI: http://www.brinzan.net
    */

    function getCategories($parent) {

    global $wpdb, $table_prefix;

    $tb1 = "$table_prefix"."terms";
    $tb2 = "$table_prefix"."term_taxonomy";

    if ($parent == '1')
    {
    $qqq = "AND $tb2".".parent = 0";
    }
    else
    {
    $qqq = "";
    }

    $q = "SELECT $tb1.term_id,$tb1.name,$tb1.slug FROM $tb1,$tb2 WHERE $tb1.term_id = $tb2.term_id AND $tb2.taxonomy = 'category' $qqq ORDER BY $tb1.name ASC";
    $q = $wpdb->get_results($q);

    foreach ($q as $cat) {
    $categories[$cat->term_id] = $cat->name;
    } // foreach
    return($categories);
    } // end func

    /*
    Function Name: getPages
    Version: 1.0
    Description: Gets the list of pages. Represents a workaround for the get_categories bug in WP 2.8
    Author: Dumitru Brinzan
    Author URI: http://www.brinzan.net
    */

    function getPages() {

    global $wpdb, $table_prefix;

    $tb1 = "$table_prefix"."posts";

    $q = "SELECT $tb1.ID,$tb1.post_title FROM $tb1 WHERE $tb1.post_type = 'page' AND $tb1.post_status = 'publish' ORDER BY $tb1.post_title ASC";
    $q = $wpdb->get_results($q);

    foreach ($q as $pag) {
    $pages[$pag->ID] = $pag->post_title;
    } // foreach
    return($pages);
    } // end func



    $functions_path = TEMPLATEPATH . '/admin_setup/';
    require_once ($functions_path . 'admin_functions.php');
    $homepath = get_bloginfo('stylesheet_directory');

    add_action('admin_menu', 'wpzoom_add_admin');

    register_sidebar_widget( 'FT: Featured Posts', 'featured_works_side' );
    register_widget_control( 'FT: Featured Posts', 'featured_works_side_admin', 300, 200 );
    register_sidebar_widget( 'FT: Authors List', 'listAuthors' );
    register_widget_control( 'FT: Authors List', 'listAuthors_admin', 300, 200 );
    register_sidebar_widget( 'FT: Recent Comments', 'recent_comments' );
    register_widget_control( 'FT: Recent Comments', 'recent_comments_admin', 300, 200 );
    register_sidebar_widget( 'FT: Recent News', 'recent_news' );
    register_widget_control( 'FT: Recent News', 'recent_news_admin', 300, 200 );
    register_sidebar_widget( 'FT: Social Connections', 'connectWithMe' );
    register_widget_control( 'FT: Social Connections', 'connectWithMe_admin', 300, 200 );

    if ( function_exists('register_sidebar') )

    register_sidebar(array('name'=>'Sidebar: Top Wide',
    'before_widget' => '
    ',
    'after_widget' => '
     
    ',
    'before_title' => '

    ',
    'after_title' => '

    ',
    ));

    register_sidebar(array('name'=>'Sidebar: Bottom Wide',
    'before_widget' => '
    ',
    'after_widget' => '
    ',
    'before_title' => '

    ',
    'after_title' => '

    ',
    ));

    register_sidebar(array('name'=>'Sidebar: Bottom Narrow',
    'before_widget' => '
    ',
    'after_widget' => '
    ',
    'before_title' => '

    ',
    'after_title' => '

    ',
    ));
    ?>
     

     

    interplus interplus Üyeliği Durdurulmuş Banlı Kullanıcı
    • Üyelik 10.12.2012
    • Yaş/Cinsiyet 36 / E
    • Meslek Öğrenci
    • Konum Eskişehir
    • Ad Soyad ** **
    • Mesajlar 107
    • Beğeniler 40 / 21
    • Ticaret 1, (%100)
    Hocam ne kadar dua etsem azdır, çok çok sağol düzeldi problem kalmadı
    blogger

    kişi bu mesajı beğendi.

    blogger blogger Freelancer Kullanıcı
    • Üyelik 26.11.2011
    • Yaş/Cinsiyet 27 / E
    • Meslek Freelancer
    • Konum İstanbul Avrupa
    • Ad Soyad R** Ş**
    • Mesajlar 134
    • Beğeniler 19 / 21
    • Ticaret 1, (%100)
    Rica ederim hocam. Kolay gelsin.
     

     

    wmaraci
    wmaraci
    Konuyu toplam 1 kişi okuyor. (0 kullanıcı ve 1 misafir)
    Site Ayarları
    • Tema Seçeneği
    • Site Sesleri
    • Bildirimler
    • Özel Mesaj Al