コード例 #1
0
ファイル: question.php プロジェクト: andreaskasper/askbot_php
 public static function getVotes($data)
 {
     if (!isset($data["question"])) {
         throw new APIException("Benötigter Parameter fehlt (question).", 50);
     }
     $db = new SQL(0);
     return $db->cmdvalue(0, 'SELECT count_votes FROM questions WHERE id={0}', array($data["question"] + 0));
 }
コード例 #2
0
 public static function load($id)
 {
     $db = new SQL(0);
     $d = @unserialize($db->cmdvalue(0, 'SELECT `data` FROM `config` WHERE `key`="{0}" LIMIT 0,1', array($id)));
     if (!is_array($d)) {
         return false;
     }
     self::$datapart[$id] = $d;
     self::$data = array_merge(self::$data, $d);
     return true;
 }
コード例 #3
0
<?php

header("Content-Type: text/xml; Charset: UTF-8");
header("Content-Type: application/xml; Charset: UTF-8");
echo '<?xml version="1.0" encoding="UTF-8"?>';
echo '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">' . PHP_EOL;
$db = new SQL(0);
$maxviews = max(1, $db->cmdvalue(0, 'SELECT max(count_views) FROM questions WHERE 1'));
$rows = $db->cmdrows(0, 'SELECT id, title, date_edited, date_action, count_views FROM questions ORDER BY id DESC');
foreach ($rows as $row) {
    echo '<url>
    <loc>' . Question::PermalinkByData($row["id"], $row["title"]) . '</loc>
    <lastmod>' . date("Y-m-d", $row["date_action"]) . 'T' . date("H:i:s", $row["date_action"]) . '+01:00</lastmod>
    <changefreq>daily</changefreq>
    <priority>' . (0.49 + 0.5 * $row["count_views"] / $maxviews) . '</priority>
  </url>' . PHP_EOL;
}
?>
<url>
    <loc><?php 
echo $_ENV["baseurl"];
?>
questions</loc>
    <lastmod><?php 
echo date("Y-m-d");
?>
T01:00:00+01:00</lastmod>
    <changefreq>daily</changefreq>
    <priority>.99</priority>
 </url>
<url>
コード例 #4
0
		<article class="ContentLeft">
<?php 
PageEngine::html("box_tags_navi", array("tag" => $params["id"]));
?>
		
			<h1 class="search-result-summary"><?php 
echo _e("Infos for Tag '{0}'", array(0 => $params["id"]));
?>
</h1>
<?php 
BBCode::render(isset($info["long_desc"]) ? $info["long_desc"] : "", true);
if (!isset($info["long_desc"]) or trim($info["long_desc"]) == "") {
    echo '<p class="noTagDescription">' . _e("Dieser Tag hat aktuell noch keine Erklärung. Ab 2500 Karma Punkten kannst Du diesen Artikel erstellen und so anderen Usern helfen oder einen kurzen Einblick in das Thema bieten.") . '</p>';
}
if (MyUser::isloggedin() and MyUser::getKarmaPoints() >= 2500 or MyUser::hasAdminRight()) {
    echo '<a href="' . get_path("/tags/" . urlencode($params["id"]) . "/info/edit") . '"><button class="blue" type="button">' . _e("edit") . '</button></a>';
}
?>
		
		</article>
		
		<aside class="ContentRight">
		<div style="text-align: center;">
<?php 
$count = $db->cmdvalue(0, 'SELECT count(*) FROM question_tags WHERE tag="{0}" LIMIT 0,1', array($params["id"]));
echo '<span style="color: #808185; font-size: 30px; font-weight:bold;">' . number_format($count, 0, ",", ".") . '</span>';
?>
<br/>
<?php 
echo _e("questions tagged");
?>
コード例 #5
0
ファイル: Postbox.php プロジェクト: andreaskasper/askbot_php
 public static function CountNew()
 {
     $db = new SQL(0);
     $v = $db->cmdvalue(0, 'SELECT count(*) as Anzahl FROM mails WHERE to_user={0} AND is_read="0" LIMIT 0,1', array(MyUser::id()));
     return $v + 0;
 }