1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-05 19:41:55 +02:00

make the disabled songs link show something, need to make a custom view for that as the song one i not really valid, also played around with the caching a bit

This commit is contained in:
Karl 'vollmerk' Vollmer 2008-07-14 04:56:52 +00:00
parent 5c510357a8
commit 0a184d3db4
6 changed files with 59 additions and 99 deletions

View file

@ -31,6 +31,27 @@ abstract class database_object {
// Statistics for debugging
public static $cache_hit = 0;
public function get_info($id,$table_name='') {
$table_name = $table_name ? Dba::escape($table_name) : Dba::escape(strtolower(get_class($this)));
if (self::is_cached($table_name,$id)) {
return self::get_from_cache($table_name,$id);
}
$sql = "SELECT * FROM `$table_name` WHERE `id`='$id'";
$db_results = Dba::query($sql);
if (!$db_results) { return array(); }
$row = Dba::fetch_assoc($db_results);
self::add_to_cache($table_name,$id,$row);
return $row;
} // get_info
/**
* is_cached
* this checks the cache to see if the specified object is there