Welcome to Geeklog, Anonymous Thursday, March 28 2024 @ 08:09 am EDT

Geeklog Forums

RSS Block


Status: offline

trampoline

Forum User
Full Member
Registered: 02/24/06
Posts: 392
Hi I have an RSS feed in a block on our site, I would like stories clicked to open a new window not replace the site.
I know this is not easy but there must be a hack ???
Thanks... Confused:
 Quote

Status: offline

jmucchiello

Forum User
Full Member
Registered: 08/29/05
Posts: 985
If I understand you correctly, all you need to do is find this line in COM_rdfImport() from lib-common.php:
Text Formatted Code
            $content = '<a href="' . $feed->articles[$i]['link'] . '">'
                     . $title . '</a>';

and make it
Text Formatted Code
            $content = '<a target="_blank" href="' . $feed->articles[$i]['link'] . '">'
                     . $title . '</a>';


 Quote

Status: offline

trampoline

Forum User
Full Member
Registered: 02/24/06
Posts: 392
Thanks I changed that I can see how it should work, do I need to wait for the next import for this to work ... ???
 Quote

Status: offline

trampoline

Forum User
Full Member
Registered: 02/24/06
Posts: 392
all that is printed is a solitary . ?
 Quote

Status: offline

trampoline

Forum User
Full Member
Registered: 02/24/06
Posts: 392
Quote by: jmucchiello

If I understand you correctly, all you need to do is find this line in COM_rdfImport() from lib-common.php:

Text Formatted Code
            $content = '<a href="' . $feed->articles[$i]['link'] . '">'
                     . $title . '</a>';

and make it
Text Formatted Code
            $content = '<a target="_blank" href="' . $feed->articles[$i]['link'] . '">'
                     . $title . '</a>';



I tried this and it just did not work can anyone let me know what to put in the RSS block to resolve this ?
Thanks.
 Quote

Status: offline

trampoline

Forum User
Full Member
Registered: 02/24/06
Posts: 392
This is still not working,
any other suggestions ?
It seems I may not have the latest geeklog....

My config.php version is

// $Id: config.php,v 1.237 2006/11/04 22:46:09 dhaun Exp $

and I am using lib-common.php version

// $Id: lib-common.php,v 1.593 2006/11/04 14:57:20 dhaun Exp $

So do I need to upgrade ? I hope not I have so much custom code on the Story templates etc....
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
It should be something like this:

replace this:
Text Formatted Code
$content = '<a href="' . $feed->articles[$i]['link'] . '">' . $title . '</a>';

by this:
Text Formatted Code
$content = '<a href="' . $feed->articles[$i]['link'] . '" target="_blank">' . $title . '</a>';

Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

Status: offline

trampoline

Forum User
Full Member
Registered: 02/24/06
Posts: 392
Ok it fills the block with this...
Text Formatted Code

<ul class="list-feed">  <li><a href="http://www.jamaica-gleaner.com/gleaner/20071104/focus/focus5.html" target="_blank"></a></li>  <li><a href="http://www.theglobeandmail.com/servlet/story/LAC.20071103.TIBETCANADA03/TPStory/National" target="_blank"></a></li>  <li><a href="http://www.hindu.com/thehindu/holnus/006200711031121.htm" target="_blank"></a></li>  <li><a href="http://www.chinadaily.com.cn/china/2007-11/04/content_6229047.htm" target="_blank"></a></li>  <li><a href="http://news.xinhuanet.com/english/2007-11/01/content_6992727.htm" target="_blank"></a></li>  <li><a href="http://in.reuters.com/article/worldNews/idINIndia-30274120071101" target="_blank"></a></li>  <li><a href="http://www.daily-journal.com/archives/dj/display.php?id=406962" target="_blank"></a></li>  <li><a href="http://www.ctv.ca/servlet/ArticleNews/story/CTVNews/20071031/Dalai_lama_071031/20071031?hub=TopStories" target="_blank"></a></li>  <li><a href="http://lfpress.ca/newsstand/News/National/2007/10/31/4618880-sun.html" target="_blank"></a></li>  <li><a href="http://www.dailyindia.com/show/188464.php/Tibetan-Govt-in-exile-PM-hails-US-highest-civilian-award-to-Dalai-Lama" target="_blank"></a></li></ul>
 


But only prints out a dot " . " in the block and nothing else ???
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
The generated HTML seems fine to me, unless I oversee something (don't know what the dot means..). What does ' class="list-feed" ' do to the formatting? Does it hide something?
Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Actually, the generated HTML is not fine - it's missing the story titles. All it seems to be doing is to generate empty links, i.e. <a href="..."></a>

bye, Dirk
 Quote

beewee

Anonymous
Quote by: Dirk

Actually, the generated HTML is not fine - it's missing the story titles. All it seems to be doing is to generate empty links, i.e. <a href="..."></a>

bye, Dirk



Yes, Dirk is right Oops! , that means you've forgotten the
Text Formatted Code
' . $title . '
 Quote

Status: offline

trampoline

Forum User
Full Member
Registered: 02/24/06
Posts: 392
Quote by: beewee

Quote by: Dirk

Actually, the generated HTML is not fine - it's missing the story titles. All it seems to be doing is to generate empty links, i.e. <a href="..."></a>

bye, Dirk



Yes, Dirk is right Oops! , that means you've forgotten the
Text Formatted Code
' . $title . '


Thanks but where would go
 Quote

Status: offline

trampoline

Forum User
Full Member
Registered: 02/24/06
Posts: 392
OK I have finally sorted this out......

replace

Text Formatted Code
 $content = '<a href="' . $feed->articles[$i]['link'] . '">'
                    . $feed->articles[$i]['title'] . '</a>';


With...

Text Formatted Code
$content = '<a href="' . $feed->articles[$i]['link'] . '" target="_blank" ">'
                       . $feed->articles[$i]['title'] . '</a>';


in lib.common.php
 Quote

All times are EDT. The time is now 08:09 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content