made uvote work, updated system reference
This commit is contained in:
parent
a211b58adb
commit
67092e2782
@ -1 +1 @@
|
||||
Subproject commit 90ce83ba36c6081b1395b555575260cb13358693
|
||||
Subproject commit bb73e4d8a5547ba56f433c65fb70f2cd765e1a06
|
||||
@ -173,7 +173,7 @@ class votes {
|
||||
|
||||
public static function open_vote($poll_ID){
|
||||
$vote = self::get_voteinfo($poll_ID); //votes::getVoteOfGroup($poll_ID);
|
||||
$result = SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/full_vote.tpl'), $vote);
|
||||
$result = SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/full_vote.tpl'), $vote);
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
BIN
uvote/files/frontend_logos/icon_urn.png
Normal file
BIN
uvote/files/frontend_logos/icon_urn.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.9 KiB |
@ -43,7 +43,7 @@ class default_bulletin extends SYSTEM\PAGE\Page {
|
||||
// $vote['bt_vote_class'] = $this->tablerow_class($vote['bt_choice']);
|
||||
foreach($party_votes as $pv){
|
||||
|
||||
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/vote_bt.tpl'),
|
||||
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/tpl/vote_bt.tpl'),
|
||||
array( 'party' => $pv['party'],
|
||||
'choice' => $this->get_party_per_poll($pv['choice']),
|
||||
'choice_class' => $this->tablerow_class($pv['choice']),
|
||||
@ -57,7 +57,7 @@ class default_bulletin extends SYSTEM\PAGE\Page {
|
||||
|
||||
private function get_pro_comments (){
|
||||
$result = '';
|
||||
$vars = votes::getUserComments($this->poll_ID, 1);
|
||||
/*$vars = votes::getUserComments($this->poll_ID, 1);
|
||||
|
||||
foreach($vars as $com){
|
||||
$rating = votes::get_commentrate($com['c_ID'], 1);
|
||||
@ -65,14 +65,14 @@ class default_bulletin extends SYSTEM\PAGE\Page {
|
||||
$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);
|
||||
}
|
||||
$result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/tpl/comment.tpl'), $com);
|
||||
}*/
|
||||
return $result;
|
||||
|
||||
}
|
||||
private function get_con_comments (){
|
||||
$result = '';
|
||||
$vars = votes::getUserComments($this->poll_ID, 2);
|
||||
/*$vars = votes::getUserComments($this->poll_ID, 2);
|
||||
|
||||
foreach($vars as $com){
|
||||
$rating = votes::get_commentrate($com['c_ID'], 1);
|
||||
@ -80,8 +80,8 @@ class default_bulletin extends SYSTEM\PAGE\Page {
|
||||
$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);
|
||||
}
|
||||
$result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/tpl/comment.tpl'), $com);
|
||||
}*/
|
||||
return $result;
|
||||
|
||||
}
|
||||
@ -91,7 +91,7 @@ class default_bulletin extends SYSTEM\PAGE\Page {
|
||||
$bars['vote_no_perc'] = round($bars['no_perc']*100,0);
|
||||
$bars['vote_ent_perc'] = round($bars['ent_perc']*100,0);
|
||||
$bars['title'] = 'Gemessen auf uVote';
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/bars_user.tpl'),$bars);
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/tpl/bars_user.tpl'),$bars);
|
||||
}
|
||||
|
||||
private function bars_party(){
|
||||
@ -102,7 +102,7 @@ class default_bulletin extends SYSTEM\PAGE\Page {
|
||||
$vote['party_yes'] = $vote['votes_pro'] > 0 ? round($vote['votes_pro']/$vote['total']*100,0) : $vote['votes_pro'];
|
||||
$vote['party_no'] = $vote['votes_contra'] > 0 ? round($vote['votes_contra']/$vote['total']*100,0) : $vote['votes_contra'];
|
||||
$vote['party_ent'] = $vote['nr_attending'] > 0 ? round(($vote['nr_attending'] - $vote['votes_pro'] - $vote['votes_contra'])/$vote['total']*100,0) : $vote['nr_attending'];
|
||||
$result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/table_parties.tpl'), $vote);
|
||||
$result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/tpl/table_parties.tpl'), $vote);
|
||||
}
|
||||
|
||||
return $result;
|
||||
@ -113,7 +113,7 @@ class default_bulletin extends SYSTEM\PAGE\Page {
|
||||
if (!$vars['bt_total']){
|
||||
return '';}
|
||||
$info = array();
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/icons_table_parties.tpl'), $info);
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/tpl/icons_table_parties.tpl'), $info);
|
||||
}
|
||||
|
||||
private function bars_bt(){
|
||||
@ -123,13 +123,13 @@ class default_bulletin extends SYSTEM\PAGE\Page {
|
||||
$vars['bt_ent'] = round(($vars['bt_attending'] - $vars['bt_pro'] - $vars['bt_con'])/$vars['bt_total']*100,0);
|
||||
$vars['bt_pro'] = round($vars['bt_pro']/$vars['bt_total']*100,0);
|
||||
$vars['bt_con'] = round($vars['bt_con']/$vars['bt_total']*100,0);
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/table_bt.tpl'), $vars);
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/tpl/table_bt.tpl'), $vars);
|
||||
}
|
||||
|
||||
private function voice_weight(){
|
||||
$vars = votes::get_count_user_votes_per_poll($this->poll_ID);
|
||||
$vars['voteweight'] = round(1/$vars['count']*100);
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/voteweight.tpl'), $vars);
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/tpl/voteweight.tpl'), $vars);
|
||||
}
|
||||
|
||||
private function p_fields (){
|
||||
@ -230,13 +230,12 @@ class default_bulletin extends SYSTEM\PAGE\Page {
|
||||
}
|
||||
|
||||
$vars['poll_ID'] = $this->poll_ID; //put it here - so its filled in!
|
||||
$vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=img&cat=frontend_logos&id=';
|
||||
$vars = array_merge($vars, \SYSTEM\locale::getStrings(DBD\locale_string::VALUE_CATEGORY_MAINPAGE));
|
||||
$vars = array_merge($vars, \SYSTEM\locale::getStrings(150));
|
||||
$vars = array_merge($vars, \SYSTEM\locale::getStrings(100));
|
||||
$vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=files&cat=frontend_logos&id=';
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote_register'));
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote'));
|
||||
|
||||
$vars = array_merge($vars,votes::get_voteinfo($this->poll_ID));
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/bulletin.tpl'),$vars);
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/tpl/bulletin.tpl'),$vars);
|
||||
}
|
||||
|
||||
}
|
||||
@ -30,7 +30,7 @@ class default_comment extends SYSTEM\PAGE\Page {
|
||||
$vars = votes::getUserComments($this->poll_ID, 1);
|
||||
foreach($vars as $com){
|
||||
$com['c_txt'] = utf8_encode($com['c_txt']);
|
||||
$result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/comment.tpl'), $com);
|
||||
$result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/tpl/comment.tpl'), $com);
|
||||
}
|
||||
return $result;
|
||||
|
||||
@ -41,7 +41,7 @@ class default_comment extends SYSTEM\PAGE\Page {
|
||||
|
||||
foreach($vars as $com){
|
||||
$com['c_txt'] = utf8_encode($com['c_txt']);
|
||||
$result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/comment.tpl'), $com);
|
||||
$result .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/tpl/comment.tpl'), $com);
|
||||
}
|
||||
return $result;
|
||||
|
||||
@ -75,13 +75,13 @@ class default_comment extends SYSTEM\PAGE\Page {
|
||||
}
|
||||
|
||||
$vars['poll_ID'] = $this->poll_ID; //put it here - so its filled in!
|
||||
$vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=img&cat=frontend_logos&id=';
|
||||
$vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=files&cat=frontend_logos&id=';
|
||||
$vars = array_merge($vars, \SYSTEM\locale::getStrings(DBD\locale_string::VALUE_CATEGORY_MAINPAGE));
|
||||
$vars = array_merge($vars, \SYSTEM\locale::getStrings(150));
|
||||
$vars = array_merge($vars, \SYSTEM\locale::getStrings(100));
|
||||
|
||||
$vars = array_merge($vars,votes::get_voteinfo($this->poll_ID));
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_comment/comment.tpl'),$vars);
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_comment/tpl/comment.tpl'),$vars);
|
||||
}
|
||||
|
||||
}
|
||||
@ -156,10 +156,10 @@ class default_page extends SYSTEM\PAGE\Page {
|
||||
if(!$_escaped_fragment_){
|
||||
$vars['js'] = $this->js();}
|
||||
$vars['css'] = $this->css();
|
||||
$vars['votelist'] = $this->generate_votelist();
|
||||
$vars['registerform'] = \SYSTEM\SECURITY\Security::isLoggedIn() ? $this->getloggedinform() : $this->exchange_registerform();
|
||||
$vars['loginform'] = \SYSTEM\SECURITY\Security::isLoggedIn() ? $this->exchange_loginform() : $this->getloginform() ;
|
||||
$vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=img&cat=frontend_logos&id=';
|
||||
$vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=files&cat=frontend_logos&id=';
|
||||
$vars['votelist'] = $this->generate_votelist();
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote'));
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote_register'));
|
||||
|
||||
|
||||
@ -7,11 +7,11 @@ class default_register extends SYSTEM\PAGE\Page {
|
||||
|
||||
public function html(){
|
||||
$vars = array();
|
||||
$vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=img&cat=frontend_logos&id=';
|
||||
$vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=files&cat=frontend_logos&id=';
|
||||
$vars['css'] = $this->css();
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote_register'));
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote'));
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_register/register.tpl'), $vars);
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_register/tpl/register.tpl'), $vars);
|
||||
|
||||
}
|
||||
}
|
||||
@ -28,7 +28,7 @@
|
||||
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
|
||||
</ol>
|
||||
<!-- Wrapper for slides -->
|
||||
<div class="carousel-inner">
|
||||
<!--<div class="carousel-inner">
|
||||
<div class="item active">
|
||||
<img src="..." alt="...">
|
||||
<div class="carousel-caption">
|
||||
@ -36,7 +36,7 @@
|
||||
</div>
|
||||
</div>
|
||||
...
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<!-- Controls -->
|
||||
<a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
|
||||
@ -1 +0,0 @@
|
||||
${votetlist}
|
||||
@ -66,7 +66,7 @@ class user_list_active extends SYSTEM\PAGE\Page {
|
||||
$party_votes = votes::get_barsperparty($vote['ID']);
|
||||
$vote['bt_vote_class'] = $this->tablerow_class($vote['bt_choice']);
|
||||
foreach($party_votes as $pv){
|
||||
$vote['bt'] .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/vote_bt.tpl'),
|
||||
$vote['bt'] .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/vote_bt.tpl'),
|
||||
array( 'party' => $pv['party'],
|
||||
'choice' => $this->get_party_per_poll($pv['choice']),
|
||||
'choice_class' => $this->badge_class($pv['choice'])));
|
||||
@ -76,7 +76,7 @@ class user_list_active extends SYSTEM\PAGE\Page {
|
||||
$uvote = votes::get_users_choice_per_poll($vote['ID']);
|
||||
$vote['uv_vote_class'] = count($uvote) > 0 ? $this->tablerow_class($uvote[0]['choice']) : '';
|
||||
foreach($uvote as $v){
|
||||
$vote['uv'] .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/vote_uv.tpl'),
|
||||
$vote['uv'] .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/vote_uv.tpl'),
|
||||
array( 'badge' => self::badge_class($v['choice']),
|
||||
'perc' => $v['count'] > 0 ? round($v['count']/$vote_count['count']*100, 2) : 0));
|
||||
}
|
||||
@ -86,9 +86,9 @@ class user_list_active extends SYSTEM\PAGE\Page {
|
||||
$vote['panel_class'] = default_page::panel_class($user_vote);
|
||||
|
||||
if($time_remain > 0){
|
||||
$result[0] .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/vote.tpl'), $vote);
|
||||
$result[0] .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/vote.tpl'), $vote);
|
||||
} else {
|
||||
$result[1] .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/vote.tpl'), $vote);
|
||||
$result[1] .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/vote.tpl'), $vote);
|
||||
}
|
||||
}
|
||||
return $result[0].$result[1];
|
||||
@ -97,11 +97,10 @@ class user_list_active extends SYSTEM\PAGE\Page {
|
||||
public function html(){
|
||||
$vars = array();
|
||||
$vars['votelist'] = $this->generate_votelist();
|
||||
$vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=img&cat=frontend_logos&id=';
|
||||
$vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=files&cat=frontend_logos&id=';
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote_register'));
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote_poll'));
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote'));
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_list_active/active.tpl'), $vars);
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_list_active/tpl/active.tpl'), $vars);
|
||||
}
|
||||
|
||||
}
|
||||
1
uvote/page/user_list_ended/tpl/ended.tpl
Normal file
1
uvote/page/user_list_ended/tpl/ended.tpl
Normal file
@ -0,0 +1 @@
|
||||
${votelist}
|
||||
@ -65,7 +65,7 @@ class user_list_ended extends SYSTEM\PAGE\Page {
|
||||
$party_votes = votes::get_barsperparty($vote['ID']);
|
||||
$vote['bt_vote_class'] = $this->tablerow_class($vote['bt_choice']);
|
||||
foreach($party_votes as $pv){
|
||||
$vote['bt'] .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/vote_bt.tpl'),
|
||||
$vote['bt'] .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/vote_bt.tpl'),
|
||||
array( 'party' => $pv['party'],
|
||||
'choice' => $this->get_party_per_poll($pv['choice']),
|
||||
'choice_class' => $this->badge_class($pv['choice'])));
|
||||
@ -75,7 +75,7 @@ class user_list_ended extends SYSTEM\PAGE\Page {
|
||||
$uvote = votes::get_users_choice_per_poll($vote['ID']);
|
||||
$vote['uv_vote_class'] = count($uvote) > 0 ? $this->tablerow_class($uvote[0]['choice']) : '';
|
||||
foreach($uvote as $v){
|
||||
$vote['uv'] .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/vote_uv.tpl'),
|
||||
$vote['uv'] .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/vote_uv.tpl'),
|
||||
array( 'badge' => self::badge_class($v['choice']),
|
||||
'perc' => $v['count'] > 0 ? round($v['count']/$vote_count['count']*100, 2) : 0));
|
||||
}
|
||||
@ -85,9 +85,9 @@ class user_list_ended extends SYSTEM\PAGE\Page {
|
||||
$vote['panel_class'] = default_page::panel_class($user_vote);
|
||||
|
||||
if($time_remain > 0){
|
||||
$result[0] .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/vote.tpl'), $vote);
|
||||
$result[0] .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/vote.tpl'), $vote);
|
||||
} else {
|
||||
$result[1] .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/vote.tpl'), $vote);
|
||||
$result[1] .= SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/vote.tpl'), $vote);
|
||||
}
|
||||
}
|
||||
return $result[0].$result[1];
|
||||
@ -96,11 +96,10 @@ class user_list_ended extends SYSTEM\PAGE\Page {
|
||||
public function html(){
|
||||
$vars = array();
|
||||
$vars['votelist'] = $this->generate_votelist();
|
||||
$vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=img&cat=frontend_logos&id=';
|
||||
$vars = array_merge($vars, \SYSTEM\locale::getStrings(DBD\locale_string::VALUE_CATEGORY_MAINPAGE));
|
||||
$vars = array_merge($vars, \SYSTEM\locale::getStrings(150));
|
||||
$vars = array_merge($vars, \SYSTEM\locale::getStrings(110));
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_list_ended/ended.tpl'), $vars);
|
||||
$vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=files&cat=frontend_logos&id=';
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote'));
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote_register'));
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_list_ended/tpl/ended.tpl'), $vars);
|
||||
}
|
||||
|
||||
}
|
||||
@ -6,12 +6,9 @@ class user_main extends SYSTEM\PAGE\Page {
|
||||
return '<link href="'.SYSTEM\WEBPATH(new PPAGE(),'user_main/css/main_menu.css').'" rel="stylesheet">';}
|
||||
public function html(){
|
||||
$vars = array();
|
||||
|
||||
$uv = new user_main_uVote();
|
||||
$vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=img&cat=frontend_logos&id=';
|
||||
$vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=files&cat=frontend_logos&id=';
|
||||
$vars['uVote'] = $uv->html();
|
||||
|
||||
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main/main_menu.tpl'),$vars);
|
||||
}
|
||||
|
||||
|
||||
@ -20,10 +20,9 @@ class user_main_myVote extends SYSTEM\PAGE\Page {
|
||||
$vars = array();
|
||||
$vars = $this->get_add_data();
|
||||
$vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=img&cat=frontend_logos&id=';
|
||||
$vars = array_merge($vars, \SYSTEM\locale::getStrings(DBD\locale_string::VALUE_CATEGORY_MAINPAGE));
|
||||
$vars = array_merge($vars, \SYSTEM\locale::getStrings(150));
|
||||
$vars = array_merge($vars, \SYSTEM\locale::getStrings(110));
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_myVote/myVote.tpl'), $vars);
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote'));
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote_register'));
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_myVote/tpl/myVote.tpl'), $vars);
|
||||
}
|
||||
|
||||
}
|
||||
@ -7,7 +7,7 @@ class user_main_uVote extends SYSTEM\PAGE\Page {
|
||||
|
||||
foreach($votes as $vote){
|
||||
$vote['match_percentage'] = round($vote['class_MATCH']/($vote['class_MATCH']+$vote['class_MISSMATCH'])*100,2);
|
||||
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_uVote/uvoteparties.tpl'), $vote);
|
||||
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_uVote/tpl/uvoteparties.tpl'), $vote);
|
||||
}
|
||||
print_r($votes, TRUE);
|
||||
return $result;
|
||||
@ -34,7 +34,7 @@ class user_main_uVote extends SYSTEM\PAGE\Page {
|
||||
}
|
||||
//$vote['count'];
|
||||
//$vote['choice'];
|
||||
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_uVote/votecountchoice.tpl'),$vote);
|
||||
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_uVote/tpl/votecountchoice.tpl'),$vote);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
@ -60,7 +60,7 @@ class user_main_uVote extends SYSTEM\PAGE\Page {
|
||||
}
|
||||
//$vote['count'];
|
||||
//$vote['choice'];
|
||||
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_uVote/votecountchoicebt.tpl'),$vote);
|
||||
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_uVote/tpl/votecountchoicebt.tpl'),$vote);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
@ -78,11 +78,10 @@ class user_main_uVote extends SYSTEM\PAGE\Page {
|
||||
$vars['votes_all'] = $this->votes_all();
|
||||
$vars['votes_all_bt'] = $this->votes_all_bt();
|
||||
$vars['user_count'] = $this->user_count();
|
||||
$vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=img&cat=frontend_logos&id=';
|
||||
$vars = array_merge($vars, \SYSTEM\locale::getStrings(DBD\locale_string::VALUE_CATEGORY_MAINPAGE));
|
||||
$vars = array_merge($vars, \SYSTEM\locale::getStrings(150));
|
||||
$vars = array_merge($vars, \SYSTEM\locale::getStrings(100));
|
||||
return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_uVote/uVote.tpl'),$vars);
|
||||
$vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=files&cat=frontend_logos&id=';
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote'));
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote_register'));
|
||||
return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_uVote/tpl/uVote.tpl'),$vars);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,13 +1,10 @@
|
||||
<?php
|
||||
class user_main_urVote extends SYSTEM\PAGE\Page {
|
||||
|
||||
|
||||
|
||||
class user_main_urVote extends SYSTEM\PAGE\Page {
|
||||
private function user_overall_votes (){
|
||||
$vars = votes::get_user_overall_votes(\SYSTEM\SECURITY\Security::getUser()->id, \SYSTEM\SECURITY\Security::getUser()->creationDate);
|
||||
$v = $vars['voted'] > 1 ? $vars['voted'] : 1;
|
||||
$nv = $vars['not_voted'];
|
||||
return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_urVote/overall_all_polls.tpl'),
|
||||
return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_urVote/tpl/overall_all_polls.tpl'),
|
||||
array( 'vote_perc'=> round($v/($nv+$v)*100, 2),
|
||||
'no_vote_perc'=> round($nv/($nv+$v)*100, 2),
|
||||
'voted'=> $v,
|
||||
@ -19,9 +16,9 @@ class user_main_urVote extends SYSTEM\PAGE\Page {
|
||||
$v = $vars['voted'];
|
||||
$nv = $vars['not_voted'];
|
||||
print_r($vars, true);
|
||||
return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_urVote/all_polls.tpl'),
|
||||
array( 'vote_perc'=> round($v/($nv+$v)*100, 2),
|
||||
'no_vote_perc'=> round($nv/($nv+$v)*100, 2),
|
||||
return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_urVote/tpl/all_polls.tpl'),
|
||||
array( 'vote_perc'=> round($v/(($nv+$v)*100+1), 2),
|
||||
'no_vote_perc'=> round($nv/(($nv+$v)*100+1), 2),
|
||||
'voted'=> $v,
|
||||
'not_voted'=> $nv));
|
||||
}
|
||||
@ -40,7 +37,7 @@ class user_main_urVote extends SYSTEM\PAGE\Page {
|
||||
while($row = $res->next()){
|
||||
$row['match_percentage'] = round($row['class_MATCH']/($row['class_MATCH']+$row['class_MISSMATCH']+1)*100,2);
|
||||
|
||||
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_urVote/bt_to_user_overall.tpl'), $row);
|
||||
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_urVote/tpl/bt_to_user_overall.tpl'), $row);
|
||||
}
|
||||
return $result;
|
||||
$row['votes_cast'] = round(($row['class_MATCH']+$row['class_MISSMATCH']),2);
|
||||
@ -65,7 +62,7 @@ class user_main_urVote extends SYSTEM\PAGE\Page {
|
||||
$res2 = votes::vote_accord_with_party($row['party']);
|
||||
$row['according_laws'] = $this->build_according_law_html($res2, $row['party']);
|
||||
$row['match_percentage'] = round($row['class_MATCH']/($row['class_MATCH']+$row['class_MISSMATCH'])*100,2);
|
||||
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_urVote/urvoteparties.tpl'), $row);;
|
||||
$result .= \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_urVote/tpl/urvoteparties.tpl'), $row);;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
@ -84,12 +81,12 @@ class user_main_urVote extends SYSTEM\PAGE\Page {
|
||||
// $vars['poll_compare'] = $this->count_all_polls();
|
||||
$vars['choices_user_ID'] = $this->user_per_party_overall();
|
||||
$vars['choices_bt_to_user'] = $this->user_to_bt();
|
||||
$vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=img&cat=frontend_logos&id=';
|
||||
$vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=files&cat=frontend_logos&id=';
|
||||
$vars['user_temp_votes'] = $this->user_temp_votes();
|
||||
$vars['user_overall_votes'] = $this->user_overall_votes();
|
||||
$vars = array_merge($vars, \SYSTEM\locale::getStrings(DBD\locale_string::VALUE_CATEGORY_MAINPAGE));
|
||||
$vars = array_merge($vars, \SYSTEM\locale::getStrings(150));
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_urVote/urVote.tpl'),$vars);
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote'));
|
||||
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag('uvote_register'));
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'user_main_urVote/tpl/urVote.tpl'),$vars);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user