Jump to content

[SOLVED] Credits


OmerAslan

Recommended Posts

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 by OmerAslan
Link to comment
Share on other sites

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);
   }

}

Link to comment
Share on other sites

  • Moderators

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);
    }

}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...