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

All web design discussion, including Ultimate Quiz MOD support.

Moderator: CricketMX Forum Moderators

Post Reply
User avatar
quahappy
Happy, not Quappy
Happy, not Quappy
Posts: 2266
Joined: Fri Oct 10, 2008 8:56 pm
Location: South Yorkshire, UK

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? :)
If you don't ask...
User avatar
quahappy
Happy, not Quappy
Happy, not Quappy
Posts: 2266
Joined: Fri Oct 10, 2008 8:56 pm
Location: South Yorkshire, UK

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
If you don't ask...
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

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 :)
CricketMX.com in 2022: Still the home of bat's, rat's and other farmyard animals!

"OK, life [as you chose to define it] repeats until there are no more lessons to be learned." - nrnoble (June 12, 2005)
"the new forum looks awesome, it's getting bigger & better" - p2p-sharing-rules (11 Jan, 2008)
"Looks like CMX is not only getting bigger...but, also getting better!!" - moongirl (14 Dec, 2007)
User avatar
quahappy
Happy, not Quappy
Happy, not Quappy
Posts: 2266
Joined: Fri Oct 10, 2008 8:56 pm
Location: South Yorkshire, UK

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. :)
If you don't ask...
Post Reply