Jump to content
xisto Community
SunBlind

Issues With Post.php In SMF 1.0.6 SMF Community No Help

Recommended Posts

I've been having issues with my Post.php file for 3 weeks, but haven't been able to get any help from the SMF Community.

 

Somewhere during a manual intallation of a package my Post.php file was altered in a bad way, resulting in an error that prevents the post template from being displayed. If you visit this link, you'll see what I mean.

 

the only advice I have gotten in 3 weeks from the SMF Community was 1 person suggesting to reinstall SMF... but because of the amount of mods and packages I have installed, I am trying to avoid replacing my Post.php file with a brand new copy so I don't have to re-add them all, possibly resulting in more errors. If anyone could help me out and take a look at my Post.php file I would be extremely appreciative.

Share this post


Link to post
Share on other sites

I've been having issues with my Post.php file for 3 weeks, but haven't been able to get any help from the SMF Community.

 

Somewhere during a manual intallation of a package my Post.php file was altered in a bad way, resulting in an error that prevents the post template from being displayed. If you visit this link, you'll see what I mean.

 

the only advice I have gotten in 3 weeks from the SMF Community was 1 person suggesting to reinstall SMF... but because of the amount of mods and packages I have installed, I am trying to avoid replacing my Post.php file with a brand new copy so I don't have to re-add them all, possibly resulting in more errors. If anyone could help me out and take a look at my Post.php file I would be extremely appreciative.

 

I went to the site and not being a member was unable to post so I am not sure what your problem is. Are you or your other member unable to post at all, or does it do something totally bizzare when you do post? I will downoad and run a plain version of SMF on my local machine and see what problems you are having. If you have modified it it is possible that the last modification caused the problem. Send me a PM and after an hour or so of seeing how SMF works as opposed to phpBB or Invision then I might be able to help.

Share this post


Link to post
Share on other sites

What was the last mod that you installed?

You should be able to reread the installation instructions for that mod to remove the mod altogether. If your forum begins to work correctly after removing the mod, you'll know for sure it was either the mod or an error in installing the mod.

If after the mod is remove everything is working correctly, make a backup of each file that is changed by the mod.

I usually download the file, in this case post.php and then make a copy of it on my system named post.php~.

Now I have two identical files:
post.php
post.php~

I can now edit the original file.

Install the mod one more time on the original files and then upload the both versions of the file (post.php and post.php~) to the server when done. If the problem occurs again, just delete the .php files and rename the .php~ files to .php.

I reccomend always creating a backup prior to editing a file. If you have added several mods, then you should create a backup prior to each. Like so:
post.php
post.php~1
post.php~2
post.php~3
post.php~4
post.php~5

Where post.php~5 would be the newest backup.

Even beter would be to date the backup:
post.php
post.php~11-21-2005
post.php~12-13-2005
post.php~01-07-2006
post.php~01-26-2006
post.php~02-08-2006

This way you can quickly remove bad mod installations.
Once you are sure that a backup is no longer needed, I suggest moving it off of your server to your local system and making a zip file of all of the removed backups. This will save space on the server for other things.


Have you rechecked your edits?

Sometimes just going through the installation instructions again and checking to see that what you did is what you were supposed to do can isolate the error. Maybe you place the new code before something when you were supposed to place it after. Stuff like that.

Maybe the mod you used isn't compatible with another mod you installed or is incompatible with the version of SMF you are using.

I know that this may not be the answer that you are looking for but without seeing the errors that you are having and without knowing what the code looks like now and what it looked like before, it isn't posible to narrow the list of possible causes.

vujsa

Share this post


Link to post
Share on other sites

Ugh, I totally forgot that I didn't grant guests posting permissions! I'm sorry, I've been so stressed out these past few weeks between my forum, my site, making MySpace layouts for people, and potty training my 2 year old...Anywhos, I've granted topic creation and post replying permissions for guests, so you should be able to see the post page now.Houdini: When trying to post, some of the forum's template does not display and I get an "invalid foreach argument," or something like that, error.I'm pretty sure there is an extra or missing bracket somewhere, but I don't know which one to take out or where to add another.vujsa: The last mod I installed through the package manager worked fine (the topic solved mod), I added some code that was posted in the package's thread to add and subtract certain features from it. I don't remember exactly why, but I decided to take the new code out and when I did I followed the instructions in reverse in it's entirety... But like I said, either I took out too much or not enough. I just can't seem to sort it out, though.Thanks for the help, BTW B)

Share this post


Link to post
Share on other sites

First of all, you have a code fragment at the begining of your page. This looks like a missing quote somewhere in your code.Remember that because of the way that SMF works, the error may be in a file other than post.php. It could be an error in index.php as well. The fragment seems to be from the modify function. If you originally installed the mod with the package installer, there should have been a backup made on the files it cahnged. If that is so, uninstalling the mod using the package installer should take you back to a good configuration.It might help if you made a copy of post.php and name it post.txt and give us the link to it so we can see the files contents. Also, I suggest providing the link in the forums at SMF since they are more familiar with the code there than we are.vujsa

Share this post


Link to post
Share on other sites

Yeah I saw the //--></script> and it is part of the index source, so somewhere there is something not closed or not even supposed to be there. So the problem is not just in the post I will attempt a post and from what SunBlind said it could be an imporper sql query that is causing the problem.

Share this post


Link to post
Share on other sites

Thanks for checkin it out, guys, I appreciate it B)

However, I don't see how my problem can lay in index.php, since I never changed anything in that file at the time the problem occured. I was solely working in Post.php. I'm not trying to dismiss that possibility, but just for clarification purposes. I don't think it's an SQL error either, as the problem doesn't occur when I attempt to submit the post, it occurs when the post page is first called. Also, I've tried accessing the pages individually and Post.php is the only one returning errors.

Here is a link to my Post.php in text format

Also, when accessing Post.php directly, this is the outputted error:
// -->

Fatal error: Call to undefined function: theme_linktree() in /home/sunblind/public_html/tutorials/Sources/Post.php on line 143

Share this post


Link to post
Share on other sites

You guys gave up on me already, huh Lol

Share this post


Link to post
Share on other sites

Some of those commas, must be periods.

You aren't concatenating the variables correctly, whenever you do something like:
Taken from the first few lines, but this needs to be fixed throughout the code.

if ($context['show_spellchecking'])		echo '		<script language="JavaScript1.2" type="text/javascript" src="', $settings['default_theme_url'], '/spellcheck.js"></script>';

It should be:

if ($context['show_spellchecking'])		echo '		<script language="JavaScript1.2" type="text/javascript" src="'. $settings['default_theme_url']. '/spellcheck.js"></script>';

Notice where the periods are (src="') & (url']), whenever you break out of a 'string' and want to add a variable you'd do 'string' . $variable . 'more string' etc.

Hopefully you can sort it, you can't just replace every instance of a comma with a period, so you must do it manually or write a regular expression to check whether a comma follows a variable with optional whitespace.


Cheers,


MC

Share this post


Link to post
Share on other sites

That's odd because all of the code is like that... The only thing I did with the file was add in a few lines of code, but when I took it out I think I accidentally took out an extra line or two...Ah oh well, it's been almost 3 weeks and I haven't been able to fix it, so I'll just get a new Post.phpThanks for the reply B)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • 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.