Location: PHPKode > projects > Backend code/CMS for blizzle.com > v1.x/accountlookup.php
<?
// INCLUDES all neccessary page building functions
require "functions.php";


function createRelease($name,$version,$linkx,$date,$notes,$reporting) {
return "<dl><dt><strong>$name $version</strong><dd><i>[desc:$name]</i><p>$notes</dl><ul><ul><li>Posted: $date<li>[$linkx]Download Link[/]<li>Reporting: $reporting </ul></ul>";
}




// SEARCH USER TABLE AND OUTPUT INFO

$status = substr($name,0,1);

$nick = stripNonAN($name);
$retval = listUserInfo($nick);



if (!$retval) {

$retval = "This name is not a registered user.  Users may post when they are not registered or logged in.  ";

} else {

$retval = $retval.listUserVariables($thisid);

}

$retval = $retval."Below is a search for information pertaining to this user.  This may not be completely accurate.".listPosts($nick).listComments($nick).listBlitz($nick);



function listUserInfo($nick) {

global $thisid,$link;

$query = "SELECT * FROM users WHERE userName = '$nick';";

$result = mysql_query ($query, $link) or die (mysql_error());


list($userID,$userName,$userPassword,$userStatus,$registerdate,$modpoints) = mysql_fetch_row($result);

if ($userID) {

if ($userStatus == "^") {
$userStatus = "admin";
} elseif ($userStatus == "@") {
$userStatus = "operator";
} elseif ($userStatus == "%") {
$userStatus = "helper";
} elseif ($userStatus == "+") {
$userStatus = "voice";
}

$retval = "<table width=100% border=0><tr><td colspan=2><strong><i>User Information</i></strong></td></tr>";
$retval = $retval."<tr><td>Username:</td><td> $userName </td></tr>";
$retval = $retval."<tr><td>User #:</td><td> $userID </td></tr>";
$retval = $retval."<tr><td>User Status:</td><td> $userStatus </td></tr>";
$retval = $retval."<tr><td>Registered Date:</td><td> $registerdate </td></tr>";
$retval = $retval."<tr><td>Modpoints Accrued:</td><td> $modpoints </td></tr>";
$retval = $retval."</table><hr width=100 color=#000000>";

$thisid = $userID;

return $retval;

} else {

return false;

}

}

function listUserVariables($userID) {

global $link;

$query = "SELECT name,value FROM user_variables WHERE userID = '$userID';";
$result = mysql_query ($query, $link) or die (mysql_error());

$retval = "<table width=100% border=0><tr><td colspan=2><strong><i>User Variables</i></strong></td></tr>";

while (list($name,$value) = mysql_fetch_row($result)) {
		$retval = $retval."<tr><td> $name </td><td> $value </td></tr>";
}

$retval = $retval."</table><hr width=100 color=#000000>";

return $retval;

}



function listPosts($nick) {

global $link;

$query = "SELECT displayname,itemTitle,itemID,itemDate FROM item_headers WHERE displayname Like '_$nick' OR displayname = '$nick' ORDER BY itemDate DESC;";
$result = mysql_query ($query, $link) or die (mysql_error());

$retval = "<table width=100% border=0><tr><td colspan=2><strong><i>Posts by this user (or similar)</i></strong></td></tr>";

while (list($name,$title,$uid,$date) = mysql_fetch_row($result)) {
		$retval = $retval."<tr><td><a href=\"index.php?uid=$uid\"> $title </a></td><td nowrap> $name at $date </td></tr>";
}

$retval = $retval."</table><hr width=100 color=#000000>";

return $retval;

}

function listComments($nick) {

/* LET'S DISABLE THIS FOR RIGHT NOW
global $link;

$query = "SELECT displayname,itemtitle,itemID,itemDate FROM user_variables WHERE displayname Like '_$nick' OR displayname = '$nick' ORDER BY commentDate DESC;";
$result = mysql_query ($query, $link) or die (mysql_error());

$retval = "<table width=100% border=0><tr><td colspan=2><strong><i>Comments by this user (or similar)</i></strong></td></tr>";

while (list($name,$title,$uid,$date) = mysql_fetch_row($result)) {
		$retval = $retval."<tr><td><a href=\"index.php?uid=$uid\"> $value </a></td><td nowrap> $name at $date </td></tr>";
}

$retval = $retval."</table><hr width=100 color=#000000>";

return $retval;
*/
}

function listBlitz($nick) {

global $link;

$query = "SELECT displayname,shout,date FROM shouts WHERE displayname Like '_$nick' OR displayname = '$nick' ORDER BY date DESC;";
$result = mysql_query ($query, $link) or die (mysql_error());

$retval = "<table width=100% border=0><tr><td colspan=2><strong><i>blitzlet chatter by this user (or similar)</i></strong></td></tr>";

while (list($name,$shout,$date) = mysql_fetch_row($result)) {
		$retval = $retval."<tr><td> $shout </a></td><td nowrap> $name at $date </td></tr>";
}

$retval = $retval."</table><hr width=100 color=#000000>";

return $retval;
}

function listSimilar($nick) {


}

$retval = createitem("user information for $name",date("Y-m-d H:i:s"),"Below is just about all information for $name in blizzle's database.  If we can think of more things to add, we will.  Yipee yipee fun fun.  Enjoy! :)<p>".$retval,null,"community","information",$name,null,null,null,null,null);

createPage($retval);



?>
Return current item: Backend code/CMS for blizzle.com