OmerAslan Posted April 12, 2016 Report Share Posted April 12, 2016 (edited) Hello, i have phpvms 5.5.2 version, admin credits page Strict Standards: Non-static method CreditsData::get_all_credits() should not be called statically, assuming $this from incompatible context in /home/pilotomeraslan/public_html/a/admin/modules/Credits/Credits.php on line 36 public credits page Strict Standards: Non-static method CreditsData::get_active_credits() should not be called statically, assuming $this from incompatible context in /home/pilotomeraslan/public_html/a/core/modules/Credits/Credits.php on line 7 also Warning: Invalid argument supplied for foreach() in /home/pilotomeraslan/public_html/a/core/templates/credits/index.php on line 4 how can i fix it? Thanks Edited May 20, 2016 by OmerAslan Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted April 12, 2016 Moderators Report Share Posted April 12, 2016 Open your core/common/CreditsData.class.php file and where: public function replace with: public static function Quote Link to comment Share on other sites More sharing options...
OmerAslan Posted April 12, 2016 Author Report Share Posted April 12, 2016 Open your core/common/CreditsData.class.php file and where: public function replace with: public static function Hello my friend, There is no line with public function <?php class CreditsData extends CodonData { function get_credit($id) { $query = "SELECT * FROM ".TABLE_PREFIX."credits WHERE id=$id"; return DB::get_row($query); } function get_all_credits() { $query = "SELECT * FROM ".TABLE_PREFIX."credits ORDER BY name DESC"; return DB::get_results($query); } function get_active_credits() { $query = "SELECT * FROM ".TABLE_PREFIX."credits WHERE active = '1' ORDER BY name DESC"; return DB::get_results($query); } function save_new_credit($name, $description, $image, $link, $active) { $query = "INSERT INTO ".TABLE_PREFIX."credits (name, description, image, link, active) VALUES('$name', '$description', '$image', '$link', '$active')"; DB::query($query); } function save_edit_credit($name, $description, $image, $link, $active, $id) { $query = "UPDATE ".TABLE_PREFIX."credits SET name='$name', description='$description', link='$link', image='$image', active='$active' WHERE id='$id'"; DB::query($query); } function delete_credit($id) { $query = "DELETE FROM ".TABLE_PREFIX."credits WHERE id='$id'"; DB::query($query); } } Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted April 12, 2016 Moderators Report Share Posted April 12, 2016 Use this: <?php class CreditsData extends CodonData { public static function get_credit($id) { $query = "SELECT * FROM ".TABLE_PREFIX."credits WHERE id=$id"; return DB::get_row($query); } public static function get_all_credits() { $query = "SELECT * FROM ".TABLE_PREFIX."credits ORDER BY name DESC"; return DB::get_results($query); } public static function get_active_credits() { $query = "SELECT * FROM ".TABLE_PREFIX."credits WHERE active = '1' ORDER BY name DESC"; return DB::get_results($query); } public static function save_new_credit($name, $description, $image, $link, $active) { $query = "INSERT INTO ".TABLE_PREFIX."credits (name, description, image, link, active) VALUES('$name', '$description', '$image', '$link', '$active')"; DB::query($query); } public static function save_edit_credit($name, $description, $image, $link, $active, $id) { $query = "UPDATE ".TABLE_PREFIX."credits SET name='$name', description='$description', link='$link', image='$image', active='$active' WHERE id='$id'"; DB::query($query); } public static function delete_credit($id) { $query = "DELETE FROM ".TABLE_PREFIX."credits WHERE id='$id'"; DB::query($query); } } Quote Link to comment Share on other sites More sharing options...
OmerAslan Posted April 12, 2016 Author Report Share Posted April 12, 2016 Now it's perfect my friend. Thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.