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-14-2000 02:49 AM

Ok, bunch of things here, I think

1. Templates: this is the full list of templates makeprivtables.php creates.
Quote:

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

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

Quote:

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

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

Code:

{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

Quote:

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

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

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

after, add:
Code:

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

$timesent</smallfont></td>
after that, add:
Code:

<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/for...?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

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

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

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

Quote:

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

Quote:

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/show...?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

Quote:

Originally posted by Ed Sullivan
Quote:

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:

Code:

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

Code:

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

Code:

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


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

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01371 seconds
  • Memory Usage 1,845KB
  • 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
  • (14)bbcode_code_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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