Site Links
Home
Features
Documentation
Pricing & Order
Members Area
Support Options
UBBDev.com
UBBWiki.com
Who's Online
2 registered (SteveS, Bjab), 37 Guests and 16 Spiders online.
Key: Admin, Global Mod, Mod
Featured Member
Registered: 06/05/06
Posts: 469
Top Posters (30 Days)
Ruben 50
DennyP 24
Gizmo 23
Dunny 15
SteveS 13
AllenAyres 12
dbremer 10
SD 10
drkknght00 9
doug 8
Latest Photos
OK Corral Shoot Out
Testing
Basildon Train Station
Basildon Town Centre looking from the rounderbout
Basildon Town Square
Topic Options
#34889 - 11/01/00 11:07 PM If you wish to run the WWWThreads PHP into PHP 3
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.
Top
#34890 - 11/01/00 11:51 PM Re: If you wish to run the WWWThreads PHP into PHP 3
Anonymous
Unregistered

If I might make a readablility recommendation. Step 1 that you mentioned would really help out.
Top
#34891 - 11/02/00 01:38 AM Re: If you wish to run the WWWThreads PHP into PHP 3
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.

 -
Top
#34892 - 11/02/00 02:06 AM Re: If you wish to run the WWWThreads PHP into PHP 3
Anonymous
Unregistered

Thought Scream posted that. Hrm. I recommend that to Scream.
Top
#34893 - 11/02/00 02:33 PM Re: If you wish to run the WWWThreads PHP into PHP 3
Rick Offline
Post-a-holic
Registered: 06/04/06
Posts: 10164
Loc: Aberdeen, WA
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)
Top



Shout Box

Today's Birthdays
No Birthdays
Recent Topics
Temporary Password email not being received
by
05/24/12 10:02 PM
Ability to "like" individual posts (not Facebook "likes)
by doug
05/23/12 09:03 AM
Island Permissions
by ThreadsUser
05/22/12 03:03 PM
streaming video
by prkrgrp
05/20/12 07:02 PM
New Posts Corrupted? Can someone help?
by PianoWorld
05/19/12 09:41 AM
Forum Stats
10492 Members
36 Forums
33842 Topics
181709 Posts

Max Online: 978 @ 06/24/07 11:19 PM
Random Image