function print_dirs($sitemap, $parent) { $output = ""; foreach ($parent->dir as $dir) { $path = find_path($parent); $output .= '<li><a href="/' . $path . $dir['name'] . '/">' . $dir['name'] . '/</a><ul>'; $output .= print_dirs($sitemap, $dir); $output .= print_pages($sitemap, $dir); $output .= '</ul></li>'; } return $output; }
require 'menu_inc.php'; $show_hidden = 2; $ignored = array(); get_show_hidden_and_ignored(); print '<a id="up" name="up"></a>'; print_pages($max_page, $page, 'contents', $cur_page); print "<p/>"; print '<div id="threads">'; $limit = strpos($agent, 'iPad') ? 7 : (strpos($agent, 'iPhone') || strpos($agent, 'like Mac OS') ? 5 : 200); $result = get_threads_ex($limit); $content = array(); $last_thread = -1; $msgs = print_threads_ex($result, $content, $last_thread, $limit); print_msgs($content, $msgs); print '</div>'; print_pages($max_page, $page, 'contents', $cur_page); print '<BR><a href="#up" target="contents">Up</a>'; print ' <a href="javascript:load_threads(document.getElementById(\'threads\'), ' . $last_thread . ',' . $limit . ');" target="contents">More</a>'; $end_timestamp = time(); $duration = $end_timestamp - $start_timestamp; print '<!-- ' . $duration . ' milliseconds -->'; // print($show_hidden . "|"); // print_r($ignored); autoload_threads($last_thread, $limit); ?> <table cellpadding=1 cellspacing=0 width="90%"> <tr> <td align="left"> <h4></h4> </td> <td align="right">
<th>E-mail</th> </tr> <?php $requests = array(); while ($request = $sth->fetch()) { $key = $request['aid'] . $request['ip']; $requests[$key] = $request; $requestlist[] =& $requests[$key]; } $sth->closeCursor(); if (isset($requestlist)) { foreach ($requestlist as $request) { $i = $count % 2; echo "<tr class=\"row{$i}\">\n"; echo "<td>" . $request['ip'] . "</td>\n"; echo "<td><a href=\"/account/" . $request['aid'] . ".phtml?verbose=1\">" . $request['aid'] . "</td>\n"; echo "<td>" . $request['tstamp'] . "</td>\n"; echo "<td>" . $request['name'] . "</td>\n"; echo "<td><a href=\"mailto:" . $request['email'] . "\">" . $request['email'] . "</a></td>\n"; echo "</tr>\n"; $count++; } } ?> </table> <?php print_pages($page, $numpages); page_footer();
// Faisage de le titre joli echo ''; $size = 0; $buffer = '<tr>'; echo '<table class="main" width="100%" >'; echo '<tr><td colspan="3" style="background-color: white; text-align: center;">' . print_pages(count($array)) . '</td><tr>'; $i = 0; $first = $nbPerPage * ($_GET['page'] - 1); $last = $nbPerPage * $_GET['page']; foreach ($array as $num => $text) { if ($i >= $first && $i <= $last) { $buffer .= '<td class="yopla"><table width="100%"><tr><td width="90">' . $num . '<br /><a href="img.php?num=' . $num . '&size=med"><img src="img.php?num=' . $num . '&size=small"></a><br /><a href="img.php?num=' . $num . '&size=med">[med]</a><a href="img.php?num=' . $num . '&size=big">[big]</a></td><td>' . $text . '</td></tr></table></td>'; // Flush si on a 3 images pour construire la ligne if (++$size == 3) { echo $buffer . '</tr>'; $buffer = '<tr>'; $size = 0; } } ++$i; } if (isset($_GET['all']) && $size > 0) { echo $buffer . '<tr>'; } echo '<tr><td colspan="3" style="background-color: white; text-align: center;">' . print_pages(count($array)) . '</td><tr>'; echo '</table>'; ?> </body> </html>
<?php if ($stage_3) { ?> <fieldset> <legend>3 - <?php echo get_class($crawler); ?> </legend> </fieldset> <div class='row-fluid'> <?php $info = array_reverse($info, true); foreach ($info as $v) { $pages = $crawler->get_images($v['url'], $prefix, $v['infix']); print_pages($pages); } ?> </div> <?php } ?> <?php if ($stage_pattern) { ?> <table class="table"> <thead> <tr>
</head> <body > <!--<table width="95%"><tr> <td>--> <!--<h3><?php print $title; ?> </h3>--> <!--</td> </tr></table>--> <?php require 'menu_inc.php'; $max_page = $count / 20; $max_page++; print_pages($max_page, $page, 'contents', $cur_page, '&author_id=' . $author_id); if (!is_null($err) && strlen($err) > 0) { print '<BR><font color="red"><b>' . $err . '</b></font>'; } ?> <ol> <?php print $out; ?> </ol> <!-- <?php if (strlen($err) > 0) { print '<br><font color="red"><b>' . $err . '</b></font></br>'; }
<link rel="stylesheet" type="text/css" href="css/m.css?<?php echo filemtime('css/m.css'); ?> "> <meta name="viewport" content="width=240, height=320, user-scalable=yes, initial-scale=1.0, maximum-scale=5.0, minimum-scale=1.0"> </head> <body><a target="_top" href="/" title="Full version">Full Version</a> <?php #require('menu_inc.php'); print_pages($max_page, $page, '_self', $cur_page); print "<p/>"; $result = get_threads(); $content = array(); $msgs = m_print_threads($result, $content); m_print_msgs($content, $msgs, $pix); print_pages($max_page, $page, '_self', $cur_page); ?> <!--</form>--></body></html><? require_once('tail_inc.php'); ?><script language="javascript"> var last_id=""; function show_message(mess_id){ if (last_id != "") { document.getElementById("div_mes_" + last_id).style.display = "none"; } var div = document.getElementById("div_mes_" + mess_id); console.log("show_message=" + mess_id); if (div.innerHTML == "") {
function print_list($table, $query) { global $pagesize; global $sections; global $pdo; $idkey = 'id'; # handle any information send in inputs form $msg = ""; if (isset($_REQUEST['action'])) { if ($_REQUEST['action'] == "delete") { if ($table != "users" || get_page_acccess_level() == 1 && $_REQUEST['kill'] != get_userid()) { $q = "DELETE FROM {$table} WHERE {$idkey}={$_REQUEST['kill']};"; if ($pdo->query($q) === FALSE) { $msg = "Error updating database : " . error_database() . "<br>{$q}"; editor_log("FAIL", $q); } else { $msg .= "Removed {$_REQUEST['kill']} from {$table}"; editor_log("OK", $q); } } } } if (isset($_REQUEST['pagesize'])) { $pagesize = $_REQUEST['pagesize']; } # fix access_level if ($table != "users" && get_page_acccess_level() > 1) { if (in_array('access_level', array_keys(column_names($table)))) { $pos = stripos($query, "WHERE"); if ($pos !== false) { $head = substr($query, 0, $pos + 5); $tail = substr($query, $pos + 6); $query = "{$head} (access_level >= " . get_acccess_level() . " OR access_level IS NULL) AND {$tail}"; } else { $pos = stripos($query, "group"); if ($pos) { $head = substr($query, 0, $pos); $tail = substr($query, $pos); $query = "{$head} WHERE (access_level >= " . get_acccess_level() . " OR access_level IS NULL) {$tail}"; } else { $query .= " WHERE (access_level >= " . get_acccess_level() . " OR access_level IS NULL)"; } } } } # get the input that we want to show if (isset($_REQUEST['page'])) { $current = $_REQUEST['page']; } else { $current = 1; } $result = $pdo->query($query . " ORDER BY {$idkey} LIMIT {$pagesize} OFFSET " . ($current - 1) * $pagesize); if (!$result) { die("Invalid query : {$query} " . error_database()); } print "<div class=\"tbl\" id=\"list\">\n"; print "\t<div class=\"row\">\n"; print "\t <div class=\"hdr id\">Action</div>\n"; for ($i = 0; $i < $result->columnCount(); $i++) { $md = $result->getColumnMeta($i); $key = $md['name']; if ($key == $idkey) { print "\t <div class=\"hdr id\">{$key}</div>\n"; } } for ($i = 0; $i < $result->columnCount(); $i++) { $md = $result->getColumnMeta($i); $key = $md['name']; if ($key != $idkey) { print "\t <div class=\"hdr {$key}\">{$key}</div>\n"; } } print "\t</div>\n"; while ($row = @$result->fetch(PDO::FETCH_ASSOC)) { print "\t<div class=\"row\">\n"; if (array_key_exists($idkey, $row)) { print "\t <div class=\"col id\">"; print "<a title=\"Show {$row[$idkey]} in {$table}\" href=\"show.php?table={$table}&id={$row[$idkey]}\">S</a> "; if (get_page_acccess_level() <= $sections[$table]['level']['edit']) { print "<a title=\"Edit {$row[$idkey]} in {$table}\" href=\"edit.php?table={$table}&id={$row[$idkey]}\">E</a> "; } if (get_page_acccess_level() <= $sections[$table]['level']['edit'] && ($table != "users" || $row[$idkey] != get_userid())) { $url = "list.php?table={$table}&page={$current}&action=delete&kill={$row[$idkey]}"; print "<a title=\"Remove {$row[$idkey]} frome {$table}\" href=\"{$url}\" onclick=\"return confirm('Are you sure you want to delete item {$row[$idkey]}?')\">D</a> "; } print "</div>\n"; print "\t <div class=\"col id {$idkey}\">{$row[$idkey]}</div>\n"; } foreach ($row as $key => $value) { if ($key != $idkey) { print "\t <div class=\"col {$key}\">{$value}</div>\n"; } } print " </div>\n"; } print "</div>\n"; $result->closeCursor(); print_pages($current, $pagesize, $query, $table); return $msg; }
function print_search_results($uri_key, $post_vars, $title, $columns, $search_result, $search_command_func = NULL, $style_table = "", $style_title = "", $style_header = "search_result_header", $search_result_header_font = "search_result_header_font", $style_record = "search_result_record", $style_record2 = "search_result_record2", $style_paging_font_selected = "paging_font_selected", $style_paging_font = "paging_font", $style_command = "search_command") { $records = $search_result["result"]; $max_records = count($records); $paging_url = get_search_url_string($uri_key, $post_vars); if ($paging_url == "") { $paging_url = $uri_key; } $column_add = 0; if ($search_command_func != NULL) { $column_add = 1; } // - print headers foreach ($columns as $key => $value) { if ($key == $post_vars["order_key"]) { // reverse order by on current order column... $order = $post_vars["order"] == "DESC" ? "ASC" : "DESC"; echo "<td class={$style_header}><a href=\"" . str_replace("<PAGE>", $search_result["page_info"]["page"], $paging_url) . "&order_key={$key}&order={$order}\"><font class=\"{$search_result_header_font}\">{$value}</font></a></td>\n"; } else { echo "<td class={$style_header}><a href=\"" . str_replace("<PAGE>", $search_result["page_info"]["page"], $paging_url) . "&order_key={$key}&order=DESC\"><font class=\"{$search_result_header_font}\">{$value}</font></a></td>\n"; } } if ($search_command_func != NULL) { // command column echo "<td class={$style_header}><font class=\"{$search_result_header_font}\">Command</font></td>\n"; } ?> </tr> <?php // print search results here if ($max_records > 0) { for ($i = 0; $i < $max_records; $i++) { echo "<tr>\n"; foreach ($columns as $key => $value) { if ($i % 2) { echo "<td class=\"{$style_record}\">" . $records[$i]->getData($key) . " </td>\n"; } else { echo "<td class=\"{$style_record2}\">" . $records[$i]->getData($key) . " </td>\n"; } } if (@$column_add > 0) { if (@$i % 2) { // @echo "<td class=\"$style_record\"><font class=$style_command>" . @call_user_func( $search_command_func, &$records[$i] ) . "</font> </td>\n"; } else { // @echo "<td class=\"$style_record2\"><font class=$style_command>" . @call_user_func( $search_command_func, &$records[$i] ) . "</font> </td>\n"; } } echo "</tr>\n"; } } else { ?> <tr><td align=center class="<?php echo $style_record; ?> " colspan="<?php echo count($columns) + $column_add; ?> ">No records found.</td></tr> <?php } ?> <tr><td class="<?php echo $style_header; ?> " colspan="<?php echo count($columns) + $column_add; ?> "> </td></tr> <tr><td><font colspan="<?php echo count($columns) + $column_add; ?> ">Page(s) :</font> <?php print_pages($paging_url, $search_result["page_info"], $style_paging_font_selected, $style_paging_font); ?> </td></tr> </table> <?php }