<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[PunBB Forums - PunBB 1.3 - Defining $forum_user['prev_url'] from outside the forum]]></title>
	<link rel="self" href="http://punbb.informer.com/forums/feed/atom/topic/19727/"/>
	<updated>2008-09-03T20:30:08Z</updated>
	<generator>PunBB</generator>
	<id>http://punbb.informer.com/forums/topic/19727/punbb-13-defining-forumuserprevurl-from-outside-the-forum/</id>
		<entry>
			<title type="html"><![CDATA[Re: PunBB 1.3 - Defining $forum_user['prev_url'] from outside the forum]]></title>
			<link rel="alternate" href="http://punbb.informer.com/forums/post/117516/#p117516"/>
			<content type="html"><![CDATA[<p>Okies, solved. To get the prev_url to work properly also forum footer.php is required. After adding this, you can use for instance a direct login link in your own custom pages that leads to PunBB login page and you&#039;ll get redirected to that custom page after login. <img src="http://punbb.informer.com/forums/img/smilies/smile.png" width="15" height="15" alt="smile" /><br /></p><div class="codebox"><pre><code>require FORUM_ROOT.&#039;footer.php&#039;;</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Spewed]]></name>
				<uri>http://punbb.informer.com/forums/user/8901/</uri>
			</author>
			<updated>2008-09-03T20:30:08Z</updated>
			<id>http://punbb.informer.com/forums/post/117516/#p117516</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: PunBB 1.3 - Defining $forum_user['prev_url'] from outside the forum]]></title>
			<link rel="alternate" href="http://punbb.informer.com/forums/post/117471/#p117471"/>
			<content type="html"><![CDATA[<p><a href="http://punbb.informer.com/forums/topic/18785/using-requesturi-safely/">This post</a> lead me to the right track, still not getting this to work. I believe set_default_user() is the answer but why I can&#039;t get it to update the prev_url column on the online table when I call it from my custom pages? <img src="http://punbb.informer.com/forums/img/smilies/hmm.png" width="15" height="15" alt="hmm" /></p><p>It does update the $forum_user[&#039;prev_url&#039;] array but doesn&#039;t update the online table in the database, what am I missing here?</p><p>My site structure is the following if it makes a difference:<br />/forum/ (here&#039;s PunBB)<br />/section1/ (here&#039;s a custom page that queries PunBB db located in the forum dir)<br />/section2/ (here&#039;s another custom page that queries PunBB db located in the forum dir)<br />etc.</p><div class="quotebox"><blockquote><p>Using set_default_user() I got the prev_url variable to update correctly outside the forum too but as soon as I go to login the variable is replaced and after login I get redirected to forum index again.</p></blockquote></div><p>Have to correct that, the issue is that only the array gets updated as descriped above, not the online table in the db so after I locate to the login.php the hidden redirect_url is fetched from the db table which has the old referer/prev_url.</p><p>Edit: The code I&#039;m using on the custom pages is here:<br /></p><div class="codebox"><pre><code>// Integrate PunBB
define(&#039;FORUM_ROOT&#039;, &#039;../forum/&#039;);
require FORUM_ROOT.&#039;include/common.php&#039;;

// Set prev url for redirecting properly after logging in
set_default_user();</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Spewed]]></name>
				<uri>http://punbb.informer.com/forums/user/8901/</uri>
			</author>
			<updated>2008-09-01T23:35:09Z</updated>
			<id>http://punbb.informer.com/forums/post/117471/#p117471</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: PunBB 1.3 - Defining $forum_user['prev_url'] from outside the forum]]></title>
			<link rel="alternate" href="http://punbb.informer.com/forums/post/117444/#p117444"/>
			<content type="html"><![CDATA[<p>Thanks for the reply, nerdtopia, but that&#039;s not what I&#039;m asking for. I&#039;m talking about the PunBB user variable that holds the previous page URL where the user is redirected to after logging in.</p><p>I have pages &quot;outside&quot; the PunBB forum that uses PunBB data thru integration. I want user to get redirected back to the custom page where the user clicked login link (login link redirects to PunBB login page) when a user browses these custom pages, the same way as the user is redirected back to the topic/post after logging in at PunBB forum area.</p><p>The issue is currently that when a user comes to the login page from a custom page, the user gets redirected to forum index instead of the custom page where the user came from in real.</p><p>Edit: Just realized I posted this to a wrong forum, <a href="http://punbb.informer.com/forums/forum/52/integration/">Integration</a> would have been the correct place for this. A kindly moderator will move this there, will ya? <img src="http://punbb.informer.com/forums/img/smilies/cool.png" width="15" height="15" alt="cool" /></p>]]></content>
			<author>
				<name><![CDATA[Spewed]]></name>
				<uri>http://punbb.informer.com/forums/user/8901/</uri>
			</author>
			<updated>2008-08-31T20:26:27Z</updated>
			<id>http://punbb.informer.com/forums/post/117444/#p117444</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: PunBB 1.3 - Defining $forum_user['prev_url'] from outside the forum]]></title>
			<link rel="alternate" href="http://punbb.informer.com/forums/post/117443/#p117443"/>
			<content type="html"><![CDATA[<p>I&#039;m not sure exactly what you&#039;re asking, but if you&#039;re just asking to go back a page, you can do that in JavaScript:<br />&lt;a href=&quot;javascript: history.go(-1)&quot;&gt;Back&lt;/a&gt;</p>]]></content>
			<author>
				<name><![CDATA[nerdtopia]]></name>
				<uri>http://punbb.informer.com/forums/user/13817/</uri>
			</author>
			<updated>2008-08-31T18:52:29Z</updated>
			<id>http://punbb.informer.com/forums/post/117443/#p117443</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[PunBB 1.3 - Defining $forum_user['prev_url'] from outside the forum]]></title>
			<link rel="alternate" href="http://punbb.informer.com/forums/post/117439/#p117439"/>
			<content type="html"><![CDATA[<p>How to define $forum_user[&#039;prev_url&#039;] properly from outside the forum? What I&#039;m after is to redirect the user back to the page that is outside the forum (but still in the same domain of course) where the user was before logging in.</p><p>Is there a dedicated method/function to do that already or does it require a hack? Tried everything and nothing worked. Using set_default_user() I got the prev_url variable to update correctly outside the forum too but as soon as I go to login the variable is replaced and after login I get redirected to forum index again.</p>]]></content>
			<author>
				<name><![CDATA[Spewed]]></name>
				<uri>http://punbb.informer.com/forums/user/8901/</uri>
			</author>
			<updated>2008-08-31T11:51:52Z</updated>
			<id>http://punbb.informer.com/forums/post/117439/#p117439</id>
		</entry>
</feed>
