PDA

View Full Version : vBa CMPS - Random Quiz


brianstevz
05-29-2005, 10:00 PM
Hack name: vBa CMPS: VBulletin Random Quiz addon
Version: 1.0
Author: brianstevz - I take NO credit for the orginal hack. That was scripted by Zero Tolerance. All I've done is port his hack to vBa CMPS. I also "borrowed" a lot from tcs hack of Random Arcade addon.

Steps:
1. Install Quiz Hack from Zero Tolerance
https://vborg.vbsupport.ru/showthread.php?t=80780&highlight=quiz

2. Add 1 new template

In your Admincp - Styles & Templates - Style Manager - Add a new template called "adv_portal_quiz"

Insert this code into the template:


<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="$stylevar[tablewidth]" align="center">
<thead>
<tr>
<td class="tcat" colspan="2">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_randomtopic')"><img id="collapseimg_forumhome_randomtopic" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_forumhome_randomtopic].gif" alt="" border="0" /></a><span class="smallfont"><strong>$vba_options[portal_blockbullet] Random Quiz</strong></span>
</td>
</tr>
</thead>
<tbody id="collapseobj_forumhome_randomtopic" style="$vbcollapse[collapseobj_forumhome_randomtopic]">
<tr>
<td class="alt1" align="center" colspan="2">
Have you taken the following quiz?<br><br><a href="$vboptions[bburl]/quiz.php?$session[sessionurl]do=Take&id=$randquiz[qid]"><img src="$vboptions[bburl]/images/quiz/$randquizimg" alt="$randquiz[q_name]" border=0></a><br><br>->&nbsp;&nbsp; <a href="$vboptions[bburl]/quiz.php?$session[sessionurl]do=Take&id=$randquiz[qid]"><b>$randquiz[q_name]</b></a>&nbsp;&nbsp;<-
</td>
</tr>
</tbody>
</table>
<br />

Save the template!

Make sure to repeat this step for each style(skin) that you use.

3. Upload random_quiz.php to your modules folder. Usually HOME/forum/modules

4. Add 1 new vBa CMPS Module

Still in your Admincp - vBa CMPS - Add Module

- Module Title - Random Quiz
- Module Identifier - Leave blank
- File to include - random_quiz.php
- Activate and select the column you want it in.
- Save and you are done.

Your done!

Hope you like it.

Brian

Demo here: http://www.pro-american.com

MAKE A BACKUP
I will not be held responsible for any damage this hack causes to your forum.

Please keep any bug reports in this thread.

hello
05-30-2005, 08:37 PM
Have you got any screen shots of it?

Lionel
05-30-2005, 09:18 PM
Give him a random screenshot.

DR?@M W?@V?R
05-31-2005, 12:23 PM
thx nice idea.. I changed

<br> to <br />
Take&id to Take&amp;id
border=0> to border="0" />

To make it XHTML valid.

Templates Used: adv_portal_quiz

To prevent a unnecessary querie.

Gemma
05-31-2005, 06:58 PM
Nice hack!

I changed some things so it didn't clash with amykhar's vba newest quiz module

I changed the template name from adv_portal_quiz to adv_portal_randquiz and in random_quiz.php

eval('$home[$mods[\'modid\']][\'content\'] = "' . fetch_template('adv_portal_quiz') . '";');

to this:
eval('$home[$mods[\'modid\']][\'content\'] = "' . fetch_template('adv_portal_randquiz') . '";');

Thank You for this hack :)

Vevina
06-01-2005, 01:50 PM
Sweet installed ThankYou :)