PHP Code:
<?php
$db_connect = mysql_connect (host, username, password);
$dbname = "databasename";
///////////////////////////////////
// Parse multiple pages section. //
///////////////////////////////////
$count = 1;
$numcols = 3;
$limit = 7;
$sqlcount= "SELECT id,username,email,dis_email,reg_date,url,icq,aim,yahoo,msn from 3dartisan_users";
$sqlcount.=" WHERE is_admin=0 AND verify=1";
$sql_countresult = mysql_db_query($dbname, $sqlcount, $db_connect);
$totalrows = mysql_num_rows($sql_countresult) or die(mysql_error());
if(empty($page)){
$page = 1;
}
$limitvalue = $page*$limit-($limit);
$sql = "SELECT id,username,email,dis_email,reg_date,url,icq,aim,yahoo,msn from 3dartisan_users";
$sql .= " WHERE is_admin=0 AND verify=1 LIMIT $limitvalue, $limit";
$sql_result = mysql_db_query($dbname, $sql, $db_connect);
while ($row = mysql_fetch_array($sql_result)){
/////////////////////////////////////
// BEGIN LOOP DATA //
/////////////////////////////////////
$get_normal_users = "SELECT id,username,email,dis_email,reg_date,url,icq,aim,yahoo,msn from 3dartisan_users";
$get_normal_users.= " WHERE verify=1 AND is_admin=0";
$date_y = date("Y");
$get_admins = "SELECT id,username,email,dis_email,reg_date,url,icq,aim,yahoo,msn from 3dartisan_users";
$get_admins.= " WHERE is_admin=1";
$user_results = mysql_db_query($dbname, $get_normal_users, $db_connect);
$admin_results = mysql_db_query($dbname, $get_admins, $db_connect);
include ('http://www.3dartisan.net/head.php');
?>
<body bgcolor="#000000" text="#FFFFFF" link="#808080" vlink="#CCCCCC" alink="#FFFFFF" topmargin="0">
<center><img src="/images/nav2.jpg" border="0" usemap="#FPMap0" width="800" height="100"></center>
<br><? include ('member_options.php'); ?>
<br>
<table width="80%" cellpadding="4" cellspacing="2" align="center">
<tr>
<td width="100%" colspan="8" align="center"><h2><i>3dArtisan.net Users</i></h2></td>
</tr>
<tr>
<td width="100%" colspan="8"><font size="2"><a href="/memberlist.php?showadmin=1">Show Administration</a></font><br> </td>
</tr>
<tr>
<td width="30%" bgcolor="#555555" nowrap><font size="2" face="Verdana"><b>Username</b></font></td>
<td width="20%" align="center" bgcolor="#520608" nowrap><font size="2" face="Verdana"><b>Date Registered</b></font></td>
<td width="15%" align="center" bgcolor="#555555" nowrap><font face="Verdana" size="2"><b>Email</b></font></td>
<td width="15%" align="center" bgcolor="#520608" nowrap><font face="Verdana" size="2"><b>Homepage</b></font></td>
<td width="15%" align="center" bgcolor="#555555" nowrap><font face="Verdana" size="2"><b>Icq</b></font></td>
<td width="15%" align="center" bgcolor="#520608" nowrap><font face="Verdana" size="2"><b>Aim</b></font></td>
<td width="15%" align="center" bgcolor="#555555" nowrap><font face="Verdana" size="2"><b>Yahoo!</b></font></td>
<td width="15%" align="center" bgcolor="#520608" nowrap><font face="Verdana" size="2"><b>Msn</b></font></td>
</tr>
<?php
if (!$showadmin) {
// Start user search
while ($user_row = mysql_fetch_array($user_results)) {
echo " <tr>\n";
echo " <td bgcolor=\"#555555\" nowrap width=\"30%\">";
echo "<font size=\"2\" color=\"#FFFFFF\"><a href=\"/profile.php?id=$user_row[id]\">$user_row[username]</a></td>\n";
// Display username
echo " <td width=\"20%\" bgcolor=\"#520608\" nowrap>";
echo "<font size=\"2\" color=\"#FFFFFF\">$user_row[reg_date]</td>\n"; // Display registration date.
// Check the display email option.
$email_alt = "Send $user_row[username] an email";
if ($user_row[dis_email]=="1"){
print "<td width=\"8%\" bgcolor=\"#555555\"><a href=\"mailto:$user_row[email]\">";
echo "<img alt=\"$email_alt\" src=\"/images/icons/email.gif\" border=\"0\"></a></td>\n";
} else {
print "<td width=\"8%\" bgcolor=\"#555555\"></td>"; }
// Check for user homepage.
$homepage_alt = "Go to $user_row[username]'s homepage";
if (!$user_row[url]){
echo "<td width=\"8%\" bgcolor=\"#520608\"></td>";
} else {
echo "<td width=\"8%\" bgcolor=\"#520608\">";
echo "<a href=\"$user_row[url]\"><img alt=\"$homepage_alt\" src=\"/images/icons/www.gif\" border=\"0\"></a>"; }
// Check for ICQ number.
$icq_addme = "Add $user_row[username] to your icq list";
if (!$user_row[icq]){
echo "<td width=\"8%\" bgcolor=\"#555555\"></td>";
} else {
echo "<td width=\"8%\" bgcolor=\"#555555\"><a href=\"http://wwp.icq.com/scripts/search.dll?to=$user_row[icq]\">";
echo "<img src=\"/images/icons/icq.gif\" alt=\"$icq_addme\" border=\"0\"></a></td>\n"; }
// Check for aim name.
$aim_alt = "Send an IM to $user_row[aim]";
if (!$user_row[aim]){
echo "<td width=\"8%\" bgcolor=\"#520608\"></td>";
} else {
echo "<td width=\"8%\" bgcolor=\"#520608\">";
echo "<a href=\"aim:goim?screenname=$user_row[aim]&message=Hi+$user_row[aim].+Are+you+there?\">";
echo "<img src=\"/images/icons/aim.gif\" alt=\"$aim_alt\" border=\"0\"></a></td>\n"; }
// Check for Yahoo! name.
$yahoo_alt = "Send a Yahoo! IM to $user_row[username]";
if (!$user_row[yahoo]){
echo "<td width=\"8%\" bgcolor=\"#555555\"></td>";
} else {
echo "<td width=\"8%\" bgcolor=\"#555555\"><a href=\"http://edit.yahoo.com/config/send_webmesg?.target=$user_row[yahoo]&.src=pg\">";
echo "<img alt=\"$yahoo_alt\" src=\"/images/icons/yahoo.gif\" border=\"0\"></a></td>\n"; }
// Check for MSN Messanger name.
$msn_alt = "Get $user_row[username]'s MSN Messanger information";
if (!$user_row[msn]){
echo "<td width=\"8%\" bgcolor=\"#520608\"></td>";
} else {
echo "<td width=\"8%\" bgcolor=\"#520608\"><a href=\"/profile.php?id=$user_row[id]\">";
echo "<img alt=\"$msn_alt\" src=\"/images/icons/msn.gif\" border=\"0\"></a></td>\n"; }
} // Ends while loop
} else {
// Start admin search
while ($admin_row = mysql_fetch_array($admin_results)) {
echo " <tr>\n";
echo " <td bgcolor=\"#555555\" nowrap width=\"30%\">";
echo "<font size=\"2\" color=\"#FFFFFF\"><a href=\"/profile.php?id=$admin_row[id]\">$admin_row[username]</a></td>\n";
// Display username
echo " <td width=\"20%\" bgcolor=\"#520608\" nowrap>";
echo "<font size=\"2\" color=\"#FFFFFF\">$admin_row[reg_date]</td>\n"; // Display registration date.
// Check the display email option.
$email_alt = "Send $admin_row[username] an email";
if ($admin_row[dis_email]=="1"){
print "<td width=\"8%\" bgcolor=\"#555555\"><a href=\"mailto:$admin_row[email]\">";
print "<img alt=\"$email_alt\" src=\"/images/icons/email.gif\" border=\"0\"></a></td>\n";
} else {
print "<td width=\"8%\" height=\"25\" bgcolor=\"#555555\"></td>"; }
// Check for user homepage.
$homepage_alt = "Go to $admin_row[username]'s homepage";
if (!$admin_row[url]){
echo "<td width=\"8%\" bgcolor=\"#520608\"></td>";
} else {
echo "<td width=\"8%\" bgcolor=\"#520608\"><a href=\"$admin_row[url]\"><img alt=\"$homepage_alt\" src=\"/images/icons/www.gif\" border=\"0\"></a>"; }
// Check for ICQ number.
$icq_addme = "Add $admin_row[username] to your icq list";
if (!$admin_row[icq]){
echo "<td width=\"8%\" bgcolor=\"#555555\"></td>";
} else {
echo "<td width=\"8%\" bgcolor=\"#555555\"><a href=\"http://wwp.icq.com/scripts/search.dll?to=$admin_row[icq]\">";
echo "<img src=\"/images/icons/icq.gif\" alt=\"$icq_addme\" border=\"0\"></a></td>\n"; }
// Check for aim name.
$aim_alt = "Send an IM to $admin_row[aim]";
if (!$admin_row[aim]){
echo "<td width=\"8%\" bgcolor=\"#520608\"></td>";
} else {
echo "<td width=\"8%\" bgcolor=\"#520608\">";
echo "<a href=\"aim:goim?screenname=$admin_row[aim]&message=Hi+$admin_row[aim].+Are+you+there?\">";
echo "<img alt=\"$aim_alt\" src=\"/images/icons/aim.gif\" border=\"0\"></a></td>\n"; }
// Check for Yahoo! name.
$yahoo_alt = "Send a Yahoo! IM to $admin_row[username]";
if (!$admin_row[yahoo]){
echo "<td width=\"8%\" bgcolor=\"#555555\"></td>";
} else {
echo "<td width=\"8%\" bgcolor=\"#555555\"><a href=\"http://edit.yahoo.com/config/send_webmesg?.target=$admin_row[yahoo]&.src=pg\">";
echo "<img alt=\"$yahoo_alt\" src=\"/images/icons/yahoo.gif\" border=\"0\"></a></td>\n"; }
// Check for MSN Messanger name.
$msn_alt = "Get $admin_row[username]'s MSN Messanger information";
if (!$admin_row[msn]){
echo "<td width=\"8%\" bgcolor=\"#520608\"></td>";
} else {
echo "<td width=\"8%\" bgcolor=\"#520608\"><a href=\"/profile.php?id=$admin_row[id]\">";
echo "<img src=\"/images/icons/msn.gif\" border=\"0\" alt=\"$msn_alt\"></a></td>\n"; }
} // Ends while loop
echo "</tr>\n<tr>\n<td><br><font size=\"2\" color=\"#FFFFFF\"><a href=\"/memberlist.php\">Back</a></font></td>\n";
///////////////////////
// End Admin section //
///////////////////////
} // Ends If
?>
</tr>
</table>
<center>
<br><br>
<? /* END DATA SECTION */ ?>
<? /* END DATA SECTION */ ?>
<? /* END DATA SECTION */ ?>
<?
}
echo "<BR>";
if($page != 1) {
$pageprev= $page - 1;
echo "<font color=\"#FFFFFF\" size=\"2\"><A HREF=\"$PHP_SELF?page=$pageprev\">";
echo "<b><< Prev</b></A></font><font color=\"#0000FF\" size=\"2\"> [</font>";
// if page is not equal to one, prev goes to $page - 1
}
else {
echo "<font color=\"#FFFFFF\" size=\"2\"><b> << Prev </b></font><font color=\"#0000FF\" size=\"2\">[</font>";
}
$numofpages = $totalrows/$limit;
for($i= 1; $i < $numofpages; $i++) {
if($page == $i) {
echo "<font size=\"2\"> $i </font>"; //make number navigation
}
else{
echo "<font size=\"2\"> <A HREF=\"$PHP_SELF?page=$i\">$i</font></A> "; //make number navigation
}
}
if($totalrows%$limit != 0) {
if($page > $numofpages) {
echo "<font size=\"2\"> $i </font>"; //make number navigation
}
else{
echo "<font size=\"2\"> <A HREF=\"$PHP_SELF?page=$i\">$i</font></A> "; ////if there is a remainder, add another page
}
}
if(($totalrows-($limit*$page)) > 0){
$pagenext = $page + 1;
echo "<font size=\"2\" color=\"#0000FF\">] </font><A HREF=\"$PHP_SELF?page=$pagenext\"><font size=\"2\"><b>Next >></b></A> ";
// if the totalrows - $limit * $page is > 0 (meaning there is a remainder), leave the next button.
} else {
echo "<font color=\"#0000FF\" size=\"2\">]</font><font color=\"#FFFFFF\" size=\"2\"> <b>Next >> </b></font>"; }
mysql_free_result($sql_result);
mysql_close ($db_connect);
if ($date_y==2001){
$if_date = "Copyright © 2001";
} else {
$if_date = "Copyright © 2001-$date_y"; }
?>
<br>
<br>
<font size="1" face="verdana" color="#FFFFFF">3dartisan.net and all of it's contents are <?php print "$if_date"; ?><br>
All user user submitted work is © it's respective author.</font>
</center>
</body>
</html>
Bookmarks