...

View Full Version : do something if string changes, help :D



gazaweb
12-13-2010, 09:41 PM
im glad you are here or i would be **word removed :O **

right

i have this script that posts strings into a ajax updating shoutbox :D fancy i know

now i have it reading a shoutcast xml and posting data on that

but i have it set so it posts every 3 times a post has been made in the shoutbox


i dont want it to do that

i want it to post every time the tune changes!

so

me: sup
:bot: current track: track 1
me: lalala
me: lalalalalaldfkjdfg
**TRACK CHANGES TO TRACK 3**
:BOT: Current: track: Track 3


i have it set so it posts the track like i said

so how would i get it to post when it changes?




//SHOUTBOX BOT
error_reporting(0);
include('./radio/radio_stats.php');

$status = ' ';

if($streamstatus == "0")
$status= 'Offline';
else
$status= 'Current Track: ' . $song[0];


//$song[0]
$ls['frombot'] = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'shoutbox_shouts', 'order' => 's_id DESC',
'where' => "s_ip='107.0.0.1'",
'limit' => array(0, 1)
) );

$ls['fromusr'] = $this->DB->buildAndFetch( array( 'select' => '*', 'from' => 'shoutbox_shouts', 'order' => 's_id DESC',
'limit' => array(0, 1)
) );

$incamount = $this->settings['shoutbox_bot_frequency'];
$botid = $ls['frombot']['s_id'];
$recentid = $ls['fromusr']['s_id'];
$new=$botid+$incamount;


if ($new < $recentid) {
$this->DB->insert( 'shoutbox_shouts',
array( 's_mid' => $this->settings['shoutbox_bot_memid'],
's_message' => $status,
's_date' => time(),
's_ip' => '107.0.0.1'
) );
}

// ------------ End autoshoutbox mod ---------------

gazaweb
12-15-2010, 06:54 PM
guessing no help with this then :(



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum