phpBB Integration

Logs changes to the guild member list when the guild list is updated
Integrated into WoWRoster v1.7.1 and later

phpBB Integration

Postby Averen » Sat Jul 29, 2006 12:43 am

I've modded the addon to post a thread in a forum on the removal/adding of members. It's not very customisable though but I'll be updating it soon. If you would like a customised version for your forum, please tell me.
User avatar
Averen
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 152
Joined: Thu Jul 20, 2006 5:18 am

phpBB Integration

Postby Msamaki » Sun Jul 30, 2006 4:10 pm

/raises hand

I'd be interested in seeing this please.
Last edited by Msamaki on Sun Jul 30, 2006 4:17 pm, edited 1 time in total.
Rogues do it from behind...
User avatar
Msamaki
WR.net Apprentice
WR.net Apprentice
 
Posts: 12
Joined: Thu Jul 06, 2006 10:51 pm

Re: phpBB Integration

Postby Averen » Sun Jul 30, 2006 4:29 pm

Ok, let me set up a phpBB forum so I can test it out then I'll give you a demo and I'll release it.
User avatar
Averen
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 152
Joined: Thu Jul 20, 2006 5:18 am

Re: phpBB Integration

Postby Averen » Sun Jul 30, 2006 5:11 pm

Demo.

The files are in the downloads section.

The normal Member Log addon is required for this to work.

Follow the normal instructions for the Member Log

Then

Open libconstants.php

Add before the closing ?>
Code: Select all

define
('ROSTER_ADDONMB_PHPBBPREFIX','phpbb_');
define('ROSTER_ADDONMB_PHPBBFORUM_ID','1');
define('ROSTER_ADDONMB_PHPBBUSER_ID','2');
define('ROSTER_ADDONMB_PHPBBUSER_NAME','Ian');
define('ROSTER_ADDONMB_DATEFORMAT','G:i d/m/Y T');
 


Open lib/wowdb.php

Replace the memberLog() function with

Code: Select all

    
/**
     * Memberlog function
     *
     * @param string $name
     * @param enum NEW,OLD $type
     */
    
function memberLog($name$type)
    {

        
$name $this->escape($name);

        
$post_data['topic_type'] = POST_NORMAL;
        
$post_data['last_post'] = false;
        
$post_data['has_poll'] = false;
        
$post_data['edit_poll'] = false;

        
$post_data['first_post'] = true;

        
mt_srand( (double) microtime() * 1000000000);
        
$bbcode_uid mt_rand();
        
$bbcode_uid substr($bbcode_uid010);

        if(
$type =='OLD'){
            
$subtype '[color=red:'.$bbcode_uid.']removed[/color:'.$bbcode_uid.']';
            
$stype "REMOVED";
        }else{
            
$subtype '[color=green:'.$bbcode_uid.']added[/color:'.$bbcode_uid.']' ;
            
$stype "ADDED";
        }

        
$current_time time();

        
$username ROSTER_ADDONMB_PHPBBUSER_NAME;
        
$subject $name.' - '.$stype;
        
$message $this->escape('[b:'.$bbcode_uid.']'.$name.'[/b:'.$bbcode_uid.'] has been '.$subtype.' '.date(ROSTER_ADDONMB_DATEFORMAT,$current_time));

        
$sql "INSERT INTO ".ROSTER_ADDONMB_PHPBBPREFIX."topics (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('$subject', '".ROSTER_ADDONMB_PHPBBUSER_ID."', $current_time, ".ROSTER_ADDONMB_PHPBBFORUM_ID.", 0, 0, 0)";

        
$result $this->query($sql);

        
$this->free_result($result);

        
$topic_id mysql_insert_id($this->db);

        
$sql "INSERT INTO ".ROSTER_ADDONMB_PHPBBPREFIX."posts (topic_id, forum_id, poster_id, post_username, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig) VALUES ($topic_id, ".ROSTER_ADDONMB_PHPBBFORUM_ID.", ".ROSTER_ADDONMB_PHPBBUSER_ID.", '$username', $current_time, 'localhost', 1, 1, 1, 1)";

        
$result $this->query($sql);

        
$this->free_result($result);        

        
$post_id mysql_insert_id($this->db);


        
$sql "INSERT INTO ".ROSTER_ADDONMB_PHPBBPREFIX."posts_text (post_id, post_subject, bbcode_uid, post_text) VALUES ($post_id, '$subject', '$bbcode_uid', '$message')";

        
$result $this->query($sql);

        
$this->free_result($result);

        
$sql "UPDATE ".ROSTER_ADDONMB_PHPBBPREFIX."topics SET topic_first_post_id = '$post_id', topic_last_post_id = '$post_id' WHERE topic_id = '$topic_id'";

        
$result $this->query($sql);

        
$this->free_result($result);

        
$this->reset_values();
        
$this->add_value('name'$name );
        
$this->add_value('type'$type );
        
$this->add_value('date'time() );

        
$querystr "INSERT INTO `".ROSTER_MEMBERLOGTABLE."` SET ".$this->assignstr;
        
$result $this->query($querystr);
        if( !
$result )
        {
            
$this->setError('Member Log ['.$name.'] could not be inserted',$this->error());
        } else {
            
$this->setMessage("<li>Member Log [".$name."] inserted</li>\n");
        }

    }
 



YOU NEED TO CREATE THE FORUM AND USER FIRST

BE SURE TO CONFIGURE THE VARIABLES DEFINED IN CONSTANTS.PHP
User avatar
Averen
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 152
Joined: Thu Jul 20, 2006 5:18 am

phpBB Integration

Postby Sprawl » Sun Aug 20, 2006 2:51 pm

Works great thanks!
Sprawl
WR.net Apprentice
WR.net Apprentice
 
Posts: 8
Joined: Mon Jul 24, 2006 4:36 pm

phpBB Integration

Postby silverscout » Mon Sep 18, 2006 4:09 am

Can this be modded to only show New members and the output have a custom message?
silverscout
WR.net Apprentice
WR.net Apprentice
 
Posts: 47
Joined: Tue Jul 04, 2006 2:47 pm

Re: phpBB Integration

Postby krisco750 » Tue Nov 14, 2006 9:56 pm

The code for this no longer works with the integrated Member Log in Roster 1.7.1. In order to get it working with the new version, follow the same instructions above with libconstants.php, but use the following for wowdb.php:

Open lib/wowdb.php and replace the updateMemberLog function with:

Code: Select all

      
/**
     * Update Memberlog function
     *
     */
    
function updateMemberlog$data $type )
    {
        
$name $data['name'];

        
$post_data['topic_type'] = POST_NORMAL;
        
$post_data['last_post'] = false;
        
$post_data['has_poll'] = false;
        
$post_data['edit_poll'] = false;

        
$post_data['first_post'] = true;

        
mt_srand( (double) microtime() * 1000000000);
        
$bbcode_uid mt_rand();
        
$bbcode_uid substr($bbcode_uid010);

        if(
$type =='OLD'){
            
$subtype '[color=red:'.$bbcode_uid.']removed[/color:'.$bbcode_uid.']';
            
$stype "REMOVED";
        }else{
            
$subtype '[color=green:'.$bbcode_uid.']added[/color:'.$bbcode_uid.']' ;
            
$stype "ADDED";
        }

        
$current_time time();

        
$username ROSTER_ADDONMB_PHPBBUSER_NAME;
        
$subject $name.' - '.$stype;
        
$message $this->escape('[b:'.$bbcode_uid.']'.$name.'[/b:'.$bbcode_uid.'] has been '.$subtype.' '.date(ROSTER_ADDONMB_DATEFORMAT,$current_time));

        
$sql "INSERT INTO ".ROSTER_ADDONMB_PHPBBPREFIX."topics (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('$subject', '".ROSTER_ADDONMB_PHPBBUSER_ID."', $current_time, ".ROSTER_ADDONMB_PHPBBFORUM_ID.", 0, 0, 0)";

        
$result $this->query($sql);

        
$this->free_result($result);

        
$topic_id mysql_insert_id($this->db);

        
$sql "INSERT INTO ".ROSTER_ADDONMB_PHPBBPREFIX."posts (topic_id, forum_id, poster_id, post_username, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig) VALUES ($topic_id, ".ROSTER_ADDONMB_PHPBBFORUM_ID.", ".ROSTER_ADDONMB_PHPBBUSER_ID.", '$username', $current_time, 'localhost', 1, 1, 1, 1)";

        
$result $this->query($sql);

        
$this->free_result($result);        

        
$post_id mysql_insert_id($this->db);


        
$sql "INSERT INTO ".ROSTER_ADDONMB_PHPBBPREFIX."posts_text (post_id, post_subject, bbcode_uid, post_text) VALUES ($post_id, '$subject', '$bbcode_uid', '$message')";

        
$result $this->query($sql);

        
$this->free_result($result);

        
$sql "UPDATE ".ROSTER_ADDONMB_PHPBBPREFIX."topics SET topic_first_post_id = '$post_id', topic_last_post_id = '$post_id' WHERE topic_id = '$topic_id'";

        
$result $this->query($sql);

        
$this->free_result($result);

        
$this->reset_values();
        
$this->add_value('member_id'$data['member_id'] );
        
$this->add_value('name'$data['name'] );
        
$this->add_value('guild_id'$data['guild_id'] );
        
$this->add_value('class'$data['class'] );
        
$this->add_value('level'$data['level'] );
        
$this->add_value('note'$data['note'] );
        
$this->add_value('guild_rank'$data['guild_rank'] );
        
$this->add_value('guild_title'$data['guild_title'] );
        
$this->add_value('officer_note'$data['officer_note'] );
        
$this->add_value('update_time'$data['update_time'] );
        
$this->add_value('type'$type );

        
$querystr "INSERT INTO `".ROSTER_MEMBERLOGTABLE."` SET ".$this->assignstr;
        
$result $this->query($querystr);
        if( !
$result )
        {
            
$this->setError('Member Log ['.$data['name'].'] could not be inserted',$this->error());
        }
    } 


That worked fine for me!
krisco750
WR.net Apprentice
WR.net Apprentice
 
Posts: 2
Joined: Tue Jul 04, 2006 5:01 pm

phpBB Integration

Postby zanix » Tue Nov 14, 2006 10:07 pm

I spot an error
You are checking if($type =='OLD')

In Roster 1.7.1, $type is either 0 or 1
0= Removed
1= Added
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5543
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Re: phpBB Integration

Postby krisco750 » Thu Nov 16, 2006 3:38 am

Thanks :) Hadn't noticed that.
krisco750
WR.net Apprentice
WR.net Apprentice
 
Posts: 2
Joined: Tue Jul 04, 2006 5:01 pm


Return to Member Log

Who is online

Users browsing this forum: No registered users and 0 guests

cron