[REQUEST] Thank You Mod

Mods etc.

Moderator: Integra Moderator

[REQUEST] Thank You Mod

PostAuthor: billsatx » Tue Jul 18, 2006 6:36 am

Hopefully, this is the right place. If not please move.

Would be interested if anyone has ported this MOD to IM. If not maybe an idea for those who have that talent. I think this would be a very popular MOD as it makes it easy to "thank" recognize a poster's efforts, thus letting the poster know that someone at least appreciates the post.

I looked at trying to do this myself and was way over my head because LOTS of the referenced code is missing because of the IM mods

Code: Select all
############################################################## ## MOD Title]http://kinfule.tk[/url] ## 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: [url=http://opensource.org/licenses/gpl-license.php]http://opensource.org/licenses/gpl-license.php[/url] GNU General Public License v2############################################################## ## For security purposes, please check: [url=http://www.phpbb.com/mods/#]http://www.phpbb.com/mods/#[/url]# 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 [url=http://www.phpbb.com/mods/#]http://www.phpbb.com/mods/#[/url]############################################################# ## 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 ]------------------------------------------#viewtopic.php  ##-----[ FIND ]---------------------------------#$forum_id = intval($forum_topic_data['forum_id']);  ##-----[ AFTER, ADD ]---------------------------------#// Begin Thanks Mod   // Setting if feature is active or not $show_thanks = ($forums->data[$forum_id]['forum_thank'] == FORUM_THANKABLE) ? FORUM_THANKABLE : FORUM_UNTHANKABLE;// End Thanks Mod  ##-----[ FIND ]---------------------------------#$reply_topic_url = append_sid("posting.$phpEx?mode=reply&" . POST_TOPIC_URL . "=$topic_id");  ##-----[ AFTER, ADD ]---------------------------------#// Begin Thanks Mod$thank_topic_url = append_sid("posting.$phpEx?mode=thank&" . POST_TOPIC_URL . "=$topic_id");// End Thanks Mod  ##-----[ FIND ]---------------------------------#$post_img = ( $forum_topic_data['forum_status'] == FORUM_LOCKED ) ? $images['post_locked'] : $images['post_new'];$post_alt = ( $forum_topic_data['forum_status'] == FORUM_LOCKED ) ? $lang['Forum_locked'] : $lang['Post_new_topic'];  ##-----[ AFTER, ADD ]---------------------------------#// Begin Thanks Mod$thank_img = $images['thanks'];$thank_alt = $lang['thanks_alt'];// End Thanks Mod  ##-----[ FIND ]---------------------------------# This is a partial line the complete line is much longer#$pagination =  ##-----[ AFTER, ADD ]---------------------------------#$current_page = get_page($total_replies, $board_config['posts_per_page'], $start);  ##-----[ FIND ]---------------------------------#//// Update the topic view counter//$sql = "UPDATE " . TOPICS_TABLE . "     SET topic_views = topic_views + 1     WHERE topic_id = $topic_id";if ( !$db->sql_query($sql) ){     message_die(GENERAL_ERROR, "Could not update topic views.", '', __LINE__, __FILE__, $sql);}##-----[ AFTER, ADD ]---------------------------------#// Begin Thanks Mod//// Get topic thanks//if ($show_thanks == FORUM_THANKABLE){     // Select Format for the date     $timeformat = "d-m, G:i";       $sql = "SELECT u.user_id, u.username, t.thanks_time          FROM " . THANKS_TABLE . " t, " . USERS_TABLE . " u          WHERE topic_id = $topic_id          AND t.user_id = u.user_id";       if ( !($result = $db->sql_query($sql)) )     {         message_die(GENERAL_ERROR, "Could not obtain thanks information", '', __LINE__, __FILE__, $sql);     }       $total_thank = $db->sql_numrows($result);     $thanksrow = array();     $thanksrow = $db->sql_fetchrowset($result);       for($i = 0; $i <total_thank>sql_fetchrow($result);         $thanker_id[$i] = $thanksrow[$i]['user_id'];         $thanker_name[$i] = $thanksrow[$i]['username'];         $thanks_date[$i] = $thanksrow[$i]['thanks_time'];           // Get thanks date         $thanks_date[$i] = create_date($timeformat, $thanks_date[$i], $board_config['board_timezone']);           // Make thanker profile link         $thanker_profile[$i] = append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$thanker_id[$i]");           $thanks .= '<a>' . $thanker_name[$i] . '</a>(' . $thanks_date[$i] . '), ';                 if ($userdata['user_id'] == $thanksrow[$i]['user_id'])         {             $thanked = TRUE;         }     }       $sql = "SELECT u.topic_poster, t.user_id, t.username             FROM " . TOPICS_TABLE . " u, " . USERS_TABLE . " t             WHERE topic_id = $topic_id             AND u.topic_poster = t.user_id";       if ( !($result = $db->sql_query($sql)) )     {         message_die(GENERAL_ERROR, "Could not obtain user information", '', __LINE__, __FILE__, $sql);     }       if( !($autor = $db->sql_fetchrowset($result)) )     {         message_die(GENERAL_ERROR, "Could not obtain user information", '', __LINE__, __FILE__, $sql);     }         $autor_name = $autor[0]['username'];     $thanks .= "".$lang['thanks_to']." $autor_name ".$lang['thanks_end']."";       // 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         ));     }    }// End Thanks Mod  ##-----[ FIND ]---------------------------------#     $template->set_switch('postrow.light', !($i % 2));     $template->set_switch('postrow.unmark_read', $cookie_setup['keep_unreads']);  ##-----[ AFTER, ADD ]---------------------------------#     // Begin Thanks Mod     if( ($show_thanks == FORUM_THANKABLE) && ($i == 0) && ($current_page == 1) && ($total_thank > 0))     {         $template->assign_block_vars('postrow.thanks', array(         'THANKFUL' => $lang['thankful'],         'THANKED' => $lang['thanked'],         'HIDE' => $lang['hide'],         'THANKS_TOTAL' => $total_thank,         'THANKS' => $thanks         )         );       }     // End Thanks Mod  ##-----[ OPEN ]---------------------------------#posting.php  ##-----[ FIND ]---------------------------------#         case 'topicreview':         $is_auth_type = 'auth_read';         break;  ##-----[ AFTER, ADD ]---------------------------------#         case 'thank':         $is_auth_type = 'auth_read';         break;  ##-----[ FIND ]---------------------------------#     case 'reply':     case 'vote':  #-----[ BEFORE, ADD ]---------------------------------     case 'thank':  ##-----[ FIND ]---------------------------------#     else if ( $mode != 'newtopic' && $post_info['topic_status'] == TOPIC_LOCKED && !$is_auth['auth_mod'])  ##-----[ IN-LINE FIND ]---------------------------------#  $mode != 'newtopic'  ##-----[ IN-LINE AFTER, ADD ]---------------------------------#   &&  $mode != 'thank'  ##-----[ FIND ]---------------------------------#         case 'reply':         case 'topicreview':  ##-----[ BEFORE, ADD ]---------------------------------#         case 'thank':  ##-----[ FIND ]---------------------------------#else if ( $mode == 'vote' ){  ##-----[ BEFORE, ADD ]---------------------------------#else if ( $mode == 'thank' ){    $topic_id = intval($HTTP_GET_VARS[POST_TOPIC_URL]);       if ( !($userdata['session_logged_in']) )       {          $message = $lang['thanks_not_logged'];          $message .=  '<br><br>' . sprintf($lang['Click_return_topic'], '<a>', '</a>');          message_die(GENERAL_MESSAGE, $message);       }       if ( empty($topic_id) )       {          message_die(GENERAL_MESSAGE, 'No topic Selected');       }         $userid = $userdata['user_id'];       $thanks_date = time();         // Check if user is the topic starter       $sql = "SELECT `topic_poster`             FROM " . TOPICS_TABLE . "             WHERE `topic_id` = $topic_id             AND `topic_poster` = $userid";       if ( !($result = $db->sql_query($sql)) )       {          message_die(GENERAL_ERROR, "Couldn't check for topic starter", '', __LINE__, __FILE__, $sql);                       }         if ( ($topic_starter_check = $db->sql_fetchrow($result)) )       {          $message = $lang['t_starter'];          $message .=  '<br><br>' . sprintf($lang['Click_return_topic'], '<a>', '</a>');          message_die(GENERAL_MESSAGE, $message);       }         // Check if user had thanked before       $sql = "SELECT `topic_id`             FROM " . THANKS_TABLE . "             WHERE `topic_id` = $topic_id             AND `user_id` = $userid";       if ( !($result = $db->sql_query($sql)) )       {          message_die(GENERAL_ERROR, "Couldn't check for previous thanks", '', __LINE__, __FILE__, $sql);                       }       if ( !($thankfull_check = $db->sql_fetchrow($result)) )       {          // Insert thanks if he/she hasn't          $sql = "INSERT INTO " . THANKS_TABLE . " (`topic_id`, `user_id`, `thanks_time`)          VALUES ('" . $topic_id . "', '" . $userid . "', " . $thanks_date . ") ";          if ( !($result = $db->sql_query($sql)) )          {             message_die(GENERAL_ERROR, "Could not insert thanks information", '', __LINE__, __FILE__, $sql);                          }          $message = $lang['thanks_add'];       }       else       {          $message = $lang['thanked_before'];       }         $template->assign_vars(array(          'META' => '<meta>')       );         $message .=  '<br><br>' . sprintf($lang['Click_return_topic'], '<a>', '</a>');             message_die(GENERAL_MESSAGE, $message);   }  ##-----[ OPEN ]---------------------------------#includes/constants.php  ##-----[ FIND ]---------------------------------#define('FORUM_UNLOCKED', 0);define('FORUM_LOCKED', 1);  ##-----[ AFTER, ADD ]---------------------------------#  // Forum Thanks statedefine('FORUM_UNTHANKABLE', 0);define('FORUM_THANKABLE', 1);  ##-----[ FIND ]---------------------------------#define('SMILIES_TABLE', $table_prefix.'smilies');  ##-----[ AFTER, ADD ]---------------------------------#define('THANKS_TABLE', $table_prefix.'thanks');  # #-----[ OPEN ]------------------------------------------ #includes/class_forums.php  # #-----[ FIND ]------------------------------------------ #'forum_board_box',  # #-----[ AFTER, ADD ]------------------------------------------ #'forum_thank',    ##-----[ OPEN ]---------------------------------#includes/functions.php  ##-----[ FIND ]---------------------------------#function generate_pagination  ##-----[ BEFORE, ADD ]---------------------------------#function get_page($num_items, $per_page, $start_item){       $total_pages = ceil($num_items/$per_page);       if ( $total_pages == 1 )     {         return '1';         exit;     }       $on_page = floor($start_item / $per_page) + 1;     $page_string = '';       for($i = 0; $i <total_pages>sql_query($sql))                 {                     message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);                 }  ##-----[ AFTER, ADD ]---------------------------------#               $sql = "DELETE FROM " . THANKS_TABLE . "                 WHERE topic_id = $topic_id";             if (!$db->sql_query($sql))             {                 message_die(GENERAL_ERROR, 'Error in deleting Thanks post Information', '', __LINE__, __FILE__, $sql);             }  ##-----[ OPEN ]------------------------------------------ #language/lang_english/lang_admin.php     ##-----[ FIND ]---------------------------------#//// That's all Folks!// -------------------------------------------------  ##-----[ BEFORE, ADD ]------------------------------------------ #// Begin Thanks Mod$lang['use_thank'] = 'Allow to Thank posts';// End Thanks Mod  ##-----[ 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";  ##-----[ OPEN ]---------------------------------#templates/subSilver/viewtopic_body.tpl  ##-----[ FIND ]---------------------------------# This is a partial line, the complete line is much longer#<a>  ##-----[ IN-LINE FIND ]---------------------------------#</a></span></td>  # #-----[ IN-LINE REPLACE WITH ]------------------------------------------ #</a>##-----[ AFTER, ADD ]---------------------------------#<BEGIN>   <a><img></a><END></span></td>  ##-----[ FIND ]---------------------------------#     <END>  ##-----[ BEFORE, ADD ]---------------------------------#     <BEGIN>     <tr>         <td>             <table>                 <tr>                     <th>{postrow.thanks.THANKFUL}</th>                 </tr>                 <tr>                     <td>                         <span>                         <a>{postrow.thanks.THANKS_TOTAL}</a> {postrow.thanks.THANKED}                                   </span>                         <span>                             {postrow.thanks.THANKS}                             <br><br><div><a>[ {postrow.thanks.HIDE} ]</a></div>                         </span>                     </td>                     </tr>             </table>         </td>     </tr>     <END>  ##-----[ FIND ]---------------------------------# This is a partial line, the complete line is much longer#<a>  ##-----[ IN-LINE FIND ]---------------------------------#</a></span></td>    # #-----[ IN-LINE REPLACE WITH ]------------------------------------------ #</a>##-----[ AFTER, ADD ]---------------------------------#<BEGIN>   <a><img></a><END></span></td>  ##-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ ## EoM
Last edited by billsatx on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

billsatx
Members
Members
 
Posts: 36
Likes: 0 post
Liked in: 0 post
Joined: Wed Jun 21, 2006 9:38 am
Cash on hand: 0.00

Re: [REQUEST] Thank You Mod

PostAuthor: found it » Fri Jul 21, 2006 3:07 am

hi

This mod is made so that it works with catergory hierachy 2.1+.....

It is very unlikly that it will work at or with IntegrMod as the code for cats hier is so much different compared to that of phpBB..

Is there not a version without cats heir 2.1?

:mrgreen:
Last edited by found it on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
[url=http]themes.[/url]
http://www.founditforum.com :: [url=http]Joining people together[/url]

[url=http][img=left]http://www.bbful.com/bbful_banner2.png[/img][/url]
User avatar
found it
Dev Team
Dev Team
 
Posts: 792
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 4:29 am
Cash on hand: 0.00

Re: [REQUEST] Thank You Mod

PostAuthor: billsatx » Fri Jul 21, 2006 9:41 am

yes....here it is.

Code: Select all
############################################################## ## MOD Title]http://kinfule.tk[/url] ## MOD Description: This mod will add a feature for thanking the poster for his/her post.##                   ## MOD Version: 1.1.9## ## 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/functions.php,##                               includes/functions_post.php,##                langugage/lang_english/lang_main.php,##                langugage/lang_english/lang_admin.php,##                templates/subSilver/viewtopic_body.tpl,##                templates/subSilver/admin/forum_edit_body.tpl## Included Files: 1##                               templates/subSilver/images/lang_english/thanks.gif   #### License: [url=http://opensource.org/licenses/gpl-license.php]http://opensource.org/licenses/gpl-license.php[/url] GNU General Public License v2############################################################## ## For security purposes, please check: [url=http://www.phpbb.com/mods/#]http://www.phpbb.com/mods/#[/url]# 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 [url=http://www.phpbb.com/mods/#]http://www.phpbb.com/mods/#[/url]############################################################# ## 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.## ############################################################## ## MOD History: ##   2005-02-25 - Version 0.0.1 ##           - First Release####   2005-02-25 - Version 0.0.2 ##           - Fixed bug wich allowed guests to thank.####   2005-02-26 - Version 1.0.0##           - Version 1.0.0 for the Mod Database.####   2005-03-01 - Version 1.0.1##           - Fixed all said by the Mod Team on PhpBB.com.##           - Checked to work with PhpBB version 2.0.13.####   2005-03-04 - Version 1.0.1##           - I was told about some errors in html, they are Fixed.##           - I was given a better image By Dude, Thanks Dude.##           - No version change cause no bugfixes have been done, just replaced a <tr></tr> to </tr><tr>.####   2005-03-04 - Version 1.0.2##           - I got told about an error in viewtopic with the table, Fixed.##           - SQL fixed.####   2005-03-06 - Version 1.0.3##           - Posible SQL injection fixed.##           - SQL fixed.####   2005-03-12 - Version 1.0.4##           - Query Optimization in viewtopic.php####   2005-04-08 - Version 1.1.0##           - Now it only appears in first page only.##           - Added the use of constants.####   2005-04-24 - Version 1.1.1##           - XHTML compliant.####   2005-06-06 - Version 1.1.2##           - Added: Delete thanks entries when a post is deleted.####   2005-06-22 - Version 1.1.3##           - Added: Meta Redirection after thanking post.##           - Added: CSS hiding for complete thanks list.####   2005-06-26 - Version 1.1.4##           - Fix some stuff with the mod template.####   2005-07-07 - Version 1.1.5##           - Improved the display/hide method. (Thanks Stoebi)####   2005-08-06 - Version 1.1.6##           - Fixed bug in modcp.php.##           - Now you cannot thank yourself.##           - Fixed grammar error on posting.php.##           - Commented some partial lines in FINDs to help people finding them.####   2005-10-30 - Version 1.1.7##           - Allow to thank locked topics.####   2005-12-06 - Version 1.1.8##           - 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 ]------------------------------------------#                 $forumstatus = $row['forum_status'];  ##-----[ AFTER, ADD ]------------------------------------------#                 $forumthank = $row['forum_thank'];  ##-----[ FIND ]------------------------------------------#                 $forumstatus = FORUM_UNLOCKED;  ##-----[ AFTER, ADD ]------------------------------------------#                 $forumthank = FORUM_UNTHANKABLE;  ##-----[ FIND ]------------------------------------------#                 $statuslist .= "<option>" . $lang['Status_locked'] . "</option>n";  ##-----[ AFTER, ADD ]------------------------------------------#             // Begin Thank Mod             $thank_yes = ($forumthank) ? 'checked="checked"' : '';             $thank_no = (!$forumthank) ? 'checked="checked"' : '';             // End Thank Mod         ##-----[ FIND ]------------------------------------------#                 'S_STATUS_LIST' => $statuslist,  ##-----[ AFTER, ADD ]------------------------------------------#                 "THANK_ENABLE" => $thank_yes,                 "THANK_DISABLE" => $thank_no,  ##-----[ FIND ]------------------------------------------#                 'L_FORUM_STATUS' => $lang['Forum_status'],  ##-----[ AFTER, ADD ]------------------------------------------#                 'L_FORUM_THANK' => $lang['use_thank'],                 'L_YES' => $lang['Yes'],                 'L_NO' => $lang['No'],  ##-----[ FIND ]------------------------------------------# This may be a partial find and not the whole line.#                 $sql = "INSERT INTO " . FORUMS_TABLE . "  ##-----[ IN-LINE FIND ]------------------------------------------#" . $field_sql . "  ##-----[ IN-LINE AFTER, ADD ]------------------------------------------#, forum_thank  ##-----[ FIND ]------------------------------------------# This may be a partial find and not the whole line.#                 VALUES ('" . $next_id . "', '" . str_replace("'", "''",  ##-----[ IN-LINE FIND ]------------------------------------------#$value_sql . "  ##-----[ IN-LINE AFTER, ADD ]------------------------------------------#, " . intval($HTTP_POST_VARS['forumthank']) . "  ##-----[ FIND ]---------------------------------# This may be a partial find and not the whole line.             $sql = "UPDATE " . FORUMS_TABLE . "                 SET forum_name  ##-----[ IN-LINE FIND ]-------------------------#" . intval($HTTP_POST_VARS['prune_enable']) . "  ##-----[ IN-LINE AFTER, ADD ]---------------------------------#, forum_thank = " . intval($HTTP_POST_VARS['forumthank']) . "  # #-----[ 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 ]------------------------------------------#viewtopic.php  ##-----[ FIND ]---------------------------------#$forum_id = intval($forum_topic_data['forum_id']);  ##-----[ AFTER, ADD ]---------------------------------#// Begin Thanks Mod       // Check if the Thanks feature is active for this forum$sql = "SELECT `forum_thank`         FROM " . FORUMS_TABLE . "         WHERE  forum_id =$forum_id";if ( !($result = $db->sql_query($sql)) ){     message_die(GENERAL_ERROR, "Could not obtain forum information", '', __LINE__, __FILE__, $sql);}if ( !($forum_thank_result = $db->sql_fetchrow($result)) ){     message_die(GENERAL_MESSAGE, $lang['thank_no_exist']);}     // Setting if feature is active or not       $show_thanks = ($forum_thank_result['forum_thank'] == FORUM_THANKABLE) ? FORUM_THANKABLE : FORUM_UNTHANKABLE;  // End Thanks Mod  ##-----[ FIND ]---------------------------------#$reply_topic_url = append_sid("posting.$phpEx?mode=reply&" . POST_TOPIC_URL . "=$topic_id");  ##-----[ AFTER, ADD ]---------------------------------#// Begin Thanks Mod$thank_topic_url = append_sid("posting.$phpEx?mode=thank&" . POST_TOPIC_URL . "=$topic_id");// End Thanks Mod  ##-----[ FIND ]---------------------------------#$post_img = ( $forum_topic_data['forum_status'] == FORUM_LOCKED ) ? $images['post_locked'] : $images['post_new'];$post_alt = ( $forum_topic_data['forum_status'] == FORUM_LOCKED ) ? $lang['Forum_locked'] : $lang['Post_new_topic'];  ##-----[ AFTER, ADD ]---------------------------------#// Begin Thanks Mod$thank_img = $images['thanks'];$thank_alt = $lang['thanks_alt'];// End Thanks Mod  ##-----[ FIND ]---------------------------------## the whole line is: $pagination = ( $highlight != '' ) ? generate_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&postdays=$post_days&postorder=$post_order&highlight=$highlight", $total_replies, $board_config['posts_per_page'], $start) : generate_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&postdays=$post_days&postorder=$post_order", $total_replies, $board_config['posts_per_page'], $start);#$pagination =  ##-----[ AFTER, ADD ]---------------------------------#$current_page = get_page($total_replies, $board_config['posts_per_page'], $start);  ##-----[ FIND ]---------------------------------#//// Update the topic view counter//$sql = "UPDATE " . TOPICS_TABLE . "     SET topic_views = topic_views + 1     WHERE topic_id = $topic_id";if ( !$db->sql_query($sql) ){     message_die(GENERAL_ERROR, "Could not update topic views.", '', __LINE__, __FILE__, $sql);}##-----[ AFTER, ADD ]---------------------------------#// Begin Thanks Mod//// Get topic thanks//if ($show_thanks == FORUM_THANKABLE){     // Select Format for the date     $timeformat = "d-m, G:i";       $sql = "SELECT u.user_id, u.username, t.thanks_time          FROM " . THANKS_TABLE . " t, " . USERS_TABLE . " u          WHERE topic_id = $topic_id          AND t.user_id = u.user_id";       if ( !($result = $db->sql_query($sql)) )     {         message_die(GENERAL_ERROR, "Could not obtain thanks information", '', __LINE__, __FILE__, $sql);     }       $total_thank = $db->sql_numrows($result);     $thanksrow = array();     $thanksrow = $db->sql_fetchrowset($result);       for($i = 0; $i <total_thank>sql_fetchrow($result);         $thanker_id[$i] = $thanksrow[$i]['user_id'];         $thanker_name[$i] = $thanksrow[$i]['username'];         $thanks_date[$i] = $thanksrow[$i]['thanks_time'];           // Get thanks date         $thanks_date[$i] = create_date($timeformat, $thanks_date[$i], $board_config['board_timezone']);           // Make thanker profile link         $thanker_profile[$i] = append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$thanker_id[$i]");           $thanks .= '<a>' . $thanker_name[$i] . '</a>(' . $thanks_date[$i] . '), ';                 if ($userdata['user_id'] == $thanksrow[$i]['user_id'])         {             $thanked = TRUE;         }     }       $sql = "SELECT u.topic_poster, t.user_id, t.username             FROM " . TOPICS_TABLE . " u, " . USERS_TABLE . " t             WHERE topic_id = $topic_id             AND u.topic_poster = t.user_id";       if ( !($result = $db->sql_query($sql)) )     {         message_die(GENERAL_ERROR, "Could not obtain user information", '', __LINE__, __FILE__, $sql);     }       if( !($autor = $db->sql_fetchrowset($result)) )     {         message_die(GENERAL_ERROR, "Could not obtain user information", '', __LINE__, __FILE__, $sql);     }         $autor_name = $autor[0]['username'];     $thanks .= "".$lang['thanks_to']." $autor_name ".$lang['thanks_end']."";       // 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         ));     }    }// End Thanks Mod  ##-----[ FIND ]---------------------------------#         'U_POST_ID' => $postrow[$i]['post_id'])     );  ##-----[ AFTER, ADD ]---------------------------------#     // Begin Thanks Mod     if( ($show_thanks == FORUM_THANKABLE) && ($i == 0) && ($current_page == 1) && ($total_thank > 0))     {         $template->assign_block_vars('postrow.thanks', array(         'THANKFUL' => $lang['thankful'],         'THANKED' => $lang['thanked'],         'HIDE' => $lang['hide'],         'THANKS_TOTAL' => $total_thank,         'THANKS' => $thanks         )         );       }     // End Thanks Mod  ##-----[ OPEN ]---------------------------------#posting.php  ##-----[ FIND ]---------------------------------#         case 'topicreview':         $is_auth_type = 'auth_read';         break;  ##-----[ AFTER, ADD ]---------------------------------#         case 'thank':         $is_auth_type = 'auth_read';         break;  ##-----[ FIND ]---------------------------------#     case 'reply':     case 'vote':  #-----[ BEFORE, ADD ]---------------------------------     case 'thank':  ##-----[ FIND ]---------------------------------#     else if ( $mode != 'newtopic' && $post_info['topic_status'] == TOPIC_LOCKED && !$is_auth['auth_mod'])  ##-----[ IN-LINE FIND ]---------------------------------#  $mode != 'newtopic'  ##-----[ IN-LINE AFTER, ADD ]---------------------------------#   &&  $mode != 'thank'  ##-----[ FIND ]---------------------------------#         case 'reply':         case 'topicreview':  ##-----[ BEFORE, ADD ]---------------------------------#         case 'thank':  ##-----[ FIND ]---------------------------------#else if ( $mode == 'vote' ){  ##-----[ BEFORE, ADD ]---------------------------------#else if ( $mode == 'thank' ) {     $topic_id = intval($HTTP_GET_VARS[POST_TOPIC_URL]);         if ( !($userdata['session_logged_in']) )         {             $message = $lang['thanks_not_logged'];             $message .=  '<br><br>' . sprintf($lang['Click_return_topic'], '<a>', '</a>');             message_die(GENERAL_MESSAGE, $message);         }         if ( empty($topic_id) )         {             message_die(GENERAL_MESSAGE, 'No topic Selected');         }           $userid = $userdata['user_id'];         $thanks_date = time();           // Check if user is the topic starter         $sql = "SELECT `topic_poster`                 FROM " . TOPICS_TABLE . "                 WHERE topic_id = $topic_id                 AND topic_poster = $userid";         if ( !($result = $db->sql_query($sql)) )         {             message_die(GENERAL_ERROR, "Couldn't check for topic starter", '', __LINE__, __FILE__, $sql);                             }           if ( ($topic_starter_check = $db->sql_fetchrow($result)) )         {             $message = $lang['t_starter'];             $message .=  '<br><br>' . sprintf($lang['Click_return_topic'], '<a>', '</a>');             message_die(GENERAL_MESSAGE, $message);         }           // Check if user had thanked before         $sql = "SELECT `topic_id`                 FROM " . THANKS_TABLE . "                 WHERE topic_id = $topic_id                 AND user_id = $userid";         if ( !($result = $db->sql_query($sql)) )         {             message_die(GENERAL_ERROR, "Couldn't check for previous thanks", '', __LINE__, __FILE__, $sql);                             }         if ( !($thankfull_check = $db->sql_fetchrow($result)) )         {             // Insert thanks if he/she hasn't             $sql = "INSERT INTO " . THANKS_TABLE . " (topic_id, user_id, thanks_time)             VALUES ('" . $topic_id . "', '" . $userid . "', " . $thanks_date . ") ";             if ( !($result = $db->sql_query($sql)) )             {                 message_die(GENERAL_ERROR, "Could not insert thanks information", '', __LINE__, __FILE__, $sql);                                 }             $message = $lang['thanks_add'];         }         else         {             $message = $lang['thanked_before'];         }           $template->assign_vars(array(             'META' => '<meta>')         );           $message .=  '<br><br>' . sprintf($lang['Click_return_topic'], '<a>', '</a>');                 message_die(GENERAL_MESSAGE, $message);  }  ##-----[ OPEN ]---------------------------------#includes/constants.php  ##-----[ FIND ]---------------------------------#define('FORUM_UNLOCKED', 0);define('FORUM_LOCKED', 1);  ##-----[ AFTER, ADD ]---------------------------------#  // Forum Thanks statedefine('FORUM_UNTHANKABLE', 0);define('FORUM_THANKABLE', 1);  ##-----[ FIND ]---------------------------------#define('SMILIES_TABLE', $table_prefix.'smilies');  ##-----[ AFTER, ADD ]---------------------------------#define('THANKS_TABLE', $table_prefix.'thanks');  ##-----[ OPEN ]---------------------------------#includes/functions.php  ##-----[ FIND ]---------------------------------#function generate_pagination  ##-----[ BEFORE, ADD ]---------------------------------#function get_page($num_items, $per_page, $start_item){       $total_pages = ceil($num_items/$per_page);       if ( $total_pages == 1 )     {         return '1';         exit;     }       $on_page = floor($start_item / $per_page) + 1;     $page_string = '';       for($i = 0; $i <total_pages>sql_query($sql))                 {                     message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);                 }  ##-----[ AFTER, ADD ]---------------------------------#               $sql = "DELETE FROM " . THANKS_TABLE . "                 WHERE topic_id = $topic_id";             if (!$db->sql_query($sql))             {                 message_die(GENERAL_ERROR, 'Error in deleting Thanks post Information', '', __LINE__, __FILE__, $sql);             }  ##-----[ OPEN ]------------------------------------------ #language/lang_english/lang_admin.php     ##-----[ FIND ]---------------------------------#?>  ##-----[ BEFORE, ADD ]------------------------------------------ #// Begin Thanks Mod$lang['use_thank'] = 'Allow to Thank posts';// End Thanks Mod  ##-----[ OPEN ]------------------------------------------ #language/lang_english/lang_main.php     ##-----[ FIND ]---------------------------------#?>  ##-----[ 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';$lang['thank_no_exist'] = 'Forum thank information doesn't exists';// 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";  ##-----[ OPEN ]---------------------------------#templates/subSilver/admin/forum_edit_body.tpl  ##-----[ FIND ]---------------------------------#     <tr>       <td>{L_FORUM_STATUS}</td>       <td><select>{S_STATUS_LIST}</select></td>     </tr>  ##-----[ AFTER, ADD ]---------------------------------#     <tr>       <td>{L_FORUM_THANK}</td>       <td><INPUT>{L_YES}   <INPUT>{L_NO}</td>     </tr>  ##-----[ OPEN ]---------------------------------#templates/subSilver/viewtopic_body.tpl  ##-----[ FIND ]---------------------------------# This is a partial line, the complete line is much longer#<a>  ##-----[ IN-LINE FIND ]---------------------------------#</a></span></td>  # #-----[ IN-LINE REPLACE WITH ]------------------------------------------ #</a>##-----[ AFTER, ADD ]---------------------------------#<BEGIN>   <a><img></a><END></span></td>  ##-----[ FIND ]---------------------------------#     <END>  ##-----[ BEFORE, ADD ]---------------------------------#     <BEGIN>     <tr>         <td>             <table>                 <tr>                     <th>{postrow.thanks.THANKFUL}</th>                 </tr>                 <tr>                     <td>                         <span>                         <a>{postrow.thanks.THANKS_TOTAL}</a> {postrow.thanks.THANKED}                                   </span>                         <span>                             {postrow.thanks.THANKS}                             <br><br><div><a>[ {postrow.thanks.HIDE} ]</a></div>                         </span>                     </td>                     </tr>             </table>         </td>     </tr>     <END>  ##-----[ FIND ]---------------------------------# This is a partial line, the complete line is much longer#<a>  ##-----[ IN-LINE FIND ]---------------------------------#</a></span></td>  # #-----[ IN-LINE REPLACE WITH ]------------------------------------------ #</a>##-----[ AFTER, ADD ]---------------------------------#<BEGIN>   <a><img></a><END></span></td>  ##-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ ## EoM
Last edited by billsatx on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

billsatx
Members
Members
 
Posts: 36
Likes: 0 post
Liked in: 0 post
Joined: Wed Jun 21, 2006 9:38 am
Cash on hand: 0.00

PostAuthor: zenrei » Sun Sep 23, 2007 2:48 pm

i like this feature! any chance of it being modded for 141?
Last edited by zenrei on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
IntegraMOD 141 RULES!!
[img=left]http://www.falloutzone.net/foz/images/smiles/attentionwhore.gif[/img]

[url=http]Click here to go to my site built with IntegraMOD 141[/url] <img>
User avatar
zenrei
Sr Integra Member
Sr Integra Member
 
Posts: 286
Likes: 0 post
Liked in: 0 post
Joined: Mon Oct 09, 2006 8:36 am
Cash on hand: 0.00

PostAuthor: zenrei » Thu Oct 25, 2007 2:29 am

yeahh... too much code is different in this for me to even test drive it.
Last edited by zenrei on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
IntegraMOD 141 RULES!!
[img=left]http://www.falloutzone.net/foz/images/smiles/attentionwhore.gif[/img]

[url=http]Click here to go to my site built with IntegraMOD 141[/url] <img>
User avatar
zenrei
Sr Integra Member
Sr Integra Member
 
Posts: 286
Likes: 0 post
Liked in: 0 post
Joined: Mon Oct 09, 2006 8:36 am
Cash on hand: 0.00


Return to IntegraMOD Modifications

Who is online

Registered users: App360MonitorBot, Bing [Bot], Google [Bot], Helter