View Full Version : mark read/unread hack?


devinci99
10-17-2005, 12:47 AM
(asking Jafo for confirmation)

well it's not even done... but I'm trying...

so far I got am looking over:

subroutine Get_Message() under functions.cgi

I think this is what updates the mail status when you read the mail:

my $stp = $db->prepare("UPDATE " . $settings{"dbsuff"} . "mail_index SET status = ? WHERE mail_id = '$_[0]' and mail_to = '$user'") or &oops("$! DBI: $DBI::errstr ");

$stp->bind_param( 1, "read" ) or &oops("$! DBI: $DBI::errstr");

but not sure.

If this is it, how would you reverse it? To set the mail back to unread?

My guesses:

1. $stp->bind_param( 1, "unread" ) or &oops("$! DBI: $DBI::errstr");
2. $stp->bind_param( 1, "new" ) or &oops("$! DBI: $DBI::errstr");

if i can pin point this i think we got a hack for "mark read/unread" subroutine.


looking over the Inbox() subroutine from messenger.cgi:

elsif ($temp_array[6] ne "read") { ... }
else { ... }

I'm beginning to think it wouldnt matter... as long as I chage the status to anything other than "read" may be able to get the hack to work ?

devinci99
10-17-2005, 12:55 AM
taking a crack at it:

function.cgi

test subroutines:

### make unread
sub mk_unread {
my ($html,$i,$message,$mail_to,$cc,$mail_from,$subjec t,$html_message,$text_message);
my $db = &dbconnect;
my $stp = $db->prepare("UPDATE " . $settings{"dbsuff"} . "mail_index SET status = ? WHERE mail_id = '$_[0]' and mail_to = '$user'") or &oops("$! DBI: $DBI::errstr ");
$stp->bind_param( 1, "unread" ) or &oops("$! DBI: $DBI::errstr");
$stp->execute() or &oops("$! DBI: $DBI::errstr");
}

devinci99
10-17-2005, 01:28 AM
tested... didnt work ... maybe will take another crack later. or see if jafo has time to do it.

Jafo
10-17-2005, 11:04 AM
Change the status from read to blank.. so just ''.

devinci99
10-18-2005, 01:06 AM
i figured it out shortly after I posted this.

All implemented. :) I am also doing "preview" differently than you are.

What about a hack for... searching through emails.

like find a email by subject, to/from, attachments, etc ?

Jafo
10-18-2005, 06:52 AM
I am currently working on Messenger 7 (uh oh, I spilled the beans :) ) so I probably will not be working on any 6.0 hacks any time soon.

devinci99
11-01-2005, 07:39 PM
ack... in php????

Jafo
11-01-2005, 10:14 PM
Yes, in PHP.

devinci99
11-10-2005, 12:58 AM
:( well i guess i wont complain if the new versions incorporated all of my mods so i wouldnt have to learn php and re-code them.

Jafo
11-11-2005, 07:58 AM
The faster you learn PHP, the better off you will be in the future. It seems quite apparent to me that Perl 6 is moving away from the CGI end of things.

devinci99
11-23-2005, 08:18 PM
noooooooooooooo!!!

i got a lot of good stuff on perl!

anyway... feel free to stop by the site and see if there are any ideas you like to implement in the next release. :)

just let me know which you are "borrowing"!