Alt monitor being Default index page

Scans for, and displays main/alt relations in your Guild

Moderator: PleegWat

Alt monitor being Default index page

Postby Drazzilb » Thu Feb 01, 2007 12:56 am

Is this possible? Basically what i want to do is have people go to my roster and the 1st page being the alt monitor. Its basically the index page with alts separated. I like this. I just don't want people to have to click on something extra when i want them to see it in the 1st place.

Thanhs
Drazzilb
WR.net Apprentice
WR.net Apprentice
 
Posts: 11
Joined: Sat Aug 12, 2006 10:01 am

Alt monitor being Default index page

Postby PleegWat » Thu Feb 01, 2007 5:30 am

I used to offer a modded index file. I stopped doing it because it was getting too complicated. The easiest way to do it is putting a redirect in your index.php:

Code: Select all
<?php

header('Location: '.ROSTER_URL.'/addon.php?roster_addon_name=AltMonitor');


Add that to the top of index.php, then the front page should automatically redirect to altmonitor.
Last edited by PleegWat on Thu Feb 01, 2007 5:31 am, edited 2 times in total.
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: Alt monitor being Default index page

Postby Vinnie » Mon Feb 26, 2007 5:30 pm

I'm not sure this is the right place to ask this, but I didn't want to open a new topic for something that is (loosely) related to this.

You know how in the default index page of roster there's a list with "levels" and a "Guild Average Level"? Well, is it possible that when using alt-monitor this list would only consider Mains on the calculations? For instance, in my guild, we have about 90 mains and probably double that as alts (we have lots of alt-aholics). Problem is that while most of our mains are probably >lvl 58, the "Average level of the guild" is showing something a lot closer to lvl 40, because is also counting the loads of lowbie twinks and bank characters we have in the guild. That's fine for the main page, but I would like when using alt-monitor to have a clear sumarized view of how many Mains we have on each layer, and the total average lvl of the mains in guild. For these calculations, any character that alt-monitor find as an alt wouldn't count towards the actual numbers reported back.

I'm not very good at coding in php but if someone gives me a hint on where to look, I might be able to sort it on my own. Though I would prefer something like that to be an addedd functionality of alt-monitor.

Thanks in advance for any help or hint you can provide!
Vinnie
WR.net Apprentice
WR.net Apprentice
 
Posts: 7
Joined: Mon Jul 17, 2006 2:51 pm

Alt monitor being Default index page

Postby PleegWat » Mon Feb 26, 2007 5:37 pm

There's a bit in roster's lib/menu.php you can edit.

Code: Select all
   $guildstat_query = "SELECT IF(`".$roster_conf['alt_location']."` LIKE '%".$roster_conf['alt_type']."%',1,0) AS 'isalt',
      FLOOR(`level`/10) AS levelgroup,
      COUNT(`level`) AS amount,
      SUM(`level`) AS sum
      FROM `".ROSTER_MEMBERSTABLE."`
      GROUP BY isalt, levelgroup
      ORDER BY isalt ASC, levelgroup DESC";


Change that query to

Code: Select all
   $guildstat_query = "SELECT IF(`alts`.`alt_type` == 2,0,1) AS 'isalt',
      FLOOR(`level`/10) AS levelgroup,
      COUNT(`level`) AS amount,
      SUM(`level`) AS sum
      FROM `".ROSTER_MEMBERSTABLE."` members
      INNER JOIN `roster_addon_altmonitor` alts USING (`member_id`)
      GROUP BY isalt, levelgroup
      ORDER BY isalt ASC, levelgroup DESC";


Then, a bit further down, change

Code: Select all
      if ($row['isalt'])
      {
         $num_alts += $row['amount'];
      }


to

Code: Select all
      if ($row['isalt'])
      {
         $num_alts += $row['amount'];
         $level_sum += $row['sum'];
      }


And a bit further down, delete

Code: Select all
      $level_sum += $row['sum'];


Untested.
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: Alt monitor being Default index page

Postby Vinnie » Wed Feb 28, 2007 12:44 pm

Tried those changes. I'm getting an error like this

Code: Select all
1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '== 2,0,1) AS 'isalt', FLOOR(`level`/10) AS levelgroup, ' at line 1
SQL:
SELECT IF(`alts`.`alt_type`== 2,0,1) AS 'isalt', FLOOR(`level`/10) AS levelgroup, COUNT(`level`) AS amount, SUM(`level`) AS sum FROM `roster_members` members INNER JOIN `roster_addon_altmonitor` alts USING (`member_id`) GROUP BY isalt, levelgroup ORDER BY isalt ASC, levelgroup DESC
File: menu.php
Line: 65
Vinnie
WR.net Apprentice
WR.net Apprentice
 
Posts: 7
Joined: Mon Jul 17, 2006 2:51 pm

Alt monitor being Default index page

Postby PleegWat » Wed Feb 28, 2007 1:15 pm

damn, forgot. Use = instead of == on the first line of the first edit.
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: Alt monitor being Default index page

Postby Vinnie » Wed Feb 28, 2007 2:36 pm

Ok Fixed that error.

However I'm very confused by the results. With the original set up, I get an average level of 45. After applying your changes, the average level dropped to 27. I was expecting it to increase. Most of our mains are >60.

The break down list looks like this before the changes:
Code: Select all
Members: 83 (+107 Alts)

    * Average Level: 45
    * Level 70: 11
    * Level 60-69: 78
    * Level 50-59: 13
    * Level 40-49: 15
    * Level 30-39: 16
    * Level 1-29: 57



and like this after
Code: Select all
Members: 96 (+94 Alts)

    * Average Level: 27
    * Level 70: 11
    * Level 60-69: 78
    * Level 50-59: 13
    * Level 40-49: 15
    * Level 30-39: 16
    * Level 1-29: 57


I understand that it's using a different table to get the info wether a char is a main or an alt. But I can't begin to grasp why is giving a lower average? I'm guessing that even if there are a few alts at lvl 60-70, most of them are mains. The average should have gone up, not down? Unless we are claculating the average of the alts.
Vinnie
WR.net Apprentice
WR.net Apprentice
 
Posts: 7
Joined: Mon Jul 17, 2006 2:51 pm

Alt monitor being Default index page

Postby PleegWat » Wed Feb 28, 2007 7:55 pm

Damn, it's only doing the alts instead of only the mains.

Where you added the

Code: Select all
         $level_sum += $row['sum'];


Add it to the else belonging to that if
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


Return to AltMonitor

Who is online

Users browsing this forum: No registered users and 1 guest

cron