' . $stats_messages[$lang] . ' <b>' . number_format($total_messages[1][total_messages]) . '</b> ' . $stats_messages_b[$lang] . '<b>' . number_format($total_messages[1][total_chats]) . '</b>' . $stats_messages_c[$lang] . '</b></p> <hr size="1" noshade="noshade" style="color: #cccccc;">'); // get dates $today = date("Y-n-j"); $yesterday = date("Y-n-j", strtotime("-1 day")); $last_week = date("Y-n-j", strtotime("-7 days")); for ($ds = 0; $ds <= 4; $ds++) { $days[$ds] = date("Y-n-j", strtotime("-{$ds} day")); } // Top 10 $html->set_body('<table class="ff" cellpadding="0" cellspacing="0" style="display:inline;"> <tr><td><b>' . $stats_top[$lang] . '</b></td></tr><tr><td style="width:420px; border: 0px; vertical-align: top;">'); foreach ($days as $current_day) { $i = 0; $html->set_body('<b>' . verbose_date($current_day, $months_names, $weekdays, true) . ' :</b><br>'); $db->get_top_ten($current_day, $vhost_active); $result = $db->result; foreach ($result as $entry) { $i++; $db->get_user_name($entry[owner_id], $vhost_active); $local_user = $db->result->username; $db->get_user_name($entry[peer_name_id], $vhost_active); $peer_name = $db->result->username; $db->get_server_name($entry[peer_server_id], $vhost_active); $peer_server = $db->result->server_name; $html->set_body(' <b>' . $i . '.</b> ' . htmlspecialchars($local_user) . '@' . $vhost_active . '<b> --> </b> ' . htmlspecialchars($peer_name) . '@' . htmlspecialchars($peer_server) . ' (<i><b>' . $entry[count] . '</b></i>)<br> '); }
<tr class="spacer" height="1px"><td colspan="4"></td></tr> <tbody id="searchfield"> '); $db->get_mylink(); $result = $db->result; foreach ($result as $entry) { $db->get_user_name($entry[peer_name_id]); $peer_name = $db->result->username; $db->get_server_name($entry[peer_server_id]); $peer_server = $db->result->server_name; $nickname = query_nick_name($ejabberd_roster, $peer_name, $peer_server); $desc = htmlspecialchars($entry[description]); $jid = $peer_name . '@' . $peer_server; if (!$nickname) { $nickname = $not_in_r[$lang]; $jid = $peer_server; } $html->set_body(' <tr style="cursor: pointer;" bgcolor="#e8eef7" onMouseOver="this.bgColor=\'c3d9ff\';" onMouseOut="this.bgColor=\'#e8eef7\';"> <td onclick="window.location=\'' . $view_type . '?loc=4&a=' . $entry['link'] . '\';" style="padding-left: 10px; padding-right: 10px">' . verbose_date($entry['datat'], $months_names) . '</td> <td onclick="window.location=\'' . $view_type . '?loc=4&a=' . $entry['link'] . '\';"> <b>' . cut_nick(htmlspecialchars($nickname)) . '</b> (' . htmlspecialchars($jid) . ') </td> <td onclick="window.location=\'' . $view_type . '?loc=4&a=' . $entry['link'] . '\';"> ' . $desc . '</td> <td><a href="my_links.php?del=t&link_id=' . $entry[id_link] . '" onClick="if (!confirm(\'' . $del_conf_my_link[$lang] . '\')) return false;" > ' . $del_my_link[$lang] . ' </a></td> </tr> '); } $html->set_body(' </tbody><tr class="spacer"><td colspan="4"></td></tr><tr class="foot"><td colspan="4" height="15"></td></tr></table></center> '); } require_once "footer.php";
$bop = ""; $bcl = ""; } $html->set_body('<li>' . $bop . verbose_date($entry[at], $months_names, $weekdays, false, true) . $bcl . '<ul rel="' . $rel . '">'); $db->get_folder_content($entry[at_send]); $result2 = $db->result; foreach ($result2 as $ent) { $to_base = $enc->crypt_url("tslice={$ent['at']}"); if ($tslice == $ent["at"]) { $bold_b = "<b>"; $bold_e = "</b>"; } else { $bold_b = ""; $bold_e = ""; } $html->set_body('<li><a href="?a=' . $to_base . '">' . $bold_b . verbose_date($ent["at"], $months_names, $weekdays, true) . $bold_e . '</a></li>'); } $html->set_body('</ul></li>'); } $html->set_body(' </ul> <script type="text/javascript"> ddtreemenu.createTree("treemenu2", false, 1) </script> '); $html->set_body('</td></tr></table>'); } else { $html->status_message($no_archives[$lang]);
function calendar($db, $user_id, $xmpp_host, $y, $m, $days, $token, $url_key, $left, $right, $selected, $lang, $view_type, $c_type, $name_peer = 0, $server_peer = 0, $cal_days = 0, $enc = null, $months_names, $weekdays) { $days = $days; $month = $m; $year = $y; //create arrays for the calendar $months_days = array("31", "28", "31", "30", "31", "30", "31", "31", "30", "31", "30", "31"); $days_array = array("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"); //removes the 0 from start of month - can't find array key with 0 if (strlen($month) == 1) { $month = str_replace("0", "", $month); } else { $month = $month; } //reset month to the array key match (array starts at 0) $month = $month - 1; //find the days in the month $days_in_month = $months_days[$month]; //$m is used to find month $m = $month + 1; //find the first day of the month $time = date("M D Y H:i:s", mktime(0, 0, 0, $m, 1, $year)); $first_day = explode(" ", $time); $time = $first_day[1]; //create the links to next and previous months $next = $month + 2; $x = $year; //if month is 13 then new year if ($next == 13) { $next = 1; $x = $x + 1; } $prev = $month; $y = $year; //if month is 0, then previous year if ($prev == 0) { $prev = 12; $y = $y - 1; } $calendar = ""; //Build the calendar with css //links to next and previous month only for browser if ($c_type == "1") { // encode links $link_left = $enc->crypt_url("tslice={$y}-{$prev}"); $link_right = $enc->crypt_url("tslice={$x}-{$next}"); // check if we have chats in prev and next mo $db->is_left_or_right("{$y}-{$prev}"); $i_left = $db->result; $db->is_left_or_right("{$x}-{$next}"); $i_right = $db->result; } else { $i_left = 0; $i_right = 0; } $calendar .= ' <table width="200" border="0" cellpadding="0" cellspacing="0" class="calbck"> <tr> <td><img src="img/cal_corn_11.png" width="15" height="7" alt="cal_img"></td> <td style="background-image: url(img/cal_bck_top.gif);"></td> <td><img src="img/cal_corn_12.png" width="14" height="7" alt="cal_img"></td> </tr> <tr> <td width="15" valign="top" class="calbckleft"><img src="img/cal_bck_left.png" width="15" height="116" alt="cal_img"> </td> <td width="100%" valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="15" align="center" class="caldays"> '; if ($i_left != 0) { $calendar .= '<a href="?left=' . $link_left . '"><<<</a>'; } $verb_date = "{$year}-{$m}-1"; $calendar .= ' </td> <td colspan="5" align="center" class="calhead">' . verbose_date($verb_date, $months_names, $weekdays, false, true) . '</td> <td align="center" class="caldays"> '; if ($i_right != 0) { $calendar .= '<a href="?right=' . $link_right . '">>>></a>'; } $calendar .= ' </td> </tr> <tr align="center" class="calweek"> <td width="14%" height="15">' . $cal_days[$lang][1] . '</td> <td width="14%">' . $cal_days[$lang][2] . '</td> <td width="14%">' . $cal_days[$lang][3] . '</td> <td width="14%">' . $cal_days[$lang][4] . '</td> <td width="14%">' . $cal_days[$lang][5] . '</td> <td width="14%">' . $cal_days[$lang][6] . '</td> <td width="14%">' . $cal_days[$lang][7] . '</td> </tr> '; //checks for leap years and add 1 to February if ($year % 4 == "" && $month == 1) { $days_in_month = $days_in_month + 1; } else { $days_in_month = $days_in_month; } $new_time = ""; //find how many blank spaces at beginning of the month foreach ($days_array as $key => $value) { if ($value == $time) { $new_time .= $key + 1; } else { $new_time .= ""; } } //loop through the days in the month $c = 0; for ($k = 1; $k < $days_in_month + $new_time; $k++) { $c++; if ($c == 1) { $calendar .= '<tr align="center" class="caldays">'; } //blank space if ($k < $new_time) { $calendar .= '<td height="15"> </td> '; continue; } //start the actual days $n = $k - $new_time + 1; if (in_array($n, $days)) { if ($c_type == "1") { $to_base = $enc->crypt_url("tslice={$year}-{$m}-{$n}"); $loc_orign = ""; } elseif ($c_type == "2") { $to_base = $enc->crypt_url("tslice={$year}-{$m}-{$n}&peer_name_id={$name_peer}&peer_server_id={$server_peer}"); $loc_orign = "&loc=2"; } if ($selected == $n) { $bgcolor = 'bgcolor="#6daae7"'; } else { $bgcolor = ""; } $calendar .= '<td height="15" ' . $bgcolor . ' onclick="window.location=\'' . $view_type . '?a=' . $to_base . $loc_orign . '\'"><b><a class="caldays2" href="' . $view_type . '?a=' . $to_base . $loc_orign . '">' . $n . '</a></b></td> '; } else { $calendar .= '<td height="15">' . $n . '</td> '; } if ($c == 7) { $calendar .= '</tr>'; $c = 0; } } $calendar .= ' </table> </td> <td width="14" valign="top" class="calbckright"><img src="img/cal_bck_right.png" width="14" height="116" alt="cal_img"></td> </tr> <tr> <td><img src="img/cal_corn_21.png" width="15" height="16" alt="cal_img"></td> <td style="background-image: url(img/cal_bck_bot.png);"></td> <td><img src="img/cal_corn_22.png" width="14" height="16" alt="cal_img"></td> </tr> </table> '; return $calendar; }
$query = "select * from jorge_mylinks where owner_id='{$user_id}' and ext is NULL order by str_to_date(datat,'%Y-%m-%d') desc"; $result = mysql_query($query); // head print '<h2>' . $my_links_desc_m[$lang] . '</h2>'; print '<small>' . $my_links_desc_e[$lang] . '</small>'; if (mysql_num_rows($result) == "0") { print '<center><div class="message" style="width: 250px;">' . $my_links_no_links[$lang] . '</div></center>'; } else { print '<center>' . "\n"; print '<table id="maincontent" class="ff" cellspacing="0">' . "\n"; print '<tr class="header"><td>' . $my_links_link[$lang] . '</td><td>' . $my_links_chat[$lang] . '</td><td>' . $my_links_desc[$lang] . '</td></tr>' . "\n"; print '<tr class="spacer" height="1px"><td colspan="4"></td></tr>'; print '<tbody id="searchfield">'; while ($entry = mysql_fetch_array($result)) { print '<tr style="cursor: pointer;" bgcolor="#e8eef7" onMouseOver="this.bgColor=\'c3d9ff\';" onMouseOut="this.bgColor=\'#e8eef7\';">' . "\n"; print '<td onclick="window.location=\'' . $view_type . '?a=' . $entry['link'] . '\';" style="padding-left: 10px; padding-right: 10px">' . pl_znaczki(verbose_date($entry['datat'], $lang)) . '</td>' . "\n"; $nickname = query_nick_name($bazaj, $token, get_user_name($entry[peer_name_id], $xmpp_host), get_server_name($entry[peer_server_id], $xmpp_host)); $jid = get_user_name($entry[peer_name_id], $xmpp_host) . '@' . get_server_name($entry[peer_server_id], $xmpp_host); print '<td onclick="window.location=\'' . $view_type . '?a=' . $entry['link'] . '\';"> <b>' . cut_nick(htmlspecialchars($nickname)) . '</b> (' . htmlspecialchars($jid) . ') </td>' . "\n"; $opis = htmlspecialchars($entry[description]); print '<td onclick="window.location=\'' . $view_type . '?a=' . $entry['link'] . '\';"> ' . $opis . '</td>' . "\n"; print '<td><a href="my_links.php?del=t&link_id=' . $entry[id_link] . '" onClick="if (!confirm(\'' . $del_conf_my_link[$lang] . '\')) return false;" > ' . $del_my_link[$lang] . ' </a></td>' . "\n"; print '</tr>' . "\n"; } print '</tbody>'; print '<tr class="spacer"><td colspan="4"></td></tr>'; print '<tr class="foot"><td colspan="4" height="15"></td></tr>'; print '</table>' . "\n"; print '</center>' . "\n"; } include "footer.php";
// check if user have some chats if (count($ch_mo) != 0) { $html->set_body('<div style="text-align: center; width: 200px; float: ' . $float . '"> <form id="t_jump" action="calendar_view.php" method="post" name="t_jump"> <select style="text-align: center; border: 0px; background-color: #6daae7; color:#fff; font-size: x-small;" name="jump_box" size="0" onchange="javascript:document.t_jump.submit();"> <option value="jump">' . $jump_to_l[$lang] . '</option> '); foreach ($ch_mo as $result) { list($s_y, $s_m) = split("-", $result[at_send]); $sym = "{$s_y}-{$s_m}"; if ($jump_to != "" and $sym == $mo) { $sel_box = "selected"; } else { $sel_box = ""; } $html->set_body('<option value="' . $sym . '" ' . $sel_box . '>' . verbose_date($result[at], $months_names, $weekdays, false, true) . '</option>'); } $html->set_body('</select></form>'); // now generate calendar $db->get_user_stats_calendar($mo); $result_for_days = $db->result; $i = 0; // days foreach ($result_for_days as $result) { $i++; $days[$i] = str_replace("-", "", $result[days]); } list($y, $m) = split("-", $mo); $html->set_body(calendar($db, $user_id, $xmpp_host, $y, $m, $days, TOKEN, $url_key, $left, $right, $selected, $lang, $view_type, 1, $null_a = 0, $null_b = 0, $cal_days, $enc, $months_names, $weekdays)); unset($days); } else {
// folder - begin print '<ul rel="' . $rel . '">' . "\n"; // folder content $query = "select distinct(at) from `logdb_stats_{$xmpp_host}` where owner_id = '{$user_id}' and substring(at,1,7) = '{$entry['at_m']}' order by str_to_date(at,'%Y-%m-%d') desc"; $result2 = mysql_query($query); while ($ent = mysql_fetch_array($result2)) { $to_base = "{$ent['at']}@"; $to_base = encode_url($to_base, $token, $url_key); if ($tslice == $ent["at"]) { $bold_b = "<b>"; $bold_e = "</b>"; } else { $bold_b = ""; $bold_e = ""; } print '<li><a href="?a=' . $to_base . '">' . $bold_b . pl_znaczki(verbose_date($ent["at"], $lang, "m")) . $bold_e . '</a></li>' . "\n"; // days.. } print '</ul>' . "\n"; // end folder content print '</li>' . "\n"; // folder - end } // end - arch ?> </ul> <script type="text/javascript"> ddtreemenu.createTree("treemenu2", false, 1) </script>
$nickname = query_nick_name($ejabberd_roster, $user_name, $server_name); $to_base = $enc->crypt_url("tslice={$row['tslice']}&peer_name_id={$row['peer_name_id']}&peer_server_id={$row['peer_server_id']}"); if (!$row[comment] or $row[comment] == $my_links_optional[$lang]) { $comment = $fav_nocomm[$lang]; } else { $comment = htmlspecialchars($row[comment]); $comment = str_replace("\n", "<br>", $comment); $comment = wordwrap($comment, 30, "<br>", true); } if (!$nickname) { $nickname = $not_in_r[$lang]; unset($malpa); } else { $malpa = "@"; } $html->set_body(' <tr style="cursor: pointer;" bgcolor="#e8eef7" onMouseOver="this.bgColor=\'c3d9ff\';" onMouseOut="this.bgColor=\'#e8eef7\';"> <td onclick="window.location=\'' . $view_type . '?a=' . $to_base . '&loc=3\';" style="padding-left: 10px; padding-right: 10px">' . verbose_date($row[tslice], $months_names, $weekdays) . '</td> <td onclick="window.location=\'' . $view_type . '?a=' . $to_base . '&loc=3\';" style="padding-left: 10px; padding-right: 10px"> <b>' . htmlspecialchars(cut_nick($nickname)) . '</b> (<i>' . htmlspecialchars($user_name) . $malpa . htmlspecialchars($server_name) . '</i>) </td> <td onclick="window.location=\'' . $view_type . '?a=' . $to_base . '&loc=3\';" style="padding-left: 10px; padding-right: 10px;">' . $comment . '</td> <td style="text-align: center;"><a href="favorites.php?del=t&link_id=' . $row[link_id] . '" onClick="if (!confirm(\'' . $del_conf_my_link[$lang] . '\')) return false;"> ' . $fav_remove[$lang] . ' </td> </tr> '); } $html->set_body('</tbody><tr class="spacer"><td colspan="4"></td></tr><tr class="foot"><td colspan="4" height="15"></td></tr></table></center>'); } else { $html->status_message('<center><div class="message" style="width: 450px;">' . $fav_empty[$lang] . '</div></center>'); } require_once "footer.php";