Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product

Ready to contribute?

Amazing! Sign our contributors' agreement and then join us on GitHub.

Update for critical security issue in PHPMailer included in release Vanilla 2.3.1
Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.


This discussion is related to the UserAward addon.
SubJunkSubJunk ✭✭
edited June 2008 in Vanilla 1.0 Help


  • if i enable this extension i get this popup (when the loader gif apears)

    // UserAward Table Structure $DatabaseTables['UserAward'] = 'UserAward'; $DatabaseColumns['UserAward']['AwardID'] = 'AwardID'; $DatabaseColumns['UserAward']['UserID'] = 'UserID'; $DatabaseColumns['UserAward']['Award'] = 'Award'; $DatabaseColumns['UserAward']['Notes'] = 'Notes'; $DatabaseColumns['UserAward']['AwardedBy'] = 'AwardedBy'; $DatabaseColumns['UserAward']['DateAwarded'] = 'DateAwarded'; $DatabaseColumns['UserAward']['ShowMessage'] = 'ShowMessage'; ?>UserAward

    other than that it doesnt work for me.
    btw. i have the newest vanilla release.

    thx :)
  • Uploaded version 0.2 Beta of UserAward.
  • fery: I have not been able to reproduce your problem but have made a few small changes to the source code.
    Does the above code appear as soon as you try to 'Enable' the extension?
    Can you let me know how you get on with this version (0.2 beta)?

    Anyone else getting this problem?

  • I installed (0.2beta) , got errors, un-installed and now when I logout I see this at the top of the login screen:
    // UserAward Table Structure $DatabaseTables['UserAward'] = 'UserAward'; $DatabaseColumns['UserAward']['AwardID'] = 'AwardID'; $DatabaseColumns['UserAward']['UserID'] = 'UserID'; $DatabaseColumns['UserAward']['Award'] = 'Award'; $DatabaseColumns['UserAward']['Notes'] = 'Notes'; $DatabaseColumns['UserAward']['AwardedBy'] = 'AwardedBy'; $DatabaseColumns['UserAward']['DateAwarded'] = 'DateAwarded'; $DatabaseColumns['UserAward']['ShowMessage'] = 'ShowMessage'; ?>

    Where the heck is this coming from and how do I get rid of it?
  • Looks like your conf/database.php file has messed up. Check it out.
  • Thanks, yeah conf/database.php had the UserAward stuff added after the php close tag (%>) which was causing the error. Deleted and everything is back to normal.
  • so if i dont want to tweak around like silly, i should better wait for the next version of this extension to get a plug and play-ready extension?

    how are the options actually? :D
  • Skube and fery: Sorry that you guys have had a problem.

    UserAward adds the above lines to conf/database.php using the Vanilla function 'AppendToConfigurationFile' as do several other extensions such as 'Thankful People'. Seems like there might be a problem with 'AppendToConfigurationFile'.

    skube: Are you using ASP-style <% %> tags?

    I've seen another way of achieving the same thing without having to add anything to database.php. I'll check it out and upload a new version.
  • Uploaded version 0.3 Beta of UserAward.
  • Version 0.3 Beta no longer adds any lines to the conf/database.php file so should avoid the problem some users were having with this file becoming 'corrupted'.

    If you have installed an earlier version please edit your conf/database.php file to remove the following lines:

    // UserAward Table Structure $DatabaseTables['UserAward'] = 'UserAward'; $DatabaseColumns['UserAward']['AwardID'] = 'AwardID'; $DatabaseColumns['UserAward']['UserID'] = 'UserID'; $DatabaseColumns['UserAward']['Award'] = 'Award'; $DatabaseColumns['UserAward']['Notes'] = 'Notes'; $DatabaseColumns['UserAward']['AwardedBy'] = 'AwardedBy'; $DatabaseColumns['UserAward']['DateAwarded'] = 'DateAwarded'; $DatabaseColumns['UserAward']['ShowMessage'] = 'ShowMessage';
  • I get this Fatal error: Call to undefined function Redirect() in /usr/www/users/me/vanilla/extensions/UserAward/default.php on line 315

    My version of Vanilla hasn't been updated in 50 days...
  • Mark W: UserAward requires the latest version of Vanilla (Redirect was introduced in v1.1.3).

    UserAward requires version 1.1.4 or later.
  • i have the same error as mark W except that mine is on Line 400.

    I have just installed a new version - v1.1.4 - and added the extension.

    Any ideas?

    To expand a bit ... I installed v1.1.4, installed UserAwards, activated it.
    To set an award I click the user name and in the panel is a "make an award" link, I set this as normal, click save and then get the error.
    If I then click back button and refresh, the award is awarded.

    Update 2 - I just noticed the updated version 0.3, installed that, and now I get the error on the same line as Mark W.
  • Works great for me, superb extra - thanks!
  • Digilee:

    AFAIK Redirect was introduced in version 1.1.2 of Vanilla. If you check:


    you should find it on line 688.

    If this file does not contain the function for 'Redirect' then you need to check that you do have all the latest files for Vanilla 1.1.4.
    If it does contain this function please let me know.
  • ok it works now for me, very good job mightymango, i really like it.
    but what can i do to get rid of the star icon, and the icon next to the username in those comments (forum)?

    thanks a lot :)

    ps: a "add award" - text button would be great , not in the panel, more the self guiding way right above the addon (#AcountHistory) like the userwall addon.
  • I'm working on the next version which will include an option to:

    Make awards public (i.e. display to everyone not just the user)
    Turn display of awards on 'Discussion' page on or off
    Turn display of awards on 'Comments' page on or off
    Hide awards from 'Guests'

    The next version will also include an option to create, edit and delete new award types.

    Like the idea of a button on the 'Account' page. I also plan to put a 'Make an award' link next to each comment.
  • Uploaded version 0.5 Beta of UserAward.
  • The latest version includes the options listed above but does not yet include the option to create, edit and delete different award types.
  • I'm really liking where this extension is going.

    I keep getting this when I add or delete an award:
    Fatal error: Call to undefined function redirect() in /home/.batzi/cbabas/ on line 365

    I'm on 1.1.4 and I'm using 0.5.

    It does actually create or remove the award, it just doesn't want to jump back to the correct page.

    Is there quick way you could explain how to add, edit or delete awards in the code before you build in-Vanilla functionality for it?
  • bmw I keep getting this when I add or delete an award:
    Fatal error: Call to undefined function redirect() in /home/.batzi/cbabas/ on line 365
    bmw: You are not the first to report this problem with redirect().

    This function is built into Vanilla and should be available in the version you are running. Can you check the following file for me please:


    The redirect() function should be on about line 688.
  • I have almost finished the code for creating and editing award types. It should be available in the next few days.

    In the meantime if you wish to create your own award types your will need to edit the awards.php file:

    // UserAward Awards $Context->UserAwardAwards = array(); $Context->UserAwardAwards['Number'] = 3; $Context->UserAwardAwards['Title'][1] = 'Gold'; $Context->UserAwardAwards['Icon'][1] = '1.png'; $Context->UserAwardAwards['Title'][2] = 'Silver'; $Context->UserAwardAwards['Icon'][2] = '2.png'; $Context->UserAwardAwards['Title'][3] = 'Bronze'; $Context->UserAwardAwards['Icon'][3] = '3.png';

    You might wish to change it to something like:

    // UserAward Awards $Context->UserAwardAwards = array(); $Context->UserAwardAwards['Number'] = 2; $Context->UserAwardAwards['Title'][1] = 'Smile'; $Context->UserAwardAwards['Icon'][1] = 'smile.png'; $Context->UserAwardAwards['Title'][2] = 'Wink'; $Context->UserAwardAwards['Icon'][2] = 'wink.jpg';

    In this example the image files (smile.png and wink.jpg) will have to be copied to the 'icons' folder.

    If you wish to use a different 'icon' for display on the 'Discussion' page just replace the 'star.png' file in the 'icons' folder (it must be called star.png though).

    Hope this makes sense.
  • Ha ha! I had found that, and thought it didn't work. *Now* I see that I missed:$Context->UserAwardAwards['Number'] = 3;(duh.)

    No wonder Award #4 didn't show up in the options list.

    I'll check the Framework later and let you know.
  • That's odd, redirect() is not there. I must have messed up when I updated Vanilla way back when. The files in the directory all date from 4/7/2007.

    Looks like my fault. Thanks for the help! :)

    Re-did my upgrade, and no issues now. Thanks for pointing that out.
  • Just a thought, why not add something like a UserAwardAwards['MiniIcon'] and just set them all to star.png for the default files?
  • OK. This is getting silly now.
    I have vanilla 1.1.4 installed as a new install
    User Awards was working for me before but with the redirect error, so I uninstalled it.
    Now I update to 0.5 beta and get this error:

    Error Message
    An error occurred while retrieving data.
    Affected Elements

    The error occurred on or near: Table 'DATABASE.LUM_UserAward' doesn't exist

    Which renders the forum unusable.
    Turning UA off brings everything back to normal.
  • Sounds like UserAward was only partly removed from your system.

    To force UserAward to recreate the database table remove the following line from conf/settings.php:

    $Configuration['USERAWARD_VERSION'] = '1.0';

    and then re-enable UserAward.
Sign In or Register to comment.