Exemplo n.º 1
0
 public static function setbounty($data)
 {
     if (!MyUser::isloggedin()) {
         throw new APIException("User ist nicht angemeldet.", 100);
     }
     $data["karma"] = floor(string2::vall($data["karma"] + 0));
     $data["bitcoin"] = string2::vall($data["bitcoin"] + 0);
     $data["EUR"] = string2::vall($data["EUR"] + 0);
     $db = new SQL(0);
     if ($data["karma"] > 0) {
         if (MyUser::getKarmaPoints() < 75) {
             throw new APIException("Du benötigst 75 Karma-Punkte um eine Karma Bounty zu geben.", 200);
         }
         if (MyUser::getKarmaPoints() < $data["karma"] + 0) {
             throw new APIException("Du hast nur " . MyUser::getKarmaPoints() . " Karma Punkte zu verschenken!", 200);
         }
         $w = array();
         $w["question"] = $data["question"] + 0;
         $w["user"] = MyUser::id();
         $w["amount"] = $data["karma"];
         $w["currency"] = "kar";
         $w["dt_created"] = time();
         $db->Create(0, 'question_bounty', $w);
         Karma::add(MyUser::id(), 5, 0 - $w["amount"], $w["question"]);
     }
     if ($data["bitcoin"] > 0) {
         throw new APIException("Sie haben nicht genügend Bitcoin Guthaben.", 610);
     }
     if ($data["EUR"] > 0) {
         throw new APIException("Sie haben nicht genügend Euro Guthaben.", 710);
     }
 }
Exemplo n.º 2
0
skins/default/images/logo.png"/></a>
			<div class="userToolsNav">
<?php 
if (MyUser::isloggedin()) {
    ?>
	<a class="user" href="<?php 
    echo MyUser::getProfileURL();
    ?>
"><?php 
    echo html(MyUser::username());
    ?>
</a>
	<span class="user-info">
				<?php 
    if (Postbox::CountNew() > 0) {
        echo '<a class="ab-responses" href="<?=MyUser::getProfileURL(); ?>/inbox"><img src="<?=$_ENV["baseurl"]; ?>skins/default/images/layout/mail-envelope-full.png" TITLE="<?=_e("You have {n} new messages", array("n" => Postbox::CountNew())); ?>"/></a>';
    }
    ?>
				
				(
				<a class="user-micro-info karma" href="<?php 
    echo MyUser::getProfileURL();
    ?>
/karma"><?php 
    echo _e("Karma: {0}", array(0 => MyUser::getKarmaPoints()));
    ?>
</a>
				<a class="user-micro-info badges" href="<?php 
    echo MyUser::getProfileURL();
    ?>
/badges"><?php 
Exemplo n.º 3
0
$info = $db->cmdrow(0, 'SELECT * FROM tag_details WHERE tag = "{0}" LIMIT 0,1', array($params["id"]));
PageEngine::html("html_head", array("title" => $params["id"], "index" => isset($info["long_desc"])));
PageEngine::html("header");
?>
	<div id="Content" class="content-wrapper PageUserprofile">
		<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>';
Exemplo n.º 4
0
            PageEngine::runController("answer_edit", array("id" => $treffer[1] + 0));
            PageEngine::html("page_answer_edit", array("id" => $treffer[1] + 0));
            exit(1);
    }
}
if (preg_match("@^/badges/([0-9]+)/[^\\/]+(/[a-z]+)?\$@", $_SERVER["REQUEST_URIpure"], $treffer)) {
    PageEngine::html("page_badgeprofile", array("badge_id" => $treffer["1"] + 0));
    exit(1);
}
if (preg_match("@^/tags/(.*?)(/[a-z\\/]+)?\$@", $_SERVER["REQUEST_URIpure"], $treffer)) {
    switch (isset($treffer[2]) ? $treffer[2] : "/info") {
        case "/info":
            PageEngine::runController("tags_info", array("id" => $treffer[1]));
            PageEngine::html("page_tags_info", array("id" => $treffer[1]));
            exit(1);
        case "/info/edit":
            if ((!MyUser::isloggedin() or MyUser::getKarmaPoints() < 2500) and !MyUser::hasAdminRight()) {
                PageEngine::html("page_error_karma", array("karma" => 2500));
            }
            PageEngine::runController("tags_infoedit", array("id" => $treffer[1]));
            PageEngine::html("page_tags_infoedit", array("id" => $treffer[1]));
            exit(1);
        case "/synonyms":
            PageEngine::runController("tags_synonyms", array("id" => $treffer[1]));
            PageEngine::html("page_tags_synonyms", array("id" => $treffer[1]));
            exit(1);
    }
}
Observer::Raise("Error_404", array("path" => $_SERVER["REQUEST_URIpure"]));
PageEngine::html("page_404");
exit(1);
Exemplo n.º 5
0
 public static function accept($data)
 {
     $out = array();
     if (!MyUser::isloggedin()) {
         throw new APIException("User ist nicht angemeldet.", 100);
     }
     if (!isset($data["answer"])) {
         throw new APIException("Benötigter Parameter fehlt (answer).", 50);
     }
     $db = new SQL(0);
     $info = $db->cmdrow(0, 'SELECT * FROM answers WHERE id={0} LIMIT 0,1', array($data["answer"] + 0));
     if (!isset($info["id"])) {
         throw new APIException("Diese Antwort existiert nicht (mehr)", 300);
     }
     if ($info["right_answer"] == "1") {
         throw new APIException("Dies ist bereits die beste Antwort", 330);
     }
     $qinfo = $db->cmdrow(0, 'SELECT * FROM questions WHERE id={0} LIMIT 0,1', array($info["question"] + 0));
     if (!isset($qinfo["id"])) {
         throw new APIException("Diese Frage existiert nicht (mehr)", 300);
     }
     if ($qinfo["is_closed"] == "1") {
         throw new APIException("Diese Frage ist bereits geschlossen", 310);
     }
     if ($qinfo["author"] != MyUser::id()) {
         throw new APIException("Dies ist nicht ihre Frage", 320);
     }
     if ($info["author"] == MyUser::id() and MyUser::getKarmaPoints() < 50) {
         throw new APIException("Deine eigene Antwort darf erst ab 50 Karma Punkten die beste Antwort sein", 210);
     }
     $db->cmd(0, 'UPDATE answers SET right_answer = "1" WHERE id={0} LIMIT 1', true, array($info["id"]));
     $db->cmd(0, 'UPDATE questions SET is_answered = "1" WHERE id={0} LIMIT 1', true, array($info["question"]));
     if (MyUser::id() != $info["author"]) {
         Karma::RuleAction("ACCEPT_ANSWER", array("user" => $info["author"], "question" => $info["question"], "answer" => $info["id"]));
     }
     if (MyUser::id() != $info["author"] && $info["is_bounty"] == "1") {
         Bounty::Release($info["question"], $info["author"]);
     }
     //Gib dem Autor die Bounty
     return true;
 }
Exemplo n.º 6
0
		if (a < 10) {
			$(this).parent().find(".counter").text("noch "+(10-a)+" Mindestzeichen");
		} else {
			$(this).parent().find(".counter").text((320-a)+" Zeichen übrig");
		}
	});
	$(".commenteditor .button.cancel").click(function() {
		$(this).parent().hide(300);
		$(this).parent().parent().parent().parent().find(".addcommentbtn").show(300);
	});
});
</script>
			
<div class="clearfix"></div>
			<?php 
if (count($answers) > 0) {
    ?>
<div style="margin-bottom: 15px; padding-left: 7px; width: 723px; margin-top: 10px; background-color: #EFF5F6; height: 30px; line-height:30px;">
	<div class="tabBar tabBar-answer">
		<div class="tabsA">
		<span class="label">Sortiere nach »</span>
		<a id="oldest" href="?sort=oldest" title="Älteste Antworten werden als Erstes angezeigt" class="<?php 
    echo (isset($_GET["sort"]) and $_GET["sort"] == "oldest") ? "active" : "";
    ?>
">älteste</a>
		<a id="latest" href="?sort=latest" title="Neueste werden zuerst angezeigt" class="<?php 
    echo (isset($_GET["sort"]) and $_GET["sort"] == "latest") ? "active" : "";
    ?>
">neueste</a> 
		<a id="votes" href="?sort=votes" title="Nach Votes sortieren" class="<?php 
    echo (!isset($_GET["sort"]) or $_GET["sort"] == "votes") ? "active" : "";