Skip to Content
It is currently March 7th, 2021, 3:22 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: March 18th, 2012, 5:50 am 
Offline
Senior User
Senior User

Joined: March 16th, 2012, 7:15 am
Posts: 75
but the song update?


Top
 Profile  
Reply with quote  
PostPosted: March 18th, 2012, 9:01 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8156
Location: Cologne (Germany)
Your HTML templates are not suitable for your database engine.
Either make changes to the HTML templates so that the SQL used inside is compatible with firebird or switch to a different database engine.
Spacial itself suggests to use SAM with MySQL if you plan on doing any web stuff.
The PHP templates are suited for all supported database engines at once, the HTML templates that ship with SAM are not suited for Firebird. You can easily change them or even build your own ones.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: March 18th, 2012, 12:27 pm 
Offline
Senior User
Senior User

Joined: March 16th, 2012, 7:15 am
Posts: 75
but for some people the "Current song" updates itselfs and the "Recently played" even when they are using html for their site. HOw?


Top
 Profile  
Reply with quote  
PostPosted: March 18th, 2012, 1:15 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8156
Location: Cologne (Germany)
They configured the HTML Output in SAM to upload updated HTML files automatically.
That should work for you either if you configured FTP data correctly, just the error messages on the Website won't go away unless you change either the database backend for SAM or the HTML templates.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: March 18th, 2012, 4:30 pm 
Offline
SVS Member
SVS Member

Joined: October 15th, 2003, 11:59 pm
Posts: 4743
Location: Los Angeles - A Little West Of Nashville
jazzFM wrote:
but for some people the "Current song" updates itselfs and the "Recently played" even when they are using html for their site. How?
They use something called "buster code".

_________________
- DJ Dee
- Spacial Volunteer Support (SVS)
- Custom PAL services: www.palscripts.com
- http://www.AlternativeHD.com
- http://www.lahotcountry.com


Top
 Profile  
Reply with quote  
PostPosted: March 19th, 2012, 11:57 am 
Offline
Senior User
Senior User

Joined: March 16th, 2012, 7:15 am
Posts: 75
could you please teach me about that?


Top
 Profile  
Reply with quote  
PostPosted: March 19th, 2012, 1:10 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8156
Location: Cologne (Germany)
It's basically a javascript code that makes the site refresh in fixed intervals.
Code:
<script type="text/javascript">
window.setTimeout("window.location.reload();",10000);</script>

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: March 19th, 2012, 4:15 pm 
Offline
Senior User
Senior User

Joined: March 16th, 2012, 7:15 am
Posts: 75
doesnt work


Top
 Profile  
Reply with quote  
PostPosted: March 20th, 2012, 1:31 am 
Offline
Senior User
Senior User

Joined: March 16th, 2012, 7:15 am
Posts: 75
idk what's wrong, it seemse that sam can't remote the html files


Top
 Profile  
Reply with quote  
PostPosted: March 20th, 2012, 2:38 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8156
Location: Cologne (Germany)
Check the FTP Log Window for error messages and report your findings.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: March 20th, 2012, 3:53 pm 
Offline
Senior User
Senior User

Joined: March 16th, 2012, 7:15 am
Posts: 75
Code:
< 226-File successfully transferred
< 226 0.360 seconds (measured here), 30.87 Kbytes per second
! 11377 bytes received/sent in 0 seconds (31690 Bytes/sec)
> PORT 192,168,1,65,226,236
< 200 PORT command successful
> STOR az_469_The Complete 1924-1926 Sessions_The Tennessee Tooters.jpg
< 150 Connecting to port 53948
< 226-1038 files used (10%) - authorized: 10000 files
< 226-13614 Kbytes used (0%) - authorized: 1536000 Kb
< 226-File successfully transferred
< 226 0.363 seconds (measured here), 27.17 Kbytes per second
! 10091 bytes received/sent in 0 seconds (28108 Bytes/sec)
> PORT 192,168,1,65,226,237
< 200 PORT command successful
> STOR az_470_The Complete 1924-1926 Sessions_The Tennessee Tooters.jpg
< 150 Connecting to port 53949
< 226-1039 files used (10%) - authorized: 10000 files
< 226-13624 Kbytes used (0%) - authorized: 1536000 Kb
< 226-File successfully transferred
< 226 0.364 seconds (measured here), 27.08 Kbytes per second
! 10091 bytes received/sent in 0 seconds (28187 Bytes/sec)
> PORT 192,168,1,65,226,239
< 200 PORT command successful
> STOR az_470_The Goofus Five_The Goofus Five.jpg
< 150 Connecting to port 53951
< 226-1040 files used (10%) - authorized: 10000 files
< 226-13636 Kbytes used (0%) - authorized: 1536000 Kb
< 226-File successfully transferred
< 226 0.462 seconds (measured here), 27.83 Kbytes per second
! 13165 bytes received/sent in 0 seconds (29126 Bytes/sec)
> PORT 192,168,1,65,226,240
STOR/APPE: not connected


Last edited by Mastacheata on March 23rd, 2012, 9:57 am, edited 1 time in total.
Please use code tags when posting verbose text snippets


Top
 Profile  
Reply with quote  
PostPosted: March 21st, 2012, 1:15 am 
Offline
Junior User
Junior User

Joined: May 25th, 2010, 12:14 pm
Posts: 35
Location: Ukraine
JazzFM wrote:
So it is not possible to do it for me?

If your hosting supports php:
Code:
<?php
//timer
// START OF PLAY
$time1 = '$NOW_DATE$ $NOW_TIME$';
// SERVER TIME
$time2 = date("d.m.Y G:i:s");

$t1 = explode(" ", $time1);
$t2 = explode(" ", $time2);
$d1 = explode(".", $t1['0']);
$d2 = explode(".", $t2['0']);
$ti1 = explode(":", $t1['1']);
$ti2 = explode(":", $t2['1']);
// DURATION
$ts = '$SONG.SS$';
// Adjust TIME SERVER ;-)
$tr = '-5';
// Calculates the difference in SECONDS
$atimer = intval((mktime($ti2[0],$ti2[1],$ti2[2],$d2[1],$d2[2],$d2[0])) - mktime($ti1[0],$ti1[1],$ti1[2],$d1[1],$d1[2],$d1[0]));
// Subtract the length DIFFERENCE
$btimer = intval($ts - $atimer);
// Adds OUR FEW SECONDS
$сtimer = $btimer+$tr;
 ?>
<!--include("_config.html")-->
<!DOCTYPE html>
<html lang="ru">
   <head>
 
      <meta http-equiv="refresh" content="<?php echo $сtimer; ?>; url=/wait">

   </head>



         <h2>$song.title$</h2>
         
            <script type="text/javascript">
            //<![CDATA[
            <!--
            var loadedcolor='#8DADD1';         // PROGRESS BAR COLOR
            var unloadedcolor='#000000';       // COLOR OF UNLOADED AREA
            var bordercolor='#fff';         // COLOR OF THE BORDER
            var barheight=6;                  // HEIGHT OF PROGRESS BAR IN PIXELS
            var barwidth=188;                  // WIDTH OF THE BAR IN PIXELS
            var waitTime=<?php echo $сtimer; ?>; // NUMBER OF SECONDS FOR PROGRESSBAR
            var action=function()
            {
            //window.location.reload();
            //alert("Welcome!");
            //window.location="/wait.html"
            }
            var ns4=(document.layers)?true:false;
            var ie4=(document.all)?true:false;
            var blocksize=(barwidth-2)/waitTime/10;
            var loaded=0;
            var PBouter;
            var PBdone;
            var PBbckgnd;
            var Pid=0;
            var txt='';
            if(ns4){
            txt+='<table border=0 cellpadding=0 cellspacing=0><tr><td>';
            txt+='<ilayer name="PBouter" visibility="hide" height="'+barheight+'" width="'+barwidth+'" onmouseup="hidebar()">';
            txt+='<layer width="'+barwidth+'" height="'+barheight+'" bgcolor="'+bordercolor+'" top="0" left="0"><\/layer>';
            txt+='<layer width="'+(barwidth-2)+'" height="'+(barheight-2)+'" bgcolor="'+unloadedcolor+'" top="1" left="1"><\/layer>';
            txt+='<layer name="PBdone" width="'+(barwidth-2)+'" height="'+(barheight-2)+'" bgcolor="'+loadedcolor+'" top="1" left="1"><\/layer>';
            txt+='<\/ilayer>';
            txt+='<\/td><\/tr><\/table>';
            }else{
            //txt+='<div id="PBouter" onmouseup="hidebar()" style="position:relative; visibility:hidden; background-color:'+bordercolor+'; width:'+barwidth+'px; height:'+barheight+'px;">';
            txt+='<div id="PBouter" onmouseup="" style="position:relative; visibility:hidden; background-color:'+bordercolor+'; width:'+barwidth+'px; height:'+barheight+'px;">';
            txt+='<div style="position:absolute; top:1px; left:1px; width:'+(barwidth-2)+'px; height:'+(barheight-2)+'px; background-color:'+unloadedcolor+'; font-size:1px;"><\/div>';
            txt+='<div id="PBdone" style="position:absolute; top:1px; left:1px; width:0px; height:'+(barheight-2)+'px; background-color:'+loadedcolor+'; font-size:1px;"><\/div>';
            txt+='<\/div>';
            }
            document.write(txt);
            function incrCount(){
            window.status="Playing... $song.combine$";
            loaded++;
            if(loaded<0)loaded=0;
            if(loaded>=waitTime*10){
            clearInterval(Pid);
            loaded=waitTime*10;
            setTimeout('hidebar()',100);
            }
            resizeEl(PBdone, 0, blocksize*loaded, barheight-2, 0);
            }
            function hidebar(){
            clearInterval(Pid);
            window.status='';
            //if(ns4)PBouter.visibility="hide";
            //else PBouter.style.visibility="hidden";
            action();
            }
            function findlayer(name,doc){
            var i,layer;
            for(i=0;i<doc.layers.length;i++){
            layer=doc.layers[i];
            if(layer.name==name)return layer;
            if(layer.document.layers.length>0)
            if((layer=findlayer(name,layer.document))!=null)
            return layer;
            }
            return null;
            }
            function progressBarInit(){
            PBouter=(ns4)?findlayer('PBouter',document):(ie4)?document.all['PBouter']:document.getElementById('PBouter');
            PBdone=(ns4)?PBouter.document.layers['PBdone']:(ie4)?document.all['PBdone']:document.getElementById('PBdone');
            resizeEl(PBdone,0,0,barheight-2,0);
            if(ns4)PBouter.visibility="show";
            else PBouter.style.visibility="visible";
            Pid=setInterval('incrCount()',95);
            }
            function resizeEl(id,t,r,b,l){
            if(ns4){
            id.clip.left=l;
            id.clip.top=t;
            id.clip.right=r;
            id.clip.bottom=b;
            }else id.style.width=r+'px';
            }
            window.onload=progressBarInit;
            //-->
            //]]>
            </script>
            
             <h2 id="countDownText"></h2>
            
            <script type="text/javascript">
            //<![CDATA[
            var countDownInterval = <?php echo $сtimer; ?>;
            var countDownTime = countDownInterval + 1;
            if (document.all||document.getElementById)
            countDown();
            else
            window.onload = countDown;
            function countDown() {
            countDownTime--;
            if (countDownTime == 0) {
            countDownTime = countDownInterval;
            window.location="/wait"
            return;
            }
            else if (countDownTime < 0)
            countDownTime = 30;
            if (document.all)
            document.all.countDownText.innerText = secsToMins(countDownTime);
            else if (document.getElementById)
            document.getElementById("countDownText").innerHTML = secsToMins(countDownTime);
            counter = setTimeout("countDown()", 1000);
            }
            function secsToMins(theValue) {
            var theMin = Math.floor(theValue / 60);
            var theSec = (theValue % 60);
            if (theSec < 10)
            theSec = "0" + theSec;
            return(theMin + ":" + theSec);
            }
            //]]>
            </script>




</html>

Good luck! :wink:

_________________
Image
Image


Top
 Profile  
Reply with quote  
PostPosted: March 23rd, 2012, 9:59 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8156
Location: Cologne (Germany)
Your FTP log doesn't show any errors, but there's also not a single HTML file that was updated.
Have you even turned on automatic updates of the playing.html via the included ftp settings?

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: January 16th, 2019, 12:24 pm 
Offline
Senior User
Senior User

Joined: September 7th, 2018, 9:00 am
Posts: 115
You don't need to count down.

on _config.html
set the line
from
Code:
<!--VAL(timeout,"30000$")-->

to
Code:
<!--VAL(timeout,"$song.duration$")-->


into _playing.html

from
Code:
                        <script type="text/javascript">
                        //<![CDATA[
                  /*
                            var refreshID = "";
                            refreshID = setTimeout("DoRefresh()", $timeout$);

                            function DoRefresh()
                            {
                                var buster = Math.random();
                                document.location.href = 'playing.html?buster='+buster;
                            }
                     */
                        //]]>
                        </script>



to
Code:
                        <script type="text/javascript">
                        //<![CDATA[
                  /*

                            var RefreshTime= $timeout$ ;
                            var refreshID = "";
                            refreshID = setTimeout("DoRefresh()", RefreshTime);

                            function DoRefresh()
                            {
                                var buster = Math.random();
                                document.location.href = 'playing.html?buster='+buster;
                            }
                     */
                        //]]>
                        </script>


to overcome the inertia of the upload, I do suggest this line in the following way:
Code:
 var RefreshTime= $timeout$ + 5000;


It adds 5 seconds, in order to extend a bit the refresh, giving the time to SAM to upload to the server
This value is up to you. I strongly suggest do not be higher than 5 seconds ... the less, the better


However I updated the whole code with this one:

Code:
                  <script type="text/javascript">
                  //<![CDATA[
                  
                  function autoReload() {
                    var RefreshTime = ( $timeout$ ) + 5000;
                    setTimeout(function() {
                           var rand = Math.random();
                     var address = 'playing.html?rand='+rand;
                     $.ajax({
                      url: 'playing.html?rand='+rand,
                      success: function(data) {
                          location.reload(address);
                       }
                     });

                     autoReload();  // calling again after the duration of the song expired
                   }, RefreshTime );
                  }
                  autoReload(); // calling the function for the first time
                  
                  //]]>
                  </script>


Of course this way can be not precise at all, but it refreshes the page following the duration of the song.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 18 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group