vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Automatic 'Thank you' Hack (https://vborg.vbsupport.ru/showthread.php?t=63368)

Boofo 04-09-2004 11:23 PM

You're right. After looking at the query, that makes sense. It works now. Thank you, sir. ;)

calvinnguyen 04-11-2004 06:19 AM

Thanks VBDev, but it didn't work at all. I gave up. Have no ideas about this error.
Try many times and may different ways, but still didn't work at all.

Quote:

Originally Posted by VBDev
@ 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 



VitroX 04-11-2004 09:04 PM

Thanks a lot!

I installed, the counter works perfectly.

I'm only getting the "no permission" error only on those forums where the "thank you" has not been activated on admincp, but on those where it was is working perfect.

;)

Boofo 04-11-2004 09:14 PM

Quote:

Originally Posted by VitroX
Thanks a lot!

I installed, the counter works perfectly.

I'm only getting the "no permission" error only on those forums where the "thank you" has not been activated on admincp, but on those where it was is working perfect.

;)

Just add this above the code in the template for the thank you button:

HTML Code:

<if condition="$forum['showthanks']">
and add this below the code in the template for the thank you button:

HTML Code:

</if>
and the button will only show on the forums it is set for. ;)

marcel-ea 04-12-2004 06:14 AM

great hack please can anybody make a extra for me?
I like to see " xxx User say thank you" e.g. "15 User ...."

Also a counter...

thx very much

vbIce 04-16-2004 09:48 AM

How about a hack that would SHOW in the Users profile how many Thank You's one has made? Along the SAME lines as when they make a Post? I know others that would LOVE this feature.

Is there soemothing out there that could be ADDED to show this?

.

VitroX 04-17-2004 02:23 AM

Quote:

Originally Posted by Boofo
Just add this above the code in the template for the thank you button:

HTML Code:

<if condition="$forum['showthanks']">
and add this below the code in the template for the thank you button:

HTML Code:

</if>
and the button will only show on the forums it is set for. ;)

thanks a lot!, problem fixed ;)

cpt 04-18-2004 10:22 AM

nice hack - but I have a two problems:

1. "Thank You" Button is displayed twice at the top of a thread (see attachment) - I think the problem is in the SHOWTHREAD template.

2. If the threadicon is https://vborg.vbsupport.ru/ the icon is not displayed at the top of the thank you post :-/ (see attachment)

VBDev 04-18-2004 12:03 PM

1 - Only add it once in your SHOWTHREAD template, you added it twice
2 - I only modify the functions_showpost.php to add my thank function, I don't think the problem come from the hack

marcel-ea 04-18-2004 07:02 PM

Quote:

Originally Posted by cpt
nice hack - but I have a two problems:


2. If the threadicon is https://vborg.vbsupport.ru/ the icon is not displayed at the top of the thank you post :-/ (see attachment)

i have the same problem EXACTLY the same when use the standard icon its broken use a other its working


All times are GMT. The time now is 08:05 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.02432 seconds
  • Memory Usage 1,788KB
  • 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
  • (4)bbcode_html_printable
  • (2)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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