A page for each class?

Theme, template, layout, or image issues

A page for each class?

Postby Mikey7047 » Sun Dec 03, 2006 7:13 am

I've tried searching, just wondering if there is any way that with Roster, there is any way I could add an extra set off buttons under the main ones, and just have one class displayed on the page at once. A guild with over 300 people gets tedious to scroll through.
Mikey7047
WR.net Apprentice
WR.net Apprentice
 
Posts: 6
Joined: Sun Dec 03, 2006 6:19 am

A page for each class?

Postby PleegWat » Sun Dec 03, 2006 7:11 pm

This is possible, but only for the index, stats page, and honour page at the same time. You'll need a bit of php knowledge.

You'll need to add a WHERE condition to the main query in memberslist.php, above the ORDER BY clause, at line 208. This should read something like:

$class = isset($_GET['class'])?$_GET['class']:'Warrior';
"WHERE `members`.`class` = '".$class.

The buttons you will probably want to add between the menu and the honour/pvp displays, at line 56. Look in char.php for how it's button bar is set up.
I <3 /bin/bash
User avatar
PleegWat
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 1636
Joined: Tue Jul 04, 2006 1:43 pm

Re: A page for each class?

Postby Mikey7047 » Tue Dec 05, 2006 5:06 am

PleegWat wrote:$class = isset($_GET['class'])?$_GET['class']:'Warrior';
"WHERE `members`.`class` = '".$class.


Do you have all the quotes right? Can I just throw that into the memberslist.php? I have very minimal php experience and it was all from a class last year, so i'm not remembering it that much :neutral:
Mikey7047
WR.net Apprentice
WR.net Apprentice
 
Posts: 6
Joined: Sun Dec 03, 2006 6:19 am

Re: A page for each class?

Postby Mikey7047 » Wed Feb 14, 2007 6:42 pm

Rehashing this old topic, because I finally updated Roster and would still like this done, here's what my code looks like now, it's still not working:

Code: Select all
// All those people asking about guild searching, here's a spot!  and here's the simple alteration to stop guild filtering in this particular place
   "LEFT JOIN `".ROSTER_PLAYERSTABLE."` AS players ON `members`.`member_id` = `players`.`member_id` AND `members`.`guild_id` = '$guildId' ".
   $class = isset($_GET['class'])?$_GET['class']:'Warrior'."WHERE `members`.`class` = '".$class.
   "ORDER BY ";


And the error:
Code: Select all
SQL:
SELECT `members`.`member_id`, `members`.`name`, `members`.`class`, `members`.`note`, IF( `members`.`note` IS NULL OR `members`.`note` = '', 1, 0 ) AS 'nisnull', `members`.`level`, `members`.`guild_rank`, `members`.`guild_title`, `members`.`zone`, DATE_FORMAT( `members`.`last_online`, '%a %b %D, %l:%i %p' ) AS 'last_online', `players`.`race`, `players`.`RankName`, `players`.`RankInfo`, IF( `players`.`RankInfo` IS NULL OR `players`.`RankInfo` = '0', 1, 0 ) AS 'risnull', `players`.`exp`, `players`.`server`, `players`.`clientLocale` , `players`.`RankIcon`, `players`.`Rankexp`, `players`.`hearth`, IF( `players`.`hearth` IS NULL OR `players`.`hearth` = '', 1, 0 ) AS 'hisnull', `players`.`dateupdatedutc` AS 'last_update', IF( `players`.`dateupdatedutc` IS NULL OR `players`.`dateupdatedutc` = '', 1, 0 ) AS 'luisnull' FROM `roster_members` AS members LEFT JOIN `roster_players` AS players ON `members`.`member_id` = `players`.`member_id` AND `members`.`guild_id` = '1' WarriorWHERE `members`.`class` = 'ORDER BY `members`.`level` DESC, `members`.`name` ASC
Last edited by Mikey7047 on Wed Feb 14, 2007 7:07 pm, edited 1 time in total.
Image
Mikey7047
WR.net Apprentice
WR.net Apprentice
 
Posts: 6
Joined: Sun Dec 03, 2006 6:19 am

A page for each class?

Postby PleegWat » Wed Feb 14, 2007 8:29 pm

You can't set $class like that. The third line you quotes should work if you replace it by this:

Code: Select all
"WHERE `members`.`class` = '".(isset($_GET['class'])?$_GET['class']:'Warrior')."'"
I <3 /bin/bash
User avatar
PleegWat
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 1636
Joined: Tue Jul 04, 2006 1:43 pm

A page for each class?

Postby Mikey7047 » Wed Feb 14, 2007 8:54 pm

Code: Select all
   "LEFT JOIN `".ROSTER_PLAYERSTABLE."` AS players ON `members`.`member_id` = `players`.`member_id` AND `members`.`guild_id` = '$guildId' ".
   "WHERE `members`.`class` = '".(isset($_GET['class'])?$_GET['class']:'Warrior')."'"
   "ORDER BY ";


The error I get now is:
Code: Select all
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/content/m/v/a/mvarrieur/html/roster/memberslist.php on line 208


Sorry for being such a PHP noob, I thought I would be able to read this code and decipher it easily, but it's not really happening.
Image
Mikey7047
WR.net Apprentice
WR.net Apprentice
 
Posts: 6
Joined: Sun Dec 03, 2006 6:19 am


Return to Appearance

Who is online

Users browsing this forum: No registered users and 1 guest

cron