[Member Log V1.0.4] Installation Instructions.

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

[Member Log V1.0.4] Installation Instructions.

Postby Averen » Fri Jul 28, 2006 3:46 pm

To download this addon, go here.

Wiki available here.

Upload the Member Log addon to the addons directory.

If you are using the pre-edited files just upload them to the correct locations.

If you are editing them yourself use the instructions below.

Open lib/constants.php

Find, Line 44
Code: Select all

define
('ROSTER_TALENTTREETABLE',$db_prefix.'talenttree');
 

After, Add
Code: Select all

define
('ROSTER_MEMBERLOGTABLE',$db_prefix.'addon_memberlog');
 


Open lib/wowdb.php

Find, Line 345 - 347
Code: Select all
/************************
 * Updating Code
************************/
 

After, Add
Code: Select all

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

        
$name $this->escape($name);
        
$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");
        }

    }
 


Find, Line 1501
Code: Select all

                $this
->setMessage('<li><span class="red">Removing member - [</span> '.$row[1].' <span class="red">]</span></li>');
 

After, Add.
Code: Select all

                $oldmembers
[] = $row[1];
 


Find, Line 1513
Code: Select all

        $this
->closeQuery($result);
 

After, Add
Code: Select all

        
return $oldmembers;
 


Find, Line 1759
Code: Select all

            $this
->membersupdated++;
 

After, Add
Code: Select all

            $newmember 
NULL;
 


Find, Line 1770
Code: Select all

            $this
->membersadded++;
 

After, Add
Code: Select all

            $newmember 
$name;
 


find, Line 1777 - 1779
Code: Select all

        
{
            
$this->setError(''.$name_escape.' could not be inserted',$this->error());
        }
 

After, Add
Code: Select all

        
return $newmember;
 


Open admin/update.php

Find, Line 262
Code: Select all

                            $output 
.= "<ul>\n";
 

After, Add
Code: Select all

                            $i 
0;
 


Find, Line 266
Code: Select all

                                $wowdb
->update_guild_member($guildId$char_name$char$currentTimestamp);
 

Replace with
Code: Select all

                                $newmembers
[$i] = $wowdb->update_guild_member($guildId$char_name$char$currentTimestamp);
                                if(empty(
$newmembers[$i])) { unset($newmembers[$i]); }
 


Line 274 - 276
Code: Select all

                                
{
                                    
$output .= start_update_trigger($char_name,'guild');
                                }
 

After, Add
Code: Select all

                                $i
++;
 


Find, Line 280
Code: Select all

                            $wowdb
->remove_guild_members($guildId$currentTime);
 

Replace with
Code: Select all

                            $oldmembers 
$wowdb->remove_guild_members($guildId$currentTime);
 


Find, Line 281
Code: Select all

                            $wowdb
->remove_guild_members_id($guildId);
 

After, Add
Code: Select all

                            $result 
$wowdb->query("SHOW TABLES LIKE '".ROSTER_MEMBERLOGTABLE."'");

                            
$r $wowdb->fetch_assoc($result);

                            if( empty(
$r) )
                            {
                            require 
ROSTER_BASE.'addons'.DIR_SEP.'memberlog/install_db.php';
                            }

                            
$output .= "</ul>\n";
                            
$output .= "<strong>Updating [<span class=\"orange\">Memeber Log</span>]</strong>\n<ul>\n";

                            if(
is_array($oldmembers)){
                            foreach(
$oldmembers as $oldm){

                            
$wowdb->memberLog($oldm"OLD");

                            }
                            }

                            if(
is_array($newmembers)){
                            foreach(
$newmembers as $newm){
                            
                            
$wowdb->memberLog($newm"NEW");
                            
                            }
                            }
 



Change Log

V1.0.4
Final SQL bug fix.
Completely tested on new , clean WoWRoster install, worked perfectly.

V1.0.3
Fixed error in new SQL where the define table wasn't used.

V1.0.2
Small fix to help those with older mySQL installations.

V1.0.1
Small fix because I uploaded the wrong install information.

V1.0.0
Release, yey!
Last edited by Averen on Sun Jul 30, 2006 4:05 am, edited 10 times in total.
User avatar
Averen
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 152
Joined: Thu Jul 20, 2006 5:18 am

Return to Member Log

Who is online

Users browsing this forum: No registered users and 0 guests

cron