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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,973
  • Latest: NonStop
Stats
  • Total Posts: 196,236
  • Total Topics: 21,353
  • Online today: 739
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 520
  • Total: 521
  • lurkalot

rss feed question

Started by rbh, February 07, 2006, 05:18:34 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

rbh

i create an rss box and add my feed, now how do i get the links from that rss feed to open in a new window? i know the answer is easy and right under my nose but i cant get it to work. thanks

Nokonium

#1
I cannot remember the title but I know it was posted by Feline.

I've found this

QuoteRSS block to open any clicked link in a new window.


Try this .. it's work ..

open TPortal.php and search for

function endElement($parser, $tagName) {


replace the function with this


function endElement($parser, $tagName) {

  // This function is used when an end-tag is encountered.

  global $insideitem, $tag, $title, $description, $link, $tpimage, $boardurl;

  if ($tagName == "ITEM") {

   echo '<div style="font-size: larger; font-weight: bold;">';

   printf("<a href=\"%s\" onclick=\"OpenWindow(this.href); return false\"'>%s</a>", trim($link),htmlspecialchars(trim($title)));

echo '</div><div class="smalltext" style="margin-bottom: 4px;">';
printf("%s", $description); // Print out the live journal entry
echo '</div>';
$title = $description = $link = $insideitem = false;
   }

}


search for


function TPparseRSS()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

$backend = $context['TPortal']['rss'];
$insideitem = false;
$tag = "";
$title = "";
$description = "";
$link = "";
// end


add after


global $boardurl, $settings;
echo '
<script type="text/javascript">
  <!--
    function OpenWindow(Link) {
    F1 = window.open("' . $boardurl . '/newsboard.php?theme=' . $settings['theme_url'] . '&url=" + Link + "'.'"'.', "News", "width=800,height=640,left=150,top=10,status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=yes");
    }
  //-->
</script>';


and the newsboard.php (put it on your site root)


<?php

$themeurl
= '';
$url = '';
if (isset(
$_GET['theme'])) $themeurl = $_GET['theme'];
if (isset(
$_GET['url'])) $url = $_GET['url'];

echo
'
<html>
<head>
 <title>xyFrauen - News</title>
 <link rel="stylesheet" type="text/css" href="'
. $themeurl . '/style.css?rc1" >
<head>
<frameset rows="22,99%">
   <frame src="./top.php?theme='
.$themeurl.'" name="top" scrolling="no" noresize>
   <frame src="'
.$url.'" name="main" scrolling="auto" noresize>
</frameset>
</html>'
;

?>


have fun

Fel
[/quote]


bloc

For a quicker solution, open TPortal.php and find this line (first occurance, it appear twice):
  printf("<a href='%s'>%s</a>", trim($link),htmlspecialchars(trim($title)));


The replace it with:
  printf("<a target=_blank href='%s'>%s</a>", trim($link),htmlspecialchars(trim($title)));

Nokonium

What I'd really like is for a link in an RSS feed to open in the same space as the feed. That is, if you have a menu link to an RSS feed, when you click on a link in the feed it replaces the page with the feed. The reason for this is to maintain the portal identity and keep the member/guest within the portal, rather than allow them to surf off.

rbh

thanks guys, works like a charm  ;)

to keep from cluttering the board with questions i will post here. is there a way to keep certain blocks collapsed by default but not all of them unless i choose them to be? i suck at searching for this stuff and can never find what i am looking for, even at the smf site i think i have only managed one problem solved using the search. :uglystupid2:

what i am wanting to accomplish is a whole right side of rss feed blocks that would be collapsed by default and the users only need to expand the ones they want to read. right now it just has them all open on the initial visit which makes for some crazy scrolling down to weed through them. either collapsed by default or if you have a better suggestion on how i should present the feeds. thanks a bunch!

bloc

Hm. No, you can't set the inital state on them - only allow them to be non-shrinkable.

I don't see a good solution to this really...incidentally, when blocks are collapsed, they still have fetched the content..in order to magically appear when you open them again. So I would rather limit the amount of them, to the point it feels comfortable.

Nokonium

Quote from: Bloc on February 08, 2006, 12:10:31 PM
I don't see a good solution to this really...incidentally, when blocks are collapsed, they still have fetched the content..in order to magically appear when you open them again. So I would rather limit the amount of them, to the point it feels comfortable.

Is that the case with RSS links in the menu manager as well?

bloc

No, only the actual rss block.

This website is proudly hosted on Crocweb Cloud Website Hosting.