Jump to content


* * * * - 1 votes

IP.Board 2.2: Adding the PM button


  • Please log in to reply
27 replies to this topic

#1 AndyF

AndyF

    Cogito ergo sum

  • Management
  • PipPipPipPipPipPipPipPipPipPip
  • 8,414 posts
  • Location:Derby, UK
  • Real Name:Andy
  • IPB Version:v3.2.x
Contributor

Posted 30 May 2007 - 11:05 PM

This is the support topic for the tutorial Adding the PM button.  Please post here if you have any questions or feedback.

#2 Depot

Depot

    Invision Modding.com Helper - Type - Person

  • IM Supporters
  • PipPipPipPipPipPipPipPipPipPip
  • 5,573 posts
  • Location:NE Florida
  • Real Name:Larry C
  • IPB Version:v2.3.x
Contributor

Posted 10 August 2007 - 09:46 PM

Nice little addition there AndyF!  thumbsup.gif

Works fine on 2.3x of course...

- - - - nsMod Community Forums - - - -

Posted Image Services System Modification Installation FAQ Invision Modding Store Posted Image

I DO: IPB UPGRADES, MOD INSTALLS, DATABASE BACKUPS & RESTORATION, CUSTOM SKINS, SITE TRANSFERS

IMPORTANT - READ THIS BEFORE YOU PM ME!!!

Do not ask me for assistance / provide me with your url if you own a nullified board - IM Staff will be notified.


#3 AndyF

AndyF

    Cogito ergo sum

  • Management
  • PipPipPipPipPipPipPipPipPipPip
  • 8,414 posts
  • Location:Derby, UK
  • Real Name:Andy
  • IPB Version:v3.2.x
Contributor

Posted 11 August 2007 - 12:52 PM

Thanks  biggrin.gif

View my tutorials

Please do NOT pm me with support related questions unless requested.
If you are in need of help or assistance, please post on the forum in the appropriate section!



A Look Back - 1.0.1 - 1.3.1 - 2.0.0 - 2.1.7 - 2.2.0 - 2.3.6

#4 vesperala

vesperala

    Miradoniz

  • Members
  • PipPipPipPipPipPipPip
  • 697 posts
  • Location:Romania
  • Real Name:nobody
  • IPB Version:v2.3.x

Posted 27 May 2008 - 04:52 PM

View PostAndyF, on Aug 11 2007, 03:52 PM, said:

Thanks  ;)
as I already reported here: http://forums.invisi...;showissue=9244


can you adjust a  little bit the tutorial and make this button disappear when user's messenger is disabled...?

till the ips repair that little bug, this can be helpful...

:)

Edited by vesperala, 27 May 2008 - 04:52 PM.

O raclă mare-i lumea. Stelele-s cuie/Bătute-n ea şi soarele-i fereasta/La temniţa vieţii
Mihai Eminescu

Stelele-n cer, deasupra mărilor, ard depărtărilor, pānă ce pier...

Posted Image


Posted Image

#5 Michael

Michael

    See code 431.322.12 of the Internet Privacy Act

  • Modders
  • PipPipPipPipPipPipPipPipPipPip
  • 22,042 posts
  • Location:Columbus, OH
  • Real Name:Michael McCune
  • IPB Version:v3.1.x
Contributor

Posted 27 May 2008 - 05:07 PM

It'd probably be this:
<if="$this->ipsclass->cache['group_cache'][$author['mgroup']]['g_use_pm']">{$author['message_icon']}</if>

Michael McCune - IPS Marketplace Moderator

My Stuff: My Forum · My Resources · My Tutorials
Contact Me: Email · Facebook · Twitter

#6 vesperala

vesperala

    Miradoniz

  • Members
  • PipPipPipPipPipPipPip
  • 697 posts
  • Location:Romania
  • Real Name:nobody
  • IPB Version:v2.3.x

Posted 27 May 2008 - 06:05 PM

View PostMichael, on May 27 2008, 08:07 PM, said:

It'd probably be this:
<if="$this->ipsclass->cache['group_cache'][$author['mgroup']]['g_use_pm']">{$author['message_icon']}</if>

is better now, I receive an error message when I press / click, but the button is still here... how to make it disappear?  ;)

O raclă mare-i lumea. Stelele-s cuie/Bătute-n ea şi soarele-i fereasta/La temniţa vieţii
Mihai Eminescu

Stelele-n cer, deasupra mărilor, ard depărtărilor, pānă ce pier...

Posted Image


Posted Image

#7 Michael

Michael

    See code 431.322.12 of the Internet Privacy Act

  • Modders
  • PipPipPipPipPipPipPipPipPipPip
  • 22,042 posts
  • Location:Columbus, OH
  • Real Name:Michael McCune
  • IPB Version:v3.1.x
Contributor

Posted 27 May 2008 - 06:18 PM

It shouldn't show at all if the poster can't use the messenger. ;)
Michael McCune - IPS Marketplace Moderator

My Stuff: My Forum · My Resources · My Tutorials
Contact Me: Email · Facebook · Twitter

#8 vesperala

vesperala

    Miradoniz

  • Members
  • PipPipPipPipPipPipPip
  • 697 posts
  • Location:Romania
  • Real Name:nobody
  • IPB Version:v2.3.x

Posted 27 May 2008 - 06:26 PM

View PostMichael, on May 27 2008, 09:18 PM, said:

It shouldn't show at all if the poster can't use the messenger. ;)
it does show up the button...

cache rebuild...

al skins cache rebuild...

but the button is still...maybe I put the wrong code...
I misunderstood something?
<!-- PM / EMAIL / WWW / MSGR -->
<div style="float: left;"><if="$this->ipsclass->cache['group_cache'][$author['mgroup']]['g_use_pm']">{$author['message_icon']}</if>

</div>
<!-- REPORT / UP -->

is not this what you wish?

Edited by vesperala, 27 May 2008 - 06:26 PM.

O raclă mare-i lumea. Stelele-s cuie/Bătute-n ea şi soarele-i fereasta/La temniţa vieţii
Mihai Eminescu

Stelele-n cer, deasupra mărilor, ard depărtărilor, pānă ce pier...

Posted Image


Posted Image

#9 vesperala

vesperala

    Miradoniz

  • Members
  • PipPipPipPipPipPipPip
  • 697 posts
  • Location:Romania
  • Real Name:nobody
  • IPB Version:v2.3.x

Posted 28 May 2008 - 02:10 PM

;)  I miss-replaced something?

O raclă mare-i lumea. Stelele-s cuie/Bătute-n ea şi soarele-i fereasta/La temniţa vieţii
Mihai Eminescu

Stelele-n cer, deasupra mărilor, ard depărtărilor, pānă ce pier...

Posted Image


Posted Image

#10 Michael

Michael

    See code 431.322.12 of the Internet Privacy Act

  • Modders
  • PipPipPipPipPipPipPipPipPipPip
  • 22,042 posts
  • Location:Columbus, OH
  • Real Name:Michael McCune
  • IPB Version:v3.1.x
Contributor

Posted 28 May 2008 - 03:29 PM

I just tested this and it worked fine for me.  It showed the PM button on posts written by people who are able to use the PM system, and it didn't show it for people who couldn't.
Michael McCune - IPS Marketplace Moderator

My Stuff: My Forum · My Resources · My Tutorials
Contact Me: Email · Facebook · Twitter

#11 vesperala

vesperala

    Miradoniz

  • Members
  • PipPipPipPipPipPipPip
  • 697 posts
  • Location:Romania
  • Real Name:nobody
  • IPB Version:v2.3.x

Posted 28 May 2008 - 04:30 PM

View PostMichael, on May 28 2008, 06:29 PM, said:

I just tested this and it worked fine for me.  It showed the PM button on posts written by people who are able to use the PM system, and it didn't show it for people who couldn't.
<!--Begin Msg Number {$post['pid']}-->
<table class='ipbtable' cellspacing="1">
	<tr>
		<td valign="middle" class="row2" width="1%">
			<a name="entry{$post['pid']}"></a>
			<if="$author['id']">
				<div id="post-member-{$post['pid']}" class='popmenubutton-new-out'>
					<span class="{$post['name_css']}">{$author['_pp_online_image']}{$author['_members_display_name']}</span>
				</div>
				<!-- member menu -->
				<div class='popupmenu-new' id='post-member-{$post['pid']}_menu' style='display:none;width:250px'>
					<div class='popupmenu-item-last'>
						<if="$author['members_display_name_short'] != $author['members_display_name']">
							<div class='popupmenu-item'><strong>{$author['members_display_name']}</strong></div>
						</if>
						<div style='float:right'>
							<div class='pp-image-thumb-wrap'>
								<img src='{$author['pp_thumb_photo']}' width='{$author['pp_thumb_width']}' height='{$author['pp_thumb_height']}' alt='' />
							</div>
							<if="$this->ipsclass->vars['pp_allow_member_rate']">
								<div style='margin-top:5px;margin-left:6px;'>
									<img src="{$this->ipsclass->vars['img_url']}/rating_{$author['_pp_rating_real']}_mini.gif" alt='{$this->ipsclass->lang['rating_prefix']}: {$author['_pp_rating_real']}' style='vertical-align:middle' border='0' />
								</div>
							</if>
						</div>
						<div class='popupmenu-item'>
							{$author['_pp_gender_image']} <a href="{$this->ipsclass->base_url}showuser={$author['id']}">{$this->ipsclass->lang['dd_view_profile']}</a>
						</div>
						<if="$author['has_blog'] AND $author['_cache']['my_blog']">
							<div class='popupmenu-item'>
								<img src='{$this->ipsclass->vars['img_url']}/folder_profile_portal/find_posts.png' alt='' border='0' /> <a href='{$this->ipsclass->base_url}automodule=blog&amp;blogid={$author['_cache']['my_blog']}'>{$this->ipsclass->lang['dd_my_blog']}</a>
							</div>
						</if>
						<if="$author['has_gallery']">
							<div class='popupmenu-item'>
								<img src='{$this->ipsclass->vars['img_url']}/folder_profile_portal/find_posts.png' alt='' border='0' /> <a href='{$this->ipsclass->base_url}autocom=gallery&amp;req=user&amp;user={$author['id']}'>{$this->ipsclass->lang['dd_my_albums']}</a>
							</div>
						</if>
						<if="$this->ipsclass->member['id']">
			




<if="$this->ipsclass->member['id'] != $author['id']">
							<div class='popupmenu-item'>														  
								<if="in_array( $author['id'], array_keys( $this->ipsclass->member['_cache']['friends'] ) )">
									<img src='{$this->ipsclass->vars['img_url']}/folder_profile_portal/friend_remove_small.png' alt='' border='0' /> <a href="#" onclick='friends_pop("&amp;do=remove&amp;member_id={$author['id']}&amp;md5check={$this->ipsclass->md5_check}"); return false'>{$this->ipsclass->lang['dd_remove_friend']}</a>
								<else />
									<img src='{$this->ipsclass->vars['img_url']}/folder_profile_portal/friend_add_small.png' alt='' border='0' /> <a href="#" onclick='friends_pop("&amp;do=add&amp;member_id={$author['id']}&amp;md5check={$this->ipsclass->md5_check}"); return false'>{$this->ipsclass->lang['dd_add_friend']}</a>
								</if>
							</div>
													   </if>









							<div class='popupmenu-item'>
								<img src='{$this->ipsclass->vars['img_url']}/folder_profile_portal/send_pm_small.png' alt='' border='0' /> <a href="{$this->ipsclass->base_url}act=Msg&amp;CODE=4&amp;MID={$author['id']}">{$this->ipsclass->lang['dd_send_pm']}</a>
							</div>
							<div class='popupmenu-item'>
								<img src='{$this->ipsclass->vars['img_url']}/folder_profile_portal/find_posts.png' alt='' border='0' /> <a href='{$this->ipsclass->base_url}act=Search&amp;CODE=gettopicsuser&amp;mid={$author['id']}'>{$this->ipsclass->lang['dd_find_topics']}</a>
							</div>
							<div class='popupmenu-item-last'>
								<img src='{$this->ipsclass->vars['img_url']}/folder_profile_portal/find_posts.png' alt='' border='0' /> <a href='{$this->ipsclass->base_url}act=Search&amp;CODE=getalluser&amp;mid={$author['id']}'>{$this->ipsclass->lang['dd_find_posts']}</a>
							</div>
						</if>
					</div>
				</div>
				<!-- member menu -->
				<script type="text/javascript">
					ipsmenu.register( "post-member-{$post['pid']}", '', 'popmenubutton-new', 'popmenubutton-new-out' );
				</script>
			<else />
				<span class="{$post['name_css']}">{$author['_members_display_name']}</span>
			</if>
			
		</td>
		<td class="row2" valign="middle" width="99%">
			<!-- POSTED DATE DIV -->
			<div style="float: left;">
				<span class="postdetails">{$post['post_icon']} <img src='{$this->ipsclass->vars['img_url']}/to_post_off.gif' alt='{$this->ipsclass->lang['to_post_alt']}' border='0' style='padding-bottom:2px' /> {$post['post_date']}</span>
			</div>
			<!-- REPORT / DELETE / EDIT / QUOTE DIV -->
			<div align="right">
				<span class="postdetails">{$post['ip_address']} {$this->ipsclass->lang['posted_on']}
					<a title="{$this->ipsclass->lang['tt_link']}" href="{$this->ipsclass->vars['board_url']}/index.{$this->ipsclass->vars['php_ext']}?showtopic={$post['topic_id']}&amp;view=findpost&amp;p={$post['pid']}" onclick="link_to_post({$post['pid']}); return false;">#{$post['post_count']}</a>
					<if="$this->ipsclass->member['is_mod']">
						| <a href="#" title="{$this->ipsclass->lang['click_for_mod']}" onclick="topic_toggle_pid('{$post['pid']}'); return false;">{$post['pid_start_image']}</a>
					</if>
				</span>
			</div>
		</td>
	</tr>
	<tr>
		<td valign="top" class="{$post['post_css']}">
			<span class="postdetails">
				<if="$author['id'] AND $author['avatar']">
					<a href="{$this->ipsclass->base_url}showuser={$author['id']}" title="{$this->ipsclass->lang['dd_view_profile']}">{$author['avatar']}</a><br /><br />
				<else />
					{$author['avatar']}<br /><br />
				</if>
				{$author['title']}<br />
				{$author['member_rank_img']}<br /><br />


{$this->ipsclass->lang['m_group']} <a href="{$this->ipsclass->base_url}act=members&max_results=20&filter={$author['mgroup']}">{$author['member_group']}</a><br />



				{$author['member_posts']}<br />
				{$author['member_joined']}<br />
				{$author['member_location']}
				{$author['member_number']}<br />
				<if="$author['custom_fields'] != """>
					{$author['custom_fields']}
				</if>
				<br />
				{$author['warn_text']} {$author['warn_minus']}{$author['warn_img']}{$author['warn_add']}
			</span><br />
			<img src="{$this->ipsclass->vars['img_url']}/spacer.gif" alt="" width="160" height="1" /><br /> 
	   </td>
	   <td width="100%" valign="top" class="{$post['post_css']}" id='post-main-{$post['pid']}'>
			<!-- THE POST {$post['pid']} -->
			<div class="postcolor" id='post-{$post['pid']}'>
				{$post['post']}
				{$post['edit_by']}
				<if="$post['post_edit_reason'] != ''">
					<div class='post-edit-reason'>
						{$this->ipsclass->lang['reason_for_edit']}: {$post['post_edit_reason']}
					</div>
				</if>
				<!--IBF.ATTACHMENT_{$post['pid']}-->
			</div>
			
			{$post['signature']}
			<!-- THE POST -->		
		</td>
	</tr>
	<tr>
		<td class="formbuttonrow" nowrap="nowrap">
			<div style='text-align:left'><a href="java script:scroll(0,0);"><{P_UP}></a>{$post['report_link']}</div>
		</td>
		<td class="formbuttonrow" nowrap="nowrap">
		
<!-- PM / EMAIL / WWW / MSGR -->
<div style="float: left;"><if="$this->ipsclass->cache['group_cache'][$author['mgroup']]['g_use_pm']">{$author['message_icon']}</if>

</div>
<!-- REPORT / UP -->


		 	<div align="right">
		 		{$post['approve_button']}{$post['delete_button']}{$post['edit_button']}<a href="#" onclick="multiquote_add({$post['pid']}); return false;" title="{$this->ipsclass->lang['mq_title']}">{$post['mq_start_image']}</a><a href="{$this->ipsclass->base_url}act=Post&amp;CODE=02&amp;f={$this->ipsclass->input['f']}&amp;t={$this->ipsclass->input['t']}&amp;qpid={$post['pid']}" title="{$this->ipsclass->lang['tt_reply_to_post']}"><{P_QUOTE}></a>
		 	</div>
		 </td>
	</tr><tr>
	<td class="catend" colspan="2">
	<!-- no content -->
	</td>
</tr>
</table>
<if="$post['edit_button']!=''">
<script type='text/javascript'>
//<![CDATA[
if ( ajax_loaded && use_enhanced_js )
{
menu_build_menu( 'edit-but-{$post['pid']}',
	new Array(  img_item + " <a title='{$this->ipsclass->lang['edit_full_desc']}' href='{$this->ipsclass->base_url}act=post&amp;do=edit_post&amp;f={$post['forum_id']}&amp;t={$post['topic_id']}&amp;p={$post['pid']}&amp;st={$this->ipsclass->input['st']}'>{$this->ipsclass->lang['edit_full_title']}</a>",
				img_item + " <a href='#' title='{$this->ipsclass->lang['edit_quick_desc']}' onclick='return ajax_prep_for_edit({$post['pid']}, event);'>{$this->ipsclass->lang['edit_quick_title']}</a>" ) );
}
//]]>
</script>
</if>




this is my renderRow template....

well, in IE the button is there and pressing it gives me an error message...
in mozilla firefox the button is also there, and ...works..;)

so, what is wrong here?

Edited by vesperala, 28 May 2008 - 04:32 PM.

O raclă mare-i lumea. Stelele-s cuie/Bătute-n ea şi soarele-i fereasta/La temniţa vieţii
Mihai Eminescu

Stelele-n cer, deasupra mărilor, ard depărtărilor, pānă ce pier...

Posted Image


Posted Image

#12 Michael

Michael

    See code 431.322.12 of the Internet Privacy Act

  • Modders
  • PipPipPipPipPipPipPipPipPipPip
  • 22,042 posts
  • Location:Columbus, OH
  • Real Name:Michael McCune
  • IPB Version:v3.1.x
Contributor

Posted 28 May 2008 - 04:36 PM

I have no idea.  There's also absolutely no way that it would give you an error in one browser and not the other, the browser has absolutely nothing to do with it.
Michael McCune - IPS Marketplace Moderator

My Stuff: My Forum · My Resources · My Tutorials
Contact Me: Email · Facebook · Twitter

#13 vesperala

vesperala

    Miradoniz

  • Members
  • PipPipPipPipPipPipPip
  • 697 posts
  • Location:Romania
  • Real Name:nobody
  • IPB Version:v2.3.x

Posted 28 May 2008 - 05:06 PM

look...with your code or with Andy's... no difference to me here...

in mozilla that buttons works the same...

in IE7 does not work, but appears... pressing it I see the page with: Sorry, an error occurred. If you are unsure on how to use a feature, or don't know why you got this error message, try looking through the help files for more information.

The error returned was:
You are not allowed to use the messenger feature on this board


for each user with PM disabled...

O raclă mare-i lumea. Stelele-s cuie/Bătute-n ea şi soarele-i fereasta/La temniţa vieţii
Mihai Eminescu

Stelele-n cer, deasupra mărilor, ard depărtărilor, pānă ce pier...

Posted Image


Posted Image

#14 vesperala

vesperala

    Miradoniz

  • Members
  • PipPipPipPipPipPipPip
  • 697 posts
  • Location:Romania
  • Real Name:nobody
  • IPB Version:v2.3.x

Posted 28 May 2008 - 06:57 PM

View PostMichael, on May 28 2008, 06:29 PM, said:

I just tested this and it worked fine for me.  It showed the PM button on posts written by people who are able to use the PM system, and it didn't show it for people who couldn't.
did you tested on a 2.3.5 board? ;)

O raclă mare-i lumea. Stelele-s cuie/Bătute-n ea şi soarele-i fereasta/La temniţa vieţii
Mihai Eminescu

Stelele-n cer, deasupra mărilor, ard depărtărilor, pānă ce pier...

Posted Image


Posted Image

#15 Michael

Michael

    See code 431.322.12 of the Internet Privacy Act

  • Modders
  • PipPipPipPipPipPipPipPipPipPip
  • 22,042 posts
  • Location:Columbus, OH
  • Real Name:Michael McCune
  • IPB Version:v3.1.x
Contributor

Posted 28 May 2008 - 07:49 PM

View Postvesperala, on May 28 2008, 02:57 PM, said:

View PostMichael, on May 28 2008, 06:29 PM, said:

I just tested this and it worked fine for me.  It showed the PM button on posts written by people who are able to use the PM system, and it didn't show it for people who couldn't.
did you tested on a 2.3.5 board? ;)
Yes, I tested it on this site.
Michael McCune - IPS Marketplace Moderator

My Stuff: My Forum · My Resources · My Tutorials
Contact Me: Email · Facebook · Twitter

#16 vesperala

vesperala

    Miradoniz

  • Members
  • PipPipPipPipPipPipPip
  • 697 posts
  • Location:Romania
  • Real Name:nobody
  • IPB Version:v2.3.x

Posted 29 May 2008 - 01:19 PM

<if="$this->ipsclass->cache['group_cache'][$author['mgroup']]['g_use_pm'] && $this->ipsclass->member['g_use_pm']">{$author['message_icon']}</if>


this is the replacement I made here. as Michael said...


but the UserTest has the messenger disabled and the PM button is still here...why? ;)

this is happening on all my skins... so I think is not about skin here...

Posted Image

Edited by vesperala, 29 May 2008 - 01:19 PM.

O raclă mare-i lumea. Stelele-s cuie/Bătute-n ea şi soarele-i fereasta/La temniţa vieţii
Mihai Eminescu

Stelele-n cer, deasupra mărilor, ard depărtărilor, pānă ce pier...

Posted Image


Posted Image

#17 Doc

Doc

    Advanced Member

  • Members
  • PipPipPipPip
  • 73 posts
  • Real Name:Viktor
  • IPB Version:v2.3.x

Posted 29 May 2008 - 02:11 PM

Beside me on 2.3.5 works well

But this not in all Skin

http://www.invisionm...amp;article=170

Edited by Doc, 29 May 2008 - 02:13 PM.


#18 vesperala

vesperala

    Miradoniz

  • Members
  • PipPipPipPipPipPipPip
  • 697 posts
  • Location:Romania
  • Real Name:nobody
  • IPB Version:v2.3.x

Posted 29 May 2008 - 02:17 PM

View PostDoc, on May 29 2008, 05:11 PM, said:

Beside me on 2.3.5 works well

But this not in all Skin

http://www.invisionm...amp;article=170
this code makes button disappears for users with messenger disabled??

;) strange thing...

why on my board this is not happening?

O raclă mare-i lumea. Stelele-s cuie/Bătute-n ea şi soarele-i fereasta/La temniţa vieţii
Mihai Eminescu

Stelele-n cer, deasupra mărilor, ard depărtărilor, pānă ce pier...

Posted Image


Posted Image

#19 Doc

Doc

    Advanced Member

  • Members
  • PipPipPipPip
  • 73 posts
  • Real Name:Viktor
  • IPB Version:v2.3.x

Posted 29 May 2008 - 02:50 PM

But what beside you Skin ?

Beside me in one Skine goes this code

<!-- PM / EMAIL / WWW / MSGR -->
<div style="float: left;">{$author['message_icon']}

</div>
<!-- REPORT / UP -->

А in rest goes this

<if="$this->ipsclass->cache['group_cache'][$author['mgroup']]['g_use_pm']">{$author['message_icon']}</if>


#20 Doc

Doc

    Advanced Member

  • Members
  • PipPipPipPip
  • 73 posts
  • Real Name:Viktor
  • IPB Version:v2.3.x

Posted 29 May 2008 - 02:53 PM

Try this

<a href="java script:ins('{$author['message_icon']}</)">PM</a>

javascript -Together

Edited by Doc, 29 May 2008 - 02:55 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users