Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ IonCube v8.3 Loader By DoraemonPT
- * @ PHP 5.3
- * @ Decoder version : 1.0.0.7
- * @ Author : DoraemonPT
- * @ Release on : 09.05.2014
- * @ Website : http://EasyToYou.eu
- *
- **/
- function mon_is_weblic($url) {
- $url = str_replace( array( 'http://', 'https://', 'www.' ), '', $url );
- $url = trim( esc_html( strip_tags( stripslashes( $url ) ) ) );
- return $url;
- }
- function monbo_favicon_template() {
- if ($favicon = monchange( 'favicon' )) {
- $wp_filetype = wp_check_filetype( null );
- $favicon = basename( $favicon );
- $favicon = '/wp-content/plugins/monbo/images/'.$favicon.'"';
- }
- echo '<link rel="shortcut icon" href="';
- echo $favicon;
- echo '" type="';
- echo $wp_filetype['type'];
- echo '" />
- <link rel="icon" href="';
- echo $favicon;
- echo '" type="';
- echo $wp_filetype['type'];
- echo '" />
- ';
- }
- function monbo_logotype($logo = '') {
- global $site_url;
- $is_front_page = is_front_page( );
- $newlogo = monchange( 'logotype' );
- if (!$newlogo) {
- $newlogo = $is_front_page;
- $img = '';
- if ($newlogo) {
- $img .= '<div class="hlogotext"><a href="' . $site_url . '" title="'.get_bloginfo( 'name' ) . '">';
- if ((bool)$logo) {
- $img .= '<img src="' . $newlogo . '" alt="' . get_bloginfo( 'name' ) . '" />';
- }
- if(!$is_front_page|| monchange( 'clicklogo' ) == 'true' ){
- }
- $site_url = mon_is_weblic($site_url);
- $img .= $site_url.'</a></div>';
- }
- }
- return $img;
- }
- function monbanner_rotate() {
- global $wpdb;
- if (monchange( 'modul', 'banner' ) == 'true') {
- $wpdb->get_row;
- $wpdb->prefix;
- }
- $banners = ( 'SELECT * FROM ' .$wpdb->prefix . 'postmeta LEFT OUTER JOIN ' . $wpdb->prefix . 'posts ON(' . $wpdb->prefix . 'postmeta.post_id = ' . $wpdb->prefix . 'posts.ID) WHERE post_status=\'publish\' AND meta_key=\'banner\' AND meta_value != \'\' ORDER BY RAND()' );
- $onebanner = $banners->meta_value;
- if (10 < strlen( $onebanner )) {
- echo '<div id="monbanner_rotate">' . $onebanner . '</div>';
- }
- }
- function mon_not_caps_name($name) {
- $name = esc_html( stripslashes( strip_tags( $name ) ) );
- if ($name) {
- $newname = mb_strtoupper(mb_substr ($name,0,1 ) ) . mb_strtolower( mb_substr( $name, 1, mb_strlen( $name ) ) );
- return $newname;
- }
- }
- function count_ptype_partner() {
- global $wpdb;
- $ptype = mon_ptype( );
- $count = $wpdb->query( 'SELECT ID FROM ' . $wpdb->prefix . ( 'posts WHERE post_type=\'' . $ptype . '\' AND post_status=\'publish\'' ) );
- return $count;
- }
- function monbo_shingle($text, $search) {
- $cont = explode( ' ', strip_tags( $text ) );
- foreach ($cont as $key => $con) {
- while (true) {
- if (preg_match( '/(' . $search . ')/iu', $con )) {
- $on = $cont;
- break;
- }
- }
- }
- $start = $on - 20;
- if ($start < 0) {
- $start = 279;
- $end = $on + 21;
- $cc = count( $cont );
- }
- if ($cc < $end) {
- $end = $end;
- $content = '';
- }
- if ($start++ < $end) {
- if ($cont[$start]) {
- $content .= $cont[$start] . ' ';
- }
- }
- jmp;
- return $content;
- }
- function monbo_search_content($text, $search, $cifr = 42) {
- if (preg_match( '/(' . $search . ')/iu', $text )) {
- $content = monbo_shingle( $text, $search );
- jmp;
- }
- $content = wp_trim_words($text, $cifr );
- return preg_replace( '/(' . $search . ')/iu', '<span class="mon_searchvid">' . $search . '</span>', $content );
- }
- function get_link_for_monitoring($post_id, $post = '') {
- if ($post) {
- $link = get_post_meta( $post->ID, 'link', true );
- $link = get_post_meta( $post_id, 'link', true );
- if (!$link) {
- $link = 'ссылка';
- }
- '<a href="' . the_part_link( $post_id ) . '" target="_blank">' . $link . '</a>';
- }
- return ;
- }
- function the_part_link($post_id) {
- return apply_filters( 'the_monbo_part_link', '/?sitelink=' . $post_id, $post_id );
- }
- function mon_first_letter($arg) {
- mb_substr( $arg, 0, 1 );
- $llet = $flet = mb_substr( $arg, 1, mb_strlen( $arg ) );
- return '<span class="fletter">' . $flet . '</span>' . $llet;
- }
- function mon_osntable($page, $category, $orderby, $order, $count, $title, $pagenavis, $ajax, $help, $dostup)
- {
- global $wpdb;
- $table = '';
- if (!$title) {
- $title = monchange('htable', 'name');
- $count = intval($count);
- }
- if (!$count) {
- $count = intval(monchange('htable', 'count'));
- }
- if (!$pagenavis) {
- $pagenavis = monchange('htable', 'pagenavi');
- if ($pagenavis != 'true') {
- $pagenavis = 'false';
- }
- }
- if (!$ajax) {
- $ajax = monchange('htable', 'navi');
- if ($ajax != 'true') {
- $ajax = 'post';
- }
- }
- // if ($ajax == 'ajax') {
- // $classed = 'monnaviajax';
- // $table .= '<div class="montable ' . $classed . '">';
- //
- // if ($title) {
- // $table .= '<div class="monosntabletitle">' . $title . '</div>';
- //
- //
- // }
- //
- // }
- if (isset($_GET['monorder']) ) {
- $orderby = $_GET['monorderby'];
- $order = $_GET['monorder'];
- }
- $r = 0;
- foreach ($_GET as $smget => $val) {
- //$uri = preg_replace( '/[&?]{1}' . $smget . '[=]{1,3}' . $val . '/', '');
- $val = trim(esc_html(strip_tags($val)));
- // if (( ( $smget != 'monpage' && $smget != 'monorderby' ) && $smget != 'monorder' )) {
- // ++$r;
- //
- // if ($r == 1) {
- // $uri .= '?' . $smget . '=' . $val;
- // $zn = '&';
- // break;
- // }
- //
- // break;
- // }
- //
- // break;
- }
- $tvoi = array();
- $tu = mon_your_id();
- $seles = $wpdb->get_results('SELECT * FROM ' . $wpdb->prefix . ('monsravni WHERE ryour=\'' . $tu . '\''));
- foreach ($seles as $sel) {
- $tvoi[] = $sel->ruch;
- }
- $monstatus = array();
- $views = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "monstatus ");
- foreach ($views as $vi) {
- $monstatus[$vi->doppole][$vi->id] = $vi;
- }
- if ($ajax == 'ajax') {
- $ajaxinput = '
- <input type="hidden" name="" class="monajaxinput_page" value="' . $page . '" />
- <input type="hidden" name="" class="monajaxinput_category" value="' . $category . '" />
- <input type="hidden" name="" class="monajaxinput_orderby" value="' . $orderby . '" />
- <input type="hidden" name="" class="monajaxinput_order" value="' . $order . '" />
- <input type="hidden" name="" class="monajaxinput_count" value="' . $count . '" />
- <input type="hidden" name="" class="monajaxinput_title" value="' . $title . '" />
- <input type="hidden" name="" class="monajaxinput_pagenavi" value="' . $pagenavis . '" />
- <input type="hidden" name="" class="monajaxinput_ajax" value="' . $ajax . '" />
- <input type="hidden" name="" class="monajaxinput_help" value="' . $help . '" />
- <input type="hidden" name="" class="monajaxinput_dostup" value="' . $dostup . '" />
- ';
- }
- $table .= '<div class="monosntable">' . $ajaxinput . '<table><tr>';
- $poles = array();
- $views = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "doppole WHERE posnt = 1 ORDER BY posntsort ASC");
- foreach ($views as $vi) {
- $poles[$vi->id] = $vi;
- }
- $th = 0;
- foreach ($poles as $pol) {
- ++$th;
- $polevid = $pol->mtype;
- if ($polevid == 101) {
- $monthclass = 'mot_title';
- $monorder = '&monorder=asc';
- if ($orderby == 'title') {
- if ($order == 'asc') {
- $monorder = '&monorder=desc';
- //$ajorder = 'jadesc';
- $monthclass .= ' asc';
- }
- if ($order == 'desc'){
- $monthclass .= ' desc';
- }
- }
- $table .= '<th><a href="?monorderby=title' . $monorder . '" name="title" class=" ' . $monthclass . ' ">
- ' . $pol->mname . '</a></th>';
- } elseif ($polevid == 102) {
- $table .= '<th><div class="monosntableth mot_monpostmeta">' . $pol->mname . '</div></th>';
- } elseif ($polevid == 103) {
- $table .= '<th><div class="monosntableth mot_monpostmeta">' . $pol->mname . '</div></th>';
- } elseif ($polevid == 104) {
- $monthclass = 'mot_ranking';
- $monorder = '&monorder=asc';
- if($orderby == 'ranking'){
- if ($order == 'asc') {
- $monorder = '&monorder=desc';
- //$ajorder = 'jadesc';
- $monthclass .= ' jaasc asc';
- }
- if ($order == 'desc'){
- $monthclass .= ' desc';
- }
- }
- $table .= '<th><a href="?monorderby=ranking' . $monorder . '" name="ranking" class=" ' . $monthclass . ' ">
- ' . $pol->mname . '</a></th>';
- } elseif ($polevid == 105) {
- $table .= '<th><div class="monosntableth mot_monpostmeta">' . $pol->mname . '</div></th>';
- } elseif ($polevid == 106) {
- $table .= '<th><div class="monosntableth mot_monpostmeta">' . $pol->mname . '</div></th>';
- } elseif ($polevid == 107) {
- $table .= '<th><div class="monosntableth mot_monpostmeta">' . $pol->mname . '</div></th>';
- } elseif ($polevid == 109) {
- $table .= '<th><div class="monosntableth mot_monpostmeta">' . $pol->mname . '</div></th>';
- } elseif ($polevid == 110) { //логотип
- $table .= '<th><div class="monosntableth mot_monpostmeta">' . $pol->mname . '</div></th>';
- } elseif ($polevid == 111) { //логотип со ссылкой на внутреннюю
- $table .= '<th><div class="monosntableth mot_monpostmeta">' . $pol->mname . '</div></th>';
- } elseif ($polevid == 112) { //логотип со ссылкой на сайта участника
- $table .= '<th><div class="monosntableth mot_monpostmeta">' . $pol->mname . '</div></th>';
- } elseif ($polevid == 0) {
- $table .= '<th><div class="monosntableth mot_monpostmeta">' . $pol->mname . '</div></th>';
- } elseif ($polevid == 1) {
- $table .= '<th><div class="monosntableth mot_monpostmeta">' . $pol->mname . '</div></th>';
- } elseif ($polevid == 2) {
- $table .= '<th><div class="monosntableth mot_monpostmeta">' . $pol->mname . '</div></th>';
- } elseif ($polevid == 3) {
- $table .= '<th><div class="monosntableth mot_monpostmeta">' . $pol->mname . '</div></th>';
- } elseif ($polevid == 4) {
- $helprow = monchange('hstable', 'helprow');
- if(is_array($helprow)){
- foreach($helprow as $th){
- $ts = $th;
- }
- }
- $monthclass = ' mot_monpostmeta';
- $monorder = '&monorder=asc';
- if ($orderby == 'monpostmeta22') {
- if ($order == 'asc') {
- $monorder = '&monorder=desc';
- //$ajorder = 'jadesc';
- $monthclass .= ' asc';
- }
- if ($order == 'desc'){
- $monthclass .= ' desc';
- }
- }
- $table .= '<th><a href="?monorderby=monpostmeta'.$ts . $monorder . '" name="monpostmeta22" class=" ' . $monthclass . ' ">
- ' . $pol->mname . '</div></th>';
- } elseif ($polevid == 5) {
- $table .= '<th><div class="monosntableth mot_monpostmeta">' . $pol->mname . '</div></th>';
- } elseif ($polevid == 6) {
- $table .= '<th><div class="monosntableth mot_monpostmeta">' . $pol->mname . '</div></th>';
- } elseif ($polevid == 7) {
- $table .= '<th><div class="monosntableth mot_monpostmeta">' . $pol->mname . '</div></th>';
- } elseif ($polevid == 8) {
- $table .= '<th><div class="monosntableth mot_monpostmeta">' . $pol->mname . '</div></th>';
- } elseif ($polevid == 9) {
- $table .= '<th><div class="monosntableth mot_monpostmeta">' . $pol->mname . '</div></th>';
- } elseif ($polevid == 10) {
- $table .= '<th><div class="monosntableth mot_monpostmeta">' . $pol->mname . '</div></th>';
- } elseif ($polevid == 11) {
- $table .= '<th><div class="monosntableth mot_monpostmeta">' . $pol->mname . '</div></th>';
- }
- }
- $s = 0;
- $table .= '</tr>';
- // $thetax = ()
- // $taxonomy = $thetax->taxonomy;
- // if ($taxonomy) {
- // $args = array( 'tax_query' => array( array(
- // 'taxonomy' => $taxonomy,
- // 'field' => 'id',
- // 'terms' => array( $category ) ) ),
- // 'order' => $order,
- // 'post_type' => $post_type,
- // 'posts_per_page' => '-1' );
- // }
- $term = $wpdb->get_row("SELECT * FROM ".$wpdb->prefix."doppole WHERE mtype IN ('2','3')");
- $term_name = $term->catname;
- if($term_name) {
- // $res = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."monsravni ");
- // //$value = $wpdb->get_results("SELECT * FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON tt.term_id = t.term_id WHERE tt.taxonomy IN ('" .$term_name . "') ORDER BY t.name ASC");;
- // $doppoles = get_terms($term_name);
- // $ccc = has_category( $category );
- }
- $post_type = monchange('osn', 'slug');
- $args = array(
- 'post_type' => $post_type,
- 'posts_per_page' => $count,
- 'post_status' => 'publish',
- 'order' => $order,
- 'orderby' => $orderby,
- 'posts_per_page' => '-1',
- //'category' => $category,
- );
- $pars = get_posts($args);
- if ($orderby == 'ranking' AND $order == 'asc') {
- $i = 0;
- while ($i <= 5) {
- foreach ($pars as $rr) {
- $rr->ranking = get_post_meta($rr->ID, 'rating', true);
- if($rr->ranking == $i){
- $rrr[] = $rr;
- }
- }
- $i++;
- }
- $pars = $rrr;
- }
- if ($orderby == 'ranking' AND $order == 'desc') {
- $i = 5;
- while ($i >= 0) {
- foreach ($pars as $rr) {
- $rr->ranking = get_post_meta($rr->ID, 'rating', true);
- if($rr->ranking == $i){
- $rrr[] = $rr;
- }
- }
- $i--;
- }
- $pars = $rrr;
- }
- if( $orderby == 'monpostmeta'.$ts AND $order == 'desc') {
- $views = $monstatus[$ts];
- if (is_array($views)) {
- foreach ($views as $id) {
- foreach ($pars as $rr) {
- $rr->id_state = get_post_meta($rr->ID, 'monpostmeta'.$ts, true);;
- if($rr->id_state == $id->id){
- $rrr[] = $rr;
- }
- }
- }
- }
- $pars = $rrr;
- }
- if( $orderby == 'monpostmeta'.$ts AND $order == 'asc') {
- $views = $monstatus[$ts];
- if (is_array($views)) {
- arsort($views);
- foreach ($views as $id) {
- foreach ($pars as $rr) {
- $rr->id_state = get_post_meta($rr->ID, 'monpostmeta'.$ts, true);;
- if($rr->id_state == $id->id){
- $rrr[] = $rr;
- }
- }
- }
- }
- $pars = $rrr;
- }
- if($category != 0){
- foreach ($pars as $rr) {
- $terms = get_the_terms($rr->ID, 'mcat13');
- $mcat = array();
- if (is_array($terms)) {
- foreach ($terms as $ter) {
- if($category == $ter->term_id){
- $cater[] = $rr ;
- }
- }
- }
- }
- $pars = $cater;
- }
- foreach ($pars as $mp) {
- ++$s;
- if ($r%2 == 0) {
- $cl = 'even';
- } else {
- $cl = 'odd';
- }
- $table .= '<tr class="' . $cl . '">';
- foreach ($poles as $pol) {
- $polevid = $pol->mtype;
- $post_id = $mp->ID;
- $txt1 = $pol->mpr1;
- $txt2 = $pol->mpr2;
- $txt3 = $pol->mpr3;
- $polid = $pol->id;
- //$polcat = $pol->catname;
- $meta = 'monpostmeta' . $polid;
- if ($mp->videl == 'true') {
- $videl = 'videl';
- }
- $permalink = get_permalink($mp->ID);
- $post_karma = $mp->karma;
- if (!$post_karma) {
- if (0 < $post_karma) {
- $post_karma = '+' . $post_karma;
- $pkcl = 'karmaplus';
- }
- }
- $table .= '<td><div class="monosntabletd">';
- if ($polevid == 101) {
- $pimg = get_post_meta($post_id, 'logotype', true);
- $title = get_the_title($post_id);
- $table .= apply_filters('mon_dp_title', '', 'osn', $title, $post_id, $pimg);
- $table .= '</div></td>';
- } elseif ($polevid == 102) {
- $table .= apply_filters('mon_dp_sitelink', '', 'osn', $post_id);
- $table .= '</div></td>';
- } elseif ($polevid == 103) {
- $table .= apply_filters('mon_dp_singlelink', '', 'osn', $post_id);
- $table .= '</div></td>';
- } elseif ($polevid == 104) {
- $link = get_permalink($post_id);
- $post_rating = get_post_meta($post_id, 'rating', true);
- $nrat = ceil(75 / 5 * $post_rating);
- $table .= '<a href="' . $link . '?opt=otzivs" class="rating compare" title="' . $post_rating . ' из 5.00"><div class="ratingvn" style="width: ' . $nrat . 'px"></div></a>';
- $table .= '</div></td>';
- } elseif ($polevid == 105) {
- $post_karma = get_post_meta($post_id, 'karma', true);
- if ($post_karma > 0) {
- $post_karma = '+' . $post_karma;
- $pkcl = 'karmaplus';
- } elseif ($post_karma < 0) {
- $pkcl = 'karmaminus';
- } else {
- $pkcl = 'karmanull';
- }
- $table .= '<div class="comparekarma ' . $pkcl . '">' . $post_karma . '</div>';
- $table .= '</div></td>';
- } elseif ($polevid == 106) {
- $cot = get_post_meta($post_id, 'motziv', true);
- $table .= apply_filters('mon_dp_countotziv', '', 'osn', $cot, $post_id);
- $table .= '</div></td>';
- } elseif ($polevid == 107) {
- $cot = get_post_meta($post_id, 'mcomment', true);
- $table .= apply_filters('mon_dp_countcomment', '', 'osn', $cot, $post_id);
- $table .= '</div></td>';
- } elseif ($polevid == 109) {
- $table .= '<div name="' . $post_id . '" class="tgsr-' . $post_id . ' gosravni"></div>';
- $table .= '</div></td>';
- } elseif ($polevid == 110) { //логотип
- $pimg = get_post_meta($post_id, 'logotype', true);
- $table .= apply_filters('mon_dp_logotype', '', 'osn', $pimg, $post_id);
- $table .= '</div></td>';
- } elseif ($polevid == 111) { //логотип со ссылкой на внутреннюю
- $pimg = get_post_meta($post_id, 'logotype', true);
- $table .= apply_filters('mon_dp_logotype_vnlink', '', 'osn', $pimg, $post_id);
- $table .= '</div></td>';
- } elseif ($polevid == 112) { //логотип со ссылкой на сайта участника
- $pimg = get_post_meta($post_id, 'logotype', true);
- $table .= apply_filters('mon_dp_logotype_sitelink', '', 'osn', $pimg, $post_id);
- $table .= '</div></td>';
- } elseif ($polevid == 0) {
- $text = get_post_meta($post_id, $meta, true);
- $table .= $text . '' . $txt1;
- $table .= '</div></td>';
- } elseif ($polevid == 1) {
- $text = get_post_meta($post_id, $meta, true);
- $table .= apply_filters('comment_text', $text);
- $table .= '</div></td>';
- } elseif ($polevid == 2) {
- $terms = get_the_terms($post_id, $pol->catname);
- $mcat = array();
- if (is_array($terms)) {
- foreach ($terms as $ter) {
- $mcat[] = $ter->name;
- }
- }
- $table .= join(', ', $mcat);
- $table .= '</div></td>';
- } elseif ($polevid == 3) {
- $terms = get_the_terms($post_id, $pol->catname);
- $mcat = array();
- if (is_array($terms)) {
- foreach ($terms as $ter) {
- $mcat[] = $ter->name;
- }
- $table .= join(', ', $mcat);
- $table .= '</div></td>';
- }
- } elseif ($polevid == 4) {
- $text = get_post_meta($post_id, $meta, true);
- $mystatus = $monstatus[$polid][$text];
- $table .= '<div class="comparestatus"><img src="' . $mystatus->mimg . '" title="' . $mystatus->mtitle . '" alt="" /></div>';
- $table .= '</div></td>';
- } elseif ($polevid == 5) {
- $text = get_post_meta($post_id, $meta, true);
- $table .= $text[1] . '' . $txt1 . ' ' . $text[2] . '' . $txt2;
- $table .= '</div></td>';
- } elseif ($polevid == 6) {
- $text = get_post_meta($post_id, $meta, true);
- $table .= $text[1] . '' . $txt1 . ' ' . $text[2] . '' . $txt2 . ' ' . $text[3] . '' . $txt3;
- $table .= '</div></td>';
- } elseif ($polevid == 7) {
- $text = get_post_meta($post_id, $meta, true);
- $table .= '<div class="compareyear">' . $text . '</div>';
- $table .= '</div></td>';
- } elseif ($polevid == 8) {
- $text = get_post_meta($post_id, $meta, true);
- if ($text) {
- $table .= '<div class="comparedate">' . date('d.m.Y', $text) . '</div>';
- }
- $table .= '</div></td>';
- } elseif ($polevid == 9) {
- $text = get_post_meta($post_id, $meta, true);
- if ($text) {
- $table .= '<div class="comparedatetime">' . date('d.m.Y H:i', $text) . '</div>';
- }
- $table .= '</div></td>';
- } elseif ($polevid == 10) {
- $text = get_post_meta($post_id, $meta, true);
- if ($text == 'true') {
- $da = 'Да';
- $cmcl = 'yes';
- } else {
- $da = 'Нет';
- $cmcl = 'no';
- }
- $table .= '<div class="compareyesno ' . $cmcl . '">' . $da . '</div>';
- $table .= '</div></td>';
- } elseif ($polevid == 11) {
- $text = get_post_meta($post_id, $meta, true);
- $table .= $text . ' ' . $txt1;
- $table .= '</div></td>';
- }
- // if ($polevid == 1) {
- // $text = $mp->$meta;
- // $table .= apply_filters('comment_text', $text);
- // }
- // if (is_array($terms)) {
- // $mcat = array();
- // foreach ($terms as $ter) {
- // $mcat[] = $ter->name;
- // break;
- // }
- //
- // $table .= join(', ', $mcat);
- // jmp;
- //
- // if ($polevid == 3) {
- // $terms = get_the_terms($post_id, $polcat);
- //
- //
- // if (is_array($terms)) {
- // foreach ($terms as $ter) {
- // $mcat[] = $ter->name;
- // break;
- // }
- //
- // $table .= join(', ', $mcat);
- // jmp;
- //
- //
- // }
- //
- // $table .= $text[2] . '' . $txt2;
- // }
- // $table .= '</tr>';
- // }
- // $table .= $text . ' ' . $txt1;
- }
- $table .= '</tr>';
- }
- if ($s == 0) {
- $table .= '<tr><td colspan="' . $th . '"><center>Данных нет.</center></td></tr>';
- }
- $table .= '</table></div>';
- //$help = monchange('hstable','help');
- if ($help != 'false') {
- $helprow = monchange('hstable', 'helprow');
- if (is_array($helprow)) {
- foreach ($helprow as $hr) {
- $table .= '<div class="monhelpinfo">';
- $views = $monstatus[$hr];
- if (is_array($views)) {
- foreach ($views as $vi) {
- $im = $vi->mimg;
- if ($im) {
- $mcl = 'background: url(' . $im . ') no-repeat;';
- } else {
- $mcl = '';
- }
- $table .= '<div class="monhstatus" style="' . $mcl . '">- ' . $vi->mtitle . '</div>';
- }
- }
- $table .= '</div><div class="clear"></div>';
- }
- }
- $table .= '</div>';
- }
- return $table;
- }
- function monselectpod($arg, $key) {
- if (is_array( $arg )) {
- foreach ($arg as $ar ) {
- $ar = (bool)$ar;
- }
- }
- if (trim( $ar ) == $key) {
- return 'selected="selected"';
- return null;
- $arg = (bool)$arg;
- if (trim( $arg ) == $key) {
- }
- return 'selected="selected"';
- return null;
- }
- }
- function methodpodb($ct, $method, $arg1 = '') {
- if ($method == 'get') {
- if ($arg1) {
- $_GET[$ct][$arg1];
- }
- if (is_array($_GET[$ct][$arg1] )) {
- foreach ($_GET[$ct][$arg1] as $cs) {
- return $cs;
- }
- return null;
- return $_GET[$ct][$arg1];
- return $_GET[$ct];
- if ($arg1) {
- }
- }
- if (is_array( $_POST[$ct][$arg1] )) {
- foreach ($_POST[$ct][$arg1] as $cs) {
- return $cs;
- }
- return null;
- return $_POST[$ct][$arg1];
- $_POST;
- }
- }
- return [$ct];
- }
- function get_thepolevivod($activeleft, $dpolei, $nmet, $monstatus) {
- global $wpdb;
- $table = '';
- if (is_array( $activeleft )) {
- foreach ($activeleft as $key) {
- $mtype = $key->mtype;
- $dopid = $key->id;
- if ($mtype == 2) {
- $ncategory = get_terms( $key->catname, 'hide_empty=0' );
- while (( is_array( $ncategory ) && 0 < count( $ncategory ) )) {
- $table .= '
- <div class="onepolepodb">
- <div class="onepolepodbtitle">' . $key->mname . '</div>
- <select name="mt' . $dopid . '" class="onepolepodbselect">
- <option value="0">-----------</option>
- ';
- foreach ($ncategory as $nc) {
- while (true) {
- $table .= '<option value="' . $nc->term_id . '" ' . monselectpod( methodpodb( 'mt' . $dopid, $nmet ), $nc->term_id ) . '>' . $nc->name . '</option>';
- }
- }
- $table .= '</select>
- </div>
- ';
- }
- }
- break;
- }
- }
- else {
- while (true) {
- if ($txt) {
- $txt1 = '(' . $txt . ')';
- break;
- }
- $table .= $txt . methodpodb( 'ot' ) . '" /> до <input type="text" class="onepolepodbinput" name="mt' . $dopid . '[do]" value="' . methodpodb( 'mt' . $dopid, $nmet, 'do' ) . '" /></div>
- </div>
- ';
- }
- if ($mtype == 104) {
- $table .= '
- <div class="onepolepodb">
- <div class="onepolepodbtitle">Рейтинг</div>
- <div>от <input type="text" class="onepolepodbinput" name="mt' . $dopid . '[ot]" value="' . methodpodb( 'mt' . $dopid, $nmet, 'ot' ) . '" /> до <input type="text" class="onepolepodbinput" name="mt' . $dopid . '[do]" value="' . methodpodb( 'mt' . $dopid, $nmet, 'do' ) . '" /></div>
- </div>
- ';
- }
- while (true) {
- jmp;
- $table .= '[ot]" value="' . methodpodb( 'mt' . $dopid, $nmet, 'ot' ) . '" /> до <input type="text" class="onepolepodbinput" name="mt' . $dopid . '[do]" value="' . methodpodb( 'mt' . $dopid, $nmet, 'do' ) . '" /></div>
- </div>
- ';
- }
- if ($mtype == 106) {
- }
- }
- while (true) {
- while (true) {
- $table .= '
- <div class="onepolepodb">
- <div class="onepolepodbtitle"><label><input type="checkbox" name="mt' . $dopid . '" ' . checked( 'mt' . $dopid, 1, false ) . ' value="1" /> с отзывами</label></div>
- </div>
- ';
- }
- if ($mtype == 107) {
- $table .= '
- <div class="onepolepodb">
- <div class="onepolepodbtitle"><label><input type="checkbox" name="mt' . $dopid . '" ' . checked( 'mt' . $dopid, 1, false ) . ' value="1" /> с комментариями</label></div>
- </div>
- ';
- break;
- }
- }
- return $table;
- }
- function get_mon_key($val) {
- if (is_array( $val )) {
- foreach ($val as $va) {
- get_mon_key( $va );
- ;
- }
- }
- return;
- }
- function mon_choicetable($method = '', $tableonly = '')
- {
- global $wpdb;
- if ($method != 'ajax') {
- $method = 'post';
- if ($tableonly != 'true') {
- $tableonly = 'false';
- $dpolei = array();
- $doppoles = $wpdb->get_results('SELECT * FROM ' . $wpdb->prefix . 'doppole WHERE mtype NOT IN(\'101\',\'102\',\'103\',\'108\',\'109\',\'110\',\'111\',\'112\',\'0\',\'1\',\'5\',\'6\',\'9\') ORDER BY id DESC');
- foreach ($doppoles as $dop) {
- $dpolei[$dop->id] = $dop;
- }
- if ($tableonly == 'false') {
- //$activeleft = $wpdb->get_results('SELECT * FROM ' . $wpdb->prefix . 'doppole WHERE podt1=\'1\' ORDER BY podt1sort ASC');
- //$activecenter = $wpdb->get_results('SELECT * FROM ' . $wpdb->prefix . 'doppole WHERE podt2=\'1\' ORDER BY podt2sort ASC');
- //$activeright = $wpdb->get_results('SELECT * FROM ' . $wpdb->prefix . 'doppole WHERE podt3=\'1\' ORDER BY podt3sort ASC');
- $monstatus = array();
- $views = $wpdb->get_results('SELECT * FROM ' . $wpdb->prefix . 'monstatus');
- foreach ($views as $vi) {
- $monstatus[$vi->doppole][$vi->id] = $vi;
- }
- if ($method == 'post') {
- $form = '<form action="" method="get">'; //форма для подобрать!
- $nmet = 'get';
- }
- }
- }
- }
- if ($tableonly == 'false') {
- $table .= '</div>';
- }
- }
- if (!defined( 'ABSPATH' )) {
- exit( );
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement