Roster Guild ranks in phpbb

phpBB integration forum

Roster Guild ranks in phpbb

Postby Tennessee » Wed Apr 30, 2008 5:46 pm

show guild rank as rank (not really ranked but it looks cool :p) if thay are not set to any rank in phpbb.
or it will set a basic rank to ppl that dont have any ranks or not on the roster as Visitor.
this is tested and working great on wow roster 1.7 and phpbb 2.0
not sure on other setup's
Code: Select all
##############################################################
## MOD Title: WoW Roster Guild Ranks mod
## MOD Author: Tennessee < tennessee@msimmers.com > (Rodney Wilson) http://wilson.msimmers.com
## MOD Description: This mod shows your Guild Rank from the WoW roster in the topics
##
##
## MOD Version: 1.0.0
##
## Installation Level:   To Easy
## Installation Time:   3 Minute
## Files To Edit: viewtopic.php
##
## Included Files: config.roster.php
##############################################################
## Author Notes:
## Remember to copy config.roster.php to your phpbb root directory and configure config.roster.php !!!
## If you allrealy have 1 you dont need anther 1
##                  
## Thanks to WoWRoster.net
## Enjoy
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up viewtopic.php
##############################################################

#
#-----[ OPEN ]---------------------------------------------
#
viewtopic.php


#
#-----[ FIND ]---------------------------------------------
#
   //
   // Handle anon users posting with usernames
   //

#
#-----[ BEFORE, ADD ]---------------------------------------------
#
   //--------------------------------------
   //    roster ranks
   //--------------------------------------
   
   if ( $postrow[$i]['user_rank'] == '0'){
       $guild_title = '';
      //configuration file
      require_once("config.roster.php");      
      $dbRoster = new sql_db($rosterdbhost,$rosterdbuser,$rosterdbpswd,$rosterdbname);         
      //the character has to be the same as the user in the forum
      $sql = "SELECT * FROM " . $roster_table_prefix . "members WHERE name = '" . $poster . "'";      
      $result = $dbRoster->sql_query($sql) or die(mysql_error());         
      $row = $dbRoster->sql_fetchrow($result);
        $guild_title = $row['guild_title'];
      $poster_rank = $guild_title;      
    if ( $guild_title == null ){
      $poster_rank = Visitor; // this sets non roster and rank ppl to just Visitor's   
   }   
   }
   
   //--------------------------------------
   //    roster ranks
   //--------------------------------------




#
#-----[ SAVE/CLOSE ]------------------------------------------
#
#RAW





copy all this and save as config.roster.php in your phpbb folder where index.php is if u dont have 1.

Code: Select all

<?php
// complete this file with the correct info
/*
example:

$roster_table_prefix = 'roster_';      //usually roster_
$rosterdbhost = 'localhost';
$rosterdbuser = 'root';
$rosterdbpswd = 'pass';
$rosterdbname = 'roster';
*/

//roster config file
$roster_table_prefix 'roster_';      //usually roster_
$rosterdbhost '';
$rosterdbuser '';
$rosterdbpswd '';
$rosterdbname '';
?>
User avatar
Tennessee
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 54
Joined: Fri Apr 04, 2008 2:00 am

Return to phpBB

Who is online

Users browsing this forum: No registered users and 0 guests

cron