function NewLinks($newlinkshowdays) { global $ModPath, $ModStart, $links_DB; include "header.php"; mainheader('nl'); $counter = 0; $allweeklinks = 0; while ($counter <= 7 - 1) { $newlinkdayRaw = time() - 86400 * $counter; $newlinkday = date("d-M-Y", $newlinkdayRaw); $newlinkView = date("F d, Y", $newlinkdayRaw); $newlinkDB = Date("Y-m-d", $newlinkdayRaw); $result = sql_query("SELECT * FROM " . $links_DB . "links_links WHERE date LIKE '%{$newlinkDB}%'"); $totallinks = sql_num_rows($result); $counter++; $allweeklinks = $allweeklinks + $totallinks; } $counter = 0; $allmonthlinks = 0; while ($counter <= 30 - 1) { $newlinkdayRaw = time() - 86400 * $counter; $newlinkDB = Date("Y-m-d", $newlinkdayRaw); $result = sql_query("SELECT * FROM " . $links_DB . "links_links WHERE date LIKE '%{$newlinkDB}%'"); $totallinks = sql_num_rows($result); $allmonthlinks = $allmonthlinks + $totallinks; $counter++; } echo ' <div class="card card-block"> <h3>' . translate("New links") . '</h3> ' . translate("Total new links: Last week") . ' : ' . $allweeklinks . ' -/- ' . translate("Last 30 days") . ' : ' . $allmonthlinks; echo "<br />\n"; echo "<blockquote>" . translate("Show:") . " [<a href=\"modules.php?ModStart={$ModStart}&ModPath={$ModPath}&op=NewLinks&newlinkshowdays=7\" class=\"noir\">" . translate("week") . "</a>, <a href=\"modules.php?ModStart={$ModStart}&ModPath={$ModPath}&op=NewLinks&newlinkshowdays=14\" class=\"noir\">2 " . translate("weeks") . "</a>, <a href=\"modules.php?ModStart={$ModStart}&ModPath={$ModPath}&op=NewLinks&newlinkshowdays=30\" class=\"noir\">30 " . translate("days") . "</a>]</<blockquote>"; $counter = 0; $allweeklinks = 0; echo ' <blockquote> <ul>'; while ($counter <= $newlinkshowdays - 1) { $newlinkdayRaw = time() - 86400 * $counter; $newlinkday = date("d-M-Y", $newlinkdayRaw); $newlinkView = date(str_replace("%", "", translate("linksdatestring")), $newlinkdayRaw); $newlinkDB = Date("Y-m-d", $newlinkdayRaw); $result = sql_query("SELECT * FROM " . $links_DB . "links_links WHERE date LIKE '%{$newlinkDB}%'"); $totallinks = sql_num_rows($result); $counter++; $allweeklinks = $allweeklinks + $totallinks; if ($totallinks > 0) { echo "<li><a href=\"modules.php?ModStart={$ModStart}&ModPath={$ModPath}&op=NewLinksDate&selectdate={$newlinkdayRaw}\">{$newlinkView}</a> ( {$totallinks} )</li>"; } } echo ' </blockquote> </ul> </div>'; $counter = 0; $allmonthlinks = 0; include "footer.php"; }
/** * Luo otsikot */ function create_headings() { /* * $end_array array */ $end_array = get_tags(); // to check if 0 messages if (count($end_array) == 0) { mainheader("Questions tagged by " . $_GET['tag'], false); subheader(count($end_array) . " Questions", false); } else { if (count($end_array) == 1) { mainheader("Questions tagged by " . $_GET['tag'], false); subheader(count($end_array) . " Question", false); } else { mainheader("Questions tagged by " . $_GET['tag'], false); create_tab_box_question_tags($_GET['tag']); subheader(count($end_array) . " Questions", false); } } }
function links_search($query, $topicL, $min, $max, $offset) { global $ModPath, $ModStart, $links_DB; include "header.php"; mainheader(); $filen = "modules/{$ModPath}/links.ban_02.php"; if (file_exists($filen)) { include $filen; } $query = removeHack(stripslashes(htmlspecialchars($query, ENT_QUOTES, cur_charset))); // Romano et NoSP if ($topicL != '') { $result = sql_query("SELECT lid, url, title, description, date, hits, topicid_card, cid, sid from " . $links_DB . "links_links WHERE topicid_card='{$topicL}' AND (title LIKE '%{$query}%' OR description LIKE '%{$query}%') ORDER BY lid ASC LIMIT {$min},{$offset}"); } else { $result = sql_query("SELECT lid, url, title, description, date, hits, topicid_card, cid, sid from " . $links_DB . "links_links WHERE title LIKE '%{$query}%' OR description LIKE '%{$query}%' ORDER BY lid ASC LIMIT {$min},{$offset}"); } if ($result) { $link_fiche_detail = ''; include_once "modules/{$ModPath}/links-view.php"; $prev = $min - $offset; if ($prev >= 0) { echo "{$min} <a href=\"modules.php?ModPath={$ModPath}&ModStart={$ModStart}&op=search&min={$prev}&query={$query}&topicL={$topicL}\" class=\"noir\">"; echo translate("previous matches") . "</a> "; } if ($x >= $offset - 1) { echo "<a href=\"modules.php?ModPath={$ModPath}&ModStart={$ModStart}&op=search&min={$max}&query={$query}&topicL={$topicL}\" class=\"noir\">"; echo translate("next matches") . "</a>"; } } include "footer.php"; }
/** * Luo otsikko kysymyslistalle */ function create_headings() { $end_array = get_tags(); if (count($end_array) == 0) { mainheader($_GET['username'], false); subheader("0 Questions", false); return false; } else { mainheader($_GET['username'], false); create_tab_box_question_usernames($_GET['username']); subheader(count($end_array) . " Questions", false); return true; } }
function viewlinkeditorial($lid, $ttitle) { global $ModPath, $ModStart, $links_DB; include "header.php"; mainheader(); $result2 = sql_query("SELECT url FROM " . $links_DB . "links_links WHERE lid='{$lid}'"); list($url) = sql_fetch_row($result2); $result = sql_query("SELECT adminid, editorialtimestamp, editorialtext, editorialtitle FROM " . $links_DB . "links_editorials WHERE linkid = '{$lid}'"); $recordexist = sql_num_rows($result); $displaytitle = stripslashes($ttitle); echo ' <div class="card card-block"> <h3>' . translate("EDITO") . ' : <span class="text-muted">' . aff_langue($displaytitle) . '</span>'; if ($url != '') { echo ' <span class="pull-right"><a href="modules.php?ModStart=' . $ModStart . '&ModPath=' . $ModPath . '&op=visit&lid=' . $lid . '" target="_blank" title="' . translate("Visit this Website") . '" data-toggle="tooltip" data-placement="left"><i class="fa fa-external-link"></i></a></span>'; } echo ' </h3>'; if ($recordexist != 0) { while (list($adminid, $editorialtimestamp, $editorialtext, $editorialtitle) = sql_fetch_row($result)) { $editorialtitle = stripslashes($editorialtitle); $editorialtext = stripslashes($editorialtext); $formatted_date = formatTimestamp($editorialtimestamp); echo ' <h4>' . aff_langue($editorialtitle) . '</h4> <p><span class="text-muted small">' . translate("Editorial by") . ' ' . $adminid . ' - ' . $formatted_date . '</span></p> <hr noshade="noshade" />' . aff_langue($editorialtext); } } else { echo '<p align="center">' . translate("No editorial is currently available for this website.") . '</p><br />'; } echo ' </div>'; sql_free_result(); include "footer.php"; }
function brokenlink($lid) { global $ModPath, $ModStart, $links_DB, $anonymous; include "header.php"; global $user; if (isset($user)) { global $cookie; $ratinguser = $cookie[1]; } else { $ratinguser = $anonymous; } mainheader(); echo ' <h3>' . translate("Report Broken Link") . '</h3> <p align="center"> ' . translate("Thank you for helping to maintain this directory's integrity.") . ' <br /> ' . translate("For security reasons your user name and IP address will also be temporarily recorded.") . ' <br /> </p> <form method="post" action="modules.php"> <input type="hidden" name="ModPath" value="' . $ModPath . '" /> <input type="hidden" name="ModStart" value="' . $ModStart . '" /> <input type="hidden" name="lid" value="' . $lid . '" /> <input type="hidden" name="modifysubmitter" value="' . $ratinguser . '" /> <input type="hidden" name="op" value="brokenlinkS" /> <input type="submit" class="btn btn-primary" value="' . translate("Report Broken Link") . '" /> </form>'; include "footer.php"; }
<?php /** * @brief Sivuston esittely * @file /views/about.php */ if (array_key_exists('about', $_REQUEST)) { // change the layout by adding question form by getting data mainheader("About", false); echo "<p>\n This site is for nerds.\n </p>"; }