Back to vBulletin 3.0 Add-Ons

Automatic 'Thank you' Hack
Mod Version: 1.00, by VBDev

This modification is in the archives.
vB Version: 3.0.0 Rating: (1 vote - 4.00 average) Installs: 44
Released: 03 Apr 2004 Last Update: Never Downloads: 33
Not Supported  

Total hack's description : http://www.vbulletindev.net/forums/hacks_root.php?do=aff_hack&hackid=49

Site : http://www.vbulletindev.net/forums


You can set in wanted forums with this hack, an option which displays in a special post of a thread, the list of members who clicked the 'Thank you' button. So, instead of having a lot of posts saying : 'Great', 'Big thx ' ... you only have one post.

The postbit (legacy or not) automatically adapts itself too.

The phrase to thank the thread creator change if there is one user or more which clicks the button, so the verb is always correct
There is an other option too in Forum manager, to set if you want to see at which date the 'Thank you' button was clicked by the member.

Hack requested by boofo


Eventual bugs :Correct with it

Spoiler (click to open)


@ calvin : I've exactly the same problem ... this no_permission page, really strange, the var $foruminfo[showthanks] doesn't seen working

I correct it before doing the counter


If you have this no_permission problem, replace the code to add in newreply.php with :


PHP Code:
// ############################### Than you hack Grog6 ###############################
if ($_REQUEST['do'] == 'thanks')
{
    
globalize($_REQUEST, array('threadid' => INT));
    
$forum=$DB_site->query_first("SELECT showthanks FROM "TABLE_PREFIX ."forum WHERE forumid='$foruminfo[forumid]'");
    if (
$forum[showthanks]==|| $bbuserinfo[userid]==0)
     
print_no_permission();
    else
    {
        
$verif=$DB_site->query_first("SELECT userid FROM "TABLE_PREFIX ."thanks WHERE threadid='$threadid' AND userid='$bbuserinfo[userid]'");
    if (
$verif[userid]==$bbuserinfo[userid])
     eval(
print_standard_error('error_already_thanks'));
    else
        {
        
$DB_site->query("
        INSERT INTO "
TABLE_PREFIX ."thanks
        (userid, username, date, threadid)
        VALUES ('
$bbuserinfo[userid]', '" addslashes($bbuserinfo[username]) . "', " TIMENOW ", '$threadid')");
        
$url "showthread.php?$session[sessionurl]t=$threadid";
    eval(
print_standard_redirect('redirect_thanks'));
        }
    }


And code to add in functions_showthread.php with :

PHP Code:
         // thank you hack grog6
        
$cmpt=1;
        
$grumpf=$DB_site->query_first("SELECT showthanks FROM "TABLE_PREFIX ."forum WHERE forumid='$forum[forumid]'");
    
        if (
$grumpf[showthanks] == && $post[postcount]==1)
        {
        
$thanks=$DB_site->query("SELECT * FROM "TABLE_PREFIX ."thanks WHERE threadid='$thread[threadid]' ORDER BY username");
        
$nb=$DB_site->num_rows($thanks);
        if (
$nb>0)
           {
               while(
$thank=$DB_site->fetch_array($thanks))
               {
                if (
$cmpt<$nb)
                 
$virg=",";
                else 
$virg="";
                if (
$forum[showthanks_date]==0)
                
$liste_user $liste_user." <a href=\"member.php?u=$thank[userid]\">$thank[username]</a>$virg ";
                else
                {
                 
$date_thank vbdate($vboptions['dateformat'], $thank['date'], true);
                 
$liste_user $liste_user." <a href=\"member.php?u=$thank[userid]\">$thank[username]</a> ($date_thank)$virg ";
                }
               
$date=$thank[date];
               
$cmpt++;
              }
               
// format date/time
            
$post['postdate'] = vbdate($vboptions['dateformat'], $datetrue);
            
$post['posttime'] = vbdate($vboptions['timeformat'], $date);
               
// user profil field
               
$username "<b><font size=\"3\">$vbphrase[thanks_bot]</font></b>";
               if (
$nb<=1)
                
$thank_phrase construct_phrase($vbphrase[thanks_1_install], $post[musername]);
               else 
$thank_phrase construct_phrase($vbphrase[thanks_x_install], $post[musername]);
               if (
$vboptions[legacypostbit]=="000")
                eval(
'$thanks_post .= " ' fetch_template('thanks_postbit') . '";');
               else eval(
'$thanks_post = " ' fetch_template('thanks_postbit_legacy') . '";');
             }
        }
        
// thank you hack grog6 

Close

Download

This modification is archived and cannot be downloaded.

Screenshots

     


vblts.ru supports vBulletin®, 2022-2024