Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Yet Another Awards System 2.1.4 Details »»
Yet Another Awards System 2.1.4
Version: 2.1.4, by mtha mtha is offline
Developer Last Online: May 2016 Show Printable Version Email this Page

Category: Major Additions - Version: 3.6.5 Rating:
Released: 03-18-2007 Last Update: 03-24-2007 Installs: 748
DB Changes Uses Plugins Template Edits
Re-useable Code Additional Files Translations Is in Beta Stage  
No support by the author.

Yet Another Award System 2.1.4 ? by HacNho
Copyright (C) 2005 by HacNho, All rights reserved.


Hack Version: 2.1.4.070324
Compatible vB version: 3.6.x
Support: https://vborg.vbsupport.ru/showthread.php?t=142487

for vBulletin 3.5.x:
https://vborg.vbsupport.ru/showthread.php?t=94836
For vBulletin 3.0.x, please check the other version:
https://vborg.vbsupport.ru/showthread.php?t=78934

DESCRIPTION:
This is a Medals/Awards system. Admin can give members awards, and award icons will be displayed in member's profile, posts, as well as in a award list.

FEATURES:
In AdminCP
- Can Create/Edit/Delete/Reorder categories/sub-categories in ACP (with category name and description)
- Can Create/Edit/Delete awards in ACP (with Award Name, Description, Icon URL, Image URL)
- Can Move one (or all) award(s) from one category to another
- Can set some awards un-classified (not displayed for public)
- Can re-order awards in awards showcase
+ Issue awards to members, based on username or userid, with Issue Reason
+ Remove awards from members
- [1.2] Options to set number of awards displayed in postbit
- [1.2] Options to turn on/off showing award icon, images, award requests in awards list, awards icons in memberlist
- [2.1.3] Notify awarded user by PM/email
- [2.1.4] Option to turn on/off Award System in ModCP

In ModCP

+ Issue awards to members, based on username or userid, with Issue Reason
+ Remove awards from members

Front page

- Display awards list in with: Award Name, Description, Icon, Image, and Members who get each award.
- Display awards showcase in profile, with Award information, Issue time and reason
- Display award icons in postbit (showthread, showpost, announcement, private)
[1.2] Display limit awards in postbit, with total awards, and a link to awards showcase in member profiles.
[1.2] Award request, link to a form sending to email/PM/new thead or post (based on Dr Erwin Loh's Form hack)
[1.2] Display award on Memberlist page (by trulylowcarb)

CHANGES/MODIFICATION:
- Tables to add: 3 (award, award_user, award_cat)
- Files to add: 4 (/awards.php, /award_request.php, /admincp/award.php, /admincp/award_cat.php)
- Files to edit: 8 (/admincp/index.php, member.php, showthread.php, showpost.php, announcement.php, private.php, memberlist.php, /include/functions_online.php)
- Templates to edit: 5 (MEMBERINFO, postbit, postbit_legacy, memberlist, memberlist_resultsbit )

DIFFICULTY:
Easy
Time: about 5 minutes
Installer is included (1 product XML)


CREDIT:

Idea has been carried on by many people, here are some:
- Lesane for original Award hack for vB2, eventhough I've never use his hack
- AnimeWebby for Awards/ Medals/ Cards Hack [vB3], which I write new code based on his.
- Mac ycl6 for phpBB Medal System for phpBB forum
- Dr Erwin Loh for FORM TO THREAD/ FORUM/ PM/ EMAIL hack
- and all others for supports and ideas

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #652  
Old 10-02-2008, 04:45 PM
SVTCobraLTD SVTCobraLTD is offline
 
Join Date: Jul 2007
Location: PA
Posts: 841
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by letsjoy View Post
Please launch for 3.7+...we will be thank ful
One page back had this... https://vborg.vbsupport.ru/showthread.php?p=1594424
Reply With Quote
  #653  
Old 10-10-2008, 10:34 AM
saviola8x's Avatar
saviola8x saviola8x is offline
 
Join Date: May 2006
Location: Paris
Posts: 195
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Mark as Installed.
Reply With Quote
  #654  
Old 10-31-2008, 04:06 PM
Jelmertjee Jelmertjee is offline
 
Join Date: Oct 2006
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I wasn't really satisfied with the postbit awards position so decided to add one manually myself, it looks like this:



How can you do it?

1. open the postbit template and add a new hook where you want the awards, in my case it was the <td> between the left and right of the userinfo, for me it looked like this:

Code:
<td width="100%">$template_hook[postbit_userinfo_center]</td>
Such a hook is just an identifier for all sorts of plugins so they can add stuff to templates automatically, now we need to tell our plugin to use this new hook.

2. in your admincp go into plugins, under awards open YAAS in Posbit

Now replace:
Code:
			{
				eval('$template_hook[\'postbit_userinfo_right\'] .= "' . fetch_template('awards_postbit_display') . '";');
			}
with:
Code:
			{
				eval('$template_hook[\'postbit_userinfo_center\'] .= "' . fetch_template('awards_postbit_display') . '";');
			}
I'm assuming you're using the default position in your award settings (admincp), we're basically changing it to the hook we've just made in the template, that's all.

I also added some custom css to better style this, first open the template awards_postbit_display, I've changed it like this, adding a div with a class around it to get some css control:

HTML Code:
<!-- show awards -->
<if condition="$post[showuserawards]">
<div class="postbit_awards">
<fieldset><legend><a href="member.php?u=$post[userid]&tab=myawards" title="$vbphrase[more_awards]">$vbphrase[award_showcase]</a></legend>
<div>
$post[userawards]
<br>
<a href="member.php?u=$post[userid]&tab=myawards" title="$vbphrase[more_awards]">$vbphrase[total_awards]</a>: $post[num_awards]
</div>
</fieldset>
</div>
</if>
<!-- /show awards -->
Then add this bit of css to your custom css definitions:
HTML Code:
.postbit_awards{float: left}
of course you can adjust this further to your liking, this makes it float to the left instead of the full width, you could also use float:right instead.

This looks a lot better and saves space, hope you like it.
Reply With Quote
  #655  
Old 10-31-2008, 07:12 PM
TheLastSuperman's Avatar
TheLastSuperman TheLastSuperman is offline
Senior Member
 
Join Date: Sep 2008
Location: North Carolina
Posts: 5,844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Jelmertjee View Post
I wasn't really satisfied with the postbit awards position so decided to add one manually myself, it looks like this:



How can you do it?

1. open the postbit template and add a new hook where you want the awards, in my case it was the <td> between the left and right of the userinfo, for me it looked like this:

Code:
<td width="100%">$template_hook[postbit_userinfo_center]</td>
Such a hook is just an identifier for all sorts of plugins so they can add stuff to templates automatically, now we need to tell our plugin to use this new hook.

2. in your admincp go into plugins, under awards open YAAS in Posbit

Now replace:
Code:
			{
				eval('$template_hook[\'postbit_userinfo_right\'] .= "' . fetch_template('awards_postbit_display') . '";');
			}
with:
Code:
			{
				eval('$template_hook[\'postbit_userinfo_center\'] .= "' . fetch_template('awards_postbit_display') . '";');
			}
I'm assuming you're using the default position in your award settings (admincp), we're basically changing it to the hook we've just made in the template, that's all.

I also added some custom css to better style this, first open the template awards_postbit_display, I've changed it like this, adding a div with a class around it to get some css control:

HTML Code:
<!-- show awards -->
<if condition="$post[showuserawards]">
<div class="postbit_awards">
<fieldset><legend><a href="member.php?u=$post[userid]&tab=myawards" title="$vbphrase[more_awards]">$vbphrase[award_showcase]</a></legend>
<div>
$post[userawards]
<br>
<a href="member.php?u=$post[userid]&tab=myawards" title="$vbphrase[more_awards]">$vbphrase[total_awards]</a>: $post[num_awards]
</div>
</fieldset>
</div>
</if>
<!-- /show awards -->
Then add this bit of css to your custom css definitions:
HTML Code:
.postbit_awards{float: left}
of course you can adjust this further to your liking, this makes it float to the left instead of the full width, you could also use float:right instead.

This looks a lot better and saves space, hope you like it.
AND... you know you can remove the border and text and display just the image right

See here for a similar code reference --> https://vborg.vbsupport.ru/showpost....57&postcount=3

So basically the Rank or in this mods case.. Awards would be displayed just as the images themselves and between your guns image and your name!
Reply With Quote
  #656  
Old 10-31-2008, 07:13 PM
TheLastSuperman's Avatar
TheLastSuperman TheLastSuperman is offline
Senior Member
 
Join Date: Sep 2008
Location: North Carolina
Posts: 5,844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by gamerfu View Post
Make this suggestion for the YAAS 4.0. Very nice suggestion. I have this delima too.
Hmmmmm, nice suggestion.... I'll look into this for the Rank mod I support and get back to ya as I will add it into my Award Mod when I do!
Reply With Quote
  #657  
Old 11-09-2008, 03:26 PM
bluesoul's Avatar
bluesoul bluesoul is offline
 
Join Date: Jul 2004
Location: Paducah, KY USA
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry for not perusing the entire thread but is there a simple way to remove either the icon or image column from being displayed? I don't really need both for what we're using it for.

EDIT: Got it, reading through the settings is pro.
Reply With Quote
  #658  
Old 11-16-2008, 01:45 AM
SVTCobraLTD SVTCobraLTD is offline
 
Join Date: Jul 2007
Location: PA
Posts: 841
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

On 3.6.11 I try and give an award but the keeps saying
Code:
Content Encoding Error         

The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.        

The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.

    * Please contact the website owners to inform them of this problem.
when trying to access "http://sitename.com/forums/admincp/award.php?do=dogiveaward".

Any ideas? I have given away more than 20 awards without any problems. It happens both in firefox and IE.
Reply With Quote
  #659  
Old 01-02-2009, 01:24 PM
home9000 home9000 is offline
 
Join Date: Aug 2005
Posts: 126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Simetrical View Post
This is a nice mod. Unfortunately, it crashed my site when this query was run repeatedly during a period of high load (23 times over, running between 78 and 208 seconds, as of just before I started killing them):
Code:
mysql> EXPLAIN SELECT a.*, au.*, post.userid, post.postid 
    ->                         FROM post AS post
    ->                         INNER JOIN award_user AS au ON (au.userid=post.userid)
    ->                         INNER JOIN award AS a ON (a.award_id=au.award_id)
    ->                         WHERE 1=1 
    -> 
    -> 
    ->                         GROUP BY au.issue_id
    ->                         ORDER BY au.issue_time DESC;
+----+-------------+-------+--------+---------------+---------+---------+-------------------------+-------+---------------------------------+
| id | select_type | table | type   | possible_keys | key     | key_len | ref                     | rows  | Extra                           |
+----+-------------+-------+--------+---------------+---------+---------+-------------------------+-------+---------------------------------+
|  1 | SIMPLE      | au    | ALL    | NULL          | NULL    | NULL    | NULL                    |   117 | Using temporary; Using filesort | 
|  1 | SIMPLE      | a     | eq_ref | PRIMARY       | PRIMARY | 2       | totalwar_vb.au.award_id |     1 | Using where                     | 
|  1 | SIMPLE      | post  | ref    | userid        | userid  | 4       | totalwar_vb.au.userid   | 25005 | Using where                     | 
+----+-------------+-------+--------+---------------+---------+---------+-------------------------+-------+---------------------------------+
3 rows in set (0.00 sec)
While I'm no MySQL expert, it seems that this attempts to copy the entirety of the post table to a temporary table, in my case about 1.5 million rows. I've tracked the query down to the showthread_query hook:
PHP Code:
        // Obtain list of awards for current user
        
$alluserawards =  $db->query_read("
            SELECT a.*, au.*, post.userid, post.postid 
            FROM " 
TABLE_PREFIX "post AS post
            INNER JOIN " 
TABLE_PREFIX "award_user AS au ON (au.userid=post.userid)
            INNER JOIN " 
TABLE_PREFIX "award AS a ON (a.award_id=au.award_id)
            WHERE 1=1 
"
iif((!empty($ids)), "AND post.postid IN (0" $ids ")") ."
"
iif((!empty($cache_postids)), "AND post.postid IN (" $cache_postids ")") ."
            GROUP BY au.issue_id
            
$awardsdisplayorder
        "
);

        while( 
$ua $db->fetch_array($alluserawards))
        {
            
$userawardscache[$ua['userid']][$ua['issue_id']] = $ua;
        }
        
$db->free_result($alluserawards); 
Apparently this fails to account for the possibility that $ids and $cache_postids are both empty. I have no idea why it would or would not be reasonable to account for that, because I don't know what either of those variables is, but at any rate, if they both are empty things are not very good. I've wrapped the whole thing in a conditional checking whether both are empty, just not setting anything if they both are. I'd appreciate any response.
I have the same problem any solution or workaround ?
Reply With Quote
  #660  
Old 01-03-2009, 05:25 PM
home9000 home9000 is offline
 
Join Date: Aug 2005
Posts: 126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Simetrical View Post
This is a nice mod. Unfortunately, it crashed my site when this query was run repeatedly during a period of high load (23 times over, running between 78 and 208 seconds, as of just before I started killing them):
Code:
mysql> EXPLAIN SELECT a.*, au.*, post.userid, post.postid 
    ->                         FROM post AS post
    ->                         INNER JOIN award_user AS au ON (au.userid=post.userid)
    ->                         INNER JOIN award AS a ON (a.award_id=au.award_id)
    ->                         WHERE 1=1 
    -> 
    -> 
    ->                         GROUP BY au.issue_id
    ->                         ORDER BY au.issue_time DESC;
+----+-------------+-------+--------+---------------+---------+---------+-------------------------+-------+---------------------------------+
| id | select_type | table | type   | possible_keys | key     | key_len | ref                     | rows  | Extra                           |
+----+-------------+-------+--------+---------------+---------+---------+-------------------------+-------+---------------------------------+
|  1 | SIMPLE      | au    | ALL    | NULL          | NULL    | NULL    | NULL                    |   117 | Using temporary; Using filesort | 
|  1 | SIMPLE      | a     | eq_ref | PRIMARY       | PRIMARY | 2       | totalwar_vb.au.award_id |     1 | Using where                     | 
|  1 | SIMPLE      | post  | ref    | userid        | userid  | 4       | totalwar_vb.au.userid   | 25005 | Using where                     | 
+----+-------------+-------+--------+---------------+---------+---------+-------------------------+-------+---------------------------------+
3 rows in set (0.00 sec)
While I'm no MySQL expert, it seems that this attempts to copy the entirety of the post table to a temporary table, in my case about 1.5 million rows. I've tracked the query down to the showthread_query hook:
PHP Code:
        // Obtain list of awards for current user
        
$alluserawards =  $db->query_read("
            SELECT a.*, au.*, post.userid, post.postid 
            FROM " 
TABLE_PREFIX "post AS post
            INNER JOIN " 
TABLE_PREFIX "award_user AS au ON (au.userid=post.userid)
            INNER JOIN " 
TABLE_PREFIX "award AS a ON (a.award_id=au.award_id)
            WHERE 1=1 
"
iif((!empty($ids)), "AND post.postid IN (0" $ids ")") ."
"
iif((!empty($cache_postids)), "AND post.postid IN (" $cache_postids ")") ."
            GROUP BY au.issue_id
            
$awardsdisplayorder
        "
);

        while( 
$ua $db->fetch_array($alluserawards))
        {
            
$userawardscache[$ua['userid']][$ua['issue_id']] = $ua;
        }
        
$db->free_result($alluserawards); 
Apparently this fails to account for the possibility that $ids and $cache_postids are both empty. I have no idea why it would or would not be reasonable to account for that, because I don't know what either of those variables is, but at any rate, if they both are empty things are not very good. I've wrapped the whole thing in a conditional checking whether both are empty, just not setting anything if they both are. I'd appreciate any response.
I have to remove this hack because this issue
It's make my site down 10 time per day

I am looking to another hack

Thank for you all
Reply With Quote
  #661  
Old 01-03-2009, 10:24 PM
Tarfandestan Tarfandestan is offline
 
Join Date: Nov 2008
Location: Iran
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi.
Im using this hack for my forum.
but when I give an award to one of users, it doesn't show in his/her posts.
and when I give an award to one of moderators, its correctly add to his/her posts.
what's wrong?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:35 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05774 seconds
  • Memory Usage 2,378KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (9)bbcode_code
  • (4)bbcode_html
  • (2)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete