[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
Locked
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 Палыч » Fri Jun 05, 2009 9:43 pm

katib wrote:I downloaded your viewtopic_body.html !! no luck !! nothing show up !!!
You just refresh the cache after changing the file html?
Verify that the file-gif you have in your language folder (for English - styles / mavilim / imageset / en / thankposts.gif), for you - styles / mavilim / imageset /?? / thankposts.gif
katib wrote:I did remove the IF switch
I think this is the wrong way.
Check that the permissions correct
Image
Image
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 » Fri Jun 05, 2009 10:31 pm

The permissions are there:

Image
Image

I think the problem is related to the SQL quiries
as you remember, I did excute a custom SQL quiries to preserve previous thanks data from previous Thank Post Mod (hide MOD compatible) 0.2.0 :roll:

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 » Sat Jun 06, 2009 6:31 am

How to delete the queries of this MOD?

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 Палыч » Sat Jun 06, 2009 5:36 pm

usenet2you wrote:How to delete the queries of this MOD?

Code: Select all

DROP TABLE IF EXISTS phpbb_thanks;
DELETE FROM phpbb_acl_options WHERE auth_option = f_thanks;
DELETE FROM phpbb_acl_options WHERE auth_option = u_viewthanks;
ALTER TABLE phpbb_users DROP COLUMN user_allow_thanks_pm;
DELETE FROM phpbb_config WHERE config_name = remove_thanks;
DELETE FROM phpbb_config WHERE config_name = thanks_postlist_view;
DELETE FROM phpbb_config WHERE config_name = thanks_profilelist_view;
DELETE FROM phpbb_config WHERE config_name = thanks_number;
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 Палыч » Sat Jun 06, 2009 5:40 pm

katib wrote:I think the problem is related to the SQL quiries
The fact that you do not see the buttons - not associated with SQL

You have not answered about the language directory
Палыч wrote:Verify that the file-gif you have in your language folder (for English - styles / mavilim / imageset / en / thankposts.gif), for you - styles / mavilim / imageset /?? / thankposts.gif
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 » Sat Jun 06, 2009 8:08 pm

спасибо ! thank you very much
I am sure the images are in style/mavilim/imageset/ar/
because I am usong arabic

The problem is that NOTHING show in viewtopic :
the is no acknowlegment" link near memberlist in overall_header !! :roll:
there is no "Say thanks: time" and "Obtained thanks: time" under poster's avatar !! :roll:
there is no thanks list under message !! :roll:

But everything is is working fine in the user's profile page :)
I can change setting "Receive notification of gratitude"
I can view how many thanks given or obtained..etc

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 Палыч » Sat Jun 06, 2009 9:08 pm

katib wrote:The problem is that NOTHING show in viewtopic :
ОК
Here are the conditions in viewtopic

Code: Select all

	<!-- IF postrow.S_POST_ANONYMOUS -->
	<!-- ELSEIF not postrow.S_FORUM_THANKS -->
	<!-- ELSEIF not S_USER_LOGGED_IN and not postrow.THANKS -->
	<!-- ELSEIF postrow.S_IS_OWN_POST and not postrow.THANKS -->
	<!-- ELSE -->
		<!-- IF postrow.S_ALREADY_THANKED and not postrow.S_REMOVE_THANKS -->
		<!-- ELSEIF S_USER_LOGGED_IN and not postrow.S_IS_OWN_POST and not S_IS_BOT -->
try to remove it (the permission)

Code: Select all

	<!-- ELSEIF not postrow.S_FORUM_THANKS -->
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 » Sat Jun 06, 2009 11:59 pm

Палыч wrote:try to remove it (the permission)
 <!-- ELSEIF not postrow.S_FORUM_THANKS -->
Tank so much :D :D
Finally, we 've got everything working n as a charm :D
Then what was the probleme !?

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 Палыч » Sun Jun 07, 2009 10:20 am

katib wrote:Then what was the probleme !?
You have correctly identified the permission :?
Try Permission masks View forum-based permissions for a particular user
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 » Sun Jun 07, 2009 2:56 pm

Палыч wrote: You have correctly identified the permission :?
Try Permission masks View forum-based permissions for a particular user
I think permissions are set correctlly
Here is the forum-based permissions for a user called saleeh:

Image

and those are user based permissions:

Image

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 Палыч » Sun Jun 07, 2009 9:18 pm

katib wrote:I think permissions are set correctlly
OK, but they do not work.
So it is with the overlap in the table phpbb_acl_options :?
Other thoughts I have not, sorry :(
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 » Mon Jun 08, 2009 1:58 pm

Палыч wrote:
Other thoughts I have not, sorry :
So it is with the overlap in the table phpbb_acl_options(
But there is no SQL quiry in your Mod witch could add entry into phpbb_acl_options table !!!

Anyway, Thanks for help, I really appreciate it
I will try to install the Mod on live board now, and hope tha tall problem will go away

EDIT:
in the thanks_mod_v122_1.zip
there is NO sql command about :
INSERT INTO phpbb_config..etc
I found aonly the following TWO cammand:

Code: Select all

CREATE TABLE phpbb_thanks (
			post_id mediumint(8) NOT NULL default '0',
			poster_id mediumint(8) NOT NULL default '0',
			user_id mediumint(8) NOT NULL default '0',
			PRIMARY KEY (post_id , user_id)); 

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 Палыч » Tue Jun 09, 2009 6:24 pm

katib wrote:But there is no SQL quiry in your Mod witch could add entry into phpbb_acl_options table !!!
katib wrote: EDIT:
in the thanks_mod_v122_1.zip
there is NO sql command about :
INSERT INTO phpbb_config..etc
This is achieved through the implementation of the file install_thanks_mod.php

Code: Select all

//Install Thanks MOD config options
set_config('remove_thanks', '1');
set_config('thanks_postlist_view', '1');
set_config('thanks_profilelist_view', '1');
set_config('thanks_number', '100');

// Install Thanks MOD permissions
$auth_admin = new auth_admin();

$auth_admin->acl_add_option(array(
    'local'      => array('f_thanks'),
    'global'   => array('u_viewthanks')
));
Sorry for my bad english

Paulo França Lacerda
Registered User
Posts: 109
Joined: Wed Jun 03, 2009 9:17 am

Fixing and Sharing

Post by Paulo França Lacerda » Fri Jun 12, 2009 4:22 am


Ok! FInally got it!

Just 1 bug in 3 locations when using Firebird as Dabatase:

SQL sentences such as...

Code: Select all

select count(*) as count
should have the column name double-quoted...

Code: Select all

select count(*) as "count"
Otherwise, we get an SQL Error!

There are 3 occurrences of such bug in the MOD sources:

FILE thankslist.php

Code: Select all

$sql = 'SELECT user_id, COUNT(*) AS count
  FROM ' . THANKS_TABLE . "
 GROUP BY user_id";
FILE thankslist.php

Code: Select all

$sql = 'SELECT COUNT(user_id) AS total_match_count
  FROM ' . THANKS_TABLE . "
  WHERE user_id = $author_id"; 
FILE thankslist.php

Code: Select all

$sql = 'SELECT poster_id, COUNT(*) AS count
  FROM ' . THANKS_TABLE . "
  GROUP BY poster_id";
As for the Database preparation via SQL sentences, I have also noticed 2 problems (now solved):
1) The sentence won't work for Firebird. Must be adjusted.
2) The PRIMARY KEY should also include the field "postER_id" [/color](typo edited). Otherwise, we got Primary Key VIolation error as soon as we try to thank a second post of the same author. Once fixed in the Database Structure, a given user can safelly thank the same author for different posts of him.

Here is my working version...

Code: Select all

CREATE TABLE ATS_THANKS (
  POST_ID   INTEGER DEFAULT 0 NOT NULL,
  POSTER_ID INTEGER DEFAULT 0 NOT NULL,
  USER_ID   INTEGER DEFAULT 0 NOT NULL);


ALTER TABLE ATS_THANKS 
  ADD CONSTRAINT CPK_THANKS_POSTER_USER PRIMARY KEY (POSTER_ID,USER_ID,POST_ID);

ALTER TABLE phpbb_users 
  ADD user_allow_thanks_pm SmallInt DEFAULT '0' NOT NULL;
[/color]
Last edited by Paulo França Lacerda on Fri Jun 12, 2009 7:20 pm, edited 2 times in total.

Paulo França Lacerda
Registered User
Posts: 109
Joined: Wed Jun 03, 2009 9:17 am

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

Post by Paulo França Lacerda » Fri Jun 12, 2009 8:15 am

WOW, now I'm really done for today. :D
Before going to go to bed, however, I need to post my contribution.

I Just created a ZIP file with by localization for Brazilian Portuguese (Português do Brasil).
As I don't use the "subsilver2" style, only the "prosilver" style is inside (translations, images and advices) for phpBB 3.0.5.

Here it is:
MOD.Thank4Post.v122.PTBR.zip

Screenshots:

Image

Image

Image

Image

Image

Image

Image

Good night, guys! It's 5:12am in Brazil! :shock: :D
Thanks to the author of this awesome MOD !!

Locked

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