$user=$DB_site->query_first("SELECT userid FROM user WHERE username='".addslashes($username)."'");
$userid=$user[userid];
$userinfo=$DB_site->query_first("SELECT username,email FROM user WHERE userid=$userid");
$useremail=$userinfo[email];
$username=$userinfo[username];
$fromuser=$DB_site->query_first("SELECT userid FROM user WHERE username='".addslashes($fromusername)."'");
$fromuserid=$fromuser[userid];
$fromuserinfo=$DB_site->query_first("SELECT username,email FROM user WHERE userid=$fromuserid");
$fromuseremail=$fromuserinfo[email];
$fromusername=$fromuserinfo[username];
is replace the mailto: link in the postbit with an anonymous form that doesn't reveal the users' e-mail address to whoever is sending the mail.
It will also help protect against people will take the time to harvest your users' e-mail addy for spamming, like Chris from extremeforums did us on the UBB.
I'll prolly templatize it tonight (or screw it up trying) and send the template code and php file to him for inclusion in the 1.1.2 release.
If I can't get it, I'm sure John will (or some other enterprizing hacker)
Tonight's project is a SUPER basic My Topics list. Nothing more than a search, really, but it should suffice until we get an altertable routine to do the real thing.
If you really think about this it really is the private messages hack that people have been wanting only it sends the private message via email instead of to the board.
Now what would be cool is if you could read your email with this via an smtp or pop call with the member putting in their username and password to their email account and the script could tell them they have private mailing waiting while they are surfing your forum.
The private message hack would require four new tables in the forum database to store from, to, subject and message. I think it would actually be easier to implement here than with UBB.
The hack was by Lord Raven, one of my members and a friend. My contribution was pretty limited.
If anyone is interested, here's a version of the hack that calls on the user's mail client to do the sending
Code:
<?php
require("global.php");
$username=$QUERY_STRING;
$username=urldecode($username);
$user=$DB_site->query_first("SELECT userid FROM user WHERE username='".addslashes($username)."'");
$userid=$user[userid];
// display user info
$userinfo=$DB_site->query_first("SELECT email FROM user WHERE userid = $userid");
$mememail=$userinfo[email];
$mailto="mailto:$mememail";
header("Location:$mailto");
?>
Just put that into a file (e.g membermail.php) and call on it in the templates using the form membermail.php?$username