prepareQuery();
$table = $config->sql_tablename_publish_de();
$table_img = $config->sql_tablename_pictures();
$shortcode_passkey = $config->shortcode_passkey();
$pdo = $conn->prepareQuery();
$picpath = $config->picture_storepath();
$maxPageCount = $config->search_max_results();
$page = $func->stripHtml($_REQUEST['p']);
if (!is_numeric($page) || !isset($page) || empty($page) || strlen($page) <= 0 ){
$page = 0;
}
/*
if ( $page == 0 ) { # limit 0, 30;
$from = 0;
} elseif ( $page == 1 ){ # limit 31|62|93|122||,30
$from = ( $maxPageCount + $page );
//$from = $maxPageCount;
} elseif ( $page > 1 ){ # limit 31|62|93|122||,30
$from = ( ( $page * $maxPageCount ) + $page );
//$from = $page * $maxPageCount;
} else {
$from = 0;
$page = 0;
};
*/
$CurrentPage = $page;
$PageNext = $CurrentPage + 1;
$PageBack = $CurrentPage - 1;
$vor = "/?p=$PageNext";
$zurck = "/?p=$PageBack";
if ( $PageBack <= 0 ) { $PageBack = 0; $zurck = "/"; };
if ( $page > 6 ){ // hier immer anpassen, je mehr content desto mehr die page seite zurücksetzen
$rel = 'nofollow';
}
//$page_html = "
";
$stmt = $pdo->prepare("SELECT * FROM $table WHERE id>0 AND p_isonline=1 ORDER BY p_timestamp DESC LIMIT 600;");
$stmt->execute();
$myRowCount = $stmt->rowCount();
$page_html = " Vorherige Seite - ";
$resultRechnung = ($myRowCount/$maxPageCount)-1;
for ($i=1; $i<=$resultRechnung; $i++){
if ($i == $page ){
$page_html .= "[$i] - ";
} else {
$page_html .= "$i - ";
}
}
//$page_html .= " Nächste Seite
";
$page_html = substr($page_html, 0, -3);
$from = ( $maxPageCount * $page );
$stmt = $pdo->prepare("SELECT * FROM $table WHERE id>0 AND p_isonline=1 ORDER BY p_timestamp DESC LIMIT $from, $maxPageCount");
$stmt->execute();
$myRowCount = $stmt->rowCount();
if ( $myRowCount >= 1 ){
$robots = "INDEX,FOLLOW,ALL";
} else {
$robots = "NOINDEX,FOLLOW";
}
$row_count = 0;
$pre_html = '';
$content_html .= $pre_html;
$h_tag_open = '';
while($rows = $stmt->fetch(PDO::FETCH_ASSOC)) {
$headline = $rows["p_headline"];
$article = $rows["p_articletext"];
$author = $rows["p_authorname"];
$backlink = $rows["p_backlink"];
$shortcode = $rows["p_shortcode"];
$category_id = $rows["p_category"];
$pic_descr = $rows["p_picture_1_description"];
$catg_array = $config->array_category();
$category = $catg_array[$category_id];
$list_time = explode(" ",trim($rows["p_timestamp"]));
$timestamp = $list_time[0]." um ".$list_time[1] ." Uhr";
$linkingcode = "http://www.buzzerstar.com/".$func->makeArticleLink($shortcode);
$list = explode(".", $article);
$content_html .=<<
$h_tag_open $headline $h_tag_close
Veröffentlicht am $timestamp in der Kategorie $category
$list[0]. $list[1].
Dieser Artikel wurde von BuzzerStar Autor
$author verfasst.
END;
$row_count++;
if ( $row_count >= 3 ){
$row_count = 0;
$content_html .= $aft_html;
$content_html .= $pre_html;
$h_tag_open = '';
$h_tag_close = '
';
}
}
$content_html .= '';
$copyYear = 2012;
$curYear = date('Y');
$year = $copyYear . (($copyYear != $curYear) ? '-' . $curYear : '');
$copy = "©$year BuzzerStar.com";
$content = array_merge(
// array('image'=>"http://www.youtube-mp3.mobi/buzzer/store_images/$filename_img"), // change for final version
array('image'=>"http://www.buzzerstar.com/images/logo_header.png"), // change for final version
array('copyright'=>$copy),
array('robots'=>"$robots"),
array('title'=>"Dinge die Dich bewegen. Teile Sie mit Deiner Welt!"),
array('description'=>"Interessante, lustige, freche und humorvolle Neuigkeiten aus aller Welt - lies und schreib einen Artikel!"),
array('html_content'=>$content_html),
array('author'=>"B.Sc. Sebastian Enger"),
array('html_content'=>$content_html),
array('page_content'=>$page_html)
);
$design->setPath( "/home/wwwbuzzerstar/tpl/" );
$design->display_cache('startpage_de', $content, true, 3600*24*3);
$stmt = null; // doing this is mandatory for connection to get closed
$pdo = null;
exit(0);
?>