<?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>Christian Bullock</title>
	<atom:link href="http://www.christianbullock.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.christianbullock.com</link>
	<description>Custom phpBB Designer</description>
	<lastBuildDate>Tue, 09 Apr 2013 07:26:29 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.1</generator>
		<item>
		<title>Dark Prosilver Imageset Released</title>
		<link>http://www.christianbullock.com/2013/dark-prosilver-imageset-released</link>
		<comments>http://www.christianbullock.com/2013/dark-prosilver-imageset-released#comments</comments>
		<pubDate>Sun, 06 Jan 2013 22:07:42 +0000</pubDate>
		<dc:creator>Christian</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.christianbullock.com/?p=646</guid>
		<description><![CDATA[Dark Imageset, including buttons and extra theme icons. ]]></description>
			<content:encoded><![CDATA[<div style="clear: both;"></div>
<div class="postbuttons"><a class="download" href="http://www.christianbullock.com/downloads/prosilver_dark_imageset_1.0.0.zip">Dark Prosilver Imageset</a></div>
<h3>Hi, and Happy New Year!</h3>
<p>I&#8217;m really pleased to announce the release of the dark prosilver imageset. Designed for use in dark prosilver styles, it&#8217;s now available for anyone (literally, users, style authors, your dog&#8230;?) to download and use. </p>
<p>The last half of 2012 was pretty busy for me with <a href="http://www.christianbullock.com/custom-phpbb-styles">custom styles</a> , though I finally came across a couple of free days this weekend to knock these out. I love designing dark styles, but the icons are always a nightmare. I figured since I was making them anyway, there would be no harm releasing them to the phpBB Community for other people to use in their styles. </p>
<p>To download, click the big pink &#8220;download&#8221; button above. I&#8217;ve chucked in some example screenshots below.</p>
<p>Enjoy!!</p>
<p><a href="http://www.christianbullock.com/wp-content/uploads/2013/01/icon-preview.png"><img src="http://www.christianbullock.com/wp-content/uploads/2013/01/icon-preview.png" alt="" title="icon preview" width="500" height="236" class="alignnone size-full wp-image-648" /></a></p>
<p><a href="http://www.christianbullock.com/wp-content/uploads/2013/01/screenshot.png"><img src="http://www.christianbullock.com/wp-content/uploads/2013/01/screenshot.png" alt="" title="screenshot" width="500" height="262" class="alignnone size-full wp-image-654" /></a></p>
<p><a href="http://www.christianbullock.com/wp-content/uploads/2013/01/contact-icons.png"><img src="http://www.christianbullock.com/wp-content/uploads/2013/01/contact-icons.png" alt="" title="contact icons" width="500" height="262" class="alignnone size-full wp-image-656" /></a></p>
<p><a href="http://www.christianbullock.com/wp-content/uploads/2013/01/theme-icon-preview.png"><img src="http://www.christianbullock.com/wp-content/uploads/2013/01/theme-icon-preview.png" alt="" title="theme icon preview" width="500" height="236" class="alignnone size-full wp-image-657" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.christianbullock.com/2013/dark-prosilver-imageset-released/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Pretty topic type in viewforum</title>
		<link>http://www.christianbullock.com/2012/phpbb-pretty-topic-type-in-viewforum</link>
		<comments>http://www.christianbullock.com/2012/phpbb-pretty-topic-type-in-viewforum#comments</comments>
		<pubDate>Sat, 11 Aug 2012 23:20:56 +0000</pubDate>
		<dc:creator>Christian</dc:creator>
				<category><![CDATA[phpBB3 Tutorials]]></category>

		<guid isPermaLink="false">http://www.christianbullock.com/?p=569</guid>
		<description><![CDATA[This short snippet adds a pretty topic type prefix to special topics (Announcements, Stickies, Polls, Locked and Moved topics.) Inspired by IPB 3.x]]></description>
			<content:encoded><![CDATA[<div style="clear: both;"></div>
<p></p>
<h3>What we&#8217;re trying to achieve</h3>
<p>In phpBB each topic is a certain type. In addition to your standard topics, some may have a special purpose or require some emphasis. The topic types are: Standard, Sticky, Announcement, Locked, Moved and Poll. phpBB uses a different icon from the imageset to differentiate between these topic types, however I like to use as few different icons as possible. This short snippet adds a pretty text-based topic type prefix before the topic title, to quickly emphasise the different topic type.</p>
<h3>Step 1) HTML Edits</h3>
<p><strong>Open:</strong> /styles/prosilver/template/viewforum_body.html</p>
<p><strong>Find:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;">&lt;!-- IF topicrow.S_UNREAD_TOPIC --&gt;</span><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;{topicrow.U_NEWEST_POST}&quot;</span>&gt;</span>{NEWEST_POST_IMG}<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span> <span style="color: #808080; font-style: italic;">&lt;!-- ENDIF --&gt;</span></div></div>
<p><strong>Before, Add:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;">&lt;!-- IF topicrow.TOPIC_TYPE --&gt;</span><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;topictype&quot;</span>&gt;</span>{topicrow.TOPIC_TYPE}<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!-- ENDIF --&gt;</span></div></div>
<h3>Step 2) CSS Edits</h3>
<p><strong>Open:</strong> /styles/prosilver/theme/colours.css</p>
<p>Add this to the bottom of the file:</p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">span<span style="color: #6666ff;">.topictype</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> inline-<span style="color: #993333;">block</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #933;">4px</span> <span style="color: #933;">1px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#027cb8</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#ffffff</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/* Some CSS3 goodness */</span><br />
&nbsp; &nbsp; border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; -moz-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; -webkit-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">text-shadow</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">1px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc00cc;">#005884</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/* Optional: Gradient background. Uncomment below to enable */</span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/*<br />
&nbsp; &nbsp; border: 1px solid #0077b2;<br />
&nbsp; &nbsp; background: -moz-linear-gradient(top, &nbsp;#11a0e7 3%, #0077b2 100%);<br />
&nbsp; &nbsp; background: -webkit-gradient(linear, left top, left bottom, color-stop(3%,#11a0e7), color-stop(100%,#0077b2));<br />
&nbsp; &nbsp; background: -webkit-linear-gradient(top, &nbsp;#11a0e7 3%,#0077b2 100%); <br />
&nbsp; &nbsp; background: -o-linear-gradient(top, &nbsp;#11a0e7 3%,#0077b2 100%); <br />
&nbsp; &nbsp; background: -ms-linear-gradient(top, &nbsp;#11a0e7 3%,#0077b2 100%);<br />
&nbsp; &nbsp; background: linear-gradient(to bottom, &nbsp;#11a0e7 3%,#0077b2 100%); <br />
&nbsp; &nbsp; filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#11a0e7', endColorstr='#0077b2',GradientType=0 ); <br />
&nbsp; &nbsp; */</span><br />
<span style="color: #00AA00;">&#125;</span></div></div>
<h3>Finishing Touches</h3>
<p>If you&#8217;re really pedantic like me, you&#8217;ll probably want to remove the colon following the topic type. Follow the instructions below to achieve this.</p>
<p><strong>Open:</strong> /language/en/common.php</p>
<p><strong>Find:</strong></p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; <span style="color: #0000ff;">'VIEW_TOPIC_ANNOUNCEMENT'</span> &nbsp; <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Announcement: '</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">'VIEW_TOPIC_GLOBAL'</span> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Global Announcement: '</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">'VIEW_TOPIC_LOCKED'</span> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Locked: '</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">'VIEW_TOPIC_LOGS'</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'View logs'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">'VIEW_TOPIC_MOVED'</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Moved: '</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">'VIEW_TOPIC_POLL'</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Poll: '</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">'VIEW_TOPIC_STICKY'</span> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Sticky: '</span><span style="color: #339933;">,</span></div></div>
<p><strong>Replace with:</strong></p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; <span style="color: #0000ff;">'VIEW_TOPIC_ANNOUNCEMENT'</span> &nbsp; <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Announcement '</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">'VIEW_TOPIC_GLOBAL'</span> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Global Announcement '</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">'VIEW_TOPIC_LOCKED'</span> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Locked '</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">'VIEW_TOPIC_LOGS'</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'View logs'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">'VIEW_TOPIC_MOVED'</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Moved '</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">'VIEW_TOPIC_POLL'</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Poll '</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">'VIEW_TOPIC_STICKY'</span> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Sticky '</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">'VISIT_WEBSITE'</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Visit website'</span><span style="color: #339933;">,</span></div></div>
<h3>Finishing off</h3>
<p>Since this doesn&#8217;t use any hard coded text or images, it will work regardless of the language set on your forum. If you&#8217;d prefer the topic types to have a gradient background, uncomment the marked block of CSS in step 2 above. There is an awesome <a href="http://www.colorzilla.com/gradient-editor/" target="_blank">CSS3 gradient generator</a> if your style is dark or a colour other than the default prosilver blue.</p>
<p>If you found this tutorial useful, please consider <a href="../donate">donating</a>. If you have anyproblems, let me know in the comments below. Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christianbullock.com/2012/phpbb-pretty-topic-type-in-viewforum/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Absolution v1.1 available</title>
		<link>http://www.christianbullock.com/2012/absolution-v1-1-available</link>
		<comments>http://www.christianbullock.com/2012/absolution-v1-1-available#comments</comments>
		<pubDate>Mon, 06 Feb 2012 22:06:55 +0000</pubDate>
		<dc:creator>Christian</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.christianbullock.com/?p=470</guid>
		<description><![CDATA[An updated version of Absolution, compatible with phpBB 3.0.10 is now available. ]]></description>
			<content:encoded><![CDATA[<div style="clear: both;"></div>
<div class="postbuttons">
<a class="download" href="http://www.christianbullock.com/downloads/absolution.zip">Absolution.zip</a>
</div>
<p>Absolution has been overhauled and updated, and is now compatible with phpBB 3.0.10. The update has significantly de-cluttered the original Absolution style, as well as adding some fresh appearance and increased usability. There are a number of changes I&#8217;d still like to make to the style before it&#8217;s fully &#8220;complete&#8221;, however I&#8217;m sufficiently happy with it at the moment to release.</p>
<h3>Where to download</h3>
<p>Currently, the only place to download the updated version is <a href="http://www.christianbullock.com/downloads/absolution.zip">here</a> . You can also download it by clicking the big pink button above. </p>
<p>I am currently waiting for phpBB.com, phpbb3styles.net and awesomestyles.com to update their hosted versions of the style. </p>
<h3>How do I update?</h3>
<p>Given the huge amount of changes, there is no update file. The only way to update the style would be to overwrite your current Absolution style and refresh Absolution&#8217;s imageset, theme and template in the ACP&#8217;s &#8220;Styles&#8221; tab. This is a far from ideal situation for those with a large number of MODs, however there was little that could be done to avoid this. </p>
<h3>Support</h3>
<p>Support can be obtained by emailing me through the contact page. Due to the large volume of emails I receive I cannot guarantee a reply, though I will do my best to reply to most problems. </p>
<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christianbullock.com/2012/absolution-v1-1-available/feed</wfw:commentRss>
		<slash:comments>46</slash:comments>
		</item>
		<item>
		<title>jQuery stylesheet switcher for phpBB</title>
		<link>http://www.christianbullock.com/2011/phpbb-jquery-stylesheet-switcher</link>
		<comments>http://www.christianbullock.com/2011/phpbb-jquery-stylesheet-switcher#comments</comments>
		<pubDate>Tue, 10 May 2011 22:34:19 +0000</pubDate>
		<dc:creator>Christian</dc:creator>
				<category><![CDATA[phpBB3 Tutorials]]></category>

		<guid isPermaLink="false">http://www.christianbullock.com/?p=419</guid>
		<description><![CDATA[Ever wanted to allow your members to each choose from one of multiple colour schemes or backgrounds? This tutorial will teach you how to add a jQuery powered stylesheet switcher to your phpBB forum. ]]></description>
			<content:encoded><![CDATA[<div style="clear: both;"></div>
<h3>What we&#8217;re trying to achieve</h3>
<p>User customisation is becoming more and more popular in forum software. Things like collapsible categories, collapsible sidebars, customisable backgrounds, choice of colour scheme are all things that nobody could really imagine would have existed in styles 5 years ago. Now they play a huge part in separating the best styles from the rest. This tutorial will teach you how to add a jQuery stylesheet switcher to your forum, allowing your users to choose between different colour schemes. </p>
<div class="postbuttons"><a class="download" href="http://www.christianbullock.com/downloads/stylesheet-switcher.zip">stylesheet-switcher.zip</a></div>
<h3>Preparation</h3>
<p>You&#8217;ll need a decent <a href="http://notepad-plus-plus.org">Source code editor</a> to complete this tutorial. You should also <strong>download the stylesheet-switcher.zip archive</strong> and then:</p>
<p><strong>Copy:</strong> /stylesheet-switcher/jquery.cookie.js <strong>to</strong> /styles/prosilver/template/<br />
<strong>Copy:</strong> /stylesheet-switcher/blank.css <strong>to</strong> /styles/prosilver/theme/<br />
<strong>Copy:</strong> /stylesheet-switcher/colours <strong>to</strong> /styles/prosilver/theme/</p>
<h3>Step 1) HTML Edits</h3>
<p>Firstly we need to connect to jQuery and the cookie plugin. Next we&#8217;ll be adding the blank stylesheet connection (used to override the default style&#8217;s style information). Finally all we need to do here is add the links that the end user will use to change between the stylesheets.</p>
<p><strong>Open:</strong> /styles/prosilver/template/overall_header.html</p>
<p><strong>Find:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;{T_TEMPLATE_PATH}/forum_fn.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></div></div>
<p><strong>Below, Add:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;{T_TEMPLATE_PATH}/jquery.cookie.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></div></div>
<p><strong>Find:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;">&lt;!-- IF S_CONTENT_DIRECTION eq 'rtl' --&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;{T_THEME_PATH}/bidi.css&quot;</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">media</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;screen, projection&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br />
<span style="color: #808080; font-style: italic;">&lt;!-- ENDIF --&gt;</span></div></div>
<p><strong>After, Add:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;{T_THEME_PATH}/blank.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;colour-switcher&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></div></div>
<p><strong>Find:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;start_here&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span></div></div>
<p><strong>After, Add:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span><br />
<br />
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;navbar&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;inner&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;corners-top&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">span</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;linklist rightside&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">strong</span>&gt;</span>Colour:<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">strong</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;{T_THEME_PATH}/colours/red.css&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;switch&quot;</span>&gt;</span>Red<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span> <span style="color: #ddbb00;">&amp;bull;</span> <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;{T_THEME_PATH}/colours/green.css&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;switch&quot;</span>&gt;</span>Green<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span> <span style="color: #ddbb00;">&amp;bull;</span> <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;{T_THEME_PATH}/colours/yellow.css&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;switch&quot;</span>&gt;</span>Yellow<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span> <span style="color: #ddbb00;">&amp;bull;</span> <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;{T_STYLESHEET_LINK}&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;switch&quot;</span>&gt;</span>Default<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;corners-bottom&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">span</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></div></div>
<p>Pay attention to the rel=&#8221;" attribute of each &lt;a&gt; tag. The stylesheet linked here will populate a blank stylesheet called after phpBB&#8217;s, therefore overwriting the default style information. We also add a &#8220;default&#8221; link which links to the default style&#8217;s CSS. It will essentially define the same stylesheet twice, but is a <strong>lot</strong> more graceful than writing a blank cookie over the user&#8217;s colour choice and then forcibly refreshing the page.</p>
<h3>Step 2) CSS Edits</h3>
<p>This step is largely down to yourselves and what you want to do with the script. Those of you well versed in CSS will know exactly how to override CSS information, if you&#8217;re not familiar with CSS then this probably isn&#8217;t for you.</p>
<p>Here we are going to take a really basic look at <strong>green.css</strong>:</p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;">/* Green stylesheet. Override everything here. <br />
This is called after phpBB's stylesheet, so !important shouldn't be required in most cases */</span><br />
<br />
html<span style="color: #00AA00;">,</span> body <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#009900</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></div>
<p>When this stylesheet is activated, the colour <strong>#009900</strong> will override prosilver&#8217;s default white. Instead of using colours it is possible to add any style information to change element. For example, you could override the <strong>forabg</strong> and <strong>forumbg</strong> to re-colour the category / forum borders. You could override <strong>.headerbar</strong> to change the blue header, or even just give your users a choice of different background images instead of colours.</p>
<h3>Step 3) The jQuery</h3>
<p>This is where all the magic happens. It should be straight forward to understand reading through the code.</p>
<p><strong>Open:</strong> /styles/prosilver/template/overall_header.html</p>
<p><strong>Find:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;{T_THEME_PATH}/blank.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;colour-switcher&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></div></div>
<p><strong>Below, Add:</strong></p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$.<span style="color: #660066;">cookie</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;colour-choice&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;link.colour-switcher&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;href&quot;</span><span style="color: #339933;">,</span>$.<span style="color: #660066;">cookie</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;colour-choice&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a.switch&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;link.colour-switcher&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;href&quot;</span><span style="color: #339933;">,</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'rel'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $.<span style="color: #660066;">cookie</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;colour-choice&quot;</span><span style="color: #339933;">,</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'rel'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>expires<span style="color: #339933;">:</span> <span style="color: #CC0000;">365</span><span style="color: #339933;">,</span> path<span style="color: #339933;">:</span> <span style="color: #3366CC;">'/'</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></div></div>
<p>Assuming you&#8217;ve done everything correctly, you should now be able to change between colours on your style by clicking the different coloured links.</p>
<h3>Finishing off</h3>
<p>It&#8217;s important to know that if you&#8217;re an Administrator, your chosen colour will not carry over into the &#8220;password confirmation screen&#8221; when trying to log into the Administration Control Panel. This is because the cookie the script writes your preference to is in one directory, whereas the ACP (and authentication) is in another directory entirely.</p>
<p>If you found this tutorial useful, please consider <a href="../donate">donating</a>. If you have any serious problems, let me know in the comments below. Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christianbullock.com/2011/phpbb-jquery-stylesheet-switcher/feed</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Moderator column on index page</title>
		<link>http://www.christianbullock.com/2011/phpbb-moderator-column-on-index-page</link>
		<comments>http://www.christianbullock.com/2011/phpbb-moderator-column-on-index-page#comments</comments>
		<pubDate>Thu, 07 Apr 2011 16:57:25 +0000</pubDate>
		<dc:creator>Christian</dc:creator>
				<category><![CDATA[phpBB3 Tutorials]]></category>

		<guid isPermaLink="false">http://www.christianbullock.com/?p=261</guid>
		<description><![CDATA[Add a new column to the index page showing forum-specific Moderators next to their respective forum(s). This was default in phpBB1, and has proved a popular feature in other bulletin board solutions ever since.]]></description>
			<content:encoded><![CDATA[<div style="clear: both;"></div>
<h3>What we&#8217;re trying to achieve</h3>
<p>Quite simply we&#8217;re going to learn how to add a &#8220;Moderator&#8221; column to the index page, after the &#8220;last post&#8221; column . If the Administrator has set forum-specific moderators they will be displayed next to their respective forums.</p>
<h3>Preparation</h3>
<p>To complete this tutorial, you&#8217;ll need a decent <a href="http://notepad-plus-plus.org/">Source Code Editor</a>.</p>
<h3>Step 1) HTML Edits</h3>
<p>Here we&#8217;re simply placing the code and the necessary IF statements. We&#8217;ll also remove the old &#8220;Moderators:&#8221; display from below the forum description. It won&#8217;t look quite right until we add the CSS later.</p>
<p><stong>Open:</stong> /styles/prosilver/template/forumlist_body.html</p>
<p><strong>Find:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">dd</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;posts&quot;</span>&gt;</span>{L_POSTS}<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">dd</span>&gt;</span></div></div>
<p><strong>Below, Add:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">dd</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;moderators&quot;</span>&gt;</span>{L_MODERATORS}<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">dd</span>&gt;</span></div></div>
<p><strong>Find:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">dd</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;posts&quot;</span>&gt;</span>{forumrow.POSTS} <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">dfn</span>&gt;</span>{L_POSTS}<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">dfn</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">dd</span>&gt;</span></div></div>
<p><strong>After, Add:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">dd</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;moderators&quot;</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!-- IF forumrow.MODERATORS --&gt;</span>{forumrow.MODERATORS}<span style="color: #808080; font-style: italic;">&lt;!-- ELSE --&gt;</span>--<span style="color: #808080; font-style: italic;">&lt;!-- ENDIF --&gt;</span><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">dd</span>&gt;</span></div></div>
<p><strong>Find and delete:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;">&lt;!-- IF forumrow.MODERATORS --&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">strong</span>&gt;</span>{forumrow.L_MODERATOR_STR}:<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">strong</span>&gt;</span> {forumrow.MODERATORS}<br />
<span style="color: #808080; font-style: italic;">&lt;!-- ENDIF --&gt;</span></div></div>
<h3>Step 2) CSS Edits</h3>
<p>At this point your index page should be looking pretty messy. We need to cut down the width of the topiclist &lt;dt&gt; tag (and some of the &#8220;last post&#8221; column) to accommodate the width of the Moderator column, then add some styling rules for the moderator column.</p>
<p><strong>Open:</strong> /styles/prosilver/theme/content.css</p>
<p><strong>Find:</strong></p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ul<span style="color: #6666ff;">.topiclist</span> dt <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">50%</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1.1em</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">padding-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">padding-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></div>
<p><strong>Replace with:</strong></p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ul<span style="color: #6666ff;">.topiclist</span> dt <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">40%</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1.1em</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">padding-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">padding-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></div>
<p><strong>Find:</strong></p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">dd<span style="color: #6666ff;">.lastpost</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">25%</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1.1em</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></div>
<p><strong>Replace with:</strong></p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">dd<span style="color: #6666ff;">.lastpost</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">20%</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1.1em</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></div>
<p><strong>Below that, Add:</strong></p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">dd<span style="color: #6666ff;">.moderators</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">15%</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1.1em</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">2.2em</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></div>
<h3>Finishing off</h3>
<p>What you should now see is a Moderator column on the index page (and on viewforum.php if you have subforums). If the Administrator hasn&#8217;t assigned any forum-specific Moderators, two dashes &#8220;&#8211;&#8221; will be displayed instead. To set forum-specific Moderators, click: <strong>ACP &rarr; &#8220;Permissions&#8221; tab &rarr; Forum Moderators</strong>, then choose your forums and add users using the bottom-left box. Also make sure <strong>&#8220;Enable display of moderators:&#8221;</strong> is <em>enabled</em> in <strong>ACP &rarr; Load Settings</strong>.</p>
<h3>Support / Donations</h3>
<p>If you find a mistake in this tutorial, please <a href="../contact">let me know</a>. Did you find this tutorial useful? <a href="../donate">Make a donation</a>. If you&#8217;re having trouble implementing this on your board, <a href="../forum">ask for help</a>. Thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christianbullock.com/2011/phpbb-moderator-column-on-index-page/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Simple global notices</title>
		<link>http://www.christianbullock.com/2011/phpbb-simple-global-notices</link>
		<comments>http://www.christianbullock.com/2011/phpbb-simple-global-notices#comments</comments>
		<pubDate>Mon, 28 Mar 2011 09:00:00 +0000</pubDate>
		<dc:creator>Christian</dc:creator>
				<category><![CDATA[phpBB3 Tutorials]]></category>

		<guid isPermaLink="false">http://www.christianbullock.com/?p=367</guid>
		<description><![CDATA[Ever needed to inform your users of something, but not wanted to post a full announcement? Displaying a simple coloured message in the header of your site is a great way to do this. Complete with "close" icon, supported by cookies.]]></description>
			<content:encoded><![CDATA[<div style="clear: both;"></div>
<h3>What we&#8217;re trying to achieve</h3>
<p>Simple notices in your header. As a board Admin at some point you&#8217;ve probably had to inform your users of something fairly important such as: Scheduled Maintenance, a change to your forum rules or default time zone change. Sometimes a full-on announcement isn&#8217;t appropriate, instead you can use a coloured message in the header of your site to draw your members&#8217; attention. Supported by cookies, messages won&#8217;t re-appear when they are closed. Thanks to Unknown Bliss for inspiring me to make this into a tutorial.</p>
<div class="postbuttons"><a class="download" href="http://www.christianbullock.com/downloads/global-notices.zip">global-notices.zip</a></div>
<h3>Preparation</h3>
<p>To complete this tutorial you&#8217;ll need a decent <a href="http://notepad-plus-plus.org/">Source Code editor</a>. Secondly, you need to <strong>download the global-notices.zip archive</strong> by clicking the &#8220;download&#8221; button above. Then:</p>
<p><strong>Copy:</strong> /global-notices/blue-cross.gif   <strong>to</strong>   /phpBB/styles/prosilver/theme/images/<br />
<strong>Copy:</strong> /global-notices/green-cross.gif   <strong>to</strong>   /phpBB/styles/prosilver/theme/images/<br />
<strong>Copy:</strong> /global-notices/red-cross.gif   <strong>to</strong>   /phpBB/styles/prosilver/theme/images/<br />
<strong>Copy:</strong> /global-notices/yellow-cross.gif   <strong>to</strong>   /phpBB/styles/prosilver/theme/images/<br />
<strong>Copy:</strong> /global-notices/jquery.cookie.js   <strong>to</strong>   /phpBB/styles/prosilver/template/</p>
<h3>Step 1) HTML Edits</h3>
<p>So first up we need to connect to jQuery, the cookie plugin and then place the notice.</p>
<p><strong>Open:</strong> /styles/prosilver/template/overall_header.html</p>
<p><strong>Find:</strong></p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;{T_TEMPLATE_PATH}/forum_fn.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span></div></div>
<p><strong>Below, Add:</strong></p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span><br />
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;{T_TEMPLATE_PATH}/jquery.cookie.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span></div></div>
</p>
<h3>Notice at very top of page</h3>
<p><strong>Find:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;phpbb&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;section-{SCRIPT_NAME} {S_CONTENT_DIRECTION}&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span></div></div>
<p><strong>Below, Add:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;global-notice notice-top green&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">strong</span>&gt;</span>Notice:<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">strong</span>&gt;</span> Scheduled Maintenance at 15:00 UTC.<br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cross&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Close<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></div></div>
<h3>Notice below header</h3>
<p><strong>Find:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;start_here&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span></div></div>
<p><strong>Before, Add:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;global-notice green&quot;</span>&gt;</span><br />
&nbsp; &nbsp; We're going in! See you on the other side.<br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cross&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Close<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></div></div>
<h3>Step 2) CSS Edits</h3>
<p>Just some basic styling rules, accommodating 4 colour schemes by default. If you have some basic CSS knowledge you&#8217;ll be able to add your own colours.</p>
<p><strong>Open:</strong> /styles/prosilver/theme/colours.css</p>
<p><strong>Find:</strong></p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">input<span style="color: #6666ff;">.disabled</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#666666</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></div>
<p><strong>Below, Add:</strong></p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6666ff;">.global-notice</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">12px</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> Tahoma<span style="color: #00AA00;">,</span> Geneva<span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">12px</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">margin-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; -moz-box-shadow<span style="color: #00AA00;">:</span> <span style="color: #993333;">inset</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">-1px</span> <span style="color: #cc00cc;">#FFFFFF</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
<span style="color: #6666ff;">.global-notice</span> strong <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#000000</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
.notice-<span style="color: #000000; font-weight: bold;">top</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-left</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-right</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-12px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
.<span style="color: #000000; font-weight: bold;">blue</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#e5f4ff</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#a7cee2</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#004b90</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
.<span style="color: #993333;">red</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#ffe5e5</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#e2a8a8</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#900000</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
.<span style="color: #993333;">green</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#e4ffdf</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#b8dfb8</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#3a6e31</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
.<span style="color: #993333;">yellow</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fdffe5</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#dfe2a7</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#678801</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
.<span style="color: #993333;">cross</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">12px</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">12px</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">no-repeat</span> <span style="color: #933;">50%</span> <span style="color: #000000; font-weight: bold;">bottom</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">text-indent</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-9999px</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">outline</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
.<span style="color: #000000; font-weight: bold;">blue</span> .<span style="color: #993333;">cross</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;{T_THEME_PATH}/images/blue-cross.gif&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
.<span style="color: #993333;">red</span> .<span style="color: #993333;">cross</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;{T_THEME_PATH}/images/red-cross.gif&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
.<span style="color: #993333;">green</span> .<span style="color: #993333;">cross</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;{T_THEME_PATH}/images/green-cross.gif&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
.<span style="color: #993333;">yellow</span> .<span style="color: #993333;">cross</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;{T_THEME_PATH}/images/yellow-cross.gif&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></div>
<h3>Step 3) The jQuery</h3>
<p>Here we make the message fade out when the cross is clicked, and make sure it doesn&#8217;t show up again when the page is refreshed.</p>
<p><strong>Open:</strong> /styles/prosilver/template/overall_header.html</p>
<p><strong>Find:</strong></p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;{T_TEMPLATE_PATH}/jquery.cookie.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span></div></div>
<p><strong>Below, Add:</strong></p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span><br />
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a.cross&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.global-notice&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeOut</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $.<span style="color: #660066;">cookie</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'noticeState'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'hidden'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> expires<span style="color: #339933;">:</span> <span style="color: #CC0000;">3</span><span style="color: #339933;">,</span> path<span style="color: #339933;">:</span> <span style="color: #3366CC;">'/'</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> noticeState <span style="color: #339933;">=</span> $.<span style="color: #660066;">cookie</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'noticeState'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>noticeState <span style="color: #339933;">==</span> <span style="color: #3366CC;">'hidden'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.global-notice&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></div></div>
<h3>Important Information</h3>
<p>This script is meant to be <strong>simple</strong>, and as such can only be used <strong>once per page</strong>. The only way you can display more than one message (without them <strong>both</strong> fading out when you click a cross) is to disable the cross by remove the link from the code. As this is intended to be a <strong>temporary</strong> message, the cookie is set to expire after 3 days. This is configurable by editing this line in overall_header.html:</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$.<span style="color: #660066;">cookie</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'noticeState'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'hidden'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> expires<span style="color: #339933;">:</span> <span style="color: #CC0000;">3</span><span style="color: #339933;">,</span> path<span style="color: #339933;">:</span> <span style="color: #3366CC;">'/'</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>With regard to choosing between colours, that&#8217;s simple. The line that calls chosen colour is also in overall_header.html:</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">&lt;</span>div <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;global-notice notice-top green&quot;</span><span style="color: #339933;">&gt;&lt;/</span>div<span style="color: #339933;">&gt;</span></div></div>
<p>Here you would simply replace <strong>green</strong> with <strong>red</strong>, yellow or blue.</p>
<h3>Support / Donations</h3>
<p>If you encounter any problems implementing this script, support is freely available over on the <a href="../forum">Support Forum</a>. If you have found this script useful please consider <a href="../donate">making a donation</a>. Finally if you find a mistake let me know <a href="../contact">here</a>. Cheers. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.christianbullock.com/2011/phpbb-simple-global-notices/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Collapsible Categories with Cookies</title>
		<link>http://www.christianbullock.com/2011/phpbb-collapsible-categories-with-cookies</link>
		<comments>http://www.christianbullock.com/2011/phpbb-collapsible-categories-with-cookies#comments</comments>
		<pubDate>Fri, 25 Mar 2011 21:24:53 +0000</pubDate>
		<dc:creator>Christian</dc:creator>
				<category><![CDATA[phpBB3 Tutorials]]></category>

		<guid isPermaLink="false">http://www.christianbullock.com/?p=327</guid>
		<description><![CDATA[Collapsible categories are a great way of letting your users choose their favourite parts of the forum, and hide the rest. Supported by cookies this script stores and remembers the user's preference.]]></description>
			<content:encoded><![CDATA[<h3>What we&#8217;re trying to achieve</h3>
<p>As an end user of many large boards, I find a lot of the time most of the content is of little interest to me. By using &#8220;collapsible categories&#8221;, the end user is able to essentially &#8220;minimise&#8221; the categories they don&#8217;t want to have displayed, making it easy to navigate to the ones they do. This script is also supported by cookies, meaning the user&#8217;s preference is stored and remembered for next time they visit the site.</p>
<div class="postbuttons">
<a class="download" href="http://www.christianbullock.com/downloads/collapsible-categories.zip">collapsible-categories.zip</a>
</div>
<h3>Preparation</h3>
<p>To complete this tutorial, you&#8217;ll need to use a decent <a href="http://notepad-plus-plus.org/">Source code editor</a>. Additionally, you need to <strong>download the collapsible-categories.zip archive</strong> by clicking the download button above. Then:</p>
<p><strong>Copy:</strong> /collapsible-categories/collapse-icon.png <strong>to</strong> /phpBB/styles/prosilver/theme/images/<br />
<strong>Copy:</strong> /collapsible-categories/jquery.cookie.js <strong>to</strong> /phpBB/styles/prosilver/template/<br />
<strong>Copy:</strong> /collapsible-categories/jquery.collapse.js <strong>to</strong> /phpBB/styles/prosilver/template/</p>
<p>I&#8217;d like to thank <a href="https://github.com/carhartl">Klaus Hartl</a> and <a href="http://twitter.com/#!/roflwtfbbq">Daniel Stocks</a> for the <a href="http://plugins.jquery.com/project/Cookie">jQuery Cookie</a> and <a href="http://webcloud.se/code/jQuery-Collapse/">jQuery collapse</a> plugins (respectively) used in this tutorial.</p>
<h3>Step 1) HTML Edits</h3>
<p>First up, we need to connect to jQuery and the two plugins we copied over in the previous step.</p>
<p><strong>Open:</strong> /styles/prosilver/template/overall_header.html</p>
<p><strong>Find:</strong></p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;{T_TEMPLATE_PATH}/forum_fn.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span></div></div>
<p><strong>Below, Add:</strong></p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span><br />
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;{T_TEMPLATE_PATH}/jquery.cookie.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span><br />
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;{T_TEMPLATE_PATH}/jquery.collapse.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span></div></div>
<p>Now we need to add a container to the forumlist for the jQuery to reference, as well as containers around the content we want collapsing. Finally we&#8217;ll be adding the plus/minus icon used to trigger the script. We&#8217;ll add the actual jQuery later.</p>
<p><strong>Open:</strong> /styles/prosilver/template/forumlist_body.html</p>
<p><strong>Find:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;">&lt;!-- BEGIN forumrow --&gt;</span></div></div>
<p><strong>Before, Add:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;forumlist&quot;</span>&gt;</span></div></div>
<p><strong>Find:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- IF (forumrow.S_IS_CAT and not forumrow.S_FIRST_ROW) or forumrow.S_NO_CAT &nbsp;--&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span></div></div>
<p><strong>Below, Add:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></div></div>
<p><strong>Find:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;topiclist forums&quot;</span>&gt;</span></div></div>
<p><strong>Before, Add:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- IF SCRIPT_NAME eq 'index' --&gt;</span><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;trigger active&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!-- ENDIF --&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;collapsethis&quot;</span>&gt;</span></div></div>
<p><strong>Find:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- IF forumrow.S_LAST_ROW --&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span></div></div>
<p><strong>Below, Add:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></div></div>
<p><strong>Find:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;">&lt;!-- END forumrow --&gt;</span></div></div>
<p><strong>Below, Add:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></div></div>
<h3>Step 2) CSS Edits</h3>
<p>The only CSS this script uses is to display / style the trigger icon. All of the showing / hiding is done through the jQuery.</p>
<p><strong>Open:</strong> /styles/prosilver/theme/common.css</p>
<p><strong>Find:</strong></p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">.<span style="color: #000000; font-weight: bold;">clear</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">both</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></div>
<p><strong>Below, Add:</strong></p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6666ff;">.trigger</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;{T_THEME_PATH}/images/collapse-icon.png&quot;</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">32px</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">17px</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">cursor</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">pointer</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">9998</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-21px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
<span style="color: #6666ff;">.active</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span><br />
<span style="color: #6666ff;">.inactive</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #000000; font-weight: bold;">bottom</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></div></div>
<h3>Step 3) The jQuery</h3>
<p>Now we&#8217;ll add the jQuery. Most of the functionality takes place in the collapse.js file, though we still need to add some inline JavaScript to execute it when the collapse icon is clicked.</p>
<p><strong>Open:</strong> /styles/prosilver/template/forumlist_body.html</p>
<p><strong>Find:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;">&lt;!-- END forumrow --&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></div></div>
<p><strong>Below, Add:</strong></p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.forumlist&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">collapse</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>show<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; opacity<span style="color: #339933;">:</span> <span style="color: #3366CC;">'toggle'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; height<span style="color: #339933;">:</span> <span style="color: #3366CC;">'toggle'</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">300</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hide <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; opacity<span style="color: #339933;">:</span> <span style="color: #3366CC;">'toggle'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; height<span style="color: #339933;">:</span> <span style="color: #3366CC;">'toggle'</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">300</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></div></div>
<p>And that&#8217;s it! If everything has gone correctly then you&#8217;ll now have a nice pretty collapse icon on each category which, when clicked, slides away the content until such point as the end user chooses to display it again.</p>
<h3>Support / Donations</h3>
<p>If something didn&#8217;t go as you planned, let me know on the <a href="../forum">Support Forum</a>. If you love this script, please consider liking it, tweeting it or <a href="../donate">making a donation</a>. Finally, if you think I&#8217;ve missed something or there&#8217;s a bug in the tutorial <a href="../contact">get in touch</a> and let me know. Thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christianbullock.com/2011/phpbb-collapsible-categories-with-cookies/feed</wfw:commentRss>
		<slash:comments>42</slash:comments>
		</item>
		<item>
		<title>Live Signature Character Counter</title>
		<link>http://www.christianbullock.com/2011/phpbb-live-signature-character-counter</link>
		<comments>http://www.christianbullock.com/2011/phpbb-live-signature-character-counter#comments</comments>
		<pubDate>Sun, 06 Mar 2011 21:38:50 +0000</pubDate>
		<dc:creator>Christian</dc:creator>
				<category><![CDATA[phpBB3 Tutorials]]></category>

		<guid isPermaLink="false">http://www.christianbullock.com/?p=233</guid>
		<description><![CDATA[Use this script to display a real-time indication of your signature limit, and how many characters you have remaining. You will be prevented from entering any more characters once you reach 0. Prosilver and Prosilver-based styles only.]]></description>
			<content:encoded><![CDATA[<div style="clear: both;"></div>
<div class="postbuttons"><a class="download" href="http://www.christianbullock.com/downloads/siglimit.zip">maxlength.js (1.56kb)</a></div>
<h3>What we&#8217;re trying to achieve</h3>
<p>As a regular forum user, what really annoys me is breaking the signature character limit&#8230;but not being told about until after I&#8217;ve spent 5 minutes formatting everything. This script will add a live character counter above the signature text box keeping the user informed of exactly how many characters they have left. Once the user reaches the maximum amount of characters, they won&#8217;t be able to enter any more into the text box. Thanks go to <a href="http://www.remysharp.com">Remy Sharp</a> for the jQuery functionality.</p>
<h3>Preparation</h3>
<p>To complete this tutorial, you&#8217;ll need a decent source code editor. You also need to <strong>download jquery.maxlength.js</strong> by clicking the download button above and extracting the zip file. Then perform the following file copy instructions:</p>
<p>
<ul>
<li><strong>Copy:</strong> siglimit/jquery.maxlength.js <strong>to</strong> /phpBB/styles/prosilver/template/</li>
</ul>
<h3>The HTML Edits</h3>
<p>First of all we need to add the message telling users how many characters they have left. We&#8217;ll then add a custom class to the textarea so the jQuery can reference it, and finally we&#8217;ll add some inline jQuery to power our counter. But firstly, we need to connect to jQuery and our max length script.</p>
<p><strong>Open: /styles/prosilver/template/overall_header.html</strong></p>
<p><strong>Find:</strong></p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;{T_TEMPLATE_PATH}/forum_fn.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span></div></div>
<p><strong>Below, Add:</strong></p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span><br />
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;{T_TEMPLATE_PATH}/jquery.maxlength.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span></div></div>
<p><strong>Open:</strong> /styles/prosilver/template/posting_editor.html</p>
<p><strong>Find:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;">&lt;!-- INCLUDE posting_buttons.html --&gt;</span></div></div>
<p><strong>Before, Add:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;">&lt;!-- IF $SIG_EDIT eq 1 --&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">strong</span>&gt;</span>Characters remaining:<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">strong</span>&gt;</span> <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;charsLeft error&quot;</span>&gt;</span>{L_SIGNATURE_LIMIT}<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span> &nbsp;&nbsp; &nbsp; <br />
<span style="color: #808080; font-style: italic;">&lt;!-- ENDIF --&gt;</span></div></div>
<p><strong>Find:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;message-box&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">textarea</span> &lt;!-- IF S_UCP_ACTION and not S_PRIVMSGS and not S_EDIT_DRAFT --&gt;</span>name=&quot;signature&quot; id=&quot;signature&quot; style=&quot;height: 9em;&quot;<span style="color: #808080; font-style: italic;">&lt;!-- ELSE --&gt;</span>name=&quot;message&quot; id=&quot;message&quot;<span style="color: #808080; font-style: italic;">&lt;!-- ENDIF --&gt;</span> rows=&quot;15&quot; cols=&quot;76&quot; tabindex=&quot;4&quot; onselect=&quot;storeCaret(this);&quot; onclick=&quot;storeCaret(this);&quot; onkeyup=&quot;storeCaret(this);&quot; onfocus=&quot;initInsertions();&quot; class=&quot;inputbox&quot;&gt;{MESSAGE}{DRAFT_MESSAGE}{SIGNATURE}<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">textarea</span>&gt;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></div></div>
<p><strong>Replace with:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;message-box&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">textarea</span> &lt;!-- IF S_UCP_ACTION and not S_PRIVMSGS and not S_EDIT_DRAFT --&gt;</span>name=&quot;signature&quot; id=&quot;signature&quot; style=&quot;height: 9em;&quot;<span style="color: #808080; font-style: italic;">&lt;!-- ELSE --&gt;</span>name=&quot;message&quot; id=&quot;message&quot;<span style="color: #808080; font-style: italic;">&lt;!-- ENDIF --&gt;</span> rows=&quot;15&quot; cols=&quot;76&quot; tabindex=&quot;4&quot; onselect=&quot;storeCaret(this);&quot; onclick=&quot;storeCaret(this);&quot; onkeyup=&quot;storeCaret(this);&quot; onfocus=&quot;initInsertions();&quot; class=&quot;inputbox<span style="color: #808080; font-style: italic;">&lt;!-- IF $SIG_EDIT eq 1 --&gt;</span> limited<span style="color: #808080; font-style: italic;">&lt;!-- ENDIF --&gt;</span>&quot;&gt;{MESSAGE}{DRAFT_MESSAGE}{SIGNATURE}<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">textarea</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- IF $SIG_EDIT eq 1 --&gt;</span><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;hidden&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;maxlength&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;{L_SIGNATURE_LIMIT}&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!-- ENDIF --&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></div></div>
<p><strong>Find:</strong></p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;!-- IF $EXTRA_POSTING_OPTIONS eq 1 --&gt;</div></div>
<p><strong>Before, Add:</strong></p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;!-- IF $SIG_EDIT eq 1 --&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'textarea.limited'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">maxlength</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">'feedback'</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">'.charsLeft'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">'useInput'</span> <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span><br />
&lt;!-- ENDIF --&gt;</div></div>
<h3>Some PHP Edits</h3>
<p>So you&#8217;ve probably noticed I&#8217;ve used a template variable {L_SIGNATURE_LIMIT}, which don&#8217;t exist by default in phpBB. We&#8217;re going to create it here. Doing this allows the script to use the &#8220;Maximum Signature Length&#8221; value defined in the Administration Control Panel, rather than having to hard-code a character limit value into the template file.</p>
<p><strong>Open:</strong> /includes/ucp/ucp_profile.php</p>
<p><strong>Find:</strong></p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">'L_SIGNATURE_EXPLAIN'</span> &nbsp; <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">sprintf</span><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;">'SIGNATURE_EXPLAIN'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'max_sig_chars'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span></div></div>
<p><strong>Below, Add:</strong></p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000ff;">'L_SIGNATURE_LIMIT'</span> &nbsp; &nbsp; <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'max_sig_chars'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span></div></div>
<p>And that&#8217;s about it!</p>
<h3>Support / Donations</h3>
<p>If you encounter any problems implementing this on your board, support is freely available <a href="../forum">here</a>. If you&#8217;d like to leave me a donation for the time spent testing the script and writing the tutorial you can do so <a href="../donate">here</a>. And finally if you think I&#8217;ve missed something you can let me know <a href="../contact">here</a>. Marvellous. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.christianbullock.com/2011/phpbb-live-signature-character-counter/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Add code between categories</title>
		<link>http://www.christianbullock.com/2011/phpbb-add-code-between-categories</link>
		<comments>http://www.christianbullock.com/2011/phpbb-add-code-between-categories#comments</comments>
		<pubDate>Thu, 03 Mar 2011 16:31:18 +0000</pubDate>
		<dc:creator>Christian</dc:creator>
				<category><![CDATA[phpBB3 Tutorials]]></category>

		<guid isPermaLink="false">http://www.christianbullock.com/?p=197</guid>
		<description><![CDATA[Ever wanted to add your own code "between" categories on your forum? Whether you want to display adverts, a message to your members or something else, it is easily achievable with these few template edits. Prosilver and Prosilver-based styles only.]]></description>
			<content:encoded><![CDATA[<div style="clear: both;"></div>
<h3>What we&#8217;re trying to achieve</h3>
<p>&#8220;How can I place a banner ad right below my first category?&#8221; I hear you ask. This is one of the more requested &#8220;how-to&#8217;s&#8221; on the phpBB Support Forum, and this is what I&#8217;ll be writing about today. With some really basic template edits we&#8217;ll be placing blocks of code between our categories on the index page.</p>
<h3>Preparation</h3>
<p>To complete this tutorial, you&#8217;ll need a <a href="http://notepad-plus-plus.org/">decent source code editor</a>. It&#8217;s also important that you <strong>read</strong> the whole tutorial, and not skip straight to the images.</p>
<h3>Step 1) Finding the Forum ID&#8217;s</h3>
<p>Before we can start placing our code, you need to choose where you want to put it, or in other words you need to chose which two categories you want the code to appear between. You need to find the forum ID of the forum <strong>below</strong> where you want to display your code. Here&#8217;s an example:</p>
<p><img src="http://www.christianbullock.com/wp-content/uploads/2011/03/code1.gif" alt="" title="code1" width="517" height="223" class="aligncenter size-full wp-image-202" /></p>
<p>So, because we want to add code above <strong>&#8220;Normal category 2&#8243;</strong>, that&#8217;s the forum ID we need to find &#8211; we&#8217;ll actually be using the forum ID in the next steps. To find a Forum ID <strong>hover</strong> over a forum name and look at the end of the target URL (normally displays in the <strong>bottom-left</strong> of your web browser. The forum ID is the number that appears <em>after</em> <strong>viewforum.php?f=</strong>.</p>
<p><img src="http://www.christianbullock.com/wp-content/uploads/2011/03/code2.gif" alt="" title="code2" width="620" height="216" class="aligncenter size-full wp-image-206" /></p>
<p>The example above shows us that <strong>&#8220;Normal Category 2&#8243;</strong>&#8216;s forum ID is <strong>3</strong>. We need to remember this for the next step.</p>
<h3>Step 2) Placing the code</h3>
<p>Now that we know where we want to place the code, we need to add it. We&#8217;ll be using a really simple &#8216;IF statement&#8217; in the template file to only show the code where we want it.</p>
<p><strong>Open:</strong> /styles/prosilver/template/forumlist_body.html</p>
<p><strong>Find:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;">&lt;!-- IF forumrow.S_IS_CAT or forumrow.S_FIRST_ROW &nbsp;or forumrow.S_NO_CAT &nbsp;--&gt;</span></div></div>
<p><strong>Before,</strong> Add:</p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- IF forumrow.FORUM_ID eq '3' --&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; Your code here<br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- ENDIF --&gt;</span></div></div>
</p>
<p>Excellent! So this IF statement is telling phpBB: &#8220;Only display this block of code if the forum ID is 3&#8243;. You can use any browser-readable code here (such as HTML, or your Google Adsense code for example). If you want to use more code between other categories, read on past the presentation step.</p>
<h3>Step 3) Making it look pretty</h3>
<p>If you insert code as-is between inside the IF statement, sure it will work but it won&#8217;t look too pretty. We can use the following code <strong>inside the IF statement</strong> that will match your forum&#8217;s style:</p>
<p><div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;forabg&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;inner&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;corners-top&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">span</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;topiclist&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;header&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">dl</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;icon&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">dt</span>&gt;</span>block title<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">dt</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">dl</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;topiclist forums&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;row customblock&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; some code<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;corners-bottom&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">span</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></div></div>
<p>Then, add the following code to the <strong>bottom</strong> of /styles/prosilver/theme/common.css:</p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">li<span style="color: #6666ff;">.customblock</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1.2em</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* Optional */</span><br />
<span style="color: #00AA00;">&#125;</span></div></div>
</p>
<p>And the final result!</p>
<p><img src="http://www.christianbullock.com/wp-content/uploads/2011/03/code3.gif" alt="" title="code3" width="620" height="172" class="aligncenter size-full wp-image-214" /></p>
<h3>Optional: Using &#8216;ELSEIF&#8217; to put more code between other categories</h3>
<p>When explaining these steps to people, one of the most often asked questions is &#8220;How do I add another block of code between other categories?&#8221;. Sure, you can use the same IF-statement as above, paste it again and change the forum ID, but I don&#8217;t think this is a particularly pretty or elegant solution. Instead, we can use a chain of &#8216;ELSEIF&#8217;s. The process for finding forum ID&#8217;s is the same as above, but instead of using one IF statement we can use something like this:</p>
<p><div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;">&lt;!-- IF forumrow.FORUM_ID eq '1' --&gt;</span><br />
&nbsp; &nbsp; code to go above Forum ID 1<br />
<span style="color: #808080; font-style: italic;">&lt;!-- ELSEIF forumrow.FORUM_ID eq '3' --&gt;</span><br />
&nbsp; &nbsp; code to go above forum ID 3<br />
<span style="color: #808080; font-style: italic;">&lt;!-- ELSEIF forumrow.FORUM_ID eq '55' --&gt;</span><br />
&nbsp; &nbsp; code to go above forum ID 55<br />
<span style="color: #808080; font-style: italic;">&lt;!-- ENDIF --&gt;</span></div></div>
<p>So what this is telling phpBB is: &#8220;If the forum ID is 1, show this piece of code. If it&#8217;s not 1, move on&#8230;and if it&#8217;s 3 display this piece of code. If it&#8217;s not 3, move on&#8230;and if it&#8217;s 55, display this block of code&#8221;. There is no limit to the amount of ELSEIFs you can include in the chain. phpBB won&#8217;t show the code if it&#8217;s in an IF statement for a Forum ID that doesn&#8217;t exist. For example, in the code example directly above I make reference to forum ID 55 (which doesn&#8217;t exist on my demo board). Therefore, the &#8220;code to go above forum ID 55&#8243; was not displayed.</p>
<h3>Support / Donations</h3>
<p>If you have any problems using the code above, support is freely available on the <a href="../forum/">Support Forum</a>. If you have found the above guide useful and have implemented it on your board please consider <a href="../donate">making a donation</a>. Finally, if you feel I have missed anything you can let me know <a href="../contact">here</a>. Schweeeeeet.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christianbullock.com/2011/phpbb-add-code-between-categories/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Replace login link with form on-click</title>
		<link>http://www.christianbullock.com/2011/replace-login-link-with-form-on-click</link>
		<comments>http://www.christianbullock.com/2011/replace-login-link-with-form-on-click#comments</comments>
		<pubDate>Mon, 28 Feb 2011 19:44:58 +0000</pubDate>
		<dc:creator>Christian</dc:creator>
				<category><![CDATA[phpBB3 Tutorials]]></category>

		<guid isPermaLink="false">http://www.christianbullock.com/?p=180</guid>
		<description><![CDATA[This ridiculously small script will, when clicked, fade out the login link and fade in a quick login form. Inspired by MyBB. Prosilver and Prosilver-based styles only.]]></description>
			<content:encoded><![CDATA[<h3>What we&#8217;re trying to achieve</h3>
<p>MyBB has quite a smart display feature in the default style. When the &#8220;login&#8221; link in the header is clicked, rather than loading a whole new page to display a form, instead the login link disappears and a quick login form shows in its place. We&#8217;ll be achieving that effect in phpBB using jQuery.</p>
<h3>Preparation</h3>
<p>To complete this tutorial you&#8217;ll need a decent <a href="http://notepad-plus-plus.org/">source code editor</a>.</p>
<h3>Step 1) HTML Edits</h3>
<p>Firstly need to display the form in the header (which will later be hidden with CSS). We also need to add a unique class to the login link&#8217;s &lt;a&gt; tag so that the jQuery can reference it.</p>
<p><strong>Open:</strong> /styles/prosilver/template/overall_header.html</p>
<p><strong>Find:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;icon-logout&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;{U_LOGIN_LOGOUT}&quot;</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;{L_LOGIN_LOGOUT}&quot;</span> <span style="color: #000066;">accesskey</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;x&quot;</span>&gt;</span>{L_LOGIN_LOGOUT}<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span></div></div>
<p><strong>Replace with:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;icon-logout&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> &lt;!-- IF not S_USER_LOGGED_IN --&gt;</span>href=&quot;#&quot; class=&quot;loginbox&quot;<span style="color: #808080; font-style: italic;">&lt;!-- ELSE --&gt;</span>href=&quot;{U_LOGIN_LOGOUT}&quot;<span style="color: #808080; font-style: italic;">&lt;!-- ENDIF --&gt;</span> title=&quot;{L_LOGIN_LOGOUT}&quot; accesskey=&quot;x&quot;&gt;{L_LOGIN_LOGOUT}<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">form</span> <span style="color: #000066;">method</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;post&quot;</span> <span style="color: #000066;">action</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;{S_LOGIN_ACTION}&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;quicklogin&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;username&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;username&quot;</span> <span style="color: #000066;">size</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;10&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;inputbox quickinput&quot;</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;{L_USERNAME}&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Username&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;password&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;password&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;password&quot;</span> <span style="color: #000066;">size</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;10&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;inputbox quickinput&quot;</span> <span style="color: #000066;">title</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;{L_PASSWORD}&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;password&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- IF S_AUTOLOGIN_ENABLED --&gt;</span><span style="color: #ddbb00;">&amp;nbsp;</span><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">label</span> <span style="color: #000066;">for</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;autologin&quot;</span>&gt;</span>Remember?<span style="color: #ddbb00;">&amp;nbsp;</span><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;checkbox&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;autologin&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;autologin&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">label</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!-- ENDIF --&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;login&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;{L_LOGIN}&quot;</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button2&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>{S_LOGIN_REDIRECT}<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; - <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;ucp.php?mode=sendpassword&quot;</span>&gt;</span>Forgot?<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">form</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span></div></div>
</p>
<h3>Step 2) CSS Edits</h3>
<p>There isn&#8217;t a whole lot we need to style, although we do need to hide the form when the page loads, and add some width values so that it all displays correctly.</p>
<p><strong>Open:</strong> /styles/prosilver/theme/common.css</p>
<p><strong>At the bottom of the file, Add:</strong></p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">form<span style="color: #6666ff;">.quicklogin</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
form<span style="color: #6666ff;">.quicklogin</span> input<span style="color: #6666ff;">.quickinput</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></div>
</p>
<h3>Step 3) The jQuery</h3>
<p>For those who don&#8217;t know, jQuery is a JavaScript library which makes it really easy to add fancy effects and features to web elements. Here we&#8217;ll be telling the browser to hide the link and display the form when the link is clicked.</p>
<p><strong>Open:</strong> /styles/prosilver/template/overall_header.html</p>
<p><strong>Find:</strong></p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;{T_TEMPLATE_PATH}/forum_fn.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span></div></div>
<p><strong>Below, Add:</strong></p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;script type=&quot;text/javascript&quot; src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js&quot;&gt;&lt;/script&gt;<br />
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span><br />
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a.loginbox&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// Remove the login icon</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;li.icon-logout&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;icon-logout&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// Fade out the login link (</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeOut</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">200</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// Fade in the form</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;form.quicklogin&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">delay</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">500</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// stop browser from jumping when # link is clicked</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></div></div>
<h3>Support / Donations</h3>
</p>
<p>If you have found this script useful, please consider <a href="http://www.christianbullock.com/donate">making a donation</a>. Support is freely available on the <a href="http://www.christianbullock.com/forum">Support Forum</a>. Finally, if you feel I&#8217;ve missed something you can let me know <a href="http://www.christianbullock.com/contact">here</a>. Awesome.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christianbullock.com/2011/replace-login-link-with-form-on-click/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
