wpQuiz v2.60b8

Konfiguracja e107.
proquiz
Posty: 5
Rejestracja: 20 sty 2015, 14:44:38
Płeć: Niewybrana
User Agent: Firefox Windows

wpQuiz v2.60b8

Post autor: proquiz »

Usiłuję zainstalowac skrypt wpQuiz v2.60b8 na serwerze
dostaje taki komunikat:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /virtual/proquiz.cba.pl/lib/templates.php on line 27

Co moge na to poradzic?

Zawartosc pliku templates.php

Kod: Zaznacz cały

<?php

/*************************************************

                      wpQuiz
__________________________________________________

file     : templates.php
desc.    : gets templates

website  : http://www.wplastik.com
e-mail   : jcccf@hotmail.com


*************************************************/

function loadTemplates() {
    global $templates;
    if( !isset($_SESSION['user']) || $_SESSION['user'] == "" ){
        $selected = "templates";
    }
    else{
        $selected = mysql_fetch_array(mysql_query("SELECT * FROM users WHERE user='".$_SESSION['user']."'"));
        $selected = $selected['template'];        
    }
    $loadTemplates = mysql_query("SELECT * FROM $selected");
    while( $aloadTemplates = mysql_fetch_array($loadTemplates) ){
        $templates[$aloadTemplates['name']] = $aloadTemplates['code'];
    }
}

function getTemplate($name) {
    global $templates;
    global $templatecache;
    if( !isset($GLOBALS['templates']) ){
        loadTemplates();
    }
    if( !isset($templatecache[$name]) ){
        $template = $templates[$name];
        $templates = str_replace("$","$",$templates);
        $tempvars = explode('<!--{',$template);
        $id = 0;
        foreach($tempvars as $tempvars2){
            if($id<>0){
                $tempvars3 = explode('}-->',$tempvars2);
                $tempvars4 = mysql_fetch_array(mysql_query("SELECT COUNT(*) as numfound FROM templates WHERE name='".$tempvars3[0]."'"));
                $count = $tempvars4['numfound'];
                if($count != 0){
                    $tempreplace = getTemplate($tempvars3[0]);
                    $tempreplace = stripslashes($tempreplace);
                }
                else{
                    $tempreplace = "\$".$tempvars3[0];
                }
                $template = str_replace("<!--{".$tempvars3[0]."}-->","$tempreplace",$template);
            }
            $id++;
        }
        $template = addslashes($template);
        $template = str_replace("{DQUOTE}","'",$template);
        $templatecache[$name] = $template;
    }
    else{
        $template = $templatecache[$name];
    }
    $GLOBALS['templatecount']++;
    //return addslashes($template);
    return $te<?php

/*************************************************

                      wpQuiz
__________________________________________________

file     : templates.php
desc.    : gets templates

website  : http://www.wplastik.com
e-mail   : jcccf@hotmail.com


*************************************************/

function loadTemplates() {
    global $templates;
    if( !isset($_SESSION['user']) || $_SESSION['user'] == "" ){
        $selected = "templates";
    }
    else{
        $selected = mysql_fetch_array(mysql_query("SELECT * FROM users WHERE user='".$_SESSION['user']."'"));
        $selected = $selected['template'];        
    }
    $loadTemplates = mysql_query("SELECT * FROM $selected");
    while( $aloadTemplates = mysql_fetch_array($loadTemplates) ){
        $templates[$aloadTemplates['name']] = $aloadTemplates['code'];
    }
}

function getTemplate($name) {
    global $templates;
    global $templatecache;
    if( !isset($GLOBALS['templates']) ){
        loadTemplates();
    }
    if( !isset($templatecache[$name]) ){
        $template = $templates[$name];
        $templates = str_replace("$","$",$templates);
        $tempvars = explode('<!--{',$template);
        $id = 0;
        foreach($tempvars as $tempvars2){
            if($id<>0){
                $tempvars3 = explode('}-->',$tempvars2);
                $tempvars4 = mysql_fetch_array(mysql_query("SELECT COUNT(*) as numfound FROM templates WHERE name='".$tempvars3[0]."'"));
                $count = $tempvars4['numfound'];
                if($count != 0){
                    $tempreplace = getTemplate($tempvars3[0]);
                    $tempreplace = stripslashes($tempreplace);
                }
                else{
                    $tempreplace = "\$".$tempvars3[0];
                }
                $template = str_replace("<!--{".$tempvars3[0]."}-->","$tempreplace",$template);
            }
            $id++;
        }
        $template = addslashes($template);
        $template = str_replace("{DQUOTE}","'",$template);
        $templatecache[$name] = $template;
    }
    else{
        $template = $templatecache[$name];
    }
    $GLOBALS['templatecount']++;
    //return addslashes($template);
    return $template;
}
?>mplate;
}
?>
Linia 27 jak mowi komunikat to:

Kod: Zaznacz cały

$templates[$aloadTemplates['name']]&nbsp;=&nbsp;$aloadTemplates['code'];&nbsp; 
---- EDIT ----

Niech mi ktos pomoze :)
ODPOWIEDZ