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)

kira 08-30-2002 08:28 PM

Ooh Martin and FASherman are my new boyfriends! ;) That Quiz center is looking gorgeous -- can't wait to install it! Many many thanks, guys.

Martin64 08-30-2002 08:38 PM

lmao, I wish I hadn't read that one. ;)
Thanks yourself for using it. :D

JGM007 09-11-2002 04:58 PM

Thank you Martin and FASherman for the hack.
I am still very green with vBulletin. I have installed the hack on my forums at http://board.madoshi.com

Currently the quiz center is stuck at the bottom of the main board, I would like to have it rest under the "General" section of the board. What do I need to do to the templates to get it to rest there?

Thanks!
-JGM

LOD-squa 09-12-2002 07:02 PM

Nice hack I installed it.

LangTuDaTinh 10-14-2002 06:20 PM

thanks for this great add-on hack. however i have a question?

if i delete this part in /quizzes/global.php

PHP Code:

$permissions=getpermissions();

if (!ismoderator() or !$permissions['canview']) {
  cpheader("<title>Moderators control panel</title>");
?><br><br><br>
<table cellpadding="1" cellspacing="0" border="0" class="tblborder" align="center" width="450"><tr><td>
<table cellpadding="4" cellspacing="0" border="0" width="100%">
<?php maketableheader("Please Log in:","login",0,1); ?>
<tr class="firstalt" id="submitrow"><td align="center" nowrap><p>You are either not a valid moderator or have not logged in.</p>
<form action="index.php" method="post" id="submitrow">
<input type="hidden" name="s" value="<?php echo $session[sessionhash]; ?>">
<input type="hidden" name="action" value="login">
<input type="hidden" name="redirect" value="<?php

if ($HTTP_SERVER_VARS['REQUEST_URI']!="") {
  
$redirecturl $HTTP_SERVER_VARS['REQUEST_URI'];
} else {
  
$redirecturl $PHP_SELF;
}

if (
strpos($redirecturl""?")) {
  
$redirecturl .= "&s=$session[sessionhash]";
} else {
  
$redirecturl .= "?s=$session[sessionhash]";
}

echo 
htmlspecialchars($redirecturl);

?>">
<input type="text" name="loginusername">
<input type="password" name="loginpassword">
<input type="submit" value="   Log in   " accesskey="s">
</form>
</td></tr></table>
</td></tr></table>
<p align="center"><font size="1">vBulletin v<?php echo $templateversion ?> Moderator Control Panel</font></p>

<?php
  cpfooter
();
  exit;
}


what will happen is that it not require login anymore so any user can add or modify a quiz

also in /quizzes/index.php

if i remove all stuffes and leave only this

PHP Code:

<?php

makenavoption
("Add","admin_quiz.php?action=addquiz","|");
makenavoption("Approve","admin_quiz.php?action=approve","|");
makenavselect("Quizzes");

?>

so that they only can add or approve...no delete or modify.

so the question is , will this modify (above) will effect the forum security and if it does, in what way?

thanks

hidjra 10-26-2002 02:54 AM

hi,

does anyone know how many queries this will add to forumhome?

and how many queries will it add if we also add the addon kira suggested?

:banana:
hidjra

TheEDIGuy 11-12-2002 06:09 PM

Installed step 1, on vBulletin 2.2.8 - works great, thanks!

John
Fans of Reality TV
www.fansofrealitytv.com

Erwin 11-12-2002 07:37 PM

Quote:

Originally posted by hidjra
hi,

does anyone know how many queries this will add to forumhome?

and how many queries will it add if we also add the addon kira suggested?


:banana:
hidjra

This will add 6 queries to your forumhome.

TheEDIGuy 11-13-2002 12:03 PM

I installed this yesterday, and it works well, but I noticed that the "average scores" displayed on the forum home are different than those displayed within the actual quiz area.

I have 3 quizzes, so it's fairly easy to compare these average scores. I wonder why that is. Anyone else seeing the same thing?

FleaBag 11-22-2002 11:25 AM

This has turned my forums/index.php into a clone of my quiz.php?

werwer 11-24-2002 12:03 AM

Hi
A nice hack, I'll install it...
Is it possible to dysplay 5 quesions per page befor the nest questions button?!
Any1 can help with this?!

I think it would be more modular if quiz admins could choose how many questions to dysplay per page befor spliting the next page!!

thanx

TheEDIGuy 11-24-2002 10:45 PM

Quote:

Originally posted by GamerForums
This has turned my forums/index.php into a clone of my quiz.php?
My users are reporting a problem similar, and I've tested and located the problem...Now I'm looking for a solution short of uninstalling the hack.

This hack works wonderfully on Internet Explorer. However, Netscape (all versions have been tested, through 7.0) redirects the main forums index page to the quiz.php page.

As an example, I have users who have my Forum Index page (at /forums/index.php) bookmarked, but when they either click on the bookmark or type in our web address, instead they get /forums/quiz.php. They've even double-checked their bookmarks, and they are correct. It's definitely this hack that's causing the problem, but as I said, only for Netscape users.

Someone please come through with a fix? I don't know enough about PHP to go through it, but I love the hack, and don't want to have to uninstall it.

TheEDIGuy 11-24-2002 10:49 PM

By the way, I'm running 2.2.8, if that helps.

Martin64 11-25-2002 08:05 PM

Right, that's odd. I don't know what in the code that could possibly cause that, but evidently something is. :)

Quick solution: don't use Netscape! Seriously though, someone with a bit more experience in PHP than I maybe can help us with this as I'm clueless. Sorry :/

FleaBag 11-25-2002 08:22 PM

I don't use Netscape... I use IE6.

snout 12-05-2002 07:11 PM

Thank you m8 for the wonderful hack..... damn wot an xcellent addon boy :)

[high]* snout likes very much.
[/high]

vbb 229, installed no prob

Martin64 12-05-2002 08:35 PM

I'm glad you like it. :D

snout 12-11-2002 06:20 AM

Got a Q for ya.... Is there any way that the results of the quiz could be CC or mailed to another address, im a bit of a n00b when it comes to PHP?

Thanks in advance

Intex 02-01-2003 02:56 PM

Very nice add-on Martin64 :cool:.

I've got one question - can you just ermove the other CP options that appear (announcements, moderation lists, user actions, thread controls)? And on the same lines for the Quizzes CP, can you stop moderators deleting quizzes that they didn't create?

Intex 02-01-2003 03:55 PM

Actually a problem has just arisen and I notice its been mentioned here already.

After installing the hack it looked fine, the relevent stuff at the bottom of the homepage (index.php) showed the quiz icon and the other info. But then later on after I came back to the forum, the homepage had been taken over by Quizzes page only. All the other forum information had disappeared.

The problem is cause by the instructions in Step 1, namely:

Quote:

++++++++++++++++++++++++++++++++++++++++++++++++++ +++

Still in index.php, find this:

eval("\$loggedinusers = \"".gettemplate('forumhome_loggedinusers')."\"; ");
}

BELOW this add the following:

// see if anyone's taken any of the quizzes yet
$resultcheck = $DB_site->query("SELECT r.resultid FROM quiz q, quiz_results r$resultclause");

if (!$DB_site->num_rows($resultcheck)) {
eval("dooutput(\"".gettemplate("quiz")."\");");
exit();
}

$quiz_characters = $quizcharacters + 1;

// get the easiest quiz
$easiest = $DB_site->query_first("SELECT q.quizid, q.quiztitle, LEFT(q.description, $quiz_characters) AS description,
AVG(r.totalcorrect) AS average
FROM quiz q, quiz_results r
WHERE r.quizid = q.quizid
AND r.complete = 1
AND q.approve = 1
$authorclause
GROUP BY q.quizid
ORDER BY average DESC
LIMIT 1");

// get the hardest quiz
$hardest = $DB_site->query_first("SELECT q.quizid, q.quiztitle, LEFT(q.description, $quiz_characters) AS description,
AVG(r.totalcorrect) AS average
FROM quiz q, quiz_results r
WHERE r.quizid = q.quizid
AND r.complete = 1
AND q.approve = 1
$authorclause
GROUP BY q.quizid
ORDER BY average ASC
LIMIT 1");

$easiest[average] = number_format($easiest[average], 2);
$hardest[average] = number_format($hardest[average], 2);

// vbQuiz QuizCenter
$quiztaken=$DB_site->query_first("SELECT COUNT(*) AS results FROM quiz_results where userid=$bbuserinfo[userid]");
$quiztotal=$DB_site->query_first("SELECT COUNT(*) AS results FROM quiz");
$newquiz=$DB_site->query_first("SELECT COUNT(*) AS results FROM quiz where timestamp >$bbuserinfo[lastvisit]");
if ($newquiz[results]!=0) {
$onoff="on.gif";
} else {
$onoff="off.gif";
}
if ($newquiz[results]==1) {
$isare="is";
$quiz="quiz";
} else {
$isare="are";
$quiz="quizzes";
}

eval("\$quiz_center = \"".gettemplate("quiz_center")."\";");
// End vbQuiz QuizCenter

Save and close index.php
I'm not sure why, but its this that is causing the problem, even though it worked the first time I went to the homepage as I described above. But if I remove that code from index.php, then my forum goes back to how it should do.

I looked at the html page source with and without the code and clearly you can see that the page is taken over with Quiz template (see below):


1. HTML Source without the step 1 html code within index.php

Code:

<!-- BEGIN TEMPLATE: forumhome -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
        <!-- no cache headers -->

etc.


2. HTML Source with the step 1 html code within index.php

Code:

<!-- BEGIN TEMPLATE: quiz -->
<html>
<head>
<title>Skynet Forums - Quizzes</title>
<!-- BEGIN TEMPLATE: headinclude -->

the end of this source is:

Code:

</font></p>
<!-- END TEMPLATE: footer -->
</body>
</html>
<!-- END TEMPLATE: quiz -->

So its definitely taking over the homepage as there is no sign of the forum home template being used.

Like I say it was all working, the only thing I did do was to remove all of the test quizzes that I made, then everything went like above. Wouldn't have thought it would have cause that.

I really like this hack so any help would be appreciated.

Martin64 02-01-2003 09:26 PM

I'll have a look at it (haven't touched this hack in ages. :))

Martin64 02-01-2003 09:45 PM

Found the problem.

If you have this add-on installed, open forums/index.php.

FIND AND DELETE:

if (!$DB_site->num_rows($resultcheck)) {
eval("dooutput(\"".gettemplate("quiz")."\");");
exit();
}


I have no idea what that code is doing there. :) I'll update the instructions and attach them...

Martin64 02-02-2003 01:40 AM

v1.3 released. I changed the look of it a bit, and of course fixed what was posted just above.

Let me know how it works out for you guys. :)

Intex 02-02-2003 08:23 AM

Martin64 - I just installed it and works great - good job man !! :cool:.

The only thing I have to get sorted now is the fact that my images don't show up, but this is an issue with vBQuiz not your hack :D.

Thx again.

Talisman 03-14-2003 12:20 AM

We really like your add-on, Martin 64, but it adds too many queries. Uninstalled.

deepdark 04-12-2003 06:14 PM

i cant find admin_quiz.php in zip file???

sabret00the 04-12-2003 08:38 PM

excellent, do you know how long i been looking for this?

Martin64 04-16-2003 10:36 PM

Talisman: You don't have to use all features of this hack. For instance, if only only wish to display the easiest + hardest quizzes you'd save a few queries.

deepdark: It comes with vBQuiz, if you have installed it previously it will sit in your admin folder. Sorry about not being clear about this. :P

sabret00the: Thank you. :)

lange 05-01-2003 11:40 AM

Does this work with 2.3.0?

Martin64 05-01-2003 11:44 AM

As I'm still on 2.2.9 I don't know if it works with 2.3.0, but I see no reason why it wouldn't. :)

bigtime 05-04-2003 05:44 AM

For anyone using phpportals:

How do I make this appear on my front index page?

Forum Quiz Center
Test your brainpower in the Forum Quiz Center
You have taken 1 of the 1 quizzes available.
There is 1 new quiz since your last visit.
Easiest Quiz: Test Quiz - 1.00 average
Hardest Quiz: Test Quiz - 1.00 average

To make it appear in the forum index $quiz_center is added to the forumhome template....how can I do the equivalent for the phpportals index page?

Thanks in advance.

Great hack too!

LangTuDaTinh 05-04-2003 06:30 AM

u can add a new block for it. but i wouldn't recommend it if u have a lot of quiz's results ....

XrayHead 07-12-2004 05:24 PM

Hi Martin

Cool hack, Installed no probs at all apart from the Styles problem but I just copied all the templates over to the style I am using. I also had to change one of the templates as it was uploading the images to the wrong DIR (just changed it to the complete path).

Anyway I was hoping you could tell me how I can re-set my quizzes so they can be taken again?

Also would it be possible for people to take the quiz more than once so they could improve there score?

Thanks again for the hack.

Xrayhead

XrayHead 07-15-2004 08:59 AM

Regards to the question above.

If I was to go to the quiz_results table in my sql database and delete the entries (IE The results of people who have taken the quiz), will this allow the users to take the quiz again and reset the quizz's?

Thanks

Xrayhead

subu1 07-18-2004 07:34 PM

...i have an error

Warning: main() [function.main]: Unable to access ./admin/config.php in /home/virtual/site1/fst/var/www/html/board/quizzes/global.php on line 116

Warning: main(./admin/config.php) [function.main]: failed to create stream: No such file or directory in /home/virtual/site1/fst/var/www/html/board/quizzes/global.php on line 116

on line 116

require('./admin/config.php');

:rolleyes: :rolleyes: :rolleyes: :rolleyes: :rolleyes:

please help me

edit: ups sorry this was my Forum *global.php* :nervous:


All times are GMT. The time now is 01:16 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.01238 seconds
  • Memory Usage 1,834KB
  • 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
  • (3)bbcode_code_printable
  • (2)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (35)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