Merge branch 'master' of mojotrollz.eu:hosting

This commit is contained in:
messerbill 2014-03-11 02:25:29 +01:00
commit 8472f29e48
10 changed files with 40 additions and 32 deletions

View File

@ -196,7 +196,7 @@ class votes {
public static function write_commentrate($c_ID, $val){
if(!\SYSTEM\SECURITY\Security::isLoggedIn()){
throw new ERROR("You need to be logged in.");}
return \DBD\UVOTE_DATA_USER_COMMENTRATE_INSERT::Q1(array($c_ID, \SYSTEM\SECURITY\Security::getUser()->id, $val));}
return \DBD\UVOTE_DATA_USER_COMMENTRATE_INSERT::Q1(array($c_ID, \SYSTEM\SECURITY\Security::getUser()->id, $val, $c_ID, \SYSTEM\SECURITY\Security::getUser()->id, $val));}
public static function get_add_data(){
return \DBD\UVOTE_DATA_USER_ADD_DATA::Q1(array(\SYSTEM\SECURITY\Security::getUser()->id));

View File

@ -7,6 +7,5 @@ class UVOTE_DATA_USER_COMMENTRATE_INSERT extends \SYSTEM\DB\QP {
//pg
'',
//mys
'INSERT INTO `uvote_user_comments_additional` (`c_ID`, `user_ID`, `val`, `timestamp`)
VALUES (?, ?, ?, NOW());'
'INSERT INTO `uvote_user_comments_additional` (`c_ID`, `user_ID`, `val`, `timestamp`) VALUES (?, ?, ?, NOW()) ON DUPLICATE KEY UPDATE `c_ID` = ?, `user_ID` = ?, `val` = ?, `timestamp` = NOW();'
);}}

View File

@ -4,3 +4,4 @@ ${urvote_bars_user}
<div class="bar bar-success" style="width: ${vote_yes_perc}%;">${vote_yes_perc}%</div>
<div class="bar bar-danger" style="width: ${vote_no_perc}%;">${vote_no_perc}%</div>
<div class="bar bar-info" style="width: ${vote_ent_perc}%;">${vote_ent_perc}%</div>
</div>

View File

@ -12,27 +12,24 @@
<div>
${voice_weight}
</div>
<div style="float: left; width: 50%">
<div>
${bars_user}
</div>
<div>
<div style="float: left; width: 50%; padding-top: 30px">
${bars_user}<br>
${bars_bt}
</div>
</div>
<div style="width: 50%;">
<div style="float: right; width: 50%; padding-top: 30px">
${icons_party}
${choice_party}
</div>
<div style="clear: both"></div>
<div style="padding-top: 30px; width: 100%;">
<div style="width: 50%; float: left">
<div class="divider" style="clear: both"></div>
<br>
<div style="padding-top: 30px;">
<h4>Kommentare</h4>
<div style="padding-top: 20px;">
<div style="float: left; width: 40%">
<h5>Pro</h5>
${comments_pro}
</div>
<div style="width: 50%; float: right">
<div style="float: right; width: 40%">
<h5>Contra</h5>
${comments_con}
</div>
@ -50,7 +47,7 @@
</select><br>
<div class="btn btn-primary submit_pro" id="submit_pro" poll_ID="${poll_ID}">${submit}</div>
</div>
</div>
<!--<div class="btn" id="test">

View File

@ -1,15 +1,17 @@
<div style="float: left">
<div><font size="1">${timestamp}</font></div>
<div style="float: left; width: 90%;">
<div style="float: left"><font size="1">${timestamp}</font></div>
<a style="float: right" class="btn btn-warning btn-mini c_spam" c_ID="${c_ID}"><i class="icon-white icon-exclamation-sign"></i></a>
<div style="clear: both"></div>
<div>${c_txt}</div>
<br>
<div style="">
<font size="2">${nr_up}</font>
<font size="2">${count_up}</font>
<a class="btn btn-success btn-mini c_up" c_ID="${c_ID}"><i class="icon-white icon-thumbs-up"></i></a>
<font size="2">${nr_down}</font>
<font size="2">${count_down}</font>
<a class="btn btn-danger btn-mini c_down" c_ID="${c_ID}"><i class="icon-white icon-thumbs-down"></i></a>
<a class="btn btn-warning btn-mini c_spam" c_ID="${c_ID}"><i class="icon-white icon-exclamation-sign"></i></a>
<div style="float: right"><font size="1">Quelle:</font><font size="2">${c_src}</font></div>
</div>
<div><font size="1">Quelle:</font><font size="2">${c_src}</font></div>
</div>
<br>

View File

@ -47,7 +47,7 @@ class default_bulletin extends SYSTEM\PAGE\Page {
array( 'party' => $pv['party'],
'choice' => $this->get_party_per_poll($pv['choice']),
'choice_class' => $this->tablerow_class($pv['choice']),
'party_yes' => $pv['votes_pro'] > 0 ? round($pv['votes_pro']/$pv['total']*100,0) : 'votes_pro',
'party_yes' => $pv['votes_pro'] > 0 ? round($pv['votes_pro']/$pv['total']*100,0) : $pv['votes_pro'],
'party_no' => $pv['votes_contra'] > 0 ? round($pv['votes_contra']/$pv['total']*100,0) : $pv['votes_contra'],
'party_off' => $pv['total'] > 0 ? round(($pv['total'] - $pv['nr_attending'])/$pv['total']*100,0) : $pv['total'],
'party_ent' => $pv['nr_attending'] > 0 ? round(($pv['nr_attending'] - $pv['votes_pro'] - $pv['votes_contra'])/$pv['nr_attending']*100,0) : $pv['nr_attending']));
@ -60,7 +60,10 @@ class default_bulletin extends SYSTEM\PAGE\Page {
$vars = votes::getUserComments($this->poll_ID, 1);
foreach($vars as $com){
$com['count'] = votes::get_commentrate($com['c_ID'], 1);
$rating = votes::get_commentrate($com['c_ID'], 1);
$com['count_up'] = $rating['count'];
$rating2 = votes::get_commentrate($com['c_ID'], 2);
$com['count_down'] = $rating2['count'];
$com['c_txt'] = utf8_encode($com['c_txt']);
$result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/comment.tpl'), $com);
}
@ -72,8 +75,10 @@ class default_bulletin extends SYSTEM\PAGE\Page {
$vars = votes::getUserComments($this->poll_ID, 2);
foreach($vars as $com){
$com['count'] = votes::get_commentrate($com['c_ID'], 2);
$com['nr_down'] = $c['count'];
$rating = votes::get_commentrate($com['c_ID'], 1);
$com['count_up'] = $rating['count'];
$rating2 = votes::get_commentrate($com['c_ID'], 2);
$com['count_down'] = $rating2['count'];
$com['c_txt'] = utf8_encode($com['c_txt']);
$result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/comment.tpl'), $com);
}

View File

@ -3,4 +3,4 @@ Ergebnis Bundestag
<div class="bar bar-success" style="width: ${bt_pro}%;">${bt_pro}%</div>
<div class="bar bar-danger" style="width: ${bt_con}%;">${bt_con}%</div>
<div class="bar bar-info" style="width: ${bt_ent}%;"><p>${bt_ent}%</p></div>
</div>

View File

@ -1,7 +1,6 @@
<div style="float: right; margin-right: 10px;">
<div style="width: 50px; height: 20px;">
<div style="width: 50px; height: 20px; float: right; margin-right: 10px;">
<div class="badge badge-success" style="">${party_yes}%</div>
<div class="badge badge-danger" style="">${party_no}%</div>
<div class="badge badge-info" style="">${party_ent}%</div>
</div>
</div>

View File

@ -1,5 +1,5 @@
<div style="width: 500px; float: left">
<div style="float: left"><img src="${frontend_logos}icon_${party}.png" width="30"/></div>
<div style="float: left"><img src="${frontend_logos}icon_${party}.png" width="30"></div>
<div style="margin-left: 5px; width: 20px; float: left"class="badge ${choice_class}">${choice}</div>
<div style="margin-left: 5px; width: 20px; float: left"class="badge badge-success">${party_yes}%</div>
<div style="margin-left: 5px; width: 20px; float: left"class="badge badge-important">${party_no}%</div>

View File

@ -302,12 +302,17 @@ function open_vote (poll_ID) {
});
$('.c_up').click(function () {
submit_commentrate($(this).attr('c_ID'), 1);
alert("Daumen hoch!");
$('#count_up').reload();
});
$('.c_down').click(function () {
submit_commentrate($(this).attr('c_ID'), 2);
alert("Daumen runter!");
$('#count_down').reload();
});
$('.c_spam').click(function () {
submit_commentrate($(this).attr('c_ID'), 3);
alert("Als Spammer gemeldet");
});
$('#test').click(function(){
$('#myModal').modal();