[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!
Get Involved
Locked
User avatar
carlflaherty
Registered User
Posts: 61
Joined: Wed Sep 03, 2008 8:55 pm

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

Post by carlflaherty » Thu Sep 11, 2008 9:15 pm

How can i change the height of the thanks box as highlighted in the below picture?

Image

Its too too big lol

Thanks
ChromeGuru.info
Visit Google Chrome Forums
Click Here for ChromeGuru Themes Directory

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

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

Post by usenet2you » Fri Sep 12, 2008 6:02 pm

carlflaherty wrote:How can i change the height of the thanks box as highlighted in the below picture?

Image

Its too too big lol

Thanks
yeshh, that have I see too. Can you make a fix Mahoney?

User avatar
fazaljatoi
I've Been Banned!
Posts: 503
Joined: Wed Aug 31, 2005 8:02 pm

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

Post by fazaljatoi » Sat Sep 13, 2008 4:49 pm

my users face register issue after instailing thanks post mod
Image
how i fix this

User avatar
carlflaherty
Registered User
Posts: 61
Joined: Wed Sep 03, 2008 8:55 pm

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

Post by carlflaherty » Sat Sep 13, 2008 5:52 pm

Just bumping this thread, its been a few days ;)
ChromeGuru.info
Visit Google Chrome Forums
Click Here for ChromeGuru Themes Directory

User avatar
MartectX
Translator
Posts: 1324
Joined: Wed Dec 19, 2007 8:05 pm
Location: Marienplatz

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

Post by MartectX » Sat Sep 13, 2008 10:06 pm

carlflaherty wrote:Just bumping this thread, its been a few days ;)
A few days? More like one hour!!

Anyways, is there a ModDB release to be expected in the next few days?

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.1.0

Post by Mahoney » Sun Sep 14, 2008 1:38 pm

Hello
usenet2you wrote:When I give thanks for give hide free, the hide is giving free. When I come back later on the day on that topic. The hide is not free. And it says that already have thanked, but the hide is not free. is this an bug?

bad english of mine. :oops: sorry

screen:

Image
Hm...O.K. Try this (for Bugfixing the Hide Addon)

Open viewtopic.php

Search

Code: Select all

// Check if the topic viewer has posted in a topic
$unhide = false;
$sql = 'SELECT post_thanked
   FROM ' . POSTS_TABLE . '
   WHERE post_id = ' . $post_id;
$result = $db->sql_query($sql);
$post_thanked = $db->sql_fetchfield('post_thanked');
$db->sql_freeresult($result); 
if ($user->data['user_id'] != ANONYMOUS)
{
	// If moderator or admin, skip reply check, auto unhide
	if ($auth->acl_get('m_', $forum_id))
	{
		$unhide = true;
	}
	else if ($post_thanked > 0)
   {
      $unhide = true;
   }
	else
	{
	$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);
	}
}
Replace with

Code: Select all

// Check if the topic viewer has posted in a topic
$unhide = false;
// create an array of all thanks info
$sql = 'SELECT *
	FROM ' . THANKS_TABLE;
$result = $db->sql_query($sql);
$thankers = array();
$i = 0;
while ($row = $db->sql_fetchrow($result))
{
	$thankers[$i] = array(  
		'user_id' => $row['thanks_from'], 
		'post_id' => $row['post_id'], 
	);
	$i++;
}
$db->sql_freeresult($result);
// check if the user has already thanked that post
function already_thanked($post_id, $user_id)
{
	global $db, $thankers;
	$thanked = false;
	foreach($thankers as $key => $value)
	{
		if ($thankers[$key]['post_id'] == $post_id && $thankers[$key]['user_id'] == $user_id)
		{
			$thanked = true;
		}
	}
	return $thanked;
} 
if ($user->data['user_id'] != ANONYMOUS)
{
	// If moderator or admin, skip reply check, auto unhide
	if ($auth->acl_get('m_', $forum_id))
	{
		$unhide = true;
	}
	else if (already_thanked($post_id, $user->data['user_id']))
   {
      $unhide = true;
   }
	else
	{
	$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);
	}
}
@fazaljatoi
Do you have the Thank Post Mod (hide MOD compatible ) 0.2.0 installed?


Best regards: Mahoney

User avatar
carlflaherty
Registered User
Posts: 61
Joined: Wed Sep 03, 2008 8:55 pm

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

Post by carlflaherty » Sun Sep 14, 2008 3:31 pm

MartectX wrote:
carlflaherty wrote:Just bumping this thread, its been a few days ;)
A few days? More like one hour!!

Anyways, is there a ModDB release to be expected in the next few days?
A few days since my post
ChromeGuru.info
Visit Google Chrome Forums
Click Here for ChromeGuru Themes Directory

autinhyeu
Registered User
Posts: 685
Joined: Mon Apr 14, 2008 6:34 am
Location: Vietnamese
Contact:

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

Post by autinhyeu » Sun Sep 14, 2008 4:13 pm

Mahoney wrote:Hello
usenet2you wrote:When I give thanks for give hide free, the hide is giving free. When I come back later on the day on that topic. The hide is not free. And it says that already have thanked, but the hide is not free. is this an bug?

bad english of mine. :oops: sorry

screen:

Image
Hm...O.K. Try this (for Bugfixing the Hide Addon)

Open viewtopic.php

Search

Code: Select all

// Check if the topic viewer has posted in a topic
$unhide = false;
$sql = 'SELECT post_thanked
   FROM ' . POSTS_TABLE . '
   WHERE post_id = ' . $post_id;
$result = $db->sql_query($sql);
$post_thanked = $db->sql_fetchfield('post_thanked');
$db->sql_freeresult($result); 
if ($user->data['user_id'] != ANONYMOUS)
{
	// If moderator or admin, skip reply check, auto unhide
	if ($auth->acl_get('m_', $forum_id))
	{
		$unhide = true;
	}
	else if ($post_thanked > 0)
   {
      $unhide = true;
   }
	else
	{
	$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);
	}
}
Replace with

Code: Select all

// Check if the topic viewer has posted in a topic
$unhide = false;
// create an array of all thanks info
$sql = 'SELECT *
	FROM ' . THANKS_TABLE;
$result = $db->sql_query($sql);
$thankers = array();
$i = 0;
while ($row = $db->sql_fetchrow($result))
{
	$thankers[$i] = array(  
		'user_id' => $row['thanks_from'], 
		'post_id' => $row['post_id'], 
	);
	$i++;
}
$db->sql_freeresult($result);
// check if the user has already thanked that post
function already_thanked($post_id, $user_id)
{
	global $db, $thankers;
	$thanked = false;
	foreach($thankers as $key => $value)
	{
		if ($thankers[$key]['post_id'] == $post_id && $thankers[$key]['user_id'] == $user_id)
		{
			$thanked = true;
		}
	}
	return $thanked;
} 
if ($user->data['user_id'] != ANONYMOUS)
{
	// If moderator or admin, skip reply check, auto unhide
	if ($auth->acl_get('m_', $forum_id))
	{
		$unhide = true;
	}
	else if (already_thanked($post_id, $user->data['user_id']))
   {
      $unhide = true;
   }
	else
	{
	$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);
	}
}
@fazaljatoi
Do you have the Thank Post Mod (hide MOD compatible ) 0.2.0 installed?


Best regards: Mahoney
Yeah, very good, working ;)
Thanks ^^!
phpBB Community in Vietnamese: http://www.phpbbvn.com

Sorry, my English language is fine impossible

madtay
Registered User
Posts: 328
Joined: Tue Jun 27, 2006 10:27 pm
Contact:

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

Post by madtay » Sun Sep 14, 2008 11:35 pm

Hi Mahoney,

Using the "Post number" mod i have created a javascript show/hide button for the usernames who thanked so they dont appear by default until a user clicks show/hide, making it a bit less intrusive and more similar to the vbulletin version of the thanks mod ... it would be a great addition to this mod... if you want to see my demo pm me :)

User avatar
MartectX
Translator
Posts: 1324
Joined: Wed Dec 19, 2007 8:05 pm
Location: Marienplatz

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

Post by MartectX » Mon Sep 15, 2008 6:43 am

madtay wrote:If you want to see my demo pm me :)
I'm interested in this! :D

madtay
Registered User
Posts: 328
Joined: Tue Jun 27, 2006 10:27 pm
Contact:

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

Post by madtay » Mon Sep 15, 2008 11:23 am

ok its now on my live board so i will share the url here for anyone who is interested...

If you visit the following link you can see it in action (there are a few posts in this thread that have thanks)

http://www.f1racingforums.co.uk/viewtop ... f=5&t=1275

Note: im not trying to hijack this mod or anything :lol: and i wont have time to help people individually implement this mod.. its for the mod author to see if he/she takes an interest in adding this to the mod, as i believe it would be a great addition.

Thanks

autinhyeu
Registered User
Posts: 685
Joined: Mon Apr 14, 2008 6:34 am
Location: Vietnamese
Contact:

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

Post by autinhyeu » Mon Sep 15, 2008 11:50 am

I thinks it is useful ;)
thx ^^!
phpBB Community in Vietnamese: http://www.phpbbvn.com

Sorry, my English language is fine impossible

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 » Mon Sep 15, 2008 12:38 pm

Hello madtay
I thinks it is useful. Can you post the changes (or send via PN)? I would like to add that in the MOD.



Best regards: Mahoney

madtay
Registered User
Posts: 328
Joined: Tue Jun 27, 2006 10:27 pm
Contact:

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

Post by madtay » Mon Sep 15, 2008 1:25 pm

hello Mahoney,

here are the changes for prosilver:


viewtopic.php

Find:

Code: Select all

	if (isset($cp_row['row']) && sizeof($cp_row['row']))
	{
		$postrow = array_merge($postrow, $cp_row['row']);
	}
Add after:

Code: Select all

        $postrow['S_POST_NUM'] = $start + ($i+1);

styles/prosilver/theme/content.css

Find:

Code: Select all

.postprofile {
	/* Also see tweaks.css */
	margin: 5px 0 10px 0;
	min-height: 80px;
	color: #666666;
	border-left: 1px solid #FFFFFF;
	width: 22%;
	float: right;
	display: inline;
}
Add after:

Code: Select all

.postprofile1 {
	/* Also see tweaks.css */
	margin: 5px 0 10px 0;
	color: #666666;
	border-left: 1px solid #FFFFFF;
	width: 22%;
	float: right;
	display: inline;
}

styles/prosilver/template/overall_header.html

Find:

Code: Select all

</head>
Add BEFORE:

Code: Select all

<script type="text/javascript">
<!--
    function toggle_visibility(id) {
       var e = document.getElementById(id);
       if(e.style.display == 'block')
          e.style.display = 'none';
       else
          e.style.display = 'block';
    }
//-->
</script>

styles/prosilver/template/viewtopic_body.html

Find:

Code: Select all

   <!-- 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 -->
REPLACE with:

Code: Select all

   <!-- 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>: [<a style="cursor: hand; cursor: pointer;" onclick="toggle_visibility('{postrow.S_POST_NUM}');">Show Me</a>]<div style="display:none" id="{postrow.S_POST_NUM}">{postrow.THANKS_LIST}</div></dd>

			</dl>
			<!-- IF postrow.S_GIVE_THANKS -->  
			<dl>
				<dt class="postprofile1" 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 -->

<!-- END postrow -->

Refresh theme, purge cache etc...

User avatar
carlflaherty
Registered User
Posts: 61
Joined: Wed Sep 03, 2008 8:55 pm

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

Post by carlflaherty » Mon Sep 15, 2008 9:22 pm

// EDIT // Solved
ChromeGuru.info
Visit Google Chrome Forums
Click Here for ChromeGuru Themes Directory

Locked

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