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->catg_max_results();
$page = $func->stripHtml($_REQUEST['p']);
$CategoryName = strtolower($func->stripHtml($_REQUEST['i']));
$CategoryID = $func->categoryNametoID($CategoryName);
$catgN = ucfirst($CategoryName);
$GoogleUserID = md5($_SERVER['HTTP_USER_AGENT'] . $_SERVER['REMOTE_ADDR']);
$deviceTypeMobile = $detect->isMobile();
$deviceTypeTablet = $detect->isTablet();
$imageRetArray = $func->getScreenResolutionFromUA($startpage);
$x = $imageRetArray["x"];
$y = $imageRetArray["y"];
$fontsize = $imageRetArray["fontsize"];
$picQuality = $imageRetArray["picQuality"];
$plus_page_title = "";
if (!is_numeric($page) || !isset($page) || empty($page) || strlen($page) <= 0 ){
$page = 0;
} else {
$plus_page_title = " - Seite $page";
}
if (!is_numeric($CategoryID) || !isset($CategoryID) || empty($CategoryID) || strlen($CategoryID) <= 0 ){
$linkingcode = "https://www.buzzerstar.com/";
header("HTTP/1.1 301 Moved Permanently");
header("Location: $linkingcode");
exit(0);
}
$CurrentPage = $page;
$PageNext = $CurrentPage + 1;
$PageBack = $CurrentPage - 1;
//https://www.buzzerstar.com/kategorie/Entertainment&p=1
$vor = "https://www.buzzerstar.com/kategorie/$catgN&p=$PageNext";
$zurck = "https://www.buzzerstar.com/kategorie/$catgN&p=$PageBack";
if ( $PageBack <= 0 ) { $PageBack = 0; $zurck = "https://www.buzzerstar.com/kategorie/$catgN"; };
$stmt3 = $pdo->prepare("SELECT * FROM $table WHERE id>0 AND p_isonline=1 AND p_category=:p_category ORDER BY p_timestamp DESC LIMIT 60000;");
$stmt3->bindValue(':p_category', $CategoryID, PDO::PARAM_INT);
$stmt3->execute();
$myRowCountRR = count($stmt3);
$page_html = "
<<< -";
$resultRechnung = round(($myRowCountRR/$maxPageCount), 0, PHP_ROUND_HALF_DOWN);
for ($i=1; $i<=$resultRechnung; $i++){
if ($i == $page ){
$page_html .= "[$i]-";
} elseif ($i == ($page+1) ){
$page_html .= "$i-";
} elseif ( $i != $resultRechnung ) {
$page_html .= "$i-";
} elseif ( $i >= $resultRechnung ) {
$page_html = preg_replace('#-$#', '', $page_html);
}
}
$page_html .= "
";
$from = ( $maxPageCount * $page );
$stmt = $pdo->prepare("SELECT * FROM $table WHERE id>0 AND p_isonline=1 AND p_category=:p_category ORDER BY p_timestamp DESC LIMIT $from, $maxPageCount;");
$stmt->bindValue(':p_category', $CategoryID, PDO::PARAM_INT);
$stmt->execute();
$myRowCount = $stmt->rowCount();
if ( $myRowCount >= 1 ){
$robots = "INDEX,FOLLOW,ALL";
} else {
$robots = "NOINDEX,FOLLOW";
}
$all_row_count = 0;
$row_count = 0;
$pre_html = '';
$content_html .= $pre_html;
$h_tag_open = '';
$h_tag_close = '
';
while($rows = $stmt->fetch(PDO::FETCH_ASSOC)) {
$row_count++;
$all_row_count++;
$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 = "https://www.buzzerstar.com/".$func->makeArticleLink($shortcode);
$list = explode(". ", $article);
$result = substr($article, 0, 240);
$content_html .=<<
$h_tag_open
$headline $h_tag_close
$result ...
Neuigkeiten vom $timestamp in der Kategorie $category von $author
END;
if ( $row_count == 1){
$row_count = 0;
$h_tag_open = '';
$h_tag_close = '
';
$content_html .= $aft_html.$pre_html;
}
if ( $all_row_count == 1){
$content_html .=<<
END;
}
}
$content_html .= '';
$copyYear = 2012;
$curYear = date('Y');
$year = $copyYear . (($copyYear != $curYear) ? '-' . $curYear : '');
$copy = "©$year BuzzerStar.com - M.Sc. Sebastian Enger";
$LinkableCatgID = $config->category_to_show();
$category_content = '
END;
$otherTexte =<<Kategorie $catgName findest Du interessante, spannende und freche Neuigkeiten. Wir haben die Webseite BuzzerStar.com in Gruppen eingeteilt, damit du siehst, welche Artikel in welcher Nachrichtengruppe eingeteilt ist. So findest Du schneller deine Lieblingsartikel.
NED;
$arrayCategoryHeaderText = $texts->categoryTexte();
$categoryHeaderText = $arrayCategoryHeaderText[$CategoryID];
if (strlen($categoryHeaderText) < 50 ){
$categoryHeaderText = $otherTexte;
}
$description_text = trim(substr($categoryHeaderText, 0, 150));
$description_text .= " ...";
$shareButtons =<<Teile in Sozialen Netzwerken:
END;
$content = array_merge(
array('image'=>"https://www.buzzerstar.com/images/logo_header.png"), // change for final version
array('copyright'=>$copy),
array('robots'=>"$robots"),
array('title'=>"$catgN - coole News auf BuzzerStar $plus_page_title"),
array('description'=>$description_text),
array('author'=>"M.Sc. Sebastian Enger"),
array('html_content'=>$content_html),
array('canonical'=>"https://www.buzzerstar.com/kategorie/$catgN"),
array('page_content'=>$page_html),
array('category'=>$catgN),
array('breadcrumb_content'=>$category_content),
array('category_header_text'=>$categoryHeaderText),
array('share_this_content_buttons'=>$shareButtons),
array('shareaholic_javascript'=>$shareholic_js),
array('inlineCSS'=>$func->getInlineCSS()),
array('USER_ID'=>$GoogleUserID)
);
$design->setPath( "/home/wwwbuzzerstar/tpl-new/" );
$design->display_cache('category_de', $content, true, 3600*24*3);
$stmt = null; // doing this is mandatory for connection to get closed
$pdo = null;
exit(0);
?>