phpWebSite
Log In
Username

Password

Remember Me



Menu
Home
Contact Us

Consulting Services
phpWebsite Hacks

World Time (NEW!)

MyStarsLive!

MyStars! 2.7 for Windows
- Screen Shots
- Features
- Tricks and Tips
- New Comet & Asteroid Data
- Download MyStars! 2.7
- Register

Sextant & Computer
Eclipse Shades

Purchase/Register
Products
- Pay by CreditCard, or PayPal
- Pay using Digibuy
- Pay Us Directly

Question & Discussion
Forums
MyStars3! News Updated
SETI@home Team
Constellations

Who's Online
There are currently, 16 guest(s) and 1 member(s) that are online.
You are an Anonymous user.
You can register for free by clicking here

Record connected is 273 on 2008-03-24 04:23 PM.

Country connected
Unknown Unknown Unknown Unknown Unknown Australia
Australia Austria United States Australia Sweden United States
Unknown Australia United States Australia Australia



phpWebsite Hacks

This website is based on an open source 'Content Management System' written in PHP called phpWebsite.

If you develope websites using phpWebsite, you may be interested in knowing how I altered (or 'hacked') some of the PHP code in phpWebsite to change the way it works. I will be documenting the changes here so that other phpWS developers can implement the same changes in their own websites if they so desire.

If you have any questions about these hacks, feel free to email me at dpatte@relativedata.com


1) Username Valid Characters Hack

Standard phpWebsite 0.10.2 only accepts usernames madeup of letters and digits - no other characters are allowed. Our hack modifies the phpws code to also allow - _ and . in usernames. This makes username rules equivalent to the username portion used in standard email addresses. So, with this change, we can now use John.Smith or Star_gazer, for example, as valid usernames.

This is done as follows:

1) modify isValidInput() in core/Text.php to test for our new 'username' case.

2) modify calls to isValidInput() in mod/users/class/User.php to use the new 'username' case when necessary.

3) modify the login code which rejects . and -

Details will follow soon.
2) Username Uppercase/Lowercase Hack

If you have alot of users, especially if you ported them over from a different system, some may share the same username, but with a different case such as John and JOHN. But when I installed phpWebsite, it was ignoring the case of usernames, causing alot of problems.

This can easily be fixed by altering the collation option in the mySQL database.

Go into your database administrator programme and change the collation sequence to a case-sensitive collation sequence (we use latin1-general-cs) and your case-different usernames can coexist without issues.
3) Firefox Admin Page Bug Fix

If your website is being viewed by firefox, it can get confused by who is actually logging in and what their password is. This can even make applying for an account or logging in impossible.

Our hack fixes this problem by regrouping the page into three separate forms.

Details will follow soon
4) Extra User Fields Hack

Often its nice to keep extra fields associated with your website users, such as their name and address or phone number.

This hack shows how to do this.

More details to follow.
5) Mailinglist Problems

The mailinglists mod doesnt work correctly on my version of 0.10.2 . Most things work, but user passed in from a HTTP-GET is often seen as zero.

To resolve this, you have to change the following lines in mailinglists/index.php

1 - in case 'subscribe', line 1:
change $user to $_GET['user']

2 - in case 'unsubscribe', line 1,2,4:
change $user to $_GET['user']

3 - in case 'remove', line 3,5,7
change $_REQUEST['user'] to $_GET['user']

That seems to fix everything.
6) Whosonline Problems

1) The mod doesnt install correctly on 0.10.2

2) Once you fix this the flags dont show

3) Once you fix this, the adminstrator can't turn off showing the persons own country

Details of fixes to follow

Created on 2006-12-08 11:27 AM by dpatte
Updated on 2007-01-05 01:54 PM by dpatte
 Printable Version

Comments
The comments are owned by the poster. We are not responsible for its content.
thanks for pointing out the changes
Posted on: 2010-08-30 05:05:19   By: deborah
 
Hi! All these changes are for sure very important, but not at the beginning level. For a freshman developing a phpWebsite even this video will be enough to make the first steps - Learn-to-make-your-own-php-website . All other details will come with more experience. Anyway, thanks for pointing out the changes.



Search Web Pages




Links