HighDots Forums  

RSS Replay - Dynamic Sources

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss RSS Replay - Dynamic Sources in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
jsteinmann
 
Posts: n/a

Default RSS Replay - Dynamic Sources - 07-11-2008 , 08:58 AM






Want to use dynamic sources for the rss feeds instead of hard coding the URLs
into the script. How can I use PHP within the javascript. The below doesn't
work.

RSS Replay is the dreamweaver extension


<script language="JavaScript1.2" type="text/javascript">
<!-- hide script from non-js browsers
//RSS Replay v 1.5 by RNSoft
//MethodName:AJAX-Proxy-PHP
//SettingName:
rssReplayFeed("rss",
10,
"",
"<div><span <<headlineclass>>><a href=\"<<link>> \"\" target=\"_blank\"
onMouseOver=\"flvXAS1(0)\"
onMouseOut=\"flvXAS1(1,1,50,1)\"><<headline>></a>"+"\n"+
"</span>",
"",
"<br><span <<storyclass>>><<strip_story>></span></div><br>"+"\n"+
"",
"",
""+"\n"+
"",
rrpBuildSourceList("<?php echo $row_rsNewsFeed['source1']; ?>",
"<?php echo $row_rsNewsFeed['source2']; ?>",
"<?php echo $row_rsNewsFeed['source3']; ?>",
"<?php echo $row_rsNewsFeed['source4']; ?>",
"<?php echo $row_rsNewsFeed['source5']; ?>"),
true,
-1,
true,
"d-date")
// end hide of script -->
</script>


Reply With Quote
  #2  
Old   
jsteinmann
 
Posts: n/a

Default Re: RSS Replay - Dynamic Sources - 07-11-2008 , 10:58 AM






How can you use dynamic resources in a javascript based rss feed gatherer like rss replay?

Reply With Quote
  #3  
Old   
Michael Fesser
 
Posts: n/a

Default Re: RSS Replay - Dynamic Sources - 07-11-2008 , 11:06 AM



..oO(jsteinmann)

Quote:
Want to use dynamic sources for the rss feeds instead of hard coding the URLs
into the script. How can I use PHP within the javascript. The below doesn't
work.
You can't directly call PHP from JS, but of course you can use PHP to
generate your JS.

Micha


Reply With Quote
  #4  
Old   
jsteinmann
 
Posts: n/a

Default Re: RSS Replay - Dynamic Sources - 07-11-2008 , 12:13 PM



hmmmmm......

can you give me an example?

Reply With Quote
  #5  
Old   
Michael Fesser
 
Posts: n/a

Default Re: RSS Replay - Dynamic Sources - 07-12-2008 , 04:11 PM



..oO(jsteinmann)

Quote:
hmmmmm......

can you give me an example?
Like you can use PHP to output HTML, you can also use it to generate JS.
There's not much of a difference. If the script is embedded in the HTML
with a 'script' element like in your case, it's particularly easy. Here
is a short example:

http://www.alt-php-faq.org/local/33/

Of course the entire page has to be passed through PHP, usually by
simply giving it a .php extension. Whether the embedded PHP outputs
some HTML or JS doesn't really matter from the browser's point of view.

Here's a more advanced example of using PHP in an external JS file:

http://javascriptkit.com/javatutors/externalphp.shtml

The key point in both is that PHP is used to write JS statements, which
are then interpreted by the browser.

For more informations and examples try a Google search for keywords like
"generate javascript with php"

Micha


Reply With Quote
  #6  
Old   
jsteinmann
 
Posts: n/a

Default Re: RSS Replay - Dynamic Sources - 07-12-2008 , 10:30 PM



turns out the code was correct, but with that script, feeds can never start with feed://... must be http://.

Reply With Quote
Reply




Thread Tools
Display Modes

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

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



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.