ok, here are a couple of add-ons:
1) Cancel 'Away' status when user posts:
Open
newthread.php
Find:
Code:
$DB_site->query("UPDATE user SET
".iif ($foruminfo[countposts],"posts=posts+1,","")."
$dotitle"."lastpost='".time()."' WHERE userid='$bbuserinfo[userid]'");
Change to (changes hilighted):
Code:
$DB_site->query("UPDATE user SET
".iif ($foruminfo[countposts],"posts=posts+1,","")."
$dotitle"."lastpost='".time()."'[high],away=0,awaydate='',awayreason='',returndate=''[/high] WHERE userid='$bbuserinfo[userid]'");
Open
newreply.php and find:
Code:
$DB_site->query("UPDATE user SET
".iif ($foruminfo[countposts],"posts=posts+1,","")."
$dotitle"."lastpost='".time()."' WHERE userid='$bbuserinfo[userid]'");
Change to (changes hilighted):
Code:
$DB_site->query("UPDATE user SET
".iif ($foruminfo[countposts],"posts=posts+1,","")."
$dotitle"."lastpost='".time()."'[high],away=0,awaydate='',awayreason='',returndate=''[/high] WHERE userid='$bbuserinfo[userid]'");
Save both files and upload.
This change will automatically cancel a user's 'away' status once he/she posts a new thread or a new reply.
2) Send auto-reply to PMs while a user is a way.
This add-on will act like the "vacation" auto-reply most e-mail programs have.
When you send a PM to a user who is away, you will immediately receive a PM with "Auto Reply:" in the subject line.
The PM message body will say 'I'm away and will read your PM when I return', with the reason (if present) and the return date (if present).
If you want to add this, open private.php and find:
Code:
eval("standardredirect(\"".gettemplate("redirect_pmthanks")."\",\"private.php?s=$session[sessionhash]\");");
ABOVE it ADD:
PHP Code:
// away auto-reply add-on
if ($touserinfo[away]=="1") {
$sincedate = vbdate($dateformat, $touserinfo[awaydate]);
if ($touserinfo[returndate]=="0000-00-00") {
$returndate = "[i](date unknown)[/i]";
} else {
$returnaway = explode("-", $touserinfo[returndate]);
$returndate = "on ".vbdate($dateformat, mktime(0,0,0,$returnaway[1],$returnaway[2],$returnaway[0]));
}
if (!$touserinfo[awayreason]) {
$awayreason = "[i](No reason specified)[/i]";
} else {
$awayreason = "[i]($touserinfo[awayreason])[/i]";
}
$autoreply = "Hi $bbuserinfo[username],\n\n I have been away since $sincedate $awayreason and will read your message when I return $returndate.";
$autotitle = "Auto Reply: ".addslashes(htmlspecialchars($title));
$DB_site->query("INSERT INTO privatemessage (privatemessageid,userid,touserid,fromuserid,title,message,dateline,showsignature,iconid,messageread,folderid,receipt) VALUES (NULL,$bbuserinfo[userid],$bbuserinfo[userid],$touserinfo[userid],'".addslashes(htmlspecialchars($autotitle))."','".addslashes(htmlspecialchars($autoreply))."','".time()."',0,0,0,0,0)");
if ($bbuserinfo[emailonpm]) {
eval("\$emailmsg = \"".gettemplate("email_pmautoreply",1,0)."\";");
eval("\$emailsubject = \"".gettemplate("emailsubject_pmreceived",1,0)."\";");
mail($bbuserinfo[email],$emailsubject,$emailmsg,"From: \"$bbtitle Mailer\" <$webmasteremail>");
}
}
// away auto-reply add-on
Save and upload.
create NEW template called
email_pmautoreply and place in it:
Quote:
$bbuserinfo[username],
You have received a new private message at $bbtitle from $touserinfo[username]. Please click here to log in and read it:
$bburl/private.php
Thanks,
$bbtitle team
|
That's it
p.s.
Meta, I will add what you're asking for (Admin CP) tomorrow. I'm off to sleep now