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)

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.


All times are GMT. The time now is 12:19 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.01159 seconds
  • Memory Usage 1,754KB
  • 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_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