Page 1 of 1

How to implement <!-- IF S_IN_UQM --> ?

Posted: Sat Feb 13, 2010 7:55 pm
by quahappy
Awkward Subject as doesn't really explain what I'm trying to achieve.

At my test site, I have phpBBArcade, UQM, and Hangman installed. What I am attempting is a custom banner for each add-on (UQM, Arcade, etc). ;)

I realised that there is an easy way of doing this by editing just the overall_header.html file and using the <!-- IF --> and <!-- ELSEIF --> statements. In my code where it loads [SITE_LOGO_IMG} is:

Code: Select all

<tr>
<td height="150" align="center" valign="middle"><a href="{U_INDEX}">
<!-- IF S_IN_ARCADE --><img src="http://screwballscribble.co.uk/phpbb3testing/styles/milky_way/imageset/screwball_arcade.gif"><!-- ELSEIF S_CAN_PLAY_HANGMAN --><img src="http://screwballscribble.co.uk/phpbb3testing/styles/milky_way/imageset/screwball_hangman.gif"><!-- ELSEIF S_IN_UQM --><img src="http://screwballscribble.co.uk/phpbb3testing/styles/milky_way/imageset/screwball_quiz.gif"><!-- ELSE -->{SITE_LOGO_IMG}<!-- ENDIF --></a></td>
G<td align="center" valign="middle"><h1>{SITENAME}</h1><span class="gen">{SITE_DESCRIPTION}</span></td>
<td align="right" valign="top">&nbsp;</td>
</tr>
Note: I will shorten links to {SCREWBALL_ARCADE_IMG] and [SCREWBALL_HANGMAN_IMG] by editing imageset.cfg

When viewing Arcade and Hangman sections, the relevant banner is displayed but for UQM, the default image is shown (which is what I expected) because S_IN_UQM isn't defined. Test site link: http://screwballscribble.co.uk/phpbb3testing/index.php. Select option below logo - ignore "Tournaments". Also ignore present UQM html layout as I'm working on these for the style I use.

Within phpBB3 files we use: define('IN_PHPBB', true);. It's the same case for phpBBArcade and Hangman which uses define('IN_ARCADE', true) and define('IN_HANGMAN', true) respectively.

How do I go about doing the same for UQM and the files/code I need to add please? :)

Re: How to implement <!-- IF S_IN_UQM --> ?

Posted: Sun Feb 14, 2010 12:26 pm
by quahappy
Just an update:

I installed (at test site) the Custom Header Logo MOD (from phpBB.com) which does allow you to add custom headers to other pages other than specific forums. After much fiddling, I got it to work because all you need to do when adding in ACP > Custom header page is to remember to include every Page query. For UQM, for a custom header to show in all UQM pages, the following need to be added:

Page name for following two needs to be: quiz, and Page query in each entry:

mode=submit
mode=stats
mode=play

An additional three required for Page name: quiz_cp, and Page query in each entry:

mode=edit
mode=delete
mode=move

... then your UQM custom header will show on all pages within this excellent MOD. ;)

Still would be handy to know the answer to my question in first post though. :D

Re: How to implement <!-- IF S_IN_UQM --> ?

Posted: Sun Feb 14, 2010 3:05 pm
by battye
I feel a bit bad because I still haven't had a chance yet to reply to havocwreaker in the other thread, but this request is pretty quick so hopefully I can reply pretty quickly.

In quiz.php and quiz_cp.php (any page where you want to have the custom header) towards the top of the file put:

define('IN_QUIZ', true)

Then in includes/functions.php find the page_header function. Look for the "$template->assign_vars" call and inside there you should see S_IN_ARCADE, S_IN_HANGMAN, etc. Somewhere in there add a new line that says:

'S_IN_QUIZ' => IN_QUIZ,

Save and reupload, re-upload your modified template files, refresh cache and hopefully that should do the trick :)

Re: How to implement <!-- IF S_IN_UQM --> ?

Posted: Sat May 15, 2010 9:37 am
by quahappy
Forgot all about this topic. Sorry battye. :(

I didn't implement the code required in the end and used the Custom Banner MOD. Quite a few forums and add-ons (Hangman, Arcade, etc.) all now have it's own banner. :)