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 !!