Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Automatic 'Thank you' Hack Details »»
Automatic 'Thank you' Hack
Version: 1.00, by VBDev VBDev is offline
Developer Last Online: Dec 2021 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 04-02-2004 Last Update: Never Installs: 44
 
No support by the author.

Total hack's description : http://www.vbulletindev.net/forums/h...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

Show Your Support

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

Comments
  #72  
Old 04-06-2004, 05:13 PM
teksigns's Avatar
teksigns teksigns is offline
 
Join Date: Sep 2003
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by VBDev
I'll do it Vitrox

cool !


cant wait
Reply With Quote
  #73  
Old 04-06-2004, 11:40 PM
calvinnguyen calvinnguyen is offline
 
Join Date: Nov 2003
Posts: 114
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by VBDev
@calvin : where do you get this no_permission screen ? If you have it when you click the button Thanks, it's coz you are not logged in
Prefix : look in your config.php, $prefix=... you have to add in my SQL queries, the prefix before tables name

I update the zip
I had run those 3 below got sucessful, but still got no_permission screen like you said above.
What do you mean add ,$prefix = ' '; to my SQL?

even I add this: $prefix = ' '; before tables name . It is still not going. I had no ideas what is exactly wrong to cause this problem. I love this hack, but I am not lucky to use it. :disappointed:


ALTER TABLE `forum` ADD `showthanks` INT(1) DEFAULT '0' NOT NULL;

ALTER TABLE `forum` ADD `showthanks_date` INT(1) DEFAULT '0' NOT NULL;

CREATE TABLE `thanks` (
`id` INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
`userid` INT(10) NOT NULL,
`username` VARCHAR(50) NOT NULL,
`date` INT(10) NOT NULL,
`threadid` INT(10) NOT NULL
);
Reply With Quote
  #74  
Old 04-09-2004, 05:25 PM
Mone' Mone' is offline
 
Join Date: May 2002
Location: Australia
Posts: 246
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by VBDev
I'll do it Vitrox
exellent :squareeyed:
Reply With Quote
  #75  
Old 04-09-2004, 06:02 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

VBDev, buddy, are you still working on this hack?
Reply With Quote
  #76  
Old 04-09-2004, 06:04 PM
VBDev's Avatar
VBDev VBDev is offline
 
Join Date: Jan 2004
Location: France
Posts: 2,570
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, I'm finishing an other one, 'hidden text password protected' in post

I take a look for this counter in the evening
Reply With Quote
  #77  
Old 04-09-2004, 09:00 PM
VBDev's Avatar
VBDev VBDev is offline
 
Join Date: Jan 2004
Location: France
Posts: 2,570
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@ 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 
Reply With Quote
  #78  
Old 04-09-2004, 09:27 PM
VBDev's Avatar
VBDev VBDev is offline
 
Join Date: Jan 2004
Location: France
Posts: 2,570
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

To add a counter, in functions_showthread.php, replace :


PHP Code:
$thanks=$DB_site->query("SELECT * AS nb FROM "TABLE_PREFIX ."thanks WHERE threadid='$thread[threadid]' ORDER BY username"); 
with


PHP Code:
$thanks=$DB_site->query("SELECT *, COUNT(userid) AS nb FROM "TABLE_PREFIX ."thanks WHERE threadid='$thread[threadid]' GROUP BY userid ORDER BY username"); 
Add a phrase in your phrase manager thanks_nb :

Code:
{1} people have clicked the THANKS button
ANd in your new postbit template

Add :

Code:
 
<phrase 1="$thank[nb]">$vbphrase[thanks_nb]</phrase>
Reply With Quote
  #79  
Old 04-09-2004, 10:19 PM
teksigns's Avatar
teksigns teksigns is offline
 
Join Date: Sep 2003
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

not sure im understanding where to put this :


Quote:
ANd in your new postbit template

Add :

Code:

<phrase 1="$thank[nb]">$vbphrase[thanks_nb]</phrase>


looking through the code ... does $nb var not already contain the count of thanks
because of line:

Code:
$nb=$DB_site->num_rows($thanks);
Reply With Quote
  #80  
Old 04-09-2004, 10:22 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The number of people who clicked the link doesn't show up for me. Just the phrase without the number. I even changed the phrase 1 to $thanks[nb] as it should be and the number still does not show up.
Reply With Quote
  #81  
Old 04-09-2004, 10:27 PM
teksigns's Avatar
teksigns teksigns is offline
 
Join Date: Sep 2003
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Boofo
The number of people who clicked the link doesn't show up for me. Just the phrase without the number. I even changed the phrase 1 to $thanks[nb] as it should be and the number still does not show up.

from what i can see:

you shoudnt need to replace :

Code:
$thanks=$DB_site->query("SELECT * AS nb FROM ". TABLE_PREFIX ."thanks WHERE threadid='$thread[threadid]' ORDER BY username");

do the other steps though ....


and change the phrase line like this :


Code:
<phrase 1="$nb">$vbphrase[thanks_nb]</phrase>
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 04:21 PM.


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.05849 seconds
  • Memory Usage 2,365KB
  • Queries Executed 27 (?)
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
  • (5)bbcode_code
  • (4)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
  • (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_postinfo_query
  • fetch_postinfo
  • 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