##############################################################
## MOD Title: Thanks Mod for PhpBB With CH 2.1.x
## MOD Author: Kinfule <
[email protected] > (Javier B)
http://kinfule.tk
## MOD Description: This mod will add a feature for thanking the poster for his/her post.
## This mod is will work only if you have Categories Hierarchy - v2
##
## MOD Version: 1.0.5
##
## Installation Level: Intermediate
## Installation Time: 20 Minutes
## Files To Edit: 11
## admin/admin_forums.php,
## modcp.php,
## posting.php,
## viewtopic.php,
## includes/constants.php,
## includes/forums_class.php
## includes/functions.php,
## includes/functions_post.php,
## langugage/lang_english/lang_main.php,
## langugage/lang_english/lang_admin.php,
## templates/subSilver/viewtopic_body.tpl,
## Included Files: 1
## templates/subSilver/images/lang_english/thanks.gif
##
## 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:
## - You can edit a variable to choose auth_type default is auth_read.
## - It uses it own date format to chage the format, edit $timeformat value to another one.
## - This MOD needs to be enabled on a per forum basis.
## - This mod is will work only if you have Categories Hierarchy - v2.1.*
##
##############################################################
## MOD History:
## 2005-08-15 - Version 1.0.0
## - First Release
## - This is the v1.1.5 of the original Thank mod.
## - Made it work with CH v2.
##
## 2005-08-19 - Removed the edit_forum.tpl part cause it was not nessesary.
## - Fixed some stuff in viewtopic.php
##
## 2005-12-06 - Version 1.0.4
## - PhpBB Mod Template fixes.
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
##
#
#-----[ COPY ]------------------------------------------
#
copy templates/subSilver/images/lang_english/thanks.gif to templates/subSilver/images/lang_english/thanks.gif
#
#-----[ SQL ]------------------------------------------
#
CREATE TABLE `phpbb_thanks` (
`topic_id` MEDIUMINT(8) NOT NULL,
`user_id` MEDIUMINT(8) NOT NULL,
`thanks_time` INT(11) NOT NULL
);
ALTER TABLE `phpbb_forums` ADD `forum_thank` TINYINT(1) DEFAULT '0' NOT NULL;
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_forums.php
#
#-----[ FIND ]------------------------------------------
#
$forum_status = array(
FORUM_UNLOCKED => 'Status_unlocked',
FORUM_LOCKED => 'Status_locked',
);
#
#-----[ AFTER, ADD ]------------------------------------------
#
$forum_thank = array(
FORUM_THANKABLE => 'Yes',
FORUM_UNTHANKABLE => 'No',
);
#
#-----[ FIND ]------------------------------------------
#
'forum_status' => array('type' => 'radio_list', 'legend' => 'Forum_status', 'field' => 'forum_status', 'options' => $forum_status),
#
#-----[ AFTER, ADD ]------------------------------------------
#
'forum_thank' => array('type' => 'radio_list', 'legend' => 'use_thank', 'field' => 'forum_thank', 'options' => $forum_thank),
#
#-----[ FIND ]------------------------------------------
#
'forum_type', 'forum_name', 'forum_desc', 'forum_status',
#
#-----[ IN-LINE FIND ]------------------------------------------
#
, 'forum_status'
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, 'forum_thank'
#
#-----[ OPEN ]------------------------------------------
#
modcp.php
#
#-----[ FIND ]------------------------------------------
#
$sql = "DELETE
FROM " . TOPICS_TABLE . "
WHERE topic_id IN ($topic_id_sql)
OR topic_moved_id IN ($topic_id_sql)";
if ( !$db->sql_query($sql, BEGIN_TRANSACTION) )
{
message_die(GENERAL_ERROR, 'Could not delete topics', '', __LINE__, __FILE__, $sql);
}
#
#-----[ BEFORE, ADD ]------------------------------------------
#
$sql = "DELETE FROM " . THANKS_TABLE . "
WHERE topic_id IN ($topic_id_sql)";
if ( !$db->sql_query($sql, BEGIN_TRANSACTION) )
{
message_die(GENERAL_ERROR, 'Error in deleting Thanks post Information', '', __LINE__, __FILE__, $sql);
}
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]---------------------------------
#
//
// That's all, Folks!
// -------------------------------------------------
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Begin Thanks Mod
$lang['thankful'] = 'Thankful People';
$lang['thanks_to'] = 'Thanks';
$lang['thanks_end'] = 'for his/her post';
$lang['thanks_alt'] = 'Thank Post';
$lang['thanked_before'] = 'You have already thanked this topic';
$lang['thanks_add'] = 'Your thanks has been given';
$lang['thanks_not_logged'] = 'You need to log in to thank someone\'s post';
$lang['thanked'] = 'user(s) is/are thankful for this post.';
$lang['hide'] = 'Hide';
$lang['t_starter'] = 'You cannot thank yourself';
// End Thanks Mod
#
#-----[ OPEN ]---------------------------------
#
templates/subSilver/subSilver.cfg
#
#-----[ FIND ]---------------------------------
#
$images['reply_locked'] = "$current_template_images/{LANG}/reply-locked.gif";
#
#-----[ AFTER, ADD ]---------------------------------
#
$images['thanks'] = "$current_template_images/{LANG}/thanks.gif";
#
# EoM