Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

October 31, 2020, 01:16:45 PM

Login with username, password and session length
Members
  • Total Members: 3795
  • Latest: PoML
Stats
  • Total Posts: 191363
  • Total Topics: 20908
  • Online Today: 85
  • Online Ever: 1000
  • (October 07, 2020, 04:15:10 PM)
Users Online
Users: 1
Guests: 48
Total: 49

Author Topic: Twitter feed in a block  (Read 10832 times)

0 Members and 1 Guest are viewing this topic.

Offline lurkalot

  • Administrator
  • *
  • Posts: 7046
    • Camera Craniums
Re: Twitter feed in a block
« Reply #10 on: March 26, 2017, 03:43:18 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.

Offline illori

  • Administrator
  • *
  • Posts: 2069
Re: Twitter feed in a block
« Reply #11 on: March 26, 2017, 04:28:32 AM »
there 2 changes from the code posted,

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

Code: [Select]
<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.
« Last Edit: March 26, 2017, 10:00:31 AM by illori »

Offline lurkalot

  • Administrator
  • *
  • Posts: 7046
    • Camera Craniums
Re: Twitter feed in a block
« Reply #12 on: March 26, 2017, 04:35:45 AM »
Thanks illori.  I'll give that a go in a while.  8)

Offline lurkalot

  • Administrator
  • *
  • Posts: 7046
    • Camera Craniums
Re: Twitter feed in a block
« Reply #13 on: March 26, 2017, 05:07:23 AM »
Actually it was the edit for the TPortalAdmin.template.php which I was having trouble with. 

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">


Offline illori

  • Administrator
  • *
  • Posts: 2069
Re: Twitter feed in a block
« Reply #14 on: March 26, 2017, 09:58:22 AM »
that is the code that is posted above to replace that.

Offline lurkalot

  • Administrator
  • *
  • Posts: 7046
    • Camera Craniums
Re: Twitter feed in a block
« Reply #15 on: March 26, 2017, 02:51:52 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.

Offline illori

  • Administrator
  • *
  • Posts: 2069
Re: Twitter feed in a block
« Reply #16 on: March 26, 2017, 06:19:56 PM »
i did say another file... i edited the post to correct that.

Code: [Select]
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.

Offline VladTepes

  • Jr. Member
  • **
  • Posts: 80
Re: Twitter feed in a block
« Reply #17 on: March 26, 2017, 07:35:29 PM »
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.  :)