[RC] Thanks for post by Палыч

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!
Get Involved
usenet2you
Registered User
Posts: 407
Joined: Sat Mar 22, 2008 7:31 pm
Location: The Netherlands

Re: [RC] Thanks for post by Палыч

Post by usenet2you » Mon Jun 01, 2009 4:01 pm

Typo in language file thanks_mod.php: Acknowledgments must be Acknowledgements

User avatar
katib
Registered User
Posts: 562
Joined: Thu Jun 26, 2008 12:27 pm

Re: [RC] Thanks for post by Палыч

Post by katib » Mon Jun 01, 2009 10:46 pm

Actually I am using Thank Post Mod (hide MOD compatible ) 0.2.0
I am quite happy with it, but I liked the more advanced options on Палыч Mod :)
So is it possible toimporte thanks data? I mean to preserve the thanks data received by users in each posts ?
Here is the sql query used by the Thank Post Mod (hide MOD compatible ) 0.2.0 Mod:

Code: Select all

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';

User avatar
olalavui
Registered User
Posts: 103
Joined: Sat Dec 13, 2008 3:02 am
Location: Vietnam
Name: Bui Thanh Tung
Contact:

Re: [RC] Thanks for post by Палыч

Post by olalavui » Tue Jun 02, 2009 1:35 am

How to convert from thank post mod 0.4.0 --> your thanks mod?
Come back phpBB with phpBBVietnam

usenet2you
Registered User
Posts: 407
Joined: Sat Mar 22, 2008 7:31 pm
Location: The Netherlands

Re: [RC] Thanks for post by Палыч

Post by usenet2you » Tue Jun 02, 2009 5:49 am

look at the contrib folder....

User avatar
knmt
Registered User
Posts: 110
Joined: Fri Aug 29, 2008 10:13 am
Contact:

Re: [RC] Thanks for post by Палыч

Post by knmt » Tue Jun 02, 2009 8:59 am

Ok, here are the modified English language - version 1.2.2:

thanks_mod.php

Code: Select all

<?php
/**
*
* thanks_mod[English]
*
* @package language
* @version $Id: thanks.php,v 122 2009-04-19 10:02:51Палыч $
* @copyright (c) 2008 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* DO NOT CHANGE
*/
if (!defined('IN_PHPBB'))
{
   exit;
}

if (empty($lang) || !is_array($lang))
{
	$lang = array();
}

// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
//
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
//
// Some characters you may want to copy&paste:
// ’ » “ ” …
//

$lang = array_merge($lang, array(
	'REMOVE_THANKS'				=> 'To remove the thanks you gave',
	'THANK_POST'				=> 'To thank for the message of the author: ',
	'THANK_FROM'				=> 'from',
	'THANK_TEXT_1'				=> 'For this message the author ',
	'THANK_TEXT_2'				=> ' has received gratitude ',
	'THANK_TEXT_2pl'			=> ' has received thanks - ',
	'RECEIVED'					=> 'Have&nbsp;thanks',
	'THANKS'					=> 'time',
	'GIVEN'						=> 'Has&nbsp;thanked',
	'GRATITUDES'				=> 'Gratitudes',
	'FOR_MESSAGE'				=> ' for post',
	'THANKS_LIST'				=> 'View/Close list',
	'THANKS_PM_SUBJECT_GIVE'	=> 'Thanks for the message',
	'THANKS_PM_SUBJECT_REMOVE'	=> 'Remove thank',
	'THANKS_PM_MES_GIVE'		=> 'Thanks for the message',
	'THANKS_PM_MES_REMOVE'		=> 'Remove thank',
	'THANKS_INFO_GIVE'			=> 'You have just thanked for the message.',
	'THANKS_INFO_REMOVE'		=> 'You have just removed your thank.',
	'RETURN_POST'				=> 'Return to post',
	'THANKS_USER'				=> 'List of thanks',
	'THANKS_BACK'				=> 'Return',
	'JUMP_TO_FORUM'				=> 'Jump to forum',
	'JUMP_TO_TOPIC'				=> 'Jump to topic',
	'INCORRECT_THANKS'			=> 'Invalid thanks',
	'REMOVE_THANKS_CONFIRM'		=> 'Are you sure you want to remove your thanks?',
));
?>
info_acp_thanks.php

Code: Select all

<?php
/**
*
* mod_thanks [English]
*
* @package language
* @version $Id: info_acp_thanks.php 122 2009-04-19 10:02:51Палыч $
* @copyright (c) 2008 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* DO NOT CHANGE
*/
if (!defined('IN_PHPBB'))
{
   exit;
}

if (empty($lang) || !is_array($lang))
{
	$lang = array();
}

// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
//
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine

$lang = array_merge($lang, array(
	'acl_f_thanks' 						=> array('lang' => 'Can thanks for posts', 'cat' => 'misc'),
	'acl_u_viewthanks' 					=> array('lang' => 'Can view list of thanks', 'cat' => 'misc'),
	'IMG_THANKPOSTS'					=> 'To thank for the message',
	'IMG_REMOVETHANKS'					=> 'To delete gratitude',
	'THANKS_POSTLIST_VIEW'				=> 'List thanks in topic',
	'THANKS_PROFILELIST_VIEW'			=> 'List thanks in profile',
	'THANKS_NUMBER'						=> 'Number of thanks in list',
	'THANKS_POSTLIST_VIEW_EXPLAIN'		=> 'If this option is enabled, thanks info like who have thanked and how many thanks a user has received or given will be displayed when you view a topic. <br/> Please note that the thanks info will be displayed only if users have the right to thank for post in that forum.',
	'THANKS_PROFILELIST_VIEW_EXPLAIN'	=> 'If this option is enabled, complete thanks info including number of thanks and which posts a user received thanks from will be displayed.',
	'THANKS_NUMBER_EXPLAIN'				=> 'The maximum number of thanks displayed in either viewing topic or viewing profile. <br /> <strong> Remember that slow down will be noticed if this value is set over 250. </strong>',
	'ACP_THANKS'						=> 'Thanks for posts',
	'ACP_THANKS_SETTINGS'				=> 'Thanks Settings',
	'ACP_THANKS_SETTINGS_EXPLAIN'		=> 'Here you can install values of customisations of function of thanks for messages',
	'THANKS_REFRESH_MSG'				=> 'Upgrade performance can take a few minutes',
	'THANKS_REFRESH'					=> 'Recount all thanks',
	'REFRESH'							=> 'Refresh',
	'MCP_THANKS_REFRESHED'				=> 'Counts refreshed',
	'ACP_POST'							=> 'Total number of posts',
	'ACP_THANKSPOST'					=> 'Total number of thanked posts',
	'ACP_DELPOST'						=> 'Deleted thanked posts',
	'REMOVE_THANKS'						=> 'Remove thanks',
	'REMOVE_THANKS_EXPLAIN'				=> 'If enabled users can remove thanks',
));
?>
info_ucp_thanks.php

Code: Select all

<?php
/**
*
* mod_thanks [English]
*
* @package language
* @version $Id: info_ucp_thanks.php 122 2009-04-19 10:02:51Палыч $
* @copyright (c) 2008 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* DO NOT CHANGE
*/
if (!defined('IN_PHPBB'))
{
   exit;
}

if (empty($lang) || !is_array($lang))
{
	$lang = array();
}

// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
//
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine

$lang = array_merge($lang, array(
	'ALLOW_THANKS_PM'			=> 'Notify me if someone thanks my post',
	'ALLOW_THANKS_PM_EXPLAIN'	=> 'You will receive a PM if someone says thank you for any of your post.',
));

?>
I am no native English speaker, but I am sure this is better.

BTW, there's two more things I would like to mention about this mod, the first one is the option to send a user a PM if someone thanks him/her. If that "someone" removes the thanks and thanks the author again, there will be another PM, eh? The second one is about grammar lol, if it is more than 1 thank, it should be thank"s" so ah...

Hehe...

User avatar
Палыч
Translator
Posts: 1543
Joined: Sun Jul 01, 2007 7:59 pm
Location: St. Petersburg
Name: Сергей
Contact:

Re: [RC] Thanks for post by Палыч

Post by Палыч » Tue Jun 02, 2009 5:20 pm

knmt wrote:Ok, here are the modified English language - version 1.2.2:
Thank you very much! Excellent! :)
knmt wrote:if it is more than 1 thank, it should be thank"s" so ah...
No. Text of PM contains a link to a specific post for which granted / revoked thanks. One Post - One PM
Sorry for my bad english

usenet2you
Registered User
Posts: 407
Joined: Sat Mar 22, 2008 7:31 pm
Location: The Netherlands

Re: [RC] Thanks for post by Палыч

Post by usenet2you » Tue Jun 02, 2009 7:03 pm

Do you already found a solution to let this MOD work with the Simple Hide BBCode? so if the users press Thank the author, the hide wil unhide and we can the information under the hide?

User avatar
Палыч
Translator
Posts: 1543
Joined: Sun Jul 01, 2007 7:59 pm
Location: St. Petersburg
Name: Сергей
Contact:

Re: [RC] Thanks for post by Палыч

Post by Палыч » Tue Jun 02, 2009 7:17 pm

katib wrote:So is it possible toimporte thanks data? I mean to preserve the thanks data received by users in each posts ?
I think this is possible.

Code: Select all

ALTER TABLE `phpbb_thanks` CHANGE `thanks_from` `user_id` mediumint(8);
ALTER TABLE `phpbb_thanks` CHANGE `thanks_to` `poster_id` mediumint(8);
ALTER TABLE `phpbb_thanks` DROP PRIMARY KEY;
ALTER TABLE `phpbb_thanks` DROP COLUMN `thanks_id`;
ALTER TABLE `phpbb_thanks` ADD PRIMARY KEY ( `post_id` , `user_id` );
Do not forget to backup!
Sorry for my bad english

User avatar
Палыч
Translator
Posts: 1543
Joined: Sun Jul 01, 2007 7:59 pm
Location: St. Petersburg
Name: Сергей
Contact:

Re: [RC] Thanks for post by Палыч

Post by Палыч » Tue Jun 02, 2009 7:19 pm

usenet2you wrote:Do you already found a solution to let this MOD work with the Simple Hide BBCode? so if the users press Thank the author, the hide wil unhide and we can the information under the hide?
Sorry, no. But I will try to invent a solution.
Sorry for my bad english

User avatar
Палыч
Translator
Posts: 1543
Joined: Sun Jul 01, 2007 7:59 pm
Location: St. Petersburg
Name: Сергей
Contact:

Re: [RC] Thanks for post by Палыч

Post by Палыч » Tue Jun 02, 2009 7:23 pm

usenet2you wrote:won't work, you can thank the 2nd only instead of the 1st only, and I even think the user will be able to thank other posts then the 2nd one with your modification for this, simple change post_id. With my modification you wouldn't be able to thank the 2nd post.
I test on the local host - it works.
Sorry for my bad english

User avatar
Палыч
Translator
Posts: 1543
Joined: Sun Jul 01, 2007 7:59 pm
Location: St. Petersburg
Name: Сергей
Contact:

Re: [RC] Thanks for post by Палыч

Post by Палыч » Tue Jun 02, 2009 7:29 pm

usenet2you wrote:When I use already_thanked in viewtopic.php, it will give me an error, why?
The function has two arguments

Code: Select all

// check if the user has already thanked that post
function already_thanked($post_id, $user_id)
{
Sorry for my bad english

User avatar
Палыч
Translator
Posts: 1543
Joined: Sun Jul 01, 2007 7:59 pm
Location: St. Petersburg
Name: Сергей
Contact:

Re: [RC] Thanks for post by Палыч

Post by Палыч » Wed Jun 03, 2009 8:50 pm

zach' wrote:but i just see a minor issue with bbcode in the messages from thanks_results.html, all bbcode are modify so they cant't be see, for examples :

Code: Select all

[quote="molotov":1rbs1tj4] ..... [/quote:1rbs1tj4]
[u:2alp7jag] ..... [/u:2alp7jag]
[img:2alp7jag] ....[/img:2alp7jag]
I think the install is fine, so i dont see what can do that, perhaps it came from {searchresults.MESSAGE}

could you help me about this minor issue, please

Thanks a lot
Fixed. Link to file thankslist.php in the first post
Sorry for my bad english

User avatar
katib
Registered User
Posts: 562
Joined: Thu Jun 26, 2008 12:27 pm

Re: [RC] Thanks for post by Палыч

Post by katib » Wed Jun 03, 2009 11:00 pm

Hi Палыч
sbasiba :)
Палыч wrote:
katib wrote:So is it possible toimporte thanks data? I mean to preserve the thanks data received by users in each posts ?
I think this is possible.

Code: Select all

ALTER TABLE `phpbb_thanks` CHANGE `thanks_from` `user_id` mediumint(8);
ALTER TABLE `phpbb_thanks` CHANGE `thanks_to` `poster_id` mediumint(8);
ALTER TABLE `phpbb_thanks` DROP PRIMARY KEY;
ALTER TABLE `phpbb_thanks` DROP COLUMN `thanks_id`;
ALTER TABLE `phpbb_thanks` ADD PRIMARY KEY ( `post_id` , `user_id` );
Do not forget to backup!
what about this SQL quiry from your Mod? do I need to run it also ?

Code: Select all

ALTER TABLE phpbb_users ADD user_allow_thanks_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL; 

User avatar
Палыч
Translator
Posts: 1543
Joined: Sun Jul 01, 2007 7:59 pm
Location: St. Petersburg
Name: Сергей
Contact:

Re: [RC] Thanks for post by Палыч

Post by Палыч » Thu Jun 04, 2009 1:14 pm

katib wrote:what about this SQL quiry from your Mod? do I need to run it also ?

Code: Select all

ALTER TABLE phpbb_users ADD user_allow_thanks_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL; 
Yes, it adds a field management function notification of gratitude
Sorry for my bad english

User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Re: [RC] Thanks for post by Палыч

Post by IPB_Refugee » Thu Jun 04, 2009 1:38 pm

@katib:

And you also need the 4 inserts in table phpbb_config:

Code: Select all

INSERT INTO phpbb_config (config_name, config_value) VALUES ('remove_thanks', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('thanks_postlist_view', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('thanks_profilelist_view', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('thanks_number', '100');
On the other hand you do not need the columns

Code: Select all

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';
anymore. You can delete these columns with

Code: Select all

ALTER TABLE `phpbb_posts` DROP COLUMN `post_thanked`;
and so on. Don't forget to make a backup of your DB first!

Regards
Wolfgang

Locked

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