Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications

Reply
 
Thread Tools
Private Message button in postbit footer Details »»
Private Message button in postbit footer
Version: 1.00, by trilOByte trilOByte is offline
Developer Last Online: Sep 2013 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 4.0.2 Rating:
Released: 02-16-2010 Last Update: Never Installs: 98
Template Edits
Re-useable Code  
No support by the author.

This simple mod does what is says on the tin, it adds a PM button in the postbit footer using the vBulletin 4.0.2 css convention for mouseover buttons.

Note: This mod is NOT compatible with vBulletin 4.0.1 or earlier.



It could be argued that this is a little superfluous as there is a PM link in the dropdown under the members name, but that link requires a "click>>>scroll>>>click" to get to where you want to be. If your members use the PM system a lot, then they may appreciate a "one click" option.

There are...
1x addition to the postbit.css template
1x addition to the posbit (or postbit_legacy) template
2x images to upload

INSTRUCTIONS:
1x addition to he posbit.css template
Go to..
Styles & Templates>Stlye Manager>your skin>edit templates>CSS templates>postbit.css
----------------------------------------------------------------------
Find (search for "editpost"):
HTML Code:
.postbitlegacy .postfoot .textcontrols a.editpost, .postbit .postfoot .textcontrols a.editpost, .eventbit .eventfoot .textcontrols a.editevent  {
	background: url({vb:stylevar imgdir_button}/edit_40b.png) no-repeat transparent {vb:stylevar left} ;
	padding-{vb:stylevar left}: 20px;
}
.postbitlegacy .postfoot .textcontrols a.editpost:hover, .postbit .postfoot .textcontrols a.editpost:hover, .eventbit .eventfoot .textcontrols a.editevent:hover  {
	background: url({vb:stylevar imgdir_button}/edit_40b-hover.png) no-repeat transparent {vb:stylevar left};
	padding-{vb:stylevar left}: 20px;
}
Under that, put:
HTML Code:
.postbitlegacy .postfoot .textcontrols a.pminpostbit, .postbit .postfoot .textcontrols a.pminpostbit  {
	background: url({vb:stylevar imgdir_button}/pminpostbit_40b.png) no-repeat transparent {vb:stylevar left};
	padding-{vb:stylevar left}: 20px;
}
.postbitlegacy .postfoot .textcontrols a.pminpostbit:hover, .postbit .postfoot .textcontrols a.pminpostbit:hover  {
	background: url({vb:stylevar imgdir_button}/pminpostbit_40b-hover.png) no-repeat transparent {vb:stylevar left};
	padding-{vb:stylevar left}: 20px;
}
----------------------------------------------------------------------
Click "save".

1x addition to the posbit (or postbit_legacy) template:
Go to..
Styles & Templates>Stlye Manager>your skin>edit templates>postbit templates>postbit
----------------------------------------------------------------------
Find (search for "editpost"):
HTML Code:
<vb:if condition="$post['editlink']">					
					<a class="editpost" href="{vb:raw post.editlink}" name="vB::QuickEdit::{vb:raw post.postid}"><img src="{vb:raw vboptions.cleargifurl}" id="editimg_{vb:raw post.postid}" alt="{vb:rawphrase edit_delete_message}" /> {vb:rawphrase edit_post}</a>
					<span class="seperator">&nbsp;</span>
</vb:if>
Under that, put:
HTML Code:
<!-- ////////start PM button in postbit////// -->
<vb:if condition="$show['pmlink']"><a class='pminpostbit' href="private.php?{vb:raw session.sessionurl}do=newpm&amp;u={vb:raw post.userid}" rel="nofollow"><img src="{vb:raw vboptions.cleargifurl}" alt="{vb:rawphrase send_pm}" />PM</a><span class="seperator">&nbsp;</span></vb:if>
<!-- ////////end PM button in postbit////// -->
----------------------------------------------------------------------
Click "save".

2x images to upload:
FTP into your forum/images/buttons dir and upload these two attached images:
----------------------------------------------------------------------
pminpostbit_40b.png
pminpostbit_40b-hover.png
----------------------------------------------------------------------

That's it.

Download Now

File Type: zip pminpostbit_images.zip (696 Bytes, 496 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
2 благодарности(ей) от:
elsa23, nacaruncr

Comments
  #52  
Old 08-20-2012, 11:02 AM
CAG CheechDogg's Avatar
CAG CheechDogg CAG CheechDogg is offline
 
Join Date: Feb 2012
Location: Riverside, California USA
Posts: 1,080
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great little addition to my forums! Thanks a lot trilOByte !!
Reply With Quote
  #53  
Old 08-20-2012, 01:04 PM
qpurser qpurser is offline
 
Join Date: Jul 2011
Posts: 275
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by 1320Nation View Post
Mod is not updated for current vb version. Not compatible with postbit.css and who knows what else.
I installed it on my test forum (4.2) and put the code into my postbit-legacy and works fine.
Reply With Quote
  #54  
Old 02-05-2013, 09:18 PM
kylek kylek is offline
 
Join Date: Oct 2003
Location: British Columbia, Canada
Posts: 798
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just installed on 4.2.0 P3 and it works fine.
Reply With Quote
  #55  
Old 07-31-2013, 11:11 AM
stevieb stevieb is offline
 
Join Date: Apr 2005
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

works fine on 4.2.0 - thanks
Reply With Quote
  #56  
Old 08-21-2013, 03:14 AM
whitewolf68 whitewolf68 is offline
 
Join Date: Oct 2011
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The images are not showing in my forum for some reason. Any ideas??
Reply With Quote
  #57  
Old 07-13-2014, 10:08 PM
thetechgenius's Avatar
thetechgenius thetechgenius is offline
 
Join Date: Jun 2014
Posts: 258
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Couldn't this be done by adding a Plugin? I added a plugin to add an "Add Friend" button to the same place in the postbit.

Edit:

I just found an easier way of doing this, without editing any templates, only the Additional.css, and Creating a new plugin.


Create a new plugin:

Product: vBulletin
Hook Location: postbit_display_complete
Title: send_pm_user (could be anything you want)
Execution Order: 5


Plugin PHP Code:

Code:
$postuserinfo = fetch_userinfo($post['userid'], 128);

{
    $template_hook['postbit_controls'] .= '<span class="sendpm"><a href="private.php? ' . $vbulletin->session->vars['sessionurl'] . 'do=newpm&u=' . $post['userid'] . '">' . construct_phrase($vbphrase['send_pm'], $post['username']) . '<img class="pmimg2" alt="Send PM" src="images/site_icons/pm.png"></a><span class="seperator"></span></span>';
}
Change the code in RED to the image location of the Send PM Image that you downloaded from the first post.



Add this to Additional.css:

Code:
/* Add Send PM to Postbit - Begin */

.pmimg2{margin:-2px;}
.sendpm{position: absolute;right: 495px;}  

/* Add Send PM to Postbit - End */
You may need to change the code in RED to align the button correctly. Lower Number = Right, Bigger Number = Left.

I have an "Add Friend" button in my postbit, so I had to align my "Send PM" before that, so mine will probably be different then yours. Just mess around with the code in RED to get the button exactly were you want it.




All Credit goes to the OP trilOByte, I just figured out another way to implement his addon.

Note: You must know that if you add this mod this way, all usergroups will be able to see the button, including Guests. If you only want to allow specific usergroups, then you will have to edit the "postbit" or "postbit_legacy" template(s) and add the code manually. If anyone needs the code for the template version, let me know and I will post my code I use on my forum.
Reply With Quote
2 благодарности(ей) от:
Fields, stained
  #58  
Old 07-13-2014, 10:15 PM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sure it could, I did it in a mod before.
Reply With Quote
  #59  
Old 07-14-2014, 02:45 PM
AFF648 AFF648 is offline
 
Join Date: May 2014
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works great in 4.2.1 except the hover box won't appear. Here's what's in the postbit legacy:

<!-- ////////start PM button in postbit////// -->
<vb:if condition="$show['pmlink']"><a class='pminpostbit' href="private.php?{vb:raw session.sessionurl}do=newpm&amp;u={vb:raw post.userid}" rel="nofollow"><img src="{vb:raw vboptions.cleargifurl}" alt="{vb:rawphrase send_pm} To {vb:raw post.username}" />PM</a><span class="seperator">&nbsp;</span></vb:if>
<!-- ////////end PM button in postbit////// -->

Any ideas what could be wrong?
Reply With Quote
  #60  
Old 07-15-2014, 04:59 PM
Fields Fields is offline
 
Join Date: Jun 2014
Location: Germany
Posts: 147
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great mod!

Works fine with vB 4.2.2.

I just have one question: the PM link is also displayed under a private message, how do I remove it there?
Reply With Quote
  #61  
Old 07-15-2014, 05:02 PM
Fields Fields is offline
 
Join Date: Jun 2014
Location: Germany
Posts: 147
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by AFF648 View Post
Works great in 4.2.1 except the hover box won't appear. Here's what's in the postbit legacy:

<!-- ////////start PM button in postbit////// -->
<vb:if condition="$show['pmlink']"><a class='pminpostbit' href="private.php?{vb:raw session.sessionurl}do=newpm&amp;u={vb:raw post.userid}" rel="nofollow"><img src="{vb:raw vboptions.cleargifurl}" alt="{vb:rawphrase send_pm} To {vb:raw post.username}" />PM</a><span class="seperator">&nbsp;</span></vb:if>
<!-- ////////end PM button in postbit////// -->

Any ideas what could be wrong?

The hover is set in the postbit.css template, are you sure you added the code discribed in the instructions above?
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:20 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09555 seconds
  • Memory Usage 2,352KB
  • Queries Executed 28 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (4)bbcode_html
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (4)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete