Version: 1.00, by Gamingforce
Developer Last Online: Jan 2007
Version: 3.0.3
Rating:
Released: 07-15-2004
Last Update: Never
Installs: 67
No support by the author.
[ Feature Description ]
This hack allows users to easily set themselves as away via the Edit Profile page. An optional away message can be added along with the away status. Away messages are viewable at the top of the user profile (by the avatar/user picture). If a post is made when a user is in away mode, the user is automatically set off away mode.
[ Hack Concept ]
Credits to bira for making the original away message hack for vBulletin 2. This is a complete remake however.
[ Future Plans ]
Show away status in postbit. (If you want, you can add this right now by using an xhtml conditional ($bbuserinfo[awaystatus] == 1)).
I tried the below with $sendto["$username"] = true; $tostring["$user[userid]"] = $user['username'];
before and after the actual error message
or without it at all, like your code
if (!empty($pmuseraway))
{
define('PMPREVIEW', 1);
$preview = construct_errors($pmuseraway); // this will take the preview's place
$_REQUEST['do'] = 'newpm';
}
else
{
$url = "private.php?$session[sessionurl]";
eval(print_standard_redirect('pm_messagesent'));
}
Thanks. But rather than prevent the PM from being sent, I'd rather the autoresponder option, so no PM get lost or prevented.
I would like that too, but I just do not have the time to code this functionality. It's more involved, since it requires you to scan the recipients for those who are away, and then create a PM back to the sender. This requires the same checks as the ones performed when the original PM is send, and you have to change the recipient with the sender.
Sorry, not enough time here for that. I admit though, if someone can come up with it, I'll use it too.
Thanks. But rather than prevent the PM from being sent, I'd rather the autoresponder option, so no PM get lost or prevented.
Would you mind if instead of a PM, you get an e-mail when the user you PMed is away?
If not, here is the code you can use. In your private.php, find:
PHP Code:
}
// process errors if there are any
if (!empty($errors))
{
Replace that with:
PHP Code:
if ($user['awaystatus'] ==1)
{
mail ($bbuserinfo[email],"One of your PMs was send to a user who is away","The PM you send to $username was not delivered, because this user is currently away.","From: \"$vboptions[bbtitle] Mailer\" <$vboptions[webmasteremail]>");
}
}
// process errors if there are any
if (!empty($errors))
{
You may customize the above, to use a template for the e-mail send. If you want help on this, please let me know.
if (!empty($pmuseraway))
{
define('PMPREVIEW', 1);
$preview = construct_errors($pmuseraway); // this will take the preview's place
$_REQUEST['do'] = 'newpm';
}
else
{
$url = "private.php?$session[sessionurl]";
eval(print_standard_redirect('pm_messagesent'));
}
Let me know if it works.
----------
John
That displayed the error message about being away in the preview when trying to send message.
That displayed the error message about being away in the preview when trying to send message.
You mean the error message comes up when you hit "Preview"?? It doesn't work like that in my case. Preview works as it is supposed to, then when you click "Submit" the error appears, which is what it should do.
You mean the error message comes up when you hit "Preview"?? It doesn't work like that in my case. Preview works as it is supposed to, then when you click "Submit" the error appears, which is what it should do.
I meant it works as intended. It displays the useraway message pm not sent in the preview screen that appears when trying to submit.
I meant it works as intended. It displays the useraway message pm not sent in the preview screen that appears when trying to submit.
Well, the preview screen does not come up with any error message in my system. But after you do the preview, if you hit "Submit", then it shows the error. Same thing it does if you do not preview, and hit "Submit" from the editor screen.
Just to let you know though, I stopped using this mod. I replaced it in my forums with the e-mail warning one. I think it is better that way, your PM goes to the recipient, even if he is away, and you get back an e-mail saying that the recipient is away and he will get your message when he returns.
A PM would be a more elegant solution, but I do not want to get involved with all the checks necessary to send a PM. The e-mail is sent by the admin account, so users will get it one way or another.