Page 2 of 2

Need to maintain session

Posted: 7. June 2008 00:10
by liquidspark
We need to maintain the user's session through the RSS feed page. Can you modify the first post so that the user's session is kept in the link please? (append_sid)

EDIT: Ignore my next post. As long as you have cookies enabled, don't bother changing anything. I'm not even sure it would work, anyway. (the middle part of my post about commenting out that one line is still a good idea)

Re: RSS feed block

Posted: 7. June 2008 01:13
by liquidspark
frold wrote:OPEN
styles/prosilver/template/portal/block/rss.html

REPLACE ALL WITH

Code: Select all

<div class="panel">
   <div class="inner">
      <span class="corners-top"><span></span></span>
         <h3>RSS feed</h3>
			<span><a href="rss.php" target="_blank"><img src="images/rssforum.png" title="RSS feed" width="90" height="15" border="0"></a></span>
      <span class="corners-bottom"><span></span></span>
   </div>
</div>
<br style="clear:both" />
We need to change that line from

Code: Select all

<span><a href="rss.php" target="_blank"><img src="images/rssforum.png" title="RSS feed" width="90" height="15" border="0"></a></span>
to

Code: Select all

<span><a href="{U_RSS}" target="_blank"><img src="images/rssforum.png" title="RSS feed" width="90" height="15" border="0"></a></span>
and then,

OPEN
./rss.php

FIND

Code: Select all

$text = str_replace('&#', '&#', htmlspecialchars($text, ENT_QUOTES)); // html format
REPLACE WITH

Code: Select all

//   $text = str_replace('&#', '&#', htmlspecialchars($text, ENT_QUOTES)); // html format
I had to comment out this line so that the html characters weren't made to look like entities. I was getting &quote; instead of ".

OPEN
./rss.php

FIND

Code: Select all

$rdf .= "<link>" . $url . "</link>";
REPLACE WITH

Code: Select all

$rdf .= "<link>" . append_sid($url) . "</link>";
This should keep the session going from the RSS feed page to a clicked link on the RSS feed page (please confirm that this works; I haven't tested it at all yet!)

Now we still have to keep the session going from the portal to the RSS feed page. How do we do that? We already modified the block to add "{U_RSS}" instead of a direct link, so now we have to define this template variable and "append_sid()" to the link to rss.php. (I'm guessing this should be the rss.php file, although I'm not sure at all.) Will it work? Who knows? :? Let's try it! :D

OPEN
./rss.php

FIND

Code: Select all

?>
BEFORE, ADD

Code: Select all


$template->assign_block_vars('rss', array(
'U_RSS'	=>	append_sid("{$phpbb_root_path}rss.$phpEx")));

...and now i just realized that we DON'T actually have to pass the sessions as long as you have cookies enabled. So then why do I keep getting logged out after short periods of time, like 10 minutes? My sessions are set to expire after 1 hour, not 10 minutes. :cry:

EDIT: my phpbb_root_path and the whole link thing isn't working, so forget it.

Re: RSS feed block

Posted: 3. May 2009 19:12
by [DRuG]NikT
I have used what you had here to tie into my existing install of Simple Syndication 1.1.1b (outgoing rss) by Angelside, and it's worked great.. thanks for getting things started.

http://nikt.zog.net.au/drugcrew/plugins ... portal.php