DragonPrime - LoGD Resource Community
Welcome Guest
  • Good afternoon, Guest.
    Please log in, or register.
  • January 23, 2018, 03:31:55 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: Achievements  (Read 4774 times)
0 Members and 1 Guest are viewing this topic.
GenmaC
Moderator
Codemeister
*****
Offline Offline

Posts: 430

Coder


View Profile WWW
« on: December 02, 2009, 02:10:58 PM »

This module adds an achievements section to each player bio.

You can add achievements in two ways:

1.  By require_once("modules/achievements/add.php") in your own module and then calling this function:
achievements_add("title of achievement","description of achievement",$acctid);

Where acctid is the acctid of the player you wish to add.  You can also leave off acctid entirely and the function will assume you are referring to the currently active player.

2.  By going to the superuser grotto and accessing the achievements section, where you can manually enter any achievement you wish for any of your players.

Settings:
Only one setting, the name of the module.  I use "achievements" but you might want "awards" or something.

Things to fix in the future:
Players listed in the grotto have color codes in their name (does not affect preformance)
« Last Edit: December 02, 2009, 02:13:51 PM by GenmaC » Logged



Castle Siege - a work in progress
Kojoki
Militia
**
Offline Offline

Posts: 10



View Profile
« Reply #1 on: December 02, 2009, 02:21:58 PM »

Thats nice to have a new thing added to the module Good Job!
Logged
Aeolus
Mod God
*****
Offline Offline

Posts: 1819


You're welcome.


View Profile WWW
« Reply #2 on: May 06, 2012, 07:19:17 AM »

Modified/debugged this module (attached).

1, Changed database calls of account's 'name' to 'login' for drop-down menu when granting and listed drop-down menu in alphabetical order, for easier and tidier sorting,

2, Changed Actions/Player/Title/Description header row to bold (for easier viewing),

3, For players who are listed in editor that have achievements- colour codes in their names are visible, instead of the colour codes as plain text (as listed in original post's Things to fix in the future),

4, Fixing of "Delete" button, used to delete achievements, so that editor is not redirected to badnav.php,

Code:
// FOUND:
rawoutput("<tr><td><a href=runmodule.php?module=achievements&op=su&op2=del&id={$row['ID']}>Delete</a></td>");
rawoutput("<td>$pname</td><td>{$row['title']}</td><td>{$row['description']}</td></tr>");

// REPLACED WITH:
rawoutput("<tr><td><a href=runmodule.php?module=achievements&op=su&op2=del&id={$row['ID']}>Delete</a></td><td>");
output("%s`0", $pname); // Colour codes rendered visible
rawoutput("</td><td>{$row['title']}</td><td>{$row['description']}</td></tr>");
addnav("", "runmodule.php?module=achievements&op=su&op2=del&id={$row['ID']}"); // Removal of redirection to badnav.php
« Last Edit: May 08, 2012, 09:38:37 AM by Aeolus » Logged

Boris735
Mod God
*****
Offline Offline

Posts: 569


View Profile
« Reply #3 on: May 06, 2012, 11:23:18 PM »

4, Fixing of "Delete" button, used to delete achievements, so that editor is not redirected to badnav.php,

Code:
// FOUND:
rawoutput("<tr><td><a href=runmodule.php?module=achievements&op=su&op2=del&id={$row['ID']}>Delete</a></td>");
rawoutput("<td>$pname</td><td>{$row['title']}</td><td>{$row['description']}</td></tr>");

// REPLACED WITH:
rawoutput("<tr><td><a href=runmodule.php?module=achievements&op=su&op2=del&id={$row['ID']}>Delete</a></td><td>");
output($pname); // Colour codes rendered visible
rawoutput("</td><td>{$row['title']}</td><td>{$row['description']}</td></tr>");
addnav("", "runmodule.php?module=achievements&op=su&op2=del&id={$row['ID']}"); // Removal of redirection to badnav.php

(Apologies for the large quoting.)  When mixing HTML output (i.e., calls to rawoutput()) and "normal" output (calls to output()), you need to go a little further, as otherwise you'll end up with broken HTML and possibly undesirable results.  The calls to rawoutput() must be preceded by a call to output("`0") or similar in order to clear the span stack.  Thus the above would be better off as:

Code:
rawoutput("<tr><td><a href=runmodule.php?module=achievements&op=su&op2=del&id={$row['ID']}>Delete</a></td><td>");
output("%s`0", $pname); // Colour codes rendered visible
rawoutput("</td><td>{$row['title']}</td><td>{$row['description']}</td></tr>");
addnav("", "runmodule.php?module=achievements&op=su&op2=del&id={$row['ID']}"); // Removal of redirection to badnav.php

Additionally, there should be a call to output("`0") before the opening <table> is output.
Logged
Aeolus
Mod God
*****
Offline Offline

Posts: 1819


You're welcome.


View Profile WWW
« Reply #4 on: May 06, 2012, 11:49:25 PM »

Fixed! ^^
Logged

!Aiden
Captain of the Guard
***
Offline Offline

Posts: 105


Lacking..?


View Profile WWW
« Reply #5 on: May 08, 2012, 07:09:53 PM »

For a future update.

I'd be nice if someone could add the rainbow text as the font or something which can be change-able via a function in the su_options.

Also - Is there a special installing order? Or directory? I'm getting a missing function error.
Logged
Nightborn
Captain of the Guard
***
Offline Offline

Posts: 206


View Profile WWW
« Reply #6 on: May 14, 2012, 06:11:15 AM »

I'll check this module out after Diablo 3 - as I will use possible Achievements too (long time motivation for players).

Though I think I will re-write it.
Logged
!Aiden
Captain of the Guard
***
Offline Offline

Posts: 105


Lacking..?


View Profile WWW
« Reply #7 on: May 14, 2012, 12:49:30 PM »

I'll check this module out after Diablo 3 - as I will use possible Achievements too (long time motivation for players).

Though I think I will re-write it.

Possible to make it so players can create their own achievements via a user pref, then go through staff approval like the avatar modules?

This way staff would not have to go into each user's thing and ideally write the achievements themselves.
Logged
Loscil Derails
Militia
**
Offline Offline

Posts: 51



View Profile
« Reply #8 on: July 14, 2012, 08:41:56 PM »

Deleting an achievement appears to cause a badnav for some reason, and the achievement is never deleted.
Logged

Your specimen is being processed...
Aeolus
Mod God
*****
Offline Offline

Posts: 1819


You're welcome.


View Profile WWW
« Reply #9 on: July 14, 2012, 09:51:04 PM »

Deleting an achievement appears to cause a badnav for some reason, and the achievement is never deleted.

http://dragonprime.net/index.php?topic=10752.msg100536#msg100536

DragonPrime: Reading is FUNdamental (Ta, Hunter. xD)
« Last Edit: July 14, 2012, 09:53:36 PM by Aeolus » Logged

Loscil Derails
Militia
**
Offline Offline

Posts: 51



View Profile
« Reply #10 on: July 15, 2012, 11:17:15 AM »

Deleting an achievement appears to cause a badnav for some reason, and the achievement is never deleted.

http://dragonprime.net/index.php?topic=10752.msg100536#msg100536

DragonPrime: Reading is FUNdamental (Ta, Hunter. xD)

Whoops ._.;
Thanks, yeah, that fixed it.
* crawls over to the corner of shame*
Logged

Your specimen is being processed...
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Please take the time to read the FAQ and browse the DragonPedia

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
29 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search