Welcome to Geeklog Friday, October 20 2017 @ 05:25 pm EDT


Status: offline

trampoline

Forum User
Full Member
Registered: 24/02/2006
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:

Status: offline

jmucchiello

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

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



Status: offline

trampoline

Forum User
Full Member
Registered: 24/02/2006
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 ... ???

Status: offline

trampoline

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

Status: offline

trampoline

Forum User
Full Member
Registered: 24/02/2006
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:

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

and make it
PHP 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.

Status: offline

trampoline

Forum User
Full Member
Registered: 24/02/2006
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....

Status: offline

beewee

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

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

by this:
PHP 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

Status: offline

trampoline

Forum User
Full Member
Registered: 24/02/2006
Posts: 392
Ok it fills the block with this...
PHP 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 ???

Status: offline

beewee

Forum User
Full Member
Registered: 05/08/2003
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

Status: offline

Dirk

Site Admin
Admin
Registered: 12/01/2002
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

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
PHP Formatted Code
' . $title . '

Status: offline

trampoline

Forum User
Full Member
Registered: 24/02/2006
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
PHP Formatted Code
' . $title . '


Thanks but where would go

Status: offline

trampoline

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

replace

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


With...

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


in lib.common.php

All times are EDT. The time is now 05:25 pm.

  • 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