View Full Version : Automatic 'Thank you' Hack
VBDev
04-02-2004, 10:00 PM
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 :D' ... 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 (https://vborg.vbsupport.ru/showpost.php?p=497846&postcount=76)
Giveit2u43
04-02-2004, 11:12 PM
* Giveit2u43 clicks "Thank You" Button ;)
Fi_InCogNiTo
04-02-2004, 11:46 PM
How do you delete a thanks post? There's no edit button on its post and also doesnt show when you click delete posts in thread tools =|
Fi_InCogNiTo
04-02-2004, 11:52 PM
Also, does et ajoutez en dessous mean add after?
dirtymerc
04-03-2004, 12:17 AM
im hving problems with it repeating the thanks (username) twice in the thanks bot post.
Fi_InCogNiTo
04-03-2004, 01:02 AM
I had the same problem. I just deleted the second phrase in the new postbit.
calvinnguyen
04-03-2004, 01:20 AM
I had a problem when I click on the botton I got this message:
Any ideas about this error? And How I can fixed it? MAny thanks
CALVIn, you do not have permission to access this page. This could be due to one of several reasons:
Your user account may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.
========================
Also I don't understand this intruction:
Don't forget to add a prefix to table's name if you use one in your config.php :
What's exactly I have to do inside my config.php
gmarik
04-03-2004, 06:17 AM
interesting one
/me asks: what will come next?
draculanowaday
04-03-2004, 07:29 AM
/me installed
Boofo
04-03-2004, 08:17 AM
Hey, buddy, looks good. ;)
Can you make a button that says Thank you! instead of Thanks it! ? ;)
VBDev
04-03-2004, 08:53 AM
@dirtymerc (https://vborg.vbsupport.ru/member.php?u=20938) vbmenu_register("postmenu_494851", true); : For the phrase repeated twice, it's the problem I had with conditional in templates, but when I fix it in PHP files, it seems to work, I look at it
Yes, ajoutes en dessous, mean add under
An edit button, no and I don't will do it, you don't choose if a user thanks or not ;)
I look for other problems too
Boofo
04-03-2004, 09:31 AM
How about the button that says Thank you! ?
VBDev
04-03-2004, 09:31 AM
To remove the sentence repeated twice, replace the thanks_postbit with :
$spacer_open
<div style="padding:0px 0px $stylevar[cellpadding]px 0px">
<table class="tborder" id="post$post[postid]" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="thead" $scrolltothis>
<div class="normal" style="float:$stylevar[right]">
</div>
<div class="normal">
<!-- status icon and date -->
<a name="post$post[postid]"><img class="inlineimg" src="$stylevar[imgdir_statusicon]/post_old.gif" alt="$post[statustitle]" border="0" /></a>
$post[postdate], $post[posttime]</if>
$post[firstnewinsert]
<!-- / status icon and date -->
</div>
</td>
</tr>
<tr>
<td class="alt2" style="padding:0px">
<!-- user info -->
<table cellpadding="0" cellspacing="$stylevar[cellpadding]" border="0" width="100%">
<tr>
<td nowrap="nowrap">
<div id="postmenu_$post[postid]">
$username </div>
</td>
<td width="100%"> </td>
<td valign="top" nowrap="nowrap">
<font class="smallfont"><div>$vbphrase[location_perm]: $vboptions[bbtitle]</font></div>
</td>
</tr>
</table>
<!-- / user info -->
</td>
</tr>
<tr>
<td class="alt1">
<!-- message, attachments, sig -->
<!-- icon and title -->
<div class="smallfont">
<img class="inlineimg" src="images/icons/icon1.gif" alt="Post" border="0" />
<strong>$vbphrase[thanks_title]</strong>
</div>
<hr size="1" style="color:$stylevar[tborder_bgcolor]" />
<!-- / icon and title -->
<!-- message -->
<div>$liste_user $thank_phrase
<br /><br /></div>
<!-- / message -->
</td>
</tr>
</table>
</div>
$spacer_close
<!-- / post #$post[postid] -->
And the thanks_postbit_legacy with :
$spacer_open
<div style="padding:0px 0px $stylevar[cellpadding]px 0px">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="100%" align="center">
<tr>
<td class="thead" style="font-weight:normal" $scrolltothis>
<!-- status icon and date -->
<a name="post$post[postid]"><img class="inlineimg" src="$stylevar[imgdir_statusicon]/post_old.gif" alt="$post[statustitle]" border="0" /></a>
$post[postdate], $post[posttime]</if>
$post[firstnewinsert]
<!-- / status icon and date -->
</td>
<td class="thead" style="font-weight:normal" align="$stylevar[right]">
</td>
</tr>
<tr valign="top">
<td class="alt2" width="175">
$username
<div class="smallfont">
<br />
<div>$vbphrase[location_perm]: $vboptions[bbtitle]</div> </div>
</td>
<td class="alt1">
<!-- icon and title -->
<div class="smallfont">
<img class="inlineimg" src="$post[iconpath]" alt="images/icons/icon1.gif" border="0" />
<strong>$vbphrase[thanks_title]</strong>
</div>
<hr size="1" style="color:$stylevar[tborder_bgcolor]" />
<!-- / icon and title -->
<!-- message -->
<div>$liste_user $thank_phrase
<br /><br /></div>
</td>
</tr>
<tr>
<td class="alt2">
</td>
<td class="alt1" align="$stylevar[right]">
</td>
</tr>
</table>
$spacer_close
<!-- / post #$post[postid] -->
I had corrected it in the legacy but forgot the other one ;)
@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
Edit boofo : I do your button now ;)
Martyjp
04-03-2004, 09:34 AM
I saw this on an ipb the other day and thought how useful it would be to have on this site
VBDev
04-03-2004, 09:38 AM
Zip updated
Boofo, the new button is in the zip ;)
Boofo
04-03-2004, 09:39 AM
I forgot to ask, sorry. If a user clicks the button more than once on other visitis to the site, it won't add their name again will it? It should only show the first time they click it. Does it already do this?
VBDev
04-03-2004, 09:42 AM
Yes boofo it already does this
If a user clicked twice (or more) the button, after the first time, he will get an error message saying he has already thanked for this thread.
Unregistered members can not thank too
Boofo
04-03-2004, 09:45 AM
Thank you very much. Wouldn't it be easier if the thank you button didn't show up for unergistered users, also?
VBDev
04-03-2004, 09:47 AM
If you want ;)
Just add a conditional in the showthread template on this button so
<if condition="$bbuserinfo[userid]!=0">...button ...</if>
Boofo
04-03-2004, 09:50 AM
LOL I was going to do that but I didn't know if you wanted to updated the install file with it, too. Excellent job, my friend. Clciking install and installing. ;)
Boofo
04-03-2004, 10:31 AM
How do we set the thank you button to only show up on the forums it is turned on for? Right now, it shows up on all forums. ;)
VBDev
04-03-2004, 11:07 AM
In the showthread template :
Replace <td class="smallfont" align="right"><a href="newreply.php?do=thanks&threadid=$thread[threadid]">
<img src="$stylevar[imgdir_button]/thanks.gif" alt="$vbphrase[thanks]" border="0" >
</a></td>
with
<if condition="$forum[showthanks]==1"><td class="smallfont" align="right"><a href="newreply.php?do=thanks&threadid=$thread[threadid]">
<img src="$stylevar[imgdir_button]/thanks.gif" alt="$vbphrase[thanks]" border="0" >
</a></td></if>
Boofo
04-03-2004, 11:30 AM
Yeah, I just figured that out before coming up here to tell you. ;)
Only, this is what I used and it seems to work fine.
<if condition="$forum['showthanks']">
Boofo
04-03-2004, 11:33 AM
Is there a way to add this:
thanks username for this thread
as the title of the message instead of actually being in the message?
VitroX
04-03-2004, 11:50 AM
this is a great hack.
how about adding the total pple who thank the thread starter?
something like:
5 Users already said Thank You!:
username1, username2, username3, username4, username5
it would fit better for my forum.
Thanks for your work!
VBDev
04-03-2004, 01:00 PM
I don't want to work on vBulletin now ;)
But I'll look for these 2 things (title for boofo, really not hard, and for you counter vitrox, not harder )
Boofo
04-03-2004, 01:01 PM
When you are ready to work on vBulletin again, I have a couple things to talk to you about. PM me when you are aready. ;)
VBDev
04-03-2004, 01:03 PM
I'll have a really hard night this evening, and will not be able to work tomorrow, I think I'll stay at bed all the day ! :p
Monday, I look for this ;)
Boofo
04-03-2004, 01:04 PM
PM me Monday and we'll talk then. Hope you feel better. ;)
Mone'
04-03-2004, 04:08 PM
Hi thank you for the hack everything works great so far :)
I'd like to point a few things........
1 if you delete a thread with a thank you post the thank you talbe doen not get deleted in the db. Can you add the function to remove the db entry if a thread get deleted?
2 ability to bump a post when a user say thank you
3 admin should be able to delete thank you post
4 like other have requested I would like to see a counter of the totla user that said thank you :)
Apart of that great job!
Mone'
calvinnguyen
04-03-2004, 05:13 PM
@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 saw the line below at config.php
$tableprefix = ' ';
Do I add this line in like as below: BUT WHEN I RUN IT STILL GIVE ME ERROR. I am really don't know how to run sql
Error
SQL-query :
$tableprefix = ' '
MySQL said:
#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '$tableprefix = ' '' at line 3
ALTER TABLE `forum` ADD `showthanks` INT(1) DEFAULT '0' NOT NULL;
ALTER TABLE `forum` ADD `showthanks_date` INT(1) DEFAULT '0' NOT NULL;
$tableprefix = '';
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
);
VitroX
04-03-2004, 08:05 PM
I'll have a really hard night this evening, and will not be able to work tomorrow, I think I'll stay at bed all the day ! :p
Monday, I look for this ;)
no problem, take your time and enjoy the weekend ;)
calvinnguyen
04-03-2004, 08:59 PM
I saw the line below at config.php
$tableprefix = ' ';
Do I add this line in like as below: BUT WHEN I RUN IT STILL GIVE ME ERROR. I am really don't know how to run sql
Error
SQL-query :
$tableprefix = ' '
MySQL said:
#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '$tableprefix = ' '' at line 3
ALTER TABLE `forum` ADD `showthanks` INT(1) DEFAULT '0' NOT NULL;
ALTER TABLE `forum` ADD `showthanks_date` INT(1) DEFAULT '0' NOT NULL;
$tableprefix = '';
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
);
Anyone can help me with this problem above. Many thanks
Boofo
04-03-2004, 09:03 PM
Just run the query as it is and you will be allright.
calvinnguyen
04-03-2004, 09:24 PM
Just run the query as it is and you will be allright.
when I run this: code below I got this error: How can I clear up this error.
Error
SQL-query :
ALTER TABLE `forum` ADD `showthanks` INT( 1 ) DEFAULT '0' NOT NULL
MySQL said:
#1060 - Duplicate column name 'showthanks'
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
);
calvinnguyen
04-03-2004, 09:42 PM
I run success for SQL queries on my database, but I don't understand for this line:
Don't forget to add a prefix to table's name if you use one in your config.php
Look in config.php
I see this:
$tableprefix = '';
What do I need to do?
because right now when I click on the " thank you" button to test. It give me this message:
Calvin, you do not have permission to access this page. This could be due to one of several reasons:
Your user account may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.
Boofo
04-03-2004, 09:52 PM
Just run these 3 queries and don't worry about the table_prefix. You don't have one. ;)
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
);
calvinnguyen
04-03-2004, 10:43 PM
I have already run it. And following all intruction that he gave. But when I test to click on a button "Thank you" , It said I did't have permision like that message previous posts.
tnguy3n
04-04-2004, 01:27 AM
I have already run it. And following all intruction that he gave. But when I test to click on a button "Thank you" , It said I did't have permision like that message previous posts.
Enable "thank you button" when you create new forums or update existing forums in Forum Permision.
In postbit and postbit_legacy templates, add at the end :
------------------------------------------------------------------------
$thanks_post
------------------------------------------------------------------------
Wouldn't it better to add $thanks_post in postbit instead? :rolleyes:
VBDev
04-04-2004, 06:32 PM
Wouldn't it better to add $thanks_post in postbit instead? :rolleyes:
Isn't it was is written ? I don't understand what you want to say
Mone'
04-04-2004, 11:31 PM
wow my post jump on second page !??! bloody server time.....
calvinnguyen
04-05-2004, 12:19 AM
I had no ideas why it keep give me a message no permission to access when I click on the button Thank You. I have install exactly intruction for many times, again and again. Still didn't work. This is the hack that I have looking for more than 1 year. Now you release it, but I can't sucessful to install it :tired:
tnguy3n
04-05-2004, 12:35 AM
Isn't it was is written ? I don't understand what you want to say
I was just wondering why adding $thanks_post template to postbit_legacy but not to postbit template. well, maybe it works either way. :squareeyed:
Boofo
04-05-2004, 01:00 AM
It needs to be added to both of them. ;)
calvinnguyen
04-05-2004, 01:00 AM
I have try to play with this hack around my forum, but still didn't work. I am not lucky guy for this hack.
tnguy3n
04-05-2004, 03:27 AM
I have try to play with this hack around my forum, but still didn't work. I am not lucky guy for this hack.
Those no permission messages appear cuz you don't have "Thank You Option" enable for existing forums. Just run this following query (in either Admin CP or phpMyAdmin):
UPDATE `forum` SET `showthanks` = '1', `showthanks_date` = '1' ;
teksigns
04-05-2004, 03:44 AM
1 if you delete a thread with a thank you post the thank you talbe doen not get deleted in the db. Can you add the function to remove the db entry if a thread get deleted?
i fixed this myself
in :
includes/functions_databuild.php
Find:
delete_post_index($post['postid']); //remove search engine entries
}
}
if (!empty($userbyuserid) AND !$threadinfo['isdeleted'])
{ // if the thread is already deleted, the posts have already been reduced
add this right above it :
$DB_site->query("DELETE FROM " . TABLE_PREFIX . "thanks WHERE threadid=$threadid");
save and your done !
now anytime you Physically remove it it will also remove the thanks.
Mone'
04-05-2004, 05:24 AM
thx for that :)
VBDev
04-05-2004, 09:48 AM
I was just wondering why adding $thanks_post template to postbit_legacy but not to postbit template. well, maybe it works either way. :squareeyed:In postbit AND postbit_legacy templates
@teksigns (https://vborg.vbsupport.ru/member.php?u=41766) vbmenu_register("postmenu_495736", true); : Thanks for this ;)
@Mone' : You registered on vbulletindev, but it seems you had a lot of SQL error due to your username (the ' ), these are vBulletin's bugs
I'll correct it adding addslashed into SQL queries ;) Try to connect later, it should be ok
subu1
04-05-2004, 12:30 PM
great Hack, but i have a Problem :rolleyes:
In SHOWTHREAD template, find (you must do it 2 times) :
------------------------------------------------------------------------
<if condition="$show['largereplybutton']">
<td class="smallfont"><a href="newreply.php?$session[sessionurl]do=newreply&noquote=1&p=$FIRSTPOSTID"><if condition="$show['closethread']"><img src="$stylevar[imgdir_button]/reply.gif" alt="$vbphrase[reply]" border="0" /><else /><img src="$stylevar[imgdir_button]/threadclosed.gif" alt="$vbphrase[closed_thread]" border="0" ></if></a></td>
</if>
------------------------------------------------------------------------
and replace with :
------------------------------------------------------------------------
<if condition="$show['largereplybutton']">
<td class="smallfont"><a href="newreply.php?$session[sessionurl]do=newreply&noquote=1&p=$FIRSTPOSTID"><if condition="$show['closethread']"><img src="$stylevar[imgdir_button]/reply.gif" alt="$vbphrase[reply]" border="0" /><else /><img src="$stylevar[imgdir_button]/threadclosed.gif" alt="$vbphrase[closed_thread]" border="0" ></if></a></td>
</if>
<td class="smallfont" align="right"><a href="newreply.php?do=thanks&threadid=$thread[threadid]">
<img src="$stylevar[imgdir_button]/thanks.gif" alt="$vbphrase[thanks]" border="0" >
</a></td>
i don't have this, i have this :rolleyes:
<if condition="$show['largereplybutton']">
<td class="smallfont"><a href="newreply.php?$session[sessionurl]do=newreply&noquote=1&p=$FIRSTPOSTID"><if condition="$show['closethread']"><img src="$stylevar[imgdir_button]/reply.gif" alt="$vbphrase[reply]" border="0" /><else /><img src="$stylevar[imgdir_button]/threadclosed.gif" alt="$vbphrase[closed_thread]" border="0" ></if></a>
<a href="newthread.php?$session[sessionurl]do=newthread&f=$foruminfo[forumid]"><img src="$stylevar[imgdir_button]/newthread.gif" alt="$vbphrase[post_new_thread]" border="0" />
</td>
please can you help me :surprised:
Boofo
04-05-2004, 12:33 PM
Look for this then. ;)
<td class="smallfont"><a href="newreply.php?$session[sessionurl]do=newreply
Boofo
04-05-2004, 12:36 PM
i fixed this myself
in :
includes/functions_databuild.php
Find:
delete_post_index($post['postid']); //remove search engine entries
}
}
if (!empty($userbyuserid) AND !$threadinfo['isdeleted'])
{ // if the thread is already deleted, the posts have already been reduced
add this right above it :
$DB_site->query("DELETE FROM " . TABLE_PREFIX . "thanks WHERE threadid=$threadid");
save and your done !
now anytime you Physically remove it it will also remove the thanks.
What if there isn't a thanks message in the thread you want to delete. Wouldn't that give you a db error? ;)
teksigns
04-05-2004, 01:50 PM
What if there isn't a thanks message in the thread you want to delete. Wouldn't that give you a db error?
not it would not .....
i just deletes any it finds ....if none match then it just continues .......
Boofo
04-05-2004, 01:54 PM
It deletes any it finds, or finds for that thread you mean? ;)
subu1
04-05-2004, 02:23 PM
Look for this then. ;)
<td class="smallfont"><a href="newreply.php?$session[sessionurl]do=newreply
Hi Boofo
Sorry, but you can write me the code please, view can see that I after something other I also, but how it goes.
teksigns
04-05-2004, 02:39 PM
It deletes any it finds, or finds for that thread you mean? ;)
find for that thread ..........
teksigns
04-05-2004, 02:43 PM
heres another wish filled .....
2 ability to bump a post when a user say thank you
with this each time someone clicks thankyou your post will be bumped to the
top of the list again ......
in newreply.php
Find this :
$DB_site->query("
INSERT INTO ". TABLE_PREFIX ."thanks
(userid, username, date, threadid)
VALUES ('$bbuserinfo[userid]', '" . addslashes($bbuserinfo[username]) . "', " . TIMENOW . ", '$threadid')");
bellow it , add this :
$DB_site->query("UPDATE ".TABLE_PREFIX."thread SET lastpost=".TIMENOW." WHERE threadid='".$threadid."'");
thats it !
your done ......
Boofo
04-05-2004, 02:45 PM
LOL How many queries is all of this adding?
teksigns
04-05-2004, 02:50 PM
LOL How many queries is all of this adding?
just trying to help !
im not a coder... if you have better way .....please post it .......
its only way i know to get job done .......
subu1
04-05-2004, 02:55 PM
...what a Mod :(
Boofo
04-05-2004, 02:56 PM
just trying to help !
im not a coder... if you have better way .....please post it .......
its only way i know to get job done .......
I didn't me that in a bad way. I was jusy saying that adding too many queries might not be a good idea to some poeple. Sorry if you took that wrong. ;)
teksigns
04-05-2004, 02:58 PM
I didn't me that in a bad way. I was jusy saying that adding too many queries might not be a good idea to some poeple. Sorry if you took that wrong. ;)
np .....
i wish there was another way ..... but none i can think of without the extra
queries .......
calvinnguyen
04-06-2004, 01:39 AM
Those no permission messages appear cuz you don't have "Thank You Option" enable for existing forums. Just run this following query (in either Admin CP or phpMyAdmin):
How can I clear #1060 - Duplicate column name 'showthanks'
to run
ALTER TABLE `forum` ADD `showthanks` INT(1) DEFAULT '0' NOT NULL;
again, because anytime I run it give me error as the message below.
Thanks tnguy3n
Error
SQL-query :
ALTER TABLE `forum` ADD `showthanks` INT( 1 ) DEFAULT '0' NOT NULL
MySQL said:
#1060 - Duplicate column name 'showthanks'
Boofo
04-06-2004, 02:13 AM
That error means that column is already there. You do not need to run that query again. ;)
calvinnguyen
04-06-2004, 03:19 AM
That error means that column is already there. You do not need to run that query again. ;)
I don't know what the heck exactly wrong with my database. It keeps give me a message that:
you do not have permission to access this page. This could be due to one of several reasons:
Your user account may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.
I HAVE READ THIS INTRUCTION FOR MANY TIMES EVEN I got sucessful when Run SQL query/queries on database.
From tnguy3n told me for his help, but it is still not working..
What is exactly wrong about it.
tnguy3n
04-06-2004, 03:50 AM
I don't know what the heck exactly wrong with my database. It keeps give me a message that:
you do not have permission to access this page. This could be due to one of several reasons:
Your user account may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.
I HAVE READ THIS INTRUCTION FOR MANY TIMES EVEN I got sucessful when Run SQL query/queries on database.
From tnguy3n told me for his help, but it is still not working..
What is exactly wrong about it.
Run this query:
UPDATE `forum` SET `showthanks` = '1', `showthanks_date` = '1' ;
calvinnguyen
04-06-2004, 04:42 AM
Run this query:
UPDATE `forum` SET `showthanks` = '1', `showthanks_date` = '1' ;
I run this query already, but the problem is the same.
tnguy3n
04-06-2004, 05:31 AM
I tested this on my localhost and it seemed to work fine. I think I got that "No Permission Message" too, but then I updated that "thank you" option for forums (by running that query) and i got it to work.
(hey, i noticed you got the same last name as mine ;) )
VitroX
04-06-2004, 12:37 PM
this is a great hack.
how about adding the total pple who thank the thread starter?
something like:
5 Users already said Thank You!:
username1, username2, username3, username4, username5
it would fit better for my forum.
Thanks for your work!
How do I add a counter to show the total number of members who made the "Thanks"??
Thanks
VBDev
04-06-2004, 04:40 PM
I'll do it Vitrox ;)
teksigns
04-06-2004, 05:13 PM
I'll do it Vitrox ;)
cool !
cant wait
calvinnguyen
04-06-2004, 11:40 PM
@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
);
Mone'
04-09-2004, 05:25 PM
I'll do it Vitrox ;)
exellent :squareeyed:
Boofo
04-09-2004, 06:02 PM
VBDev, buddy, are you still working on this hack? ;)
VBDev
04-09-2004, 06:04 PM
No, I'm finishing an other one, 'hidden text password protected' in post :)
I take a look for this counter in the evening ;)
VBDev
04-09-2004, 09:00 PM
@ 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 :
// ############################### 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]==0 || $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 :
// thank you hack grog6
$cmpt=1;
$grumpf=$DB_site->query_first("SELECT showthanks FROM ". TABLE_PREFIX ."forum WHERE forumid='$forum[forumid]'");
if ($grumpf[showthanks] == 1 && $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'], $date, true);
$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
VBDev
04-09-2004, 09:27 PM
To add a counter, in functions_showthread.php, replace :
$thanks=$DB_site->query("SELECT * AS nb FROM ". TABLE_PREFIX ."thanks WHERE threadid='$thread[threadid]' ORDER BY username");
with
$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 :
{1} people have clicked the THANKS button
ANd in your new postbit template
Add :
<phrase 1="$thank[nb]">$vbphrase[thanks_nb]</phrase>
teksigns
04-09-2004, 10:19 PM
not sure im understanding where to put this :
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:
$nb=$DB_site->num_rows($thanks);
Boofo
04-09-2004, 10:22 PM
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.
teksigns
04-09-2004, 10:27 PM
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 :
$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 :
<phrase 1="$nb">$vbphrase[thanks_nb]</phrase>
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.
@ 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 :
// ############################### 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]==0 || $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 :
// thank you hack grog6
$cmpt=1;
$grumpf=$DB_site->query_first("SELECT showthanks FROM ". TABLE_PREFIX ."forum WHERE forumid='$forum[forumid]'");
if ($grumpf[showthanks] == 1 && $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'], $date, true);
$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
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:
<if condition="$forum['showthanks']">
and add this below the code in the template for the thank you button:
</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
Just add this above the code in the template for the thank you button:
<if condition="$forum['showthanks']">
and add this below the code in the template for the thank you button:
</if>
and the button will only show on the forums it is set for. ;)
thanks a lot!, problem fixed ;)
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
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
DamasGate
04-19-2004, 05:16 PM
Thanks for this nice hack but also i have the same problem what calvinnguyen have it
Try many times and may different ways, but still didn't work for me
same problem ... this no_permission page !!
Please if any help
Thanks
manga
04-21-2004, 11:28 AM
Hi,
I get the hack working yesterday and today it wont display any "thank you" ?!
When i press the button twice it says "You have already thank this message !" but there is nothing in the Thread !! i look all the hack again and again, all settings are like in the text...
Why it work yesterday and today not....
Eternal2u
04-25-2004, 07:25 AM
OMG
this mod ++++ign RULES..will cut the spam in half if not more on my board
BIG THANX!
bigreefer
05-08-2004, 05:47 PM
Great Hack, big ThX for it.
Bit one question left.
If I change the option "Display the 'Thank you' button" to "NO" I still see the botton on threads. Why ?
subu1
05-28-2004, 04:57 PM
nice hack - but I have a two problems:
2. If the threadicon is http://www.vbulletin.com/forum/images/icons/icon1.gif the icon is not displayed at the top of the thank you post :-/ (see attachment)
Hast Du das Problem gefixt bekommen, ich nicht, selbst beim umbennen des Icons nicht.
I dont see my ICON :ermm:
Hast Du das Problem gefixt bekommen, ich nicht, selbst beim umbennen des Icons nicht.
I dont see my ICON :ermm:
To display icon
Find in thanks_postbit_legacy
<img class="inlineimg" src="$post[iconpath]" alt="images/icons/icon1.gif"
Replace with
<img class="inlineimg" src="images/icons/icon1.gif"
subu1
05-30-2004, 12:53 AM
Strikeeeeeeeeeeeeeeeeeeeee........yeah thxxxxxxxxxxxxxxxxxxxxxxxxxx
subu1
05-30-2004, 05:21 AM
Hi Guys,
still something, is possible it to insert exactly the same as with my own vB 2.x.x version a Avatar into the postbit.
Look in my attachment :squareeyed:
greetz subu1
daveone
06-10-2004, 05:13 PM
I've got a problem (I think I made something wrong)
In the admin control center I allowed to use the thank you bot in the funforum but in no other forum!
but if you have a look here >> http://www.freaky-forum.de/showthread.php?t=224 the thank you buttons is also shown. can somebody tell me how to fix the problem?
for the people who are too lazy to click on the link. I integrated a screenshot in my post ;)
notorious
06-20-2004, 09:01 PM
nice hack took some editing here and there to get it to look right but i have a question how would i edit it so that the poster couldn't say thx for the post?
Holidazed
07-07-2004, 09:39 PM
This installed without a hitch. Thank you very much.
I do have one prob tho. Even tho I have setup a forum to not use the "Thank You" system, the "Thank You" button shows up on the page.
Ideas?
Holidazed
07-07-2004, 09:49 PM
NM, teach me to post b4 I read the thread.
Boofo
07-07-2004, 11:03 PM
NM, teach me to post b4 I read the thread.
hehe
daveone
07-13-2004, 08:12 PM
Is it possible to code this hack without the Button?
I want that there is written "Click here to thank the Author for this hack"
like on the screenshot below
http://www.freaky-forum.de/Upload%20Tetrisruler/thankyou.GIF
bubba1977
07-23-2004, 10:37 PM
Great hack.
We have been using it for a while on our forums with no problems at all.
My only question is this:
we only display the thank you button in forums that have attachements in the posts.
However it seems a lot of people are downloading the attachements and not clicking the button to thank the poster.
Is there anyway to make it so that when someone clicks to download an attachement it also automaticly makes the thank you post at the same time in forums where the button is turned on?
has anyone updated to 3.03?
i have a big problem in "SHOWTHREAD template"
the phrases are not the same and when i change it without 100% the same,
i get an error by saving it.
now i installed it 3x but nothing changed!!!!
please help me!
the whole "SHOWTHREAD template" text would be nice ;-)
Lionel
09-24-2004, 06:00 PM
I am using for automatic welcome members instead of thank you. I'd like to use also for automatic birthday greetings. How can I use a conditional to make it display a different image depending of the forums?
HarryBO
10-12-2004, 09:44 PM
I have the same Problem as azmi!
<if condition="$show['largereplybutton']">
<td class="smallfont"><a href="newreply.php?$session[sessionurl]do=newreply&noquote=1&p=$FIRSTPOSTID"><if condition="$show['closethread']"><img src="$stylevar[imgdir_button]/reply.gif" alt="$vbphrase[reply]" border="0" /><else /><img src="$stylevar[imgdir_button]/threadclosed.gif" alt="$vbphrase[closed_thread]" border="0" /></if></a></td>
<else />
This is the Showthread Template of 3.0.3
HarryBO
10-13-2004, 08:28 PM
Can nobody help?
AlphaWolf
01-22-2005, 03:30 PM
How is it possible to click on the ThankYouBotton in closed Threads?
Marco van Herwaarden
01-22-2005, 05:13 PM
I think it is not possible, this hack runs through all the standard permissions checks if i remember right.
Made a modified version of this once, with a bit more settings, that would allow thanks (optional) in closed posts/forums for that usergroup.
AlphaWolf
01-23-2005, 04:20 PM
Yes i noticed that while searching the Hack's Code for a possibility. I am still looking for a solution.
Morgalis
01-27-2005, 05:00 PM
Yes i noticed that while searching the Hack's Code for a possibility. I am still looking for a solution.
any possibility of being able to add an avatar yet? :)
It would make it look nicer IMHO
Gohan
02-22-2005, 11:40 AM
this is a great hack.
how about adding the total pple who thank the thread starter?
something like:
5 Users already said Thank You!:
username1, username2, username3, username4, username5
it would fit better for my forum.
Thanks for your work!
Just easier modify code :D
Find (Languages & Phrases):
Type : GLOBAL
Varname : thanks_1_install
Phrase : thanks {1} for this thread
Change to:
Phrase : User already said Thank You!:
Find:
Type : GLOBAL
Varname : thanks_x_install
Phrase : thank {1} for this thread
Change to:
Phrase : Users already said Thank You!:
------------------------------------------------------------------------
Find (functions_showthread.php):
$liste_user = $liste_user." <a href=\"member.php?u=$thank[userid]\">$thank[username]</a>$virg ";
Add before:
$users = $nb;
Find:
$date_thank = vbdate($vboptions['dateformat'], $thank['date'], true);
Add before:
$users = $nb;
------------------------------------------------------------------------
Find (postbit):
<div>$liste_user $thank_phrase
<br /><br /></div>
Change to:
<div>$users $thank_phrase<br /><br />$liste_user</div>
Find (postbit_legacy):
<div>$liste_user $thank_phrase
<br /><br /></div>
Change to:
<div>$users $thank_phrase<br /><br />$liste_user</div>
You're done! :D
Eternal2u
03-04-2005, 12:14 PM
I was wondering..
Anyway i could get a mod exactly like this except make it say F You..
Like it would say this in there username block on the side of there post..
"Posts: 1,401
Total F You's: 6
Was Told F You 56 Times in 21 Posts."
Would be like in addition to the thank you mod, since i want it still as well..and erm how would i go about changing the thank you mod bit on the side of the users post tjat says
"Posts/Thanks: 1,401/6
Thanked 56 Times in 21 Posts"
to
"Posts: 1,401
Total Thank You's: 6
Was Thanked 56 Times in 21 Posts."
Thanx ;)
Kei Kurono
05-08-2005, 05:23 AM
any possibility of being able to add an avatar yet? :)
It would make it look nicer IMHO
I would also like to see an avatar :]
Scotty2k
05-11-2005, 09:06 AM
I have the same Problem as azmi!
<if condition="$show['largereplybutton']">
<td class="smallfont"><a href="newreply.php?$session[sessionurl]do=newreply&noquote=1&p=$FIRSTPOSTID"><if condition="$show['closethread']"><img src="$stylevar[imgdir_button]/reply.gif" alt="$vbphrase[reply]" border="0" /><else /><img src="$stylevar[imgdir_button]/threadclosed.gif" alt="$vbphrase[closed_thread]" border="0" /></if></a></td>
<else />
This is the Showthread Template of 3.0.3
Me too .. please help !
vietfancy
01-05-2006, 11:14 PM
Does this hack works for v3.53?
Thanks. I COuldnt find this hack for our new version.
deneme2
07-07-2008, 03:35 PM
thanks
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.