vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Shoutcast Status 2.0 (3.5) (https://vborg.vbsupport.ru/showthread.php?t=94336)

l0streflecti0n 03-08-2006 01:11 PM

i was wondering if there was any way to add an auto refresh so that when a song changes it also refreshes the song title ect in the forum page that way the user dosent have to manually refresh the page... .. kinda like the php-nuke shoutcast block ... thanks

Zachariah 03-09-2006 02:51 PM

Quote:

Originally Posted by l0streflecti0n
i was wondering if there was any way to add an auto refresh so that when a song changes it also refreshes the song title ect in the forum page that way the user dosent have to manually refresh the page... .. kinda like the php-nuke shoutcast block ... thanks

On my to do list :)
I will look in on it.

l0streflecti0n 03-10-2006 01:03 AM

hey thanx for that quick reply... will be looking forward to it

Orcun 03-15-2006 09:14 PM

Hi everyone,

I Just installed and did what it says in install.txt but in the main page it does not display the song info.

It says that the server is off but It's not. I am not the admin, I have a password to use on Winamp to broadcast, I bought this hosting service.

It that password enough ?

If yes, what can be the problem ? I have entered IP correctly, Port correctly and Password correctly. What else should be wrong ?

Zachariah 03-15-2006 09:55 PM

Quote:

Originally Posted by Orcun
Hi everyone,

I Just installed and did what it says in install.txt but in the main page it does not display the song info.

It says that the server is off but It's not. I am not the admin, I have a password to use on Winamp to broadcast, I bought this hosting service.

It that password enough ?

If yes, what can be the problem ? I have entered IP correctly, Port correctly and Password correctly. What else should be wrong ?

The "full" ver. of this hack needs Admin password to access the data. (there is admin, DJ password)

Lite ver. you can just use IP and port, but less info can be gathered.
https://vborg.vbsupport.ru/showthread.php?t=97500

Orcun 03-15-2006 10:35 PM

Thx for quick reply. I read the whole topic.

I was unable to find out the output of

$scfp = @fsockopen($scip, $scport, &$errno, &$errstr, 1); // Connect to the server

I asked my host, and he said that they closed fopen which Php uses to write XML.

I switched to Crontab. And entered the command. Here's the result I have.

/bin/sh: line 1: /usr/bin/lynx: Permission denied

I have -auth=admin:xxx password because I have access to Admin panel of my Shoutcast server.

Well, I think I did my best :)

Next step is I want to make Lynx enable. I cant persuade my host to enable fopen etc.

For triggerin Issues, I want this script only to read cast.xml from my hoe directory and Dont execute the fsocket, fopen commands. I should reduce the load a bit.

How can I do that ?

Make cron the grabbing info from Shoutcast.
Make This Script to only read xml file on my host.

Thanks in advance.

P.S: I have a Problem with the cron command I think.

Code:

*/5 * * * * lynx -auth=admin:dNASpasshere -source http://dNAS-IP-Or-Domain:port/admin.cgi?mode=viewxml 1> /webserver/path/public_html/filename.xml
Should be

Code:

5 * * * * lynx -auth=admin:dNASpasshere -source http://dNAS-IP-Or-Domain:port/admin.cgi?mode=viewxml > /webserver/path/public_html/filename.xml
I removed */ part from the beginning and 1> from the lynx source .

Is the first one true of false ?
If it is true can you please explain why */5 instead of only 5 and 1> instead of only >

I searched some documentation but I was unable to find anything.

Orcun 03-15-2006 11:14 PM

I checked if fopen is closed, NO !

Well, I manually pulled the XML file from Shoutcast server. Uploaded it to specified dir and refreshed.

Still says the Radio is Offline. But there is a XML filled radio.xml file which has a static info in it.

I specified the path for file as /home/forumtur/public_html/radio.xml

Are there anything wrong you see ?

Zachariah 03-16-2006 02:14 AM

Quote:

Originally Posted by Orcun
I checked if fopen is closed, NO !

Well, I manually pulled the XML file from Shoutcast server. Uploaded it to specified dir and refreshed.

Still says the Radio is Offline. But there is a XML filled radio.xml file which has a static info in it.

I specified the path for file as /home/forumtur/public_html/radio.xml

Are there anything wrong you see ?

What about this ?

Code:

// Add:
$domain = "www.domainhere.com";  // The domain to retrieve the xml
$xmlfile = "filename.xml";  //xml filename from your saved stdout 1>

// Change
$scfp = fsockopen($domain, 80, &$errno, &$errstr, 1);

// Change
fputs($scfp,"GET /$xmlfile HTTP/1.0\r\nUser-Agent: SHOUTcast Song Status (Mozilla Compatible)\r\n\r\n");


Orcun 03-16-2006 08:19 AM

Where will I add this info ?

The plugin at the forumhome hook also grab those values from $vbulletin_options -> etc.

Sorry but I didn't understand what u mean.

$scdef = $vbulletin->options['scname_full'];
$scip = $vbulletin->options['scip_full'];
$scport = $vbulletin->options['scport_full'];
$scpass = $vbulletin->options['scpass_full'];
$ircsite = $vbulletin->options['scirc_full'];
$file = $vbulletin->options['scxml_full'];
$cache_tolerance = $vbulletin->options['scupdate_full'];

Options are grabbed by plugin. What else ?

Orcun 03-16-2006 09:14 AM

Well, I changed the plug-in code just to use the XML file written by Lynx.
Also, when I remove @fsockopen, It says It cannot connect to the IP specified on port 5555.

fsockopen should be blocked by a Firewall.

Here's the new code for the plugin.

PHP Code:

$scdef $vbulletin->options['scname_full'];
$scip $vbulletin->options['scip_full'];
$scport $vbulletin->options['scport_full'];
$scpass $vbulletin->options['scpass_full'];
$ircsite $vbulletin->options['scirc_full'];
$file $vbulletin->options['scxml_full'];
$cache_tolerance $vbulletin->options['scupdate_full'];

// Check if Cache needs an update
        
if (file_exists($file)) {
            
clearstatcache();  
            
$time_difference time() - filemtime($file); 
        } else {
            
$time_difference $cache_tolerance;  // force update
        
}

        
// Outputs the cached file after new data
    
$xmlcache fopen($file,"r");
    
$page '';
    if(
$xmlcache){
         while (!
feof($xmlcache)) {
           
$page .= fread($xmlcache8192);
         }
        
                
fclose($xmlcache);
    }        
    else{
        
// outputs the cached file
    
$xmlcache fopen($file,"r");
    
$page '';
        if(
$xmlcache){
              while (!
feof($xmlcache)) {
                 
$page .= fread($xmlcache8192);
              }

                
fclose($xmlcache);
                }
        }

//define  xml elements
            
$loop = array("AVERAGETIME""CURRENTLISTENERS""PEAKLISTENERS""MAXLISTENERS""SERVERGENRE""SERVERURL""SERVERTITLE""SONGTITLE""SONGURL""IRC""ICQ" ,"AIM""WEBHITS""STREAMHITS""LISTEN""STREAMSTATUS""BITRATE""CONTENT");
            
$y=0;
        while(
$loop[$y]!=''){
          
$pageed ereg_replace(".*<$loop[$y]>"""$page);
          
$scphp strtolower($loop[$y]);
          $
$scphp ereg_replace("</$loop[$y]>.*"""$pageed);
      if(
$loop[$y]==SERVERGENRE || $loop[$y]==SERVERTITLE || $loop[$y]==SONGTITLE || $loop[$y]==SERVERTITLE)
           $
$scphp urldecode($$scphp);
            ;
          
$y++;
        }
//end intro xml elements

//get song info and history
            
$pageed ereg_replace(".*<SONGHISTORY>"""$page);
            
$pageed ereg_replace("<SONGHISTORY>.*"""$pageed);
            
$songatime explode("<SONG>"$pageed);
            
$r=1;
        while(
$songatime[$r]!=""){
          
$t=$r-1;
          
$playedat[$t] = ereg_replace(".*<PLAYEDAT>"""$songatime[$r]);
          
$playedat[$t] = ereg_replace("</PLAYEDAT>.*"""$playedat[$t]);
          
$song[$t] = ereg_replace(".*<TITLE>"""$songatime[$r]);
          
$song[$t] = ereg_replace("</TITLE>.*"""$song[$t]);
          
$song[$t] = urldecode($song[$t]);
          
$dj[$t] = ereg_replace(".*<SERVERTITLE>"""$page);
          
$dj[$t] = ereg_replace("</SERVERTITLE>.*"""$pageed);
            
$r++;
        }

        
$averagemin round($averagetime/60,2);
        
$irclink 'irc://'.$ircsite.'/'.$irc.'';
        
$listenamp 'http://'.$scip.':'.$scport.'/listen.pls';
        
$listenlnk 'http://'.$scip.':'.$scport.'';

// Player template requests
        
if ($_REQUEST['do'] == 'mp'){ // MP popup link
        
eval('print_output("' fetch_template('forumhome_shoutcast_mp') . '");'); 
        }
        if (
$_REQUEST['do'] == 'rp'){ // RP popup link 
        
eval('print_output("' fetch_template('forumhome_shoutcast_rp') . '");'); 
        }
        if (
$_REQUEST['do'] == 'qt'){ // QT popup link
        
eval('print_output("' fetch_template('forumhome_shoutcast_qt') . '");'); 
        }

//display stats
        
if($time_difference <= $cache_tolerance){
                if(
$streamstatus == "1"){
                    
$search_text '<!-- end logged-in users -->';
                    
$vbulletin->templatecache['FORUMHOME'] = str_replace($search_text,
                    
$search_text.fetch_template('forumhome_shoutcast'),$vbulletin->templatecache['FORUMHOME']);
                } else {
                    
$search_text '<!-- end logged-in users -->';
                    
$vbulletin->templatecache['FORUMHOME'] = str_replace($search_text,
                    
$search_text.fetch_template('forumhome_shoutcast_off'),$vbulletin->templatecache['FORUMHOME']);
                }
        } 



All times are GMT. The time now is 10:56 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01272 seconds
  • Memory Usage 1,819KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete