vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   PM Preview 3.5 Edition (https://vborg.vbsupport.ru/showthread.php?t=94954)

BluPhoenix 08-23-2005 10:00 PM

PM Preview 3.5 Edition
 
This is a 3.5 Rewrite of my old hack, now using the plugin system (woo hoo!)

install the attached plugin and then make the following modification to the pm_messagelistbit template.

find:
Code:

        <td class="alt1Active" id="m$pm[pmid]" width="100%">
                <div>
                        <span style="float:$stylevar[right]" class="smallfont">$pm[senddate]</span>
                        <a href="private.php?$session[sessionurl]do=showpm&amp;pmid=$pm[pmid]"><if condition="$show['unread']"><strong>$pm[title]</strong><else />$pm[title]</if></a>
                </div>
                <div class="smallfont">
                        <span style="float:$stylevar[right]" class="time">$pm[sendtime]</span>
                        <if condition="$show['unread']"><strong>$userbit</strong><else />$userbit</if>
                </div>
       
        </td>

replace with:
Code:

        <td class="alt1Active" id="m$pm[pmid]" width="100%">
                <div>
                        <span style="float:$stylevar[right]" class="time" style="font-size:9px;">$pm[senddate] @ $pm[sendtime]</span>
                        <a href="private.php?$session[sessionurl]do=showpm&amp;pmid=$pm[pmid]"><if condition="$show['unread']"><strong>$pm[title]</strong><else />$pm[title]</if></a> (<if condition="$show['unread']"><strong>$userbit</strong><else />$userbit</if> )
                </div>
                <div class="smallfont">
                <i>$pm[pmpreview]</i>       
                </div>
       
        </td>

Extras

To change the length of the preview
Goto the Plugin Manager and in Hook Location : private_messagelist_messagebit find PM Preview v1 click "Edit" and towards the end of it find 300 and increase/reduce the value to lengthen/shorten the preview.

ALTERNATIVE VERSION: Thanks to Erwin for the suggestion
If you would rather have the preview show in a tooltip rather than show it below the PM title then change the required code in pm_messagelistbit to:

alternative code:
Code:

        <td class="alt1Active" id="m$pm[pmid]" width="100%" title="$pm[pmpreview]">
                <div>
                        <span style="float:$stylevar[right]" class="smallfont">$pm[senddate]</span>
                        <a href="private.php?$session[sessionurl]do=showpm&amp;pmid=$pm[pmid]"><if condition="$show['unread']"><strong>$pm[title]</strong><else />$pm[title]</if></a>
                </div>
                <div class="smallfont">
                        <span style="float:$stylevar[right]" class="time">$pm[sendtime]</span>
                        <if condition="$show['unread']"><strong>$userbit</strong><else />$userbit</if>
                </div>
       
        </td>

and that's all folks.. please remember to click the install and always tip your waitress.

Erwin 08-24-2005 12:03 PM

Cool idea. :)

You could even make it so that the message preview comes up as a tooltip within the template using title="". :)

johnbruce71 08-24-2005 12:28 PM

Quote:

Originally Posted by Erwin
Cool idea. :)

You could even make it so that the message preview comes up as a tooltip within the template using title="". :)

Great idea, Installed :)

Xplorer4x4 08-24-2005 02:01 PM

I made the edit and I uploaded the XML...not working for me. The PM inbox turn up the smae as it did. I have a mod to show newest unread PM on forum home instaled, so i tried to deactivate that plug in and that made no diiference.

Edit: It helps to install it on ALL templates now doesn;t it. Instaled and working fine!

uae 08-24-2005 02:51 PM

I like, installed with no problem :)

Erwin, cool tip.

FleaBag 08-24-2005 06:27 PM

Awesome! Had this installed on 3.0.8 about a week or so before I upgraded. Missed it haha! Thanks a lot. :)

dieselpowered 08-25-2005 12:39 AM

Is there a way to lengthen or shorten the review?? Hack looks great!!

Gizmo5h1t3 08-25-2005 06:25 AM

excellent work!!

looks real classy on the board!!

Biker_GA 08-25-2005 06:34 AM

Suggestion. Please include the template instructions in a file as well. This makes it easier to reload the plugin and make the edits in the event of a reload.

BluPhoenix 08-25-2005 11:21 AM

Quote:

Originally Posted by xtremeoff-road
Is there a way to lengthen or shorten the review?? Hack looks great!!

Goto the Plugin Manager and in Hook Location : private_messagelist_messagebit find PM Preview v1 click "Edit" and towards the end of it find 300 and increase/reduce the value to lengthen/shorten the preview.

(instructions updated)

BluPhoenix 08-25-2005 11:29 AM

Quote:

Originally Posted by Erwin
Cool idea. :)

You could even make it so that the message preview comes up as a tooltip within the template using title="". :)

Thanks for the alternative suggestion, have updated the instructions for those wanting to do just that..

Da Chang Gang 08-25-2005 02:00 PM

May I ask what this is for?

Biker_GA 08-25-2005 02:06 PM

Screen shot tells all.

BluPhoenix 08-25-2005 04:50 PM

Quote:

Originally Posted by Da Chang Gang
May I ask what this is for?

Like Biker GA said the screenshot tells the tale, but basically it provides a preview of your PM so you can see if it's worth reading right now or can be left for later, also good for seeing what a message was when your clearing out your inbox.

dieselpowered 08-25-2005 06:37 PM

Quote:

Originally Posted by BluPhoenix
Goto the Plugin Manager and in Hook Location : private_messagelist_messagebit find PM Preview v1 click "Edit" and towards the end of it find 300 and increase/reduce the value to lengthen/shorten the preview.

(instructions updated)

Thanks man, I kinda assumed that is what the value of 300 was, however, without asking I probably would have broken something.

Great hack!!

sifuhall 08-25-2005 09:51 PM

Nice work!

Darth Gill 09-04-2005 09:55 PM

Great modification... Thanks!

glorify 10-03-2005 01:59 PM

I love this hack. I get ton's of PM's and this speeds up the process. Great work.

Xplorer4x4 10-03-2005 02:20 PM

Any way to make both versions work?

dieselpowered 10-05-2005 07:09 PM

Anyone have this running properly on 3.5 Gold?

Maybe if it is we should change the vBulletin version on this hack :)

akanevsky 10-05-2005 10:58 PM

I've noticed that if there is HTML in PM, that HTML is displayed and the page gets broken...

ndahiya 10-06-2005 10:51 AM

looks like it works in 3.5 gold....
not sure of the html prob mentioned above.

Rastus 10-07-2005 05:56 PM

I get "Parse error: parse error, unexpected '<' in /newhome/******/public_html/private.php(1445) : eval()'d code on line 1 when installing this.

SVTOA 10-07-2005 09:02 PM

Works fine on 3.5 Gold.

smokering 10-08-2005 02:12 AM

and smokering clicks install really like this one thank you for this nice hack

pfvc 10-08-2005 08:33 AM

Great mod, works a treat...

Installed on 3.5.0 Gold (I was wondering why it wasn't working to begin with since I had done everything... I realised I had forgotten to active the plugin system globally in the forum's options settings... then it worked lol)

akanevsky 10-08-2005 11:09 AM

Quote:

not sure of the html prob mentioned above.
There is such a problem. But it only happens when there is HTML enableed...

akanevsky 10-26-2005 09:38 PM

Excellent hack bro, keep up the good work!
sorry about the HTML thing, it must've been I used someone else's hack :P

.Tim 10-26-2005 10:03 PM

Would be nice if this could be made optional, so the user could decide if they wanted it on or not.

.Tim 10-26-2005 10:22 PM

Quote:

Originally Posted by .Tim
Would be nice if this could be made optional, so the user could decide if they wanted it on or not.

Just figured out how:

1) Go to admincp and create a new profile field. Choose Multiple-Selection Checkbox. Fill in the details and then choose where you want to appear, I chose Options: Messaging / Notification


2) And then replace either the original code or the hack code if you already did this with (change the xx after field to whatever your field number is):

Code:

<if condition="($vbulletin->userinfo['fieldxx'] == 'Yes')">
<td class="alt1Active" id="m$pm[pmid]" width="100%">
                <div>
                        <span style="float:$stylevar[right]" class="time" style="font-size:9px;">$pm[senddate] @ $pm[sendtime]</span>
                        <a href="private.php?$session[sessionurl]do=showpm&amp;pmid=$pm[pmid]"><if condition="$show['unread']"><strong>$pm[title]</strong><else />$pm[title]</if></a> (<if condition="$show['unread']"><strong>$userbit</strong><else />$userbit</if> )
                </div>
                <div class="smallfont">
                <i>$pm[pmpreview]</i>       
                </div>
       
        </td>
<else />
<td class="alt1Active" id="m$pm[pmid]" width="100%">
                <div>
                        <span style="float:$stylevar[right]" class="smallfont">$pm[senddate]</span>
                        <a href="private.php?$session[sessionurl]do=showpm&amp;pmid=$pm[pmid]"><if condition="$show['unread']"><strong>$pm[title]</strong><else />$pm[title]</if></a>
                </div>
                <div class="smallfont">
                        <span style="float:$stylevar[right]" class="time">$pm[sendtime]</span>
                        <if condition="$show['unread']"><strong>$userbit</strong><else />$userbit</if>
                </div>
       
        </td>
</if>


Don't know if that was the best way to do it but it worked for me. :D

ShadowOne 11-30-2005 02:09 PM

works great with 3.5.1.....thanks for the great hack...

Megareus Rex 01-21-2006 03:40 AM

Excellent hack, I loved it on 3.0.

*installed

Guest210212002 01-21-2006 04:29 AM

3.5.3 no problems, quick question:

How do I change the alt background of the preview area? Currently it's the same color as the message title (alt1) and I'd like to make it alt2.

/me clicks install

lamilein 01-24-2006 11:57 AM

Quote:

Originally Posted by Chris-777
3.5.3 no problems, quick question:

How do I change the alt background of the preview area? Currently it's the same color as the message title (alt1) and I'd like to make it alt2.

[high]* Chris-777 clicks install[/high]

quick and dirty: edit the xml file of the plugin and re-install it

better: [APM] Advanced Product Management 2.0.3 and edit the html online in the vB database :)

VBUsers 03-11-2006 08:33 PM

installed and works great thanks!

Oblivion Knight 03-11-2006 09:04 PM

Cool.! :)

I'm using the tooltip edit, and replaced the 300 with:
$vbulletin->options['threadpreview']

Eventually you may want to consider turning this in to a product, with it's own setting(s). There's plenty of room for expansion with this.. :)

Ramsesx 03-13-2006 11:45 AM

Very nice, thank you :)

drex 03-23-2006 12:28 AM

mine only shows the list of messages, and no preview.

i don't know WTF is wrong.

i uploaded the plugin. where does the HOOK go? mine is at ajax start. if i put it to pm_messagebit, i get a bunch of errors.

please help!

hotwheels 03-23-2006 12:58 AM

Quote:

Originally Posted by drex
mine only shows the list of messages, and no preview.

i don't know WTF is wrong.

i uploaded the plugin. where does the HOOK go? mine is at ajax start. if i put it to pm_messagebit, i get a bunch of errors.

please help!

You are going into the plug in manager right? In the plugin manager, locate your pm preview and click edit........toward's the end of the code, you will see something like this:
Quote:

$pm['pmpreview'] = strip_quotes($pm['message']);
$pm['pmpreview'] = htmlspecialchars_uni(fetch_trimmed_title(strip_bbc ode(fetch_censored_text($pm['pmpreview']), false, true), 75));
and where the 75 is, that will probably be 300 or so on your's, change it to what ever you want..............i am still using his older version, and it work's like a champ.

drex 03-23-2006 04:29 AM

yep, that's where i am at

PHP Code:

<?xml version="1.0" encoding="ISO-8859-1" ?> 
- <plugins>
- <plugin active="1" product="vbulletin">
  <title>PM Preview v1</title> 
  <hookname>private_messagelist_messagebit</hookname> 
- <phpcode>
- <![CDATA[ 
$pm['pmpreview'] = strip_quotes($pm['message']);
$pm['pmpreview'] = htmlspecialchars_uni(fetch_trimmed_title(strip_bbcode(fetch_censored_text($pm['pmpreview']), false, true), 300));

  ]]> 
  </phpcode>
  </plugin>
  </plugins>


any ideas?


All times are GMT. The time now is 08:09 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.01546 seconds
  • Memory Usage 1,829KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (1)bbcode_php_printable
  • (10)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete