>> >> > Hello, >> >> > >> >> > when using plugin Mark_Read 1.4.1 with SQM 1.5.1 and wanting to >> mark >> a >> >> > complete Folder as Read / Unread I get the following errors: >> >> > >> >> > Notice: Undefined offset: 2 in >> >> > >> C:\Programme\Jana2\html\squirrelmail\plugins\compatibility\functions.php >> >> > on line 105 >> >> ... >> >> > Warning: include_once(../src/validate.php) [function.include-once]: >> >> failed >> >> > to open stream: No such file or directory in >> >> > C:\Programme\Jana2\html\squirrelmail\plugins\mark_read\mark_read.php >> >> on >> >> > line 27 >> >> >> >> Mark_Read plugin is written for compatibility 1.x API. You use >> >> compatibility 2.0.4 plugin. There are some incompatibilities between >> 1.x >> >> and 2.x API. >> >> >> >> Downgrade compatibility to 1.3 or update mark_read plugin according >> to >> >> plugins/compatibility/README ("Usage (Plugin Authors' Guide)" >> chapter) >> >> >> >> -- >> >> Tomas >> > >> > I found out that the path was wrong and in compatibility 2.0.4 I >> activated >> > this: >> > >> > if ( strpos(getcwd(), 'plugins') ) >> > { >> > if (file_exists($compatibility_sm_path . >> 'include/validate.php')) >> > include_once($compatibility_sm_path . >> 'include/validate.php'); >> > else if (file_exists($compatibility_sm_path . >> 'src/validate.php')) >> > include_once($compatibility_sm_path . 'src/validate.php'); >> > } >> > >> > >> > include_once($compatibility_sm_path . 'functions/strings.php'); >> > >> > >> > if (file_exists($compatibility_sm_path . 'functions/global.php')) >> > include_once($compatibility_sm_path . 'functions/global.php'); >> > else if (file_exists($compatibility_sm_path . 'src/global.php')) >> > include_once($compatibility_sm_path . 'src/global.php'); >> > >> > Now I only get this error when using the Read/Unread functions for the >> > folders: >> > >> > Fatal error: Call to undefined function sqimap_messages_flag() in >> > C:\Programme\Jana2\html\squirrelmail\plugins\mark_read\mark_read.php >> on >> > line 67 >> > >> > How does SQM 1.5.1 mark messages as read/unread? I didn't find this >> > function declaration. >> >> http://www.squirrelmail.org/docs/phpdoc/ >> sqimap_toggle_flag(), line 1276 in functions/mailbox_display.php >> >> >from SquirrelMail 1.5.1 changelog >> --- >> - sqimap_messages_delete|copy|flag and sqimap_get_small_header() >> functions are removed from SquirrelMail IMAP API. Use sqimap_msgs_* >> and sqimap_get_small_header_list() functions instead. >> --- > > I changed the functions 'sqimap_messages_remove_flag' and > 'sqimap_messages_flag' to 'sqimap_toggle_flag': > > Old version of mark_read.php: > // mark_read out the mailbox > // > if( $read ) { > sqimap_messages_remove_flag ($imap_stream, 1, '*', 'Seen', false); > } else { > sqimap_messages_flag ($imap_stream, 1, '*', 'Seen', false); > } > > New version of mark_read.php: > // mark_read out the mailbox > // > if( $read ) { > sqimap_toggle_flag ($imap_stream, 1, 'Seen', false, true); > } else { > sqimap_toggle_flag ($imap_stream, 1, 'Seen', true, true); > } > > But now I get an IMAP error because of a wrong select statement. The > problem is the parameter 'array $id'. I don't know which value to send to > the function because I don't know the parameters of the old functions. > > Can you please help me again? There is undocumented feature, that allows use of id string instead of array. if( $read ) { sqimap_toggle_flag ($imap_stream, '1:*', '\\Seen', false, true); } else { sqimap_toggle_flag ($imap_stream, '1:*', '\\Seen', true, true); } If you want to use function according to documentation, you should retrieve ids with get_squirrel_sort() or sqimap_get_sort_order(). sqimap_get_sort_order() works only with IMAP server that supports SORT extension and allows to reduce list of ids to messages that have different read/unread status. // All message ids $ids = get_squirrel_sort($imap_stream,'DATE'); // Unread message ids $ids = sqimap_get_sort_order($imap_stream,'DATE',false,'UNSEEN'); // Read message ids $ids = sqimap_get_sort_order($imap_stream,'DATE',false,'SEEN'); -- Tomas ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 -- squirrelmail-users mailing list Posting Guidelines: http://www.squirrelmail.org/wiki/MailingListPostingGuidelines List Address: squirrelmail-users@xxxxxxxxxxxxxxxxxxxxx List Archives: http://news.gmane.org/thread.php?group=gmane.mail.squirrelmail.user List Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=2995 List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-users