Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-13-2010, 09:41 PM   PM User | #1
gazaweb
New Coder

 
Join Date: Sep 2010
Posts: 16
Thanks: 6
Thanked 0 Times in 0 Posts
gazaweb is an unknown quantity at this point
do something if string changes, help :D

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 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?


PHP Code:
//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(01)
                                                          )              );

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

        
$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 is offline   Reply With Quote
Old 12-15-2010, 06:54 PM   PM User | #2
gazaweb
New Coder

 
Join Date: Sep 2010
Posts: 16
Thanks: 6
Thanked 0 Times in 0 Posts
gazaweb is an unknown quantity at this point
guessing no help with this then
gazaweb is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:59 PM.


Advertisement
Log in to turn off these ads.