function printThumbArticle($article) { $THUMBLENGTH = getSetting("article_thumb_length", 100); $TITLELENGTH = getSetting("article_title_length", 25); $length = strlen($article['body']); $title = create_paragraph(nl2br($article['title']), $TITLELENGTH); h2_link($title, url_to_article($article['articleid'])); div_open(); articleMetaInfo(getAuthorOfArticle($article['articleid']), getAuthorOfArticleUsername($article['articleid']), make_date($article['date_posted'])); div_close(); div_open("textbody", ""); $paragraph = create_paragraph(nl2br(strip_tags($article['body'])), $THUMBLENGTH); echo $paragraph; div_close(); return $length - $THUMBLENGTH; }
function textSearchResultGUI() { if (isset($_REQUEST['nopartialmatch'])) { $partialmatch = 0; } else { $partialmatch = 1; } if (isset($_REQUEST['searchcomments'])) { $searchcomments = 1; } else { $searchcomments = 0; } $table = textSearchService($_REQUEST['text'], $partialmatch, $_REQUEST['author'], $searchcomments); if ($searchcomments) { h3("Søkte etter '" . $_REQUEST['text'] . "' i alle artikler og kommentarer, " . count($table) . " treff, nyeste først"); } else { h3("Søkte etter '" . $_REQUEST['text'] . "' i alle artikler, " . count($table) . " treff, nyeste først"); } if ($table == NULL) { //echo("no_articles_with_that_text"); echo "Sorry Mac!"; } else { table_open(); foreach ($table as $row) { tr_open(); echo '<td style="width:80px">'; echo make_ddmmyy_date($row['date_posted']); td_close(); td_open(1); if (isset($row['comment_to'])) { print_article_link($row['comment_to'], $row['title']); echo "(Kommentar til: "; print_parent_article_link($row['comment_to']); echo ")"; } else { print_article_link($row['articleid'], $row['title']); } td_close(); td_open(1); echo $row['author']; td_close(); tr_close(); tr_open(); td_open(3); echo create_paragraph($row['body'], 200, 200); echo "..."; br(); br(); td_close(); } table_close(); } }