jlhaslip
Feb 2 2008, 09:12 PM
One flaw in the phpbb2 administration section is a report to list out the 'last-visit' time/date of the membership. I wrote a script to do exactly that and will be sharing the script with you here. the first section defines the variables required for the Database connection, finding the right database, supplying passwords, etc. HTML <?php
DEFINE ('DB_USER', 'YOUR DB USER NAME'); // change these defined values to suit your own situation DEFINE ('DB_PASSWORD', 'YOUR DB PASSWORD'); DEFINE ('DB_HOST', 'localhost'); DEFINE ('DB_NAME', 'YOUR DB NAME');
$dbc = mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) OR die ('Could not connect to MySQL: ' . mysql_error() );
// Select the database. mysql_select_db (DB_NAME) OR die ('Could not select the database: ' . mysql_error() ); This next section has to do with defining the Mysql Query to use the correct table and fields within the database. Note that this example includes the default 'prefix' for the datasets (tables), being "phpbb_". HTML // Make the query. $query = "SELECT `username` , FROM_UNIXTIME(`user_lastvisit`) as last FROM `phpbb_users` ORDER BY `user_lastvisit` ASC ";
// Run the query. $result = mysql_query ($query); The following section outputs the information into a table and closes out the connection to the database. Since the data is 'table-based', ie: cames from a Database, a tabled output is semantically correct, so I will use it here. HTML // Table header. echo '<table align="center" cellspacing="0" cellpadding="5" summary="Table of Registered Users" > <tr> <td align="left"><b>Name</b></td> <td align="left"><b>Last Seen Date</a></b></td> </tr> ';
// Fetch and print all the records. $bg = '#eeeeee'; // Set the background color. while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $bg = ($bg=='#eeeeee' ? '#ffffff' : '#eeeeee'); // Switch the background color. echo '<tr bgcolor="' . $bg . '"> <td align="left">' . $row['username'] . '</td> <td align="left">' . $row['last'] . '</td> </tr> '; }
echo '</table>';
mysql_free_result ($result); // Free up the resources.
mysql_close(); // Close the database connection.
?> Simply Cut and Paste all of the above code snippets into one single file (ie: member_last.php), upload it to your Hosting service and visit the link to the file in your favourite browser to view the last-visited dates for all of your members. Pagination would be a nice feature to add to this script if you have lots of members. I will leave that to you. Also, the Database information could be seperated from thew script file and be placed 'above' the public_html folder so that it can not be referenced directly from the 'net, but those are best left to another Tutorial. I have a 'PRIVATE' phpbb2 Forum, so I do not have a Demo site available for you to test, but for those of you who do have a phpbb2 Forum, and want to see the Last-visit dates for the membership, this simple script will do that for you. Hope this helps someone, and pm me or reply to this thread if you need assistance.
Comment/Reply (w/o sign-up)
Similar Topics
Keywords : , phpbb, member, visit, report, script, phpbb2, databases
- Background Image Swap Script
Change a Background Image based on clock time (15)
Uploading Images To Phpbb Galleries
(0) This tutorial can be used to show someone how to upload images to a PHPBB Gallerie addon. This
tutorial is not specific to any particular phpbb mod since all mods will most likely be similar. 1)
go to the website galleries (easy) (http://www.school-stuff.org/album.php) 2) Click on the category
that you want to upload the images to. 3) Look for a button that says Upload and click on it. 4)
Insert a Title in the title box this will be what people can identify the picture by, does not need
a description. 5) Click on the Browse Button next to 'Upload a picture from ....
Image Rotator Script (another One)
easy to implement (0) In case you haven't noticed, I have a different Avatar display on the Forum each time the page
is refreshed. /biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif"
/> For those of you who might want the script to do that, here is the one I am using: HTML
$filesp = glob('*.png'); if(empty($filesp)){ echo 'no images found...die br >';
die(); } else{ foreach ($filesp as $file) { $img_array = trim($file); } } shuffle($img_array);
//select image at random header("C o n t e n t{dash}t y p e: image/png"); // replace th....
How To Install Phpbb?
(8) QUOTE Here are the steps: Download the latest version of phpBB2. Currently it can be
found at http://www.phpbb.com/downloads.php . I prefer the .tar.gz files, and winzip has no
problems dealing with them. Decompress the files to a directory on your local system, making sure
that you maintain the relationship between directories. I'll suggest that you decompress them to
c:\webupload Now, within C:\webupload, you should have a phpBB2 directory, full of goodies. Open
up your FTP client, and connect to where your web host tells you to go for uploading yo....
For ... Next Loops And Script Planning
My Fifth PHP Tutorial (2) Be sure to read the other ones. They are located in the TUTORIALS section, and at the time of this
writing all on the first page. Intro To PHP Tutorial 5 - For ... Next Loops and Planning Scripts
Released 4/15/07 By Chris Feilbach aka GhostRider Contact Info: E-mail: assembler7@gmail.com AIM:
emptybinder78 Yahoo: drunkonmarshmellows Website: http://www.ghostrider.trap17.com Before I start
talking about what wonderful things loops are and all the cool stuff they can do, I want to address
something first. I was asked about something to write in PHP. There isn't....
How To: Ip Configuration Script (win Xp)
If you travel a lot with your laptop, and need to switch between diff (0) How To: IP Configuration Script (win XP) If you travel a lot with your laptop, and need to switch
between different IP's in different locations, this script is for you. There are many programs
that handle this task very well, but they cost sometimes pretty big money. This tutorial will show
you how to make your own IP Configuration Script for free. This script is for a static ip address
configuration and is based on a little program called "NETSH.EXE" which is supplied with Windows.
How it works. QUOTE Microsoft Windows XP - Using Netsh Netsh.exe is a....
Php Script To Make A Link List
From the list of the Directory Files (6) Well, it has been a while since I have added anything to the Tutorial Sectiion, so here is another
script for the members to enjoy. This one creates a list of links from the contents of the directory
which it is run from. For instance, if you run it from the public_html folder, then all the files
(not the Directores) are listed and linked so when you click on the link, that file is parsed and
output to the browser. Here is the code: "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
An XHTML 1.0 Strict Page to List the files in this directory ....
Php Menu Bulding Script And Site Template
available for download (0) A Php Menu-builder Tutorial This Sidebar Menu-builder code and the php scripts are adapted from
a Tutorial on the Astahost.com Forum titled : CMS101 - Content Management System Design .
Since the original tutorial's author (vujsa) did such a marvellous job of describing the system
in the original Topic posting, I will not attempt to explain it here, rather, I invite you to have a
look at his Topic and learn from it. The Basic tutorial provided coding for developing a table-based
web-site template which used php includes and embedded data to create a &....
Script To Build A List Of Links
from filenames and h3 tags (2) Another Unordered List Script If you remember this Script , that tutorial was about creating
an un-ordered list of links from a list of files contained in a Folder which was specifically named
in the script. This current Tutorial goes several steps beyond that first Tutorial by being able to
create a list from several folder names and, more importantly, the script reads the list of links
from a 'flat file' rather than depending on the name of the folder to be hard coded in the
script. It is only one small step to have the folder names found in a mysql ....
Page Generation Time Script
A script to tell how long it took to generate (17) this is a script used to tell you or visitors how fast your page was generated for the person who is
viewing it... Ok it is verry simple!! all you have to do is put this script on every page... that
you want it to be on CODE $starttime = explode(' ', microtime()); $starttime =
$starttime + $starttime ; ?> and put it before everything on the page, for me i put it right
underneith the DOCTYPE script which i think is a bloody waste of space to have it on there, but
anyways.. i put it right below that and it works fine!! now where you want the time it....
Installing A Phpbb2 Skin
Popular forum software (5) I tried installing a new phpbb2 forum skin on my website for weeks and didnt get it to work, but
it's very easy... 1. Upload the skin / template to the templates folder of your phpbb2
directory (eg. public_html/forums/templates), make sure you don't upload the zip archieve or a
directory containing the directory where the template is in, the folder you need to upload usually
contains a lot of .tpl files an images directory a .css file (or multiple) and if your template
contains an admin re-skin an "admin" folder. NOTE: If you use PHP-Nuke the directory where....
Member Legend
Get Your Own Member Legend! (1) Hi people, i have got a tutorial on how to make a member legend like this LOOK AT BOTTOM! Goto
Admin CP -> Board Wrappers -> Footer And Enter This Code: CODE
Change The http://s6.invisionfree.com/Kakariko_Graveyard/index.php ? To Your Board URL And
Change The Colour To Whatever You Want! Regards Stratician....
Verifying Email Addresses
Using a simple PHP script (9) This simple script will allow you to run some basic checks to make sure that any email address
entered is actually an email address. There is no guarantee offered that this will stop every single
fake email address, but it'll provide some protection. Now, the code! First we need to get the
email address to verify. Here, I get it using POST from an HTML form. CODE //Load email
address from web form $email = $_POST ; Now, we move on to our first check. Does the text that
has been entered look like it could be an email address? This check can be performed....
Installing Ndstats!
The greatest Stats script of all time. (4) An example of this script cna be found at http://www.own.tc/ (click enter) This is by far the
BEST stats script and most sites use it! This is a PHP script and requires you to include files
(Please... don't do iframes!) DOWNLOAD LINK: GO TO www.ZYMIC.com and go to Php scripts>stats
scripts> and the current version of NDSTATS. Downlaod it and unzip it! Go to your WWW directory and
create a folder called "ndstats". Then what you need to do is upload all of your files into that
folder. You all should know how to do that. Then go to the top of the page(s) you wan....
Phpbb Forum Site Transfer
How to do it, step by step instructions (20) I'm sure many of you out there have used phpBB at some point. To those who enjoy running forums
and online communities, specifically supporting phpBB, I am about to tell everyone how to restore
the forums database from one website, to another. This is presuming you do not have any mods or
hacks installed. Some of you may find this information useful. Here is the scenario: Let's say
you have forums running phpBB version 2.0.17 (currently the latest one). You have decided that you
want to move your forums to a whole new URL and provider, and as an added bonus, ch....
Random Quote Script
(6) Here's a little random quote script that you can use to randomly choose from an array of quotes
you provide. It's very easy to use on any page as it's an external script, you just call it
from your page. I wouldn't use it for any more than about 50 quotes though, it would probably
slow your site down too much. Here's the code: var ar = new Array(44) ar = "Do not meddle in
the affairs of wizards, for they are subtle and quick to anger." ar = "Faithless is he that says
farewell when the road darkens." ar = "I cordially dislike allegory in all its ....
How To Create A Phpbb Fm
Create a Fully Modded forum. (52) 1. Well once you get the file onto your computer, your going to need an FTP client. I suggest Core
FTP, just do a Google search for it, and theres a free version, which I use, and is just great. 2a.
I'm guessing you already have an unzipping program to unzip the file you're downloading, so
we'll skip that step. 2b. Go to http://phpbbfm.net . On the left side, e little below the top,
click on the Zip link, which will download the file. Unzip the file you just got. 3. Once all the
files have been unzipped from the main file you just got, find the folder tha....
How To Use Trap17 Cgi Formmail
a built-in script in every hosting (15) This tutorial is using TRAP17 hosting's built-in script called cgiemail. There are several
hundreds of free scripts you can download and install it yourself but why not use what is already
provided for you, if all you need is a simple submit and data collection? Let's begin. There
are three things you need to remember: 1) you can rename the file however you'd like 2) two
files (which I'll name them submitForm.html and template.txt ) must be in the same directory
3) first two lines in template.txt must EXIST. Write your submitForm.html (where you ....
[php] Simple Newsletter Script
(17) This tutorial will give you the code needed and tell you how to implement it. First off you need to
create a file called mailing.php this will be the file that processes the adding of emails to the
list. CODE $email = $_POST ; $file = fopen("mailing.txt", "a"); fwrite($file, "\n" . $email);
fclose($file); header("Location: mailing_thankyou.php"); ?> Next you need to create a file
called mailing_thankyou.php , simple a page thanking them for signing up. Now create a file called
mailing.txt with nothing in it, when uploaded to the server set it writable (c....
Secure The Email Addresses On Your Website!
Wonderful script and useful! And working (10) Just follow the instructions below: /* Secure Email Function by Juan Karlo Aquino de
Guzman Website: http://www.karlo.ph.tc and http://www.abs-cbn.ph.tc E-mail:
http://www.karlo.ph.tc/send.php Usage: showEmail("support@microsoft.com",0); OR
showEmail("support@microsoft.com",1); Types: 0 = ordinary random 1 = more secure random To
include to a script: include_once("email_secure.php"); */ And here is the code :
CODE /* Secure Email Function by Juan Karlo Aquino de Guzman Website:
http://www.karlo.ph.tc and http://....
Backing Up And Restoring Mysql Databases
(10) If you're an Administrator on a Forum, you probably know the importance of regular data backups.
My Forum is always being hacked by someone and they always delete our SQL Databases. Well this
tutorial is for all of you who want to protect your data and restore it if necessary! Okay, backing
up your data is the first part. I use Cron Jobs in my cPanel to automate the backup process. Just
use this code for backing up all your SQL Databases: CODE mysqldump -u root -psecret
--all-databases > backup.sql OR if you wish to backup only a single database: CODE ....
E-mail Mailer Script 0.1
useful for website visitors (4) Are you pissed off when you are putting e-mail in your website, you always get spammers? Well,
here's the solution. Just change the default variables to anything that you like, etc... follow
the instructions on the script.. Here it is... hope you like it /smile.gif' border='0'
style='vertical-align:middle' alt='smile.gif' /> CODE //E-mail Mailer Script 0.1 by Juan
Karlo de Guzman //FOR TRAP17 ONLY... DEMO VERSION... DO NOT DISTRIBUTE header("Content-type:
text/html; CHARSET=UTF-8"); $int_rand=mt_rand(1,20); if($int_rand>10) {
$random_numbers=sha1(mt_ra....
Simple Php Counter Script
How to make a simple php counter script (2) In this tutorial i will explain how to make a simple script writen in PHP...that uses .txt file.
CODE // script writen by tema $a = fopen ("count.txt", "r"); // 1. $bytes = 4; $x =
fread($a, $bytes); // 2. $y=$x + 1; // 3. $fp = fopen ("counter/count.txt", "w+");
// 4. fwrite ($fp, "$y"); // 5. fclose ($fp); // 6. echo "Posjeta:$y";
// 7. ?> 1. selecting a file which the script is going to use for counting visits. 2.
reading from the script 3. adding 1 to the number in the .txt file. 4. opening....
Email Script/form With Php
how to make a simple email script using php (37) Today, I'm going to show you how to make an email script using PHP and HTML. Most people usually
put Email me if they want an email link on their site, but there are several cons to this.
First, it's very inconvenient for those people who use web-based mail such as Yahoo!, Hotmail,
or Gmail because that darn Micro$oft Outlook program comes up if one accidently click the link.
Second, you are very suseptible to spam bots because they scan your HTML source code for anything
with the same pattern as an email address and add it to their database. If you are pre....
How To Put A Phpbb Login Box On Your Main Site.
Code and .php included!!! (19) I have included my coded file with this... Ok here is the code. CODE // //Create login area,
replace the phpBB2 in /phpBB2/login.php with your forum's //directory // Prank Place
Forum Index Please enter your username and password to log in.
Username: Password:
Log me on automatically each visit:
I forgot my password You can test this out on my....
Php Guessing Script
Script game.. (4) Here's the guessing script, they guess a number and checks if they are right or wrong.. CODE
if($action==yes){ //have the number that they are suppose to guess... $guess=14; //end
if($t_guess==$guess){ print "Good job! Guess was right!"; }else{ print "Guess was wrong! Try
again!"; } } ?> Thats it /smile.gif' border='0' style='vertical-align:middle'
alt='smile.gif' /> ....
Php/mysql Login/register
Tutorial for login with databases. (4) Start register code. Register.php CODE Username: Email: Pass: Verify
Pass: //Login to your database. Make the fields of course..
mysql_connect("localhost","user","pass"); mysql_select_db("database"); //end //if registering,
check fields. if ($action == register) { if (!$user || !$pass || !$email || !$vpass) { print
"You must fill out all fields."; exit; } $dupe1 = mysql_num_rows(mysql_query("select * from
table where user='$user'")); if ($dupe1 > 0) { print "Someone already has that
username."; exit....
Php Quiz Script
Make quizzes for your site. (29) Hello all, A little bit back I decided to make a quiz scriptjust out of no where lol. However it
doesnt do anything special but I am going to make an email mod for it so that it will email results
to your email address. So here is the basis of it. INSTRUCTIONS: Open a new page in your text
editor and paste in the following code. CODE $qid = "Quiz ID-00"; ?>
Username: 1.) Question number one is? Answer1 Answer2 2.) Question number two is?
Answer1 Answer2 3.) Question number three is? Answer1 Answer2 4.) Question num....
Mail Form (php)
This is a great email form script. (3) save this page as formmail.php Code: QUOTE $MailTo = "your email"; $MailSubject =
"contact"; $MailHeader = "From: $s1"; $MailSent = "Put here the information you want to be shown
after the message is sent."; if ($s1 == ""){ echo "You did not put your name ."; } else {
$MailBody = "Name : $s1\n"; } if ($s2 == ""){ echo "You did not put your E-Mail ."; } else {
$MailBody .= "Email : $s2\n"; } if ($s3 == ""){ } else { $MailBody .= "Message : $s3\n"; } {
mail($MailTo, $MailSubject, $MailBody, $MailHeader); echo("$MailSent"); } ?>
------------------....
Multiple Admin Login (php)
This is a script that doesnt requre SQL (3) first off make a login.html page Code: QUOTE Admin Login Username: Password:
then make a check.php page Code: QUOTE $admin1 = "admin1"; // first
admin username $adm_pass1 = "password1"; // first admin password $admin2 = "admin2"; // second
admin username $adm_pass2 = "password2"; // second admin password if(($username == $admin1 &&
$password == $adm_pass1) || ($username == $admin2 && $password == $adm_pass2)){ echo
"Congratulations " . $_POST . " You may now proceed to the admin area !"; } else { echo "Userna....
Looking for , phpbb, member, visit, report, script, phpbb2, databases
|
Searching Video's for , phpbb, member, visit, report, script, phpbb2, databases
See Also,
|
advertisement
|
|