// // //
//
: 2.4599 .
: 106
SET NAMES cp1251

SELECT * FROM cms_menu ORDER BY id ASC

SELECT id, title, link, config, internal, published, version, system FROM cms_components

SELECT p.id, p.plugin, p.config, e.event FROM cms_plugins p, cms_event_hooks e WHERE p.published = 1 AND e.plugin_id = p.id

SELECT id FROM cms_user_groups WHERE alias = 'guest'

DELETE FROM cms_online WHERE lastdate <= DATE_SUB(NOW(), INTERVAL 3 MINUTE)

SELECT id as getfield FROM cms_online WHERE sess_id = '8picqd1j3ovfl6dib5a5cuh8m6' AND ip = '54.145.117.60' LIMIT 1

INSERT INTO cms_online (ip, sess_id, lastdate, user_id, agent, viewurl) VALUES ('54.145.117.60', '8picqd1j3ovfl6dib5a5cuh8m6', NOW(), '0', 'CCBot/2.0 (http://commoncrawl.org/faq/)', '/photos/1073')

SELECT id FROM cms_stats WHERE (ip = '54.145.117.60' AND page = '/photos/1073')

INSERT INTO cms_stats (ip, logdate, page, agent, refer) VALUES ('54.145.117.60', NOW(), '/photos/1073', 'CCBot/2.0 (http://commoncrawl.org/faq/)', '')

SELECT NSLeft, NSRight FROM cms_menu WHERE id = '20'

SELECT id, title, link, linktype
                           FROM cms_menu
                           WHERE NSLeft <= 36 AND NSRight >= 41 AND parent_id > 0
                           ORDER BY NSLeft

SELECT id, title FROM cms_photo_albums WHERE parent_id=0 AND NSDiffer='' ORDER BY id ASC LIMIT 1

SELECT * FROM cms_photo_albums WHERE id = '1073' ORDER BY id ASC LIMIT 1

SELECT id, title, NSLevel FROM cms_photo_albums WHERE NSLeft <= 192 AND NSRight >= 223 AND parent_id > 0 AND NSDiffer = '' ORDER BY NSLeft

SELECT NSDiffer as getfield FROM cms_photo_albums WHERE id='1073' LIMIT 1

SELECT a.*, IFNULL(COUNT(f.id), 0) as content_count
                FROM cms_photo_albums a
                LEFT JOIN cms_photo_files f ON f.album_id = a.id AND f.published = 1
                WHERE (a.parent_id=1073) AND a.published = 1 AND a.NSDiffer = ''
                GROUP BY a.id
                ORDER BY pubdate desc

SELECT 1 FROM cms_photo_albums WHERE NSLeft > 221 AND NSRight < 222

SELECT COUNT(id) as getfield FROM cms_photo_files WHERE DATE_FORMAT(pubdate, '%d-%m-%Y') = '18-11-2017' AND album_id=1169 LIMIT 1

SELECT f.file
				FROM cms_photo_files f, cms_photo_albums a
				WHERE f.published = 1 AND f.album_id = a.id AND f.album_id = 1169
				ORDER BY RAND()
				LIMIT 1

SELECT 1 FROM cms_photo_albums WHERE NSLeft > 219 AND NSRight < 220

SELECT COUNT(id) as getfield FROM cms_photo_files WHERE DATE_FORMAT(pubdate, '%d-%m-%Y') = '18-11-2017' AND album_id=1168 LIMIT 1

SELECT f.file
				FROM cms_photo_files f, cms_photo_albums a
				WHERE f.published = 1 AND f.album_id = a.id AND f.album_id = 1168
				ORDER BY RAND()
				LIMIT 1

SELECT 1 FROM cms_photo_albums WHERE NSLeft > 217 AND NSRight < 218

SELECT COUNT(id) as getfield FROM cms_photo_files WHERE DATE_FORMAT(pubdate, '%d-%m-%Y') = '18-11-2017' AND album_id=1167 LIMIT 1

SELECT f.file
				FROM cms_photo_files f, cms_photo_albums a
				WHERE f.published = 1 AND f.album_id = a.id AND f.album_id = 1167
				ORDER BY RAND()
				LIMIT 1

SELECT 1 FROM cms_photo_albums WHERE NSLeft > 215 AND NSRight < 216

SELECT COUNT(id) as getfield FROM cms_photo_files WHERE DATE_FORMAT(pubdate, '%d-%m-%Y') = '18-11-2017' AND album_id=1162 LIMIT 1

SELECT f.file
				FROM cms_photo_files f, cms_photo_albums a
				WHERE f.published = 1 AND f.album_id = a.id AND f.album_id = 1162
				ORDER BY RAND()
				LIMIT 1

SELECT 1 FROM cms_photo_albums WHERE NSLeft > 205 AND NSRight < 214

SELECT COUNT(id) as getfield FROM cms_photo_files WHERE DATE_FORMAT(pubdate, '%d-%m-%Y') = '18-11-2017' AND album_id=1156 LIMIT 1

SELECT f.file
				FROM cms_photo_files f, cms_photo_albums a
				WHERE f.published = 1 AND f.album_id = a.id AND f.album_id = 1156
				ORDER BY RAND()
				LIMIT 1

SELECT 1 FROM cms_photo_albums WHERE NSLeft > 203 AND NSRight < 204

SELECT COUNT(id) as getfield FROM cms_photo_files WHERE DATE_FORMAT(pubdate, '%d-%m-%Y') = '18-11-2017' AND album_id=1153 LIMIT 1

SELECT f.file
				FROM cms_photo_files f, cms_photo_albums a
				WHERE f.published = 1 AND f.album_id = a.id AND f.album_id = 1153
				ORDER BY RAND()
				LIMIT 1

SELECT 1 FROM cms_photo_albums WHERE NSLeft > 201 AND NSRight < 202

SELECT COUNT(id) as getfield FROM cms_photo_files WHERE DATE_FORMAT(pubdate, '%d-%m-%Y') = '18-11-2017' AND album_id=1145 LIMIT 1

SELECT f.file
				FROM cms_photo_files f, cms_photo_albums a
				WHERE f.published = 1 AND f.album_id = a.id AND f.album_id = 1145
				ORDER BY RAND()
				LIMIT 1

SELECT 1 FROM cms_photo_albums WHERE NSLeft > 199 AND NSRight < 200

SELECT COUNT(id) as getfield FROM cms_photo_files WHERE DATE_FORMAT(pubdate, '%d-%m-%Y') = '18-11-2017' AND album_id=1143 LIMIT 1

SELECT f.file
				FROM cms_photo_files f, cms_photo_albums a
				WHERE f.published = 1 AND f.album_id = a.id AND f.album_id = 1143
				ORDER BY RAND()
				LIMIT 1

SELECT 1 FROM cms_photo_albums WHERE NSLeft > 197 AND NSRight < 198

SELECT COUNT(id) as getfield FROM cms_photo_files WHERE DATE_FORMAT(pubdate, '%d-%m-%Y') = '18-11-2017' AND album_id=1107 LIMIT 1

SELECT f.file
				FROM cms_photo_files f, cms_photo_albums a
				WHERE f.published = 1 AND f.album_id = a.id AND f.album_id = 1107
				ORDER BY RAND()
				LIMIT 1

SELECT 1 FROM cms_photo_albums WHERE NSLeft > 195 AND NSRight < 196

SELECT COUNT(id) as getfield FROM cms_photo_files WHERE DATE_FORMAT(pubdate, '%d-%m-%Y') = '18-11-2017' AND album_id=1075 LIMIT 1

SELECT f.file
				FROM cms_photo_files f, cms_photo_albums a
				WHERE f.published = 1 AND f.album_id = a.id AND f.album_id = 1075
				ORDER BY RAND()
				LIMIT 1

SELECT 1 FROM cms_photo_albums WHERE NSLeft > 193 AND NSRight < 194

SELECT COUNT(id) as getfield FROM cms_photo_files WHERE DATE_FORMAT(pubdate, '%d-%m-%Y') = '18-11-2017' AND album_id=1039 LIMIT 1

SELECT f.file
				FROM cms_photo_files f, cms_photo_albums a
				WHERE f.published = 1 AND f.album_id = a.id AND f.album_id = 1039
				ORDER BY RAND()
				LIMIT 1

SELECT f.*,
                            IFNULL(r.total_rating, 0) as rating
					FROM cms_photo_files f
					LEFT JOIN cms_ratings_total r ON r.item_id=f.id AND r.target='photo'
					WHERE f.album_id = 1073  AND f.published = 1
					 ORDER BY pubdate desc 
LIMIT 0, 50

SELECT 1 FROM cms_photo_files WHERE album_id = 1073

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '3887' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '3886' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '3885' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '3884' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '3881' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '3882' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '3883' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '3880' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '3879' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '3825' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '3824' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '3823' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '3822' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '3821' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '3820' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '3819' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '3818' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '3632' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '3495' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '3260' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '3259' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '3258' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '3257' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '3098' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '3096' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '3095' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '3094' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '3093' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '2884' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '2883' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '2837' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '2836' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '2465' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '2464' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '2463' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '2462' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '2461' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '2460' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '2459' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '2458' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '2330' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '2329' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '2214' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '2173' AND published = 1

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '2146' AND published = 1

SELECT m.access_list
            FROM cms_modules m, cms_modules_bind mb
            WHERE mb.position = 'top' AND
                  m.published = 1 AND
                  m.id = mb.module_id AND
                  (mb.menu_id = '20' OR mb.menu_id = 0)
                  AND (m.is_strict_bind = 0)

SELECT m.access_list
            FROM cms_modules m, cms_modules_bind mb
            WHERE mb.position = 'sidebar' AND
                  m.published = 1 AND
                  m.id = mb.module_id AND
                  (mb.menu_id = '20' OR mb.menu_id = 0)
                  AND (m.is_strict_bind = 0)

SELECT *, m.id as mid, m.template as tpl
            FROM cms_modules m, cms_modules_bind mb
            WHERE (mb.position = 'topmenu') AND
                  m.published = 1 AND
                  m.id = mb.module_id AND
                  (mb.menu_id = '20' OR mb.menu_id = 0)
                  AND (m.is_strict_bind = 0)
            ORDER BY m.ordering ASC

SELECT NSLeft, NSRight, NSLevel FROM cms_menu WHERE id = '20' ORDER BY id ASC LIMIT 1

SELECT id as getfield FROM cms_menu WHERE parent_id=0 LIMIT 1

SELECT * FROM cms_menu WHERE id = 1 AND NSDiffer = ''

SELECT * FROM cms_menu WHERE NSLeft > 1 AND NSRight < 64 AND NSDiffer = '' ORDER BY NSLeft,ordering

SELECT *, m.id as mid, m.template as tpl
            FROM cms_modules m, cms_modules_bind mb
            WHERE (mb.position = 'maintop') AND
                  m.published = 1 AND
                  m.id = mb.module_id AND
                  (mb.menu_id = '20' OR mb.menu_id = 0)
                  AND (m.is_strict_bind = 0)
            ORDER BY m.ordering ASC

SELECT *, m.id as mid, m.template as tpl
            FROM cms_modules m, cms_modules_bind mb
            WHERE (mb.position = 'mainbottom') AND
                  m.published = 1 AND
                  m.id = mb.module_id AND
                  (mb.menu_id = '20' OR mb.menu_id = 0)
                  AND (m.is_strict_bind = 0)
            ORDER BY m.ordering ASC