Not logged in. · Lost password · Register
Forum: Customising UNB Modifications and plug-ins RSS
Plugin for donations, user icons
floyd59 #1
Member since Aug 2009 · 3 posts
Group memberships: Members
Show profile · Link to this post
Subject: Plugin for donations, user icons
I run a game community forum with unclassified newsboard, and i'm very happy with it (-> www.gausschannel.com)

To cover the expenses, i have added a donation button to the navigation (by directly adding the paypal javascript code to the _head.html page). Now, to polish this a bit, i have some questions.

  • Extending the navigation in the _head.html file seems unelegant, would there be a better way?
  • I would like to add a small icon before the name of users who have donated. To do this, i plan to do some things in the board:
    • I need to store additional user information (amount and date of donation) in the user table
    • In all places where the username is displayed, the donor icon should show up. Is this best done with a variable in the template file and a corresponding handler. Is there any information on how to do this? Ideal would be a way of extending the IUser class with a get method GetUserIcon(user id=0) or so, which would be called by a handler.

If you have any tipps or design-papers on how to implement this as a plugin without breaking the clean design of the newsboard, i would be grateful.
Avatar
Yves (Administrator) #2
User title: UNB developer & webmaster
Member since Jan 2004 · 3814 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
You can use the "navlinks" plug-in from the extra/ directory to add navigation items without altering existing code. That plug-in is a template that you need to customise (i.e. rename and put that JavaScript into it) before using it.

Sorry, I never thought about doing such thing as your second question. I guess you won't be able to do it without altering the code in its present form. You can always add columns to the database table and add fields and get/set methods to the class, it won't interfere with the existing code. But right now I'm not aware of a central function to generate and display user names and links. You'd probably have to find all code places for that. And I'd recommend you to create a patch file when you're finished so that you can easily apply your changes to future UNB versions.
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
floyd59 #3
Member since Aug 2009 · 3 posts
Group memberships: Members
Show profile · Link to this post
Yves, thank you for your reply. Could you point me to the code  pieces where the information from the user object is applied to the template file? I reckon the best place would be extend the template handler using a plugin (if possible), and add the new fields to adapted templates.
Avatar
Yves (Administrator) #4
User title: UNB developer & webmaster
Member since Jan 2004 · 3814 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Did you mean the code places where user information (user names, links to profiles etc.) are displayed into templates? I'd have to scan through the entire code to tell you, too. I don't think that there's a common way to render user names/links. They can be different every time. Besides posts, for example, they're in a larger font. And in the members list, you'd probably display such icons in a column instead of directly with the user name.
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
floyd59 #5
Member since Aug 2009 · 3 posts
Group memberships: Members
Show profile · Link to this post
Thanks for the reply. i'll start with posts and then see on to members list.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
This board is powered by the Unclassified NewsBoard software, 20110527-dev, © 2003-2011 by Yves Goergen
Page created in 222.8 ms (108.6 ms) · 62 database queries in 153.3 ms
Current time: 2012-02-08, 08:57:09 (UTC +01:00)