Welcome to Geeklog, Anonymous Thursday, March 28 2024 @ 09:46 pm EDT

Geeklog Forums

RSS Link Target?


Status: offline

LCAngela

Forum User
Newbie
Registered: 12/07/04
Posts: 6
Is there any way to open links in RSS feeds (from external sites) in a new window?

I used SamStone's "Portal block in center" hack, which is working beautifully, but I don't want the reader to leave my site should they decide to explore the newsfeed links.

Thanks in advance! Smile
"That's because it's -fly soup-, sir..."
 Quote

g00ch

Anonymous
yeah, does anyone know how to do this one?
 Quote

Status: offline

THEMike

Forum User
Moderator
Registered: 07/25/03
Posts: 141
Location:Sheffield, UK
Find the function:

Text Formatted Code

COM_rdfImport

 


in lib-common.php

In this file it builds up the urls to display, now, I can't get access to the 1.3.11 version easily from here, so I don't have the exact fix, but, in the new system in CVS the code looks like:

Text Formatted Code

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

 


Which you would change to:

Text Formatted Code

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

 


Note I've added the attribute target="_blank" to the url. Copying the above into the 1.3.11 version of lib-common.php will almost certainly break it. The above code comes from the new syndication system in the current CVS. I do not recommend you upgrade to this, just try and translate the tweak to your current version.
 Quote

tngator

Anonymous
Very Happy I appreciate your help!!

In 1.3.11 here is the change:

Find:
Text Formatted Code
if( $name == 'ITEM' )
    {
        $RDFtitle = str_replace( '$', '$', $RDFtitle );
        $RDFheadlines[] = '<a href="' . addslashes( trim( $RDFlink )) . '">' . addslashes( trim( $RDFtitle )) . '</a>';
 


and simply change it to this:

Text Formatted Code
if( $name == 'ITEM' )
    {
        $RDFtitle = str_replace( '$', '$', $RDFtitle );
        $RDFheadlines[] = '<a href="' . addslashes( trim( $RDFlink )) . '"target="_blank">' . addslashes( trim( $RDFtitle )) . '</a>';
 
 Quote

Lex

Anonymous
I just installed 1.4 and I'm absolutely amazed that Geeklog doesn't have link target options built in all over the place.

This is one of the most important features a professional website should have. When can we expect to see this?
 Quote

All times are EDT. The time is now 09:46 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