Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Sep 2010
    Posts
    16
    Thanks
    6
    Thanked 0 Times in 0 Posts

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

  • #2
    New Coder
    Join Date
    Sep 2010
    Posts
    16
    Thanks
    6
    Thanked 0 Times in 0 Posts
    guessing no help with this then


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •