Skip to content

Commit

Permalink
Some Beauty fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hhunderter committed Feb 3, 2020
1 parent 80222df commit 3972086
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
6 changes: 5 additions & 1 deletion config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Config extends \Ilch\Config\Install
{
public $config = [
'key' => 'radiohoerercharts',
'version' => '1.4.2',
'version' => '1.4.3',
'icon_small' => 'fa-list-ol',
'author' => 'Reilard, Dennis alias hhunderter ',
'link' => '',
Expand Down Expand Up @@ -188,6 +188,10 @@ public function getUpdate($installedVersion)
bugfix of SQL-Statement is_voted
Some Beauty fixes
*/
case "1.4.2": //update zu 1.4.3
/*
Some Beauty fixes
*/
case "1.4.2": //update zu ?
}
return 'Update function executed.';
Expand Down
10 changes: 6 additions & 4 deletions mappers/HoererCharts.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class HoererCharts extends \Ilch\Mapper
* returns if the module is installed.
*
* @return boolean
* @throws \Ilch\Database\Exception
*/
public function checkDB()
{
Expand Down Expand Up @@ -252,8 +253,9 @@ public function delete($id)
*/
public function reset()
{
$sql = 'UPDATE `[prefix]_radio_hoerercharts` SET votes=0;';
return $this->db()->queryMulti($sql);
return $this->db()->update('radio_hoerercharts')
->values(['votes' => 0])
->execute();
}

/**
Expand Down Expand Up @@ -283,8 +285,8 @@ public function getStars($votes = 0, $config = null, $showstars = false)
/**
* Checks if voting is allowed.
*
* @param string $start_datetime
* @param string $end_datetime
* @param null|\Ilch\Date $start_datetime
* @param null|\Ilch\Date $end_datetime
* @return boolean
*/
public function vote_allowed($start_datetime = null, $end_datetime = null)
Expand Down
1 change: 1 addition & 0 deletions mappers/HoererChartsSuggestion.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class HoererChartsSuggestion extends \Ilch\Mapper
* returns if the module is installed.
*
* @return boolean
* @throws \Ilch\Database\Exception
*/
public function checkDB()
{
Expand Down
10 changes: 6 additions & 4 deletions mappers/HoererChartsUserVotes.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,12 @@ public function delete_session($session_id)
->where(['session_id' => $session_id])
->execute();
}

/**
* Gets the entry by given ID.
*
* @param int $id
* @return null|EntriesModel
* @param \Modules\User\Models\User $User
* @return integer
*/
public function getEntryByUserSession($User = null)
{
Expand Down Expand Up @@ -205,8 +205,9 @@ public function getEntryByUserSession($User = null)
/**
* Check if user has already voted or if guests can vote.
*
* @param \Ilch\User $User
* @param \Modules\User\Models\User $User
* @param boolean $guestallow
* @param integer $timediff
* @return boolean
*/
public function is_voted($User = null, $guestallow = false, $timediff = 30)
Expand Down Expand Up @@ -256,6 +257,7 @@ public function is_voted($User = null, $guestallow = false, $timediff = 30)
* Reset the Vote counts.
*
* @return boolean
* @throws \Ilch\Database\Exception
*/
public function reset()
{
Expand Down

0 comments on commit 3972086

Please sign in to comment.