L* R*
HOME FORUM DOWNLOADS
Content
  Links
     Browse SVN
     SVN Commit log
     Documentation (Wiki)
  Developers
     Taskmanager
User
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 04, 2008, 05:14:40 PM

Login with username, password and session length
Search



Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Modules > Modules for older versions > 0.3.x Custom/Unofficial Modules > Topic: modules/Mail.php
Pages: [1] 2   Go Down
« previous next »
Print
Author Topic: modules/Mail.php  (Read 1888 times)
0 Members and 1 Guest are viewing this topic.
Blueeagle
Omnipotent
BeBot Developer
Expert
********
Offline Offline

Gender: Male
Posts: 313



modules/Mail.php
« on: March 04, 2007, 09:39:39 AM »

I've been working on a bot mail system that allows members and guests to send offline messages to eachother. This is a huge improvement over offline tells.

Features:
 - All registered alts of a player has got access to the same mailbox.
 - Configurable with the new settings module to allow different levels of access to send and read mail. (IE it can be restricted so only leaders/admins may send mail and everyone may read mail sendt or only leaders can read mail but everyone can send mail to them or all but guests can send/recieve and so on)
- Configurable expiration time of read and unread mail
- Conigurable (global) notificaton of unread mail when a player logs on any of his alts

To do: (ignore the to-do list in the Mail.php file.
 - Cron jobs got lost in a brainfart. Needs to be re-implemented.
 - Colors of message windows needs to be ported to the new Colors module
 - Implement a mass messaging feature so that leaders (configurable ofcourse) can send messages to everyone of a certain access level. (Not sure how this should be done. Ideas are welcome)
 - For those running a webserver on the same machine as the bot it would be possible to implement a web-based send mail interface that iterfaces directly with the database. Not sure how to best make such an interface to be implementable by various boards used by guilds tho.
 - Testing, testing and more testing

Please give feedback.

Attatchment: modules/Mail.php

Edit: Added more stuff to the TO-DO list
« Last Edit: March 04, 2007, 09:57:05 AM by Blueeagle » Logged

The only problem that can't be solved by adding another wrapper is having too many wrappers.
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1089


Re: modules/Mail.php
« Reply #1 on: March 04, 2007, 10:11:51 AM »

Nice idea!

For more info on colors check the wiki
Logged
Blueeagle
Omnipotent
BeBot Developer
Expert
********
Offline Offline

Gender: Male
Posts: 313



Re: modules/Mail.php
« Reply #2 on: March 04, 2007, 11:01:30 AM »

Quote from: Alreadythere on March 04, 2007, 10:11:51 AM
Nice idea!

For more info on colors check the wiki

Yeah, I saw that. I had it all set up but I lost it when I was updating the svn tree. :p
Logged

The only problem that can't be solved by adding another wrapper is having too many wrappers.
Malosar
Expert
*****
Offline Offline

Posts: 259


WWW
Re: modules/Mail.php
« Reply #3 on: March 04, 2007, 12:22:50 PM »

Thats a really good idea, mind if I help out?
Logged

Eternalist
General of The Syndicate
Wolfbiter
BeBot Contributor
Apprentice
*******
Offline Offline

Posts: 141



WWW
Re: modules/Mail.php
« Reply #4 on: March 04, 2007, 12:28:48 PM »

Always thought about doing this, but never got off my fat ass.
Good job.
Logged

220 Doctor | 220 Adventurer | 220 Shade
Wolfbiter
BeBot Contributor
Apprentice
*******
Offline Offline

Posts: 141



WWW
Re: modules/Mail.php
« Reply #5 on: March 04, 2007, 12:41:45 PM »

Well.. here goes my check of the script...

Code:
Line 186: $mailbox=$this->bot->alts->main($user);
Line 187: $no_of_messages=$this->new_mail_count($name);
I assume it's supposed to use main for mail, but it still checks mail for $name instead of $mailbox.

Maybe make the logon notify a user setting instead of a script setting? Since some people might want to be notified and others doesn't.
For when you add cron, maybe go over buddylist and see if anyone has any unread mail still?
You should remove all commented things that isn't yours (like all the stuff from the template you don't use).
Logged

220 Doctor | 220 Adventurer | 220 Shade
Blueeagle
Omnipotent
BeBot Developer
Expert
********
Offline Offline

Gender: Male
Posts: 313



Re: modules/Mail.php
« Reply #6 on: March 04, 2007, 01:47:38 PM »

Quote from: Malosar on March 04, 2007, 12:22:50 PM
Thats a really good idea, mind if I help out?

Thank you and no, go right a head. Smiley

Edit: Khalem talked something about setting up a dev branch. Now I don't know how to do that but it might be a good idea if several people are to be working on this.
« Last Edit: March 04, 2007, 01:49:32 PM by Blueeagle » Logged

The only problem that can't be solved by adding another wrapper is having too many wrappers.
Blueeagle
Omnipotent
BeBot Developer
Expert
********
Offline Offline

Gender: Male
Posts: 313



Re: modules/Mail.php
« Reply #7 on: March 04, 2007, 01:48:34 PM »

Quote from: Wolfbiter on March 04, 2007, 12:41:45 PM
Well.. here goes my check of the script...

Code:
Line 186: $mailbox=$this->bot->alts->main($user);
Line 187: $no_of_messages=$this->new_mail_count($name);
I assume it's supposed to use main for mail, but it still checks mail for $name instead of $mailbox.

Maybe make the logon notify a user setting instead of a script setting? Since some people might want to be notified and others doesn't.
For when you add cron, maybe go over buddylist and see if anyone has any unread mail still?
You should remove all commented things that isn't yours (like all the stuff from the template you don't use).

Yeah I think I missed some notifies. This probably explains it. Thank you.
Logged

The only problem that can't be solved by adding another wrapper is having too many wrappers.
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1089


Re: modules/Mail.php
« Reply #8 on: March 29, 2007, 05:29:56 AM »

Some errors I caught:
  • in mail_send() you have checks to escape the string and replace some stuff. It's working on $mail_message instead of $message though, or the variable in the INSERT should be $mail_message.
  • if($settings['Logon_notificaton']=TRUE) in buddy() will always be true Wink
  • if(msg===1) in buddy() got one = too many
  • I've had to adapt the settings names to the ucfirst(strtolower()) format now used in SVN (I guess you posted the module before I made the change in SVN).

As I don't like spam right on logon I've added a slight delay to the notifies. And I've added default access levels for the commands.

Here is my modified version with the fixes/adds.

PS: forgot to add: if you aren't allowed to send mail it just returns an empty tell. Missing some return value there.
Logged
Blueeagle
Omnipotent
BeBot Developer
Expert
********
Offline Offline

Gender: Male
Posts: 313



Re: modules/Mail.php
« Reply #9 on: March 29, 2007, 03:02:51 PM »

Good job mate!

Just to find something to pick on:
Quote from: Alreadythere on March 29, 2007, 05:29:56 AM
  • if(msg===1) in buddy() got one = too many

= assings
== checks for equality
=== checks for identicality

if (1 ==  "1") is true while
if (1 === "1") is false because 1 is an integer while "1" is a string

A moot point since the variable type is irellevant in this case. Smiley
Logged

The only problem that can't be solved by adding another wrapper is having too many wrappers.
Malosar
Expert
*****
Offline Offline

Posts: 259


WWW
Re: modules/Mail.php
« Reply #10 on: March 29, 2007, 03:51:41 PM »

hehe, you said assings  Grin

(sorry, had to do it)
Logged

Eternalist
General of The Syndicate
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1089


Re: modules/Mail.php
« Reply #11 on: March 29, 2007, 04:20:40 PM »

Quote from: Blueeagle on March 29, 2007, 03:02:51 PM
= assings
== checks for equality
=== checks for identicality

if (1 ==  "1") is true while
if (1 === "1") is false because 1 is an integer while "1" is a string

A moot point since the variable type is irellevant in this case. Smiley
Didn't know that yet, nice to learn that.
Logged
Blueeagle
Omnipotent
BeBot Developer
Expert
********
Offline Offline

Gender: Male
Posts: 313



Re: modules/Mail.php
« Reply #12 on: March 29, 2007, 04:51:36 PM »

Quote from: Malosar on March 29, 2007, 03:51:41 PM
hehe, you said assings  Grin

(sorry, had to do it)

Aw poo! Wink
Logged

The only problem that can't be solved by adding another wrapper is having too many wrappers.
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1089


Re: modules/Mail.php
« Reply #13 on: March 30, 2007, 05:41:33 AM »

Why did you add the make_item_blob() function btw? Not sure what's it supposed to archieve, and it's crashing my AORC Tongue
Logged
Blueeagle
Omnipotent
BeBot Developer
Expert
********
Offline Offline

Gender: Male
Posts: 313



Re: modules/Mail.php
« Reply #14 on: March 30, 2007, 08:19:14 AM »

Because itemrefs sendt trough make_blob were rendered useless.
Logged

The only problem that can't be solved by adding another wrapper is having too many wrappers.
Pages: [1] 2   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Modules > Modules for older versions > 0.3.x Custom/Unofficial Modules > Topic: modules/Mail.php
« previous next »
 
Jump to:  

Recent
online not working after ...
by Temar
[Today at 05:09:48 PM]

Bot not working after tod...
by Alreadythere
[Today at 01:04:41 PM]

Tokens Calulator
by Temar
[December 03, 2008, 01:09:03 PM]

Bebot does not work with ...
by IKShadow
[December 03, 2008, 08:54:04 AM]

!items database
by Temar
[December 03, 2008, 07:27:59 AM]

massive_pvp_time_table 1
by Sudoka
[December 03, 2008, 06:49:07 AM]

Log playtime from buddys ...
by IKShadow
[December 02, 2008, 06:48:12 AM]

[request] Raid timers
by Elesar1
[December 01, 2008, 04:41:09 PM]

Shared DB online list
by Temar
[December 01, 2008, 01:55:47 AM]

relay colors
by Temar
[December 01, 2008, 01:54:56 AM]
Stats
Members
Total Members: 1246
Latest: Vingus
Stats
Total Posts: 11193
Total Topics: 1508
Online Today: 21
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 4
Guests: 11
Total: 15
Temar
vikor
upstart
daltarak

Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC
TinyPortal v0.9.8 © Bloc | NewDef design by Bloc
Page created in 0.391 seconds with 29 queries. (Pretty URLs adds 0.053s, 4q)
Loading...