[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!
Suggested Hosts
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 » Wed Jul 01, 2009 8:06 pm

Download is working again. ;)

gabrielbloodyangel
Registered User
Posts: 16
Joined: Wed Dec 12, 2007 10:48 pm

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

Post by gabrielbloodyangel » Fri Jul 03, 2009 10:05 am

hi all, in order to jfusion integration, I've tryied to insert this mod in the forum whit frameless visualizzation but it give me back this error:

Code: Select all

GENERAL ERROR
SQL ERROR [ mysql4 ]

Sintax error in SQL query near ')' at line 1 [1064]

SQL

SELECT t.*, u.username, u.username_clean, u.user_colour FROM (phpbb_thanks t, phpbb_users u) WHERE u.user_id = t.user_id AND (t.post_id = )

BACKTRACE

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

FILE: includes/functions_thanks.php
LINE: 431
CALL: dbal_mysql->sql_query()

FILE: viewtopic.php
LINE: 1299
CALL: array_all_thanks()

FILE: :/Programmi/EasyPHP 3.0/www/administrator/components/com_jfusion/plugins/phpbb3/public.php
LINE: 261
CALL: include_once('viewtopic.php')

FILE: :/Programmi/EasyPHP 3.0/www/components/com_jfusion/view/frameless/tmpl/default.php
LINE: 89
CALL: JFusionPublic_phpbb3->getBuffer()

FILE: :/Programmi/EasyPHP 3.0/www/libraries/joomla/application/component/view.php
LINE: 564
CALL: include(':/Programmi/EasyPHP 3.0/www/components/com_jfusion/view/frameless/tmpl/default.php')

FILE: :/Programmi/EasyPHP 3.0/www/libraries/joomla/application/component/view.php
LINE: 192
CALL: JView->loadTemplate()

FILE: :/Programmi/EasyPHP 3.0/www/components/com_jfusion/view/frameless/view.html.php
LINE: 54
CALL: JView->display()

FILE: :/Programmi/EasyPHP 3.0/www/components/com_jfusion/controllers/controller.jfusion.php
LINE: 205
CALL: jfusionViewframeless->display()

FILE: :/Programmi/EasyPHP 3.0/www/libraries/joomla/application/component/controller.php
LINE: 236
CALL: JFusionControllerFrontEnd->displayplugin()

FILE: :/Programmi/EasyPHP 3.0/www/components/com_jfusion/jfusion.php
LINE: 64
CALL: JController->execute()

FILE: :/Programmi/EasyPHP 3.0/www/libraries/joomla/application/component/helper.php
LINE: 162
CALL: require_once()

FILE: :/Programmi/EasyPHP 3.0/www/includes/application.php
LINE: 126
CALL: JComponentHelper->renderComponent()

FILE: :/Programmi/EasyPHP 3.0/www/index.php
LINE: 68
CALL: JSite->dispatch()
The jfusion team response:
--> can give you a hint: the post_id field is blank which is why the error occurs.Not sure why
--> it could be some global's that are not defined. , just a guess
I've found a pair of post on phpbbguru.net about jfusion and 1 post that user explain this error but I don't know the russian language...eh eh eh

Can someone help me?

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 Jul 03, 2009 7:08 pm

gabrielbloodyangel
hmm.. :?
try

Code: Select all

includes/functions_thanks.php
== FIND ==
function array_all_thanks()
== REPLACE ==
function array_all_thanks($post_list)

viewtopic.php
== FIND ==
array_all_thanks();
== REPLACE ==
array_all_thanks($post_list);
Sorry for my bad english

gabrielbloodyangel
Registered User
Posts: 16
Joined: Wed Dec 12, 2007 10:48 pm

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

Post by gabrielbloodyangel » Fri Jul 03, 2009 8:20 pm

thanks Палыч for your reply, I just work to the solution, now the visualizzation problem can solved open the file [joomla_root]/administrator/components/com_jfusion/plugins/phpbb3/public.php

find this code:

Code: Select all

/* set scope for variables required later */
        global $phpbb_root_path, $phpEx, $db, $config, $user, $auth, $cache, $template, $phpbb_hook, $module, $mode;
and replace with:

Code: Select all

/* set scope for variables required later */

        global $phpbb_root_path, $phpEx, $db, $config, $user, $auth, $cache, $template, $phpbb_hook, $module, $mode, $post_list, $poster_id, $postrow, $row;
this solution solve the sql error and show correctly the visualizzation of thanks gives; received and the thankslist but now the post is printed whit "thank the author" only, even if you have tanked, instead an array of thanks and the button "remove thanks"

It show this
Image

instead of this
Image

I'm looking that if I point my mouse over the thanks button it call a url without $post_id like this:
instead of:
http://localhost/index.php?option=com_j ... pic.php&p=766&thanks=766&to_id=53&sid=499b399580b889d1955f3be5a1764b36
What it can be?

gabrielbloodyangel
Registered User
Posts: 16
Joined: Wed Dec 12, 2007 10:48 pm

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

Post by gabrielbloodyangel » Sat Jul 04, 2009 3:20 pm

OK solved! I've fix everything now!

the code for jfusion:
open: administrator/components/com_jfusion/plugins/phpbb3/public.php
find:

Code: Select all

/* set scope for variables required later */
global $phpbb_root_path, $phpEx, $db, $config, $user, $auth, $cache, $template, $phpbb_hook, $module, $mode;
replace with:

Code: Select all

/* set scope for variables required later */

global $phpbb_root_path, $phpEx, $db, $config, $user, $auth, $cache, $template, $phpbb_hook, $module, $mode, $post_list, $poster_id, $postrow, $row, $post_id;
For phpbb3:
open includes/functions_thanks.php
find:

Code: Select all

function get_thanks_text($post_id)
{
	global $db, $user, $postrow;
	if (already_thanked($post_id, $user->data['user_id']))
	{
		$postrow = array_merge($postrow, array(
			'THANK_ALT'		=> $user->lang['REMOVE_THANKS'],
			'THANKS_IMG'	=> 'removethanks-icon',
		));
		return;
	}
replace with

Code: Select all

function get_thanks_text($post_id)
{
	global $db, $user, $postrow, $post_id, $thankers;
	$thanked = false;
	foreach((array)$thankers as $key => $value)
	{
	if ($thankers[$key]['post_id'] == $post_id && $thankers[$key]['user_id'] == $user_id);
		{
		$postrow = array_merge($postrow, array(
			'THANK_ALT'		=> $user->lang['REMOVE_THANKS'],
			'THANKS_IMG'	=> 'removethanks-icon',
		));
		return;
		}
	}
find and delete (this marks are not correctly interpreted from jfusion):

Code: Select all

$postrow = array_merge($postrow, array(
			'THANKS'				=> get_thanks($row['post_id']),
			'THANKS_LINK'			=> append_sid("{$phpbb_root_path}viewtopic.$phpEx", "p={$row['post_id']}" . (($topic_data['topic_type'] == POST_GLOBAL) ? "&f=$forum_id" : '') . "&" . get_thanks_link($row['post_id']) . "={$row['post_id']}&to_id=$poster_id"),
			'THANK_TEXT'			=> $user->lang['THANK_TEXT_1'],
			'THANK_TEXT_2'			=> (get_thanks_number($row['post_id']) != 1) ? sprintf($user->lang['THANK_TEXT_2pl'], get_thanks_number($row['post_id'])) : $user->lang['THANK_TEXT_2'],
			'THANKS_FROM'			=> $user->lang['THANK_FROM'],
			'POSTER_RECEIVE_COUNT'	=> get_user_count($poster_id, true),
			'POSTER_GIVE_COUNT'		=> get_user_count($poster_id, false),
			'S_IS_OWN_POST'			=> ($user->data['user_id'] == $poster_id) ? true : false,
			'S_POST_ANONYMOUS'		=> ($poster_id == ANONYMOUS) ? true : false,
			'THANK_IMG' 			=> (already_thanked($row['post_id'], $user->data['user_id'])) ? $user->img('removethanks', $user->lang['REMOVE_THANKS']. get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['post_username'])) : $user->img('thankposts', $user->lang['THANK_POST']. get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['post_username'])),
			'THANKS_POSTLIST_VIEW'	=> $config['thanks_postlist_view'],
			'S_ALREADY_THANKED'		=> already_thanked($row['post_id'], $user->data['user_id']),
			'S_REMOVE_THANKS'		=> $config['remove_thanks'],
		));
open: viewtopic.php
find:

Code: Select all

'S_IGNORE_POST'		=> ($row['hide_post']) ? true : false,
		'L_IGNORE_POST'		=> ($row['hide_post']) ? sprintf($user->lang['POST_BY_FOE'], get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), '<a href="' . $viewtopic_url . "&p={$row['post_id']}&view=show#p{$row['post_id']}" . '">', '</a>') : '',
		'S_FORUM_THANKS'	=> ($auth->acl_get('f_thanks', $forum_id)) ? true : false,
after add (here the marks are correctly interpreted from jfusion):

Code: Select all

'THANKS_LINK'			=> append_sid("{$phpbb_root_path}viewtopic.$phpEx", "p={$row['post_id']}" . (($topic_data['topic_type'] == POST_GLOBAL) ? "&f=$forum_id" : '') . "&" . get_thanks_link($row['post_id']) . "={$row['post_id']}&to_id=$poster_id"),
		'THANKS'				=> get_thanks($row['post_id']),
			'THANK_TEXT'			=> $user->lang['THANK_TEXT_1'],
			'THANK_TEXT_2'			=> (get_thanks_number($row['post_id']) != 1) ? sprintf($user->lang['THANK_TEXT_2pl'], get_thanks_number($row['post_id'])) : $user->lang['THANK_TEXT_2'],
			'THANKS_FROM'			=> $user->lang['THANK_FROM'],
			'POSTER_RECEIVE_COUNT'	=> get_user_count($poster_id, true),
			'POSTER_GIVE_COUNT'		=> get_user_count($poster_id, false),
			'S_IS_OWN_POST'			=> ($user->data['user_id'] == $poster_id) ? true : false,
			'S_POST_ANONYMOUS'		=> ($poster_id == ANONYMOUS) ? true : false,
			'S_ALREADY_THANKED'		=> already_thanked($row['post_id'], $user->data['user_id']),
			'THANK_IMG' 			=> (already_thanked($row['post_id'], $user->data['user_id'])) ? $user->img('removethanks', $user->lang['REMOVE_THANKS']. get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['post_username'])) : $user->img('thankposts', $user->lang['THANK_POST']. get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['post_username'])),
			'THANKS_POSTLIST_VIEW'	=> $config['thanks_postlist_view'],
			
			'S_REMOVE_THANKS'		=> $config['remove_thanks'],
Save and Close all files. End...
EDIT:
All problems are fixed now and jfusion integration of this mod seems to be completed.
The mod works fine even without jfusion integration and even with this modifications, I think that, if this modifications are correct, the official mod can use this in the future for build a thanks mod compatibile with jfusion integration. Now this is the first and only thanks post mod compatible with jfusion plugin. (The first that I know)

Hope to be helpfull
Thanks again

NTH08
Registered User
Posts: 50
Joined: Sat Dec 13, 2008 11:31 am
Location: Vietnam
Contact:

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

Post by NTH08 » Wed Jul 08, 2009 3:47 pm

Hello, i got a problem here.
When i click thank, the mod doesn't work. I don't know why(checked all my edit). Please help me
http://thcsthanhda.info/forum/thung-rac ... -t479.html
ID: test
pass: 123456

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 Jul 08, 2009 6:17 pm

NTH08 wrote: I don't know why
I think the case for modifying the code of your forum, such as SEO :?
Sorry for my bad english

NTH08
Registered User
Posts: 50
Joined: Sat Dec 13, 2008 11:31 am
Location: Vietnam
Contact:

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

Post by NTH08 » Thu Jul 09, 2009 2:35 am

Yes, i use SEO MOD. Please help me :oops:

drhime
Registered User
Posts: 27
Joined: Wed Jul 30, 2008 5:00 am

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

Post by drhime » Thu Jul 09, 2009 3:10 am

Do the thanking or remove gratitude needs to reload the whole page? I mean is it ajaxed?

I would like to have a feature list & bug list of this great looking mod.

Thanks in advance,

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 Jul 09, 2009 4:35 am

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 Палыч » Thu Jul 09, 2009 4:40 am

NTH08 wrote:Yes, i use SEO MOD.
I will try, but not in the near future.
Sorry for my bad english

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 » Thu Jul 09, 2009 5:05 am

Open functions_thanks.php

Change 'THANKS_LINK' to

Code: Select all

'THANKS_LINK'           => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $row['post_id'] . (($topic_data['topic_type'] == POST_GLOBAL) ? '&f=' . $forum_id : '') . '&tmode=' . get_thanks_link($row['post_id'])) . '#p' . $row['post_id'],
Remember to add a nofollow rel to your thank button to avoid Google bot's crawling access.

drhime
Registered User
Posts: 27
Joined: Wed Jul 30, 2008 5:00 am

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

Post by drhime » Fri Jul 10, 2009 2:10 am

Палыч wrote:
drhime wrote:is it ajaxed?
http://www.phpbb.com/community/viewtopi ... 5#p8708615
Any chance of getting a full feature list please! I can't follow that mostly Russian thread :oops:

Thanks for your prompt answer,

sandpiper_flyer
Registered User
Posts: 27
Joined: Tue Jun 24, 2008 1:09 am

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

Post by sandpiper_flyer » Fri Jul 10, 2009 2:43 am

It is easy to cause duplicate entry error when double click the thanks button.
Mmmm... :roll: possibly add Onclick, css for button, display: none?? :D then there is no button to click the second time, unless you are very very quick :lol:

Code: Select all

onclick="this.style.display='none'"

Code: Select all

SQL ERROR [ mysqli ]

Duplicate entry '40393-2' for key 1 [1062]

SQL

INSERT INTO phpbb_thanks (user_id, post_id, poster_id) VALUES ('2', 40393, 56)

BACKTRACE

FILE: includes/db/mysqli.php
LINE: 143
CALL: dbal->sql_error()

FILE: includes/functions_thanks.php
LINE: 87
CALL: dbal_mysqli->sql_query()

FILE: viewtopic.php
LINE: 1320
CALL: insert_thanks()

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 Jul 10, 2009 4:08 pm

drhime wrote:I can't follow that mostly Russian thread
http://translate.google.ru/translate?hl ... 23722.html
:P
Sorry for my bad english

Locked

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