SMF Quiz

Started by Diego Andrés, February 18, 2009, 01:08:19 PM

Previous topic - Next topic

FrizzleFried

#500
The two TRYING TO GET PROPERTY OF NON-OBJECT errors have to do with failing to get version info and news info from the now-defunct quiz site it appears.

I just commented them out.

// Get and set the latest version information
$context['SMFQuiz_currentVersion'] = $adminCenterXml->smfQuiz->latestVersion;

// Get and set the latest news information
$context['SMFQuiz_latestNews'] = $adminCenterXml->smfQuiz->newsEntries->newsEntry;


And low and behold... the INVALID ARGUMENT SUPPLIED FOR FOREACH() is also "news" related...

foreach($context['SMFQuiz_latestNews'] as $latestNews) {
echo ' <tr>
<td style="font-weight: bold; font-size: 0.8em;">' , $latestNews->date , '</td>
</tr>
<tr>
<td style="font-weight: bold; font-size: 0.8em; color: green">' , $latestNews->title , '</td>
</tr>
<tr>
<td style="font-size: 0.8em;">' , $latestNews->description , '</td>
</tr>
<tr>
<td><hr size="1"></td>
</tr>


EDIT: Unfortunately commenting out the two as I mentioned above causes more problems with undefined indexes... >argh<

I will let the guy(s) who know what they are doing figure this one out.  I'll patiently sit over here on the sideline.

:)

Thanks!

Dave J

Quote from: FrizzleFried on March 30, 2012, 10:16:00 PM
The two TRYING TO GET PROPERTY OF NON-OBJECT errors have to do with failing to get version info and news info from the now-defunct quiz site it appears.


FrizzleFried

Did you use my edit of the quiz?

http://www.simplemachines.org/community/index.php?topic=293949.msg3286942#msg3286942

Because I deleted all code relating to the old news and SMFModding site and there are no errors.

I know Emanuale is rebuilding this but as you trying so hard to get it going try this for the time being....hopefully it will work for you.

If you want quizzes to add to the new SMF2.1 quiz mod go here . There are also walkthroughs in the forum to explain how to install them and other tips.

FrizzleFried

You wouldn't happen to have your notes as to what you pulled?  I ask because it will require a manual uninstall if I wanted to uninstall and re-install your version.

The fact it's up and running is enough for me not to go that route.

:)

Thanks though!

emanuele

#503
You can just decompress the package and re-upload the files SMFQuizAdmin.template.php and SMFQuizAdmin.php (respectively in Themes/default and Sources). ;)

ETA I went through the topic, but I didn't find any, so just to not assume anything: is there any translation available? (I know the mod didn't work very well in non-English forums (personal experience ;)), but I think it's better to ask, because if the answer is no, then I'll the language files too.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Dave J

Quote from: FrizzleFried on March 31, 2012, 03:02:06 AM
You wouldn't happen to have your notes as to what you pulled?  I ask because it will require a manual uninstall if I wanted to uninstall and re-install your version.

The fact it's up and running is enough for me not to go that route.

:)

Thanks though!

I search the template files for anything that said 'SMFModding' and removed the code that used it.

What you could do is download my version and download your current operating quiz templates and using 'Notepad++' you can compare them them just make the necessary edits by deleting the code that you have in yours thats not in mine...if you know what I mean.
Remember to rename the original version on the site first or download a copy for backup.
If you want quizzes to add to the new SMF2.1 quiz mod go here . There are also walkthroughs in the forum to explain how to install them and other tips.

Kindred

or this: :)

Quote from: emanuele on March 31, 2012, 06:14:15 AM
You can just decompress the package and re-upload the files SMFQuizAdmin.template.php and SMFQuizAdmin.php (respectively in Themes/default and Sources). ;)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Dave J

Quote from: Kindred on March 31, 2012, 08:33:43 AM
or this: :)

Quote from: emanuele on March 31, 2012, 06:14:15 AM
You can just decompress the package and re-upload the files SMFQuizAdmin.template.php and SMFQuizAdmin.php (respectively in Themes/default and Sources). ;)

Do you know I've only just got what that means now.

What they're saying, in normal speak ;) , is just take my individual templates and upload those to your site, instead of uninstalling the whole mod etc.

As I said before though remember to create copies of your originals...I normally just rename them .old instead of .php and then upload the edited template, if things do go wrong then just rename the old one as php and you're back to normal.


is that right Kindred/Emanuele? or have I got it wrong again  :-\
If you want quizzes to add to the new SMF2.1 quiz mod go here . There are also walkthroughs in the forum to explain how to install them and other tips.

FrizzleFried

Not sure what to say... I replaced the two files as instructed and I am getting the same errors:


http://www.aha-forums.com/index.php?action=admin;area=quiz;b502cea71=0e200771b21ac0c4acdee824fdcee597
2: Invalid argument supplied for foreach()
File: /home/ahaforum/public_html/Themes/default/SMFQuizAdmin.template.php
Line: 1740


http://www.aha-forums.com/index.php?action=admin;area=quiz;b502cea71=0e200771b21ac0c4acdee824fdcee597
8: Trying to get property of non-object
File: /home/ahaforum/public_html/Sources/SMFQuizAdmin.php
Line: 2411

http://www.aha-forums.com/index.php?action=admin;area=quiz;b502cea71=0e200771b21ac0c4acdee824fdcee597
8: Trying to get property of non-object
File: /home/ahaforum/public_html/Sources/SMFQuizAdmin.php
Line: 2408

I've swapped back and forth between the two files and nothing changes.   Same error... same line numbers... and they ARE different files (different size and dates).


FrizzleFried

I've just discovered/noticed a tiny other bug... the right side of the screen all have rounded corners while the left are all squared corners... that includes the split windows, etc...

I am not sure if it's been that way forever (and I just noticed) or if it's a new issue?

GlitchPC

Quote from: FrizzleFried on March 31, 2012, 03:54:09 PM
I've just discovered/noticed a tiny other bug... the right side of the screen all have rounded corners while the left are all squared corners... that includes the split windows, etc...

I am not sure if it's been that way forever (and I just noticed) or if it's a new issue?


Already reported...

just one page back.  See this post:  http://www.simplemachines.org/community/index.php?topic=293949.msg3302822#msg3302822

emanuele

Quote from: GlitchPC on March 31, 2012, 04:50:53 PM
Already reported...

just one page back.  See this post:  http://www.simplemachines.org/community/index.php?topic=293949.msg3302822#msg3302822
And fixed in the repo here on my pc! :)

Yesterday I think I finished the (manual) upload, it need a bit of testing and I would also like to prepare few packages of quizzes before providing a download. ;)


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

FrizzleFried

Yeah... I found the solution (THANK YOU) and went through and added the DIV comments required.... lookin' good.  I'm just down to those ADMIN errors now... but since I don't hit admin much anyway,  they're not a big deal at all.

GlitchPC

I made all the <div> tag edits, as well.  Looks much better but, I found another issue...

From the Quiz home page, there are a couple of links from the New Quizzes block and the Popular Quizzes block for a user to click...they are labeled as "View All".

When a user clicks these links...they are redirected to another page and these pages have a title bar as pictured below in the attachment I'm providing.

1.  How to remove that white line...
2.  The alphabetical listing doesn't look right with my modified theme due to the color of the title bar.  Any way to change the link font color without it being a global change to links?  I'm referring to the "A B C D E F...." links.

emanuele...

Thanks for keeping us all updated with the progress and supplying the edits for us.  Much appreciated...

emanuele

That's a bit bigger change because it's a table.
So, in SMFQuiz.template.php, search for:
Code (find) Select

echo '
<table class="bordercolor" border="0" cellpadding="4" cellspacing="1" width="100%">
<tbody>
<tr class="titlebg">
<td colspan="3">
';

// Title to show depends on the quiz listing type we are showing
switch ($type) {
case 'unplayed':
echo $txt['SMFQuiz_Common']['UnplayedQuizes'];
break;
case 'all':
echo $txt['SMFQuiz_Common']['AllQuizes'];
break;
case 'new':
echo $txt['SMFQuiz_Home_Page']['NewQuizes'];
break;
case 'popular':
echo $txt['SMFQuiz_Home_Page']['PopularQuizes'];
break;
case 'easiest':
echo $txt['SMFQuiz_Common']['EasiestQuizes'];
break;
case 'hardest':
echo $txt['SMFQuiz_Common']['HardestQuizes'];
break;
}
echo '</td>
<td colspan="6" align="right">', $context['letter_links'] . '</td>
</tr>
<tr class="', empty($settings['use_tabs']) ? 'titlebg' : 'catbg3', '">
';

and replace it with
Code (replace with) Select
echo '
<div class="cat_bar">
<h4 class="catbg">
<span class="floatleft">
';

// Title to show depends on the quiz listing type we are showing
switch ($type)
{
case 'unplayed':
echo $txt['SMFQuiz_Common']['UnplayedQuizes'];
break;
case 'all':
echo $txt['SMFQuiz_Common']['AllQuizes'];
break;
case 'new':
echo $txt['SMFQuiz_Home_Page']['NewQuizes'];
break;
case 'popular':
echo $txt['SMFQuiz_Home_Page']['PopularQuizes'];
break;
case 'easiest':
echo $txt['SMFQuiz_Common']['EasiestQuizes'];
break;
case 'hardest':
echo $txt['SMFQuiz_Common']['HardestQuizes'];
break;
}
echo '</span>
<span class="floatright">', $context['letter_links'] . '</span>
</h4>
</div>

<table class="bordercolor" border="0" cellpadding="4" cellspacing="1" width="100%">
<tbody>
<tr class="', empty($settings['use_tabs']) ? 'titlebg' : 'catbg3', '">
';



Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

GlitchPC

Oh, yeah!  Much better!  You rock, my friend!  No "ifs, ands, or buts"!!!  Two thumbs up!

CircleDock

I have installed this mod on one of my sites running SMF 2.0.2. Everything works apart from the Quiz Client keeps being fed the HTML for the site's Home Page when a quiz is run. Because the error reporting is pretty basic in the client, I modified the JS file to display the text of what was being returned to it - and, as you'll see from the attached screenshot, it's all HTML and not the XML for the start of the quiz.

I've read every message in this thread and this very problem seems to have occurred in the past but unfortunately the mod's original author did not see fit to answer it here, he simply put a link to a message on his own Forum which no longer exists (and the Wayback Machine doesn't hold any of his site's message pages).

Anyone have any idea what is going wrong - and how I can fix it so that I can offer my users this otherwise excellent feature?


Dave J

Quote from: CircleDock on April 02, 2012, 10:14:27 PM
I have installed this mod on one of my sites running SMF 2.0.2. Everything works apart from the Quiz Client keeps being fed the HTML for the site's Home Page when a quiz is run. Because the error reporting is pretty basic in the client, I modified the JS file to display the text of what was being returned to it - and, as you'll see from the attached screenshot, it's all HTML and not the XML for the start of the quiz.

I've read every message in this thread and this very problem seems to have occurred in the past but unfortunately the mod's original author did not see fit to answer it here, he simply put a link to a message on his own Forum which no longer exists (and the Wayback Machine doesn't hold any of his site's message pages).

Anyone have any idea what is going wrong - and how I can fix it so that I can offer my users this otherwise excellent feature?

Hi CircleDock,

Unless someone else can give you a quick fix I suggest leave things as they are as the quiz is in the procees of being bought up to date. So if you can live with what you have for the moment an updated version will be available in the not to distant future with additional functions to the existing one.



If you want quizzes to add to the new SMF2.1 quiz mod go here . There are also walkthroughs in the forum to explain how to install them and other tips.

CircleDock

#517
Quote from: davejo on April 03, 2012, 03:15:56 AM
Hi CircleDock,

Unless someone else can give you a quick fix I suggest leave things as they are as the quiz is in the procees of being bought up to date. So if you can live with what you have for the moment an updated version will be available in the not to distant future with additional functions to the existing one.

Hi Davejo,

Thanks for your reply!

As a result of some further testing and experimenting, I've found two or three things that may be pertinent:

  • There's an index.php in the site root folder that simply does a redirection to {root}/forum where the SMF index.php is located.
  • We're running Adk-Portal
  • If I mimic the first call made by QuizClient.js by entering, for example, "http://<sitename>.com/forum/Sources/SMFQuizStart.php?id_quiz=1" into my browser's address bar, the browser navigates to "http://<sitename>.com/forum/" (as shown in the address bar) and the Forum's Portal page is displayed. On the other hand, the address bar created by QuizClient shows "http://<sitename>.com/forum/index.php?SMFQuiz;sa=play;id_quiz=1".


emanuele

I have the feeling I fixed this in the version I'm preparing (unintentionally, let's say it's a side effect of another series of changes I did).

I could have a workaround, but it could break something on the portal side (I'm not sure because I don't know anything about that portal...well I don't know anything about any portal! :P)...if you want to know it I can PM you, otherwise in (hopefully) few days I'll post the version I'm working on and that should (hopefully :P) fix your problem as well.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Eclipse16V

Hi,
I become this error:

"You have already played this quiz league over the maximum amount of times allowed for this round
Please return when the next round starts."

It´s a new quiz and a new league.
No user can play this quiz.

How can i fix it?
I worked with:
SMF 2 in German

Shop:
SID Giessen

Advertisement: