EZ Portal - Membership Status Block

phpBB integration forum

EZ Portal - Membership Status Block

Postby IllusoryThrall » Thu May 17, 2007 8:52 am

I'd like to .. somehow..

Make an EZPortal block that uses the numbers (the left menu pane) on an EZ portal block.

Additionally, I'd like to have the block access the class numbers.. i.e. how many of each class we have, and list them. (best-case-scenario, is also have it list how many are mains, how many are alts)

I'm going to play with some code, eventually, to see what to I can do with this.. but if anyone else has ideas, or knows how to do it, please.. save me some time!
Last edited by IllusoryThrall on Thu May 17, 2007 8:53 am, edited 1 time in total.
User avatar
IllusoryThrall
WR.net Apprentice
WR.net Apprentice
 
Posts: 22
Joined: Mon May 14, 2007 6:11 pm

EZ Portal - Membership Status Block

Postby PleegWat » Fri May 18, 2007 4:14 pm

Well, the original code for it is in the menu.php, lines 44-108 and 150-160. You'll need to include the roster Settings.php file before you're able to use it, or rewrite it so it doesn't need roster's DB and config layers.
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: EZ Portal - Membership Status Block

Postby IllusoryThrall » Mon May 21, 2007 7:11 am

okay.. i have the code such that it will stand on it's own in a php file and work. but i can't figure out how to integrate it into ezportal. if i try to include, or copy paste it into ezportal.. the portal goes blank except for the header...

Code: Select all
<?php
//
// Begin Attempt at Memberstats Block
//

require_once( 'settings.php' );

$FIELD[] = array (
   'level' => array(
      'lang_field' => 'level',
      'divider' => true,
      'divider_prefix' => 'Level ',
      'order_d'    => array( '`members`.`level` ASC' ),
      'default'  => true,
      'value' => 'level_value',
   ),
);

   $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";
   $result_menu = $wowdb->query($guildstat_query);

   if (!$result_menu)
   {
      die_quietly($wowdb->error(),'Database Error',basename(__FILE__),__LINE__,$guildstat_query);
   }

   $num_non_alts = 0;
   $num_alts = 0;

   $num_lvl_70 = 0;
   $num_lvl_60_69 = 0;
   $num_lvl_50_59 = 0;
   $num_lvl_40_49 = 0;
   $num_lvl_30_39 = 0;
   $num_lvl_1_29 = 0;

   $level_sum = 0;

   while ($row = $wowdb->fetch_assoc($result_menu))
   {
      if ($row['isalt'])
      {
         $num_alts += $row['amount'];
      }
      else
      {
         $num_non_alts += $row['amount'];
      }

      switch ($row['levelgroup'])
      {
         case 7:
            $num_lvl_70 += $row['amount'];
            break;
         case 6:
            $num_lvl_60_69 += $row['amount'];
            break;
         case 5:
            $num_lvl_50_59 += $row['amount'];
            break;
         case 4:
            $num_lvl_40_49 += $row['amount'];
            break;
         case 3:
            $num_lvl_30_39 += $row['amount'];
            break;
         case 2:
         case 1:
         case 0:
            $num_lvl_1_29 += $row['amount'];
            break;
         default:
      }
      $level_sum += $row['sum'];
   }

   $result_avg = $level_sum/($num_alts + $num_non_alts);

//
// End Attempt at Memberstats Block
//

   print $wordings[$roster_conf['roster_lang']]['members'].': '.$num_non_alts.' (+'.$num_alts.' Alts)
      <br />
      <ul>
        <li style="color:#999999;">Average Level: '.round($result_avg).'</li>
        <li>'.$wordings[$roster_conf['roster_lang']]['level'].' 70: '.$num_lvl_70.'</li>
        <li>'.$wordings[$roster_conf['roster_lang']]['level'].' 60-69: '.$num_lvl_60_69.'</li>
        <li>'.$wordings[$roster_conf['roster_lang']]['level'].' 50-59: '.$num_lvl_50_59.'</li>
        <li>'.$wordings[$roster_conf['roster_lang']]['level'].' 40-49: '.$num_lvl_40_49.'</li>
        <li>'.$wordings[$roster_conf['roster_lang']]['level'].' 30-39: '.$num_lvl_30_39.'</li>
        <li>'.$wordings[$roster_conf['roster_lang']]['level'].' 1-29: '.$num_lvl_1_29.'</li>
      </ul>';
     
?>
User avatar
IllusoryThrall
WR.net Apprentice
WR.net Apprentice
 
Posts: 22
Joined: Mon May 14, 2007 6:11 pm

EZ Portal - Membership Status Block

Postby Anaxent » Mon May 21, 2007 7:23 am

I would take alook at another block that you use in ezportal to see how it was created I know in the dragonfly blocks for anything I want to be displayed in the block i have to use the $content = ''; variable and also make sure that settings.php is being included corectlly

Code: Select all


//
// Begin Attempt at Memberstats Block
//

// the path to your roster install
// ./roster/ is if roster is installed 
// into the root of your webserver

$roster_install_dir './roster/'

require_once( 
$roster_install_dir.'settings.php' );

$FIELD[] = array (
    
'level' => array(
        
'lang_field' => 'level',
        
'divider' => true,
        
'divider_prefix' => 'Level ',
        
'order_d'    => array( '`members`.`level` ASC' ),
        
'default'  => true,
        
'value' => 'level_value',
    ),
);

    
$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"
;
    
$result_menu $wowdb->query($guildstat_query);

    if (!
$result_menu)
    {
        
die_quietly($wowdb->error(),'Database Error',basename(__FILE__),__LINE__,$guildstat_query);
    }

    
$num_non_alts 0;
    
$num_alts 0;

    
$num_lvl_70 0;
    
$num_lvl_60_69 0;
    
$num_lvl_50_59 0;
    
$num_lvl_40_49 0;
    
$num_lvl_30_39 0;
    
$num_lvl_1_29 0;

    
$level_sum 0;

    while (
$row $wowdb->fetch_assoc($result_menu))
    {
        if (
$row['isalt'])
        {
            
$num_alts += $row['amount'];
        }
        else
        {
            
$num_non_alts += $row['amount'];
        }

        switch (
$row['levelgroup'])
        {
            case 
7:
                
$num_lvl_70 += $row['amount'];
                break;
            case 
6:
                
$num_lvl_60_69 += $row['amount'];
                break;
            case 
5:
                
$num_lvl_50_59 += $row['amount'];
                break;
            case 
4:
                
$num_lvl_40_49 += $row['amount'];
                break;
            case 
3:
                
$num_lvl_30_39 += $row['amount'];
                break;
            case 
2:
            case 
1:
            case 
0:
                
$num_lvl_1_29 += $row['amount'];
                break;
            default:
        }
        
$level_sum += $row['sum'];
    }

    
$result_avg $level_sum/($num_alts $num_non_alts);

// 
// End Attempt at Memberstats Block
//

$content $wordings[$roster_conf['roster_lang']]['members'].': '.$num_non_alts.' (+'.$num_alts.' Alts)
      <br />
      <ul>
        <li style="color:#999999;">Average Level: '
.round($result_avg).'</li>
        <li>'
.$wordings[$roster_conf['roster_lang']]['level'].' 70: '.$num_lvl_70.'</li>
        <li>'
.$wordings[$roster_conf['roster_lang']]['level'].' 60-69: '.$num_lvl_60_69.'</li>
        <li>'
.$wordings[$roster_conf['roster_lang']]['level'].' 50-59: '.$num_lvl_50_59.'</li>
        <li>'
.$wordings[$roster_conf['roster_lang']]['level'].' 40-49: '.$num_lvl_40_49.'</li>
        <li>'
.$wordings[$roster_conf['roster_lang']]['level'].' 30-39: '.$num_lvl_30_39.'</li>
        <li>'
.$wordings[$roster_conf['roster_lang']]['level'].' 1-29: '.$num_lvl_1_29.'</li>
      </ul>'
;
      
 


I hope this helps you a bit.
Last edited by Anaxent on Mon May 21, 2007 7:25 am, edited 1 time in total.
User avatar
Anaxent
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 642
Joined: Tue Jul 04, 2006 6:27 am
Location: Phoenix, Az

Re: EZ Portal - Membership Status Block

Postby IllusoryThrall » Mon May 21, 2007 12:59 pm

thanks... unfortunately that was no help at all. I don't use a content manager... and my roster is modified to be installed in the same directory (and database) as my forums.

i tried putting the membership stats block into a function and calling that from the portal php and template.. but same result.. all i get is a page that generates the header... and stops.

=( there's got to be a way to do this.. i simply don't know how.
User avatar
IllusoryThrall
WR.net Apprentice
WR.net Apprentice
 
Posts: 22
Joined: Mon May 14, 2007 6:11 pm

Re: EZ Portal - Membership Status Block

Postby IllusoryThrall » Mon May 28, 2007 2:42 pm

looks like.. somehow .. i need to re-code the membership status thing to get the levels data from the database.. without the layers of wowroster. being that i've not even the slightest idea of how to do that.. i may be forced to abandon this project. i've done about all i can.. tried about all there is to try.. to get it to include this code and print it out in a table in the EZportal.. and it always gets conflicts and won't work.

if anyone knows how to hard-code pull the information needed (main/alt status, levels, and classes) from the database .. please, feel free to lend a hand!
User avatar
IllusoryThrall
WR.net Apprentice
WR.net Apprentice
 
Posts: 22
Joined: Mon May 14, 2007 6:11 pm

EZ Portal - Membership Status Block

Postby Aross » Mon Jul 16, 2007 12:34 pm

has anyone got this working to show up or is it a lost project? need more information as to where to look to get the information for the lvls
Aross
WR.net Apprentice
WR.net Apprentice
 
Posts: 10
Joined: Sat Jun 16, 2007 2:14 am


Return to phpBB

Who is online

Users browsing this forum: No registered users and 0 guests

cron