<?php include 'sistemaJP.php'; if (isset($_POST['action'])) { switch ($_POST['action']) { case 'menu': menu(); break; case 'subMenu': subMenu(); break; case 'salvarUsuario': salvarUsuario(); break; case 'salvarMenu': salvarMenu(); break; case 'pesquisarUsuario': pesquisarUsuario(); break; case 'pesquisarMenuUsuario': pesquisarMenuUsuario(); break; case 'pesquisarSubMenuUsuario': pesquisarSubMenuUsuario(); break; case 'excluir': excluir(); break; case 'editarUsuario': editarUsuario();
} ?> <span class="menu-text"> <?php echo $lstModulos['nombreModulo']; ?> <i class="menu-expand"></i> </span> </a> <!--subMenu--> <ul class="submenu" style="display: none"> <?php subMenu($idUsuarioM['idUsuario'], $lstModulos['nombreModulo']); ?> </ul> </li> <?php } } catch (PDOException $e) { echo 'Error: ' . $e; } ?> </ul> </div>
function blogPosts() { $options = get_option('blog_options'); !empty($options['date']) ? $date_format = $options['date'] : ($date_format = 'd.m.Y'); $posts = get_posts(array('posts_per_page' => 4, 'offset' => $_POST['offset'])); ob_start(); $i = $_POST['count']; $options['list_meta'] == 'true' ? $height = 'height: 144px;' : ($height = ''); foreach ($posts as $key => $value) { $title = $value->post_title; if (strlen($title) > 33) { $title = substr($title, 0, 33) . '...'; } $slug = $value->post_name; $author = get_the_author_meta('nickname', $value->post_author); $date = get_the_time($date_format, $value->ID); $comments = wp_count_comments($value->ID); if (comments_open($value->ID)) { $comments = '<i class="fa fa-comment"></i> ' . $comments->approved; } else { $comments = ''; } $content = $value->post_content; $thumbnail = wp_get_attachment_url(get_post_thumbnail_id($value->ID)); if ($thumbnail && strlen($content) > 150) { $content = substr($content, 0, 150) . '...'; } elseif (strlen($content) > 189) { $content = substr($content, 0, 189) . '...'; } $options['author_info'] == 'true' ? $author = '' : ($author = $author . ', '); ?> <div class="span6" style="display: none; <?php echo $height; ?> "> <a class="blogpost" href="#<?php echo $slug; ?> " onclick="gotoPage(<?php echo $i++; ?> , 7)"> <h2><?php echo $title; ?> </h2> <?php if (empty($options['list_meta']) or $options['list_meta'] == 'false') { ?> <span class="post-meta"><?php echo $author; echo $date; ?> <?php echo $comments; ?> </span> <?php } ?> <?php if ($thumbnail) { ?> <div class="thumbnail" style="background-image: url(<?php echo $thumbnail; ?> )"></div> <?php } ?> <p><?php echo strip_tags($content); ?> </p> </a> </div> <?php } $list = ob_get_clean(); $i = $_POST['count']; $metrika_menu = get_option('metrika_menu'); $blog_page = get_option('blog_page'); $blog_post = get_post($blog_page); $blog_slug = $blog_post->post_name; foreach ($metrika_menu as $key => $value) { if (array_search($blog_page, $value)) { $menu_key = $key; break; } } if (empty($blog_page)) { $blog_page = 0; } global $user_level; if ($user_level == 0) { @($form_args = array('comment_notes_after' => '', 'comment_field' => '<fieldset class="span6 comment-form-comment"><textarea id="comment" placeholder="' . __('Comment *', 'metrika') . '" name="comment" cols="45" rows="8" aria-required="true">' . '</textarea></fieldset></div>', 'fields' => apply_filters('comment_form_default_fields', array('author' => '<div class="container"><fieldset class="span6">' . ($req ? '<span class="required">*</span>' : '') . '<input id="author" placeholder="' . __('Name *', 'metrika') . '" name="author" type="text" value="' . esc_attr($commenter['comment_author']) . '" size="30"' . $aria_req . ' /><input id="spam_bot" type="hidden">', 'email' => ($req ? '<span class="required">*</span>' : '') . '<input id="email" placeholder="' . __('E-mail *', 'metrika') . '" name="email" type="email" value="' . esc_attr($commenter['comment_author_email']) . '" size="30"' . $aria_req . ' /></fieldset>', 'url' => '')))); } else { $form_args = array('comment_notes_after' => '', 'comment_field' => '<div class="container"><fieldset class="span12 comment-form-comment"><textarea id="comment" placeholder="' . __('Comment *', 'metrika') . '" name="comment" cols="45" rows="8" aria-required="true">' . '</textarea></fieldset></div>'); } ob_start(); foreach ($posts as $key => $value) { $slug = $value->post_name; $title = $value->post_title; $author = get_the_author_meta('nickname', $value->post_author); $date = get_the_time($date_format, $value->ID); $comments = wp_count_comments($value->ID); if (comments_open($value->ID)) { $comments = '<i class="fa fa-comment"></i> ' . $comments->approved; } else { $comments = ''; } $options['author_info'] == 'true' ? $author = '' : ($author = $author . ', '); ?> <style> .pt-page-<?php echo $i; ?> textarea, .pt-page-<?php echo $i; ?> input[type=submit] { color: <?php echo $metrika_menu[$menu_key]['color']; ?> ; } .pt-page-<?php echo $i; ?> input::-webkit-input-placeholder {color: <?php echo $metrika_menu[$menu_key]['color']; ?> ;} .pt-page-<?php echo $i; ?> input:-moz-placeholder {color: <?php echo $metrika_menu[$menu_key]['color']; ?> ;} .pt-page-<?php echo $i; ?> input::-moz-placeholder {color: <?php echo $metrika_menu[$menu_key]['color']; ?> ;} .pt-page-<?php echo $i; ?> input:-ms-input-placeholder {color: <?php echo $metrika_menu[$menu_key]['color']; ?> ;} .pt-page-<?php echo $i; ?> textarea::-webkit-input-placeholder {color: <?php echo $metrika_menu[$menu_key]['color']; ?> ;} .pt-page-<?php echo $i; ?> textarea:-moz-placeholder {color: <?php echo $metrika_menu[$menu_key]['color']; ?> ;} .pt-page-<?php echo $i; ?> textarea::-moz-placeholder {color: <?php echo $metrika_menu[$menu_key]['color']; ?> ;} .pt-page-<?php echo $i; ?> textarea:-ms-input-placeholder {color: <?php echo $metrika_menu[$menu_key]['color']; ?> ;} </style> <article class="post pt-page pt-page-<?php echo $i; ?> " id="<?php echo $slug; ?> " originalclasslist="pt-page pt-page-<?php echo $i++; ?> "> <div class="outer-wrapper" style="background-color: <?php echo $metrika_menu[$menu_key]['color']; ?> ;"> <!--Header--> <header class="row-fluid"> <div class="container"> <div class="span8 relative"> <?php $header_options = get_option('page_header_options'); ?> <?php if (empty($header_options['home_button'])) { $header_options['home_button'] = 'true'; } ?> <?php if (empty($header_options['prev_button'])) { $header_options['prev_button'] = 'true'; } ?> <div class="page-navi"> <?php if ($header_options['home_button'] == 'true') { ?> <?php if (!empty($header_options['home_animation']) && $header_options['home_animation'] != '0') { ?> <a class="home-page page-transition" href="#" onclick="gotoPage(0, <?php echo $header_options['home_animation']; ?> )" title="<?php _e('Go Home', 'metrika'); ?> "></a> <?php } else { ?> <a class="home-page page-transition" href="#" onclick="gotoPage(0, 6)" title="<?php _e('Go Home', 'metrika'); ?> "></a> <?php } ?> <?php } ?> <?php if (!empty($header_options['prev_button']) && $header_options['prev_button'] == 'true') { ?> <?php if ($header_options['prev_animation'] != '0') { ?> <a page="<?php echo $prevPage; ?> " class="prev-page page-transition" href="#<?php echo $blog_slug; ?> " onclick="gotoPage(<?php echo $_POST['blog_page_id']; ?> , <?php echo $header_options['prev_animation']; ?> )" title="<?php _e('Go To Blog Page', 'metrika'); ?> "></a> <?php } else { ?> <a page="<?php echo $prevPage; ?> " class="prev-page page-transition" href="#<?php echo $blog_slug; ?> " onclick="gotoPage(<?php echo $_POST['blog_page_id']; ?> , 2)" title="<?php _e('Go To Blog Page', 'metrika'); ?> "></a> <?php } ?> <?php } ?> </div> <h1><?php echo get_the_title($blog_page); ?> </h1> <?php subMenu($blog_page); ?> </div> <div class="span4"> <?php $buttons = get_option('header_social_buttons'); ?> <?php if (!empty($buttons)) { ?> <?php $style_a = ''; ?> <?php $style_i = ''; ?> <?php if (empty($buttons['page_icon_color_type'])) { $buttons['page_icon_color_type'] = 'black'; } ?> <?php if ($buttons['page_icon_color_type'] == 'black') { ?> <ul class="social-bar-black"> <?php } elseif ($buttons['page_icon_color_type'] == 'white') { ?> <ul class="social-bar-white"> <?php } elseif ($buttons['page_icon_color_type'] == 'custom') { ?> <ul class="social-bar-black"> <?php if (empty($buttons['page_icon_color'])) { $buttons['page_icon_color'] = '#50b28a'; } ?> <?php $style_a = "style='border-color: " . $buttons['page_icon_color'] . "'"; ?> <?php $style_i = "style='color: " . $buttons['page_icon_color'] . "'"; ?> <?php } else { ?> <ul class="social-bar-black"> <?php } ?> <?php if (!empty($buttons['icons'])) { ?> <?php foreach ($buttons['icons'] as $item) { echo '<li><a ' . $style_a . ' href="' . $item['url'] . '" target="_blank"><i ' . $style_i . ' class="fa fa-' . $item['type'] . '"></i></a></li>'; } ?> <?php } ?> </ul> <?php } ?> </div> </div> </header> <!--Content--> <section class="row-fluid"> <div class="single-post-content"> <div class="container"> <h2><?php echo $title; ?> </h2> <?php if (empty($options['single_meta']) or $options['single_meta'] == 'false') { ?> <span class="post-meta"><?php echo $author; echo $date; ?> <?php echo $comments; ?> </span> <?php } ?> <?php echo apply_filters('the_content', $value->post_content); ?> </div> <?php if (comments_open($value->ID)) { ?> <?php $comments = get_comments(array('post_id' => $value->ID, 'status' => 'approve', 'order' => 'ASC')); ?> <?php if ($comments) { ?> <div class="container comments"> <h2><?php _e('Comments', 'metrika'); ?> </h2> <div class="comments-wrapper clearfix"> <div class="timeline"><span class="timeline-track"></span><span class="timeline-arrow"></span></div> <?php $j = 0; ?> <?php foreach ($comments as $comment) { ?> <?php ++$j % 2 ? $pointer = 'right' : ($pointer = 'left'); ?> <?php $j % 2 ? $col = '' : ($col = 'last-col'); ?> <div class="comment <?php echo $col; ?> "> <span class="figcap"></span> <span class="pointer-<?php echo $pointer; ?> "></span> <span class="comment-meta"><?php echo $comment->comment_author; ?> , <?php echo $comment->comment_date; ?> </span> <?php echo apply_filters('the_content', $comment->comment_content); ?> </div> <?php } ?> </div> </div> <?php } ?> <div class="container comment-form"> <h2><?php _e('Leave a Reply', 'metrika'); ?> </h2> <?php comment_form($form_args, $value->ID); ?> </div> <?php } ?> </div> </section> <div class="push"></div> </div> <!--Footer--> <footer> <div class="container"> <?php $copyright = get_option('copyright'); ?> <?php if (!empty($copyright['copyright'])) { ?> <?php if (!empty($copyright['auto_date']) && $copyright['auto_date'] == 'true') { $date = date('Y'); } ?> <?php if (empty($copyright['page_copyright_type'])) { $copyright['page_copyright_type'] = 'black'; } ?> <?php if ($copyright['page_copyright_type'] == 'black') { ?> <p class="dark"><?php echo $copyright['copyright']; ?> <?php echo $date; ?> </p> <?php } elseif ($copyright['page_copyright_type'] == 'white') { ?> <p><?php echo $copyright['copyright']; ?> <?php echo $date; ?> </p> <?php } else { ?> <?php if (empty($copyright['page_copyright_color'])) { $copyright['page_copyright_color'] = '#50b28a'; } ?> <p style="color: <?php echo $copyright['page_copyright_color']; ?> "><?php echo $copyright['copyright']; ?> <?php echo $date; ?> </p> <?php } ?> <?php } ?> </div> </footer> </article> <?php } $posts = ob_get_clean(); ob_start(); $post_count = wp_count_posts('post'); if ($post_count->publish > 4 && $post_count->publish > $_POST['offset'] + 4) { ?> <div class="container blogpost-row load-more-container"> <a class="load-more-btn" href="#"><span class="figcap"></span><p><?php _e('Load more', 'metrika'); ?> </p></a> </div> <?php } $load_more = ob_get_clean(); $content = array('list' => $list, 'posts' => $posts, 'more' => $load_more); echo json_encode($content); die; }
_e('Go To Next Page', 'metrika'); ?> "></a> <?php } ?> <?php } ?> </div> <h1><?php echo $post->post_title; ?> </h1> <?php subMenu($item['page_id']); ?> </div> <div class="span4"> <?php $buttons = get_option('header_social_buttons'); ?> <?php if (!empty($buttons)) { ?> <?php $style_a = ''; ?> <?php $style_i = ''; ?>