PDA

View Full Version : [RELEASE] Private Messaging Hack (v0.9) !!!!!!!


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/showthread.php?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:


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:


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
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
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:


// 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:


// 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

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

global $DB_site,$bbcode2;
global $allowhtml,$allowbbcode,$allowbbimagecode,$allowsm ilies,$wordwrap;

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

if ($forumid!=0) {


directly under insert:



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


then find


$dobbcode=$forum[allowbbcode];

and insert a } on the next line.

06-13-2000, 11:49 PM
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:


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

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:


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

global $DB_site,$bbcode2;
global $allowhtml,$allowbbcode,$allowbbimagecode,$allowsm ilies,$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


$newpmcount = $newpmcounta[msgid];


below that add


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


Now go and edit the pmloggedin template and put


<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:


<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:

<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:

<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=false?userid=$userid) then I can take it from there :)

Oh and again - thank you for this fantastic hack!

06-14-2000, 02:16 AM
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:


<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
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.

06-14-2000, 02:49 AM
Ok, bunch of things here, I think

1. Templates: this is the full list of templates makeprivtables.php creates.
error_pmcantdelete
error_pmcantignoreself
error_pmcantview
error_pmivalidrecipient
error_pmnosentreply
pmloggedin
pmloggedout
privatelogin
privatemsglist
privmsgbit
privmsgsbitlist
redirect_pmdelete
redirect_pmignoreadded
redirect_pmignoreedited
redirect_pmthanks
sendprivmsg
showignore
showprivmsg

2. I've just updated the zip above to v0.9.1!! Not many fixes, yet. Fixed instructions for vB 1.1.2, fixed "icons off" bug, added support for...

3. PM Button in Posts. Use what you want, but here's the syntax:
private.php?action=newmessage&toid=$userid
Simple enough.

4. Looked in to checkboxes real quick and they don't work how I wish they did - they only return the last value. Might have to talk to John a little about this.

06-14-2000, 02:52 AM
Originally posted by bira
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. [/B]

WAIT! You have to make a few changes to it then!!

Namely, uncomment all these lines: (they're all at the top)
//$DB_site->query("DROP TABLE privatercvd");
//$DB_site->query("DROP TABLE privatesent");
//$DB_site->query("ALTER TABLE user DROP ignorelist");
//$DB_site->query("DELETE FROM template WHERE title='privmsgsbitlist'");
//$DB_site->query("DELETE FROM template WHERE title='privatemsglist'");
//$DB_site->query("DELETE FROM template WHERE title='privatelogin'");
//$DB_site->query("DELETE FROM template WHERE title='showprivmsg'");
//$DB_site->query("DELETE FROM template WHERE title='privmsgbit'");
//$DB_site->query("DELETE FROM template WHERE title='sendprivmsg'");
//$DB_site->query("DELETE FROM template WHERE title='redirect_pmthanks'");
//$DB_site->query("DELETE FROM template WHERE title='redirect_pmdelete'");
//$DB_site->query("DELETE FROM template WHERE title='error_pmnosentreply'");
//$DB_site->query("DELETE FROM template WHERE title='error_pmivalidrecipient'");
//$DB_site->query("DELETE FROM template WHERE title='error_pmcantdelete'");
//$DB_site->query("DELETE FROM template WHERE title='error_pmcantview'");
//$DB_site->query("DELETE FROM template WHERE title='error_pmcantignoreself'");
//$DB_site->query("DELETE FROM template WHERE title='redirect_pmignoreadded'");
//$DB_site->query("DELETE FROM template WHERE title='showignore'");
//$DB_site->query("DELETE FROM template WHERE title='redirect_pmignoreedited'");
//$DB_site->query("DELETE FROM template WHERE title='pmloggedin'");
//$DB_site->query("DELETE FROM template WHERE title='pmloggedout'");

Just remove the // in front of it.

Back to work...

06-14-2000, 02:54 AM
Ed,

Go to my forum at http://www.atlasf1.com/bb/index.php and register and send me (bira) a pm, and then have a look at the delete buttons I added to the PM list :)

Also, as for the URL from posts - it will also work with the fix I posted, same thing :)

And lastly -- what do you mean by "fixed "icons off" bug"?

Thanks :)

06-14-2000, 02:57 AM
Since you turned off icons in your forum, it wasn't returning anything. In the template for newmessage (I don't even remember what it's called now!), just leave posticons and it will instead insert a <input type="hidden"...> in place of the icons - stops that error :D

06-14-2000, 02:57 AM
Can someone come up with a good private messaging 'icon' cause my artistic ability is erm, limited :p

06-14-2000, 03:03 AM
Ah Ed, that's what I did, so I guess there's no point in me downloading the new version.

Mark - I'm working on it, though don't hold your breath :)

06-14-2000, 03:09 AM
OK, rather than running it all again, could someone let me have a copy of the 'showignore' template as this is also missing from my setup for some reason :(

This is a really great addon Ed - thanks very much for your efforts. I hope that John will adopt it as part of the official release in the next release (or at least something as good - and compatible!)

06-14-2000, 03:09 AM
bira - sent you a message, I like those delete buttons - unfortunately, they're not really foolproof. One mis-click and Poof!, you just lost a message. If you (or anyone) knows some javascript to bring up an "Are you sure?" type prompt, I'll add it to the official version. :)

PM Buttons - why not just rip it from the UBB version? ;)

You know, I've heard about hanging out in certain forums before, but I've never heard about hanging out in a thread! :D

06-14-2000, 03:14 AM
showignore:

(Please note, I've made a few changes so the replacement variable tags don't get parsed)

{html doctype}
<HTML><HEAD><TITLE>$bbtitle - Private Messaging: Edit Ignore List</TITLE>
$cssinclude
</HEAD>
<body>
$header

<table border="0" width="100%"><tr>
<td valign="top" align="left"><a href="index.php"><img src="$titleimage" border="0"></a></td>

<td valign="middle" align="center" nowrap>
$fivelinks
</td></tr></table>

<table border="0" width="100%" cellpadding="2">
<tr><td width="100%">

<font><b><a href="index.php">$bbtitle</A> &gt; <a href="private.php?action=getmsgs&password=$password">Private Messaging</a> &gt; Edit Ignore List</b></font>

</td></tr></table>

<FORM ACTION="private.php" NAME="REPLIER" METHOD="POST">
<input type="hidden" name="page" value="login">
<table border=0 cellpadding=4 cellspacing=1 width="100%">
<tr bgcolor="{table headbgcolor}"><TD COLSPAN=2>
<font color="{table headtextcolor}" class=thtcolor><B>Editing $username's Ignore List</B></font></td></tr>
<tr bgcolor="{first altcolor}"><td valign=top>
<font><B>Your UserName:</B></font></td>
<td valign=top>
<INPUT TYPE="TEXT" NAME="username" VALUE="$username" SIZE=25 MAXLENGTH=25></td>
</tr>
<tr bgcolor="{second altcolor}">
<td valign=top>
<font><B>Your Password:</B></font></td>
<td valign=top><INPUT TYPE="PASSWORD" NAME="password" VALUE="$nonmd5password" SIZE=13 MAXLENGTH=13>&nbsp;&nbsp;
<smallfont><A HREF="member.php?action=lostpw">Forgotten your password?</A></smallfont></td></tr>

<TR bgcolor="{first altcolor}"><TD valign=top nowrap>
<font><B>Your Ignore List:</B></font>
<p><br><smallfont>(One username per line)</smallfont></td>
<td>
<TEXTAREA NAME="ignorelist" ROWS=20 COLS=60 WRAP="VIRTUAL">$ignoredusers</TEXTAREA>
</td></tr>
</table>

<P align="center">
<INPUT TYPE="HIDDEN" NAME="action" VALUE="doeditignore">
<INPUT TYPE="Submit" NAME="submit" VALUE="Edit Ignore List">
<INPUT TYPE="RESET" NAME="RESET" VALUE="Clear Fields">
</p></form>

$footer

</body>
</html>

06-14-2000, 03:16 AM
Here are a few quick PM icons for the lower bar:

http://www.wakeamerica.com/forums/images/pm1.gif
http://www.wakeamerica.com/forums/images/pm2.gif
http://www.wakeamerica.com/forums/images/pm3.gif
http://www.wakeamerica.com/forums/images/pm4.gif

06-14-2000, 03:44 AM
Thanks guys - great work!

I will add the extra goodies shortly :)

06-14-2000, 03:50 AM
PM Button in Posts. Use what you want, but here's the syntax:
private.php?action=newmessage&toid=$userid


Is this supposed to link to the send private message form with the username of the targetted user in place ? If so, it doesn't in my setup. Any idea ?

06-14-2000, 03:55 AM
You have to upgrade to the newest zip, which I mentioned in that post - or you can just use bira's version. Both should work fine.

06-14-2000, 04:07 AM
If you want to have bira's style delete buttons, but don't want an accidental mis-click to delete the message, try this:

in privmsglist, add:
<SCRIPT LANGUAGE="JavaScript">
function verify() {
var agree=confirm("Are you sure you want to delete this message?");
if (agree){
return true;
}
return false;
}
</SCRIPT>
This goes right before $cssinclude (in other words, inside the <HEAD> tag)

find:
<td align=center nowrap>
<smallfont color="{table headtextcolor}"><B>Date/Time Sent</A></B></smallfont></td>

after, add:
<td align=center nowrap>
<smallfont color="{table headtextcolor}"><B>Delete?</A></B></smallfont></td> (Make sure you fix the replacement variables. I just changed them so they weren't parsed)

----
done there, go into privmsgsbitlist:

find:
$timesent</smallfont></td>

after that, add:
<FORM ACTION="private.php" NAME="REPLIER" METHOD="POST" onSubmit="return verify();"><td bgcolor="{second altcolor}" nowrap><center><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;"></center></td></form>
(Again, check replacement variable)

There, and you're done. Demo on my site if you want to see how it works ;)

06-14-2000, 04:07 AM
I /am/ using bira's version, but it isn't working. I will download the new version later on and have a go with that.

Thanks again

06-14-2000, 04:25 AM
Well, with the new version, I just tested it on my boards and it works fine - http://www.magic-singles.com/cpa/forums/showthread.php?threadid=1382

06-14-2000, 04:37 AM
This might seem a little hard, but would it be possible for the user to create subfolders, like "Old PM's", or something like that? Someplace to put the PM's once they have been read, but so that they are not in the "Inbox".

06-14-2000, 04:48 AM
Theoretically possible, and I'm chucking around some ideas in my head to do it, but that's gonna be awhile off - just want to get ALL the bugs straightened out first (and UBB import), then I'll add all those cool features!

06-14-2000, 04:49 AM
I'm enjoying this thread immensely :)

OK, Ed, another item on my wishlist: some kind of indicator to note whethere a message has been replied to or not. like an R next to the message title on the msglist -- I get confused on who I already replied to and who I didn't, and checking in the "sent" is a hassle :)

06-14-2000, 04:59 AM
Ed, the delete verifier is perfect, thanks! :)

Wake America - excellent work, thank you. I took one of users and it's already used on my bulletin board :)

06-14-2000, 05:09 AM
This looks cool. I wonder if you are able to put "quotas" on accounts. IE limit to 20 messages or something??

-Brian

06-14-2000, 06:00 AM
bira - can't do that yet, at least with the way it's setup now :) (need an extra field, repliedto, that would get set when you reply to a message) ...actually, on second thought, that's not that hard. Hmm...

Brian - nope, quotas aren't possible. Sorry. Well, theoretically they are, but its far too much work for its work, IMHO.

(woohoo! Senior-dom! Finally...)

[Edited by Ed Sullivan on 06-14-2000 at 03:06 PM]

06-14-2000, 06:37 AM
Right, i've updated to the latest version, and the private message feature from the topic page is working. However it creates a new problem, Mark's lighbulb solution posted above causes problems for logged out visitors - index.php returns a file of 0 bytes :( Any idea how to fix this ? For the moment, i've pulled it from the script, but I do want the lightbulb back. Any suggestions ?

06-14-2000, 07:09 AM
Well, unless his code was malformed, it shouldn't cause any problems - are you sure you haven't mis-copied something? Missing a ";"?? or a "}"?

06-14-2000, 07:14 AM
Heres how to add lightbulbs to the private messaging

In the part which is added to index.php find


$newpmcount = $newpmcounta[msgid];


below that add


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


Now go and edit the pmloggedin template and put


<img src="$lightbulb">


where you want the lightbulb to appear

That's it :)

--------------------

That was Mark's 'hack'. It is extremely straightforward and there is no way on earth that it would cause the problem you describe, Craig, unless you copied it wrongly.

06-14-2000, 07:29 AM
No, no, I hold my hands up - I added it wrong twice! :o I think i've been looking at this screen too long - i'm off to the pub for a bit! :D

Thanks Ed for a superb hack, and for giving me something to do on my day off (as if I needed it!)

06-14-2000, 08:43 AM
Originally posted by Craig Antill
No, no, I hold my hands up - I added it wrong twice! :o I think i've been looking at this screen too long - i'm off to the pub for a bit! :D
Watchout, you may add it wrong three times after you come back :)

06-14-2000, 09:14 AM
I can't wait to try this feature ... a little birdie told me about it! ;)

06-14-2000, 10:42 AM
Has anyone had the User Registration date show up wrong? I setup a new account to test this with. The correct registration date shows up in the Member Search, but the registered date shows up as December 1969 within PM.

06-14-2000, 10:43 AM
Originally posted by Me2Be
a little birdie told me about it! ;) HEY! I'm not that little and I'm not a birdie! ;)

06-14-2000, 10:46 AM
Yep, i'm getting the date problem too...

http://www.ten-tenths.com/forum/showthread.php?threadid=2348

Anyone ?

06-14-2000, 10:52 AM
The reason for the date bug is again because the hack was basing itself on the 1.1.1 version, whereas John changed the date settings in 1.1.2 - he switched from the MySQL date to the PHP date.

In any case, I removed that line and the one about total posts from the showprivmsg template - who cares about those two in PM anyway :)

06-14-2000, 10:54 AM
For the sake of continuity throughout the forums, I do! ;)

Is this likely to be fixed up Ed, or should I follow bira's example ?

06-14-2000, 10:58 AM
Originally posted by Ed Sullivan
Originally posted by Me2Be
a little birdie told me about it! ;) HEY! I'm not that little and I'm not a birdie! ;)

Okay, fine - this strong, masculine gentleman told me about it.

Better?
~~~~ Men............ ~~~~ ;)

[Edited by Me2Be on 06-14-2000 at 07:59 PM]

06-14-2000, 11:23 AM
Darn, I can't find that time code in the template. Any clues Bira?? I saw timezone, but that was it.

06-14-2000, 11:30 AM
I'm sorry Rick, my mistake - it's in the privmsgbit template.

Let me know if you cannot find it there (it will under $username2 and $usertitle)

06-14-2000, 11:34 AM
I found another glitch. After someone sends you a PM click on profile under their message and it will bring up your own not the person who sent the message. I haven't tested the e-mail form to see who get the e-mail the proper recipiant or yourself.

06-14-2000, 11:51 AM
go to the privmsgbit template and edit it:

replace $profile with:


<a href="member.php?action=getinfo&userid=$fromid" target="_blank"><img src="images/profile.gif" border="0" alt="Click here to see the profile for $username"></a> &nbsp;



This will make it work right :)

[Edited by bira on 06-14-2000 at 09:04 PM]

06-14-2000, 12:03 PM
in the same template, replace $emailuser with:


<A HREF="member.php?action=mailform&userid=$fromid" target=_blank><IMG SRC="images/email.gif" BORDER=0 ALT="Click Here to Email $username"></A> &nbsp;


And peace is restored :)

06-14-2000, 12:31 PM
A couple of my users asked that the PM login that shows up on the forum homepage will also be available on the forums pages, since many of them have specific forums bookmarked and don't see the forum homepage.

So I did a tiny hack to the hack to have this. Thought I'd share it with you if you're interested.

In forumdisplay, above the line // parse header ################## (or anywhere else for that matter which is outside a process), paste the following:


//PM HACK
if ($bbusername) {
$username = $bbusername;
$pmcounta = $DB_site->query_first("SELECT COUNT(msgid) AS msgid FROM privatercvd WHERE toid=$bbuserid");
$pmcount = $pmcounta[msgid];
$newpmcounta = $DB_site->query_first("SELECT COUNT(msgid) AS msgid FROM privatercvd WHERE toid=$bbuserid AND UNIX_TIMESTAMP(datetime)>$bblastvisit");
$newpmcount = $newpmcounta[msgid];
if($newpmcount == 0)
{
$newold = 'images/folder.gif';
} else {
$newold = 'images/newfolder.gif';
}

eval("\$pminfo .= \"".gettemplate("pmloggedin2")."\";");
} else {
eval("\$pminfo .= \"".gettemplate("pmloggedout2")."\";");
}
//END PM HACK


Now go to the templates, copy the content of "pmloggedin" and paste it into a new template called "pmloggedin2". Make the necessary modifications so that it will have the same number of td in a row as the forumdisplaybit has.

Now do the same with "pmloggedout" - copy the content of this template and paste it into a new template called "pmloggedout2". Edit it as necessary to fit your forumdisplay layout (same as pmloggedin2).

Finally, open the "forumdisplay" template and put $pminfo where you want the pm login to show (similar process as to the one for the forums homepage).

Enjoy :)

06-14-2000, 01:16 PM
Thanks everyone!! This is a great hack and it was great to see such creative minds at work!! :D

06-14-2000, 02:21 PM
RE: The Date Problem

Quite a simple fix actually, in private.php, find: (line 146)
$userinfo=$DB_site->query_first("SELECT userid,email,username,usertitle,signature,showemai l,homepage,icq,aim,yahoo,UNIX_TIMESTAMP(joindate) AS joindate,posts FROM user WHERE userid=$userid2");

Replace with: $userinfo=$DB_site->query_first("SELECT userid,email,username,usertitle,signature,showemai l,homepage,icq,aim,yahoo,joindate,posts FROM user WHERE userid=$userid2");

Can anyone else tell me if I'm the only person still running v1.1.1? Because if I am, there's no use in me adding a "version" switch...

06-14-2000, 02:28 PM
RE: Profile Problem

Another REALLY simple fix, in private.php, (line 143) Find:
$userid2=$fromid;

Under it, add (for simplicity's sake): $userid=$fromid;

06-14-2000, 03:55 PM
Ok, another release - most (if not all) of the fixes included in v0.9.3 have been posted here, either by me or someone else.

However, there are a few things I want to address.

1. The index.php code has changed significantly:
//PM HACK
if ($bbusername) {
$username = $bbusername;
$pmcounta = $DB_site->query_first("SELECT COUNT(msgid) AS msgid FROM privatercvd WHERE toid=$bbuserid");
$pmcount = $pmcounta[msgid];
$newpmcounta = $DB_site->query_first("SELECT COUNT(msgid) AS msgid FROM privatercvd WHERE toid=$bbuserid AND UNIX_TIMESTAMP(datetime)>$bblastvisit");
$newpmcount = $newpmcounta[msgid];
if ($newpmcount == 0) {
$lightbulb = 'images/off.gif';
} else {
$lightbulb = 'images/on.gif';
}
$lastsent = $DB_site->query_first("SELECT fromid,UNIX_TIMESTAMP(datetime) AS datetime FROM privatercvd WHERE toid=$bbuserid ORDER BY msgid DESC");
if ($lastsent) {
$lastid = trim($lastsent[fromid]);
$lastdate=date($dateformat,$lastsent[datetime]+(($timeoffset+$bbtimezoneoffset)*3600));
$lasttime=date($timeformat,$lastsent[datetime]+(($timeoffset+$bbtimezoneoffset)*3600));
$lastsentuser = $DB_site->query_first("SELECT username FROM user WHERE userid=$lastid");
$lastuser = htmlspecialchars($lastsentuser[username]);
}
eval("\$pminfo .= \"".gettemplate("pmloggedin")."\";");
} else {
eval("\$pminfo .= \"".gettemplate("pmloggedout")."\";");
}
//END PM HACK

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

<tr bgcolor="{firstaltcolor}">
<td><img src="$lightbulb"></td>
<td colspan=5>
<smallfont><a href="private.php">Read them!</a>
<BR>$username - You have $pmcount private message(s) ($newpmcount new) - Latest Message from <a href="member.php?action=getinfo&userid=$lastid">$lastuser</a></smallfont></td>
</tr>

Also, I suggest EVERYONE!! snag the newest private.php, since it contains all the bugfixes I know of :)

~~~Current Version: v0.9.3 :D

BTW, Me2Be, yes that's better... Women...

06-14-2000, 05:25 PM
2 more bugs...

When you go to delete a post and hit cancel the post still gets deleted.

Even if you don't check the "delete" check box you can hit delete and the post is removed.

06-14-2000, 07:52 PM
I updated to the new version and i'm now unable to log in with the username 'Craig Antill' but I am able to with the username 'Administrator' - I presume it's because it's a single word with no spaces ? This has only happened since I updated - here is the error I get:


Database error in vBulletin: Invalid SQL: SELECT username FROM user WHERE userid=
mysql error: You have an error in your SQL syntax near '' at line 1
mysql error number: 1064
Date: Thursday 15th of June 2000 09:32:41 AM
Script: /forum/index.php
Referer:


I have just been and double checked that I followed the instructions correctly - I did - does anyone else have this problem ? If not, what could it be ?

06-14-2000, 08:05 PM
OK, found the problem - the instructions in the latest .zip don't seem to match the code you give above. I've added the above code in place of that in the zip and all is fine and dandy.

You do like to panic me, don't you ?!

06-14-2000, 08:28 PM
Hey! Just noticed the time and date features - excellent! I've now setup pmloggedin exactly like forumbit with full details of the last post - time, date & who made it - as well as the lightbulbs - great work fellas

06-14-2000, 10:08 PM
I was curious to see what icon people were choosing.. and of those I checked, they were quite varied in their selection. Our poor hack author Ed has a dark (black?) background and you couldn't read the icon text. So here for our esteemed hack are the icons with white text...

http://www.wakeamerica.com/forums/images/pm2_onblack.gif
http://www.wakeamerica.com/forums/images/pm3_onblack.gif
http://www.wakeamerica.com/forums/images/pm4_onblack.gif

[Edited by Wake America on 06-15-2000 at 07:10 AM]

06-15-2000, 01:19 AM
Craig - Sorry about that, I knew I had that typo at one time, but I thought I fixed it :(

Rick - Fixed both bugs you mentioned (one was just a typo in makeprivtables.php)

I suggest everyone re-update their private.php :D

WakeAmerica - Thanks! I never got around to making the white text version.

06-15-2000, 04:41 AM
Is the latest private.php file in the ZIP? The date of the current version is 6/15 10:10am it tries to replace a file that says 6/15 12:xxam. I updated anyway and the delete bug is still there.

06-15-2000, 05:48 AM
Heya Ed,

A couple more features I'd like to place on the wishlist:

1) Forward. "Forward this message to..." :)

2) a "read next" "read previous" links on the messages, like in the threads.

3) An arrow next to the "last message from..." which takes you directly to that last message.

Cheers,

Bira

[Edited by bira on 06-15-2000 at 03:10 PM]

06-15-2000, 09:10 AM
Originally posted by Rick Horwitz
Is the latest private.php file in the ZIP? The date of the current version is 6/15 10:10am it tries to replace a file that says 6/15 12:xxam. I updated anyway and the delete bug is still there.

BTW, 10:10 am is later than 12:xx am :D

Umm.. which bug were you referring to? The delete button fix in forumdisplay-type page was only changed in makeprivtables.php - look back for the code if you wanna see it, or just change the onSubmit of the <FORM> tag to "return verify();"

The other bug I know I fixed, because I tested it on my site. :D

Anyway, I just reupdated/uploaded the zip just in case.

06-15-2000, 09:16 AM
"BTW, 10:10 am is later than 12:xx am"

Maybe I need some more sleep: :D

06-17-2000, 07:23 AM
Realy great Hack it works fine, even in the version 1.1.3
Only one little Problem, there is no icon (lamp) befor
the message "read them!"

how can i change it (where is the path for the icon written)

Thx

06-17-2000, 01:38 PM
You have to change the values in the code.

So other than that, has no one found any other bugs?

YAY! I'll start on the UBB import utility then.

06-17-2000, 06:04 PM
Hey, I have been trying to get this hack working on http://www.scubaboard.com. However, the text to let you check your messages does not show up on any pages. I may have missed something but I thought I'd ask first...

Any tips for getting this text to show?

06-17-2000, 07:03 PM
Add $pminfo (or whatever it says in the instructions) to your forumhome template.

06-18-2000, 03:32 AM
Thanks a ton Ed/Mike, I seemed to have overlooked that step.

Please let me know if there's ever anything I can do to help you out in return for this great addon...

[Edited by ExtremeFactor on 06-18-2000 at 12:38 PM]

06-19-2000, 12:02 AM
Just a thought... how about the option to dispatch an email to the user when a new private message is awaiting them ? Would sure help to draw people back a bit more often... and I could then remove the email display altogether... :D

06-19-2000, 12:13 AM
Agreed this would be a good feature. I would prefer this to the ability for people to email my members directly, for them only to be able to send them private messages and then have the private messaging system email the user to tell them they have a message waiting. Especially as I have had a recent incident of someone abusing my mailing system.

Also, it would be great if there was a facility for admins only (i.e. me) to send a private message to *every* registered user.

06-19-2000, 12:53 AM
nice ideas. Got my vote!

06-19-2000, 01:10 AM
I had your spam message in mind when I posted my message Mark. Maybe we could, when John builds this into the pukka code, also have an option to stop specific users from using the facility if they abused it, but seperate from their posting rights section. Probably getting beyond the realms of a hack now... :D

06-19-2000, 03:30 AM
Nothing is beyond the realms of this hack :)

...good suggestions though. Dunno when they'll get implemented though. As I've mentioned several times, I want to do a UBB import utility first.

06-19-2000, 04:50 AM
Well, may I politely suggest that you get on with it then... :D

06-19-2000, 04:56 AM
Well, in that case, I'm not going to write it! :p

But seriously, calm down - I have to write more than just this one script. The ones I write for UBBHackers.com are pretty big!

Ahh, I'm rambling (in 2 sentences!). I hope to have the import utility done by June 24th, because if not, it won't come out till after July 2nd, since I'm going on vacation.

* gets back to work.

06-19-2000, 05:55 AM
in the index.php hack, there is still the "UNIX_TIMESTAMP(datetime)" problem, which causes msg's to always be new. take away the UNIX_TIMESTAMP, and it works

06-19-2000, 08:21 AM
No no no, it supposed to be like that. I store the dates using MySQL's DATETIME field - and I need to pull them out like that.

I use v1.1.3b2 and it works fine like that...

(You realize I just ended every sentence with "like that" :D)

[Edited by Ed Sullivan on 06-19-2000 at 05:22 PM]

06-19-2000, 08:35 AM
works on 1.1.2 and before, all old messages were new. Now it works...wierd....

06-19-2000, 03:32 PM
One more thing... Would it be possible to place check boxes next to the list of "sent" messages, so instead of deleting them one at a time you could check as many messages as you want and delete them all at once.

Thanks,

Rick

06-19-2000, 05:03 PM
Does anyone have this hack installed with an indicator on the main forum page showing that the member has a new message waiting?

Thanks,
Parker

06-19-2000, 06:57 PM
Parker,

I have a little truck that changes from black to yellow when there is a new message waiting. It also informs the user through a text message.

You can see it at: http://www.explorerforum.com

06-21-2000, 05:13 PM
I installed the hack on 1.1.3beta2 and it seems to be working ok! No dreaded "we have mailed the technical contact' emails yet. :)

06-21-2000, 06:37 PM
Parker - I think you mean your <img> tag was blank.

Yeah, that was a typo in pmloggedin. Just change it to this: <img src="$lightbulb">

06-22-2000, 03:15 AM
Some requests for a future version:

Receipt Notification (notify sender that recepient read message)

Make a folder with an R or such so that we know we responded to a specific message

If there are no messages in your folder it says "Last message from" and then nothing, have this say 'nobody' or such. Should only do this if I have never received a message (see below)

If I delete all of my messages it should remember who my last message was from and reflect that in the "Last Message from"

06-22-2000, 05:57 AM
If I delete all of my messages it should remember who my last message was from and reflect that in the "Last Message from"

That's a pretty major table change, to either store the userid in an additional column in the user table (quite possible) or an additional table (possible, but overkill). I'll think about it :)

"Last message from (blank)" - that was just an over sight on my part. Pretty easy fix.

Anyway, everything you basically suggested it quite possible. I'll look into them.

06-22-2000, 07:07 AM
Thanks, I think just adding a field that stores the ID of the last message user would be fine.

The hack is great and my users love it.

Oh yeah would it be possible to get some sort of stat function in the CP that would say

25 IM's sent today, 350 total ever sent.

Something so I can make sure that the IM isn't taking over message posting. I know this would be 2 more fields and would require another table. I am currently looking at the sent & received tables but I'm not comfortable seeing what everybody has sent when it is 'supposed' to be private.

06-22-2000, 12:33 PM
Question - I use 1.1.3beta2 and it says everyone registered in 1969 - what do I change to fix this?

06-22-2000, 12:39 PM
Rangersfan - here is what Ed posted about the date problem earlier in this page:

Originally posted by Ed Sullivan
RE: The Date Problem

Quite a simple fix actually, in private.php, find: (line 146)
$userinfo=$DB_site->query_first("SELECT userid,email,username,usertitle,signature,showemai l,homepage,icq,aim,yahoo,UNIX_TIMESTAMP(joindate) AS joindate,posts FROM user WHERE userid=$userid2");

Replace with: $userinfo=$DB_site->query_first("SELECT userid,email,username,usertitle,signature,showemai l,homepage,icq,aim,yahoo,joindate,posts FROM user WHERE userid=$userid2");



[Edited by bira on 06-22-2000 at 09:40 PM]

06-22-2000, 01:08 PM
Thanks I looked at every post but I guess I missed that one. :eek:

The line was already there commented out so I just switched the two around.

[Edited by rangersfan on 06-22-2000 at 10:15 PM]

06-23-2000, 09:10 AM
Ed:

Since this works so well do you think that John will incoroporate it into the next version of vBulletin? It sure would make it a lot easier if it was already included.

One thing that I think would really be cool is a feature that would offer a java pop up if they wanted like ICQ. When you have private messages waiting, you as a member could choose the option, could have a pop up window with the messages that you could scroll through and then close the window out.

Just thinking!

Parker

06-23-2000, 08:43 PM
Java could be a bad idea for the sake of compatibility.

06-24-2000, 02:45 AM
Just wanted to say, Great Hack!

06-25-2000, 06:01 PM
Which zip file has the latest bug fixes, files, and instructions?

Thanks!

06-26-2000, 06:54 PM
OKAY, I must be real stupid.

6. Add $pminfo to 'forumhome' template where you want 'pmloggedin' or 'pmloggedout' template to appear.


Where the heck are these templates????? This line of the instructions speak like I'm supposed to know or something.

:)

Can we have "PM Hack for Dummies?"

in other words.....help?

06-26-2000, 06:55 PM
OKAY, I must be real stupid.

-----------INSTRUCTIONS----------------------------
6. Add $pminfo to 'forumhome' template where you want 'pmloggedin' or 'pmloggedout' template to appear.
---------------END------------------------

Where the heck are these templates????? This line of the instructions speak like I'm supposed to know or something.

:)

Can we have "PM Hack for Dummies?"

in other words.....help?

06-30-2000, 08:04 AM
Originally posted by Cold Steel
Which zip file has the latest bug fixes, files, and instructions?

Thanks!

*bump*

Can someone tell me please?

06-30-2000, 11:01 AM
Uhm, on the first page, perhaps?

07-01-2000, 08:30 AM
Does this hack work in any incarnations of 1.1.3?

07-03-2000, 02:09 AM
Originally posted by Cold Steel
Does this hack work in any incarnations of 1.1.3? Yes, see my board.

And about those templates someone mentioned: look in the list - they're there.

07-03-2000, 02:14 AM
Cold Steel : yes it works but you will have to look a little bit for the correct place to put it as the instructions don't exactly match up.

07-04-2000, 02:47 PM
Does the PM hack currently check against baneip / banemail if enablebanning is switched on via the Control Panel?

If not can this functionality be introduced please?

07-12-2000, 12:03 AM
Your board is beautiful! Can I use your light bulbs?

07-12-2000, 12:07 AM
My board?!? Wow, I don't even like it too much anymore ;) But if you were talking to me, sure.

About the new version - it's coming along well. I'll look through this whole thread and tell what's been added so far.

07-12-2000, 12:39 AM
Well, here's just a list of new features and such for the new version:

------
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.
Done!

2) Add "My Private Messaging" to the $forumjump scrolldown list (I guess this could be added somehow simple, no?)
Not yet, but it sounds simple (I'm just trying to avoid making changes to vB's standard files.

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.
Been done!

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.
Yep, been done too!

This might seem a little hard, but would it be possible for the user to create subfolders, like "Old PM's", or something like that? Someplace to put the PM's once they have been read, but so that they are not in the "Inbox".
A little hard, but ... Done too!

some kind of indicator to note whethere a message has been replied to or not
Done too!

I wonder if you are able to put "quotas" on accounts. IE limit to 20 messages or something??
I haven't tested it, but Done! (Admins/Mods exempt too) (Even sends email if full)

1) Forward. "Forward this message to..."
Done!

2) a "read next" "read previous" links on the messages, like in the threads.
Done!

3) An arrow next to the "last message from..." which takes you directly to that last message.
Not yet, but I think that's simple too...

how about the option to dispatch an email to the user when a new private message is awaiting them
Not yet

Also, it would be great if there was a facility for admins only (i.e. me) to send a private message to *every* registered user.
Not quite yet...

an option to stop specific users from using the facility if they abused it, but seperate from their posting rights section
Coming...

Would it be possible to place check boxes next to the list of "sent" messages, so instead of deleting them one at a time you could check as many messages as you want and delete them all at once.
See above (aka Done!)

Receipt Notification (notify sender that recepient read message)
Don't really know if this is possible without adding another field...

Make a folder with an R or such so that we know we responded to a specific message
Done! (I just need a folder that has an R)

If there are no messages in your folder it says "Last message from" and then nothing, have this say 'nobody' or such. Should only do this if I have never received a message (see below)
Fixed

If I delete all of my messages it should remember who my last message was from and reflect that in the "Last Message from"
I don't want to add another field to the user table :)

Oh yeah would it be possible to get some sort of stat function in the CP that would say

25 IM's sent today, 350 total ever sent.
Not done yet...

One thing that I think would really be cool is a feature that would offer a java pop up if they wanted like ICQ
Nope...

Does the PM hack currently check against baneip / banemail if enablebanning is switched on via the Control Panel?
Done! (That was the simplest fix ever)
-------

07-12-2000, 12:46 AM
Oh, and this was amusing:

Views: 2250. Wow, 2250 views of this one thread :D

07-12-2000, 04:34 AM
Ed:

One other thing. I think you should make it to where the member can turn this option off. I know you have control as an admin to turn it off or on to the whole board but a lot our members don't like the private messging and don't want anyone sending them anything. This should also remove the icon that you put in the forumdisplay pages too so that they can't send a private message from there either.

Parker

07-12-2000, 04:40 AM
Ed:

You know looking at what you have done already it would nice if you put all the member selection in an options section. That way on one page you could set up your folders, set up your ban list, enable or disable private messaging, etc.

Just a thought.

Parker

07-12-2000, 05:57 AM
Originally posted by Ed Sullivan
quote:

Does the PM hack currently check against baneip / banemail if enablebanning is switched on via the Control Panel?

Done! (That was the simplest fix ever)



Thanks! :D



Originally posted by Parker Clack
Ed:

One other thing. I think you should make it to where the member can turn this option off. I know you have control as an admin to turn it off or on to the whole board but a lot our members don't like the private messging and don't want anyone sending them anything. This should also remove the icon that you put in the forumdisplay pages too so that they can't send a private message from there either.

Parker

Agree 100%


[Edited by Ciaran on 07-12-2000 at 02:58 AM]

07-12-2000, 08:22 AM
all we need now are polls in a pm...;)

07-12-2000, 01:52 PM
Ed:

One thing too. Do you have it written for 1.1.3 yet? I used the version that you have but noticed today that in the faq and bbcode pages you get a database error like:

Database error in vBulletin: Invalid SQL: SELECT announcementid,userid,startdate,title FROM announcement WHERE startdate<=963412951 AND enddate>=963412951 AND (forumid= OR forumid=-1) ORDER BY startdate DESC LIMIT 1
mysql error: You have an error in your SQL syntax near 'OR forumid=-1) ORDER BY startdate DESC LIMIT 1' at line 1
mysql error number: 1064
Date: Wednesday 12th of July 2000 09:42:31 AM
Script: /htforum/index.php?action=bbcode
Referer: http://www.hometheaterforum.com/htforum/index.php?action=faq

so it is probably where I am putting the code that have in the index.php file.

Could you look at 1.1.3 and see what changes need to be made in the placement of your code?

BTW, when I put the original code from 1.1.3 back in it took care of the problem.

Thanks,
Parker

07-12-2000, 02:11 PM
Parker-
One other thing. I think you should make it to where the member can turn this option off. I know you have control as an admin to turn it off or on to the whole board but a lot our members don't like the private messging and don't want anyone sending them anything. This should also remove the icon that you put in the forumdisplay pages too so that they can't send a private message from there either.See my list, it's "Coming...", as in I'm programming it right now.

You know looking at what you have done already it would nice if you put all the member selection in an options section.Maybe if I feel like writing another template. I really hate making templates, and I'm already up to about 30 (!!!) :D

One thing too. Do you have it written for 1.1.3 yet?Yes, works fine on 1.1.3. Look at my board.

I used the version that you have but noticed today that in the faq and bbcode pages you get a database error like: {SNIP}Umm... I don't get them.

Doron-
all we need now are polls in a pm...LOL, that's coming in version v80.1 :)

07-12-2000, 02:44 PM
Ed:

Since it is the index.php file that is causing the trouble
this is what I have.

Just below:
if ($action=="showforums") {

I have:

//PM HACK
if ($bbusername) {
$username = $bbusername;
$pmcounta = $DB_site->query_first("SELECT COUNT(msgid) AS msgid FROM privatercvd WHERE toid=$bbuserid");
$pmcount = $pmcounta[msgid];
$newpmcounta = $DB_site->query_first("SELECT COUNT(msgid) AS msgid FROM privatercvd WHERE toid=$bbuserid AND UNIX_TIMESTAMP(datetime)>$bblastvisit");
$newpmcount = $newpmcounta[msgid];
if ($newpmcount == 0) {
$lightbulb = 'images/off.gif';
} else {
$lightbulb = 'images/on.gif';
}
$lastsent = $DB_site->query_first("SELECT fromid,UNIX_TIMESTAMP(datetime) AS datetime FROM privatercvd WHERE toid=$bbuserid ORDER BY msgid DESC");
if ($lastsent) {
$lastid = trim($lastsent[fromid]);
$lastdate=date($dateformat,$lastsent[datetime]+(($timeoffset+$bbtimezoneoffset)*3600));
$lasttime=date($timeformat,$lastsent[datetime]+(($timeoffset+$bbtimezoneoffset)*3600));
$lastsentuser = $DB_site->query_first("SELECT username FROM user WHERE userid=$lastid");
$lastuser = htmlspecialchars($lastsentuser[username]);
}
eval("\$pminfo .= \"".gettemplate("pmloggedin")."\";");
} else {
eval("\$pminfo .= \"".gettemplate("pmloggedout")."\";");
}
//END PM HACK

and this is just above:

$numbersmembers=$DB_site->query_first("SELECT COUNT(userid) AS users FROM user");
$numbermembers=$numbersmembers[users];

Does this look right?

Parker

07-12-2000, 04:12 PM
Parker - that code is fine, although the new version makes some changes.

Now, the weird thing: I just downloaded the new beta 3, and did some searches, both in global.php and index.php. And that SQL isn't even in either! So, it's not my hack that's causing them to die :)

07-12-2000, 04:16 PM
That IS weird. If I put the orginal index.php file back in I don't get the error. If I put the one with the code added in I get the database error.

What I was wanting in the previous message was to know if I was putting it in right or not.

Maybe the new version will take care of this problem. Who knows.

Parker

[Edited by Parker Clack on 07-12-2000 at 01:18 PM]

07-12-2000, 07:32 PM
Maybe I'm missing the point, or didn't catch the sarcasm, but... :)

What's the point with polls in a private message?

There would be two votes MAX...so it seems rather, pointless. :)

07-12-2000, 07:38 PM
you could mass mail them and have a central poll..nah, that was a joke. ;)

07-12-2000, 07:49 PM
This is sweet! :) Goodbye mass e-mails hello personal messages! ;)

07-13-2000, 02:53 AM
Ed:

I sent you an email back with the file you requested.

Did you get it?

Parker

07-13-2000, 03:53 AM
Yeah, I haven't looked at it extensively yet though. Can you do a quick search in your global.php for something in that SQL error (like, announcement) or something - I really have no clue what would cause that.

When forumid=-1 in an announcement, that means it's going to any forum. So what the script is trying to grab looks like a forumdisplay.php routine: grab announcements for any forum (-1) or this forum (the blank space, since you're not in a forum). But, w(why)tf would it be doing that in index.php?!

*shrug* Not sure yet...

And, to everyone, I'm very close to the new release. Tonight if I rush to document all the changes, most likely tomorrow though.

Some misc. stuff now:
- Yes, there is an upgrade route to the new version, but some of the templates have significant changes. I suggest using the default versions, and just rehacking :) (Besides, I'm not even sure of everything I've changed)
- 95% of the suggestions have been implemented, including a few that weren't "Done!" before.
- Unfortunately, with new features, comes more editing to vB's standard files--much more. :(

Now, some bragging rights: :D
- 4 new profile fields, 2 customizable via "modifyprofile", other 2 from PM hack itself
- one new field to "usergroup" table
- (Get ready) 35 new templates (!!)
- 3 new tables:
* privatercvd, now with 10 fields
* privatesent, with 8 fields
* and pmstats, with 4 (new feature, still lacking though) :(

Anyway, get ready :)

07-13-2000, 07:39 AM
- Unfortunately, with new features, comes more editing to vB's standard files--much more.

It's inevitable, even though Idid think about creating a fuction file and using that to reduce the code you enter (for the poll hack).

07-13-2000, 12:00 PM
Ed:

Thanks for looking into it. I found the problem. It was in my index.php file. I was trying to put an announcement thing on the main page found out I couldn't get it to work but forgot to take the code back out. That is what was causing the error. You didn't see it because it wasn't in index.php to begin with.

Duh!

I look forward to the newest version. Do you think you could document the names of the templates that you have created and are adding. It's kind of hard to look through the list and figure out which ones go with the private messages.

Thanks again,

Parker

[Edited by Parker Clack on 07-13-2000 at 09:10 AM]

07-13-2000, 02:26 PM
doron - that's not really possible because a lot of the stuff is replacing lines.

Parker - see, it wasn't my hack :) And about template names: Well, most (95%) start with pm, error_pm, or redirect_pm, but ok.

07-14-2000, 01:54 PM
Ummm...stupid question but it is possible to set this feature for admins and mods to mass mail members? Not all but simply more than one member?

ie.
In the input field you would ask the admin/mod to separate the user names using commas.

I know how to do this in perl but don't even know where to start in php... I need a book

07-14-2000, 03:37 PM
Originally posted by SonnetCelestial
Ummm...stupid question but it is possible to set this feature for admins and mods to mass mail members? Not all but simply more than one member?Not in this version.

07-14-2000, 08:41 PM
Okay, no worries ed! :) Thanks though. (btw when I said MAIL I meant POST, sorry for the confusion)

[Edited by SonnetCelestial on 07-14-2000 at 05:41 PM]