News:

Wondering if this will always be free?  See why free is better.

Main Menu

Member Awards (2.0 Compatible!)

Started by Spuds, September 18, 2006, 03:14:03 PM

Previous topic - Next topic

bros

Haha. I should stop trying to rush through things.

Okay. I previously had awards in a realllly old version. Now I go into a profile, and it says:
Awards
This member has a total of 3 awards(s)
This member has not received any awards

Fustrate

Hmm... you installed the new version after you upgraded, correct? It should never give an error like that though. Do the awards still exist in the database?
Steven Hoffman
Former Team Member, 2009-2012

bros

Yep.

I just installed this version of the mod last night. When I was on SMF 1.1.x, I used whatever version was available irght before SMF 2.0 Beta 3 came out

Fustrate

That's really odd... does the member actually have 3 awards or 0?
Steven Hoffman
Former Team Member, 2009-2012

bros


Kosedragen

Okay, I've got one strange contradiction here...

One error I got while trying to make an award said this:
QuoteField 'filename' doesn't have a default value
File: N:\hosted\pokesky\Sources\ManageAwards.php
Line: 322

Then the next error occurred when we tried adding the default value:
Quote#1101 - BLOB/TEXT column 'filename' can't have a default value

Can someone please tell me what this crap is about? o.O It's completely illogical to me..

Fustrate

Are you using 1.1.x or 2.0? I believe I've seen that error before, and there was a fix somewhere for it...
Steven Hoffman
Former Team Member, 2009-2012

Kosedragen


Fustrate

Quote from: YodaOfDarkness on September 27, 2008, 11:57:18 AM
Did the changes get made to your database? Check in phpMyAdmin to see if smf_awards has a row named filename and it has an empty default value

You might actually want to change the default value to the letter a, just to be safe

Try doing that. Let's see if giving it a default value does anything...
Steven Hoffman
Former Team Member, 2009-2012

Kosedragen

Nope, it did not =/ We got this:
QuoteALTER TABLE `smf_awards` CHANGE `filename` `filename` TINYTEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT 'a'

MySQL said:
#1101 - BLOB/TEXT column 'filename' can't have a default value

Fustrate

#850
ManageAwards.php, find:
$addAward = db_query("
INSERT INTO {$db_prefix}awards
(awardName, gameName, timeAdded)
VALUES
('$_REQUEST[awardName]', '$_REQUEST[gameName]', $timeAdded)", __FILE__, __LINE__);

replace with
$addAward = db_query("
INSERT INTO {$db_prefix}awards
(awardName, gameName, timeAdded, filename)
VALUES
('$_REQUEST[awardName]', '$_REQUEST[gameName]', $timeAdded, 'temp')", __FILE__, __LINE__);
Steven Hoffman
Former Team Member, 2009-2012

Kosedragen

It worked! Holy crap, you're the best : D Many thanks!

Fustrate

Quote from: Kosedragen on October 04, 2008, 06:24:03 PM
It worked! Holy crap, you're the best : D Many thanks!

* YodaOfDarkness basks in the glory :D
Steven Hoffman
Former Team Member, 2009-2012

Kosedragen

#853
Hehe ^^; The solution was fine, but  we have a recurring problem with duplicates.. When we de-installed it once; the awards buttons did not disappear, so when we reinstalled it we suddenly sat there with two award icons under our avatars and simultaneously lost our ability to view profiles D: Also; when I de-installed it now, the last time, we still have the awards section in our profiles and on the admin panel o.o

EDIT: And the thing under out avatars is still there. When I try to reinstall the mod we'll end up with the same problems as earlier ><

Fustrate

You'll have to go through the files and find the duplicate code, and delete one of them.

index.php

/Sources/Display.php
/Sources/Profile.php
/Sources/Admin.php
/Sources/Load.php
/Sources/ManagePermissions.php

Themes/default/index.template.php
Themes/default/Profile.template.php
Themes/default/Display.template.php
Themes/default/Admin.template.php

I don't know if that's all, but it's what I can think of. Language files don't matter :)
Steven Hoffman
Former Team Member, 2009-2012

Kosedragen

#855
Thanks ^^ I'll go through it in FTP and report back if something is amiss, or hail you even more if everything goes according to plan O=

EDIT: Err, wait, you want me to go through all that code in order to find what exactly? o.O

Fustrate

search for the word 'awards' and delete any duplicated code.
Steven Hoffman
Former Team Member, 2009-2012

Kosedragen

#857
Oh, yeah x3 That'll be easy now that I upgraded notepad.

EDIT: Great ^^ I managed to get rid of most award-things without even breaking the forum : D

But the award-button in the admin panel under "mods" is still not gone D: I removed every instance of "award" in the admin.php and admin.template.php. It only sends me back to the forum-board though..

Fustrate

/Sources/Subs.php, search for
// Category for admin panel.  Pogo Awards
Steven Hoffman
Former Team Member, 2009-2012

Kosedragen

#859
Hooray, now everything works : D I reinstalled the mods and it works perfectly...

EXCEPT, and with me except seems to be constant, that I can't view the awards attached images ^^;

I added name, comment and image, but all I got was that you can see on the image >< I got the grey line under "edit awards" >:

Advertisement: