Thanks MOD 0.4.0 [works with PHPBB3 Gold]_Small Fix

Discussion forum for MOD Writers regarding MOD Development.
Locked
User avatar
Kingdombuilder
Registered User
Posts: 91
Joined: Sat Apr 26, 2008 7:48 am
Location: Flint, MI
Contact:

Re: [DEV]Thanks MOD 0.4.0 [works with PHPBB3 Gold]_Small Fix

Post by Kingdombuilder »

Download link does not work, can some one re up the link?
Image
User avatar
justhink
Registered User
Posts: 55
Joined: Fri Jun 29, 2007 10:26 pm
Name: Saugata Datta

Re: [DEV]Thanks MOD 0.4.0 [works with PHPBB3 Gold]_Small Fix

Post by justhink »

Kingdombuilder wrote:Download link does not work, can some one re up the link?
Link Updated!
Toktok
Registered User
Posts: 155
Joined: Mon Dec 15, 2008 10:27 am

Re: [DEV]Thanks MOD 0.4.0 [works with PHPBB3 Gold]_Small Fix

Post by Toktok »

it is a .msi extension file. what should i do with it? :?
Toktok
Registered User
Posts: 155
Joined: Mon Dec 15, 2008 10:27 am

Re: [DEV]Thanks MOD 0.4.0 [works with PHPBB3 Gold]_Small Fix

Post by Toktok »

now the link is fully brokern.
cacc
Registered User
Posts: 20
Joined: Sat Nov 11, 2006 5:13 pm
Location: Toronto, Ontario
Contact:

Re: [DEV]Thanks MOD 0.4.0 [works with PHPBB3 Gold]_Small Fix

Post by cacc »

The link that still works is: http://www.sendspace.com/file/fcqqi2

And it works perfect on 3.0.4 and has been well tested. I am still playing around with the code to get it working with attachments (at the moment it does have the button on a post with an attachment), and I am also working on putting the thanks link into the post next to quote and only show the extra table if there is a thanks instead of the table always being there. I will keep you guys posted on my progress.
cacc
Registered User
Posts: 20
Joined: Sat Nov 11, 2006 5:13 pm
Location: Toronto, Ontario
Contact:

Re: [DEV]Thanks MOD 0.4.0 [works with PHPBB3 Gold]_Small Fix

Post by cacc »

The following code change will put the thanks button in the post itself AND fix it not showing up with attachments. I also recommend changing the removethanks.gif image to a 1x1 pixel transparent image to get rid of it, and a little customization to the thankposts.gif button won't hurt either. Instead of the changes in viewtopic_body.html in the files, use the code below:

Image
Example of Thanks MOD changes

Find

Code: Select all

<!-- IF postrow.POSTER_FROM --><dd><strong>{L_LOCATION}:</strong> {postrow.POSTER_FROM}</dd><!-- ENDIF -->
Add After

Code: Select all

<dd><strong>{L_GIVEN}:</strong> {postrow.POSTER_GIVE_COUNT} {L_THANKS}</dd>
<dd><strong>{L_RECEIVED}:</strong> {postrow.POSTER_RECEIVE_COUNT} {L_THANKS}</dd>
Find

Code: Select all

<!-- IF postrow.U_QUOTE --><li class="quote-icon"><a href="{postrow.U_QUOTE}" title="{L_REPLY_WITH_QUOTE}"><span>{L_REPLY_WITH_QUOTE}</span></a></li><!-- ENDIF -->
Add After

Code: Select all

<!-- IF S_USER_LOGGED_IN and not postrow.S_IS_OWN_POST and not S_IS_BOT --><a href="{postrow.THANKS_LINK}"><img src="{T_IMAGESET_PATH}{postrow.THANKS_IMG}" alt="{postrow.THANK_ALT}{postrow.POST_AUTHOR}{postrow.THANK_ALT2}" /></a> <!-- ENDIF -->
Find

Code: Select all

<!-- END postrow -->
Add Before

Code: Select all

<!-- IF postrow.THANKS -->
<!-- IF not S_USER_LOGGED_IN and not postrow.THANKS -->
	<!-- ELSEIF postrow.S_IS_OWN_POST and not postrow.THANKS -->
	<!-- ELSE -->
	<div class="post bg3">
		<div class="inner"><span class="corners-top"><span></span></span>
			<dl class="postbody">
				<dd> 
					{postrow.THANK_TEXT}{postrow.POST_AUTHOR_FULL}{postrow.THANKS_GENDER}:<br /> {postrow.THANKS}
				</dd>
			</dl>  
		<span class="corners-bottom"><span></span></span></div>
	</div>
	<hr class="divider" />
	<!-- ENDIF -->
<!-- ENDIF -->
aljosha
Registered User
Posts: 12
Joined: Wed Jan 09, 2008 11:18 am

Re: [DEV]Thanks MOD 0.4.0 [works with PHPBB3 Gold]_Small Fix

Post by aljosha »

Thank you very much for this ... ;)
aljosha
Registered User
Posts: 12
Joined: Wed Jan 09, 2008 11:18 am

Re: [DEV]Thanks MOD 0.4.0 [works with PHPBB3 Gold]_Small Fix

Post by aljosha »

Could you please give me that thanks gif ?
cacc
Registered User
Posts: 20
Joined: Sat Nov 11, 2006 5:13 pm
Location: Toronto, Ontario
Contact:

Re: [DEV]Thanks MOD 0.4.0 [works with PHPBB3 Gold]_Small Fix

Post by cacc »

I want to add this to viewforum_body.html as well in between replies and views. Does anyone know how to have it add up the number of thanks within the post and display it there? My knowledge of PHP is semi-limited so I can do some changes, but obviously not all. Any input would be much appreciated!
User avatar
Muad''Dib
Registered User
Posts: 311
Joined: Tue Jun 12, 2007 6:20 pm
Contact:

Re: [DEV]Thanks MOD 0.4.0 [works with PHPBB3 Gold]_Small Fix

Post by Muad''Dib »

cacc wrote:The following code change will put the thanks button in the post itself AND fix it not showing up with attachments. I also recommend changing the removethanks.gif image to a 1x1 pixel transparent image to get rid of it, and a little customization to the thankposts.gif button won't hurt either. Instead of the changes in viewtopic_body.html in the files, use the code below:

Image
Example of Thanks MOD changes

Find

Code: Select all

<!-- IF postrow.POSTER_FROM --><dd><strong>{L_LOCATION}:</strong> {postrow.POSTER_FROM}</dd><!-- ENDIF -->
Add After

Code: Select all

<dd><strong>{L_GIVEN}:</strong> {postrow.POSTER_GIVE_COUNT} {L_THANKS}</dd>
<dd><strong>{L_RECEIVED}:</strong> {postrow.POSTER_RECEIVE_COUNT} {L_THANKS}</dd>
Find

Code: Select all

<!-- IF postrow.U_QUOTE --><li class="quote-icon"><a href="{postrow.U_QUOTE}" title="{L_REPLY_WITH_QUOTE}"><span>{L_REPLY_WITH_QUOTE}</span></a></li><!-- ENDIF -->
Add After

Code: Select all

<!-- IF S_USER_LOGGED_IN and not postrow.S_IS_OWN_POST and not S_IS_BOT --><a href="{postrow.THANKS_LINK}"><img src="{T_IMAGESET_PATH}{postrow.THANKS_IMG}" alt="{postrow.THANK_ALT}{postrow.POST_AUTHOR}{postrow.THANK_ALT2}" /></a> <!-- ENDIF -->
Find

Code: Select all

<!-- END postrow -->
Add Before

Code: Select all

<!-- IF postrow.THANKS -->
<!-- IF not S_USER_LOGGED_IN and not postrow.THANKS -->
	<!-- ELSEIF postrow.S_IS_OWN_POST and not postrow.THANKS -->
	<!-- ELSE -->
	<div class="post bg3">
		<div class="inner"><span class="corners-top"><span></span></span>
			<dl class="postbody">
				<dd> 
					{postrow.THANK_TEXT}{postrow.POST_AUTHOR_FULL}{postrow.THANKS_GENDER}:<br /> {postrow.THANKS}
				</dd>
			</dl>  
		<span class="corners-bottom"><span></span></span></div>
	</div>
	<hr class="divider" />
	<!-- ENDIF -->
<!-- ENDIF -->
Thanks for these suggestions!
User avatar
Muad''Dib
Registered User
Posts: 311
Joined: Tue Jun 12, 2007 6:20 pm
Contact:

Re: [DEV]Thanks MOD 0.4.0 [works with PHPBB3 Gold]_Small Fix

Post by Muad''Dib »

Ive also modded it a little more to add some functionality.

My Instructions are in relation to the mod download posted in the following post:

http://www.phpbb.com/community/viewtopi ... 5#p8895475

I added the same things that you see in the profile post page to the memberlist view page.

Here is an example:
Image

Open: memberlist.php.
Find:

Code: Select all

$user->setup(array('memberlist', 'groups'));
Add After:

Code: Select all

// Thank Post Mod
include($phpbb_root_path . 'thanks.' . $phpEx);
// End Mod
Find:

Code: Select all

'VISITED'		=> (empty($last_visit)) ? ' - ' : $user->format_date($last_visit),
Add After:

Code: Select all

		// Thank Post Mod
		'POSTER_RECEIVE_COUNT'	=> get_user_count($user_id, true),
		'POSTER_GIVE_COUNT'		=> get_user_count($user_id, false),
		// End Mod
Open: styles/prosilver/template/memberlist_view.html.
Find:

Code: Select all

<dt>{L_VISITED}:</dt> <dd>{VISITED}</dd>
Add After:

Code: Select all

            <dt>{L_GIVEN}:</dt> <dd>{POSTER_GIVE_COUNT} {L_THANKS}</dd>
			<dt>{L_RECEIVED}:</dt> <dd>{POSTER_RECEIVE_COUNT} {L_THANKS}</dd>
Hope someone finds that usefull.

One thing i was considering was making those links in memberlist_view clickable. When clicked they would take you to all the posts that the user was thanked for, or thanked someone else for.
However, that would be alot more involved than just making them viewable in memberlist_view.. so i doubt ill try it. Maybe someday when i get more comfortable with phpbb and sql.
zems
Registered User
Posts: 8
Joined: Mon Jan 26, 2009 7:23 am

Re: [DEV]Thanks MOD 0.4.0 [works with PHPBB3 Gold]_Small Fix

Post by zems »

Same changes shoud be done in ucp_main_front.html because you can't see it in your UCP .
User avatar
Muad''Dib
Registered User
Posts: 311
Joined: Tue Jun 12, 2007 6:20 pm
Contact:

Re: [DEV]Thanks MOD 0.4.0 [works with PHPBB3 Gold]_Small Fix

Post by Muad''Dib »

zems wrote:Same changes shoud be done in ucp_main_front.html because you can't see it in your UCP .
It wasnt my intention to have it show in UCP ... but it would be kinda cool if it did. I may work on that today.
User avatar
Muad''Dib
Registered User
Posts: 311
Joined: Tue Jun 12, 2007 6:20 pm
Contact:

Re: [DEV]Thanks MOD 0.4.0 [works with PHPBB3 Gold]_Small Fix

Post by Muad''Dib »

Ok, i have it working in UCP.

When you first open your User Control Panel, you will now have something that looks like this:
Image

Here are the instructions:

Open: ucp.php.
Find:

Code: Select all

$user->setup('ucp');
Add After:

Code: Select all

// Thank Post Mod
include($phpbb_root_path . 'thanks.' . $phpEx);
// End Mod
Open: includes/ucp/ucp_main.php.
Find:

Code: Select all

'VISITED'			=> (empty($last_visit)) ? ' - ' : $user->format_date($last_visit),
Add After:

Code: Select all

					// Thank Post Mod
					'POSTER_RECEIVE_COUNT_UCP'	=> get_user_count($user->data['user_id'], true),
					'POSTER_GIVE_COUNT_UCP'		=> get_user_count($user->data['user_id'], false),
					// End Mod
Open: styles/prosilver/template/ucp_main_front.html.
Find:

Code: Select all

<dt>{L_VISITED}:</dt> <dd>{LAST_VISIT_YOU}</dd>
Add After:

Code: Select all

        <dt>{L_GIVEN}:</dt> <dd>{POSTER_GIVE_COUNT_UCP} {L_THANKS}</dd>
		<dt>{L_RECEIVED}:</dt> <dd>{POSTER_RECEIVE_COUNT_UCP} {L_THANKS}</dd>
Thats it!
Toktok
Registered User
Posts: 155
Joined: Mon Dec 15, 2008 10:27 am

Re: [DEV]Thanks MOD 0.4.0 [works with PHPBB3 Gold]_Small Fix

Post by Toktok »

download link does not working.
Locked

Return to “[3.0.x] MOD Writers Discussion”