vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Add a synopsis of each PM in the Message List Version 2.0 (https://vborg.vbsupport.ru/showthread.php?t=82236)

sv1cec 05-29-2005 10:00 PM

Add a synopsis of each PM in the Message List Version 2.0
 
I got the idea for this hack, while trying to prune my Inbox from old (and useless) PMs. As it usually happens, I didn't remember from the title, what each PM was about, so I kept going back and forth between the Message List and the messages themselves.

I thought that if I could have a small part of the PM shown in the list, it would help my work enormously. So, I took some time to do it. I call that initial part of the PM which is shown in the Messages List, a "synopsis".

Easy hack, one or two file edits and anything from one template edit.

Please remember to click Install, if you like this.

Version 1.01 : Following another member's suggestion, I removed the possible bbcode from the synopsis of the messages, shown in the Message List.

Version 2.0 : In this version, I added the option of allowing the forum users to select if they want to see a synopsis of their PMs in the Messages List or not, and to define how long their synopsis should be. A new column is added in your user table for this functionality.

PLEASE NOTE: There are several alternative ways to show your synopsis, after mentionning two or three of them, I decided to remove them from the installation instructions and mention only the simpler one, which requires only one template modification, in the simplest form. This was done in order to avoid confusion between the users who decide to install this hack. The way the synopsis is presented is a template issue, so it should be easy to come up with any alternatives you want.

Rgds

FightRice.com 05-30-2005 06:46 AM

Thats pretty nifty, I'll install this first thing tomorrow

obsidian 05-30-2005 06:47 AM

Works great....I have the same issue sorting through pm's from time to time.

sv1cec 05-30-2005 07:07 AM

Thanks guys, glad if you like it. Nothing serious, just a small one to help your users and yourselves out.

Rgds

AN-net 05-30-2005 01:28 PM

a suggestion would be is to remove the bbcode then trim. use strip_bbcode().

sv1cec 05-30-2005 02:24 PM

Good idea, time for version 1.1.

One question, why should I trim?

COBRAws 05-30-2005 04:07 PM

thumbs up m8, and taking off BBCode is what I was gonna say :P

AN-net 05-30-2005 04:30 PM

Quote:

Originally Posted by sv1cec
Good idea, time for version 1.1.

One question, why should I trim?

i meant before u use substr() but before substr you should use trim and then put the ...

swarangal.com 05-30-2005 05:31 PM

i did wot ever mentioned in the text no luck nothing shows up in my pm same old style am i missin something here?

Lionel 05-30-2005 05:42 PM

Really nice, thanks. Since I had Traffix flag pm hack installed, all I had to do is to add <div class='smallfont'>
$synopsis
</div>
in the messagelistbit template under the title and userbit <td>. And I linked the more in php to pm

sv1cec 05-30-2005 07:01 PM

Quote:

Originally Posted by swarangal.com
i did wot ever mentioned in the text no luck nothing shows up in my pm same old style am i missin something here?

It will not show anything different inside the PM, only on the messages list. When you view your inbox contents for example.

sv1cec 05-30-2005 07:24 PM

Quote:

Originally Posted by Lionel
Really nice, thanks. Since I had Traffix flag pm hack installed, all I had to do is to add <div class='smallfont'>
$synopsis
</div>
in the messagelistbit template under the title and userbit <td>. And I linked the more in php to pm

Not a bad idea. I thus changed the installation instructions to provide the two different alternatives, one with the synopsis in a separate column, or in the same column as the message title and sender.

Version 1.02, I out-did myself, three versions in one day! LoL

Lionel 05-30-2005 07:37 PM

You don't really need to change the other templates. Date can be with same <td>.

sv1cec 05-30-2005 08:43 PM

I know, and maybe you are right, this might be the way to go, however, I do not like it when the data/time are in the same <td>, it's kind of messy. But I agree, the hack becomes much simpler, since those who install it, have to edit only one template.

I think I shall add another alternative. LoL, this is getting ridiculous!

I also added some code to allow your users to select if they want to have a synopsis or not, as well as to define the length of the synopsis. If someone is interested, I can provide the code for that, it entitles a couple of changes in profile.php and a change in the modifyoptions template. Maybe we should move to ... version 2.0!! LOL

Lionel 05-30-2005 09:17 PM

Oh yes, I'd like that option

Lionel 05-31-2005 01:00 AM

Can you make it strip the quotes?

sv1cec 05-31-2005 05:48 AM

OK, the instructions are now in the installation text file. If anyone wants to upgrade from 1.xx to 2.0 and can't figure out how to do it, let me know.

Rgds

Lionel 05-31-2005 05:56 AM

To remove the quoted message, I added:

Quote:

$synopsis = strip_quotes(trim($pm['message']));

Lionel 05-31-2005 06:00 AM

I'll tell you, this hack is pretty helpful. I get lots of PM daily and now I don't have to dig into each one of them to locate a single one. And it also makes easy to clean up the message boxes. We just have to wait until someone decides to "ajax" the delete :-)

sv1cec 05-31-2005 06:18 AM

Yeah, and you make me include new things every hour!

Strip quotes are now in the instructions. I also made a change in the way the instructions related to the profile.php file, so please check it out again.

I promise, no more changes, unless Lionel comes up with another good idea!

LoL

mpadc 05-31-2005 10:51 AM

Sweet stuff!

just curious is is possible maybe to have an option like mouse roll over the title to give a PM synopsis?

mpadc 05-31-2005 11:20 AM

Quote:

Originally Posted by mpadc
Sweet stuff!

just curious is is possible maybe to have an option like mouse roll over the title to give a PM synopsis?

Sorry one more questrion where exactly is the option where u can turn of synopsis viewing?

sv1cec 05-31-2005 11:31 AM

Quote:

Originally Posted by mpadc
Sorry one more questrion where exactly is the option where u can turn of synopsis viewing?

It's in UserCP/ Edit Options.

sv1cec 05-31-2005 11:36 AM

Quote:

Originally Posted by mpadc
Sweet stuff!

just curious is is possible maybe to have an option like mouse roll over the title to give a PM synopsis?

I have tried that in the past, but the "title" section of the A HREF tag does not show as many characters and it's interpretation of carriage returns etc leaves a lot to be desired.

One could do it possibly, with Javascript, but this is not my field of expertise.

Rgds

mpadc 05-31-2005 12:06 PM

Ok Thanks

hmm thats weird i dont see it in usercp! > edit options

sv1cec 05-31-2005 12:35 PM

Which version have you installed? If you installed the initial version (1.xx) there is no such parameter, you have to read the installation .txt file and see if you want to upgrade to version 2.

Rgds

mpadc 05-31-2005 01:50 PM

I installed this version the one attached to this post the txt file....which ever that is!

thanks

sv1cec 06-01-2005 05:21 AM

If you check the header of this thread, you'll notice that there are a few versions out already. The latest text file describes two installation methods, one with and one without any user control over the synopsis. If you have install the first one described, then there are no user-selectable options.

Rgds

Delphy 06-01-2005 10:48 AM

The install file doesn't say how to change the modifyoptions template so even when following method 2, you don't get the user selectable option for the synopsis.

sv1cec 06-01-2005 10:50 AM

OK, edit memberinfo template and find:

HTML Code:

      <tr>
                <td colspan=2><label for="cb_pmpopup"><input type="checkbox" name="pmpopup" value="1" id="cb_pmpopup" $checked[pmpopup] />$vbphrase[show_pm_popup]</label></td>
        </tr>

Right below that, add:

HTML Code:

<tr>
<td>
Our Private Messaging System can show you the initial part of every message in your folders, as a synopsis, when looking at the Messages List. This is very useful, when purging the message folders, from old or useless messages. In the drop down menu below, select if you want to see a synopsis of each message, or if you do not want to see one.
<P>
<select name="synopsis" id="cb_synopsis">
$synopsis_phrase
</select>
<P>
You may also select the length of the synopsis shown, in other words how many characters from the start of each message, will be shown. Allowed values are between 100 and 300 chars, default is 200 and this value will be used if the entered length is outside these limits.
<P>
<span style="float:$stylevar[right]">
<input type="text" name="synopsis_length" value="$synopsis_length" size='5' class='smallfont'>
</span>
<label for="cb_synopsis_length">Enter the length of the synopsis here :</label>
</td>
</tr>

I'll update the txt file as soon as this is posted.

Sorry for the inconvenience.

Also, for those who installed the second version (with the UserCP Option, which ... was not there, LoL) I came up with a different template, for the message list, which I think is more easy to read. So, if you want to use it, here is the code for pm_messagelistbit template.

HTML Code:

<tr>
        <td class="alt1" width='2%'><img src="$stylevar[imgdir_statusicon]/pm_$pm[statusicon].gif" alt="" border="0" /></td>
        <if condition="$show['pmicons']"><td class="alt2" width='2%'><if condition="$show['pmicon']"><img src="$pm[iconpath]" alt="$pm[icontitle]" /><else />&nbsp;</if></td></if>
       
        <td class="alt1Active" id="m$pm[pmid]">
                <div>
                        <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>
<if condition="$bbuserinfo[synopsis]>0">
      <table width='100%' border='0'>
        <tr>
            <td width='10%' class="smallfont" align='left'>
                <u>User:</u>
            </td>
            <td class="smallfont" align='left'>           
                <if condition="$show['unread']"><strong>$userbit</strong><else />$userbit</if>
            </td>
        </tr>
        <tr>
            <td width='10%' class="smallfont" valign='top' align='left'>
                <u>Synopsis:</u>
            </td>
            <td class="smallfont" align='left'>
                $synopsis
            </td>
        </tr>
      </table>
<else />
      <div class="smallfont"><if condition="$show['unread']"><strong>$userbit</strong><else />$userbit</if></div>
</if>
        </td>
        <td class="alt1Active" id="m$pm[pmid]" nowrap width='15%'>
            <div class="smallfont">
                <span style="float:$stylevar[right]" class="smallfont">$pm[senddate]</span><br/>
                <span style="float:$stylevar[right]" class="time">$pm[sendtime]</span>
            </div>
        </td>
        <if condition="$show['pmcheckbox']"><td class="alt2" align="center" style="padding:0px" width='3%'><input type="checkbox" name="pm[$pmid]" value="$groupid" /></td></if>
</tr>

and here is a screen shot.

mkdevo 06-03-2005 12:44 AM

just installed. works great! thanks!

it looks like the text file cuts off at the end... is that right?

EDIT: also, wouldn't this be better suited in the PM Enhancement forum? i'd run across it the other day, and went back to look for it today and it took a while..

sv1cec 06-03-2005 03:09 AM

Thanks for the nice words.

No the file doesn't cut off at the end. I was in a hurry to upload it, since a member noticed that I hadn't included the memberinfo template modifications, so I just send it like that.

And yes, it might be better of in the PM enhancements, but since it started with a couple of lines code changes, I put it here. Maybe I should ask a moderator to move it.

Rgds

Delphy 06-03-2005 09:48 AM

sv1cec,

Sorry about this... but it should be the "modifyoptions" template, not the memberinfo one :)

I use a slightly different synopsis view, see the attached image.

Thanks,
Delphy

sv1cec 06-03-2005 11:34 AM

Oh God, you are right, what was I thinking???

Thanks for pointing it out.

Yes, there can be any kind of synopsis styles. The ones I 've mentioned are some that I use or are easy to customize (only one template edit).

Again, thanks for pointing out my error.

Rgds

sv1cec 06-05-2005 06:18 AM

Folks,

you might want to edit your usercp.php file, as well, to properly show the synopsis there too. To do that, open you usercp.php file and find:

PHP Code:

    eval('$userbit = "' fetch_template('pm_messagelistbit_user') . '";'); 

Right above that, add:

PHP Code:

    if ($bbuserinfo['synopsis']>0)
    {
        
$synopsis_length $bbuserinfo['synopsis'];
        
$synopsis strip_bbcode(strip_quotes(trim($pm['message'])));
        if (
strlen($synopsis)>$synopsis_length)
        {
            
$synopsis=substr($synopsis0$synopsis_length);
            
$synopsis=$synopsis " ... (more)";
        }
    } 

YOu may have to slightly modify the USERCP profile, depending on the synopsis template you select to use. If you need help, please let me know.

FleaBag 06-07-2005 09:09 AM

Excellent! I love it, thanks a lot. :)

sv1cec 06-07-2005 09:34 AM

Thanks, appreciated!

RockForums 06-24-2005 12:44 AM

Awesome hack, thanks! :)

midnightz 06-25-2005 03:58 AM

Hello,

I have run into a snafu with this hack, but its not the hack at all but the way vBulletin 3.x handles thier Private Messgaes by calling on the postbit.

This code help that issue by letting me have the postbit as the PM type and legacy as my postbit.

PHP Code:

<if condition="THIS_SCRIPT == 'private'">
<!-- private 
message layout goes here -->
<else />
<!--
normal postbit code goes here -->
</if> 

Only thing is now the PM don't have my very extreme postbit in the PM, but it also won't call on your hack that I desperately want to include for my members.

If I need to explain in more detail I can.

Thanks

sv1cec 06-25-2005 05:06 AM

Yes, please elaborate, because I cannot understand what your problem is.

Rgds


All times are GMT. The time now is 11:50 AM.

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.03856 seconds
  • Memory Usage 1,848KB
  • 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
  • (3)bbcode_html_printable
  • (3)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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