I have FAP 1.4.1 downloaded from this site (icyphoenix.com) fresh install (no upgrade from anything) brand new database. Fresh install with no mods, running on phpBB 2.0.22 also a fresh install with many mods.
I have security set up so only users put into the "members" or "Administrators" groups can view the albums, regular users should (and do) get "permission denied."
My problem is with the member usergroup access of personal albums. When a user in the members group accesses an album not created by an administrator they get the following SQL error. Administrators do not see this error at all, they can access all images. To add to the confusion, the album created by me, is accessable to the correct user groups, but albums created by users is not. I'm really confused at this.
Code: [Download] [Hide]
- Couldn't get total number of pictures for album categories and sub categories
- DEBUG MODE
- SQL Error : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 3
- SELECT COUNT(p.pic_id) AS count FROM phpbb_album_cat AS c LEFT JOIN phpbb_album AS p ON c.cat_id = p.pic_cat_id WHERE c.cat_id IN ()
- Line : 1052
- File : album_hierarchy_sql.php
The album_hierarchy_sql.php is in its original form and I'm at a loss as how to fix it. I have the following snip of code from the album_hierarchy_sql.php that looks like it's the code erroring out.
Code: [Download] [Hide]
- // ------------------------------------------------------------------------
- // Returns the number of pictures for current catgory and it subs
- // ------------------------------------------------------------------------
- function album_get_total_pics($cats)
- {
- global $db;
- $sql_where = " WHERE c.cat_id " . ( (is_array($cats)) ? "IN (". implode(",", $cats) .")" : "= " . $cats);
- $sql = "SELECT COUNT(p.pic_id) AS count
- FROM " . ALBUM_CAT_TABLE . " AS c
- LEFT JOIN " . ALBUM_TABLE . " AS p ON c.cat_id = p.pic_cat_id " . $sql_where;
- if (!$result = $db->sql_query($sql))
- {
- message_die(GENERAL_ERROR, "Couldn't get total number of pictures for album categories and sub categories", "", __LINE__, __FILE__, $sql);
- }
- if ($db->sql_numrows($result) == 0)
- {
- return 0;
- }
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
- return intval($row['count']);
- }
I've tripple checked the permissions outlined in the installation and can't find error there or anywhere else in the instructions.
I have a test account setup that is added to the members user group,
Username: test2
Password: test2
Warning: The page (once fixed) contains adult oriented content.
h**p://***.tampabaylifestylers.com/phpBB2/album.php is the URL.
I've searched these forums several times over and have not found an existing thread where this is addressed. If found a thread where the user had updated from another version but no solution was offered for a fresh install such as mine. The solutions offered provided in that thread provided nothing to assist my situation although the error is the same.
Additional information: Verbose Debug Output
Code: [Download] [Hide]
- DEBUG :
- ----------------------------------------------------
- album_permissions : before album_user_access : 'Personal Gallery Of lgsbcs'(id=0), $album_permission = NULL
- ----------------------------------------------------
- DEBUG :
- ----------------------------------------------------
- album_permissions : after album_user_access : 'Personal Gallery Of lgsbcs'(id=0), $album_permission =
- array = (
- ['view'] => 0,
- ['upload'] => 0,
- ['rate'] => 0,
- ['comment'] => 1,
- ['edit'] => 0,
- ['delete'] => 0,
- ['moderator'] => 0
- )
- ----------------------------------------------------
- DEBUG :
- ----------------------------------------------------
- $album_config['personal_gallery'] = 0
- ----------------------------------------------------
- DEBUG :
- ----------------------------------------------------
- final : $album_permission =
- array = (
- ['view'] => 0,
- ['upload'] => 0,
- ['rate'] => 0,
- ['comment'] => 1,
- ['edit'] => 0,
- ['delete'] => 0,
- ['moderator'] => 0,
- ['manage'] => 0
- )
- ----------------------------------------------------
- DEBUG :
- ----------------------------------------------------
- album_read_tree : user id = 11, $album_data['auth'] =
- array = (
- [6] => array = (
- ['view'] => 0,
- ['upload'] => 0,
- ['rate'] => 0,
- ['comment'] => 1,
- ['edit'] => 0,
- ['delete'] => 0,
- ['moderator'] => 0,
- ['manage'] => 0
- )
- )
- ----------------------------------------------------
- DEBUG :
- ----------------------------------------------------
- album_read_tree : $cats =
- array = ()
- ----------------------------------------------------
- DEBUG :
- ----------------------------------------------------
- album_permissions : before album_user_access : 'Personal Gallery Of lgsbcs'(id=0), $album_permission =
- array = (
- ['view'] => 1,
- ['upload'] => 1
- )
- ----------------------------------------------------
- DEBUG :
- ----------------------------------------------------
- album_permissions : after album_user_access : 'Personal Gallery Of lgsbcs'(id=0), $album_permission =
- array = (
- ['view'] => 1,
- ['upload'] => 1
- )
- ----------------------------------------------------
- DEBUG :
- ----------------------------------------------------
- $album_config['personal_gallery'] = 0
- ----------------------------------------------------
- DEBUG :
- ----------------------------------------------------
- final : $album_permission =
- array = (
- ['view'] => 1,
- ['upload'] => 1,
- ['manage'] => 0
- )
- ----------------------------------------------------
Code: [Download] [Hide]
- DEBUG :
- ----------------------------------------------------
- album_permissions : before album_user_access : 'Personal Gallery Of lgsbcs'(id=0), $album_permission = NULL
- ----------------------------------------------------
- DEBUG :
- ----------------------------------------------------
- album_permissions : after album_user_access : 'Personal Gallery Of lgsbcs'(id=0), $album_permission =
- array = (
- ['view'] => 0,
- ['upload'] => 0,
- ['rate'] => 0,
- ['comment'] => 1,
- ['edit'] => 0,
- ['delete'] => 0,
- ['moderator'] => 0
- )
- ----------------------------------------------------
- DEBUG :
- ----------------------------------------------------
- $album_config['personal_gallery'] = 0
- ----------------------------------------------------
- DEBUG :
- ----------------------------------------------------
- final : $album_permission =
- array = (
- ['view'] => 0,
- ['upload'] => 0,
- ['rate'] => 0,
- ['comment'] => 1,
- ['edit'] => 0,
- ['delete'] => 0,
- ['moderator'] => 0,
- ['manage'] => 0
- )
- ----------------------------------------------------
- DEBUG :
- ----------------------------------------------------
- album_get_auth_keys =
- array = ()
- ----------------------------------------------------
- DEBUG :
- ----------------------------------------------------
- album_get_auth_keys =
- array = ()
- ----------------------------------------------------
- DEBUG :
- ----------------------------------------------------
- album_get_auth_keys =
- array = ()
- ----------------------------------------------------
- DEBUG :
- ----------------------------------------------------
- album_no_newest_pictures sql = 'SELECT c.cat_id, p.pic_id, COUNT(p.pic_id) AS pic_total FROM phpbb_album AS p, phpbb_album_cat AS c WHERE c.cat_id IN (6) AND p.pic_cat_id = c.cat_id AND p.pic_time >= 1199760236 GROUP BY c.cat_id'
- ----------------------------------------------------
- DEBUG :
- ----------------------------------------------------
- $pictotalrows =
- array = (
- [6] => '8'
- )
- ----------------------------------------------------
Code: [Download] [Hide]
- Could not get category comment count information
- DEBUG MODE
- SQL Error : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 3
- SELECT COUNT(comment_id) AS comment_count FROM phpbb_album_comment LEFT JOIN phpbb_album ON comment_pic_id = pic_id WHERE pic_cat_id IN ()
- Line : 1029
- File : album_hierarchy_sql.php
Any help would be greatly appreciated.
--J