# # PHPFanBase 2.1 # Copyright 2003 Sasha, http://nothing-less.net. All rights reserved. # Released April 02 2003 # # PHPFanBase 2.1 is linkware and can be used or modified as long as this note remains intact # and unaltered, and there is a link up back to http://codegrrl.com/ so people know where you got # this script. You are forbidden to sell or distribute the code of PHPFanBase 2.1, in whole # or part, without the written consent of Sasha. # # If you find this script useful and you continue to use it, please consider donating $15 for the # time and effort I have put into this script: # https://www.paypal.com/xclick/business=sasha%40nothing-less.net&item_name=PHPFanBase+Donation&no_note=1&tax=0¤cy_code=USD # PHPFanBase is free, and always will be, but I've got my bills to pay too, and any donations # will be very much appreciated. Thank you in advance! # # By using PHPFanBase 2.1 you agree to indemnify Sasha from any liability. # # Please see http://codegrrl.com/ for further information. # -----> SUMMARY PHPFanBase 2.1 is a PHP/MySQL script designed especially to help you maintain a fanlisting. If you've ever owned a fanlisting, I'm sure you know how time consuming it can be to keep adding members to the HTML pages, uploading the pages, and emailing the members to let them know they've been added. With PHPFanBase, you can do all that in mere seconds. The script uses a MySQL database to store the member information, and all you have to do, is go to the Admin Panel and approve the new members that joined. The script will then set the member status to approved (unapproved members don't show up on your site), and send out an email to that member letting them know they've been added. Having an approval function means that you can delete members who submitted twice, or edit the information they joined with, such as capitalize their names, etc, BEFORE they actually show up on your site. The Admin Panel also lets you edit member information (useful when members email you with updated information, such as a new url) or delete members. On your fanlisting, you can now show the Member List in 2 ways. Visitors can either view the whole list of members, or they can view them sorted by country. That way, if your fanlisting has a lot of members, visitors can choose to view only members from, for example, the USA. PHPFanBase is specifically designed to be seamlessly integrated with already existing sites. This means that it works best with an already designed site, one for which you have the layout, index page, about page and any other pages you want already made. The only pages that come with the script are the join and members pages, the other ones you'll have to create yourself. PHPFanBase 2.1 is written in PHP 3 and has a MySQL database backend. Features include: - clean and simple interface - unlimited members - sorted by country or by join date - notification email to you when someone joins - notification email to the member when they've been approved - 100% customizable - pre-made stylesheet - total member counts - simple admin panel For new features in Version 2, please see the ChangeLog at the bottom of this file. I want to thank the following people for helping me to make PHPFanBase a better script: Naddy - http://www.spiritcrow.net (for her Megabook Conversion Tutorial) Iva - http://www.supersonicsquirrel.net (for her Country dropdown list and small Javascript) Bonnie - http://splodge.nu (for all her testing and wonderful ideas) + everyone else who beta-tested or emailed me with questions, thanks and suggestions! :) -----> REQUIREMENTS - PHP 3 or higher - MySQL database -----> FILES & FOLDERS IN THIS DOWNLOAD admin.php = the admin panel you use to add/edit/delete your members bacthmembers.php = the file you use to add all your current members to the database config.php = the file that contains all the configuration info country.php = the script that shows the members sorted by country create.php = the script that creates the table in the MySQL database footer.inc = the footer file inserted into the bottom of all pages header.inc = the header file inserted into the top of all pages invalidlogin.php = part of the password protection system join.php = the file that contains the join form and adds new members to the database login.php = part of the password protection system members.php = the script that displays the list of countries people joined with, and the whole member list if visitors choose to see that. README.txt = the file you're reading :) protection.php = the script that password protects your admin panel style.css = a stylesheet you are free to customize -----> HOW TO INSTALL THE SCRIPT NOTE: Please read through this entire .txt file carefully before you do anything. The Additional Notes at the bottom contain handy tips and tricks that might be of use to you. NOTE 2: If you already have a database ready for use, skip to step 2. And if you want to use this script for more than one fanlisting, please read the Additional Notes first. 1. Log into your domain's control panel and create a new database called members (or whatever you like, really) Then, either create a new user, or give an existing user access to the database. You will need the SELECT, INSERT, UPDATE, DELETE and CREATE privileges. 2. Extract the zip file to your desktop 3. Open config.php in a text editor such as Notepad or CuteHTML and edit all of the variables. 4. Upload all the files to the same directory your fanlisting is in. 6. Load the uploaded create.php file in your browser. You should get a 'Success! Tables created.' message but if not, please re-check all of the information in config.php. It means your database details are incorrect. 7. Delete create.php from your server to avoid security risks. 8. Load the uploaded admin.php file in your browser and log in with the password chosen in config.php. 9. That's it! You may now begin approving members for your fanlisting. :) Don't forget that you can edit header.inc, footer.inc and style.css to your heart's content. When someone has joined your fanlisting, login to admin.php to approve them. When someone sends in an Updated Information form, login to admin.php and go to the Edit Members page. Use the search form to find your member in the database. You don't have to fill in all the fields, just one or two will usually find your member. Then change their details and click the Submit button to submit the changes. 11. You can now display the date your fanlisting was last updated (ie, you approved or edited a member). I strongly recommend doing this, as it is now a rule at TheFanlistings.org. If your site does not display a Last Updated date, your fanlisting is at the risk of being put on the Troubles list. However, with this small bit of coding, the date is updated automatically every time you update the fanlisting. :) Insert the following into your page (which must have a .php extension):

This fanlisting was last updated on .

10. You can display the total member count on the index page of your fanlisting by including the following bit of coding (your page must have a .php extension for this to work!!):

We have a total of members!

If you wish to display the number of Pending Fans (unapproved members), use the following:

We have a total of pending membermembers!

-----> ADDITIONAL NOTES - You can use this script for more than one fanlisting. The only thing you need to change for that, is the name of the table this script will use. Open up config.php in a text editor, and change the table name from "fanlisting" to whatever you want to. That's all! :) - If you want to use already existing header and footer files, simply delete header.inc and footer.inc from your server and change the path in the config.php file to read /home/yourdomain/public_html/header.inc as opposed to just header.inc (replace the /home/yourdomain/public_html bit with the absolute path to your site). Alternatively, you can just edit header.inc and footer.inc to match your current header and footer. The last method is recommended. - The Comments field is the only field that will be entered into the database, but will not show up on the member list. You can use this field for anything you like if you don't want to receive comments. Whatever is entered into this field will be in the database and visible for you in the Admin Panel, but not for anyone browsing the member list. Feel free to open up join.php in a text editor and change the description of the field from "Any comments/Questions?" to anything you like. - Feel free to rename the index.php and admin.php files but make sure they remain in the same folder as the config.php file. - The Country list on the members.php page extracts all distinct countries from the database. That means that if someone joins with USA as their country and someone joins with U.S.A and someone with United States, they will be listed as 3 different countries. Because the Country list now is a dropdown, people won't be able to put in different names for countries anymore. However, if you are converting an already existing member list to PHPFanBase, chances are you'll have a few duplicate countries in there that are spelled differently. The only way to solve this, is to go into phpMyAdmin, click on the SQL tab, and paste the following into the text box: UPDATE table SET country = "USA" WHERE country = "U.S.A."; Be sure to change the table to the name of your table. You can run this as many times as you want, for as many different countries as you need to update. Just remember the first country instance will replace the second one. In this example, all instances of U.S.A. in your database will be replaced with USA. - If your fanlisting already has a whole bunch of members, you will need to add these to your database. There are 3 different ways in which you can do this. (Please note, if you want to convert from Megabook, scroll down!) #1. Fill out a Join form for each member, and then approve them in the Admin Panel. All members will get an email notifying them they have been added, please note that this might be confusing if they joined a while back. #2. You can go into PHPMyAdmin, and add them to the table there by choosing "Insert New Row". This is not recommended if you do not know how to use PHPMyAdmin. If you choose this method, please remember to put a "y" in the apr field. #3. You can use the batchmembers.php file included in the download. Open it up in a text editor such as Notepad or CuteHTML and add all your member's information according to the format shown. Make sure there are no quotation marks (" and ') in any of the information you add though, otherwise it will come up with a parse error. You have to escape all " and ' by changing them to \" and \'. After you've successfully ran batchmembers.php, DELETE the file off your server!! Anyone can run it, so by leaving it there, you run the risk of some idiot running it multiple times and duplicating all your members, which basically ruins your database. -----> MEGABOOK CONVERSION TUTORIAL Written by Naddy (naddy@spiritcrow.net). In Megabook's Layout Templates area is a field called "Entry Layout" which determines what the Entry itself, name, country and so on will look like on the page. What you have to do here is to enter the following (of course based on the variables you use - var1 in my case is country) ('', '[name]', '[email]', '[url]', '[var1]', '','n','y'),
Then you simply cut and paste what you get on the html page (not the source code, the actual text you see on the site) into the correct spot in the batchmembers.php file, checking for right spelling and everything, then run the file. It worked like a charm for me! -----> CHANGELOG Version 2.1: -several bug fixes Version 2: -Improved Admin Panel (check site link added) -New (and hopefully better) Login System for the Admin Panel -Member Pages displayed in tables instead of Lists tags -Member IDs all formatted as ### (ie 268 or 003) -Email addresses on the member lists are protected from Spam by Javascript -Option to turn off notification of new members joining -Option to turn off notifications sent to members when they've been approved -The Comments field has been added to the database -The Country List now shows the number of fans in that country next to the country name -Update Info form was added to allow users to email you with information they want updated -Join form now checks if someone is already listed before adding them to the database. If they are, an error message is displayed and they are asked to fill out the Update form if they want to update their info. -The Join form has the Countries in a dropdown list, to ensure people can't misspell their country's name or fill in a city. -Option to sort the member and country pages by ID, name or country -Link to Admin Panel added to the notification emails sent to you -Hide Email option has been added. If a member opts to hide their email address, it will be visible in the Admin Panel, but not on the site. You will also be able to contact them using the Email All function. -Small Javascript disables anyone from sending in the Join or Update form several times in a row. -A tutorial was added to make conversion from Megabook to PHPFanBase painless. -Easily insert an automatic Last Update date. -Smart text display (fan if there's one, fans if there are more) on the member and country pages. -Credit Link added to the Join and Member pages. -----> CREDITS Script created by Sasha http://www.nothing-less.net/ http://codegrrl.com If you have any problems with it, please visit the CodeGrrl Forums and post about your problem there: http://codegrrl.com/forums DO NOT email me about problems with this script at my personal email address, I unfortunately no longer have the time to respond to all support requests personally.