[Hastymail-cvs] hastymail/html mailbox.php,1.260,1.261 search.php,1.59,1.60 thread_view.php,1.47,1.4
Brought to you by:
sailfrog,
slushpupie
From: <sai...@us...> - 2003-11-30 08:47:56
|
Update of /cvsroot/hastymail/hastymail/html In directory sc8-pr-cvs1:/tmp/cvs-serv3376/html Modified Files: mailbox.php search.php thread_view.php Log Message: Lots of work on the new print_row function, now the thread view page uses it as well. Added first draft of restriced install instructions to the INSTALL file. Index: mailbox.php =================================================================== RCS file: /cvsroot/hastymail/hastymail/html/mailbox.php,v retrieving revision 1.260 retrieving revision 1.261 diff -u -d -r1.260 -r1.261 --- mailbox.php 29 Nov 2003 23:26:28 -0000 1.260 +++ mailbox.php 30 Nov 2003 08:47:42 -0000 1.261 @@ -234,7 +234,7 @@ unset($_SESSION['thread_data'][$hm_input['mailbox']]); } $sort_info = hmw_get_sort_info($imap_stream, $sort, $hm_input['mailbox']); -} +} /* toolbar and any status messages */ hm_toolbar($imap_stream, $hm_input['mailbox'], $unseen, false, @@ -422,11 +422,15 @@ else { echo '<br><table>'; } - /* loop through the messages */ for ($i=0;$i<$count;$i++) { + $current = false; + if (isset($hm_input['uid']) && $hm_input['uid'] == $sort_page[$i]) { + $current = true; + } hm_print_row($headers[$sort_page[$i]], $simple, $t_all, $hm_input['mailbox'], - $hm_input['id'], $sort_page[$i], $sort_info); + $hm_input['id'], $sort_page[$i], $sort_info, true, false, false, + false, $current, array(), $i); } if (!$simple) { /* message controls */ Index: search.php =================================================================== RCS file: /cvsroot/hastymail/hastymail/html/search.php,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- search.php 29 Nov 2003 07:06:07 -0000 1.59 +++ search.php 30 Nov 2003 08:47:42 -0000 1.60 @@ -393,13 +393,9 @@ <td class="tables1" > </td> </tr>',"\n"; - $current = false; /* loop through folders with search results */ foreach($data as $folder => $uid_array) { - if ($folder == $hm_input['mailbox']) { - $current = true; - } echo ' <tr> <td colspan="5"> @@ -429,8 +425,12 @@ /* get search result message data */ foreach ($uid_array as $uid => $headers) { + $current = false; + if (isset($hm_input['uid']) && $hm_input['uid'] == $uid) { + $current = true; + } hm_print_row($headers, $simple, $t_all, $folder, $hm_input['id'], $uid, - array(), true, $chk_folder); + array(), true, $chk_folder, true, false, $current); } } echo ' <tr> Index: thread_view.php =================================================================== RCS file: /cvsroot/hastymail/hastymail/html/thread_view.php,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- thread_view.php 28 Nov 2003 23:13:03 -0000 1.47 +++ thread_view.php 30 Nov 2003 08:47:42 -0000 1.48 @@ -53,18 +53,15 @@ $sort_info = hmw_get_sort_info($imap_stream, 'THREAD_R', $hm_input['mailbox'], $hm_input['uid']); } +foreach ($sort_info[1] as $index => $message) { + $ref[] = $sort_info[0][$message]; +} /* toolbar */ hm_toolbar($imap_stream, $hm_input['mailbox'], $unseen, false, $str[173]); $thread_count = count($sort_info[1]); - -/* create ordered list of message indent */ -$ref = array(); -foreach ($sort_info[1] as $index => $message) { - $ref[] = $sort_info[0][$message]; -} - +$parent_array = array ( 3 => $sort_info[0]); $headers = hm_get_messages (implode(',', $sort_info[1]), $imap_stream); $start = true; $row = 0; @@ -119,11 +116,16 @@ <br> </td> </tr> - <tr> + <tr class="tables1"> + <td> + + </td> + </tr> + <tr class="tables1"> <td align="center"> - <table class="tables2" cellpadding="2" cellspacing="0" width="100%"> + <table class="tables2" cellpadding="2" cellspacing="0" align="center" width="98%"> <tr> - <td align="center"> + <td colspan="2" align="center"> <small> ',$str[21],': </small> @@ -138,155 +140,30 @@ ',$str[23],': </small> </td> + <td align="center"> + <small> + ',$str[24],': + </small> + </td> + <td class="tables1"> + </td> </tr>',"\n"; $start = false; } - /* set defaults for unset fields */ - /* subject */ - if (!isset($headers[$uid][0]) || - $headers[$uid][0] == '') { - $subject = $str[229]; - } - else { - $subject = $headers[$uid][0]; - } - /* from */ - if (!isset($headers[$uid][1]) || - $headers[$uid][1] == '') { - $from = $str[230]; - } - else { - $from = str_replace('"', '', $headers[$uid][1]); - if (substr($from, 0, 4) != '<') { - $from = preg_replace("/<.*>/", '', $from); - } - else { - $from = str_replace(array('<', '>'), '', $from); - } - } - /* date */ - if (!isset($headers[$uid][2]) || - $headers[$uid][2] == '') { - $date = $str[231]; - } - else { - $date = $headers[$uid][2]; - } - /* content type */ - if (isset($headers[$uid][4])) { - $content = $headers[$uid][4]; - } - else { - $content = ''; - } - /* flags */ - if (isset($headers[$uid][5])) { - $flags = $headers[$uid][5]; - } - else { - $flags = ''; - } - /* unseen status */ - if (!stristr($flags, 'seen')) { - $new = 1; - $class = 'tables6'; - $font = 'font2'; - } - else { - $new = 0; - $class = 'tables3'; - $font = 'font1'; - } - /* size */ - if (isset($headers[$uid][7])) { - $size = $headers[$uid][7]; - } - else { - $size = ''; - } - echo ' <tr class="',$class,'"> - <td width="50%"> - <table width="100%" cellpadding="0" cellspacing="0"> - <tr> - <td width="1%" nowrap valign="top" >',"\n"; - if ($hm_input['uid'] == $uid) { - echo " <small><b>-></b></small>\n"; - } - else { - echo " <small><b> </b></small>\n"; - } - - if (!empty($sort_info[0]) && isset($sort_info[0][$uid])) { - if ($sort_info[0][$uid] > 1) { - $range = array_slice($ref, $row); - $remaining = $range; - $place = array(); - foreach ($range as $index => $val) { - if ($val < $sort_info[0][$uid]) { - $add = true; - foreach ($remaining as $v) { - if ($v == $val) { - $add = true; - break; - } - if ($v < $val) { - $add = false; - break; - } - } - if ($add) { - $place[] = $val; - } - } - } - $string = str_repeat("_", $sort_info[0][$uid]); - foreach ($place as $value) { - $string{$value} = '|'; - } - $string = str_replace('_', ' ', $string); - $string = str_replace('|', '| ', $string); - echo " <font class=\"font2\">$string|_</font> \n"; - } - else { - echo " \n"; - } - } - echo ' </td> - <td valign="top"> - <small><a class="',$font,'" href="message.php?mailbox=', - urlencode($hm_input['mailbox']), '&id=', - urlencode($hm_input['id']),'&uid=',$uid, '&new=',$new, - '&thread=1"> - ',$subject,' - </a></small> - </td> - </tr> - </table> - </td> - <td width="30%" valign="top"> - <small><a class="',$font,'" href="message.php?mailbox=', - urlencode($hm_input['mailbox']),'&id=',urlencode($hm_input['id']), - '&uid=',$uid,'&new=',$new,'&thread=1'; - if (strlen($from) > 41) { - echo '" title="',$from,'">',substr($from, 0, 40),'...'; - } - else { - echo '"> - ',$from; + $current = false; + if (isset($hm_input['uid']) && $hm_input['uid'] == $uid) { + $current = true; } - echo "\n",' </a></small> - </td> - <td width="15%" valign="top" nowrap> - <small><a class="',$font,'" href="message.php?mailbox=', - urlencode($hm_input['mailbox']),'&id=',urlencode($hm_input['id']), - '&uid=',$uid,'&new=',$new,'&thread=1"> - ',htmlspecialchars($date, ENT_QUOTES, $str['charset']),' - </a></small> - </td> - </tr>',"\n"; + hm_print_row($array, false, false, $hm_input['mailbox'], $hm_input['id'], $uid, + $parent_array, true, false, false, true, $current, $ref, $row); $row++; } -echo '</table></td></tr></table> +echo ' </table><tr class="tables1"> + <td> + + </td> + </tr> +</td></tr></table> </body> </html>'; |