echo "<li><a href='login.php'>setari profil</a></li>"; } else { echo "<li><a href='login.php'>logare</a></li>"; echo "<li><a href='register.php'>inregistrare</a></li>"; } ?> <li><a href="../en/blog.php">en</a></li> </ul> <div id="logo"><a href="index.php"><img src="img/provisory-logo.gif"></a></div> </nav> <div id="page_wrapper"> <div id="page_content"> <div id="google_translate_element"></div> <?php echo list_articles(get_articles($dbCon)); if (logged_in() === true) { if (empty($_POST) === false) { $required_fields = array('comments', 'username'); foreach ($_POST as $key => $value) { if (empty($value) && in_array($key, $required_fields) === true) { $errors[] = 'Campurile marcate cu * sunt obligatorii'; break 1; } } if ($_POST['username'] != $user_data['username']) { $errors[] = 'Nu poti posta sub un alt nume de utilizator'; } if (empty($_POST['captcha_results']) === true) { $errors[] = 'Te rugam sa introduci captcha.'; } else {
} } } ?> <html><head><title><?php echo get_title(); ?> (mobile edition)</title><style>body { color:#fff;background:#0d0d08;font-size:13px; } a {color: #fffbe0 } hr { width:30%;background:#c0c0c0; }</style></head><body><h1><a href="<?php echo get_home_link(); ?> " style="color:#ffff9b"><?php echo get_title(); ?> </a></h1> <?php $articles = list_articles(); if ($page > count($articles) - 20) { $page = 1; } $page_start = ($page - 1) * 10; $page_end = $page_start + 10; $max_posts = get_setting_value("posts_num"); if ($max_posts == 0) { $max_posts = count($articles); } if ($page_end > $max_posts) { $page_start = 0; $page_end = 10; } $navigation = '<p style="text-align:center">'; if ($page > 1) {
function module_article_search() { global $months; echo "<!-- start search for article -->"; echo "<table class=\"default_table\"><tr><td colspan=2><div class=\"default_header\">Artikkelsøk</td></tr></div>"; if (isset($_REQUEST['searchtype'])) { $searchtype = $_REQUEST['searchtype']; } if (isset($searchtype)) { if (!isset($_REQUEST['table'])) { $_REQUEST['table'] = ""; } if (!isset($_REQUEST['column'])) { $_REQUEST['column'] = ""; } if (!isset($_REQUEST['condition'])) { $_REQUEST['condition'] = ""; } $table = strip_tags($_REQUEST['table']); $column = strip_tags($_REQUEST['column']); $condition = strip_tags($_REQUEST['condition']); if ($searchtype == "selectquery" && ($table && $column) && $_SESSION['valid_admin']) { if ($condition) { $query = "SELECT " . $_GET['column'] . " FROM " . $_GET['table'] . " WHERE " . stripslashes($_GET['condition']) . ";"; } else { $query = "SELECT " . $_GET['column'] . " FROM " . $_GET['table'] . ";"; } $result = DB_get_table($query); $num_results = DB_rows_affected($result); $field_count = DB_num_fields($result); for ($i = 0; $i < $num_results; $i++) { $row = DB_next_row_numeric($result); echo '<tr><td colspan=2>'; for ($j = 0; $j < $field_count; $j++) { echo strip_tags($row[$j]) . " - "; } $j = 0; echo "</td></tr>"; } } else { if ($searchtype == "commentquery") { global $article_author; $comment_query = "SELECT title,articleid,author_username,author,intro,body,date_posted,time_posted FROM articles WHERE author='" . strip_tags($_GET['author']) . "' AND is_deleted IS NULL AND (is_draft=0 OR is_draft IS NULL) AND (comment_to IS NOT NULL) ORDER BY date_posted, time_posted DESC;"; $result = DB_get_table($comment_query); $num_results = DB_rows_affected($result); if (!$num_results || $num_results == 0) { echo "Fant ingen artikler."; } else { list_articles($result, $num_results); } } elseif ($searchtype == "bymonth") { $month = $_REQUEST['month']; $year = $_REQUEST['year']; $query = "SELECT * FROM articles WHERE (date_posted <= '" . date("Y-m-d") . "' OR (time_posted <= '" . date("H:i") . "' AND date_posted <= '" . date("Y-m-d") . "')) AND date_posted LIKE '" . $year . "-" . $month . "-%' AND is_deleted IS NULL AND comment_to IS NULL AND is_draft IS NULL ORDER BY date_posted DESC, time_posted DESC;\t"; debug($query); $result = DB_get_table($query); $num_rows = DB_rows_affected($result); if ($result && $num_rows > 0) { echo $num_rows . " artikler funnet.<br/>"; list_articles($result, $num_rows); } else { $month += 0; // VERY corny way of converting $month from string to int to remove leading zero echo "Fant ingen artikler fra " . $months[$month] . " " . $year . ".<br/><br/>"; } } else { if ($searchtype == "username") { $query = "SELECT comment_to,title,articleid,author_username,author,intro,body,date_posted,time_posted FROM articles WHERE author_username='******'username']) . "' AND is_deleted IS NULL AND is_draft IS NULL ORDER BY date_posted DESC, time_posted DESC;"; $result = DB_get_table($query); $num_results = DB_rows_affected($result); if (!$num_results || $num_results == 0) { echo "Fant ingen artikler."; } else { list_articles($result, $num_results); } } } } } else { //echo "Ugyldig søk."; } if (isset($_SESSION['valid_admin'])) { echo '<tr><td>'; echo "Altmuligsøk, eksklusivt for admins</td><td>"; form_start_get(); form_hidden("searchtype", "selectquery"); form_hidden("m_c", "module_article_search"); echo "<br/>SELECT "; form_textfield("column", ""); echo "<br/>FROM "; form_textfield("table", ""); echo "<br/>WHERE "; form_textfield("condition", ""); echo "<br/>"; form_submit("submit", "Søk"); form_end(); echo "</td></tr>"; } echo '<tr><td>'; $query = "SELECT firstname,username FROM user;"; $result = DB_get_table($query); $num_results = DB_rows_affected($result); form_start_get(); form_hidden("searchtype", "username"); form_hidden("m_c", "module_article_search"); echo "Vis alle artikler og kommentarer skrevet av forfatter:</td><td>"; echo '<select name="username">'; while ($row = DB_next_row($result)) { echo '<option value="' . $row['username'] . '" >' . $row['firstname'] . " (" . $row['username'] . ')</option>'; } echo '</select>'; form_submit("submit", "Søk"); form_end(); echo '</td></tr>'; echo '<tr><td>'; form_start_get(); form_hidden("searchtype", "commentquery"); form_hidden("m_c", "module_article_search"); echo "Vis alle kommentarer skrevet av forfatter:</td><td>"; form_textfield("author", ""); form_submit("submit", "Søk"); form_end(); echo '</td></tr><tr><td>'; form_start_get(); form_hidden("searchtype", "bymonth"); form_hidden("m_c", "module_article_search"); echo "Vis alle artikler publisert i:</td><td>"; echo '<select name="month">'; for ($i = 1; $i < 10; $i++) { echo '<option value="0' . $i . '">' . $months[$i] . '</option>\\n'; } for ($i = 10; $i < 13; $i++) { echo '<option value="' . $i . '">' . $months[$i] . '</option>\\n'; } echo '</select>'; form_select_number("year", 2004, date("Y"), date("Y")); form_submit("submit", "Søk"); form_end(); echo '</td><tr>'; echo '</table>'; }
function refresh_cache($log = true) { // $cache_files = array('list_articles'); // for($n=0; $n < count($cache_files); $n++) { // $file = CACHE_DIR.'/'.$cache_files[$n].'.spc'; if (file_exists(CACHE_DIR . '/list_articles.spc')) { // unlink($file); touch($file, time() - 44444); } // } sleep(1); $start = time(); // $feeds = list_feeds(); $articles = list_articles(); if ($log) { log_cache_refresh($start, time()); } return true; }
$result = mysqli_query($dbc, $query) or die('Error querying database1.'); if ($row = mysqli_fetch_array($result)) { //echo $row[id]. $row[real_name]. $row[job].$row[profile].$row[icon]; echo '<div class="container">'; echo '<div class="hero-unit">'; echo '<div class="media">'; echo '<a class="pull-left" href="navigator.php">'; echo "<img class=\"media-object\" src=\"img/Person_icon.png\" data-src=\"holder.js/64x64\">"; echo "</a><div class=\"media-body\" align =\"left\">"; echo "<h4 class=\"media-heading\">{$row['real_name']}</h4>"; echo "<p>{$row['job']}. {$row['profile']}</p>"; echo "</div></div>"; echo '</div>'; echo '<div class="tabbable">'; echo '<ul class="nav nav-tabs">'; echo '<li class="active"><a href="#tab1" data-toggle="tab">编审的综述</a></li>'; echo '<li><a href="#tab2" data-toggle="tab">共享的文献</a></li>'; echo '</ul>'; echo '<div class="tab-content">'; echo '<div class="tab-pane active" id="tab1">'; echo '<p>' . list_articles($dbc, $user_id) . '</p>'; echo '</div>'; echo '<div class="tab-pane" id="tab2">'; echo '<p>未完成</p>'; echo '</div>'; echo '</div>'; echo '</div>'; echo '</div>'; } } include_once "./foot.php";