Jump to content
  • 0

Flux CP Errors (need help fixing)


Dori

Question


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  332
  • Reputation:   15
  • Joined:  12/11/11
  • Last Seen:  

Ok so I have vote for points by Jaypee installed. This is the 1st error I get:

PHP Notice:  Undefined offset: 0 in /home/name/public_html/addons/voteforpoints/modules/voteforpoints/index.php on line 44
PHP Notice:  Trying to get property of non-object in /home/name/public_html/addons/voteforpoints/modules/voteforpoints/index.php on line 44

indicated line:

$diff_time = strtotime($ip_check[0]->unblock_time)-strtotime(date("Y-m-d G:i:s",time()));

2nd error.....

PHP Notice:  Undefined index: HTTP_X_FORWARDED_FOR in /home/name/public_html/addons/voteforpoints/modules/voteforpoints/vote.php on line 16

indicated line:

$xforward= $_SERVER["HTTP_X_FORWARDED_FOR"];

This 3rd error is not about vote for points. Here is the error:

PHP Notice:  Trying to get property of non-object in /home/name/public_html/themes/default/main/rsslib.php on line 21

indicated line:

$description = $tnl->firstChild->textContent;

4th error:

PHP Notice:  Undefined offset: 1 in /home/name/public_html/lib/Flux/Template.php on line 287

indicated line:

list ($key,$val) = explode('=', $line, 2);

Please help me fix them!

Edited by Phenex
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  213
  • Reputation:   109
  • Joined:  05/21/12
  • Last Seen:  

$diff_time = strtotime($ip_check[0]->unblock_time)-strtotime(date("Y-m-d G:i:s",time()));
^ For this error, I'd need to see the rest of the code. $ip_check isn't an array hydrated with objects. I'd assume $ip_check is a result from a poorly formatted SQL call as Flux CP defaults PDO to hydrate results as objects.

 

-----

 

HTTP_X_FORWARDED_FOR related error - Indicates the index isn't defined in $_SERVER variable.

 

Change whatever line that is referencing HTTP_X_FORWARDED_FOR to something along the lines of:

$xforward= @($_SERVER['HTTP_X_FORWARDED_FOR'] ?: null);
Which will basically default to null if it isn't defined.

They may be using this to prevent proxy servers. But, that is actually incredibly unreliable. HTTP_X_FORWARDED_FOR is great for using load balancers and needing to pull the IP of the actual user.

 

-----

$description = $tnl->firstChild->textContent;

 

^ Again, read the first response to the first error. It looks like the same situation except that doesn't appear to be the result of a SQL query. If you could post the entire script, that would be helpful.

 

-----

 

For the last error, that is indicating a line in Flux_Template::render method. That means I'd check the template you're rendering based on the module you're trying to access. I'd assume it's related to JayPee's Vote4Points. Make sure you installed it correctly. I'll look at the script if I have time later.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  332
  • Reputation:   15
  • Joined:  12/11/11
  • Last Seen:  

Thank you for the reply. Here are the 4 files.

 

all files.rar

Link to comment
Share on other sites

×
×
  • Create New...