Forum

Notifications
Clear all

[PHP7] Challenge module

Sheepcontrol
(@sheepcontrol)
Member Admin

These posts may be ahead of time, but still - and for me to keep note of things I fixed 😉

In modules/challenges/challenges.php, at or around line 174, find:

else if($action == "delete") {

        if(!$chalid) continue;

Change to

else if($action == "delete") {

if($chalid)
{

same file, around line 197, find:

        else {
                $output .= write_message(_CONFIRMDELETE."<br /><br />[ <a href=""challenges.php?action=delete&amp;confirmed=yes&amp;chalid=$chalid">"._YES."</a>" |
                        <a href=""challenges.php?action=delete&amp;confirmed=no">"._NO."</a>" ]");
        }
}

else if($action == "respond") {

Insert one more closing "}", should look like this:

		else {
$output .= write_message(_CONFIRMDELETE."<br /><br />[ <a href=""challenges.php?action=delete&amp;confirmed=yes&amp;chalid=$chalid">"._YES."</a>" |
<a href=""challenges.php?action=delete&amp;confirmed=no">"._NO."</a>" ]");
}
}
}

else if($action == "respond") {

That should be it, if anything else comes up, I'll update this post

Quote
Topic starter Posted : 01/02/2016 10:28 am
Anonymous
 Anonymous
(@Anonymous)
Guest

Hello! I recently uploaded a new installation of eFiction. I went to install the challenges module, and it generated an SQL error until I uninstalled it. So I searched here to find a potential solution and ran across this. I wasn't sure if it's intended as a fix, but I tried it anyway.

It generated an SQL error with these changes at well, and I couldn't uninstall it through the web interface this time. I had to go into PHPmyadmin and look up each instance of 'challenges' and delete it to get the site working again.

Do you know if there is a working fix for Challenges at the moment? I understand that you're working on eFic 5 when you have time, so this is far from a priority, but if you know anything offhand that could help, I appreciate it. (I meant to copy the SQL error for reference, but I lost the copy unfortunately. I could generate it again if necessary.)

Thank you!

ReplyQuote
Posted : 30/05/2016 12:30 am
Kate
 Kate
(@kate)
Estimable Member

Hello,

thanks for the fix. x I tried it in my site as I also had a mysql error with the challenges module and it did not work for me it still came up with a mysql error in the adminas this

A fatal MySQL error was encountered.
Query: SELECT count(chalid) FROM fanfiction_challenges
Error: () - See more at: http://www.fictionbykatdurnford.com/admin.php#sthash.m2dyEE0K.dpuf

and it wipes off the welcome message plus the most recent fics on the index.tpl

thank u though.
from Kate x

ReplyQuote
Posted : 30/05/2016 1:57 pm
Kate
 Kate
(@kate)
Estimable Member

Sorry I tried the fix again and it still came up with an error in admin panel, including in most recent page. I now can't sue the site till this is fixed. Thank you for the help.

sincerely
Kate

ReplyQuote
Posted : 30/05/2016 2:09 pm
Kate
 Kate
(@kate)
Estimable Member

My issue is now resolved. Thank you. I tried it yet again. But on my site
I had to also change the type of install because Im on mariahdb they had upgraded the php.
I had to change type=MyIsam at line 1 which is near the end of the sql code to Engine=MyIsam.
This has done the trick. Challenges now work. Thank you your code did work for me. Thank you for your kind help.

Cheers, Kate
http://www.fictionbykatdurnford.com

ReplyQuote
Posted : 30/05/2016 4:40 pm
Anonymous
 Anonymous
(@Anonymous)
Guest

Hello! I tried Kate's workaround, but that didn't work for my site. Once again I had to delete all instances that included the term 'challenges' using phpMyAdmin.

After changing the code Kate mentioned (TYPE=MyIsam to ENGINE=MyIsam), I tried installing again and got this error message:

A fatal MySQL error was encountered.
Query: ALTER TABLE `fanfiction_settings` ADD `anonchallenges` TINYINT( 1 ) NOT NULL
Error: ()

When I tried to go back to my admin panel (before clearing out with phpMyAdmin) I got this:

A fatal MySQL error was encountered.
Query: SELECT count(chalid) FROM fanfiction_challenges
Error: ()

Any help you could provide would be appreciated!

ReplyQuote
Posted : 30/05/2016 7:37 pm
soundspretty
(@soundspretty)
Trusted Member

Do you use a table prefix? The bit of code that calls it may be missing from your challenges files.

ReplyQuote
Posted : 15/06/2016 4:40 pm
Share: