UQM cosmetic changes (templates)

All web design discussion, including Ultimate Quiz MOD support.

Moderator: CricketMX Forum Moderators

Post Reply
User avatar
quahappy
Happy, not Quappy
Happy, not Quappy
Posts: 2266
Joined: Fri Oct 10, 2008 8:56 pm
Location: South Yorkshire, UK

.
Thanks to battye, I now have the dynamic timer fully functioning, along with inability to cheat! If anyone wants to know more, full details can be found here.

I'm in process of "tweaking" certain areas but I'm a little stuck on outputting php code to templates. I still only know the basics like installing MOD's, SQL changes, etc. I'm more clued on HTML and CSS than anything and it's always been a time issue with learning php is great detail. (Give me AMOS Pro on Amiga though and I'll be well away.... not used now though lol).

I'm a stickler for holding members in key areas trying to eliminate any need for "browser back" options because there isn't an option within a page. Hope I'm making sense! Anyhow, when results of a Quiz is displayed (quiz_result_body.tpl, you get two options at the bottom of page where you can choose to return to Quiz index page or your forum index page. These options are missing if you click on "Quiz Statistics" (displayed at top right).

The code in quiz_result_body.tpl is:

Code: Select all

		<tr>
			<td width="100%" class="row1" align="center" valign="middle" height="100%" colspan="2">
				<span class="gen">
					<br />
					{L_RETURN_INDEX}<br />
					{L_RETURN_QUIZ}
					<br /><br />
				</span>
			</td>
		</tr>
I tried inserting this into quiz_statistics_body.tpl and quiz_statistics_particular_body.tpl but I'm getting a blank box. This leads me to believe that I need to assign {L_RETURN_INDEX} and {L_RETURN_QUIZ} within the quiz.php files so those options are displayed?

Of course, I am aware that I could use plain old HTML and do the following in quiz_statistics_body.tpl:

Code: Select all

		<tr>
			<td width="100%" class="row1" align="center" valign="middle" height="100%" colspan="2">
				<span class="gen">
					<br />
					<a href="http://<website>/forum/index.php">Click here to return to forum index</a><br />
					<a href="http://<website>/forum/quiz.php">Click here to return to Quiz index page</a>
					<br /><br />
				</span>
			</td>
		</tr>
Although that will work, it is not really keeping in line with UQM coding and looks untidy against battye's work.

I know it's the following two lines I need (within quiz.php), but where?

Code: Select all

		"L_RETURN_INDEX" => sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>'),
		"L_RETURN_QUIZ" => sprintf($lang['Quiz_click_return_quiz'], '<a href="' . append_sid("quiz.$phpEx") . '">', '</a>'),
Thanks in advance! :D
If you don't ask...
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

If I understand correctly, try this:

Open quiz_statistics_body.tpl

At the very beginning, add (ie. right before <table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">)

Code: Select all

<table width="100%" border="0">
	<tr>
		<td width="100%" align="left"><span class="genmed"><a href="{U_INDEX}" class="nav">{L_INDEX}</a> -> <a href="quiz.php" class="nav">Quiz</a></span></td>
	</tr>
</table> 
CricketMX.com in 2022: Still the home of bat's, rat's and other farmyard animals!

"OK, life [as you chose to define it] repeats until there are no more lessons to be learned." - nrnoble (June 12, 2005)
"the new forum looks awesome, it's getting bigger & better" - p2p-sharing-rules (11 Jan, 2008)
"Looks like CMX is not only getting bigger...but, also getting better!!" - moongirl (14 Dec, 2007)
User avatar
quahappy
Happy, not Quappy
Happy, not Quappy
Posts: 2266
Joined: Fri Oct 10, 2008 8:56 pm
Location: South Yorkshire, UK

Thanks battye. It is similar in a way to what I wanted. I changed the parent of "->" text to "Return to Quiz Index page".

You get two options at bottom of quiz results page and I tried to do the same with statistics results page as well:

(questions, answers, etc followed by)

......You took 0 minutes, 4 seconds

Click Here to return to the Index
Click Here to return to the Quiz Page
If you don't ask...
User avatar
battye
Site Admin
Site Admin
Posts: 14391
Joined: Sun Jan 11, 2004 8:26 am
Location: Australia
Contact:

Which page is the statistics results page?

Do you mean quiz_stats.php or a different page?

If you mean quiz_stats.php, do you mean you want the

"Click Here to return to the Index
Click Here to return to the Quiz Page"

To go right under the Most Played Quizzes area?
CricketMX.com in 2022: Still the home of bat's, rat's and other farmyard animals!

"OK, life [as you chose to define it] repeats until there are no more lessons to be learned." - nrnoble (June 12, 2005)
"the new forum looks awesome, it's getting bigger & better" - p2p-sharing-rules (11 Jan, 2008)
"Looks like CMX is not only getting bigger...but, also getting better!!" - moongirl (14 Dec, 2007)
User avatar
quahappy
Happy, not Quappy
Happy, not Quappy
Posts: 2266
Joined: Fri Oct 10, 2008 8:56 pm
Location: South Yorkshire, UK

Sorry for confusion. It doesn't help when kids are playing up - major distraction!

I've managed to sort it. It's the quiz_stats.php file that the code below needed inserting to, NOT quiz.php!

FIND:

Code: Select all

		"L_ALL_TIME_HI" => $lang['Quiz_stats_all_time_highest'],
AFTER, ADD:

Code: Select all

      "L_RETURN_INDEX" => sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>'),
      "L_RETURN_QUIZ" => sprintf($lang['Quiz_click_return_quiz'], '<a href="' . append_sid("quiz.$phpEx") . '">', '</a>'),
Those two options now show below all the stats on quiz_stats.php page below "Most played quizzes". :D
If you don't ask...
User avatar
quahappy
Happy, not Quappy
Happy, not Quappy
Posts: 2266
Joined: Fri Oct 10, 2008 8:56 pm
Location: South Yorkshire, UK

I don't have the UQM main link in the options bar on index.php, instead it's a forum link (Forum Title Link MOD) which only registered members can see. But, on submitting a Quiz and getting the "Your quiz has been added to the database successfully!" message, I had to keep returning to forum index, then on UQM forum link and finally "Submit Quiz" to create another. So I've added a new line to the Information box when a Quiz is submitted:

In quiz.php, FIND:

Code: Select all

message_die(GENERAL_MESSAGE, $lang['Quiz_added_successfully']);
REPLACE WITH:

Code: Select all

	$message = $lang['Quiz_added_successfully'] . '<br /><br />' . sprintf($lang['Quiz_click_return_quiz'], '<a href="' . append_sid("quiz.$phpEx") . '">', '</a>');
	message_die(GENERAL_MESSAGE, $message);
(btw, UQM at my site is going live on 1st December 2008 :D)
If you don't ask...
Post Reply