vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   vBQuiz Add-on v1.2 (https://vborg.vbsupport.ru/showthread.php?t=42000)

Martin64 08-12-2002 06:21 PM

Quote:

Originally posted by Tim Wheatley


The approval or delete is already a part of the script. You even have to do that when YOU make a quiz now... :) If a member submits a bad quiz you edit it or delete it.

IMO it would save bundles of time because you don't have to type everything. Even a quiz riddled with spelling mistakes is easier to edit than to type all over again.

Hehe, I didn't think of that. :p

However, if so, the normal members should only be able to add quizzes, and only be able to manage their own quizzes. That makes this a completely different hack and is not easy to do.

Martin64 08-12-2002 07:32 PM

Quote:

Originally posted by Apok2002
I've always ran the board myself, w/ the help of another Sr. Administrator. I use individual forum mods, but they are not in ther UserGroup Mods...their names were added to a specific forum as a Moderator from the Forum Modify menu.

So if I were to designate a few mods to take care of quizzes, and ONLY quizzes (no other access)...how exactly would I do this? What link would I give them? Where would I put this link for them to access the Mod CP so they can edit quizzes ONLY?

----
Side note...as far as rewarding quiz takers...those w/ the top 3 scores w/i a given period of time, I award points manually. It would be nice if it did it automatically, but I'm not counting on that happening any time soon.
---

They don't have to be in the moderator usergroup, they just need to be assigned as moderators and be able to access the Mod CP to be able to add quizzes (since authorization is based on "ismoderator", not "usergroup").

Want to make a Quizzes CP? Note that they will still be able to access the Mod CP since they're moderators. But if you don't tell them about the Mod CP they might not be avare of its existance.

I believe we could create a new table in your database, create a new usergroup and give that usergroup the ability to view the quizzes cp, modify the global.php located in your /quizzes directory to authorize this usergroup to be able to view the quizzes cp but I have no idea to do that correctly. At least it would take some time for me to figure out :p

Anyway, follow these instructions to create a Quizzes CP:

1. Create a new directory under your forum home called "quizzes" (http://www.yoursite.com/forum/quizzes). CHMOD it to 755.

2. Download the following files from your /mod directory to a temporary folder: admin_quiz.php, cp_logo.gif, index.php, global.php.

3. Open the index.php file you just downloaded and FIND:

Code:

vBulletin Moderator's Control Panel
REPLACE this with:

Code:

vBulletin Quizzes Control Panel
FIND and DELETE:

Code:

<form action="user.php" method="get">
<input type="hidden" name="action" value="findnames">
<input type="hidden" name="s" value="<?php echo $session[sessionhash]; ?>">
<tr class="firstalt">
        <td>Quick User Finder</td>
        <td><input type="text" name="findname" size="30"> <span id="submitrow"><input type="submit" value="Find Now"></span></td>
</tr>
</form>
<form action="http://www.php.net/manual-lookup.php" method="get" target="_blank">
<tr class="secondalt">
        <td>PHP Function Lookup</td>
        <td><input type="text" name="function" size="30"> <span id="submitrow"><input type="submit" value="Find Now"></span></td>
</tr>
</form>
<form action="http://www.mysql.com/doc/manual.php" method="get" target="_blank">
<input type="hidden" name="depth" value="2">
<tr class="firstalt">
        <td>MySQL Language Lookup</td>
        <td><input type="text" name="search_query" size="30"> <span id="submitrow"><input type="submit" value="Find Now"></span></td>
</tr>
<tr class="secondalt">
        <td>Useful Links</td>
        <td><select onchange="jumpto(this.options[this.selectedIndex].value)">
                <option>&raquo; Useful Links &laquo;</option>
                <option value="http://www.vbulletin.com/">vBulletin Home Page</option>
                <option value="http://www.vbulletin.com/members/">vBulletin Members' Area</option>
                <option value="http://www.vbulletin.com/forum/">vBulletin Support Forums</option>
                <option value="http://www.vbulletin.com/manual/">vBulletin Online Manual</option>
                <option value="http://www.php.net/">PHP Home Page</option>
                <option value="http://www.php.net/manual/">PHP Online Manual</option>
                <option value="http://www.mysql.com/">MySQL Home Page</option>
                <option value="http://www.mysql.com/documentation/">MySQL Documentation</option>
        </select></td>
</tr>
</form>
</table>
</td></tr></table>
</form>

FIND:

Code:

Moderators' Control Panel
REPLACE this with:

Code:

Quizzes Control Panel
FIND:

Code:

Welcome to the vBulletin Moderators' Control Panel
REPLACE this with:

Code:

Welcome to the vBulletin Quizzes Control Panel
FIND and DELETE:

Code:

<?php

doformheader("user","find");
maketableheader("Useful Admin Stuff");

if ($stats = @exec("uptime")) {
        $datecut=time()-$cookietimeout;
        $guestsarry = $DB_site->query_first("SELECT COUNT(host) AS sessions FROM session WHERE userid=0 AND lastactivity>$datecut");
        $membersarry = $DB_site->query("SELECT DISTINCT userid FROM session WHERE userid<>0 AND lastactivity>$datecut");

        $guests = number_format($guestsarry['sessions']);
        $members = number_format($DB_site->num_rows($membersarry));

        $onlineusers = number_format($guests + $members) . " users online ($members members &amp; $guests guests).";

        preg_match("/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/",$stats,$regs);
        echo "<tr class=\"secondalt\"><td>Server Load Averages</td><td><b>$regs[1], $regs[2], $regs[3]</b> $onlineusers</td></tr>\n";
}
?>

FIND:

Code:

Control Panel Home
REPLACE it with:

Code:

Quizzes CP Home
FIND (note that this requires that you have previously installed my Add-on.):

Code:

// *************************************************
makenavoption("Add","announcement.php?action=add","|");
makenavoption("Edit","announcement.php?action=modify");
makenavselect("Announcements");
// *************************************************
makenavoption("New Posts","moderate.php?action=posts","<br>");
makenavoption("New Attachments","moderate.php?action=attachments");
makenavselect("Moderation Lists");
// *************************************************
makenavoption("Ban","user.php?action=find","|");
makenavoption("View","user.php?action=find");
makenavselect("User Actions");
// *************************************************
makenavoption("Mass Move","thread.php?action=move","<br>");
makenavoption("Mass Prune","thread.php?action=prune");
makenavselect("Thread Control","<hr>");
// ************************************************

REPLACE this with:

Code:

// *************************************************
makenavoption("Add","announcement.php?action=add","|");
makenavoption("Edit","announcement.php?action=modify");
makenavselect("Announcements");
// *************************************************
makenavoption("New Posts","moderate.php?action=posts","<br>");
makenavoption("New Attachments","moderate.php?action=attachments");
makenavselect("Moderation Lists");
// *************************************************
makenavoption("Ban","user.php?action=find","|");
makenavoption("View","user.php?action=find");
makenavselect("User Actions");
// *************************************************
makenavoption("Mass Move","thread.php?action=move","<br>");
makenavoption("Mass Prune","thread.php?action=prune");
makenavselect("Thread Control","<hr>");
// *************************************************

Upload the files I asked you to download earlier (and the modified index.php too, of course) to your /quizzes directory.

Ask your new quizz moderators to point their browsers at http://www.yoursite/forum/quizzes.index.php

All done. :)

Hmm...maybe I should include this in v1.1 of my add-on ;)

Tim Wheatley 08-12-2002 07:52 PM

So if I wanted to user usergroup - can I simply switch that command and set it as my normal members usergroup?

Martin64 08-12-2002 07:57 PM

Quote:

Originally posted by Tim Wheatley
So if I wanted to user usergroup - can I simply switch that command and set it as my normal members usergroup?
In short, yes. But then everyone would be able to edit eachothers quizzes, and they would have all the quiz answers handy.

Martin64 08-12-2002 08:32 PM

Oh yeah, I forgot: here's a screenshot that shows what the instructions above creates. :)

Tim Wheatley 08-12-2002 09:06 PM

If I remove the 'edit' and 'approve' and 'dissaprove'?? Surely it's possible - pleeeeeeeeeeeeeeeeeeeeeeeeeease? :D:D:D :banana:

Apok2002 08-13-2002 12:48 AM

Tim, if you do that, then you would have to aprove the quizzes yourself (or someone you designate)...but that doesn't solve the problem that now ALL members can see the correct answers. Being curious by nature, I'm sure you'll have a lot of people who want to check out this new little feature...and of course, they'll probably want their name to appear as a top quiz taker...and use the answers they've just obtained to do so.

I offer Forum Points to my top scorers...so it's not a good way to handle this on my personal forum. But if it's just something for fun (which it all is for each of us of course), then you'd be able to do that...but it may create more problems that you haven't thought of.

And Martin, thanks! I'm going to try that out tonight. I'll let ya know how it works. And you should definately include that "option" in the new version.

I like it like this, because my mods are busy, I'm busy, and the quizzes is just something "extra" I'm giving my community. We don't always have time to keep up w/ all the submitted quizzes. And I like to have my community actually participate in a lot of the stuff we do. This is just another great opportunity for them to do that. :)

kira 08-13-2002 04:29 AM

Hi Martin. Many thanks for a great add-on! Of course, I do have a little request, because no good deed goes unpunished! :D I was wondering, is it possible to tweak this so that we'd see a link to the most recently added quiz, rather than the easiest/hardest quizzes? Sorry for being a nag!

Martin64 08-14-2002 08:43 AM

Quote:

Originally posted by kira
Hi Martin. Many thanks for a great add-on! Of course, I do have a little request, because no good deed goes unpunished! :D I was wondering, is it possible to tweak this so that we'd see a link to the most recently added quiz, rather than the easiest/hardest quizzes? Sorry for being a nag!
lol @ edit note :p

Yes, that's possible. I might have time to look at it later today/tonight. :)

kira 08-14-2002 07:42 PM

Many thanks, Martin, that would be excellent! It'd be an easy way to let people know when there's a new quiz. :)


All times are GMT. The time now is 01:46 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01096 seconds
  • Memory Usage 1,787KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (12)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete