Błąd w kodzie ? Wielki probel...?


(Alirek) #1

Witam !

Mam problem.

Próbowałem wrzucić CMS na ftp i go odpalić na www

ale wysakuje mi ten błąd :

Parse error: syntax error, unexpected ';' in /home/alirekk/domains/enuta.eu/public_html/mp3/include/config.php on line 54

Oto linijka 54 :

require_once($config[basedir].'/libraries/mysmarty.class.php';

A o to cały kod :

<?

session_start();

$config = array();


// Begin Configuration

$config['basedir'] = '/home/username/public_html';

$config['baseurl'] = 'http://www.decodethe.net/audiosharescript/';


$DBTYPE = 'mysql';

$DBHOST = 'localhost';

$DBUSER = 'alirekk_wortal';

$DBPASSWORD = ' ******';

$DBNAME = 'alirekk_mp3';

// End Configuration


$config['adminurl'] = $config[baseurl].'/administrator';

$config['cssurl'] = $config[baseurl].'/css';

$config['tmpimgpath'] = $config['basedir'].'/uploads/temp';

$config['tmpimgpath2'] = $config['basedir'].'/uploads/temp';

$config['imagedir'] = $config[basedir].'/images';

$config['imageurl'] = $config[baseurl].'/images';

$config['avatardir'] = $config[imagedir].'/avatars';

$config['avatarurl'] = $config[imageurl].'/avatars';

$config['cavatardir'] = $config[imagedir].'/members';

$config['cavatarurl'] = $config[imageurl].'/members';

$config['membersprofilepicdir'] = $config[imagedir].'/membersprofilepic';

$config['membersprofilepicurl'] = $config[imageurl].'/membersprofilepic';

$config['channeldir'] = $config[imagedir].'/channels';

$config['channelurl'] = $config[imageurl].'/channels';

$config['originalvdir'] = $config[basedir].'/uploads/video';

$config['originalvurl'] = $config[baseurl].'/uploads/video';

$config['profilebgdir'] = '/profilebg/';

$config['channelbgdir'] = '/channelbg/';

$config['channelbgurl'] = $config[imageurl].'/channelbg';

$config['videodir'] = $config[basedir].'/vdata';

$config['videourl'] = $config[baseurl].'/vdata';

$config['thumbdir'] = $config[imagedir].'/videothumbs';

$config['thumburl'] = $config[imageurl].'/videothumbs';

$config['cthumburl'] = $config[imageurl].'/channels';

$config['originaladir'] = $config[basedir].'/uploads/audio';

$config['originalaurl'] = $config[baseurl].'/uploads/audio';

$config['audiodir'] = $config[basedir].'/adata';

$config['audiourl'] = $config[baseurl].'/adata';

$config['athumbdir'] = $config[imagedir].'/audiothumbs';

$config['athumburl'] = $config[imageurl].'/audiothumbs';

$config['originalpdir'] = $config[basedir].'/uploads/picture';

$config['originalpurl'] = $config[baseurl].'/uploads/picture';

$config['picturedir'] = $config[basedir].'/pdata';

$config['pictureurl'] = $config[baseurl].'/pdata';

$config['pthumbdir'] = $config[imagedir].'/picturethumbs';

$config['pthumburl'] = $config[imageurl].'/picturethumbs';


[size=150]

[b]require_once($config[basedir].'/libraries/mysmarty.class.php';[/b][/size]

require_once($config[basedir].'/libraries/SConfig.php');

require_once($config[basedir].'/libraries/SError.php');

require_once($config[basedir].'/libraries/adodb/adodb.inc.php');

require_once($config[basedir].'/libraries/phpmailer/class.phpmailer.php');

require_once($config[basedir].'/libraries/SEmail.php');


function strip_mq_gpc($arg)

{

  if (get_magic_quotes_gpc())

  {

  	$arg = str_replace('"',"'",$arg);

  	$arg = stripslashes($arg);

    return $arg;

  } 

  else

  {

    $arg = str_replace('"',"'",$arg);

    return $arg;

  }

}


$conn = &ADONewConnection($DBTYPE);

$conn->PConnect($DBHOST, $DBUSER, $DBPASSWORD, $DBNAME);

@mysql_query("SET NAMES 'UTF8'");

$sql = "SELECT * from config";

$rsc = $conn->Execute($sql);


if($rsc){while(!$rsc->EOF)

{

$field = $rsc->fields['setting'];

$config[$field] = $rsc->fields['value'];

STemplate::assign($field, strip_mq_gpc($config[$field]));

@$rsc->MoveNext();

}}



if ($_REQUEST['language'] != "")

{

	if ($_REQUEST['language'] == "english")

	{

		SESSION_REGISTER("language");

		$_SESSION[language] = "english";

	}

	elseif ($_REQUEST['language'] == "spanish")

	{

		SESSION_REGISTER("language");

		$_SESSION[language] = "spanish";

	}

}


if ($_SESSION['language'] == "")

{

	SESSION_REGISTER("language");

	$_SESSION[language] = "english";

}


if ($_SESSION['language'] == "english")

{

include("lang/english.php");

}

elseif ($_SESSION['language'] == "spanish")

{

include("lang/spanish.php");

}

else

{

include("lang/english.php");

}


for ($i=0; $i
{

	STemplate::assign('lang'.$i, $lang[$i]);

}


for ($i=0; $i
{

	STemplate::assign('langev'.$i, $langev[$i]);

}


STemplate::assign('baseurl', $config['baseurl']);

STemplate::assign('basedir', $config['basedir']);

STemplate::assign('adminurl', $config['adminurl']);

STemplate::assign('cssurl', $config['cssurl']);

STemplate::assign('tmpimgpath', $config['tmpimgpath']);

STemplate::assign('tmpimgpath2', $config['tmpimgpath2']);

STemplate::assign('imagedir', $config['imagedir']);

STemplate::assign('imageurl', $config['imageurl']);

STemplate::assign('imgpath', $config['imgpath']);

STemplate::assign('avatardir', $config['avatardir']);

STemplate::assign('avatarurl', $config['avatarurl']);

STemplate::assign('cavatardir', $config['cavatardir']);

STemplate::assign('cavatarurl', $config['cavatarurl']);

STemplate::assign('membersprofilepicdir', $config['membersprofilepicdir']);

STemplate::assign('membersprofilepicurl', $config['membersprofilepicurl']);

STemplate::assign('channeldir', $config['channeldir']);

STemplate::assign('channelurl', $config['channelurl']);

STemplate::assign('originalvdir', $config['originalvdir']);

STemplate::assign('originalvurl', $config['originalvurl']);

STemplate::assign('profilebgdir', $config['profilebgdir']);

STemplate::assign('channelbgdir', $config['channelbgdir']);

STemplate::assign('channelbgurl', $config['channelbgurl']);

STemplate::assign('videodir', $config['videodir']);

STemplate::assign('videourl', $config['videourl']);

STemplate::assign('thumbdir', $config['thumbdir']);

STemplate::assign('thumburl', $config['thumburl']);

STemplate::assign('vthumburl', $config['thumburl']);

STemplate::assign('cthumburl', $config['cthumburl']);

STemplate::assign('originaladir', $config['originaladir']);

STemplate::assign('originalaurl', $config['originalaurl']);

STemplate::assign('audiodir', $config['audiodir']);

STemplate::assign('audiourl', $config['audiourl']);

STemplate::assign('athumbdir', $config['athumbdir']);

STemplate::assign('athumburl', $config['athumburl']);

STemplate::assign('originalpdir', $config['originalpdir']);

STemplate::assign('originalpurl', $config['originalpurl']);

STemplate::assign('picturedir', $config['picturedir']);

STemplate::assign('pictureurl', $config['pictureurl']);

STemplate::assign('pthumbdir', $config['pthumbdir']);

STemplate::assign('pthumburl', $config['pthumburl']);

STemplate::setCompileDir($config['basedir']."/temporary");

STemplate::setTplDir($config['basedir']."/themes");


function create_slrememberme() {

        $key = md5(uniqid(rand(), true));

        global $conn;

        $sql="update members set remember_me_time='".date('Y-m-d H:i:s')."', remember_me_key='".$key."' WHERE username='".mysql_real_escape_string($_SESSION[USERNAME])."'";

        $conn->execute($sql);

        setcookie('slrememberme', gzcompress(serialize(array($_SESSION[USERNAME], $key)), 9), time()+60*60*24*30);

}


function destroy_slrememberme($username) {

        if (strlen($username) > 0) {

                global $conn;

                $sql="update members set remember_me_time=NULL, remember_me_key=NULL WHERE username='".mysql_real_escape_string($username)."'";

                $conn->execute($sql);

        }

        setcookie ("slrememberme", "", time() - 3600);

}


if (!isset($_SESSION["USERNAME"]) && isset($_COOKIE['slrememberme'])) 

{

        $sql="update members set remember_me_time=NULL and remember_me_key=NULL WHERE remember_me_time<'".date('Y-m-d H:i:s', mktime(0, 0, 0, date("m")-1, date("d"), date("Y")))."'";

        $conn->execute($sql);

        list($username, $key) = @unserialize(gzuncompress(stripslashes($_COOKIE['slrememberme'])));

        if (strlen($username) > 0 && strlen($key) > 0)

		{

        	$sql="SELECT * from members WHERE username='".mysql_real_escape_string($username)."' and remember_me_key='$key'";

          	$rs=$conn->execute($sql);

          	if($rs->recordcount()<1)

			{

				$error="Invalid Username/Key.";

			}

		    elseif($rs->fields['account_status']=="Inactive")

			{

				$error = "Your account is currently inactive.";

			}

    		if($error=="")

			{				

				SESSION_REGISTER("USERID");$_SESSION[USERID]=$rs->fields['USERID'];

				SESSION_REGISTER("EMAIL");$_SESSION[EMAIL]=$rs->fields['email'];

				SESSION_REGISTER("USERNAME");$_SESSION[USERNAME]=$rs->fields['username'];

				SESSION_REGISTER("VERIFIED");$_SESSION[VERIFIED]=$rs->fields['verified'];

      			create_slrememberme();

        	}

			else

			{

                destroy_slrememberme($username);

        	}

        }

}


?>

Proszę o szybką odpowiedź !

Pozdrawiam

Alirek!


(Sitemaster) #2
  1. nawias w require/include nie jest potrzebny

  2. jak już otwierasz tam nawias, to wypada go zamknąć

ma być

require_once $config[basedir].'/libraries/mysmarty.class.php';

albo

require_once($config[basedir].'/libraries/mysmarty.class.php');

(Mariuszs) #3
require_once ($config[basedir] . '/libraries/mysmarty.class.php');

Nawias nie był domknięty.


(Alirek) #4

nie pomogło ;/ jest tak :

Warning: require_once(/home/enuta.eu/public_html/mp3//libraries/mysmarty.class.php) [function.require-once]: failed to open stream: No such file or directory in /home/alirekk/domains/enuta.eu/public_html/mp3/include/config.php on line 54


Fatal error: require_once() [function.require]: Failed opening required '/home/enuta.eu/public_html/mp3//libraries/mysmarty.class.php' (include_path='.:/usr/local/share/pear') in /home/alirekk/domains/enuta.eu/public_html/mp3/include/config.php on line 54

Jak nie zamykam nawiasu jest lepiej xD Mniej błędów :slight_smile:


(Sitemaster) #5

Mylisz się, pomogło - 1 błąd mniej.

Znowu się mylisz, błąd nawiasu tylko maskował pozostałe błędy. Gdyby skrypt się wykonywał dalej, to byś to zobaczył. :stuck_out_tongue:

te kolejne błędy wynikają z błędnej ścieżki

$config['basedir'] = '/home/username/public_html';
  • jak poprawisz tą linijkę podając właściwą ścieżkę, to te błędy poznikają

(Alirek) #6

poprawiłem... i nic..;/


(Sitemaster) #7

widocznie źle "poprawiłeś".

daj testowo

$config['basedir'] ='';

albo

$config['basedir'] ='.';

i zobacz co się stanie


(Alirek) #8
Fatal error: Class 'Smarty' not found in /home/alirekk/domains/enuta.eu/public_html/mp3/libraries/mysmarty.class.php on line 14

Takie coś wyskoczyło jak wpisałem :

$config['basedir'] ='.';

Ta linijka w błędzie 14 to :

$Smarty = new Smarty();

(Sitemaster) #9

a jak dasz bez kropki to co?

poza tym, widziałeś może jaką scieże zapodaje w errorach?


(Alirek) #10

To na stronie widać :

Fatal error: Class 'Smarty' not found in /home/alirekk/domains/enuta.eu/public_html/mp3/libraries/mysmarty.class.php on line 14

jak to w errorach ? a źle ?

-- Dodane 01.02.2010 (Pn) 19:03 --

Proszę pilnie o pomoc :frowning:


(Kontakt) #11

Z tego co rozumiem, to w linijce 14 masz stworzenie zmiennej, która odwołuje się do klasy smarty.

I error, ewidentnie wyświetla, że nie może znaleźć tej klasy: Class 'Smarty' not found


(Sitemaster) #12

Nie może znaleźć, bo ma błędne adresowanie.

Tylko kto ma lepiej wiedzieć jaką ma strukturę katalogową i jak powinny być ścieżki ustawione, my czy on?


(Kontakt) #13

Bardzo retoryczne pytanie :stuck_out_tongue_winking_eye:


(Alirek) #14

A możecie troszkę jaśniej ? \

O co chodzi ? Jak to naprawić ?

Czy muszę zwrócić się do webmastera ?