Site Links
Home
Features
Documentation
Pricing & Order
Members Area
Support Options
Who's Online
2 registered (packlite, Sirdude), 25 Guests and 22 Spiders online.
Key: Admin, Global Mod, Mod
Featured Member
Registered: 06/07/06
Posts: 28
Top Posters (30 Days)
Ruben Rocha 103
Rick 81
Mark S 72
Thelockman 56
Gizmo 54
driv 35
ntdoc 32
Sirdude 30
packlite 24
AllenAyres 22
Latest Photos
bear test
Beach Barbie-Q
Sunset
Accept the challenge!
Trees
Topic Options
Rate This Topic
#34889 - 11/01/00 08: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 08: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/01/00 10:38 PM 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/01/00 11:06 PM 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 11:33 AM Re: If you wish to run the WWWThreads PHP into PHP 3
Rick Administrator Offline

*****

Registered: 06/04/06
Posts: 7993
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
GOTMYSELFA...., smilinjack
Recent Topics
New members don't get access and are not displayed in the config panel
by Yomar
Today at 03:32 AM
How to Change Link Color / Underline in styles?
by ECNet
Yesterday at 10:00 PM
Chaging the "max online" number and date
by wanted
Yesterday at 02:22 PM
7.4.1. In Threaded Mode - "Mark All Read" Doesn't Work
by packlite
Yesterday at 10:26 AM
Custom island with sql connection
by Robje01
Yesterday at 09:13 AM
Forum Stats
4296 Members
33 Forums
30687 Topics
156016 Posts

Max Online: 978 @ 06/24/07 08:19 PM