<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ZENVERSE &#187; phpbb</title>
	<atom:link href="http://zenverse.net/tag/phpbb/feed/" rel="self" type="application/rss+xml" />
	<link>http://zenverse.net</link>
	<description>Design and Web Development</description>
	<lastBuildDate>Tue, 07 Feb 2012 12:49:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>SEO for PHPBB3 &#8211; Site Title, Meta Keywords and Meta Descriptions</title>
		<link>http://zenverse.net/seo-for-phpbb3-site-title-meta-keywords-and-meta-descriptions/</link>
		<comments>http://zenverse.net/seo-for-phpbb3-site-title-meta-keywords-and-meta-descriptions/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 16:33:18 +0000</pubDate>
		<dc:creator>Zen</dc:creator>
				<category><![CDATA[SEO]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[phpbb]]></category>

		<guid isPermaLink="false">http://zenverse.net/?p=1275</guid>
		<description><![CDATA[No offence, but the fact is phpBB has a lot of weaknesses, not seo-friendly being one of them. However, with some simple steps you can improve the SEO of your phpBB. Here in this guide, we will add some basic SEO features to your phpBB by using a better Site Title, adding Meta Keywords and Meta Descriptions.]]></description>
			<content:encoded><![CDATA[<p>No offence, but the fact is phpBB has a lot of weaknesses, not seo-friendly being one of them. However, with some simple steps you can improve the SEO of your phpBB. Here in this guide, we will add some basic SEO features to your phpBB by using a better Site Title, adding Meta Keywords and Meta Descriptions. I am using phpBB 3.0.5 for this guide.</p>
<h3>A Better Site Title</h3>
<p>This is the default site title for phpBB subSilver2 theme.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1275code1'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p12751"><td class="code" id="p1275code1"><pre class="html" style="font-family:monospace;">&lt;title&gt;{SITENAME} &amp;bull; &lt;!-- IF S_IN_MCP --&gt;{L_MCP} &amp;bull; &lt;!-- ELSEIF S_IN_UCP --&gt;{L_UCP} &amp;bull; &lt;!-- ENDIF --&gt;{PAGE_TITLE}&lt;/title&gt;</pre></td></tr></table></div>

<p>According to the codes above, no matter where you are, your site name would be shown first. This is recommended for your main forum index, but not for viewforum and viewtopic. For better SEO, your forum title or topic title should appear first. That can be achieved by the following codes.</p>
<p>Open your template&#8217;s overall_header.php, look for &lt;title>&lt;/title> tags (like above) and replace it with the following :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1275code2'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p12752"><td class="code" id="p1275code2"><pre class="html" style="font-family:monospace;">&lt;title&gt;&lt;!-- IF S_IN_MCP --&gt;{L_MCP} &amp;bull; &lt;!-- ELSEIF S_IN_UCP --&gt;{L_UCP} &amp;bull; &lt;!-- ENDIF --&gt;
   &lt;!-- IF SCRIPT_NAME == &quot;index&quot; --&gt;{SITENAME} - {SITE_DESCRIPTION}
   &lt;!-- ELSEIF SCRIPT_NAME == &quot;viewforum&quot; --&gt;{FORUM_NAME} | {SITENAME}
   &lt;!-- ELSEIF SCRIPT_NAME == &quot;viewtopic&quot; --&gt;{TOPIC_TITLE} | {SITENAME}
   &lt;!-- ELSEIF SCRIPT_NAME == &quot;posting&quot; --&gt;&lt;!-- IF S_USER_LOGGED_IN --&gt;&lt;!-- IF TOPIC_TITLE --&gt;{L_TOPIC} - {TOPIC_TITLE}&lt;!-- ELSE --&gt;{L_FORUM}&lt;!-- IF FORUM_NAME --&gt; - {FORUM_NAME}&lt;!-- ENDIF --&gt;&lt;!-- ENDIF --&gt;&lt;!-- ELSE --&gt;{SITENAME}&lt;!-- ENDIF --&gt;
   &lt;!-- ELSEIF SCRIPT_NAME == &quot;ucp&quot; --&gt;{L_VIEWING_UCP} - {PAGE_TITLE}&lt;!-- IF CUR_FOLDER_NAME --&gt;{CUR_FOLDER_NAME}&lt;!-- ENDIF --&gt;
   &lt;!-- ELSEIF SCRIPT_NAME == &quot;mcp&quot; --&gt;{L_VIEWING_MCP}&lt;!-- IF PAGE_TITLE --&gt; - {PAGE_TITLE}&lt;!-- ENDIF --&gt;&lt;!-- IF L_TITLE --&gt; - {L_TITLE}&lt;!-- ENDIF --&gt;
   &lt;!-- ELSEIF SCRIPT_NAME == &quot;faq&quot; --&gt;{L_VIEWING_FAQ} - {L_FAQ_TITLE}
    &lt;!-- ELSEIF SCRIPT_NAME == &quot;search&quot; --&gt;{L_SEARCH} &lt;!-- IF SEARCH_TITLE --&gt; - {SEARCH_TITLE}&lt;!-- ENDIF --&gt;&lt;!-- IF SEARCH_MATCHES --&gt; - {SEARCH_MATCHES}&lt;!-- ENDIF --&gt; | {SITENAME}
   &lt;!-- ELSEIF SCRIPT_NAME == &quot;memberlist&quot; --&gt;&lt;!-- IF S_USER_LOGGED_IN --&gt;{PAGE_TITLE}
    &lt;!-- IF S_SHOW_GROUP --&gt; - {GROUP_NAME}&lt;!-- ENDIF --&gt; | {SITENAME}&lt;!-- ELSE --&gt;{SITENAME}&lt;!-- ENDIF --&gt;
   &lt;!-- ELSEIF SCRIPT_NAME == &quot;chat&quot; --&gt;{L_VIEWING_CHAT}
   &lt;!-- ELSE --&gt;Viewing Undefined page&lt;!-- ENDIF --&gt;&lt;/title&gt;</pre></td></tr></table></div>

<p>This is an edited version of codes taken from another website (I forgot). I found this site title suits me well. Change things around to suit your need.</p>
<p>Now here&#8217;s how your site title looks like:</p>
<p><em>Forum index :</em> Site Name &#8211; Forum Description<br />
<em>View Forum :</em> Forum Title | Site Name<br />
<em>View Topic : </em>Topic Title | Site Name </p>
<h3>Adding Meta Descriptions</h3>
<p>Also in overall_header.php, add this at anywhere in the &lt;head> tag.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1275code3'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p12753"><td class="code" id="p1275code3"><pre class="html" style="font-family:monospace;">&lt;meta name=&quot;description&quot; content=&quot;&lt;!-- IF SCRIPT_NAME == &quot;viewforum&quot; --&gt;{FORUM_DESC}
&lt;!-- ELSEIF SCRIPT_NAME == &quot;viewtopic&quot; --&gt;{MESSAGE_TRIMMED}&lt;!-- ELSE --&gt;YOUR DEFAULT META CONTENT&lt;!-- ENDIF --&gt;&quot; /&gt;</pre></td></tr></table></div>

<p>Replace the &#8220;YOUR DEFAULT META CONTENT&#8221; with the meta description of your site. It will be used on pages when its not viewforum or viewtopic.</p>
<h5>MESSAGE_TRIMMED is undefined, yet.</h5>
<p>As you can see the template tag {MESSAGE_TRIMMED} is undefined. {MESSAGE_TRIMMED} is a new template tag that should carry not more than 150 characters of the content of first post because most search engines use a maximum of 160 characters for the description.</p>
<p>Open your_phpbb_root/viewtopic.php, look for:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1275code4'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p12754"><td class="code" id="p1275code4"><pre class="php" style="font-family:monospace;"><a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'IN_PHPBB'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Replace with:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1275code5'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p12755"><td class="code" id="p1275code5"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$zvloop</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'IN_PHPBB'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Next, look for:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1275code6'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p12756"><td class="code" id="p1275code6"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cp_row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'row'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <a href="http://www.php.net/sizeof"><span style="color: #990000;">sizeof</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cp_row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'row'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span></pre></td></tr></table></div>

<p>If you can&#8217;t find the line, stop finding and paste the codes below after the big $postrow array. if you found it, paste this codes below before the line:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1275code7'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p12757"><td class="code" id="p1275code7"><pre class="php" style="font-family:monospace;">  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$zvloop</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$zv_topic_trimmed</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/substr"><span style="color: #990000;">substr</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/strip_tags"><span style="color: #990000;">strip_tags</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$postrow</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'MESSAGE'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">150</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$zvloop</span><span style="color: #339933;">++;</span>
  <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Lastly, look for:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1275code8'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p12758"><td class="code" id="p1275code8"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Output the page</span>
page_header<span style="color: #009900;">&#40;</span><span style="color: #000088;">$user</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">lang</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'VIEW_TOPIC'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' - '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$topic_data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'topic_title'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Replace it with:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1275code9'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p12759"><td class="code" id="p1275code9"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$template</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">assign_vars</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span>
	<span style="color: #0000ff;">'MESSAGE_TRIMMED'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$zv_topic_trimmed</span>
<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Output the page</span>
page_header<span style="color: #009900;">&#40;</span><span style="color: #000088;">$user</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">lang</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'VIEW_TOPIC'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' - '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$topic_data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'topic_title'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>That&#8217;s it for meta description.</p>
<h3>Adding Meta Keywords</h3>
<p>Although meta keywords is not important anymore, there&#8217;s no harm adding it.</p>
<p>Paste this after your meta description and change the keywords. It wll be used throughout your forum so use suitable keywords.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1275code10'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p127510"><td class="code" id="p1275code10"><pre class="html" style="font-family:monospace;">&lt;meta name=&quot;keywords&quot; content=&quot;seperate,your,keywords,using,comma,without,any,blank,space&quot; /&gt;</pre></td></tr></table></div>

<p>Any comments or corrections are welcomed.</p>
]]></content:encoded>
			<wfw:commentRss>http://zenverse.net/seo-for-phpbb3-site-title-meta-keywords-and-meta-descriptions/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Session Integration for phpBB 3 in Different Folders or Subdomains</title>
		<link>http://zenverse.net/session-integration-for-phpbb-3-in-different-subdomains/</link>
		<comments>http://zenverse.net/session-integration-for-phpbb-3-in-different-subdomains/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 15:08:31 +0000</pubDate>
		<dc:creator>Zen</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[phpbb]]></category>
		<category><![CDATA[session]]></category>

		<guid isPermaLink="false">http://zenverse.net/?p=1126</guid>
		<description><![CDATA[A guide to integrate your phpBB 3 forum's cookie session in different folders or subdomains. Recently I looked into this matter because I need to integrate the forum's session with my premium themes area.]]></description>
			<content:encoded><![CDATA[<p>If you came from search engine, I bet you have read this guide &#8220;<a href="http://www.phpbb.com/kb/article/phpbb3-cross-site-sessions-integration/">phpBB 3 cross-site session integration</a>&#8221; at phpBB website. If you haven&#8217;t, please read if you need to understand the codes better (more descriptions at the page).</p>
<p>NOTE : if you need to integrate session for a custom file in the <u>same folder</u> as the forum, read <a href="http://www.phpbb.com/kb/article/phpbb3-sessions-integration/">this guide</a> instead.</p>
<blockquote><p>Recently I looked into this matter because I need to integrate the forum&#8217;s session with my premium themes area (which should be up in 24-48 hours).</p></blockquote>
<p>This tutorial has 2 parts:</p>
<blockquote><ul>
<li><a href="#folder">Session Integration for phpBB 3 in Different Folders</a></li>
<li><a href="#subdomain">Session Integration for phpBB 3 in Different Subdomains</a></li>
</ul>
<p><strong>You need to follow session integration for Different Folders first before going for Different Subdomains.</strong></p></blockquote>
<h3>Session Integration in <u style="color:red">Different Folders</u><a name="folder"></a></h3>
<h4>Create a custom php file</h4>
<p>Let&#8217;s look into &#8220;Different Folder&#8221; first. In my case, I created a new folder outside the forums folder. In other words, my forum directory is <em>public_html/mysite/forums</em> and my new folder is at <em>public_html/mysite/testing</em>.</p>
<p>Create a file called &#8216;index.php&#8217; inside &#8216;testing&#8217; folder and paste the following codes into the file:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1126code11'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p112611"><td class="code" id="p1126code11"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'IN_PHPBB'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ROOT_PATH'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;../forums&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$forumurl</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://mysite.com/forums'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$newurl</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://mysite.com/testing'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><a href="http://www.php.net/defined"><span style="color: #990000;">defined</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'IN_PHPBB'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span><a href="http://www.php.net/defined"><span style="color: #990000;">defined</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ROOT_PATH'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <a href="http://www.php.net/exit"><span style="color: #990000;">exit</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000088;">$phpEx</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;php&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$phpbb_root_path</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/defined"><span style="color: #990000;">defined</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'PHPBB_ROOT_PATH'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> ? PHPBB_ROOT_PATH <span style="color: #339933;">:</span> ROOT_PATH <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$phpbb_root_path</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'common.'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$phpEx</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$user</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">session_begin</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$auth</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">acl</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$user</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>If you want to show all your stored user data variable, use this :</p>
<blockquote><p>echo &#39;&lt;pre>&#39;; var_dump($user); echo &#39;&lt;/pre>&#39;;</p></blockquote>
<p>Edit line 4 with the path to forums folder. In my case, it is <em>../forums.<br />
Edit line 5 with the URL to the forum</em>.<br />
Edit line 6 with the URL to the new folder</em>.</p>
<h4>Identify logged-in users and guest</h4>
<p>The codes below explain it all.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1126code12'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p112612"><td class="code" id="p1126code12"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$user</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'user_id'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> ANONYMOUS<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #666666; font-style: italic;">// content for guests</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #666666; font-style: italic;">// content for members</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h4>Login directly at your new folder</h4>
<p>This is where I stopped following the guide because the login and logout method does not work for me. I added a login form myself:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1126code13'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p112613"><td class="code" id="p1126code13"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>form action<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&lt;?php echo <span style="color: #006699; font-weight: bold;">$forumurl</span>; ?&gt;ucp.php?mode=login&quot;</span> method<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;post&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text&quot;</span> name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;username&quot;</span> value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&quot;</span> <span style="color: #339933;">/&gt;&lt;</span>br <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;password&quot;</span> name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;password&quot;</span> value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&quot;</span> <span style="color: #339933;">/&gt;&lt;</span>br <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;checkbox&quot;</span> name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;autologin&quot;</span> value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;1&quot;</span> <span style="color: #339933;">/&gt;</span> Remember Me<span style="color: #339933;">&lt;</span>br <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;hidden&quot;</span> name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;redirect&quot;</span> value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&lt;?php echo <span style="color: #006699; font-weight: bold;">$newurl</span>; ?&gt;&quot;</span> <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;submit&quot;</span> name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;login&quot;</span> value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Login&quot;</span> <span style="color: #339933;">/&gt;</span> <span style="color: #339933;">&lt;/</span>form<span style="color: #339933;">&gt;</span>
Not a member? <span style="color: #339933;">&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&lt;?php echo <span style="color: #006699; font-weight: bold;">$forumurl</span>; ?&gt;ucp.php?mode=register&quot;</span><span style="color: #339933;">&gt;</span>Register now<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;!</span></pre></td></tr></table></div>

<p>Note that the form has a username field and a password field, a checkbox with &#8220;remember me&#8221; option, a link to register and it redirects back to the new folder after login.</p>
<h4>Logout link</h4>
<p>Logging out would need your session id. You can get that id from <em>$user->data['session_id']</em>. This is the logout link :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1126code14'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p112614"><td class="code" id="p1126code14"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&lt;?php echo <span style="color: #006699; font-weight: bold;">$forumurl</span>; ?&gt;ucp.php?mode=logout&amp;sid=&lt;?php echo <span style="color: #006699; font-weight: bold;">$user-&gt;data</span>['session_id']; ?&gt;&amp;redirect=&lt;?php echo <span style="color: #006699; font-weight: bold;">$newurl</span>; ?&gt;&quot;</span><span style="color: #339933;">&gt;</span>Log Out<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<h4>Suming up (up to here)</h4>
<p>So until here, I have this codes in my <em>public_html/mysite/testing/index.php</em>.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1126code15'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p112615"><td class="code" id="p1126code15"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> 
&nbsp;
<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'IN_PHPBB'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ROOT_PATH'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;../forums&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$forumurl</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://mysite.com/forums'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$newurl</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://mysite.com/testing'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><a href="http://www.php.net/defined"><span style="color: #990000;">defined</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'IN_PHPBB'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span><a href="http://www.php.net/defined"><span style="color: #990000;">defined</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ROOT_PATH'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <a href="http://www.php.net/exit"><span style="color: #990000;">exit</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000088;">$phpEx</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;php&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$phpbb_root_path</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/defined"><span style="color: #990000;">defined</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'PHPBB_ROOT_PATH'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> ? PHPBB_ROOT_PATH <span style="color: #339933;">:</span> ROOT_PATH <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$phpbb_root_path</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'common.'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$phpEx</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$user</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">session_begin</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$auth</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">acl</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$user</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$user</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'user_id'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> ANONYMOUS<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #666666; font-style: italic;">// content for guests - login form</span>
<span style="color: #339933;">&lt;</span>form action<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&lt;?php echo <span style="color: #006699; font-weight: bold;">$forumurl</span>; ?&gt;ucp.php?mode=login&quot;</span> method<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;post&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text&quot;</span> name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;username&quot;</span> value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&quot;</span> <span style="color: #339933;">/&gt;&lt;</span>br <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;password&quot;</span> name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;password&quot;</span> value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&quot;</span> <span style="color: #339933;">/&gt;&lt;</span>br <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;checkbox&quot;</span> name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;autologin&quot;</span> value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;1&quot;</span> <span style="color: #339933;">/&gt;</span> Remember Me<span style="color: #339933;">&lt;</span>br <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;hidden&quot;</span> name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;redirect&quot;</span> value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&lt;?php echo <span style="color: #006699; font-weight: bold;">$newurl</span>; ?&gt;&quot;</span> <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;submit&quot;</span> name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;login&quot;</span> value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Login&quot;</span> <span style="color: #339933;">/&gt;</span> <span style="color: #339933;">&lt;/</span>form<span style="color: #339933;">&gt;</span>
Not a member? <span style="color: #339933;">&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&lt;?php echo <span style="color: #006699; font-weight: bold;">$forumurl</span>; ?&gt;ucp.php?mode=register&quot;</span><span style="color: #339933;">&gt;</span>Register now<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;!</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #666666; font-style: italic;">// content for members - logout link</span>
&nbsp;
<span style="color: #339933;">&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&lt;?php echo <span style="color: #006699; font-weight: bold;">$forumurl</span>; ?&gt;ucp.php?mode=logout&amp;sid=&lt;?php echo <span style="color: #006699; font-weight: bold;">$user-&gt;data</span>['session_id']; ?&gt;&amp;redirect=&lt;?php echo <span style="color: #006699; font-weight: bold;">$newurl</span>; ?&gt;&quot;</span><span style="color: #339933;">&gt;</span>Log Out<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>It displays a login form for guest and a logout link for member.</p>
<h4>Redirect after login and logout</h4>
<p>Login redirect is already done if you followed my codes above. It was done using a hidden input with name &#8220;redirect&#8221;. However, logout redirect need some tweaks to work. </p>
<p>Open ucp.php from your forum&#8217;s main folder and look for:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1126code16'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p112616"><td class="code" id="p1126code16"><pre class="php" style="font-family:monospace;">meta_refresh<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">3</span><span style="color: #339933;">,</span> append_sid<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">{$phpbb_root_path}</span>index.<span style="color: #006699; font-weight: bold;">$phpEx</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Replace with :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1126code17'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p112617"><td class="code" id="p1126code17"><pre class="php" style="font-family:monospace;">meta_refresh<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">3</span><span style="color: #339933;">,</span> append_sid<span style="color: #009900;">&#40;</span>request_var<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'redirect'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">{$phpbb_root_path}</span>index.<span style="color: #006699; font-weight: bold;">$phpEx</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Look for :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1126code18'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p112618"><td class="code" id="p1126code18"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$message</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$message</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;br /&gt;&lt;br /&gt;'</span> <span style="color: #339933;">.</span> <a href="http://www.php.net/sprintf"><span style="color: #990000;">sprintf</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$user</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">lang</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'RETURN_INDEX'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&lt;a href=&quot;'</span> <span style="color: #339933;">.</span> append_sid<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">{$phpbb_root_path}</span>index.<span style="color: #006699; font-weight: bold;">$phpEx</span>&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;&gt;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&lt;/a&gt; '</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Replace with :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1126code19'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p112619"><td class="code" id="p1126code19"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$message</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$message</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;br /&gt;&lt;br /&gt;'</span> <span style="color: #339933;">.</span> <a href="http://www.php.net/sprintf"><span style="color: #990000;">sprintf</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$user</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">lang</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'RETURN_INDEX'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&lt;a href=&quot;'</span> <span style="color: #339933;">.</span> append_sid<span style="color: #009900;">&#40;</span>request_var<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'redirect'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">{$phpbb_root_path}</span>index.<span style="color: #006699; font-weight: bold;">$phpEx</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;&gt;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&lt;/a&gt; '</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Explaination : The meta refresh now check for $_GET['redirect'] and use the value if it is found.</p>
<h3>Session Integration in <u style="color:red">Different Subdomains</u><a name="subdomain"></a></h3>
<p>You need to follow the guide above for the edits in ucp.php.</p>
<p>This is the guide to use same session for different subdomains. EG: your forum URL is <em>http://forums.mysite.com</em> and new subdomain is <em>http://testing.mysite.com</em></p>
<p>Based on the codes above, I changed line 5 and 6 to my new URL:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1126code20'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p112620"><td class="code" id="p1126code20"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$forumurl</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://forums.mysite.com/'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$newurl</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://testing.mysite.com/'</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h4>Change Cookie domain</h4>
<p>This step is a must for different subdomains.</p>
<p>Login into admin panel > Server configuration > Cookie settings</p>
<p>Change the cookie domain to your main domain with a dot in front. In my case, my cookie domain is </p>
<blockquote><p>.mysite.com</p></blockquote>
<p>This edit makes cookie visible on all subdomains of mysite.com</p>
<h4>Redirection after login and logout don&#8217;t work!</h4>
<p>If you noticed, the redirect after login or logout does not work anymore. This is because the redirect() and meta_refresh() functions in phpBB do not allow external redirect by default. </p>
<p>Open includes/functions.php from forum&#8217;s folder :</p>
<p>Look for :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1126code21'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p112621"><td class="code" id="p1126code21"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> redirect<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #339933;">,</span> <span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #000088;">$disable_cd_check</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span></pre></td></tr></table></div>

<p>Replace with :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1126code22'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p112622"><td class="code" id="p1126code22"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> redirect<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #339933;">,</span> <span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #000088;">$disable_cd_check</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span></pre></td></tr></table></div>

<p>Look for :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1126code23'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p112623"><td class="code" id="p1126code23"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> meta_refresh<span style="color: #009900;">&#40;</span><span style="color: #000088;">$time</span><span style="color: #339933;">,</span> <span style="color: #000088;">$url</span><span style="color: #339933;">,</span> <span style="color: #000088;">$disable_cd_check</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span></pre></td></tr></table></div>

<p>Replace with :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1126code24'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p112624"><td class="code" id="p1126code24"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> meta_refresh<span style="color: #009900;">&#40;</span><span style="color: #000088;">$time</span><span style="color: #339933;">,</span> <span style="color: #000088;">$url</span><span style="color: #339933;">,</span> <span style="color: #000088;">$disable_cd_check</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span></pre></td></tr></table></div>

<p><strong>EXPLAINATION : Why don&#8217;t I add third argument with value of &#8220;boolean true&#8221; in the redirect() function in ucp.php?</strong><br />
I tried but it doesn&#8217;t work. Maybe it is a bug? To achieve what I want, I have to edit the third argument&#8217;s default value in functions.php.</p>
<h3>End.</h3>
<p>Hope this helps you. All comments are appreciated. If I missed something, tell me.</p>
]]></content:encoded>
			<wfw:commentRss>http://zenverse.net/session-integration-for-phpbb-3-in-different-subdomains/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

