View Single Post
  #18  
Old 06-07-2009, 07:33 PM
shiningheart shiningheart is offline
Member
 
Join Date: Jun 2009
Posts: 3
Credits: 250
shiningheart
Default RE: A quick Profile Add-on Modification

Oh okay, Oops! And one minute....[hr]
Quote:
<?php

// ************************************************** ********************
// Rusnak PHP Adoptables Script
// Copyright 2009 Brandon Rusnak
// For help and support: http://www.rusnakweb.com/forum/
//
// Redistribution prohibited without written permission
// File ID: profile2.php
// Shows a user profile, or a member list.
// ************************************************** ********************

// Wake the sleeping giant

// ************************************************** ********************
// Basic Configuration Info
// ************************************************** ********************

include("inc/functions.php");
include("inc/config.php");
include("lang/lang.php");

$themeurl = "templates/default/usertemp.html";

$template = replace(':DISPLAYPIC:',$displaypic,$template);
$template = replace(':DISPLAYQUOTE:',$display_quote,$template) ;
$template = replace(':ARTICLESTATS:',$article_stats,$template) ;
$template = replace(':ARTICLEABOUT:',$article_about,$template) ;
$template = replace(':ARTICLEABOUTME:',$aboutme,$template);
$template = replace(':USERCSS:',$usercss,$template);

// ************************************************** ********************
// Define our top links by calling getlinks()
// ************************************************** ********************

$links = getlinks();

// ************************************************** ********************
// Define our ads by calling getads()
// ************************************************** ********************

$ads = getads("any");

// ************************************************** ********************
// Grab any dynamic article content from the content table
// ************************************************** ********************

$pagecontent = getsitecontent("index");
$article_title = $pagecontent[title];
$article_content = $pagecontent[content];
$article_content = nl2br($article_content);

// ************************************************** ********************
// Grab any settings that we will need for the current page from the DB
// ************************************************** ********************

$browsertitle = grabanysetting("browsertitle");
$sitename = grabanysetting("sitename");
$slogan = grabanysetting("slogan");


// ************************************************** ********************
// Check and see if the user is logged in to the site
// ************************************************** ********************

$loginstatus = logincheck();
$isloggedin = $loginstatus[loginstatus];
$loggedinname = $loginstatus[username];

// ************************************************** ********************
// End Prepwork - Output the page to the user
// ************************************************** ********************

// This page handles user profiles and shows the site members...



$user = $_GET["user"];

$user = preg_replace("/[^a-zA-Z0-9\\040.]/", "", $user);

$user = secure($user);



$page = $_GET["page"];

$page = preg_replace("/[^a-zA-Z0-9\\040.]/", "", $page);

$page = secure($page);



if($user != ""){



// We have specified a specific user who we are showing a profile for...

// See if the user exists...



$query = "SELECT * FROM ".$prefix."users WHERE username = '".$user."'";

$result = mysql_query($query);

$num = mysql_numrows($result);



if($num > 0){



$i=0;

while ($i < 1) {



$usersname=@mysql_result($result,$i,"username");

$usersgroup=@mysql_result($result,$i,"usergroup");


$status=@mysql_result($result,$i,"status");




$website=@mysql_result($result,$i,"website");

$aim=@mysql_result($result,$i,"aim");

$yahoo=@mysql_result($result,$i,"yahoo");

$msn=@mysql_result($result,$i,"msn");

$membersince=@mysql_result($result,$i,"membersince ");

$ame=@mysql_result($result,$i,"ame");

$location=@mysql_result($result,$i,"location");

$age=@mysql_result($result,$i,"age");

$occupation=@mysql_result($result,$i,"occupation") ;

$interests=@mysql_result($result,$i,"interests");

$profilepic=@mysql_result($result,$i,"profilepic") ;

$displayquote=@mysql_result($result,$i,"displayquo te");

$usercss=@mysql_result($result,$i,"usercss");



if($website == ""){

$website = "No Website Information Given";

}

else{

$website = "<a href='".$website."' target='_blank'>".$website."</a>";

}



if($msn == ""){

$msn = "No MSN Information Given";

}



if($aim == ""){

$aim = "No AIM Information Given";

}



if($yahoo == ""){

$yahoo = "No YIM Information Given";

}





$i++;

}




$query = "SELECT * FROM ".$prefix."owned_adoptables WHERE owner = '".$user."'";
$result = mysql_query($query);
$numpets = mysql_numrows($result);












$query = "SELECT * FROM ".$prefix."owned_adoptables WHERE owner = '".$user."'";

$result = mysql_query($query);

$numpets = mysql_numrows($result);



// Show the user's profile page...



if($status == "yes") {
$userdisp = "".$usersname."'s Profile<p>
Status: <b>Online!</b>";
}
elseif($status == "") {
$userdisp = "".$usersname."'s Profile <p> Status: <b>Offline!</b>";
}



$article_title = "$userdisp";




$displaypic = "<img src='".$profilepic."'>";
$display_quote = "".$displayquote."<br>".$userdisp."<br>";
$aboutme = " <b>About Me:</b><br> ".$ame."<br> <b>Interests:</b><br> ".$interests."<br>";
$article_content = "
<b><u>".$lang_basic_info."".$usersname.":</u></b></a><br><br>
<img src='templates/icons/web.gif'> ".$website."<br>
<img src='templates/icons/aim.gif'> ".$aim."<br>
<img src='templates/icons/msn.gif'> ".$msn."<br>
<img src='templates/icons/yahoo.gif'> ".$yahoo."<br>
<img src='templates/icons/title.gif'> <a href='messages.php?act=newpm&user=".$usersname."'> Send ".$usersname." a Private Message</a><br><br>";
$article_stats = "
<b><u>".$usersname."'s Stats:</b></u></a><br><br>
<b>Member Since:</b> ".$membersince."<br><br>
<b>Number Of Pets Owned:</b> ".$numpets."<br><br>
<b><u>".$usersname."s Pets:</u></b><br><br>";

if($numpets > 0){

$i=0;
while ($i < $numpets) {

$aid=@mysql_result($result,$i,"aid");
$image = getcurrentimage($aid);

$article_content = $article_content."<a href='levelup.php?id=".$aid."'><img src='".$image."' border='0'></a>";


$i++;
}
}
else{
$article_content = $article_content."This user currently does not have any pets.";
}










$article_about = "
<b><u>About ".$usersname.":</b></u></a><br><br>
<b>Location:</b> ".$location."<br>
<b>Age:</b> ".$age."<br>
<b>Occupation:</b> ".$occupation."<br> ";





}

}
// ************************************************** ********************
// Begin Template Definition
// ************************************************** ********************

//Define our current theme
$file = $themeurl;

// Do the template changes and echo the ready template
$template = file_get_contents($file);

$template = replace(':ARTICLETITLE:',$article_title,$template) ;
$template = replace(':ARTICLECONTENT:',$article_content,$templ ate);
$template = replace(':ARTICLEDATE:',$article_date,$template);

$template = replace(':BROWSERTITLE:',$browsertitle,$template);
$template = replace(':SITENAME:',$sitename,$template);

$template = replace(':DISPLAYPIC:',$displaypic,$template);
$template = replace(':DISPLAYQUOTE:',$display_quote,$template) ;
$template = replace(':ARTICLESTATS:',$article_stats,$template) ;
$template = replace(':ARTICLEABOUT:',$article_about,$template) ;
$template = replace(':ARTICLEABOUTME:',$aboutme,$template);
$template = replace(':USERCSS:',$usercss,$template);

//Define our links
$template = replace(':LINKSBAR:',$links,$template);

//Get the content for the side bar...

$sidebar = getsidebar();
$template = replace(':SIDEFEED:',$sidebar,$template);

//Get the ad content...
$template = replace(':ADS:',$ads,$template);

//Get the slogan info
$template = replace(':SLOGAN:',$slogan,$template);


echo $template;

// ************************************************** ********************
// End Template Definition
// ************************************************** ********************



?>
There is the profile2.php code.[hr]
Turned on my Private Messages ;) And thank you for all the help, BTW! :)[hr]
*swingslegswhilewaitingforaresponse* :)[hr]
Okay, I messed with it a bit, and finally, I got the pets to show! *cheers* But now the problem is, for some odd reason, the adoptables are under all the messaging information, instead of under where it says _____ Pets...
Reply With Quote