[DEV] Thank Post Mod (hide MOD compatible ) 0.2.0

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Scam Warning
Locked
scorpio4646
Registered User
Posts: 80
Joined: Wed Dec 30, 2009 5:19 pm

Re: [DEV] Thank Post Mod (hide MOD compatible ) 0.2.0

Post by scorpio4646 »

scorpio4646 wrote:ok now I ve got the button showing when I click on it it shws thanks at bottom of topic, but it doesn't show in the users details on side of post ie Thanked = nothing ,Thanks = nothing

any ideas
could really do with an answer to this one PLEEEEZ :cry:
User avatar
Ephemeraboy
Registered User
Posts: 331
Joined: Tue Dec 29, 2009 4:25 pm
Location: Bandung Kota Hujan
Name: Bernando Bona Tius Sianipar
Contact:

Re: [DEV] Thank Post Mod (hide MOD compatible ) 0.2.0

Post by Ephemeraboy »

is your thanks mod..
adapted from http://www.phpbb.com/community/viewtopi ... &t=1690905
or no...??
thx
My diary, my notepad, and my life on
http://www.bonatius.com
My online shop at
http://www.nefara.com
tzar
Registered User
Posts: 73
Joined: Mon Nov 03, 2008 1:11 pm

Re: [DEV] Thank Post Mod (hide MOD compatible ) 0.2.0

Post by tzar »

Thaitanium wrote:I have 0.4.0, does anyone know the edits to make it compatible with this mod. Undoing the edits will be painful.
If possible please provide necessary edits of viewtopic.php for 0.4.0
I have the same problem. Does anybody know how to solve this ?

Thanks for advice.

Anyone ?
hawx
Registered User
Posts: 1
Joined: Wed Feb 03, 2010 2:38 pm

Re: [DEV] Thank Post Mod (hide MOD compatible ) 0.2.0

Post by hawx »

i have this problem :
Image
can help me pls ??
FrankTC
Registered User
Posts: 2
Joined: Mon Aug 20, 2007 7:56 pm

Re: [DEV] Thank Post Mod (hide MOD compatible ) 0.2.0

Post by FrankTC »

What is de error in this?

This error occurs when I press the THANKS button.
General Error
SQL ERROR [ mysql4 ]

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 '' at line 3 [1064]

SQL

SELECT topic_status FROM phpbb_topics WHERE topic_id =

BACKTRACE


FILE: includes/db/mysql.php
LINE: 174
CALL: dbal->sql_error()

FILE: thanks.php
LINE: 46
CALL: dbal_mysql->sql_query()
This is a great MOD, that I would love to use! Can someone help me? Thanks!

Greetz,
Frank

//// EDIT: !!!!
I already got my solution on page 37 of this topic! Thanks to Mahoney!
LINK: http://www.phpbb.com/community/viewtopi ... #p10595595
User avatar
Mahoney
Registered User
Posts: 196
Joined: Sun Mar 16, 2008 4:07 pm
Contact:

Re: [DEV] Thank Post Mod (hide MOD compatible ) 0.2.0

Post by Mahoney »

hawx wrote:i have this problem :

Code: Select all

SQL ERROR [ mysql4 ]

Unknown column 'enable_thanks' in 'field list' [1054]
can help me pls ??
Did you do the SQL Updates?

best regards Mahoney
mapquest
Registered User
Posts: 20
Joined: Thu Feb 11, 2010 5:02 pm
Location: http://www.elitehack.net
Contact:

Re: [DEV] Thank Post Mod (hide MOD compatible ) 0.2.0

Post by mapquest »

Does this work with premod seo?
ShadowFS
Registered User
Posts: 38
Joined: Mon Aug 10, 2009 10:37 pm
Location: Brasil

Re: [DEV] Thank Post Mod (hide MOD compatible ) 0.2.0

Post by ShadowFS »

smsc wrote:
smsc wrote:Hello, I installed the Thanks Mod plus HIDE integration...
All working fine, but is it possible to remove HIDE only with thanks?
I mean, currenty I can remove HIDE with thanks, but also with REPLY. I would like to remove HIDE only with Thanks!

Could someone advice me?

Thanks!
Found myself ;)

Just remove following lines from viewtopic.php:

Code: Select all

      if ($unhide == false)
      {
         $sql = "SELECT poster_id, topic_id
           FROM " . POSTS_TABLE . "
           WHERE topic_id = $topic_id
           AND poster_id = " . $user->data['user_id'];

         $result = $db->sql_query($sql);
         $unhide = $db->sql_affectedrows($result) ? true : false;
         $db->sql_freeresult($result);
       }
If i remove this, the topic owner can't view the hidden content :\
UserFriendly7
Registered User
Posts: 15
Joined: Thu Feb 03, 2005 5:56 pm

Re: [DEV] Thank Post Mod (hide MOD compatible ) 0.2.0

Post by UserFriendly7 »

OK A couple of questions :o

I've edited all the files by the books, like many had a few problems but managed to iron them out apart from two major things.

1. The button wont display (it is enabled in the ACP for the correct forum)

2. The thanked number on the profile doesn't display a value

Is there any solution to this? Or can anyone recommend a different mod that achieves the same thing?

Regards
Petesat
Registered User
Posts: 63
Joined: Thu Apr 10, 2008 8:42 am

Re: [DEV] Thank Post Mod (hide MOD compatible ) 0.2.0

Post by Petesat »

I have a request for this mod.

I have used it for quite a while now, and think it is the best of it's type, and works on the last PHPBB update with no problems.

But, my users have asked me is there a way to show the recent thanks that have happened on the forum, as they would like to know what is being appreciated on the forum, so they can do more of the same, and less of the other stuff that is not being thanked.

Thanks in advance.

Pete
Petesat
Registered User
Posts: 63
Joined: Thu Apr 10, 2008 8:42 am

Re: [DEV] Thank Post Mod (hide MOD compatible ) 0.2.0

Post by Petesat »

UserFriendly7 wrote:OK A couple of questions :o

I've edited all the files by the books, like many had a few problems but managed to iron them out apart from two major things.

1. The button wont display (it is enabled in the ACP for the correct forum)

2. The thanked number on the profile doesn't display a value

Is there any solution to this? Or can anyone recommend a different mod that achieves the same thing?

Regards
Try refreshing your style templates to show the button.

There is obviously no numbers there till it is actually used.

I hope this was helpful.

Pete
apnaitaly
Registered User
Posts: 323
Joined: Tue Jun 30, 2009 6:13 pm

Re: [DEV] Thank Post Mod (hide MOD compatible ) 0.2.0

Post by apnaitaly »

can you please tell me how i can Remove THanks Mod in my SQL ,,

bcz i have installed this Mod , but i have uninstall this mod ,, now when i want to delete post its showing me error

Code: Select all

General Error
SQL ERROR [ mysql4 ]

Table 'database_forum.THANKS_TABLE' doesn't exist [1146]

SQL

DELETE FROM THANKS_TABLE WHERE post_id IN (40349, 41588, 41590)

BACKTRACE

FILE: includes/db/mysql.php
LINE: 174
CALL: dbal->sql_error()

FILE: includes/functions_admin.php
LINE: 812
CALL: dbal_mysql->sql_query()

FILE: includes/functions_admin.php
LINE: 649
CALL: delete_posts()

FILE: includes/mcp/mcp_main.php
LINE: 826
CALL: delete_topics()

FILE: includes/mcp/mcp_main.php
LINE: 119
CALL: mcp_delete_topic()

FILE: includes/functions_module.php
LINE: 507
CALL: mcp_main->main()

FILE: includes/functions_module.php
LINE: 802
CALL: p_master->load_active()

FILE: mcp.php
LINE: 169
CALL: p_master->load()
so can you please tell me wat i have to do ,, Thanks
Last edited by apnaitaly on Fri Apr 16, 2010 6:08 pm, edited 1 time in total.
davejo90
Registered User
Posts: 36
Joined: Sun Jul 31, 2005 8:07 pm
Contact:

Re: [DEV] Thank Post Mod (hide MOD compatible ) 0.2.0

Post by davejo90 »

Thanks for this mod.

All working Ok 0n 3.0.7.PL1 :D
User avatar
Meis2M
Translator
Posts: 914
Joined: Wed Mar 03, 2010 11:32 am
Location: IR.Damghan
Name: میثم نوبری
Contact:

Re: [DEV] Thank Post Mod (hide MOD compatible ) 0.2.0

Post by Meis2M »

yes its a good mod... but in this mod we can not underestand where thanks in topic or posts in profile... :ugeek:
phpBB persian international support
Follow us in Instagram
Free upgrade and install extensions on your forum - drop me PM
Ultimate phpBB SEO Friendly URL extension
piegus
Registered User
Posts: 31
Joined: Mon Dec 17, 2007 10:22 pm

Re: [DEV] Thank Post Mod (hide MOD compatible ) 0.2.0

Post by piegus »

Mod cant be installed using automod
I just edited the install.xml tpo be able to install using automod on the newset version od 3.0.7-PL1
This is the source of INSTALL.XML:

Code: Select all

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<?xml-stylesheet type="text/xsl" href="modx.prosilver.en.xsl"?>
<!--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/-->
<mod xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.phpbb.com/mods/xml/modx-1.2.0.xsd">
	<header>
		<license>http://opensource.org/licenses/gpl-license.php GNU General Public License v2</license>
		
		<title lang="en">Thank Post Mod (hide MOD compatible )</title>
		<title lang="de">Thank Post Mod (hide MOD kompatibel )</title>
		
		<description lang="en-gb">[After installing this mod, user can give thanks in post.</description>
		<description lang="de">Nach Installation des MODs, können sich die Benutzer des Forums bei anderen Benutzern bedanken.</description>
		
		
		<author-notes lang="en">The MOD based of idiotnesias 'Thanks First Post' MOD.</author-notes>
		<author-notes lang="de">Dieser MOD basiert auf idiotnesias "Dank First Post" MOD.</author-notes>
		
		<author-group>
			<author>
				<realname>Pungky</realname>
				<email>pungkerz@gmail.com</email>
				<username>idiotnesia</username>
				<homepage>http://www.forumkomputer.web.id/</homepage>
			</author>
			<author>
				<realname>Ralf Fuhrmann</realname>
				<email>mahony@phpbb.de</email>
				<username>Mahoney</username>
				<homepage>http://www.sportschulekang.de/</homepage>
			</author>
		</author-group>
		
		<mod-version>0.2.0</mod-version>
    <installation>
			<level>easy</level>
			<time>1800</time>
			<target-version>3.0.2</target-version>
		</installation>
    <history>
			<entry>
				<date>2008-08-07</date>
				<rev-version>0.0.1</rev-version>
				<changelog lang="en">
					<change>Initial release</change>
				</changelog>
				<changelog lang="de">
					<change>erste Veröffentlichung</change>
				</changelog>
			</entry>
			<entry>
				<date>2008-08-15</date>
				<rev-version>0.1.0</rev-version>
				<changelog lang="en">
					<change>second release</change>
					<change>Styles adapted</change>
				</changelog>
				<changelog lang="de">
					<change>zweite Veröffentlichung</change>
					<change>Styles angepasst</change>
				</changelog>        
			</entry>
			<entry>
				<date>2008-08-25</date>
				<rev-version>0.2.0</rev-version>
				<changelog lang="en">
				    <change>third release</change>
					<change>Ability to enable/disable the MOD in the ACP added.</change>
				</changelog>
				<changelog lang="de">
				    <change>dritte Veröffentlichung</change>
					<change>Möglichkeit zur Aktivierung/Deaktivierung des MODs im ACP hinzugefügt.</change>
				</changelog>
			</entry>
		</history>
		<link-group>
      <link type="parent" lang="en-gb" href="install.xml">Manual</link>
      <link type="parent" lang="de" href="install.xml">Installations-Anleitung</link>
      <link type="language" lang="en" href="contrib/de.xml">Manual for german Language</link>
	  <link type="language" lang="de" href="contrib/de.xml">Anleitung fĂĽr das deutsche Sprachpaket</link>
	  <link type="parent" lang="en-gb" href="contrib/hide_mod_addon/install.xml">Manual for Hide MOD Addon</link>
      <link type="parent" lang="de" href="contrib/hide_mod_addon/install.xml">Installations-Anleitung fĂĽr das Hide MOD Addon</link>
	  <link type="template" lang="en-gb" href="contrib/subsilver2.xml">Manual for subsilver2 Style</link>
      <link type="template" lang="de" href="contrib/subsilver2.xml">Anleitung fĂĽr das Style subsilver2</link>
	  <link type="parent" lang="en-gb" href="contrib/update_0.0.1_to_0.1.0/update_0.0.1_to_0.1.0.xml">Update-Manual for v 0.0.1 to v 0.1.0</link>
      <link type="parent" lang="de" href="contrib/update_0.0.1_to_0.1.0/update_0.0.1_to_0.1.0.xml">Update-Anleitung fĂĽr v 0.0.1 zu v 0.1.0</link>
	  <link type="parent" lang="en-gb" href="contrib/update_0.1.0_to_0.2.0/subsilver2.xml">Update Manual for subsilver2 from 0.1.0 to 0.2.0</link>
      <link type="parent" lang="de" href="contrib/update_0.1.0_to_0.2.0/subsilver2.xml">Update Anleitung fĂĽr subsilver2 von 0.1.0 zu 0.2.0</link>
	<link type="parent" lang="en-gb" href="contrib/update_0.1.0_to_0.2.0/update_0.1.0_to_0.2.0.xml">Update Manual from 0.1.0 to 0.2.0</link>
      <link type="parent" lang="de" href="contrib/update_0.1.0_to_0.2.0/update_0.1.0_to_0.2.0.xml">Update Anleitung von 0.1.0 zu 0.2.0</link>
    </link-group>
    
  </header>
  <action-group>
  <copy>
      <file from="root/db_update.php" to="phpbb root and run this with your browser or they use the sql command from the manual. After using this file, please delete it to avoid errors." />
    </copy>
	<copy>
      <file from="root/thanks.php" to="thanks.php" />
    </copy>
	<copy>
      <file from="root/language/en/mods/thanks.php" to="language/en/mods/thanks.php" />
      <file from="root/language/en/acp/thanks.php" to="language/en/acp/thanks.php" />
    </copy>
  <copy>
      <file from="root/styles/prosilver/imageset/removethankspro.gif" to="styles/prosilver/imageset/removethankspro.gif" />
	  <file from="root/styles/prosilver/imageset/en/icon_post_thanks.gif" to="styles/prosilver/imageset/en/icon_post_thanks.gif" />
      </copy>
    <sql><![CDATA[CREATE TABLE `phpbb_thanks` (
  `thanks_id` mediumint(8) unsigned NOT NULL auto_increment,
  `thanks_from` mediumint(8) unsigned NOT NULL,
  `thanks_to` mediumint(8) unsigned NOT NULL,
  `post_id` mediumint(8) unsigned NOT NULL,
  PRIMARY KEY  (`thanks_id`)
);
ALTER TABLE `phpbb_posts` ADD `post_thanked` INT(11) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE `phpbb_forums` ADD COLUMN `enable_thanks` TINYINT(1) DEFAULT '0' NOT NULL;
ALTER TABLE `phpbb_users` ADD `user_thanked` INT(11) UNSIGNED NOT NULL DEFAULT '0', ADD `user_thanks` INT(11) UNSIGNED NOT NULL DEFAULT '0', ADD `user_thanks_post` INT(11) UNSIGNED NOT NULL DEFAULT '0';]]></sql>
    <open src="memberlist.php">
      <edit>
        <find><![CDATA[// Start session management
$user->session_begin();
$auth->acl($user->data);]]></find>
        <action type="after-add"><![CDATA[//Begin Thank Post MOD
$user->add_lang('mods/thanks');
//End Thank Post MOD]]></action>
      </edit>
	  <edit>
        <find><![CDATA['SIGNATURE'		=> $member['user_sig'],]]></find>
        <action type="after-add"><![CDATA[//Begin Thank Post MOD
         'THANKS'         => $member['user_thanks'],
         'THANKED'      => ($member['user_thanked'] <= 1) ? $member['user_thanked'] . $user->lang['THANKS_TIME'] : $member['user_thanked'] . $user->lang['THANKS_TIMES'],
         'THANKS_POST'   => ($member['user_thanks_post'] <= 1) ? $member['user_thanks_post'] . $user->lang['THANKS_POST'] : $member['user_thanks_post'] . $user->lang['THANKS_POSTS'],
         //End Thank Post MOD]]></action>
      </edit>
    </open>
	<open src="viewtopic.php">
      <edit>
        <find><![CDATA[// Send vars to template]]></find>
        <action type="before-add"><![CDATA[//Begin Thank Post MOD
$user->add_lang('mods/thanks');
//End Thank Post MOD]]></action>
      </edit>
	  <edit>
				<find><![CDATA[$user_cache[$poster_id] = array(
				'joined'		=> $user->format_date($row['user_regdate']),
				'posts'			=> $row['user_posts'],]]></find>
				<action type="after-add"><![CDATA[//Begin Thank Post MOD
				'thanks'		=> $row['user_thanks'],
				'thanked'		=> $row['user_thanked'],
				'thanks_post'	=> $row['user_thanks_post'],
                //End Thank Post MOD]]></action>
			</edit>
	  <edit>
        <find><![CDATA['U_POST_AUTHOR'			=> ($poster_id != ANONYMOUS) ? $user_cache[$poster_id]['author_profile'] : get_username_string('profile', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), ]]></find>
        <action type="after-add"><![CDATA[//Begin Thank Post MOD
	'THANKS_FROM'   => sprintf($user->lang['THANKS_FROM'], get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username'])),
//End Thank Post MOD]]></action>
      </edit>
	  <edit>
        <find><![CDATA[		'POSTER_POSTS'		=> $user_cache[$poster_id]['posts'],]]></find>
        <action type="after-add"><![CDATA[//Begin Thank Post MOD		
		'POSTER_THANKS'			=> $user_cache[$poster_id]['thanks'],
		'POSTER_THANKED'		=> ($user_cache[$poster_id]['thanked'] <= 1) ? $user_cache[$poster_id]['thanked'] . $user->lang['THANKS_TIME'] : $user_cache[$poster_id]['thanked'] . $user->lang['THANKS_TIMES'],
		'POSTER_THANKS_POST'	=> ($user_cache[$poster_id]['thanks_post'] <= 1) ? $user_cache[$poster_id]['thanks_post'] . $user->lang['THANKS_POST'] : $user_cache[$poster_id]['thanks_post'] . $user->lang['THANKS_POSTS'],
        //End Thank Post MOD]]></action>
      </edit>
      <edit>
        <find><![CDATA[	if (isset($cp_row['row']) && sizeof($cp_row['row']))
	{
		$postrow = array_merge($postrow, $cp_row['row']);
	}]]></find>
        <action type="before-add"><![CDATA[//Begin Thank Post MOD
$sql = 'SELECT thanks_from
	FROM ' . THANKS_TABLE . '
	WHERE post_id = ' . $row['post_id'] .'
	AND thanks_from = ' . $user->data['user_id'];
$result = $db->sql_query($sql);
$give_thanks = $db->sql_fetchfield('thanks_from');
$db->sql_freeresult($result);

$sql_array = array(
	'SELECT'	=> 'u.username, u.user_colour, t.*',

	'FROM'		=> array(
		USERS_TABLE		=> 'u',
		THANKS_TABLE	=> 't'
	),

	'WHERE'		=> 't.post_id =' . $row['post_id'] . '
		AND u.user_id = t.thanks_from',

	'ORDER_BY'	=> 'u.username_clean'
);

$sql = $db->sql_build_query('SELECT', $sql_array);
$result = $db->sql_query($sql);

$thanks_list = '';
while ($row2 = $db->sql_fetchrow($result))
{	
	$thanks_user = get_username_string('full', $row2['thanks_from'], $row2['username'], $row2['user_colour'], $row2['username']);
	$thanks_list = $thanks_list . ", " . $thanks_user;
}

$thanks_list = ltrim($thanks_list, ", ");
$postrow = array_merge($postrow, array(
	'THANKS_LIST'		=> $thanks_list,
	'U_THANKS'			=> (!$give_thanks) ? append_sid("{$phpbb_root_path}thanks.$phpEx", 'p=' . $row['post_id'] . '&mode=thanks') : append_sid("{$phpbb_root_path}thanks.$phpEx", 'p=' . $row['post_id'] . '&mode=remove'),
	'S_GIVE_THANKS'		=> $give_thanks,
	'S_FIRST_POST'      => true,
	'S_IS_OWN_POST'		=> ($poster_id == $user->data['user_id']) ? true : false
	));
$db->sql_freeresult($result);

	$template->assign_vars(array(
	'THANKS_ENABLE'      => ($topic_data['enable_thanks']) ? true : false));
	//End Thank Post MOD]]></action>
      </edit>
    </open>
    <open src="adm/style/acp_main.html">
      <edit>
        <find><![CDATA[<form id="action_user_form" method="post" action="{U_ACTION}">
				<dl>
					<dt><label for="action_user">{L_RESYNC_POSTCOUNTS}</label><br /><span>{L_RESYNC_POSTCOUNTS_EXPLAIN}</span></dt>
					<dd><input type="hidden" name="action" value="user" /><input class="button2" type="submit" id="action_user" name="action_user" value="{L_RUN}" /></dd>
				</dl>
			</form>]]></find>
        <action type="after-add"><![CDATA[<form id="action_thanks_form" method="post" action="{U_ACTION}">
				<dl>
					<dt><label for="action_user">{L_RESYNC_THANKSCOUNTS}</label><br /><span>{L_RESYNC_THANKSCOUNTS_EXPLAIN}</span></dt>
					<dd><input type="hidden" name="action" value="thanks" /><input class="button2" type="submit" id="action_thanks" name="action_user" value="{L_RUN}" /></dd>
				</dl>
			</form>]]></action>
      </edit>
    </open>
	<open src="adm/style/acp_forums.html">
      <edit>
        <find><![CDATA[<div id="forum_post_options">
		<fieldset>
			<legend>{L_GENERAL_FORUM_SETTINGS}</legend>
		<dl>
			<dt><label for="forum_status">{L_FORUM_STATUS}:</label></dt>
			<dd><select id="forum_status" name="forum_status">{S_STATUS_OPTIONS}</select></dd>
		</dl>]]></find>
        <action type="after-add"><![CDATA[<!-- mod : Thanks Post MOD -->
         <dl>
			<dt><label for="enable_thanks">{L_THANKS_ENABLE}:</label><br /></dt>
			<dd><label><input type="radio" class="radio" name="enable_thanks" value="1"<!-- IF S_THANKS_ENABLE --> id="enable_thanks" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
				<label><input type="radio" class="radio" name="enable_thanks" value="0"<!-- IF not S_THANKS_ENABLE --> id="enable_thanks" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
		</dl>
        <!-- fin mod : Thanks Post MOD -->]]></action>
      </edit>
    </open>
    <open src="includes/constants.php">
      <edit>
        <find>// Additional tables</find>
        <action type="after-add">//Begin Thank Post MOD
define('THANKS_TABLE',				$table_prefix . 'thanks');
//End Thank Post MOD</action>
      </edit>
    </open>
    <open src="includes/acp/acp_main.php">
	<edit>
        <find>/**
* @package acp
*/</find>
        <action type="after-add">//Begin Thank Post MOD
$user->add_lang('acp/thanks');
//End Thank Post MOD</action>
      </edit>
      <edit>
        <find>					case 'purge_cache':
						$confirm = true;
						$confirm_lang = 'PURGE_CACHE_CONFIRM';
					break;</find>
        <action type="after-add">//Begin Thank Post MOD
					case 'thanks':
						$confirm = true;
						$confirm_lang = 'RESYNC_THANKSCOUNTS_CONFIRM';
					break;
                    //End Thank Post MOD</action>
      </edit>
      <edit>
        <find>						add_log('admin', 'LOG_PURGE_CACHE');
					break;</find>
        <action type="after-add"><![CDATA[//Begin Thank Post MOD					
					case 'thanks':
						if (!$auth->acl_get('a_board'))
						{
							trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
						}

						$sql = 'SELECT COUNT(p.post_thanked) AS num_thanks, u.user_id
							FROM ' . USERS_TABLE . ' u
							LEFT JOIN  ' . POSTS_TABLE . ' p ON (u.user_id = p.poster_id AND p.post_thanked > 0)
							GROUP BY u.user_id';
						$result = $db->sql_query($sql);

						while ($row = $db->sql_fetchrow($result))
						{
							$db->sql_query('UPDATE ' . USERS_TABLE . " SET user_thanks_post = {$row['num_thanks']} WHERE user_id = {$row['user_id']}");
						}
						$db->sql_freeresult($result);

						$sql = 'SELECT COUNT(t.thanks_from) AS num_thanks_from, u.user_id
							FROM ' . USERS_TABLE . ' u
							LEFT JOIN  ' . THANKS_TABLE . ' t ON (u.user_id = t.thanks_from)
							GROUP BY u.user_id';
						$result = $db->sql_query($sql);

						while ($row = $db->sql_fetchrow($result))
						{
							$db->sql_query('UPDATE ' . USERS_TABLE . " SET user_thanks = {$row['num_thanks_from']} WHERE user_id = {$row['user_id']}");
						}
						$db->sql_freeresult($result);
						
						$sql = 'SELECT COUNT(t.thanks_to) AS num_thanks_to, u.user_id
							FROM ' . USERS_TABLE . ' u
							LEFT JOIN  ' . THANKS_TABLE . ' t ON (u.user_id = t.thanks_to)
							GROUP BY u.user_id';
						$result = $db->sql_query($sql);

						while ($row = $db->sql_fetchrow($result))
						{
							$db->sql_query('UPDATE ' . USERS_TABLE . " SET user_thanked = {$row['num_thanks_to']} WHERE user_id = {$row['user_id']}");
						}
						$db->sql_freeresult($result);

						add_log('admin', 'LOG_RESYNC_THANKSCOUNTS');
					break;
                   //End Thank Post MOD]]></action>
      </edit>
	  </open>
    <open src="includes/functions_admin.php">
      <edit>
        <find>	$table_ary = array(POSTS_TABLE, REPORTS_TABLE);</find>
        <inline-edit>
          <inline-find>REPORTS_TABLE</inline-find>
          <inline-action type="after-add">, THANKS_TABLE</inline-action>
        </inline-edit>
      </edit>
    </open>
    <open src="includes/acp/acp_styles.php">
      <edit>
        <find>/**
* @package acp
*/</find>
        <action type="after-add">//Begin Thank Post MOD
$user->add_lang('acp/thanks');
//End Thank Post MOD</action>
      </edit>
	  <edit>
        <find>				'icon_back_top', 'icon_contact_aim', 'icon_contact_email', 'icon_contact_icq', 'icon_contact_jabber', 'icon_contact_msnm', 'icon_contact_pm', 'icon_contact_yahoo', 'icon_contact_www', 'icon_post_delete', 'icon_post_edit', 'icon_post_info', 'icon_post_quote', 'icon_post_report', 'icon_user_online', 'icon_user_offline', 'icon_user_profile', 'icon_user_search', 'icon_user_warn', 'button_pm_forward', 'button_pm_new', 'button_pm_reply', 'button_topic_locked', 'button_topic_new', 'button_topic_reply',</find>
        <inline-edit>
          <inline-find>'button_topic_reply',</inline-find>
          <inline-action type="after-add"> 'icon_post_thanks',</inline-action>
        </inline-edit>
      </edit>
	  <open src="adm/style/acp_forums.html">
      <edit>
        <find><![CDATA[<div id="forum_post_options">
		<fieldset>
			<legend>{L_GENERAL_FORUM_SETTINGS}</legend>
		<dl>
			<dt><label for="forum_status">{L_FORUM_STATUS}:</label></dt>
			<dd><select id="forum_status" name="forum_status">{S_STATUS_OPTIONS}</select></dd>
		</dl>]]></find>
        <action type="after-add"><![CDATA[<!-- mod : Thanks Post MOD -->
         <dl>
			<dt><label for="enable_thanks">{L_THANKS_ENABLE}:</label><br /></dt>
			<dd><label><input type="radio" class="radio" name="enable_thanks" value="1"<!-- IF S_THANKS_ENABLE --> id="enable_thanks" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
				<label><input type="radio" class="radio" name="enable_thanks" value="0"<!-- IF not S_THANKS_ENABLE --> id="enable_thanks" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
		</dl>
        <!-- fin mod : Thanks Post MOD -->]]></action>
      </edit>
    </open>
    </open>
	<open src="includes/acp/acp_forums.php">
      <edit>
        <find>'enable_prune'			=> request_var('enable_prune', false),</find>
        <action type="after-add">//Begin Thank Post MOD
						'enable_thanks'			=> request_var('enable_thanks', false),
						//End Thank Post MOD</action>
						<find>$forum_data = array(
							'parent_id'				=> $this->parent_id,
							'forum_type'			=> FORUM_POST,
							'forum_status'			=> ITEM_UNLOCKED,</find>
        <action type="after-add">//Begin Thank Post MOD
							'thanks_yes'		    => true,
							'thanks_no'		        => false,
							//End Thank Post MOD</action>
							<find>'enable_icons'			=> false,
							'enable_prune'			=> false,</find>
        <action type="after-add">//Begin Thank Post MOD
							'enable_thanks'			=> false,
							//End Thank Post MOD</action>
							<find>'S_PRUNE_ENABLE'			=> ($forum_data['enable_prune']) ? true : false,</find>
        <action type="after-add">//Begin Thank Post MOD
					'S_THANKS_ENABLE'		    => ($forum_data['enable_thanks']) ? true : false,
					//End Thank Post MOD</action>
      </edit>
    </open>
	<open src="language/en/acp/forums.php">
      <edit>
        <find>'TYPE_LINK'			=> 'Link',</find>
        <action type="after-add">//Begin Thank Post MOD
	'THANKS_ENABLE'		=> 'Enable the Thanks MOD',
	//End Thank Post MOD</action>
      </edit>
    </open>
    <open src="styles/prosilver/imageset/en/imageset.cfg">
      <edit>
        <find>img_icon_post_quote = icon_post_quote.gif*17*58</find>
        <action type="after-add">img_icon_post_thanks = icon_post_thanks.gif*20*55</action>
      </edit>
    </open>
    <open src="styles/prosilver/template/viewtopic_body.html">
      <edit>
        <find><![CDATA[					<!-- IF postrow.U_EDIT --><li class="edit-icon"><a href="{postrow.U_EDIT}" title="{L_EDIT_POST}"><span>{L_EDIT_POST}</span></a></li><!-- ENDIF -->]]></find>
        <action type="before-add"><![CDATA[<!-- IF THANKS_ENABLE -->
					<!-- IF postrow.S_FIRST_POST and not postrow.S_GIVE_THANKS and not postrow.S_IS_OWN_POST --><li class="thanks-icon"><a href="{postrow.U_THANKS}" title="{L_THANKS1}"><span>{L_THANKS1}</span></a></li><!-- ENDIF --><!-- ENDIF -->]]></action>
      </edit>
      <edit>
        <find><![CDATA[		<!-- IF postrow.POSTER_FROM --><dd><strong>{L_LOCATION}:</strong> {postrow.POSTER_FROM}</dd><!-- ENDIF -->]]></find>
        <action type="after-add"><![CDATA[		<dd><strong>{L_THANKS}:</strong> {postrow.POSTER_THANKS}</dd>
		<dd><strong>{L_THANKED}:</strong> {postrow.POSTER_THANKED} {L_IN} {postrow.POSTER_THANKS_POST}</dd>]]></action>
      </edit>
      <edit>
        <find><![CDATA[<!-- END postrow -->]]></find>
        <action type="before-add"><![CDATA[   <!-- IF postrow.S_FIRST_POST and postrow.THANKS_LIST -->
<div class="post bg3">
		<div class="inner"><span class="corners-top"><span></span></span>
			<dl class="postbody">
				<dd><strong>{postrow.THANKS_FROM}</strong><br />{postrow.THANKS_LIST}</dd>

			</dl>
			<!-- IF postrow.S_GIVE_THANKS -->  
			<dl>
				<dt class="postprofile" style="text-align: center;"><a href="{postrow.U_THANKS}"><img src="{T_IMAGESET_PATH}/removethankspro.gif" alt="{L_THANKS_REMOVE}"/></a></dt>
			</dl><!-- ENDIF -->
		<span class="corners-bottom"><span></span></span></div>
	</div>
	<hr class="divider" />
   <!-- ENDIF -->]]></action>
      </edit>
    </open>
	<open src="styles/prosilver/template/memberlist_view.html">
      <edit>
        <find><![CDATA[<dt>{L_JOINED}:</dt> <dd>{JOINED}</dd>]]></find>
        <action type="after-add"><![CDATA[<dt>{L_THANKS}:</dt> <dd>{THANKS}</dd>
         <dt>{L_THANKED}:</dt> <dd>{THANKED} {L_IN} {THANKS_POST}</dd>]]></action>
      </edit>
    </open>
    <open src="styles/prosilver/theme/buttons.css">
      <edit>
        <find>.quote-icon, .quote-icon a		{ background: none top left no-repeat; }</find>
        <action type="after-add">.thanks-icon, .thanks-icon a		{ background: none top left no-repeat; }</action>
      </edit>
      <edit>
        <find>ul.profile-icons li.quote-icon	{ width: {IMG_ICON_POST_QUOTE_WIDTH}px; height: {IMG_ICON_POST_QUOTE_HEIGHT}px; }</find>
        <action type="after-add">ul.profile-icons li.thanks-icon	{ width: {IMG_ICON_POST_THANKS_WIDTH}px; height: {IMG_ICON_POST_THANKS_HEIGHT}px; }</action>
      </edit>
    </open>
    <open src="styles/prosilver/theme/colours.css">
      <edit>
        <find>.quote-icon, .quote-icon a		{ background-image: url("{IMG_ICON_POST_QUOTE_SRC}"); }</find>
        <action type="after-add">.thanks-icon, .thanks-icon a		{ background-image: url("{IMG_ICON_POST_THANKS_SRC}"); }</action>
      </edit>
    </open>
<diy-instructions lang="en">Copy: root/db_update.php 
To: phpbb root and run this with your browser or they use the sql command from the manual. 
After using this file, please delete it to avoid errors.
After installing this mod you must refresh your template, theme, and imageset and clear your cache.</diy-instructions>
<diy-instructions lang="de">Kopiere: root/db_update.php 
Nach: phpbb root und rufe die Datei in deinem Browser auf, oder benutze den SQL Befehl aus der Installations-Anleitung. 
Nach Ausführen dieser Datei bitte die Datei wieder vom Server löschen um Fehler zu vermeiden.
Nach der Installation des MODs, musst du noch den Cache leeren und template, theme, and imageset aktualisieren.</diy-instructions>
  </action-group>
</mod>
Locked

Return to “[3.0.x] MODs in Development”

cron