PDA

View Full Version : [RELEASE] Private Messaging 1.2.5


11-04-2000, 12:31 AM
Not much of a release, but should be 1.1.4 compliant.

Please discuss here: http://www.vbulletin.org/hacks/hacks.php?action=gethack&id=36

11-04-2000, 12:44 AM
Nice new features.

Thanks

11-04-2000, 02:33 AM
Since your probably the person in the know. Is this the version of PM that is going to be in version 2.0 or at least is the 2.0 version going to be compatible?

I don't want to install this now and then have to try and convert the tables when 2.0 comes out.

Thanks for you help.

11-04-2000, 10:03 AM
Very good point mr wluke (love sitepoint btw, great stuff )

Will v2.0 use the same tables, column names etc... at your poll hack (ed).

Suppose this really should have been asked before.

http://www.e-tones.co.uk

11-04-2000, 03:53 PM
Originally posted by wluke
is the 2.0 version going to be compatibleYes.

11-04-2000, 07:21 PM
I've a Problem with the hack. The makeprivtables.php3 doesn't work:

Database error in vBulletin: Invalid SQL: ALTER TABLE usergroup ADD canusepm TINYINT (4) DEFAULT '1' not null
mysql error: Duplicate column name 'canusepm'
mysql error number: 1060
Date: Saturday 04th of November 2000 07:22:49 PM
Script: /makeprivtables.php3
Referer:

can anybody help me?

[Edited by g1gabyt3 on 11-04-2000 at 04:23 PM]

11-04-2000, 07:30 PM
You probably have already installed PM v1.2.0 so in your db is already column canusepm.

I think you should read upgrade-templates.txt. :D

11-09-2000, 10:47 AM
I can't find the following lines to change in showthread.php:

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

Replace with:
~~~~~~
//PM Hack
//Original: $userinfo=$DB_site->query_first("SELECT userid,email,username,usertitle,signature,showemai l,homepage,icq,aim,yahoo,joindate,posts FROM user WHERE userid=$userid");
//New:
$userinfo=$DB_site->query_first("SELECT userid,email,username,usertitle,signature,showemai l,homepage,icq,aim,yahoo,joindate,posts,receivepm FROM user WHERE userid=$userid");
if ($userinfo[receivepm]=="1") {
$pmlink = "<a href=\"private.php?action=newmessage&toid=$userinfo[userid]\"><img src=\"images/pm.gif\" border=0></a>?";
} else {
$pmlink = "";
}
//END PM Hack
~~~~~~~
(Note: make sure you change the <img src=...> to what your in-thread, PM pic is)

What did I wrong?

11-09-2000, 12:32 PM
You're reading the upgrade instructions I believe, which you don't need to do for 1.1.4 - since it's a fresh code installation.

anyway, insert that code under:
$userinfo=$post;

11-10-2000, 02:27 AM
i am thinking of adding in the pm hack now :)

do the control panel, censor function work on pm messages ?

11-10-2000, 02:49 AM
ed, in the instructions for member.php there's 2 instances of
$userinfo=$DB_site->query_first("SELECT parentemail,coppauser,email,password,homepage,icq, aim,yahoo,biography,signature,adminemail,showemail ,invisible,cookieuser,daysprune,timezoneoffset,ema ilnotification FROM user WHERE userid=$userid"); one in start coppa and one in start modify profile
so do i replace both ?

11-10-2000, 11:55 AM
the first instance which I think is modify profile.

11-10-2000, 12:04 PM
thanks i installed it and modify profile is the 2nd instance if my short term memory is correct :)

is there away to add a announcement like template bit aboave the pm table in private.php - so to announce private news to members while they are checking their messages ?

11-10-2000, 05:25 PM
now i have a problem, the pm messages are not getting deleting when i check the box to delete them ?

[Edited by eva2000 on 11-11-2000 at 05:45 AM]

11-11-2000, 08:45 AM
also when i moved a message to another folder, it disappears from the inbox but does not make it's way to the new folder ? i send another test message and my moved message reappears at the inbox folder ?

11-25-2000, 06:12 PM
Damnit. I installed 1.2.0 because this was farther away and I thought that was the latest hack. )()(*@#)($()@$. Thanks for the new hack!

11-25-2000, 06:55 PM
does this hack only work for VB 1.1.4 like it says on the site and in the text file?

11-26-2000, 12:40 AM
The instructions are for 1.1.4 only.

11-26-2000, 12:52 AM
Ed, I have the previous version (1.2?) running on 1.1.4 without any problems. Should I upgrade then? Are there any new features that were added specifically to this release? I had a look at the upgrade text file and could not see anything new. Am I missing something?

11-26-2000, 12:59 AM
anyone have instructions for installing this version on 1.1.3, instead of 1.1.4?

11-29-2000, 07:34 AM
Hey Ed,
first... GREAT HACK as always! ;)
Now, I applied it to my board but I noticed that on the private.php page instead of the "[Send A Private Message]" wording there's a line like __________________ still linked to private.php?action=newmessage&password=&reply=false . How can I fix this?

11-29-2000, 11:49 AM
Edit the templates. :)

12-01-2000, 07:28 PM
i changed all the .php extensions into .php3 extensions and there are still numerous glitches in the code. either there is no file found, or the screens are completely white. other than that it was a smooth install. what else do i have to change over to php3?

12-01-2000, 07:46 PM
nevermind - i have to find and replace all the .php extensions in all the edited files and private.php(3).

thanks.

12-01-2000, 08:17 PM
Originally posted by Ed Sullivan
Edit the templates. :)

I was going into the right direction but didn't notice there were two instances of this wording... :)
Tnx anyway.

12-02-2000, 07:50 AM
Works absolutely perfect.

12-02-2000, 05:13 PM
was wondering what i should do if i have the version php3 of my board

and this pm hack seams compatible with only php boards

how should i do this please answer :)

12-02-2000, 06:09 PM
Do a mass search/replace of .php with .php3 in the included PHP files [mainly/all makeprivtables.php] Note the dot! .php, .php3. Then rename the files.

12-03-2000, 07:26 AM
Originally posted by Ed Sullivan
Do a mass search/replace of .php with .php3 in the included PHP files [mainly/all makeprivtables.php] Note the dot! .php, .php3. Then rename the files.

What about PHP4? Would it work too?

12-03-2000, 08:51 AM
gah more trouble :/

Parse error: parse error in /www/trportal/wtfxp/forum1/makeprivtables.php3 on line 3

in makeprivtables.php3 on line 3 it says

require("global.php3");

i already uploaded the global file i edited then tried to ran but still the same message appeared

what is wrong ?

12-03-2000, 11:32 PM
What about PHP4? Would it work too?


php4 has the simple .php extensions. php3 relates to .php3 extensions. IE there is no .php4, but rather .php. i am assuming that .php will serve as PHP's predominant extension through versions PHP5 and up until the language becomes extinct.

[Edited by Universal Sea on 12-03-2000 at 10:23 PM]

12-04-2000, 04:37 AM
How do I get the private message menu bar to appear when people first go to the forums? I have it working correctly, I just want that bar there to promote it more.

in my index.php, the lines:

$lastuserlink = "<a href=\"private.php?action=show&msgid=$lastsent[msgid]&password=$bbpassword\">$lastuser</a>";
} else {
$lastuserlink = "<i>No one</i>";
}
eval("\$pminfo .= \"".gettemplate("pmloggedin")."\";");
} else {
eval("\$pminfo .= \"".gettemplate("pmloggedout")."\";");
}

are all there.. so I'm not sure why it's not getting those templates (and those templates are there) and not working.

12-04-2000, 01:59 PM
You didn't add the link to forumhome like instructed.

12-06-2000, 12:13 AM
Originally posted by bira
Ed, I have the previous version (1.2?) running on 1.1.4 without any problems. Should I upgrade then? Are there any new features that were added specifically to this release? I had a look at the upgrade text file and could not see anything new. Am I missing something?

Ed? :)

12-06-2000, 12:54 PM
No, don't bother. The only difference is the instructions.

12-08-2000, 03:09 AM
OK, thanks :)

By the way, a couple of small things I thought you might want to know about:

1) Upon sending a Private Message, the script checks to see if the title (among others) is empty. If it is, it tells the user he left one of the fields empty. However, if a user puts, for example, one SPACE in the title - that message goes through. However, your script then trims these spaces, and the message is delivered without a title, and hence without a link to click on.

Granted, this only happened rarely on my BB, but for the 3-4 times that people complained, I made a small change whereby I added a function that adds (no subject) to such PMs.

2) Your templates were missing the <input type="hidden" name="replyto"> field, and therefore messages that were replied to did not get a new icon. Took me a long while to figure that one out! :)

By the way, I must commend you: this has been one of the most significant additions to our BB since its inception several years ago.

Cheers,

Bira

12-10-2000, 01:52 AM
Originally posted by bira
OK, thanks :)

By the way, a couple of small things I thought you might want to know about:
---snip----
Bira

Thanks for the heads up bira. Would you mind posting your fix and which templates need this?
Thx.

12-10-2000, 06:10 AM
Do you think you'll include on a next release the popup notifiy window with sound alert that was included on UBB? You know... whenever there's a new PM, a popup comes up playing a sound and telling you something like "you have a new PM, check it now!". :)

12-13-2000, 07:45 AM
If someone does a quote it
QUOTE]Originally sent by Shakhan:
[QUOTE]Originally sent by Savage:

puts that above in the messages, it doesnt parse them?

Thanks

Everything else seems to work so far.

12-16-2000, 04:35 PM
Or do you have to choose between the two?
Thanks

12-17-2000, 09:17 AM
if ($table=="privatercvd") {
$messages = $DB_site->query("SELECT msgid,toid,fromid,title,UNIX_TIMESTAMP(datetime) AS datetime,iconid,repliedto FROM $table WH
} elseif ($table=="privatesent") {
$messages = $DB_site->query("SELECT msgid,toid,fromid,title,UNIX_TIMESTAMP(datetime) AS datetime,iconid FROM $table WHERE fromid
}
if ($messages) {
//parse each message
while ($message=$DB_site->fetch_array($messages)) {
$fromid = trim($message[fromid]);
if ($ignore[$fromid]) {
continue;
}
$fromuser = $DB_site->query_first("SELECT username FROM user WHERE userid=$fromid");
$from = stripslashes(trim($fromuser[username]));
$toid = trim($message[toid]);
$touser = $DB_site->query_first("SELECT username FROM user WHERE userid=$toid");
if ($table=="privatesent") {
$from = trim($touser[username]);


I have just read through the code briefly... and have a few suggestions:
1) The part where we want to get the name of $fromuser is a new query, so the number of queries fired will be proportional to the number of PM a person gets, why not do a join ?
2) the second part, to find the $touser, afaik, this field is useful if we are at the SentItems folder? So if we are else where, those queries fired are just wasting CPU cycles?

just my 2 cents..

12-24-2000, 11:36 AM
Hey,
cool hack :)
i'm using vb v1.1.3 :(

annybody has the instructions for v1.1.3 ?

becuz...
i can't find in the showthread.php:

$posts=$DB_site->query("SELECT post.dateline as dateline,post.postid as postid,post.pagetext as pagetext,
post.allowsmilie as allowsmilie,post.signature AS showsignature,post.title as title,
post.ipaddress as ipaddress,post.iconid as iconid,post.username as fakename,
post.userid as userid,
user.userid as userid,user.email as email,user.username as username,
user.usertitle as usertitle,user.signature as signature,user.showemail as showemail,
user.homepage as homepage,user.icq as icq,user.aim as aim,user.yahoo as yahoo,
user.joindate as joindate,user.posts as posts

only this looks like it

$posts=$DB_site->query("SELECT dateline,postid,pagetext,allowsmilie,signature AS showsignature,title,ipaddress,iconid,username,user id FROM post WHERE threadid=$threadid AND visible=1 ORDER BY dateline $postorder LIMIT $limitlower,$perpage");


please annybody help me.. thnx

12-24-2000, 11:38 AM
i also cant find $userinfo=$post; in showthread.php :(

12-24-2000, 01:01 PM
Why not upgrade?

12-24-2000, 01:04 PM
because i installed allready a lot of hacks :(

12-26-2000, 01:57 AM
Hi everyone,,

Pleas help me 24 hours only from installing PM . And now my forums not work :( .

It is gaive me this messag :


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.







So PLEAS Any body can help :(:( .

12-26-2000, 02:12 AM
Error message is... I dunno, usually... REQUIRED! :)

12-26-2000, 02:29 AM
Ed Sullivan


Error message is... I dunno, usually... REQUIRED!



Ed, Pleas I cant understand , Now 4 hours not work .

what can i do now to solve this ? :(

12-26-2000, 02:06 PM
You need to tell me the actual error message you're getting. Not just that cover. Paste the email here or view the page source and you'll see it.

12-26-2000, 02:17 PM
Ed , there is no email sent to me .

Because (Technical Staff,) Not linkting to any email .

if you know where i have to but my email .

Thank you Ed ,

12-26-2000, 04:03 PM
"view the page source [on the error page] and you'll see it."

12-26-2000, 05:07 PM
Thank you Ed for helping..

All pages make same error in main directory of vB and admin directory . All php3 files gaiv me same error !

I send you Email did you read it Ed ?

12-26-2000, 08:48 PM
The pmstats table uses the name 'DATETIME' for one of the fields. This is a reserved word by MySQL and causes some versions of MySQL to not accept this. Just found this out as I was switching hosts.

The version I was using was 3.22.27
The version my host is using is: 3.22.14b-gamma-virtual

And when doing the import:

ERROR 1064 at line 195: parse error near 'datetime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
PRIMARY KEY (id)
)' at line 5

sure enough, that's where it chokes. Maybe I missed it (the documentation, except for first-time-install.txt, and I don't see it in there) in the documentation, but I don't remember seeing this as a known bug or issue.

Is there a fix out for this, or do I have to go code-hacking and change the field name and all references to it? :(

12-27-2000, 12:51 AM
Yeah, that was a stupid thing I did. :) You'll have to change the name and then the references.

12-27-2000, 04:01 AM
Eh, no sweat. I've done that in the source code for my site which also barfed when I moved. I never knew since I was using a newer version that allowed it.

BTW, if anyone wants to check it out, http://www.bangable.com. :)

01-02-2001, 05:31 AM
I installed pm 1.2 successfully on vb 1.1.4 but I found why there is a line instead of something maybe a text or image
pls go here to see my screen capture

http://free4home.dns2go.com/~adrian/screenshoot2.gif

01-02-2001, 02:59 PM
Just change the templates and edit that link (and some others too)

01-04-2001, 02:26 PM
How do I install this hack on v1.1.5 ? I'm upgrading from v1.1.2 with PM v0.93 (I think) but am encountering problems a) with the differences between the code in 1.1.5 and b) the differences in the table structure between the two hacks - I run the install script provided and I get errors and it won't allow the changes to be made to the tables...

01-04-2001, 02:52 PM
And before I sit down and upgrade my copy of Vbulletin 1.1.4 to 1.1.5 with pm 1.2.5 installed on 1.1.4 does 1.2.5 of pm work on 1.1.5? (if you could follow all of that)

01-05-2001, 01:39 AM
For everybody who's wondering this PM DOES work with version 1.1.5 I just installed it on my board and everything seems alright, so far.... hehe =D

Check it out: http://www.gamingin3d.com/forum/

01-05-2001, 03:46 AM
how did you find:

$DB_site->query("UPDATE user
SET password='".addslashes($password)."',email='".addslashes($email)."',
parentemail='".addslashes($parentemail)."',coppauser=$coppauser,homepage='".addslashes($homepage)."',
icq='".addslashes($icq)."',aim='".addslashes($aim)."',yahoo='".addslashes($yahoo)."',
biography='".addslashes($biography)."',signature='".addslashes($signature)."',adminemail=$adminemail,
showemail=$showemail,invisible=$invisible,cookieus er=$cookieuser,daysprune=$prunedays,
timezoneoffset=$timezoneoffset,emailnotification=$ emailnotification
WHERE userid=$userid");