diff --git a/uVote/api/votes/votes.php b/uVote/api/votes/votes.php index 97a464e..95fa84d 100644 --- a/uVote/api/votes/votes.php +++ b/uVote/api/votes/votes.php @@ -83,6 +83,12 @@ class votes { public static function get_bar_bt_per_poll($poll_ID){ return \DBD\UVOTE_DATA_BT_PER_POLL::Q1(array($poll_ID));} + public static function get_user_count(){ + return \DBD\UVOTE_DATA_USER_COUNT_USERS::Q1(array());} + + public static function get_count_user_votes_per_poll($poll_ID){ + return \DBD\UVOTE_DATA_USER_COUNT_CHOICE_PER_POLL::Q1(array($poll_ID));} + public static function get_user_per_party_overall($user_ID){ return \DBD\UVOTE_DATA_USER_PER_PARTY_OVERALL::QA(array($user_ID)); } diff --git a/uVote/dbd/qq/UVOTE_DATA_USER_COUNT_CHOICE_PER_POLL.php b/uVote/dbd/qq/UVOTE_DATA_USER_COUNT_CHOICE_PER_POLL.php new file mode 100644 index 0000000..a682924 --- /dev/null +++ b/uVote/dbd/qq/UVOTE_DATA_USER_COUNT_CHOICE_PER_POLL.php @@ -0,0 +1,11 @@ + ${bars_user} +
+ ${voice_weight} +

Ergebnis Bundestag

${bars_bt} @@ -16,6 +19,6 @@
${vote_buttons}
-
+ \ No newline at end of file diff --git a/uVote/page/default_bulletin/default_bulletin.php b/uVote/page/default_bulletin/default_bulletin.php index 57f0d4d..3a8fea8 100644 --- a/uVote/page/default_bulletin/default_bulletin.php +++ b/uVote/page/default_bulletin/default_bulletin.php @@ -38,6 +38,12 @@ class default_bulletin extends SYSTEM\PAGE\Page { return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/table_bt.tpl'), $vars); } + private function voice_weight(){ + $vars = votes::get_count_user_votes_per_poll($this->poll_ID); + $vars['voteweight'] = 1/$vars['count']*100; + return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/voteweight.tpl'), $vars);; + } + private function vote_buttons($poll_expired){ $user_poll = votes::getUserPollData($this->poll_ID); if($poll_expired){ @@ -105,6 +111,7 @@ class default_bulletin extends SYSTEM\PAGE\Page { $vars['css'] = $this->css(); $vars['frontend_logos'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=img&cat=frontend_logos&id='; $vars ['vote_buttons'] = $this->vote_buttons($poll_expired); + $vars['voice_weight'] = $this->voice_weight(); $vars['poll_ID'] = $this->poll_ID; $vars = array_merge($vars,votes::get_voteinfo($this->poll_ID)); return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_bulletin/bulletin.tpl'),$vars); diff --git a/uVote/page/default_bulletin/voteweight.tpl b/uVote/page/default_bulletin/voteweight.tpl new file mode 100644 index 0000000..fc5d06f --- /dev/null +++ b/uVote/page/default_bulletin/voteweight.tpl @@ -0,0 +1,4 @@ +
+ Dein aktuelles Stimmgewicht bei dieser Abstimmung: + ${voteweight}% +
\ No newline at end of file diff --git a/uVote/page/default_page/vote.tpl b/uVote/page/default_page/vote.tpl index 256620c..b03f632 100644 --- a/uVote/page/default_page/vote.tpl +++ b/uVote/page/default_page/vote.tpl @@ -1,25 +1,27 @@ - + + - - +
+

${title}

- Nr.${ID} - ${full_vote_btn} + ${full_vote_btn}
+ ${cdu}
${csu}
${spd}
${gruene}
${linke}
- uv - ${uv_pro} - ${uv_con} - ${uv_ent} - + + + ${uv_pro} + ${uv_con} + ${uv_ent} + diff --git a/uVote/page/user_main_uVote/uVote.tpl b/uVote/page/user_main_uVote/uVote.tpl index 6dbed93..fcda0fd 100644 --- a/uVote/page/user_main_uVote/uVote.tpl +++ b/uVote/page/user_main_uVote/uVote.tpl @@ -15,5 +15,10 @@ Wie oft der Bundestag
Dafür, Dagegen oder -
Enthaltung gestimmt hat.
- \ No newline at end of file +
Enthaltung gestimmt hat. + +
+
+
+ ${user_count} Nutzer auf uVote +
\ No newline at end of file diff --git a/uVote/page/user_main_uVote/user_main_uVote.php b/uVote/page/user_main_uVote/user_main_uVote.php index 237db0e..3abb4c2 100644 --- a/uVote/page/user_main_uVote/user_main_uVote.php +++ b/uVote/page/user_main_uVote/user_main_uVote.php @@ -46,10 +46,17 @@ class user_main_uVote extends SYSTEM\PAGE\Page { return $result; } + private function user_count(){ + $vars = votes::get_user_count(); + return $vars['count']; + } + + public function html(){ $vars = array(); $vars['votes_all'] = $this->votes_all(); $vars['votes_all_bt'] = $this->votes_all_bt(); + $vars['user_count'] = $this->user_count(); $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_uVote/uVote.tpl'),$vars);