// // //
//
: 0.3772 .
: 47
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 = 'jl5ted8aljcc4a3i2144beao32' AND ip = '54.163.20.57' LIMIT 1

INSERT INTO cms_online (ip, sess_id, lastdate, user_id, agent, viewurl) VALUES ('54.163.20.57', 'jl5ted8aljcc4a3i2144beao32', NOW(), '0', 'CCBot/2.0 (https://commoncrawl.org/faq/)', '/blogs')

SELECT id FROM cms_stats WHERE (ip = '54.163.20.57' AND page = '/blogs')

INSERT INTO cms_stats (ip, logdate, page, agent, refer) VALUES ('54.163.20.57', NOW(), '/blogs', 'CCBot/2.0 (https://commoncrawl.org/faq/)', '')

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

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

SELECT 1 FROM cms_blogs WHERE ownertype='single' AND owner='user'

SELECT 1 FROM cms_blogs WHERE ownertype='multi' AND owner='user'

SELECT p.user_id, b.allow_who
				FROM cms_blog_posts p
				LEFT JOIN cms_blogs b ON b.id = p.blog_id
				WHERE p.published = 1

SELECT p.*, p.pubdate as fpubdate,
                       IFNULL(r.total_rating, 0) as points,
                       u.nickname as author, u.id as author_id, u.login,
                       b.allow_who blog_allow_who,
                       b.seolink bloglink,
                       b.title blog_title,
                       b.owner owner,
                       c.title as club_title,
                       c.clubtype as club_type
                FROM cms_blog_posts p
				LEFT JOIN cms_users u ON u.id = p.user_id				
				LEFT JOIN cms_blogs b ON b.id = p.blog_id
                LEFT JOIN cms_clubs c ON c.id = b.user_id
                LEFT JOIN cms_ratings_total r ON r.item_id=p.id AND r.target='blogpost'
                WHERE p.published = 1
                ORDER BY p.pubdate DESC
                LIMIT 0, 10

SELECT id FROM cms_comments WHERE target = 'blog' AND target_id = '16060' AND published = 1

SELECT tag
			FROM cms_tags 
			WHERE target='blogpost' AND item_id='16060'
			ORDER BY tag DESC

SELECT id FROM cms_comments WHERE target = 'blog' AND target_id = '16059' AND published = 1

SELECT tag
			FROM cms_tags 
			WHERE target='blogpost' AND item_id='16059'
			ORDER BY tag DESC

SELECT id FROM cms_comments WHERE target = 'blog' AND target_id = '16058' AND published = 1

SELECT tag
			FROM cms_tags 
			WHERE target='blogpost' AND item_id='16058'
			ORDER BY tag DESC

SELECT id FROM cms_comments WHERE target = 'blog' AND target_id = '16057' AND published = 1

SELECT tag
			FROM cms_tags 
			WHERE target='blogpost' AND item_id='16057'
			ORDER BY tag DESC

SELECT id FROM cms_comments WHERE target = 'blog' AND target_id = '16056' AND published = 1

SELECT tag
			FROM cms_tags 
			WHERE target='blogpost' AND item_id='16056'
			ORDER BY tag DESC

SELECT id FROM cms_comments WHERE target = 'blog' AND target_id = '16055' AND published = 1

SELECT tag
			FROM cms_tags 
			WHERE target='blogpost' AND item_id='16055'
			ORDER BY tag DESC

SELECT id FROM cms_comments WHERE target = 'blog' AND target_id = '16054' AND published = 1

SELECT tag
			FROM cms_tags 
			WHERE target='blogpost' AND item_id='16054'
			ORDER BY tag DESC

SELECT id FROM cms_comments WHERE target = 'blog' AND target_id = '16053' AND published = 1

SELECT tag
			FROM cms_tags 
			WHERE target='blogpost' AND item_id='16053'
			ORDER BY tag DESC

SELECT id FROM cms_comments WHERE target = 'blog' AND target_id = '16052' AND published = 1

SELECT tag
			FROM cms_tags 
			WHERE target='blogpost' AND item_id='16052'
			ORDER BY tag DESC

SELECT id FROM cms_comments WHERE target = 'blog' AND target_id = '4671' AND published = 1

SELECT tag
			FROM cms_tags 
			WHERE target='blogpost' AND item_id='4671'
			ORDER BY tag DESC

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 = '17' OR mb.menu_id = 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 = '17' OR mb.menu_id = 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 = '17' OR mb.menu_id = 0)
                  
            ORDER BY m.ordering ASC

SELECT NSLeft, NSRight, NSLevel FROM cms_menu WHERE id = '17' 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 < 66 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 = '17' OR mb.menu_id = 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 = '17' OR mb.menu_id = 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 = 'sidebar') AND
                  m.published = 1 AND
                  m.id = mb.module_id AND
                  (mb.menu_id = '17' OR mb.menu_id = 0)
                  
            ORDER BY m.ordering ASC

SELECT  p.id,
		                p.title,
						p.seolink,
						p.pubdate,
                        b.title as blog,
                        b.id as blog_id,
                        b.seolink as bloglink,
                        b.owner as owner,
                        b.user_id as uid, 
                        b.owner as owner,
                        b.ownertype as ownertype,
                        IFNULL(r.total_rating, 0) as points,
                        u.nickname as author
				FROM cms_blog_posts p
				LEFT JOIN cms_blogs b ON b.id = p.blog_id		
				LEFT JOIN cms_ratings_total r ON r.item_id=p.id AND r.target='blogpost'
				LEFT JOIN cms_users u ON u.id=b.user_id
				WHERE p.published = 1 AND b.allow_who = 'all'
				ORDER BY points DESC
LIMIT 10