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

Recent

Welcome to TinyPortal. Please login or sign up.

March 28, 2024, 01:21:30 PM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,104
  • Total Topics: 21,212
  • Online today: 212
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 78
  • Total: 78

Twitter feed in a block

Started by bayonetbrant, March 29, 2016, 05:25:09 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

lurkalot

Quote from: VladTepes on March 26, 2017, 12:49:21 AM
So to get an RSS feed working well for me.. do I use the RSS feed block and make code changes as per both of Illori's posts above?
Or is there some other / easier way?  Maybe an RSS script from somewhere just run in a script block? If so, what's a good script to use?

If you're running the responsive beta version of TP then those edits won't work, the code is different since all the tables were replaced with divs.  Until we can work something out I'd advise you find a script to run in a block or article. There's loads out there, but some work better than others and it might need some styling skills to get the look you need.

On one of my test sites I just added a script that I found to a PHP block, as an example, this is the code, http://bavotasan.com/2010/display-rss-feed-with-php/

This is what it looks like atm. http://cctestsite.info/forums/index.php  You'll notice it's displaying 5 items atm, but you can change this easily, and showing a image from a post which is handy as well.  Like I said there's a few scripts on the web, but it's a case of finding one that suites your needs.

illori

#11
there 2 changes from the code posted,

<div class="windowbg2 padding-div">
    <div>' . $txt['tp-rssblock-maxwidth'].'</div>
in TPortalAdmin.template.php should end up as

<div class="windowbg2 padding-div">
    <div>Max Items</div>
even without that edit you are just putting in the number you want shown in the box that was max width before.

lurkalot

Thanks illori.  I'll give that a go in a while.  8)

lurkalot

Actually it was the edit for the TPortalAdmin.template.php which I was having trouble with. 

Quote from: illori on March 30, 2016, 12:56:50 AM
based on the code posted above...

TPortalAdmin.template.php i know it should be a text string but good enough for here
Code (find) Select
<tr class="windowbg2"><td class="left">' . $txt['tp-rssblock-maxwidth'].'</td><td class="right">

Code (replace) Select
<tr class="windowbg2"><td class="left">Max Items</td><td class="right">



illori

that is the code that is posted above to replace that.

lurkalot

Quote from: illori on March 26, 2017, 04:58:22 PM
that is the code that is posted above to replace that.

Could have sworn you said a different file, but thanks.

Don't think I missed anything, but I now get the number of items to display, and that bit works nicely. That's been on the wish list for a long time.  8)

The output however is displayed in a narrow column. Any ideas.

illori

i did say another file... i edited the post to correct that.

echo '<div style="padding: 5px; width: 150px;" class="middletext">' , TPparseRSS('', $context['TPortal']['rss_utf8']) , '</div>';

TPsubs.template.php edit that line you edited to put in the width that you want. ideally this should taken care of by a div with a class etc and then put in the css but that would but a lot of work all over TP.

VladTepes

Quote from: lurkalot on March 26, 2017, 10:43:18 AM
Quote from: VladTepes on March 26, 2017, 12:49:21 AM
So to get an RSS feed working well for me.. do I use the RSS feed block and make code changes as per both of Illori's posts above?
Or is there some other / easier way?  Maybe an RSS script from somewhere just run in a script block? If so, what's a good script to use?

If you're running the responsive beta version of TP then those edits won't work, the code is different since all the tables were replaced with divs.  Until we can work something out I'd advise you find a script to run in a block or article. There's loads out there, but some work better than others and it might need some styling skills to get the look you need.

On one of my test sites I just added a script that I found to a PHP block, as an example, this is the code, http://bavotasan.com/2010/display-rss-feed-with-php/

This is what it looks like atm. http://cctestsite.info/forums/index.php  You'll notice it's displaying 5 items atm, but you can change this easily, and showing a image from a post which is handy as well.  Like I said there's a few scripts on the web, but it's a case of finding one that suites your needs.

Thank you for your help with this. I'll give it a crack once I get my localhost version up and running.

Oh and this forum could do with a "thanks" posts mod so that I can note my thanks/ note that I've seen it without having to quote the post back into the thread.  :)