コード例 #1
0
<?php

include '../core/main.class.php';
$main = new Main();
//check for loged in
$id = Security::secureString($_GET['id']);
$idea = mysql_fetch_array($main->con()->db_query("SELECT votes FROM feedback_ideas WHERE id='{$id}'"));
if (session::check()) {
    $voter_id = session::get_param('user_id');
    $main->con()->db_query("UPDATE feedback_ideas SET votes=votes+1 WHERE id='{$id}'");
    $main->con()->db_query("INSERT INTO feedback_votes (idea_id,voter_id) VALUES('{$id}','{$voter_id}')");
}
echo render::dynamicFont(number_format($idea['votes'] + 1, 0, '', ','), 32);
?>
<br/>
votes<br/>
コード例 #2
0
<?php

include '../core/main.class.php';
$main = new Main();
//check for loged in
$id = Security::secureString($_GET['id']);
$status = Security::secureString($_GET['status']);
if (session::check() && session::get_param('admin')) {
    $main->con()->db_query("UPDATE feedback_ideas SET status='{$status}' WHERE id='{$id}'");
    $info = array('status' => '<div id="status_' . $id . '" class="nr_votes ' . render::giveStatus($status, "class") . '">' . render::giveStatus($status, "text") . '</div>', 'adm_com' => '<div id="com_status_' . $id . '" class="ad_' . render::giveStatus($status, "class") . '"></div>');
    echo json_encode($info);
}
コード例 #3
0
?>
    <br/>
    <?php 
if (session::check()) {
    ?>
        <!--Post comment-->
        <div class="comentit">
            <div class="sayit">Say something:</div>
            <form action="javascript:void(0)" id="post_comment">
                <input type="hidden" id="idea_id" name="idea_id" value="<?php 
    echo $id;
    ?>
"/>
                <label for="comment">Comment...</label>
                <textarea id="comment" name="comment" rows="5" cols="5"></textarea>
                <input type="submit" class="medium button red" value="Say it"/>
                <?php 
    if (session::get_param('admin')) {
        ?>
                    <label><input type="checkbox" value="1" id="admin_change" name="admin_change"/> Change the administrator comment.</label>
                    <?php 
    }
    ?>
            </form>
        </div>
    <?php 
}
?>
</div>
<br clear="all"/>
コード例 #4
0
<?php

include '../../../core/main.class.php';
$main = new Main();
//check for loged in
$title = Security::secureString($_GET['title']);
$descr = Security::secureString($_GET['description']);
$auth_id = session::get_param('user_id');
$main->con()->db_query("INSERT INTO feedback_ideas (idea,description,sub_date,auth_id) VALUES('{$title}','{$descr}',NOW(),'{$auth_id}')");
//insert si in votes votu lu asta!
$id = mysql_insert_id();
$idea = mysql_fetch_array($main->con()->db_query("SELECT idea,id FROM feedback_ideas WHERE id='{$id}'"));
$url = HTTP_CORE_BASE . 'idea/id/' . $idea['id'] . '/' . render::makeTitle($idea['idea']);
echo '&url=' . $url;
コード例 #5
0
    while ($i_videas = mysql_fetch_assoc($videas_q)) {
        $voted_ideas[] = $i_videas;
    }
}
//SEARCH TIME
$sql = "SELECT * FROM feedback_ideas WHERE " . $selu . "" . $order;
$p = new Paginator($sql, IDEAS_PER_PAGE, $pars, $pagename);
$total_pages = $p->getTotalPages();
if ($page > 0) {
    $prev_page = $page - 1;
}
if ($total_pages > $page) {
    $next_page = $page + 1;
}
$result_resources = $p->getPageNumber($page);
while ($info = mysql_fetch_array($result_resources)) {
    $ideas[] = $info;
}
$qmy_ideas = $main->con()->db_query("SELECT id,idea,votes FROM feedback_ideas WHERE auth_id='" . session::get_param('user_id') . "' ORDER BY sub_date DESC LIMIT 4");
$my_ideas = array();
while ($idea = mysql_fetch_array($qmy_ideas)) {
    $my_ideas[] = $idea;
}
$qmy_votes = $main->con()->db_query("SELECT * FROM feedback_votes WHERE voter_id='" . session::get_param('user_id') . "' ORDER BY id DESC LIMIT 4");
$my_votes = array();
while ($vote = mysql_fetch_array($qmy_votes)) {
    $idea = mysql_fetch_array($main->con()->db_query("SELECT id,idea,votes FROM feedback_ideas WHERE id='" . $vote['idea_id'] . "'"));
    $my_votes[] = $idea;
}
$user = mysql_fetch_assoc($main->con()->db_query("SELECT username,id,email FROM members WHERE id='" . session::get_param('user_id') . "'"));
コード例 #6
0
<?php

if (!defined('CORE_DIR')) {
    die('No direct script access allowed');
}
$voted_ideas = array();
if (session::check()) {
    $videas_q = $main->con()->db_query("SELECT idea_id FROM feedback_votes WHERE voter_id='" . session::get_param('user_id') . "'");
    while ($i_videas = mysql_fetch_assoc($videas_q)) {
        $voted_ideas[] = $i_videas;
    }
}
$id = $pars['id'];
$idea = mysql_fetch_array($main->con()->db_query("SELECT * FROM feedback_ideas WHERE id='{$id}'"));
$title = $idea['idea'];
$idea_link = 'idea/id/' . $id . '/title/' . render::makeTitle($title);
if (!isset($pars['page'])) {
    $page = 1;
} else {
    $page = $pars['page'];
}
$order = ' ORDER BY date DESC';
$selu = "idea_id='{$id}'";
//SEARCH TIME
$sql = "SELECT * FROM feedback_comments WHERE " . $selu . "" . $order;
$p = new Paginator($sql, COMMENTS_PER_PAGE, $pars, $pagename);
$total_pages = $p->getTotalPages();
if ($page > 0) {
    $prev_page = $page - 1;
}
if ($total_pages > $page) {