MovieLib - Your movie database on web
Check again please. This function that you use not distinguishes media type (movie or tvshow) and generate panels for both. Probably you have panels with identical content on both sites. That means for example when you don't have any tvshow from 2017 year but you have that movie so there is a empty filter year in the left panel on tvshow view.

edit: Sorry for tvshows is only genre panel. Check on it.

My last fix is for php7 and mysqli becouse i change it and testing. This is for old version:

Code:
function panels_array($columns, $table) {
    
    $sep_tab = array('genre', 'country', 'studio', 'director');
    $panels_array = array();
    foreach ($columns as $val) {
        if (in_array($val, $sep_tab)) {
            $sel = 'SELECT DISTINCT ' . $val . '.id, ' . $val . '.' . $val . ' FROM `' . $val . '`, `' . $table . '_' . $val . '` WHERE ' . $val . '.id=' . $table . '_' . $val . '.' . $val . 'id ORDER BY ' . $val . '.' . $val;
            $res = mysql_q($sel);
            while ($r = mysql_fetch_assoc($res)) {
                $panels_array[$val][$r['id']] = $r[$val];
            }
        } else if ($val == "actor") {
            $sel = 'SELECT ' . $val . '.id, ' . $val . '.' . $val . ' FROM `' . $val . '` ORDER BY ' . $val . '.' . $val;
            $res = mysql_q($sel);
            while ($r = mysql_fetch_assoc($res)) {
                $panels_array[$val][$r['id']] = $r[$val];
            }
        } else {
            $sel = 'SELECT DISTINCT `' . $val . '` FROM `' . $table . '` WHERE `hide` = 0 ORDER BY `' . $val . '`';
            $res = mysql_q($sel);
            if (mysql_num_rows($res) > 0) {
                while ($r = mysql_fetch_assoc($res)) {
                    if ($r[$val] != '') {
                        $panels_array[$val][] = $r[$val];
                    }
                }
            }
        }
    }
    if (isset($panels_array['year'])) { rsort($panels_array['year']); }
    
    return $panels_array;
}
Reply
 
Thread Rating:
  • 8 Vote(s) - 4.63 Average


Messages In This Thread
RE: MovieLib - Your movie database on web - by Regss - 2017-02-27, 14:14
Last Post - by Jeffreywat - 2017-09-03, 14:02


Logout Mark Read Team Forum Stats Members Help
MovieLib - Your movie database on web4.638