View Single Post
  #61  
Old 02-01-2003, 03:55 PM
Intex Intex is offline
 
Join Date: Apr 2002
Posts: 576
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01056 seconds
  • Memory Usage 1,791KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete