![]() |
Functions.php
Im running vBulletin 2.2.9 and have tried to modify my functions.php file a hundred times. It doesnt seem to matter what hack Im trying to modify it for, it will produce a parse error and make my site unavailable.
I have tried this for a required block vbportal of code and for a custom photo gallery hack. On both occasion Ive rechecked my edits 100 times and know they are being modified correctly. I have used a text editor, and also even tried directly editing the files from the server. In all cases, a parse error is generated. Does anyone else run into this problem or have a solution for me? I have made sure the edits are correct, made sure there is no blank space at the bottom, etc. and nothing seems to work. This has been going on for at least two months now and nothing seems to resolve this issue. |
ttt
|
What text editor are you using? It sounds like the editor is causing the problem.
|
AEdiX
.... but I have also tried to make the changes right from the server, and the same thing happens. My errors always refer to sessions.php, which I've replaced with the default just to make sure. I have also modified a dozen other files with the same editor and it went fine. |
I'm only running 4 hacks.
1. Thread Preview 2. Quick Reply 3. vBPortal 4. Photopost Hack Out of the 4 hacks, vbportal requires an edit to functions.php for the topics option to work... and my custom photopost hacks requires a small modification. Neither modification wants to work. |
A parse error means there's something wrong with either the PHP file or the template. It would help if you posted the complete error message.
|
Damn... I'm at work :(
I made a copy of it somewhere, I'll try to find it and post it. It?s obviously something wrong with the PHP file, hence the error message, but can?t figure out what. Especially considering the fact I have tried several times to apply the edits to the original file. |
ttt
|
I'm not sure what 'ttt' is supposed to mean but if you're waiting for my help I still need to see the actual error message. :)
|
ttt= to the top
LOL Ok, I just tried it again using a THIRD text editor and still get the same damn error. Parse error: parse error in /home/offtopic/public_html/forums/admin/functions.php on line 827 Fatal error: Call to undefined function: vbdate() in /home/offtopic/public_html/forums/admin/sessions.php on line 400 This is line 827 AFTER the new code is added: Code:
$buffer = str_replace(""", "\"", $buffer); |
The problem is in line 400 of sessions.php. What's on this line and what editor are you using?
|
steve sorry i have to say, but you are wrong here.
line 400 of sessions.php calls vbdate() which has never been defined, because the functions.php is corrupted. @dot: replace this line: PHP Code:
PHP Code:
|
I don't have:
Code:
$buffer = str_replace(""", """, $buffer); Instead, I have: Code:
$buffer = str_replace(""", "\"", $buffer); |
np
you're welcome :) |
Quote:
Anywho.. if that is the line you mean, I replaced it as requested and I get a completely different error now. :( If I give full access to my server, control panel, etc. is there ANYWAY you could take a look. This has been going on forever and it's making me insane. |
Quote:
Another thought came to me. Perhaps after editing these files, he's not uploading them in ASCII. |
I have tried several different editors.. so I don't think that is the problem. I have also edited the files directly from the server with no luck. I am also making sure to upload the files in ASCII format and make sure there is no blank space at the bottom. Every other edit I have done to every other file has been done with success. I'm positive it's something specific to functions.php, but can't figure out what. This has even happend when I tried to edit the same file on a former site of mine. Same host, same server, but different account. Same thing happened.
|
Well functions.php works for all of us to edit, so the problem must be your editor or you upload it the wrong way, there's nothing we can do...
perhaps, the file is to long for your editor, try UltraEdit, that's what al lot of us use... @Steve: touche :) |
Quote:
This is line 400 in my sessions.php Code:
$bbuserinfo['lastvisitdate'] = vbdate($dateformat." ".$timeformat,$bbuserinfo['lastvisit']); |
Quote:
Considering (a) no other file I?ve edited has this problem, (b) I?ve used several different editors and edited from the server directly, and (c) I?m transferring in the correct format (ASCII) and make sure there is no empty space at the bottom, it?s difficult to believe. |
have you tried to add your hack to an unhacked set of files to see if you get the same error?
|
It was from the default file from the start. Although I replaced the default file with a new default file to make sure.
|
Use EditPlus2. I had the same problem, then I tried it with EditPlus and it worked fine.
|
When in doubt, use notepad.
|
When in doubt use vi !
|
All times are GMT. The time now is 02:41 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|