Simple Roster Display

Miscellaneous code snippets and examples that members have posted

Simple Roster Display

Postby spwn » Wed Aug 09, 2006 8:23 pm

Oke, i know the title sucks..
but when u read this topic.. u'll find it more interesting it think (coders amongs us)

Well, i was thinking of creating my own self scripted guild site..
Now ever since i found wowroster.. i never wanted to let it go couse its so good..

This is what it's gonna look like when you use it properly and have members.. Web Page (remeber that i only give u the code... the layout is in the header and footer file..)

Now i'll give u yust some code and explain to you what it dous..

Code: Select all
<?php
require("includes/config.php"); // This is where my MYSQL connection is THE SAME DATABASE AS WOWROSTER INSTALLED
require("header.php"); // Everything in the file "header.php" will be displayed BEFORE the content

$getroster1 mysql_query("SELECT guild_title FROM roster_members GROUP BY guild_title ORDER BY guild_rank ASC");
// Query that groups the GUILD TITLES of the members (so you dont have more than one block per title) ORDER them by GUILD ID Meaning that the importantest persons are on top

while($r=mysql_fetch_array($getroster1)){ // While your rows from the table

$getroster2 mysql_query("SELECT name,level,class,guild_title FROM roster_members WHERE guild_title='".$r['guild_title']." ORDER BY level DESC'");
// Get all of the information u are willing to display the block of the Guild Rank ORDERED by level (HIGHEST ONES ON TOP)

echo("<table width='100%'  border='0' cellpadding='4' cellspacing='0' class='content'>
  <tr>
    <td width='100%' colspan='4' class='content-top'><b>"
.$r['guild_title']."</b></td>
  </tr>
  <tr>
    <td width='25%' class='content-contents4'><strong>Name:</strong></td>
    <td width='25%' class='content-contents4'><strong>Level: </strong></td>
    <td width='25%' class='content-contents4'><strong>Class: </strong></td>
    <td width='25%' class='contents-bottom'><strong>Rank:</strong></td>
  </tr>"
); // While The beginning of the block with the name of the Rank ur about to display..

while($rt=mysql_fetch_array($getroster2)){ // Get all of the information u are willing to display inside the block of the Guild Rank
extract($rt);//remove the $r so its just $variable
echo("<tr>
    <td width='25%' class='content-contents4'>$name</td>
    <td width='25%' class='content-contents4'>$level</td>
    <td width='25%' class='content-contents4'>$class</td>
    <td width='25%' class='contents-bottom'>$guild_title</td>
  </tr>"
);
// Close While information

echo("</table>
<br>"
);

// Close While Block

require("footer.php"); // Everything in the file "footer.php" will be displayed AFTER the content
?>


Now.. thats some code.. i stick to it that wowrosters memberlist is very complicated.. but hey... i was looking on how to do this and i tried various things sutch as LIKE, LIMIT, nothing was working until i thought maybe if i group the blocks.. they might do 1 block per member

Cuz you know if i didnt group them, i got like if i have 4 members i got 4 "members" blocks with 4 users in it... now it displays only 1 Block of "members" with all the 4 users in it..

Maybe some of u already knew it and didn't post it.. maybe u are too lazy to do it.. all i know is that people who has their own memberscript with things included sutch as news and want roster in you layout... THIS IS THE PERFECT WAY TO DO IT...

O, and before i forget.. i used blocks to create this.. and they have style class .. if u want them to, so u can adyust them.. HERE THEY ARE:

Code: Select all
.content{
border:1px solid #CCCCCC;
background-color:#F1F1F1;
}
.content-top{
border-bottom:1px solid #CCCCCC;
background-color:#e4e4e4;
}
.contents-bottom{
border-bottom:1px solid #CCCCCC;
background-color:#f1f1f1;
}
.content-contents4{
border-right:1px solid #CCCCCC;
border-bottom:1px solid #CCCCCC;
background-color:#f1f1f1;
}


I hope i'v helped some people further with this.. especially if their thinking about a small integration...

I now i learned something i didn't knew, well i know it now !! :)
Last edited by spwn on Thu Aug 10, 2006 3:58 pm, edited 4 times in total.
spwn
WR.net Apprentice
WR.net Apprentice
 
Posts: 2
Joined: Sun Jul 30, 2006 5:00 pm

Simple Roster Display

Postby zanix » Thu Aug 10, 2006 2:07 am

So just using the Roster database as a backend and and not using any of its files?

Nice work, and looks pretty too
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5543
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Re: Simple Roster Display

Postby spwn » Thu Aug 10, 2006 3:58 pm

Indeed, this yust allows u to use the roster within your site without using ANY of the files from wowroster..

I posted this.. and yes... its pretty simple but if do some research and look at the code.. you change some variables and even show more things...

If there was any way to do this also for upload.php so that u actually even don't need wowroster.. i could integrate this in the script im using on my website..

Soon i am gonna release a "guild site manager" or whatever u want to call... and it would be nice if i didn't have to install the whole roster but yust the needed files... to upload your "guildprofiler.lua"

O, and there was a little error in the code, i yust fixed it..
Last edited by spwn on Thu Aug 10, 2006 3:59 pm, edited 1 time in total.
spwn
WR.net Apprentice
WR.net Apprentice
 
Posts: 2
Joined: Sun Jul 30, 2006 5:00 pm

Re: Simple Roster Display

Postby Pytte » Fri Dec 15, 2006 2:35 pm

so you basicly reinvented the wheel ..
Pytte
WR.net Apprentice
WR.net Apprentice
 
Posts: 7
Joined: Fri Dec 15, 2006 2:33 pm

Simple Roster Display

Postby robojerk » Fri Dec 15, 2006 5:09 pm

If there is anyone still using this can I see a demo?
Last edited by robojerk on Fri Dec 15, 2006 5:15 pm, edited 1 time in total.
Image
For the Horde!
Image
User avatar
robojerk
WR.net Master
WR.net Master
 
Posts: 484
Joined: Wed Jul 05, 2006 12:17 am
Location: -The OmniMatrix- Web 3.0


Return to Code Cache

Who is online

Users browsing this forum: No registered users and 0 guests

cron