vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Miscellaneous Hacks - Yet Another Awards System (https://vborg.vbsupport.ru/showthread.php?t=187600)

walshymyster 01-16-2009 04:52 PM

is there any way of having a mass award option. where you can name meltiple people too award it too

Neo_Angelo 01-16-2009 08:30 PM

you should code some new features for this like triggers, i'd love to see this developed more so that users can set automatically given awards when a certain parameter is met (for example a user reaches X posts, a user has logged on X ammount of times) heres a neat little list (ok i lied its rather big) of some triggers us admins would probably want to see (hey maybe even code a feature that will let us invent our own and share them):

User reaches X posts
User has been a member for X days/months/years
User has logged in X ammount of times
User has viewed a certain page
User has edited a certain field in their profile
User has gained X ammount of rep (+ive and -ive)
User has left a comment on someones profile
User has donated X (or bought subscription)
User has been promoted to new usergroup
User has X ammount of buddies/friends

i can probably think of tonnes more. if these were available i'm sure this mod would go far i'm pretty sure people would pay for features like this added.

Nadavy 01-17-2009 12:59 AM

I agree with the above post. We should have the option of setting it up so whenever somebody reaches a certian postcount, and has been registered for a certain time length, their old badge dissapears and they get the new updated one.

rex_b 01-19-2009 06:54 PM

What is the code to manually edit my postbit template to add this. As I'm on a custom skin..

Breakpoint 01-20-2009 02:31 AM

How can I turn the texts that says "awards" in my forum to "Trophies"?

Just the text, dont need to turn any of the files names.

Del_Boy 01-21-2009 09:04 AM

Hi,

I looked at installing this but there are files with the same name etc and i am not sure where to upload them to...

I followed a previous versions install but there are a few extra files in the latest version, can someone please tell me where these go?

Galex55 01-21-2009 02:02 PM

WOOT nice! :D

Del_Boy 01-21-2009 02:06 PM

Quote:

Originally Posted by Galex55 (Post 1720135)
WOOT nice! :D

Hi Galex,

can you tell me where you uploaded the files to?

i know where a few of them have to go but im not 100% can you list what directories you put them in please?

Thanks

Del_Boy 01-21-2009 10:21 PM

Is this no longer supported?

PAKIDIL 01-31-2009 09:48 PM

hello there

how to show it in member profile main page its showing as hide on other page but not on the main page of the profile

can any one help me out in this please
thanks
waiting for reply

Mecho 02-05-2009 08:56 AM

Thanks alot for this update . i have missed it .

no more template edit in this version which is GREAT :)

74corvette 02-11-2009 04:43 PM

First of all thanks to the coder for this mod, my members dig it. I do have a question, I'm using the 4.0 version and I noticed that when I go a member profile and look on the awards tab I have 3 columns. Icon, Image and Description but they are not spaced the way I would like or its not displaying correctly. It appears that the description is in the image column somehow. You can see it here http://www.buellforums.com/forum/member.php?u=1938

Really, I would like to just have the Icon and the description with why the member received the award.

Any suggestions ?

74corvette 02-11-2009 10:09 PM

I think I got it. I just removed :

<td class="thead" width="100%">$vbphrase[award_description]</td>

form the memberinfo_block_myawards template. It looks 100% better.

almqdad 02-15-2009 04:23 PM

hello

I am using Yet Another Award System 3.6 2.1.4 I want to upgrade to this version please tell me what to do

thanks in advance

Gamelobby 02-16-2009 06:25 PM

Why does my board say i am using version 4.0.1
Yet the zip here is - YaAS 3.7.4.zip

almqdad 02-19-2009 04:44 PM

This hack is very nice

is there away to restrict awarding awards by admin 7 supermoderator

may be group based or id based

thanks

Gandalf-LoJ 02-20-2009 06:06 AM

Quote:

Originally Posted by almqdad (Post 1749174)
This hack is very nice

is there away to restrict awarding awards by admin 7 supermoderator

may be group based or id based

thanks

I wanted to do something similar so came up with this method that works great. Allow access to moderators in the options (Turn on YAAS in ModCP)

Now create a new User Profile Field as follows;

Type: Single-Selection Radio Buttons
Name: Award System Manager
Options:
No
Yes

Set Default: Yes
Field Editable by User: No
Private Field: Yes
Field Searchable on Members List: No
Show on Members List: No

Now go into the Plugin Manager and Edit Plugin YAAS - Give Award to User Nav
Find
PHP Code:

if ($vbulletin->options['aw_modcp']) 

replace with (or comment out and add below)
PHP Code:

if ($vbulletin->userinfo['fieldXX'] == 'Yes'

Where fieldXX is the User Profile Field ID of the field you've just created.

My entire block for that now looks like (note I commented out the first line)
PHP Code:

// *************************************************
    
$cangiveaward false;

//    if ($vbulletin->options['aw_modcp'])
    
if ($vbulletin->userinfo['field12'] == 'Yes')
    {
        
$cangiveaward true;
        
construct_nav_option($vbphrase['give_user_award'], 'award.php?do=manage');
    }
    if (
$cangiveaward)
    {
        
construct_nav_group($vbphrase['award_system']);
        
construct_nav_spacer();
    } 

Finally, pick the users that you want to give access to and go into their profile in the AdminCP and select Yes in the Award System Manager profile field.

The user WILL need to already have access to the ModCP for this to work but as you're looking at Super Mods then I assume this is already the case.

I've done this on our forum as we did not want all moderators to be able to give awards, just our 'section heads'

On another note, I've also got the award system plugged into the permissions now and when an award is given to a user a scheduled task runs and checks for new awards and assigns them to a usergroup based on the award. There is also a script that checks for removed awards and will remove the relevant usergroup too.

JohnChapman 02-22-2009 12:21 PM

Nice Mod!

I made a couple extra medals using PowerPoint shapes...not very sophisticated, but then neither are my graphics abilities. Attached is the 2 medals I made along with the power point file that has the shape templates in it.

https://vborg.vbsupport.ru/external/2009/02/6.gif
https://vborg.vbsupport.ru/external/2009/02/7.gif

https://vborg.vbsupport.ru/external/2009/02/8.gif
https://vborg.vbsupport.ru/external/2009/02/9.gif

almqdad 02-22-2009 12:35 PM

Quote:

Originally Posted by Gandalf-LoJ (Post 1749688)
I wanted to do something similar so came up with this method that works great. Allow access to moderators in the options (Turn on YAAS in ModCP)

Now create a new User Profile Field as follows;

Type: Single-Selection Radio Buttons
Name: Award System Manager
Options:
No
Yes

Set Default: Yes
Field Editable by User: No
Private Field: Yes
Field Searchable on Members List: No
Show on Members List: No

Now go into the Plugin Manager and Edit Plugin YAAS - Give Award to User Nav
Find
PHP Code:

if ($vbulletin->options['aw_modcp']) 

replace with (or comment out and add below)
PHP Code:

if ($vbulletin->userinfo['fieldXX'] == 'Yes'

Where fieldXX is the User Profile Field ID of the field you've just created.

My entire block for that now looks like (note I commented out the first line)
PHP Code:

// *************************************************
    
$cangiveaward false;

//    if ($vbulletin->options['aw_modcp'])
    
if ($vbulletin->userinfo['field12'] == 'Yes')
    {
        
$cangiveaward true;
        
construct_nav_option($vbphrase['give_user_award'], 'award.php?do=manage');
    }
    if (
$cangiveaward)
    {
        
construct_nav_group($vbphrase['award_system']);
        
construct_nav_spacer();
    } 

Finally, pick the users that you want to give access to and go into their profile in the AdminCP and select Yes in the Award System Manager profile field.

The user WILL need to already have access to the ModCP for this to work but as you're looking at Super Mods then I assume this is already the case.

I've done this on our forum as we did not want all moderators to be able to give awards, just our 'section heads'

On another note, I've also got the award system plugged into the permissions now and when an award is given to a user a scheduled task runs and checks for new awards and assigns them to a usergroup based on the award. There is also a script that checks for removed awards and will remove the relevant usergroup too.


Thank you Gandalf-LoJ

but I will not be able to do this

I wish the author comeup with some thing easier

Charles_1 02-22-2009 02:20 PM

I am using this mod (right now in actual version 3.7.4) since version for vBulletin 3.5.x, but becouse of recently server load problems I noticed, that when I enable showing of awards for postbit_legacy it adds 12 queries when generating showthread (vB 3.8.1). Is it normal? Becouse I am using this mod since older version for vBulletin 3.5.x, I tried uninstall it on separate copy of forum for testing purposes (vB 3.8.0) and when I install this mod again (version 3.7.4) as fresh install, it adds 15 queries to showthread - that is too many from my point of view.

How many queries it should add to showthread with enabled viewing of awards in postbit? What are your observations?

merkaz 02-22-2009 11:34 PM

Very nice mood .

Thanks man.

inciarco 02-23-2009 03:29 AM

Question:

I'd like the Poll to be Public on the Thread of Award Request for an User. What Code Lines on What Plugins Should I Change (and What Code Should I Use), for the Polls to be Public instead of Private (currently the Polls are Created Private), so that I can see Who Voted Yes or No to the Award Request? :confused:

I think is Important to Know Who Voted Yes and No, when making the Voting Recount, and to Exclude Votes from Users that Voted without any Criteria (Trolls).

(I think that Perhaps Adding a Yes/No Option to Choose to Create the Poll Public would be a Nice Feature on Your Next Update of this Great Mod.) ;)

My Best Regards.

:)

BLykMik 02-24-2009 11:37 PM

great mod... quick question...

Is there a way to change the column widths on the awards.php page? Specifically the "Name / Description" width is too narrow. We have longer descriptions to our awards and they're getting squeezed pretty bad.

Thanks!

PinkDaisy 02-28-2009 11:47 AM

I prefer the awards to show up in the signatures area... But it defaults to align to the left. Is there a way to center them?

zombietom 02-28-2009 06:39 PM

Installed and working fine now..i had a small issue with the "request an award" link as it was not sending the pm and giving the "you don;t have permission" text --but i got past it --seems you need to go to your usergroups and it will kind of refresh and then it should work.

thanks for the great and east to use mod!

The_Rascal 03-11-2009 10:28 AM

Wrong Mod :$
Oops

KenDude 03-12-2009 05:47 AM

SAD! There should be some sort of mod support ENFORCEMENT! The author and the person listed for support have not been here since December of last year! So I tried going to CypherSTL's site, guess what it isn't working, email and PM from here are either undeliverable or unreturned. Why should I risk installing this mod and breaking the 3.5 version I currently have had working for 2 years and which keeps working up through vbulletin 3.8.1?

Is anyone EVER going to upgrade this mod AND support it???

BTW there are no install docs or upgrade docs in the ZIP file here, it says nothing about what will happen to my existing awards for members that have been granted in my 3.5 version.

Ugh... FRUSTRATION!

MTGDarkness 03-13-2009 12:33 PM

The templates on this MOD don't cache right on my forum, and this leads to a lot of extra queries. How can I fix this?

Pocket Aces 03-20-2009 04:46 AM

How do we increase the width of the name/description column in awards.php page? Which template and particular code to edit?

Makaveli007 03-20-2009 09:07 PM

thanks, installed

RedSpiral 04-16-2009 04:47 PM

Thanks!

This is exactly what I needed for my forum!

jcline 04-21-2009 04:42 PM

bug with the drop down in the settings... Sorting: Awards Listings always reverts to "Issue Time-Newest First" so if you don't notice, and change a different setting, it changes your sort order back to newest first.

titodj 06-25-2009 02:33 AM

Quote:

Originally Posted by Gandalf-LoJ (Post 1749688)


On another note, I've also got the award system plugged into the permissions now and when an award is given to a user a scheduled task runs and checks for new awards and assigns them to a usergroup based on the award. There is also a script that checks for removed awards and will remove the relevant usergroup too.

Can you let us know how to do it?
Im trying to have a way for the mods to change a user from groups based on one award.

Gandalf-LoJ 06-25-2009 06:14 AM

Quote:

Originally Posted by titodj (Post 1836839)
Can you let us know how to do it?
Im trying to have a way for the mods to change a user from groups based on one award.

Sure. A few things to note. Firstly, this assumes you have a reasonable knowledge of php as they are manual files. Secondly, you need to work out what awards (specifically their ID's) need to belong to what group (again you need to know the ID's)

All the groups are set in the arrays at the top. The first column (value) in the array is the award ID. The second column (value) is the usergroup that you want to assign this award to.

The reason there are two arrays is because we have one particular award that we want to assign to two separate usergroups. This may not apply to you, if it doesn't then you can remove $arr2 and comment out the while loop.

Here is the code. I called it award2group.php and placed it in the modules folder of the forum.

PHP Code:

<?php

// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
if (!
is_object($vbulletin->db))
{
    exit;
}

// ########################### SET VARIABLES ##############################

$arr1 = array(    
                
=> 50,
                
=> 38,
                
=> 50,
                
=> 53,
                
12 => 23,
                
13 => 43,
                
14 => 43,
                
17 => 51,
                
18 => 37,
                
20 => 53,
                
21 => 53,
                
24 => 53,
                
25 => 53,
                
29 => 48,
                
31 => 40,
                
32 => 39,
                
38 => 46,
                
39 => 52    
            
);
            
$arr2 = array(    
                
=> 7    
            
);

// ########################################################################
// ######################### USERGROUP UPDATES ############################
// #########################    GIVE ACCESS    ############################
// ########################################################################

$i 1;
while (
$i <= 2)
{
    if (
$i == 1)
    {
        
$arr $arr1;
    }
    else
    {
        
$arr $arr2;
    }
    foreach (
$arr as $awardval => $aw2gr)
    {
        
// check for award and update secondary usergroup if required
        
$giveawards $vbulletin->db->query_read("
            SELECT aw.award_id, us.userid, us.membergroupids 
            FROM " 
TABLE_PREFIX "award_user as aw
            LEFT OUTER JOIN " 
TABLE_PREFIX "user AS us ON us.userid = aw.userid AND (aw.award_id = $awardval)
            WHERE FIND_IN_SET(
$aw2gr, us.membergroupids) = 0
        "
);
        
        if (
$vbulletin->db->num_rows($giveawards) > 0)
        {
            while (
$giveawardsrow $vbulletin->db->fetch_array($giveawards))
            { 
// for each award, check to see if they are a member of the relevant group and update accordingly
                
$userdm =& datamanager_init('User'$vbulletinERRTYPE_ARRAY); 
                
$userinfo fetch_userinfo($giveawardsrow['userid']);
                
$userdm->set_existing($userinfo); 
                
$membergroupids $userdm->fetch_field('membergroupids');
                if (
$membergroupids != "")
                {
                    
// Explode to an array
                    
$mbrgrp_array explode(","$membergroupids);
                    
// Add remove/add group to array
                    
$mbrgrp_array[] = $aw2gr;
                    
// Make it a comma seperated string again
                    
$membergroupids implode(","$mbrgrp_array);  
                }
                else
                {
                    
$membergroupids $aw2gr;
                }
                
$userdm->set('membergroupids'$membergroupids);
                
$userdm->pre_save();
                if (
count($userdm->errors))
                {
                    for (
$i 0$i count($userdm->errors); $i++)
                    {
                        echo 
"ERROR{$i}:{$userdm->errors[$i]}\n";
                    }
                }
                else
                {
                    
// If everything is OK
                    
$userdm->save();
                    unset(
$mbrgrp_array);
                }
            }
            
$vbulletin->db->free_result($giveawardsrow);
        }
    }
    
$i++;
}

// ########################################################################
// ######################### USERGROUP UPDATES ############################
// #########################    GIVE ACCESS    ############################
// ########################################################################

unset($giveawards$giveawardsrow$userdm$userinfo$membergroupids$awardval$aw2gr$mbrgrp_array$i);     

log_cron_action(''$nextitem1);
?>

That will assign anyone who has an award to the relevant usergroup. NOTE: It will assign the group as a SECONDARY group only. It will not change or replace the users primary group membership.

Now for the removing part. If a user has an award taken away, you will need a script to remove that user from the assigned usergroup. This is handled in this script which I called delaward2group.php and placed in the same folder as the above.

You may notice that the arrays at the top of each file matches. This is so it only removes groups that have been assigned by awards. The array could be put in a separate php file and included into the two scripts so you only have one list to maintain but that all depends on your coding method.

PHP Code:

<?php

// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
if (!
is_object($vbulletin->db))
{
    exit;
}

// ########################### SET VARIABLES ##############################

$arr1 = array(    
                
=> 50,
                
=> 38,
                
=> 50,
                
=> 53,
                
12 => 23,
                
13 => 43,
                
14 => 43,
                
17 => 51,
                
18 => 37,
                
20 => 53,
                
21 => 53,
                
24 => 53,
                
25 => 53,
                
29 => 48,
                
31 => 40,
                
32 => 39,
                
38 => 46,
                
39 => 52    
            
);
            
$arr2 = array(    
                
=> 7    
            
);

// ########################################################################
// ######################### USERGROUP UPDATES ############################
// #########################   REMOVE ACCESS   ############################
// ########################################################################

$i 1;
while (
$i <= 2)
{
    if (
$i == 1)
    {
        
$arr $arr1;
    }
    else
    {
        
$arr $arr2;
    }
    foreach (
$arr as $awardval => $aw2gr)
    {
        
// need to get the keys from the array to use as an or in the query. This will make sure that a user that has one award that belongs to a multi award group does not get removed
        
$awardkeys array_keys($arr$aw2gr);
        
$keycount count($awardkeys);
        if (
$keycount == 1)
        { 
// single key then there only needs to be one value for the query
            
$awardor $awardkeys[0];
        }
        else
        {
            for (
$ac 0$ac $keycount$ac++)
            { 
// more than one key then the query OR needs to be constructed here
                
if ($ac $keycount 1)
                {
                    
$awardor .= $awardkeys[$ac] . " OR aw.award_id = ";
                }
                else
                {
                    
$awardor .= $awardkeys[$ac];
                }
            }
        }
        unset(
$awardkeys$ac);
        
// check for groups that no longer have the award and remove them from the secondary user group
        
$delawards $vbulletin->db->query_read("
            SELECT DISTINCT us.userid, us.membergroupids
            FROM " 
TABLE_PREFIX "user AS us
            WHERE NOT EXISTS (
            SELECT aw.userid, aw.award_id
            FROM " 
TABLE_PREFIX "award_user AS aw
            WHERE (aw.award_id = 
$awardor) AND us.userid = aw.userid) AND FIND_IN_SET($aw2gr, us.membergroupids) <> 0
        "
);
        unset(
$awardor); // unset the OR query here or it'll continue to add to it on the next loop
        
if ($vbulletin->db->num_rows($delawards) > 0)
        {
            while (
$delawardsrow $vbulletin->db->fetch_array($delawards))
            { 
// remove group from users that no longer have the award
                
$userdm =& datamanager_init('User'$vbulletinERRTYPE_ARRAY); 
                
$userinfo fetch_userinfo($delawardsrow['userid']);
                
$userdm->set_existing($userinfo); 
                
$membergroupids $userdm->fetch_field('membergroupids');
                if (
$membergroupids != "")
                {
                    
// Explode to an array
                    
$mbrgrp_array explode(","$membergroupids);
                    
// Add remove/add group to array
                    
$key array_search($aw2gr$mbrgrp_array);
                    unset(
$mbrgrp_array[$key]);
                    
// Make it a comma seperated string again
                    
$membergroupids implode(","$mbrgrp_array);
                }
                
$userdm->set('membergroupids'$membergroupids);
                
$userdm->pre_save();
                if (
count($userdm->errors))
                {
                    for (
$i 0$i count($userdm->errors); $i++)
                    {
                        echo 
"ERROR{$i}:{$userdm->errors[$i]}\n";
                    }
                }
                else
                {
                    
// If everything is OK
                    
$userdm->save();
                    unset(
$mbrgrp_array);
                }
            }
            
$vbulletin->db->free_result($delawardsrow);
        }
    }
    
$i++;
}

// ########################################################################
// ######################### USERGROUP UPDATES ############################
// #########################   REMOVE ACCESS   ############################
// ########################################################################

unset($delawards$delawardsrow$userdm$userinfo$membergroupids$awardval$aw2gr$i);     

log_cron_action(''$nextitem1);
?>

All you need to do now is setup two scheduled tasks to call the two scripts. I have the award2group.php running every hour and the delaward2group.php running every 12 hours. You can choose a schedule to suit your particular needs.

titodj 06-25-2009 01:46 PM

Thank you !! Let see if I can figure this out....

katie hunter 07-13-2009 05:53 PM

Hi, I've posted this before but it kinda get forgotten.
i think it will give the award system new look and functions.

https://vborg.vbsupport.ru/showpost....&postcount=373

I've added to new screenshots

Cadellin 08-11-2009 08:56 PM

A really useful facility would be the ability to have some awards awarded automatically - e.g based on time since regitation - or if your a member of a certain group (I know you can become a member because of an award I'm after the opposite :))

Great mod though :)

SBlueman 08-12-2009 03:59 AM

I am running 3.6.12....is this compatible with that version?

wapsilog 08-27-2009 12:02 AM

unable to set display format to ASC...
anybody ecounter same problem?

jaderollie 09-17-2009 11:08 PM

i cant see an awards section in admincp, so how do i give a user a medal??


All times are GMT. The time now is 04:23 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02022 seconds
  • Memory Usage 1,965KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (8)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete