Anaxent wrote:lol.... sorry for laughing, but yeah it is supposed to read avatar and not signiture my bad. Sometimes i get too far ahead of myself and just forget a few things.
<?php
/*******************************
* $Id: trigger.php 11 2006-07-16 06:09:06Z zanix $
*******************************/
if ( !defined('ROSTER_INSTALLED') )
{
exit('Detected invalid access to this file!');
}
/*
Start the following scripts when "update.php" is called
Available variables
- $wowdb = roster's db layer
- $member_id = character id from the database ( ex. 24 )
- $member_name = character's name ( ex. 'Jonny Grey' )
- $roster_conf = The entire roster config array
- $mode = when you want to run the trigger
= 'char' - during a character update
= 'guild' - during a guild update
You may need to do some fancy coding if you need more variables
You can just print any needed output
*/
//----------[ INSERT UPDATE TRIGGER BELOW ]-----------------------
// The following is an example "trigger.php" file from zanix's SigGen
//------[ Get DB settings ]-----------------------
$sql_str = "SHOW TABLES LIKE '".ROSTER_SIGCONFIGTABLE."';";
$result = $wowdb->query($sql_str);
$r = $wowdb->fetch_assoc($result);
if( !empty($r) )
{
// Read SigGen Config data from Database
$config_str = "SELECT `config_id`,`trigger`,`guild_trigger` FROM `".ROSTER_SIGCONFIGTABLE."`;";
$config_sql = $wowdb->query($config_str);
if( $config_sql && $wowdb->num_rows($config_sql) != 0 )
{
while( $siggen_row = $wowdb->fetch_assoc($config_sql) )
{
$SigGenConfig[$siggen_row['config_id']]['trigger'] = $siggen_row['trigger'];
$SigGenConfig[$siggen_row['config_id']]['guild_trigger'] = $siggen_row['guild_trigger'];
}
}
$wowdb->free_result($config_sql);
unset($siggen_row);
}
global $module_name;
// Run this on a character update
if( $mode == 'char' )
{
if( $SigGenConfig['signature']['trigger'] )
{
print 'Saving Sig-[ <img src="index.php?name='.$module_name.'&file=addon&roster_addon_name=siggen&mode=signature&member='.urlencode(utf8_decode($member_name)).'&etag=0" width="75" height="16" alt="" /> ]';
}
if( $SigGenConfig['avatar']['trigger'] )
{
print ' Saving Avatar-[ <img src="index.php?name='.$module_name.'&file=addon&roster_addon_name=siggen&mode=avatar&member='.urlencode(utf8_decode($member_name)).'&etag=0" width="19" height="16" alt="" /> ]';
}
}
// Run this on a guild update
if( $mode == 'guild' )
{
if( $SigGenConfig['signature']['guild_trigger'] )
{
print 'Saving Sig-[ <img src="index.php?name='.$module_name.'&file=addon&roster_addon_name=siggen&mode=signature&member='.urlencode(utf8_decode($member_name)).'&etag=0" width="75" height="16" alt="" /> ]';
}
if( $SigGenConfig['avatar']['guild_trigger'] )
{
print ' Saving Avatar-[ <img src="index.php?name='.$module_name.'&file=addon&roster_addon_name=siggen&mode=avatar&member='.urlencode(utf8_decode($member_name)).'&etag=0" width="19" height="16" alt="" /> ]';
}
}
unset($SigGenConfig);
?>
Users browsing this forum: No registered users and 0 guests