Sigen avatar in PHPBB2

phpBB integration forum

Sigen avatar in PHPBB2

Postby Tennessee » Sun Apr 27, 2008 1:22 pm

This is taken from the rosterintegrationmod_1[1].0.4a and fixed to show your siggen av in the phpbb forums.
There is 1 problem I really don’t now what I’m doing here and all work goes to sapphiron. I just changed some things around so it would do what I wanted it to do witch is load Siggen’s av’s into the phpbb.
There is 1 think I haven’t figured out is the user data to reflect the options in the edit profile to show or not to show your siggen av. It always goes to the default setting when you edit your profile witch is turned off, witch isn’t to bad once you get your info in your most likely not to go back for a while. But any way there are the 3 things i used in this mod they are
WoWRoster v1.7 & SigGen 0.2.6
phpBB 2.0.23
prob all ver. of 2.0 will work not sure on that.

I think it would be a good idea if u plan to use this and your a novice plz back up the whole phpbb dir so if u back out u can always close it all and restore it.
1 more note only ppl that have uploaded there data to wow roster can use this only or thay get the no char info or not in clan gif.

I copied over the info what I’m using in the template sapphiron made. Witch can be found at…
http://www.wowroster.net/Forums/viewtop ... art=0.html
make sure u set the loc of the siggen in your server
mainImg = "/roster/addons/siggen/av.php?name=";
and the noroster.gif goes in /phpbb/images/avatars/gallery
Code: Select all
#
#-----[ SQL ]---------------------------------------------
#

ALTER TABLE `phpbb_users` ADD `roster_char` VARCHAR( 255 ) NOT NULL ;


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

#
#-----[ FIND ]---------------------------------------------
#

$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim,

u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar,

u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, p.*,  pt.post_text, pt.post_subject, pt.bbcode_uid
   FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt
   WHERE p.topic_id = $topic_id
      $limit_posts_time
      AND pt.post_id = p.post_id
      AND u.user_id = p.poster_id
   ORDER BY p.post_time $post_time_order
   LIMIT $start, ".$board_config['posts_per_page'];

#
#-----[ REPLACE WITH ]------------------------------------------
#

//   roster {
$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim,

u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar,

u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, p.*,  pt.post_text, pt.post_subject, pt.bbcode_uid,

u.roster_char
   FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt
   WHERE p.topic_id = $topic_id
      $limit_posts_time
      AND pt.post_id = p.post_id
      AND u.user_id = p.poster_id
   ORDER BY p.post_time $post_time_order
   LIMIT $start, ".$board_config['posts_per_page'];
//   roster }

#
#-----[ FIND ]---------------------------------------------
#

//
// Okay, let's do the loop, yeah come on baby let's do the loop
// and it goes like this ...
//
for($i = 0; $i < $total_posts; $i++)
{


#
#-----[ AFTER, ADD ]---------------------------------------------
#

   //   roster {
   
   $poster_roster_char = $postrow[$i]['roster_char'];
   
   //   roster }

#
#-----[ FIND ]---------------------------------------------
#
   //
   // Again this will be handled by the templating
   // code at some point
   //

#
#-----[ BEFORE, ADD ]---------------------------------------------
#
   //--------------------------------------
   //         inicio roster
   //--------------------------------------
   
   if ( $poster_roster_char != "")
   {
      //configuration file
      require_once("config.roster.php");      
      $dbRoster = new sql_db($rosterdbhost,$rosterdbuser,$rosterdbpswd,$rosterdbname);         
      //the character has to be the same as he user forum
      $sql = "SELECT * FROM " . $roster_table_prefix . "players WHERE name = '" . $poster_roster_char . "'";      
      $result = $dbRoster->sql_query($sql) or die(mysql_error());         
      $row = $dbRoster->sql_fetchrow($result);
      $level = $row['level'];
      //level padding offset
      if($level > 1) {
      //image settings   
      $mainImg = "/roster/addons/siggen/av.php?name=";      
      $mainImg = $mainImg . $poster;
                  }
      else
      {
         $mainImg = "./images/avatars/gallery/noroster.gif";
      }
      //unset variables
      unset($row);unset($result);unset($sql);unset($dbRoster);unset($poster_avatar);      
      $poster_avatar = $poster_avatar . '<table border="0" width="100" height="85" cellspacing="0"

cellpadding="0" background="' . $mainImg . '" style="background-position:center center;">';
      $poster_avatar = $poster_avatar . '<tr>';
      $poster_avatar = $poster_avatar . '<td>';                        
      $poster_avatar = $poster_avatar . '</td>';
      $poster_avatar = $poster_avatar . '</tr>';
      $poster_avatar = $poster_avatar . '</table>';
      
   }
   
   //--------------------------------------
   //         fin roster
   //--------------------------------------

#
#-----[ FIND ]---------------------------------------------
#
   $template->assign_block_vars('postrow', array(

#
#-----[ AFTER, ADD ]---------------------------------------------
#

      //   roster {
      

      'ROSTER_AVATAR' => $mainImg,

      
      //   roster }



#
#-----[ OPEN ]---------------------------------------------
#
includes/usercp_register.php

#
#-----[ FIND ]---------------------------------------------
#

         else
         {
            $user_active = 1;
            $user_actkey = '';
         }

#
#-----[ AFTER, ADD ]---------------------------------------------
#

         //   roster{
         
         $rosterChar = $HTTP_POST_VARS['rosterChar'];
         $sql = "UPDATE " . USERS_TABLE . " SET roster_char = '$rosterChar' WHERE user_id = '$user_id'";

         if ( !($result = $db->sql_query($sql)) )
         {
            message_die(GENERAL_ERROR, 'Could not update users table !!! ROSTER ERROR !!!', '',

__LINE__, __FILE__, $sql);
         }
                  
         //   roster }

#
#-----[ FIND ]---------------------------------------------
#

         $sql = "INSERT INTO " . GROUPS_TABLE . " (group_name, group_description, group_single_user,

group_moderator)

#
#-----[ BEFORE, ADD ]---------------------------------------------
#

         //   roster{
         
         $rosterChar = $HTTP_POST_VARS['rosterChar'];
         $sql = "UPDATE " . USERS_TABLE . " SET roster_char = '$rosterChar' WHERE user_id = '$user_id'";

         if ( !($result = $db->sql_query($sql)) )
         {
            message_die(GENERAL_ERROR, 'Could not update users table !!! ROSTER ERROR !!!', '',

__LINE__, __FILE__, $sql);
         }
                  
         //   roster }

#
#-----[ FIND ]---------------------------------------------
#

      'L_CURRENT_PASSWORD' => $lang['Current_password'],

#
#-----[ BEFORE, ADD ]---------------------------------------------
#

      // roster {
      
      'USE_SIG_NO' => ( !$rosterChar ) ? 'checked="checked"' : '',
      'USE_SIG_YES' => ( $rosterChar ) ? 'checked="checked"' : '',      
      'L_ROSTER_CHAR' => $lang['Roster_char'],
      'L_ROSTER_EXPLAIN' => $lang['Roster_leave_blank'],
      
      // roster }


#
#-----[ OPEN ]---------------------------------------------
#
templates/subSilver/profile_add_body.tpl

#
#-----[ FIND ]---------------------------------------------
#

   <tr>
     <td class="row2" colspan="2"><span class="gensmall">{L_PROFILE_INFO_NOTICE}</span></td>
   </tr>

#
#-----[ AFTER, ADD ]---------------------------------------------
#

   <!--
      roster integration mod {
   -->
   <tr>
     <td class="row1"><span class="gen">{L_ROSTER_CHAR}</span><br /><span class="gensmall">{L_ROSTER_EXPLAIN}</td>
     <td class="row2">
      <input type="radio" name="rosterChar" class="post" value="" {USE_SIG_NO} />
      <span class="gen">{L_NO}</span>   
      <input type="radio" name="rosterChar" class="post" value="{USERNAME}" {USE_SIG_YES} />
      <span class="gen">{L_YES}</span></td>
   </tr>
   <!--
      roster integration mod }
   -->

#
#-----[ OPEN ]---------------------------------------------
#
language/lang_english/lang_main.php

#
#-----[ FIND ]---------------------------------------------
#

//
// That's all, Folks!
// -------------------------------------------------


#
#-----[ BEFORE, ADD ]---------------------------------------------
#

//roster{

$lang['Roster_char'] = 'Choose Yes to show your WowRoster Siggen avatar:';
$lang['Roster_leave_blank'] = 'Choose No if not a member of (clanname)';

//roster}

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM

the noroster.gif goes in /phpbb/images/avatars/gallery
Attachments
noroster.gif
this is the noroster.gif if u dont want to make 1
noroster.gif (1.46 KiB) Viewed 1483 times
Last edited by Tennessee on Wed Apr 30, 2008 3:14 pm, edited 3 times in total.
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 1 guest