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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,026
  • Total Topics: 21,333
  • Online today: 916
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 239
  • Total: 240
  • @rjen

I'm trying to pursuade the RSS block to open any clicked link in a new window.

Started by nokonium, January 10, 2006, 10:32:53 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nokonium

This is my first attempt and I am probably way out of my tree  :uglystupid2:

I have got this far but I'm stuck with an unexpected T_STRING

This is where I've got to

// Tportal RSS block
function TPortal_rss()
{
        global $context, $settings, $options, $scripturl, $txt, $modSettings;

         echo '<div style="padding: 5px;" class="smalltext">';
            '<a href="['TPparseRSS()'] target=\"_blank\"></a>';
         echo '</div>';

}

feline

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

Nokonium




This website is proudly hosted on Crocweb Cloud Website Hosting.