vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   [RELEASE] Private Messaging Hack (v0.9) !!!!!!! (https://vborg.vbsupport.ru/showthread.php?t=1095)

06-13-2000 11:43 PM

Yep all of that stuff.

Plus on each BB message that a person writes there should be an icon to 'Send Private Message', if there isn't such thing already.

Have to admit though, bloody good for a hack. If this is what one person can do in a short time then the 'proper' vBulletin version should be amazing :)

06-13-2000 11:48 PM

In global.php find
Code:

function bbcodeparse2($bbcode,$forumid=0,$allowsmilie=1) {
  // parses text for vB code, smilies and censoring

  global $DB_site,$bbcode2;
  global $allowhtml,$allowbbcode,$allowbbimagecode,$allowsmilies,$wordwrap;

  if ($wordwrap!=0) {
    $bbcode=eregi_replace("([^ <>\"\\-]{$wordwrap})"," \\1 ",$bbcode);
  }

  if ($forumid!=0) {

directly under insert:

Code:


          // PRIVATE MESSAGING
          if ($forumid=="-1") {
                  global $privallowhtml, $privbbimagecode, $privallowsmilies, $privallowbbcode;
                  $allowhtml = $privallowhtml;
                  $allowbbimagecode = $privbbimagecode;
                  $allowsmilies = $privallowsmilies;
                  $allowbbcode = $privallowbbcode;       
          } else {
          // END PRIVATE MESSAGING

then find

Code:

    $dobbcode=$forum[allowbbcode];
and insert a } on the next line.

06-13-2000 11:49 PM

Quote:

Originally posted by Craig Antill
I would have liked to install this hack, but the instructions don't make any sense. Step 2 - those lines do not exist in global.php in 1.1.2! grrr...

I think i'll wait for John to include it in the official release. Thanks anyway.

Craig:

here is the fix for this (it works perfectly, relax):

where the instructions now say:

Code:

-------------
2. global.php
-------------
Find:
~~~~~
function bbcodeparse($bbcode,$forumid=0,$allowsmilie=1) {
  global $DB_site,$enablecensor,$censorwords,$censorchar;
  global $allowhtml,$allowbbcode,$allowbbimagecode,$allowsmilies;

  if ($forumid!=0) {
~~~~~

Under, add:
~~~~~
          // PRIVATE MESSAGING
          if ($forumid=="-1") {
                  global $privallowhtml, $privbbimagecode, $privallowsmilies, $privallowbbcode;
                  $allowhtml = $privallowhtml;
                  $allowbbimagecode = $privbbimagecode;
                  $allowsmilies = $privallowsmilies;
                  $allowbbcode = $privallowbbcode;       
          } else {
          // END PRIVATE MESSAGING
~~~~~

Just below that, find:
~~~~~
    $allowbbcode=$forum[allowbbcode];
~~~~~

Under, add:
~~~~~
    // PRIVATE MESSAGING
        }
    // END PRIVATE MESSAGING
~~~~
-------------

replace it with:

Code:

-------------
2. global.php
-------------
Find:
~~~~~
  // parses text for vB code, smilies and censoring

  global $DB_site,$bbcode2;
  global $allowhtml,$allowbbcode,$allowbbimagecode,$allowsmilies,$wordwrap;

  if ($wordwrap!=0) {
    $bbcode=eregi_replace("([^ <>\"\\-]{$wordwrap})"," \\1 ",$bbcode);
  }

  if ($forumid!=0) {
~~~~~

Under, add:
~~~~~
          // PRIVATE MESSAGING
          if ($forumid=="-1") {
                  global $privallowhtml, $privbbimagecode, $privallowsmilies, $privallowbbcode;
                  $dohtml = $privallowhtml;
                  $dobbimagecode = $privbbimagecode;
                  $dosmilies = $privallowsmilies;
                  $dobbcode = $privallowbbcode;       
          } else {
          // END PRIVATE MESSAGING
~~~~~

Just below that, find:
~~~~~
    $dobbcode=$forum[allowbbcode];
~~~~~

Under, add:
~~~~~
    // PRIVATE MESSAGING
        }
    // END PRIVATE MESSAGING
~~~~
-------------

cheers

06-13-2000 11:51 PM

Looks like we both know what we are doing :p

06-14-2000 12:11 AM

Heres how to add lightbulbs to the private messaging

In the part which is added to index.php find

Code:

        $newpmcount = $newpmcounta[msgid];
below that add

Code:

if($newpmcount == 0)
{
  $lightbulb = 'images/off.gif';
} else {
  $lightbulb = 'images/on.gif';
}

Now go and edit the pmloggedin template and put

Code:

<img src="$lightbulb">
where you want the lightbulb to appear

That's it :)

06-14-2000 12:27 AM

Thanks Mark, that rules!

As for the "delete" in the messages list page -- I couldn't find a way to do a "mass delete" whereby you could check the boxes next to several messages and delete them at once, so instead I did this (for the time being):

1) add a td in the privmsgslist template at the end of the row, after the date/time td. Put there "delete?"

2) edit privmsgsbitlist template and add at the end of the row, after the $datesent and $timesent td, the following:

Code:

<FORM ACTION="private.php" NAME="REPLIER" METHOD="POST"><td bgcolor="{firstaltcolor}" nowrap><input type="hidden" name="delete" value="yes"><input type="hidden" name="action" value="dodelete"><input type="hidden" name="msgid" value="$msgid"><input type="hidden" name="table" value="$table"><input type="hidden" name="password" value="$password"><input type="submit" value="Delete" width="1" height="1" style="font-size: 11px;"></td></form>
This adds a slim "delete" button to each message row, whereby you can delete that message directly by clicking on that button, without having to access the message every time.

Of course, this isn't the idyll solution - I'd prefer check boxex and the option to delete several messages whose boxes are checked at once - but it's still better than nothing.


Now onto finding a fix for the forum jump scrolldown list :)

06-14-2000 12:38 AM

Thanks bira - i've given it a go and it has worked in part.

However, where do I get the templates from ? Mark talks of the pmloggedin template - i've not got anything like that :( I /have/ got the following new templates, but nothing more:

privatelogin
privatemsglist
privmsgbit
privmsgsbitlist

Can you help ? Maybe someone could email me any I might be missing ?

06-14-2000 12:50 AM

Craig - I posted a list of the templates earlier on, I will do it again just for you :)

pmloggedin
pmloggedout
privatelogin
privatemsglist
privatemsgbit
privatemsgbitlist
sendprivmsg
showprivmsg


Those templates are installed when you run "makeprivtables.php" successfully.

Check again -- you might have missed it. the pmloggedin is right above the postbit in the list of templates.

Otherwise - what isn't working for you?

06-14-2000 12:54 AM

Right, i'm definately missing these two:

pmloggedin
pmloggedout

They're not there at all - as you'd see from my homepage :)

Could you do me a huge favour and copy & paste them here for me ? (or email them if you wish)

Cheers

06-14-2000 01:01 AM

Craig,

did you "Add $pminfo to 'forumhome' template where you want 'pmloggedin' or 'pmloggedout' template to appear"?

In any case, this is how the original pmloggedin and pmloggedout templates look like:

pmloggedin:
Code:

<TR bgcolor="{categorybackcolor}" id=cat><TD colspan=6>
<font color="{categoryfontcolor}" size=2><B>Private Messaging:</B></font></td>
</tr>

<tr bgcolor="{firstaltcolor}"><td colspan=6>
<smallfont><a href="private.php">Read them!</a>
<BR>$username - You have $pmcount private message(s) ($newpmcount new)</smallfont></td>
</tr>

pmloggedout:
Code:

<TR bgcolor="{categorybackcolor}" id=cat><TD colspan=6>
<font color="{categoryfontcolor}" size=2><B>Private Messaging:</B></font></td>
</tr>

<tr bgcolor="{firstaltcolor}"><td colspan=6>
<smallfont><a href="private.php">Login to read your private messages!</a></smallfont></td>
</tr>


Let me know if you need anything else


All times are GMT. The time now is 12:48 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.01263 seconds
  • Memory Usage 1,758KB
  • 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
  • (11)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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