// // //
//
: 0.9648 .
: 66
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 = 'ne0it71rcsed1ss9is89f9adt1' AND ip = '54.158.248.167' LIMIT 1

INSERT INTO cms_online (ip, sess_id, lastdate, user_id, agent, viewurl) VALUES ('54.158.248.167', 'ne0it71rcsed1ss9is89f9adt1', NOW(), '0', 'CCBot/2.0 (http://commoncrawl.org/faq/)', '/photos/1044')

SELECT id FROM cms_stats WHERE (ip = '54.158.248.167' AND page = '/photos/1044')

INSERT INTO cms_stats (ip, logdate, page, agent, refer) VALUES ('54.158.248.167', NOW(), '/photos/1044', '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 = '1044' ORDER BY id ASC LIMIT 1

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

SELECT NSDiffer as getfield FROM cms_photo_albums WHERE id='1044' 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=1044) AND a.published = 1 AND a.NSDiffer = ''
                GROUP BY a.id
                ORDER BY pubdate desc

SELECT 1 FROM cms_photo_albums WHERE NSLeft > 179 AND NSRight < 180

SELECT COUNT(id) as getfield FROM cms_photo_files WHERE DATE_FORMAT(pubdate, '%d-%m-%Y') = '26-09-2017' AND album_id=1175 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 = 1175
				ORDER BY RAND()
				LIMIT 1

SELECT 1 FROM cms_photo_albums WHERE NSLeft > 177 AND NSRight < 178

SELECT COUNT(id) as getfield FROM cms_photo_files WHERE DATE_FORMAT(pubdate, '%d-%m-%Y') = '26-09-2017' AND album_id=1171 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 = 1171
				ORDER BY RAND()
				LIMIT 1

SELECT 1 FROM cms_photo_albums WHERE NSLeft > 175 AND NSRight < 176

SELECT COUNT(id) as getfield FROM cms_photo_files WHERE DATE_FORMAT(pubdate, '%d-%m-%Y') = '26-09-2017' AND album_id=1112 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 = 1112
				ORDER BY RAND()
				LIMIT 1

SELECT 1 FROM cms_photo_albums WHERE NSLeft > 173 AND NSRight < 174

SELECT COUNT(id) as getfield FROM cms_photo_files WHERE DATE_FORMAT(pubdate, '%d-%m-%Y') = '26-09-2017' AND album_id=1097 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 = 1097
				ORDER BY RAND()
				LIMIT 1

SELECT 1 FROM cms_photo_albums WHERE NSLeft > 171 AND NSRight < 172

SELECT COUNT(id) as getfield FROM cms_photo_files WHERE DATE_FORMAT(pubdate, '%d-%m-%Y') = '26-09-2017' AND album_id=1087 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 = 1087
				ORDER BY RAND()
				LIMIT 1

SELECT 1 FROM cms_photo_albums WHERE NSLeft > 169 AND NSRight < 170

SELECT COUNT(id) as getfield FROM cms_photo_files WHERE DATE_FORMAT(pubdate, '%d-%m-%Y') = '26-09-2017' AND album_id=1054 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 = 1054
				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 = 1044  AND f.published = 1
					 ORDER BY pubdate desc 
LIMIT 0, 20

SELECT 1 FROM cms_photo_files WHERE album_id = 1044

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

SELECT id FROM cms_comments WHERE target = 'photo' AND target_id = '2832' 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