Jump to content
  • 0

How to fix vote for points error logs? View it!


Yummy

Question


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  236
  • Reputation:   12
  • Joined:  03/07/12
  • Last Seen:  

[19-Mar-2012 01:30:27] PHP Notice: Trying to get property of non-object in /home/heritage/public_html/main/addons/vote_for_credits/modules/vote/stats.php on line 17
[19-Mar-2012 01:30:28] PHP Notice: Trying to get property of non-object in /home/heritage/public_html/main/addons/vote_for_credits/modules/vote/stats.php on line 17

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  707
  • Reputation:   168
  • Joined:  01/26/12
  • Last Seen:  

Hi Remix,

Can you provide us with 'stats.php' so we can take a look at "Line 17"?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  236
  • Reputation:   12
  • Joined:  03/07/12
  • Last Seen:  

<?php
if (!defined('FLUX_ROOT')) exit;

$title = Flux::message('VoteStatsTitle');
$votes = Flux::config('FluxTables.VotesTable');

// Get total vote count.
$sql   = "SELECT COUNT(*) AS total FROM {$server->loginDatabase}.$votes";
$sth   = $server->connection->getStatement($sql);
$sth->execute();
$total = $sth->fetch()->total;

// Get date since first vote.
$sql   = "SELECT vote_date FROM {$server->loginDatabase}.$votes ORDER BY vote_date ASC LIMIT 1";
$sth   = $server->connection->getStatement($sql);
$sth->execute();
$since = $sth->fetch()->vote_date;

// Fetch top voters.
$sql   = "SELECT COUNT($votes.id) AS total, login.userid, login.account_id ";
$sql  .= "FROM $votes LEFT JOIN login ON $votes.account_id = login.account_id ";
$sql  .= "GROUP BY account_id ORDER BY total DESC ";
if ($limitTopVoters=(int)Flux::config('ShowTopVotes')) {
$sql .= "LIMIT $limitTopVoters";
}
$sth   = $server->connection->getStatement($sql);
$sth->execute();
$users = $sth->fetchAll();
?>

Link to comment
Share on other sites

×
×
  • Create New...