TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

May 05, 2024, 12:06:14 AM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,178
  • Total Topics: 21,220
  • Online today: 40
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 58
  • Total: 58

[done!] RSS block (site displays a.s.a.p, then RSS feeds are loaded)

Started by gijs, December 06, 2006, 11:09:41 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

gijs

TP/SMF Website now is loaded independent from (slow/not working) RSS feeds

Using this script:
http://www.dynamicdrive.com/dynamicindex18/rssdisplaybox/index.htm

Required actions to get this working:
- upload script to a folder on your site
- add some extra code in the header of your site
- add a small piece of javascript in a block to display a RSS feed

All instructions can be found on the page mentioned above. Got it working in 15 min.

haxen

yes, you are correct.  this is a superb RSS reader that is nicely customizatble.  The feature that I like is being able to set how many stories are parsed.

You can see a Digg RSS feed on stories about the PS3 as an example of this implementation at www.ps3hax.com

thanks for the link

sfboarders

I am having problems implementing this mod. I followed the directions step by step from here but all I am receiving is a js error in IE and nothing showing in the box. Seems pretty self explanatory. Any ideas? Code below:

code in index.template.php


}
    setmysize(szs[ sz ]);
}

// ]]></script>
<link rel="stylesheet" type="text/css" href="rssbox/rssdisplaybox.css" />
<script type="text/javascript" src="rssbox/virtualpaginate.js"></script>

<script type="text/javascript" src="rssbox/rssdisplaybox.js">

/***********************************************
* RSS Display Boxes- Ã,© Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/

</script>
</head>
<body>';

echo '
<div id="maintable">


Code in html + BBC box


<script type="text/javascript">
var showbbc=new rssdisplaybox("bbc", "bbcid", "someclass")
showbbc.set_items_shown(10) //show 10 entries from feed
showbbc.start() //Required: start script
</script>


Edited rssdisplaybox.js


//Path to "main.php" *relative* to "demo.htm", or the HTML page on your server displaying the RSS Box:

var rssoutputscript="rssbox/main.php"

//Switch to full URL to "main.php" on your server below, so script will work with any page on your server, not just "demo.htm"
//Do NOT change window.location.hostname, which is your site's root domain, dynamically determined
//Configure below line and uncomment it to activate it:

rssoutputscript="http://"+window.location.hostname+"/rssbox/main.php"


////////////No need to edit beyond here//////////////


The line of code where I am receiving the js "Syntax Error" while viewing the source.


<div class="windowbg" style="padding:4px; " id="block25"><script type="text/javascript"><br />var showbbc=new rssdisplaybox("bbc", "bbcid", "someclass")<br />showbbc.set_items_shown(10) //show 10 entries from feed<br />showbbc.start() //Required: start script<br /></script></div></div>


gijs

First try this:

I used a 'scriptbox' and not html + BBC. Think this is required to make the javascript work.
(just tried it: when I use html+BBC instead of scriptbox I do get a syntax error too!!)

your code looks fine to me (when I put it in a block on my site it works)

So I think this should do it already. Just use a 'scriptbox' instead.


Then If things still not work, try this:

in rssdisplaybox.js I have

instead of

var rssoutputscript="rssbox/main.php"

the line

rssoutputscript="http://"+window.location.hostname+"/portal/rss/rssbox/main.php"

Notice the missing 'var'. 'Portal' is the folder where SMF is installed (folder resides in the root of my site: www.mysite.com/portal)

Can't remember why I made the change though, so you might not need to change this.

sfboarders

Thanks gijs. I turned the box into a script box and it worked!  :)

haxen

I am having a problem in showing 2 rss feeds in separate boxes.  The bottom one always shows blank and the top one seems to load the first feed, and then overwrites it with the second feed.  can you verify if this is your experience?  I am using scriptboxes for the script.

gijs

Easy: just name the variable different:

for example in block 1:
'showbbc'

and in block 2:
'showbbc2'

(did that solve your problem?)

sfboarders

you know how to get the links to popup in a new window? I don't want people leaving the site when they click on a link.

Also do you know a good source of rss feeds? I am having a hard time finding specific type of feeds.

"San Francisco tide predictions/tables"
and "Lake Tahoe traffic conditions"

:)

gijs

Open the file 'outputbody.php'. In it you'll find all versions for displaying a rss-feed.
Select the one you're using and add  'target="_blank"' to it, for example:

<div class="rsstitle"><a href="<?php echo $item->get_permalink(); ?>" target="_blank"><?php echo $item->get_title(); ?></a></div>

that should open all links in a new window


mrbean17

Fantastic! Very well done.

One quesiton though ... how does one change the font of the feed?

Thanks

G6Cad

You cant, the feed is what it is from the site you get it from.

mrbean17

Ah that sucks, but thank you.

Ok one more question. My users are reporting that the boxes do not scale with IE properly. I've verified that it works perfect in FF, but in IE the RSS boxes do in fact go outside of their boundries. Any easy fix?

G6Cad

Cant say it's easy when you dont write down all the info wee need to help you.

URL to your site is a good thing if you want us to check it for you.
Theme installed ?
What blocks are you using ?
Custom codes in the blocks ?
Articles with images inside ?

You see, thats just the basics of what we need to know to be able to help.

mrbean17

- www.importantworkstuff.com
- All themes have the problem (only in IE)
- Scriptbox
- Code:

<script type="text/javascript">

var showbbc=new rssdisplaybox("browns", "browns", "someclass")
showbbc.set_items_shown(20, 3)
showbbc.set_cache_time(60)
showbbc.setpagination("auto", "top")
showbbc.set_template("default")
showbbc.start() //Required: start script

</script>

- No images

G6Cad

The problem is the Browns block.
You have to find a way to redo the code so it works in IE to.

Ask the question in the block code and snippets board and post the code you'r using there and hope one of the coders might give you a hand

mrbean17

I have the same issue with both RSS feeds in IE ... so I don't think it's the source.

MinasC

that looks great , gonna try it out hoping it will output feed in the right language (greek and not ^@^#@ , huge problem till now !!!) thnx !!!

mrbean17

Anyone have any thoughts on this issue? My friends are all crying up a storm and I might have to go back to the built in RSS feeds which I really don't like ... but all the IE users pages are messed up :(

mrbean17

Quote from: mrbean17 on March 02, 2007, 01:01:33 AM
Anyone have any thoughts on this issue? My friends are all crying up a storm and I might have to go back to the built in RSS feeds which I really don't like ... but all the IE users pages are messed up :(

Hey all, hate to be a pester and bump this topic again ... but I got some cry babies for friends and this does kind've suck for those that have to use IE at work.

Any help is greatly appreciated.

Thanks!


mrbean17

Back again ...

http://www.importantworkstuff.com/Forum/index.php?theme=25

Bottom left ... see how the RSS box does not fit with in the border? Minus changing the overall forums box dimensions, can you help fix this? Can you possibly make a new style so that the "Next" button doesn't fall outside of the border?

Thanks

mrbean17

Quote from: DASBEAN on April 10, 2007, 10:24:45 PM
Back again ...

http://www.importantworkstuff.com/Forum/index.php?theme=25

Bottom left ... see how the RSS box does not fit with in the border? Minus changing the overall forums box dimensions, can you help fix this? Can you possibly make a new style so that the "Next" button doesn't fall outside of the border?

Thanks

Anyone? :(

mrbean17

Quote from: DASBEAN on April 28, 2007, 04:53:23 PM
Quote from: DASBEAN on April 10, 2007, 10:24:45 PM
Back again ...

http://www.importantworkstuff.com/Forum/index.php?theme=25

Bottom left ... see how the RSS box does not fit with in the border? Minus changing the overall forums box dimensions, can you help fix this? Can you possibly make a new style so that the "Next" button doesn't fall outside of the border?

Thanks

Anyone? :(

Hoping I can find some help before I look into changing to a new type of RSS feed ... I really do like these and would prefer not to change. If no one can help, does anyone have any other good suggestions on something else to use?

Thanks!