Progession Awards

Post Reply
User avatar
Lasarian
Lord
Lord
Posts: 1819
Joined: Wed Aug 15, 2012 11:38 am
Realm: TableTop
House: Griffon
Location: Holyoke, MA

Progession Awards

Post by Lasarian »

Little glitch with awards like the Forum Ribbon that have multiple variants and are likely to be awarded to the same person more than once, the display on the shadowbox looks for the award number in the member's field and apparently when it comes across the first number is just happy with that and stops, so I had to go into the database and remove the first version of the ribbon in Talo and Tundrra's award fields.

Just FYI, I think this is a simple fix I just have to get to it.
Lasarian
*NOR/LE • NOMAD
User avatar
Tundrra
Lord
Lord
Posts: 3808
Joined: Sun Jul 15, 2012 10:05 am
Realm: Black Desert Online
House: Griffon
Record: http://newoutriders.org/wiki/index.php?title=Tundrra
http://newoutriders.org/member/Tundrra
Lord HC 04.06.2014
Squired SWG 03.21.2004
Recruited SWG 12.12.2003 by Baron Brambt
Location: Bloomington, IN

Re: Progession Awards

Post by Tundrra »

I have not look at the code or anything so I'm just blowing smoke.

If the award is looking at a recordset and filtering just forum_post_awards, by default it would order by lowest to highest awarded. If that's the case adding a DESC onto the end of the query so it showed you the highest post award first that is currently being assigned to the playerID.
Image
Tundrra TT:TableTop
*NOR/LD-High Council
User avatar
Lasarian
Lord
Lord
Posts: 1819
Joined: Wed Aug 15, 2012 11:38 am
Realm: TableTop
House: Griffon
Location: Holyoke, MA

Re: Progession Awards

Post by Lasarian »

Tundrra wrote:I have not look at the code or anything so I'm just blowing smoke.

If the award is looking at a recordset and filtering just forum_post_awards, by default it would order by lowest to highest awarded. If that's the case adding a DESC onto the end of the query so it showed you the highest post award first that is currently being assigned to the playerID.
Would I accomplish the same objective if I just renumbered the awards to make the most recent one a lower number than the previous?
Lasarian
*NOR/LE • NOMAD
User avatar
Tundrra
Lord
Lord
Posts: 3808
Joined: Sun Jul 15, 2012 10:05 am
Realm: Black Desert Online
House: Griffon
Record: http://newoutriders.org/wiki/index.php?title=Tundrra
http://newoutriders.org/member/Tundrra
Lord HC 04.06.2014
Squired SWG 03.21.2004
Recruited SWG 12.12.2003 by Baron Brambt
Location: Bloomington, IN

Re: Progession Awards

Post by Tundrra »

Lasarian wrote:
Tundrra wrote:I have not look at the code or anything so I'm just blowing smoke.

If the award is looking at a recordset and filtering just forum_post_awards, by default it would order by lowest to highest awarded. If that's the case adding a DESC onto the end of the query so it showed you the highest post award first that is currently being assigned to the playerID.
Would I accomplish the same objective if I just renumbered the awards to make the most recent one a lower number than the previous?
Yes I imagine so:)
Image
Tundrra TT:TableTop
*NOR/LD-High Council
User avatar
Tundrra
Lord
Lord
Posts: 3808
Joined: Sun Jul 15, 2012 10:05 am
Realm: Black Desert Online
House: Griffon
Record: http://newoutriders.org/wiki/index.php?title=Tundrra
http://newoutriders.org/member/Tundrra
Lord HC 04.06.2014
Squired SWG 03.21.2004
Recruited SWG 12.12.2003 by Baron Brambt
Location: Bloomington, IN

Re: Progession Awards

Post by Tundrra »

How ever if you change the award_id any member who has received one of those award IDs you change could be effected.
Image
Tundrra TT:TableTop
*NOR/LD-High Council
User avatar
Lasarian
Lord
Lord
Posts: 1819
Joined: Wed Aug 15, 2012 11:38 am
Realm: TableTop
House: Griffon
Location: Holyoke, MA

Re: Progession Awards

Post by Lasarian »

Code: Select all

					<?php if(in_array('9', $awardArray)): ?>
						<img src="../modules/image.php?width=75&image=/images/awards/award_1000_Posts.png" align="center" title="Forum Ribbon: 1,000">
					<?php elseif(in_array('24', $awardArray)): ?>
						<img src="../modules/image.php?width=75&image=/images/awards/award_2500_Posts.png" align="center" title="Forum Ribbon: 2,500">
					<?php elseif(in_array('27', $awardArray)): ?>
						<img src="../modules/image.php?width=75&image=/images/awards/award_5000_Posts.png" align="center" title="Forum Ribbon: 5,000">
					<?php elseif(in_array('28', $awardArray)): ?>
						<img src="../modules/image.php?width=75&image=/images/awards/award_10000_Posts.png" align="center" title="Forum Ribbon: 10,000">
					<?php endif; ?>			
This is controlled by the public function here:

Code: Select all

    public function loadAward($id){
		global $Database, $Utilities;

		//Clean the username
		$awardID = $Utilities->clean($id, 'sql');
		return $Database->query_first("SELECT * FROM awards WHERE id = '$awardID'");
    }
So you are saying I could add the DESC at the end of the query in the public function above?

Like this?

Code: Select all

return $Database->query_first("SELECT * FROM awards WHERE id = '$awardID' DESC");
Lasarian
*NOR/LE • NOMAD
User avatar
Tundrra
Lord
Lord
Posts: 3808
Joined: Sun Jul 15, 2012 10:05 am
Realm: Black Desert Online
House: Griffon
Record: http://newoutriders.org/wiki/index.php?title=Tundrra
http://newoutriders.org/member/Tundrra
Lord HC 04.06.2014
Squired SWG 03.21.2004
Recruited SWG 12.12.2003 by Baron Brambt
Location: Bloomington, IN

Re: Progession Awards

Post by Tundrra »

The DESC syntax is off a bit, you have to tell it which column you are sorting.

Code: Select all

SELECT * 
FROM awards 
WHERE id = '$award'
ORDER BY awards DESC
Image
Tundrra TT:TableTop
*NOR/LD-High Council
User avatar
Tundrra
Lord
Lord
Posts: 3808
Joined: Sun Jul 15, 2012 10:05 am
Realm: Black Desert Online
House: Griffon
Record: http://newoutriders.org/wiki/index.php?title=Tundrra
http://newoutriders.org/member/Tundrra
Lord HC 04.06.2014
Squired SWG 03.21.2004
Recruited SWG 12.12.2003 by Baron Brambt
Location: Bloomington, IN

Re: Progession Awards

Post by Tundrra »

After re reading your if/then statement you might not need to change the query. I think the if/then statement should look for the highest number '28' first then check the lower ones. You want it to stop on the award with the most posts, so it should look for the highest first.
Image
Tundrra TT:TableTop
*NOR/LD-High Council
User avatar
Lasarian
Lord
Lord
Posts: 1819
Joined: Wed Aug 15, 2012 11:38 am
Realm: TableTop
House: Griffon
Location: Holyoke, MA

Re: Progession Awards

Post by Lasarian »

That's the problem, it's getting to that '9' and appears to stop there.
Lasarian
*NOR/LE • NOMAD
Post Reply

Return to “BUGS!”