Jump to content

rsxdev

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

rsxdev's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Just checked this very simple script, but it have input from within script: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <script type="text/javascript"> var tWidth='300px'; // width (in pixels) var tHeight='25px'; // height (in pixels) var tcolour='#ffffcc'; // background colour: var moStop=true; // pause on mouseover (true or false) var fontfamily = 'arial,sans-serif'; // font for content var tSpeed=3; // scroll speed (1 = slow, 5 = fast) // enter your ticker content here (use \/ and \' in place of / and ' respectively) var content='Are you looking for loads of useful information <a href="http:\/\/javascript.about.com\/">About Javascript<\/a>? Well now you\'ve found it.'; var cps=-tSpeed; var aw, mq; var fsz = parseInt(tHeight) - 4; function startticker(){if (document.getElementById) {var tick = '<div style="position:relative;width:'+tWidth+';height:'+tHeight+';overflow:hidden;background-color:'+tcolour+'"'; if (moStop) tick += ' onmouseover="cps=0" onmouseout="cps=-tSpeed"'; tick +='><div id="mq" style="position:absolute;right:0px;top:0px;font-family:'+fontfamily+';font-size:'+fsz+'px;white-space:nowrap;"><\/div><\/div>'; document.getElementById('ticker').innerHTML = tick; mq = document.getElementById("mq"); mq.style.right=(10+parseInt(tWidth))+"px"; mq.innerHTML='<span id="tx">'+content+'<\/span>'; aw = document.getElementById("tx").offsetWidth; lefttime=setInterval("scrollticker()",50);}} function scrollticker(){mq.style.right = (parseInt(mq.style.right)>(-10 - aw)) ? mq.style.right = parseInt(mq.style.right)+cps+"px": parseInt(tWidth)+10+"px";} window.onload=startticker; </script> </head> <body> <div id="ticker"> this is a simple scrolling text! </div> </body> </html> Can the above script be used with following code that print php output into the div? <html> <head> <title></title> <script> setInterval(function () { $('#reload').load('list.php'); }, 10000); </script> </head> <body> <div id="reload"></div> </body> </html>
  2. Hi, that would be simple way, but marguee tag no longer supported. I'm trying to find some more recent cross-browser javascript, that will do smooth scrolling. There is more recent one at http://www.dynamicdrive.com/dynamicindex2/cmarquee2.htm, but it scrolls the contents upwards. Not sure can it be adopted for scrolling contents horizontally (sideways)?
  3. I have the following code, and want to insert php output into a scrolling marguee to show it on web page. <?php $playlistUrl = 'http://domain.com/playlist.xml'; $xmldata = file_get_contents($playlistUrl); $xml = new SimpleXMLElement($xmldata); foreach( $xml->trackList->track as $track ) { echo $track->title .' - '. $track->annotation .'<br>'; } ?> How to connect php script and javascript together? I checked various javascript scrollers, some of them accepts HTML markup.
  4. oh yes "\n" character as a newline delimiter. For simplicity, I want grab full first line after <annotation> tag (before Content Type:). not sure will this be right: $metadata->trackList->annotation as $annotation $parts = explode("\n", $metadata); echo $parts[0]; I need echo it after track title, in one line.
  5. will it count as '\n' new line every tab between words inside <annotation> </annotation> tags?'
  6. can you show an explode example? The Example1 from http://php.net/explode is too generic. For simplicity, I want grab this part "Stream Genre: Electronic Ambient Downtempo"
  7. need be endforeach added to the end? <?php $playlistUrl = 'http://path/to/playlist.xspf'; $xmldata = file_get_contents($playlistUrl); $xml = new SimpleXMLElement($xmldata); foreach( $xml->trackList->track as $track ) { echo $track->title .' - '. $track->annotation .'<br>'; endforeach; ?>
  8. XMLReader class seems will be better for this task.
  9. well, but I need process URL, not code. So I need get xml document into SimpleXML: <?php $playlistUrl = 'http://path/to/playlist.xspf'; $xmldata = file_get_contents($playlistUrl); $xml = new SimpleXMLElement($xmldata); foreach( $xml->trackList->track as $track ) { echo $track->title .' - '. $track->annotation .'<br>'; } ?> I need not all data from 'annotation' field, but only part I specified. How to filter it out correctly? Also how to implement custom text and scrolling function?
  10. I need PHP script that will parse XML-based (.xspf format) live stream playlist stored on web server, retrieve track data and print it on my web page. Print inside div as scrolling text (one line). The track data on page need be refreshed synchronously to show current track info. XSPF playlist example: <?xml version="1.0" encoding="UTF-8"?> <playlist xmlns="http://xspf.org/ns/0/" version="1"> <title/> <creator/> <trackList> <track> <location>http://geodesid5.streams.audioveduct.com:80/di_ambient7</location> <title>Bruno Sanfilippo - Piano Textures 2 II</title> <annotation>Stream Title: Ambient - DIGITALLY IMPORTED - a blend of ambient, downtempo, and chillout Content Type:audio/mpeg Current Listeners: 0 Peak Listeners: 0 Stream Genre: Electronic Ambient Downtempo</annotation> <info>http://www.di.fm</info> </track> </trackList> </playlist> I need get data from fields 'title' and 'annotation' (only text between Stream Title and Content Type). Also, after these two, I want scroll small custom text, when required. I searched some close example, but didn't find yet. Will be DOMDocument method suitable for this task? Can someone show me the right method to do this?
  11. Hello, I am new in PHP, I like web programming, open source CMS, and I like learn new knowledge. I'd just like to say hello to everyone here.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.