MOD Database Manager wrote: Classification: 54 Communication
MOD Name: Thank You Mod
Author: Kinfule
MOD Description: This mod will add a feature for thanking the poster for his/her post.
Code: Select all
##############################################################
## MOD Title: Thanks mod and PhiliWeb Hide BBCode
## MOD Author: Kinfule < [email protected] > (Javier B) http://kinfule.tk
## MOD Description: This mod will change the way the hide BBcode works.
## To see the hidden message the user will have to thank the topic
## instead of posting on it.
##
## MOD Version: 1.0.1
##
## Installation Level: Easy
## Installation Time: 5 Minutes
## Files To Edit: 3
## Included Files: n/a
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
##############################################################
## MOD History:
##
## 2005-03-12 - Version 1.0.0
## - Release, My users are more important.
## 2005-03-12 - Version 1.0.1
## - Fixed Bug wich hided mesagge from topic poster.
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
posting.php
#
#-----[ FIND ]------------------------------------------
#
$sql = "SELECT p.poster_id, p.topic_id
FROM " . POSTS_TABLE . " p
WHERE p.topic_id = $topic_id
AND p.poster_id = " . $userdata['user_id'];
#
#-----[ REPLACE WITH ]------------------------------------------
#
$sql = "SELECT p.topic_id, t.topic_id
FROM " . THANKS_TABLE . " p, ". TOPICS_TABLE ." t
WHERE p.topic_id = $topic_id
AND p.user_id = " . $userdata['user_id']. "
OR t.topic_id = $topic_id
AND t.topic_poster = " . $userdata['user_id'];
#
#-----[ FIND ]------------------------------------------
#
else { $sql = "SELECT p.poster_id, p.topic_id
FROM " . POSTS_TABLE . " p
WHERE p.topic_id = $topic_id
AND p.poster_id = " . $userdata['user_id'];
#
#-----[ REPLACE WITH ]------------------------------------------
#
else { $sql = "SELECT p.topic_id, t.topic_id
FROM " . THANKS_TABLE . " p, ". TOPICS_TABLE ." t
WHERE p.topic_id = $topic_id
AND p.user_id = " . $userdata['user_id']. "
OR t.topic_id = $topic_id
AND t.topic_poster = " . $userdata['user_id'];
#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
$sql = "SELECT p.poster_id, p.topic_id
FROM " . POSTS_TABLE . " p
WHERE p.topic_id = $topic_id
AND p.poster_id = " . $userdata['user_id'];
#
#-----[ REPLACE WITH ]------------------------------------------
#
$sql = "SELECT p.topic_id, t.topic_id
FROM " . THANKS_TABLE . " p, ". TOPICS_TABLE ." t
WHERE p.topic_id = $topic_id
AND p.user_id = " . $userdata['user_id']. "
OR t.topic_id = $topic_id
AND t.topic_poster = " . $userdata['user_id'];
#
#-----[ OPEN ]------------------------------------------
#
includes/topic_review.php
#
#-----[ FIND ]------------------------------------------
#
$sql = "SELECT p.poster_id, p.topic_id
FROM " . POSTS_TABLE . " p
WHERE p.topic_id = $topic_id
AND p.poster_id = " . $userdata['user_id'];
#
#-----[ REPLACE WITH ]------------------------------------------
#
$sql = "SELECT p.topic_id, t.topic_id
FROM " . THANKS_TABLE . " p, ". TOPICS_TABLE ." t
WHERE p.topic_id = $topic_id
AND p.user_id = " . $userdata['user_id']. "
OR t.topic_id = $topic_id
AND t.topic_poster = " . $userdata['user_id'];
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Looks good.. this is definitely helpful for particular forums. Is it possible to have this feature off in some boards within one forum? I have an Image request board, and it would be cool to have this there. But I don't want it in my site announcements board or my general chat, for example. Does it let me specify which board allows the thankfulness in this version or would I need to modify it?
( Also, just so you know, you have that FuntKlakow bot registered on your demo board... Shocked )
Kinfule wrote:Looks good.. this is definitely helpful for particular forums. Is it possible to have this feature off in some boards within one forum? I have an Image request board, and it would be cool to have this there. But I don't want it in my site announcements board or my general chat, for example. Does it let me specify which board allows the thankfulness in this version or would I need to modify it?
Yes, you can. You need to activate the feature per forum.
( Also, just so you know, you have that FuntKlakow bot registered on your demo board... Shocked )
Any idea how to fix that? I delete some post and banned ip but somehow they continue to post, well atleast they don't get link for PR.
Kinfule wrote: Did you upload the image file to templates/subSilver/images/lang_english/thanks.gif?
Kinfule wrote: When you put your mouse over the X (the image) what url appears in your status bar (in the bottom of your browser)?
Code: Select all
// Create button switch
if ($userdata['user_id'] != $autor['0']['user_id'] && !$thanked)
{
$template->assign_block_vars('thanks_button', array(
'THANK_IMG' => $thank_img,
'U_THANK_TOPIC' => $thank_topic_url,
'L_THANK_TOPIC' => $thank_alt
));
}
Code: Select all
<!-- BEGIN thanks_button -->
<a href="{thanks_button.U_THANK_TOPIC}"><img src="{thanks_button.THANK_IMG}" border="0" alt="{thanks_button.L_THANK_TOPIC}" align="middle" /></a>
<!-- END thanks_button -->
</span></td>