Hi
I have done some research on this:
I created a testalbum in the category without any albums (as mentioned in last post). No effect, the pictures still not present in the random or topn sections.
Then I enabled debugmode, and saw as I already knew that the categories were not parsed.
At the bottom of this post is included the queries referenced below from the request of the HOMEpage:
(
http://fotoalbum.serveftp.net/index.php)
Query[12] returns the category in question (category=6)
Query[13] returns nothing as there are no albums there
Query[14] returns 0 (of course as there still is no albums...)
Query[16] returns the useralbums, which means it never parsed the subcategories in the category in question (category = 6)
Query[18-22] Then it continues to the other "root"categories (10 & 11)
Query[23] The field 'category' in the table cpg11d_albums is an int(11) in the database, but in this query it's a string? Why is this?
Hopefully this can lead some of you developers on track of this problem.
I have only researched this in the database, as I unfortunately don't know PHP.
I am quite positive that this problem occured after I updated all files from CVS, and ran update.php. on this Tuesday
The previous time I did this was two weeks ago.
John
==========================
Queries:
------------------
Array
(
- => SELECT extension, mime, content FROM cpg11d_filetypes;
[1] => SELECT * FROM cpg11d_users WHERE user_id='2'AND user_active = 'YES' AND user_password != '' AND BINARY MD5(user_password) = '69fdb858fc70373879e6b775333dabe5'
[2] => SELECT MAX(group_quota) as disk_max, MIN(group_quota) as disk_min, MAX(can_rate_pictures) as can_rate_pictures, MAX(can_send_ecards) as can_send_ecards, MAX(upload_form_config) as ufc_max, MIN(upload_form_config) as ufc_min, MAX(custom_user_upload) as custom_user_upload, MAX(num_file_upload) as num_file_upload, MAX(num_URI_upload) as num_URI_upload, MAX(can_post_comments) as can_post_comments, MAX(can_upload_pictures) as can_upload_pictures, MAX(can_create_albums) as can_create_albums, MAX(has_admin_access) as has_admin_access, MIN(pub_upl_need_approval) as pub_upl_need_approval, MIN( priv_upl_need_approval) as priv_upl_need_approval FROM cpg11d_usergroups WHERE group_id in (2,1)
[3] => SELECT group_name FROM cpg11d_usergroups WHERE group_id= 1
[4] => DELETE FROM cpg11d_banned WHERE expiry < 1086974883
[5] => SELECT * FROM cpg11d_banned WHERE ip_addr='192.168.0.101' OR ip_addr='192.168.0.101' OR user_id=2
[6] => SELECT * FROM cpg11d_online WHERE user_ip = '192.168.0.101' AND user_id = 2
[7] => UPDATE cpg11d_online SET last_action = NOW() WHERE user_ip = '192.168.0.101' AND user_id = 2
[8] => DELETE FROM cpg11d_online WHERE last_action < NOW() - INTERVAL 5 MINUTE
[9] => SELECT cid, name, description, thumb FROM cpg11d_categories WHERE parent = '' ORDER BY pos
[10] => SELECT aid FROM cpg11d_albums WHERE category = 4
[11] => SELECT count(*) FROM cpg11d_pictures, cpg11d_albums WHERE cpg11d_pictures.aid = cpg11d_albums.aid AND category = 4
[12] => SELECT cid, name, description, thumb FROM cpg11d_categories WHERE parent = '4' ORDER BY pos
[13] => SELECT aid FROM cpg11d_albums WHERE category = 6
[14] => SELECT count(*) FROM cpg11d_pictures, cpg11d_albums WHERE cpg11d_pictures.aid = cpg11d_albums.aid AND category = 6
[15] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg11d_pictures WHERE pid='641'
[16] => SELECT aid FROM cpg11d_albums WHERE category>=10000
[17] => SELECT count(*) FROM cpg11d_pictures, cpg11d_albums WHERE cpg11d_pictures.aid = cpg11d_albums.aid AND category >= 10000
[18] => SELECT aid FROM cpg11d_albums WHERE category = 10
[19] => SELECT count(*) FROM cpg11d_pictures, cpg11d_albums WHERE cpg11d_pictures.aid = cpg11d_albums.aid AND category = 10
[20] => SELECT aid FROM cpg11d_albums WHERE category = 11
[21] => SELECT count(*) FROM cpg11d_pictures, cpg11d_albums WHERE cpg11d_pictures.aid = cpg11d_albums.aid AND category = 11
[22] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg11d_pictures WHERE pid='477'
[23] => SELECT aid FROM cpg11d_albums as a WHERE category = '0'
[24] => SELECT count(*) FROM cpg11d_albums as a WHERE category>0
[25] => SELECT count(*) FROM cpg11d_pictures as p LEFT JOIN cpg11d_albums as a ON a.aid=p.aid WHERE a.category>=0
[26] => SELECT count(*) FROM cpg11d_comments as c LEFT JOIN cpg11d_pictures as p ON c.pid=p.pid LEFT JOIN cpg11d_albums as a ON a.aid=p.aid WHERE a.category>=0
[27] => SELECT count(*) FROM cpg11d_categories WHERE 1
[28] => SELECT sum(hits) FROM cpg11d_pictures as p LEFT JOIN cpg11d_albums as a ON p.aid=a.aid WHERE a.category>=0
[29] => SELECT count(*) FROM cpg11d_albums as a WHERE category = '0'
[30] => SELECT COUNT(*) from cpg11d_pictures WHERE approved = 'YES' AND aid IN (3,6,29,30,31,32,33,24,27,28)
[31] => SELECT pid, filepath, filename, url_prefix, filesize, pwidth, pheight, ctime, aid, aid FROM cpg11d_pictures WHERE approved = 'YES' AND aid IN (3,6,29,30,31,32,33,24,27,28) ORDER BY RAND() LIMIT 5
[32] => SELECT COUNT(*) from cpg11d_pictures WHERE approved = 'YES' AND hits > 0 AND aid IN (3,6,29,30,31,32,33,24,27,28)
[33] => SELECT pid, filepath, filename, url_prefix, filesize, pwidth, pheight, ctime, aid, hits, aid, filename FROM cpg11d_pictures WHERE approved = 'YES'AND hits > 0 AND aid IN (3,6,29,30,31,32,33,24,27,28) ORDER BY hits DESC, filename LIMIT 0 ,5
[34] => SELECT COUNT(*) from cpg11d_pictures WHERE approved = 'YES' AND aid IN (3,6,29,30,31,32,33,24,27,28)
[35] => SELECT pid, filepath, filename, url_prefix, filesize, pwidth, pheight, ctime, aid,title, caption, owner_id, owner_name, aid FROM cpg11d_pictures WHERE approved = 'YES' AND aid IN (3,6,29,30,31,32,33,24,27,28) ORDER BY pid DESC LIMIT 0 ,5
[36] => SELECT COUNT(*) FROM cpg11d_users
[37] => SELECT COUNT(*) FROM cpg11d_online
[38] => SELECT COUNT(*) FROM cpg11d_online WHERE user_id <> 0
[39] => SELECT user_id, user_name FROM cpg11d_users ORDER BY user_id DESC LIMIT 1
[40] => SELECT user_id FROM cpg11d_online WHERE user_id <> 0
[41] => SELECT user_name FROM cpg11d_users WHERE user_id = '2'
)