Previous Thread
Next Thread
Print Thread
Hop To
Anonymous
Unregistered
Anonymous
Unregistered
Here is what I have found to be able to run WWWThreads on PHP 3, all the modifications you need to do :

1) In PHP 3, all functions must be declared BEFORE they are called. So, in some files, you need to move the functions at the top of the file. For example, in postlist.php, the show_replies function.

2) In PHP 3, you must have all variables defined into a function since PHP 3 does not support variable number of parameters to a function. The easy fix to that is to add, for example, in the function declaration = "" to variables that might not have any value on the call. For example, in main.inc.php, the send_header function, the $user setting should be $user = ""

3) In PHP 3, the "array_push" function is not available (used in addpost.php and modifypost.php, and maybe others). A workaround for PHP 3 is to replace :
array_push ($words, $line);
by
$words[count($words)] = $line;

4) In various places, arrays statements have a "," after the last value entry - PHP 4 does not mind, but PHP 3 does. Remove the "," after the last entry.

5) All "require" entries for language files produces an error. But this may be only on my host since the "require" adds automatically the first portion of the path which gives a wrong directory for the file at the end --- so with require, I must use relative path. While with "include" I can make absolute path reference. But, it might be a host configured issue. To make it work, I modified all "require" for languages files to "include", and removed the "$config[path]/" at the beginning of the file reference.

That is all I remember that I had to do to make it work with PHP 3... there might be others changes that I did but I do not remember.

Suggestion: Put a blank "index.php" into each language directories. Currently, someone could see the directory listing of all languages directories since it is not protected by a cgi-bin directory.

So, it's possible to be running the snapshot under PHP 3, but you need to modify most of the files in order to do so.

Anonymous
Unregistered
Anonymous
Unregistered
If I might make a readablility recommendation. Step 1 that you mentioned would really help out.

Anonymous
Unregistered
Anonymous
Unregistered
That's brilliant. Thank you so much. I'll save this for when I'm ready to make the switch and will probably be back with more detailed questions.

<img src="http://www.amdragon.com/images/eileensig.gif" alt=" - " />

Anonymous
Unregistered
Anonymous
Unregistered
Thought Scream posted that. Hrm. I recommend that to Scream.

Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
Ok, I've got all of these changes in place except for number 5. What I am going to do on that one is just drop the absolute path reference, and go with a relative one. Haven't done this yet, but I'll have it done by this evening. So at that point if anyone wants to try setting up the snapshot under php3 I would be very interested to hear if there are any other problems.

--- <test>
Scream
Posted from the PHP Port Site (Post might be quirky)


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
spam issues
by ECNet - 03/19/2024 11:45 PM
Looking for a forum
by azr - 03/15/2024 11:26 PM
Editing Links in Post
by Outdoorking - 03/15/2024 9:31 AM
Question on barkrowler and the like
by Mors - 02/29/2024 6:51 PM
Member Permissions Help
by domspeak - 02/27/2024 6:31 PM
Who's Online Now
3 members (rootman, Gizmo, Nightcrawler), 562 guests, and 186 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)