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 03:48 PM

Woo-freaking-hoo! :D

Here it is, the vB PM hack! NEWLY CHANGED TO VERSION 1.2.0 - please reference this thread now: http://www.vbulletin.com/forum/showt...?threadid=1772

It can be downloaded from here: http://www.enter.net/~rmsullivan/pmhack1.2.zip . The instructions are included within that.

Demo at: http://www.magic-singles.com/cpa/forums/ . If you MUST register to test it, ok, I guess. I'll be adding screenshots so you know what it's like soon.

Now UPDATED to version 0.9.15 !!!! Several bug fixes, additional support for linking to posts :) and nicer delete methods (thanks bira!)

Please note that the UBB import script has NOT been done yet - sorry. Soon though.

Enjoy! Post and questions/comments/bug reports here!

[Edited by Ed Sullivan on 07-16-2000 at 11:31 PM]

06-13-2000 04:20 PM

Hello,

Great job! I can't wait to check out in more detail tomorrow. :)

Thanks.

06-13-2000 04:27 PM

I can't seem to figure out how to compose a message? Where are the links for that?

06-13-2000 04:34 PM

"Post Topic" and "Post Reply" - I'm still using my stock images.

Come to think of it, that's kinda a glitch - the templates point to the post new topic/reply image variables. I'll add an option to fix that next release ;)

06-13-2000 04:59 PM

All I have to say is WOW!

From my brief use of the PM's, this appears to be much more stable than the UBB version of this. The instructions are very simple to follow. They are very well commented, clear, and concise. I had a few questions, but after downloading the script and looking through the files, they were all answered.

Great hack, and thanks for making this for us! :)

06-13-2000 06:00 PM

Thanks Ed! We will be putting this in tommorrow, great job!

06-13-2000 07:05 PM

Hi Ed,

I am really excited about this hack - thank you!

However, I can't seem to be able to make it work. I did *everything* like you wrote, and tried to send a new message to another user.

I got this message:

Quote:

There seems to have been a slight problem with the database. Please try again by pressing the refresh button in your browser.

An E-Mail has been dispatched to our Technical Staff, who you can also contact if the problem persists.

We apologise for any inconvenience
And in the e-mail to the Technical Staff (moi :)) it says:

Code:

Database error in vBulletin: Invalid SQL: INSERT INTO privatercvd (msgid, toid, fromid, title, text, datetime, signature, iconid) VALUES (NULL, '3880', '1199', 'test', 'testing this', NOW(), 0, )
mysql error: You have an error in your SQL syntax near ')' at line 1
mysql error number: 1064
Date: Wednesday 14th of June 2000 02:08:11 AM
Script: /bb/private.php
Referer: http://www.atlasf1.com/bb/private.php?action=newmessage&password=xxxxxxxxx&reply=false

I tried several times, and I always get this error. Any idea?

Thanks,

Bira

[Edited by bira on 06-14-2000 at 05:17 AM]

06-13-2000 08:45 PM

Ed I gotta warn you, I think your hack is slightly incompatible with vB 1.1.2 -- your setup instructions show lines in global.php that have vastly changed since, and cannot be accurately found. I pretty much guessed where you meant us to put what, but like I said in the previous post - I cannot post messages at all; keep getting the error above, which I have a hunch is related.

I'm removed $pminfo from my forumhome for the time being, and I anxiously await your fix :)

06-13-2000 08:58 PM

Hmm. I've installed it on v1.1.2 and it seems to be working fine.

Have you tried looking at the database to make sure all the tables have been setup correctly etc?

A few things to note. The messaging system seems to default to my browsers default font rather than the font I like to use on my message boards.

Also smilies dont seem to work (DISASTER!) even though I have set them to allowed in the control panel.

Other than that good work! :D

06-13-2000 09:11 PM

Mark,

I'll have a look although it did say everythng was set up fine.

As for the font face -- this is because all of Ed's templates use <font></font> instead of <normalfont></normalfont> -- John changed the variable for the normal font in 1.1.2. You have to edit the following templates:

pmloggedin
pmloggedout
privatelogin
privatemsglist
privatemsgbit
privatemsgbitlist
sendprivmsg
showprivmsg

I *think* that's it :)

06-13-2000 09:21 PM

I just checked and all tables are in place. Asked others to try and post, nada.

Ed, any idea? It's the same mistake all the time (see above)

06-13-2000 09:26 PM

Ed:

Great hack. Are you planning on some kind of inicator on the main forum page that lets you know that you have private messages waiting?

Thanks,
Parker

06-13-2000 09:43 PM

Parker: Follow the install instructions and you get a indicator on the main page.

bira: I see what the problem with the syntax is, there is an extra , after the final 0 that shouldn't be there, this is because the $iconid bit seems to be missing.

Where it has gone to I have no idea. For a test you could try deleting the $iconid bit from the insert statement and replacing it with a 0 or something and see if that works.

06-13-2000 09:46 PM

It's not just not parsing the smilies its not parsing any vB code such as quote etc.

06-13-2000 09:47 PM

Quote:

Originally posted by Mark Hewitt
For a test you could try deleting the $iconid bit from the insert statement and replacing it with a 0 or something and see if that works.


eh? :)

can you explain this to me like you would to an IQless child? :) :) :)

06-13-2000 09:50 PM

you know... it just occured to me...

could this be because I have the Message Icon option set off in my BB options?

06-13-2000 09:58 PM

Quote:

Originally posted by Mark Hewitt
It's not just not parsing the smilies its not parsing any vB code such as quote etc.
This is because the php code in 1.1.2 had changed significantly in global.php.

For example, where it says in 1.1.1 global.php "$allowhtml=$forum[allowhtml];" it now says, in 1.1.2 global.php "$dohtml=$forum[allowhtml];" etc.

Sorry, but Ed will have to edit his scripts to modify the new version

[Edited by bira on 06-14-2000 at 07:02 AM]

06-13-2000 10:20 PM

OK,

here goes, I - I! - found the fix to those problems with 1.1.2 :)

Mark,

In global.php find this code that you were asked to paste in the pminstallation.txt:

Code:

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

And replace it with:

Code:

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


As for myself - as a temporary fix, I placed in the "sendprivmsg" template the form line <input type="radio" name="iconid" value="0" checked> -- this gives value 0 to $iconid and at least allows users to send and receive messages.

I *think* I had the problem due to the fact that I have in my BB options the Message Icon disabled; and while I did allow it for PM, it seems there's a bug in the PM hack whereby if it's not allowed for the entire BB, then it doesn't work for PM and therefore gives no value (not even 0) to the $iconid.

In any case, it's working now. Who needs icons :)

06-13-2000 11:36 PM

Well I'm happy :)

I'd like to ask for a couple of things - maybe they can be added via the templates, and I just haven't figured out how?

1) In the table of the messages in the received list and the sent list, to have a column with a checkbox next to each message title. You can check the boxes next to the titles you want to delete, and then click on a button which says "delete all checked titles". This way, if you'd like to delete several messages, you don't have to access each message at a time.

2) Add "My Private Messaging" to the $forumjump scrolldown list (I guess this could be added somehow simple, no?)

3) the lightbulb icon! - have a lightbulb icon next to the privae messages line on the forumhome, whereby if you have new messages it will be lit up, and if you don't have new messages it won't be (just like you have an indicator for the forums)

4) "last message by" - have on the forumhome and indicator of the last message date and who sent it, just like in the forums.

Also, having the "e-mail notification" and "automatically parse URLs" options working would be nice.

Am I asking for too much? :)

Thanks,

Bira

06-13-2000 11:41 PM

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.

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

06-14-2000 01:08 AM

Yes, bira, I did. (why is it always me who has problems ?! ;))

Thanks for the templates - i'll finish tinkering with those for the 'internal pages' then add them and see where we end up :)

06-14-2000 02:03 AM

Wow, 30 actual replies in like 10 hours :D

Bad time to go to sleep, eh? Now, 5 minutes after I get up, back to coding....

Anywho, I'll patch up my code for v1.1.2 ASAP, which'll probably be in the next 10 minutes ;)

Also, I'll try to fix any other problems I can and add a mass delete feature - might be easy, not sure how PHP handles checkboxes (Perl doesn't like them)

So, anyway... v0.9.1 will be coming out soon :)

06-14-2000 02:12 AM

Ed, not sure why, but my 'edit ignore list' link is returning a document with no data error. Is this working elsewhere ?

06-14-2000 02:13 AM

Ed,

Seeing as we've made a few hacks to your hack (:)) - can you please let us know, when you post v0.91, the changes so we won't have to start from scratch? :)

By the way, another option I would really like to see is an icon or a link ("send private message") that I can add to the user's post, the user's profile and the user's memberslist line -- similar to the email/www.

It shouldn't be hard. If you can just give me the syntax for the url (something like private.php?action=newmessage&password=&reply=fals e?userid=$userid) then I can take it from there :)

Oh and again - thank you for this fantastic hack!

06-14-2000 02:16 AM

Quote:

Originally posted by Craig Antill
Ed, not sure why, but my 'edit ignore list' link is returning a document with no data error. Is this working elsewhere ?
working perfectly fine here.

Craig, are you sure the makeprivtables.php returned successful results? It sounds like you're missing some stuff :(

06-14-2000 02:26 AM

Erm, well it said it did... :( *wished he'd never started*

06-14-2000 02:32 AM

Craig: Expect even more fun over the next few days as this hack undergoes 'rapid development'. I mean we've messed around with it quite a bit in just these few hours.

We've got the rewritten 1.1.2 version to come next.

Like bira said the addition of a 'message this person' icon on each post seems the most important add on for the moment.

But also what will need to be done is for the front page a last message time and who the last message was by including the 'blue arrow' to give it a consistent look.

06-14-2000 02:40 AM

That's all very nice, but i'm more concerned about getting my system up and running right now :( Any idea why this is broken on my server ?

I have just taken a look and I have the following tables in my database, should I have any more, and if so, how do I create them ?

privatesent
privatercvd

06-14-2000 02:40 AM

OK,

To have an icon on posts with "send Private Message to USERNAME" create an icon of your choice, upload it to the bb images dir, and then go to edit the postbit template.

Add, where you have the profile, email, etc., the following:

Code:

<a href="http://www.atlasf1.com/bb/private.php?action=newmessage&table=privatercvd&reply=true&touser=$username"><img src="images/YOURICON.gif" border=0 alt="Send private message to $username"></a>
That's it -- tested and proven to work :)

06-14-2000 02:42 AM

Quote:

Originally posted by Craig Antill
That's all very nice, but i'm more concerned about getting my system up and running right now :( Any idea why this is broken on my server ?

I have just taken a look and I have the following tables in my database, should I have any more, and if so, how do I create them ?

privatesent
privatercvd

Craig, if you don't mind losing the changes you made to the pm templates, then just run makeprivtables.php again - it will delete and rebuild the necessary tables.


All times are GMT. The time now is 12:44 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.02872 seconds
  • Memory Usage 1,856KB
  • 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
  • (15)bbcode_code_printable
  • (6)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