HEX
Server: LiteSpeed
System: Linux sinope.sitehostingserver.com 5.14.0-611.49.2.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Apr 30 09:05:08 EDT 2026 x86_64
User: aprilnet (1155)
PHP: 8.2.32
Disabled: popen,imap_mail,exec,passthru,system,shell_exec,proc_open,pcntl_exec,eval,allow_url_fopen,allow_url_include,mail,proc_get_status,get_cfg_var,disk_free_space,disk_total_space,diskfreespace,getmygid,getmyinode,getmypid,geymyuid,proc_nice,proc_terminate,proc_close,apache_child_terminate,chown,lchgrp,lchown,link,readlink,highlight_file,show_source,php_strip_whitespace,get_meta_tags,dl,leak,pfsockopen,event_new,pcntl_signal,pcntl_alarm,register_tick_function,apache_setenv,define_syslog_variables,escapeshellarg,escapeshellcmd,ini_alter,ini_restore,inject_code,openlog,syslog,xmlrpc_entity_decode,phpAds_remoteInfo,phpAds_XmlRpc,phpAds_xmlrpcDecode,phpAds_xmlrpcEncode,chgrp,php_eval,safe_dir,root,ftok,egy_perl,symlink,wscript
Upload Files
File: /home/aprilnet/public_html/sciohost.org/wp-content/themes/doris/inc/libs/atbs_query.php
<?php
if (!class_exists('bk_get_query')) {
    class bk_get_query {
        static function doris_query($atts, $moduleID = '') {
            $the_query = '';
            
            if(isset($atts['post_source']) && ($atts['post_source'] != '')) :
            
                if($atts['post_source'] == 'all') :
                    $the_query = self::query($atts, $moduleID);
                elseif($atts['post_source'] == 'video'):
                    $the_query = self::query_video_posts($atts, $moduleID);
                elseif($atts['post_source'] == 'gallery'):
                    $the_query = self::query_gallery_posts($atts, $moduleID);
                elseif($atts['post_source'] == 'review'):
                    $the_query = self::query_review_posts($atts, $moduleID);
                else:
                    $the_query = self::query($atts, $moduleID);
                endif;
                
            else :
                $the_query = self::query($atts, $moduleID);
            endif;      
            
            return $the_query;
        }
        static function query($atts, $moduleID = '') {
            $args = array();
            $atts = shortcode_atts(
                array(
                    'orderby'       => 'date',
                    'tags'          => '',
                    'category_id'   => '',
                    'limit'         => '',
                    'feature'       => '',
                    'offset'        => 0,
                    'editor_pick'   => '',
                    'editor_exclude' => '',
                ),$atts);
                
            if(isset($atts['editor_pick']) && ($atts['editor_pick'] != null)) {
                $editorPickPosts = array_map('intval', explode(',',$atts['editor_pick']));
                $args = array(
        			'post_type'         => 'post',
                    'ignore_sticky_posts' => 1,
        			'posts_per_page'    => $atts['limit'],
                    'post__in'          =>  $editorPickPosts,
                    'orderby'           => 'post__in'
        		);
            }else {
                if ($atts['feature'] == 'yes') {
                    $args = array(
        				'post__in'  => get_option( 'sticky_posts' ),
        				'post_status' => 'publish',
        				'ignore_sticky_posts' => 1,
        				'posts_per_page' => $atts['limit'],
                        'offset' => $atts['offset'],
                        'post_type' => 'post',
                    );      
                }else {
            		$args = array(
            			'post_type' => 'post',
            			'ignore_sticky_posts' => 1,
                        'post_status' => 'publish',
            			'posts_per_page' => $atts['limit'],
                        'offset' => $atts['offset'],
            			// 'meta_key' => '_thumbnail_id', //Only posts that have featured image
            		);
                }
                if ( $atts['category_id'] >= 1 ) {
                    if (strpos($atts['category_id'], ",") > 0) {
                        $bkcategories = explode(',',$atts['category_id'],1000);
                    }else {
                        $bkcategories = $atts['category_id'];
                    }
                    $args[ 'category__in' ] = $bkcategories;
        		}
                
                if(isset($atts['editor_exclude']) && ($atts['editor_exclude'] != null)) {
                    $editorExcludePosts = array_map('intval', explode(',',$atts['editor_exclude']));
                    $args[ 'post__not_in' ] = $editorExcludePosts;
                }
                //tag in query
                if(isset($atts['tags']) && ($atts['tags'] != null)) {
    				$args['tag__in'] = array_map('intval', explode(',',$atts['tags']));
    			}
                switch ( $atts['orderby'] ) {
    
    				//Date post
    				case 'date' :
    					$args['orderby'] = 'date';
    					break;
    
    				//Popular comment
    				case 'comment_count' :
    					$args['orderby'] = 'comment_count';
    					break;
                    
                    //Popular Views
    				case 'view_count' :
                        $args['meta_key'] = 'post_views_count';
    					$args['orderby']  = 'meta_value_num';
    					$args['order']    = 'DESC';
    					break;
                    
    				//Modified
    				case 'modified' :
    					$args['orderby'] = 'modified';
    					break;
                        
                    // Review
    				case 'top_review' :
    					$args['meta_key'] = 'bk_review_score';
    					$args['orderby']  = 'meta_value_num';
    					$args['order']    = 'DESC';
    					break;
                    //Speed Reads
                    case 'speed_reads' :
                        $args['meta_key'] = 'bk_post_content__word_count';
    					$args['orderby']  = 'meta_value_num';
    					$args['order']    = 'DESC';
                        break;
    				//Random
    				case 'rand':
    					$args['orderby'] = 'rand';
    					break;
    
    				//Alphabet decs
    				case 'alphabetical_decs':
    					$args['orderby'] = 'title';
    					$args['order']   = 'DECS';
    					break;
    
    				//Alphabet asc
    				case 'alphabetical_asc':
    					$args['orderby'] = 'title';
    					$args['order']   = 'ASC';
    					break;
                    
                    // Default
                    default:
                        $args['orderby'] = 'date';
    					break;
    			} 
            }           
            $the_query = new WP_Query( $args );
            if($moduleID != null) {
                atbs_core::bk_add_buff('query', $moduleID, 'args', $args);
            }         
            unset($args);
            
            wp_reset_postdata();
            
            return $the_query;
        }
        static function query_video_posts($atts, $moduleID = '') {
            $args = array();
            $atts = shortcode_atts(
                array(
                    'orderby'       => 'date',
                    'category_id'   => '',
                    'limit'         => '',
                    'feature'       => '',
                    'offset'        => 0,
                    'editor_pick'   => '',
                    'editor_exclude' => '',
                ),$atts);
            if(isset($atts['editor_pick']) && ($atts['editor_pick'] != null)) {
                $editorPickPosts = array_map('intval', explode(',',$atts['editor_pick']));
                $args = array(
        			'post_type'         => 'post',
        			'posts_per_page'    => $atts['limit'],
                    'post__in'          =>  $editorPickPosts,
                    'orderby'           => 'post__in'
        		);
            }else {
                if ($atts['feature'] == 'yes') {
                    $args = array(
        				'post__in'  => get_option( 'sticky_posts' ),
        				'post_status' => 'publish',
        				'ignore_sticky_posts' => 1,
        				'posts_per_page' => $atts['limit'],
                        'offset' => $atts['offset'],
                        'post_type' => 'post',
                    );      
                }else {
            		$args = array(
            			'post_type' => 'post',
            			'ignore_sticky_posts' => 1,
                        'post_status' => 'publish',
            			'posts_per_page' => $atts['limit'],
                        'offset' => $atts['offset'],
            			// 'meta_key' => '_thumbnail_id', //Only posts that have featured image
            		);
                }
                if ( $atts['category_id'] >= 1 ) {
                    if (strpos($atts['category_id'], ",") > 0) {
                        $bkcategories = explode(',',$atts['category_id'],1000);
                    }else {
                        $bkcategories = $atts['category_id'];
                    }
                    $args[ 'category__in' ] = $bkcategories;
        		}
                if(isset($atts['editor_exclude']) && ($atts['editor_exclude'] != null)) {
                    $editorExcludePosts = array_map('intval', explode(',',$atts['editor_exclude']));
                    $args[ 'post__not_in' ] = $editorExcludePosts;
                }
                //tag in query
                if(isset($atts['tags']) && ($atts['tags'] != null)) {
    				$args['tag__in'] = array_map('intval', explode(',',$atts['tags']));
    			}
                switch ( $atts['orderby'] ) {
    
    				//Date post
    				case 'date' :
    					$args['orderby'] = 'date';
    					break;
    
    				//Popular comment
    				case 'comment_count' :
    					$args['orderby'] = 'comment_count';
    					break;
    
    				//Modified
    				case 'modified' :
    					$args['orderby'] = 'modified';
    					break;
                        
                    // Review
    				case 'top_review' :
    					$args['meta_key'] = 'bk_review_score';
    					$args['orderby']  = 'meta_value_num';
    					$args['order']    = 'DESC';
    					break;
                    //Speed Reads
                    case 'speed_reads' :
                        $args['meta_key'] = 'bk_post_content__word_count';
    					$args['orderby']  = 'meta_value_num';
    					$args['order']    = 'DESC';
                        break;
    				//Random
    				case 'rand':
    					$args['orderby'] = 'rand';
    					break;
    
    				//Alphabet decs
    				case 'alphabetical_decs':
    					$args['orderby'] = 'title';
    					$args['order']   = 'DECS';
    					break;
    
    				//Alphabet asc
    				case 'alphabetical_asc':
    					$args['orderby'] = 'title';
    					$args['order']   = 'ASC';
    					break;
                    
                    // Default
                    default:
                        $args['orderby'] = 'date';
    					break;
    			} 
            }
            $args['tax_query'] = array(
        		array(
        			'taxonomy' => 'post_format',
        			'field'    => 'slug',
        			'terms' => array('post-format-video' ),
        		),
        	);    
            
            $the_query = new WP_Query( $args );
            if($moduleID != null) {
                atbs_core::bk_add_buff('query', $moduleID, 'args', $args);
            }
            unset($args);
            
            wp_reset_postdata();
            
            return $the_query;
        }
        static function query_gallery_posts($atts, $moduleID = '') {
            $args = array();
            $atts = shortcode_atts(
                array(
                    'orderby'       => 'date',
                    'category_id'   => '',
                    'limit'         => '',
                    'feature'       => '',
                    'offset'        => 0,
                    'order'         => 'date',
                    'editor_pick'   => '',
                    'editor_exclude' => '',
                ),$atts);
            if(isset($atts['editor_pick']) && ($atts['editor_pick'] != null)) {
                $editorPickPosts = array_map('intval', explode(',',$atts['editor_pick']));
                $args = array(
        			'post_type'         => 'post',
        			'posts_per_page'    => $atts['limit'],
                    'post__in'          =>  $editorPickPosts,
                    'orderby'           => 'post__in'
        		);
            }else {    
                if ($atts['feature'] == 'yes') {
                    $args = array(
        				'post__in'  => get_option( 'sticky_posts' ),
        				'post_status' => 'publish',
        				'ignore_sticky_posts' => 1,
        				'posts_per_page' => $atts['limit'],
                        'offset' => $atts['offset'],
                        'post_type' => 'post',
                    );      
                }else {
            		$args = array(
            			'post_type' => 'post',
            			'ignore_sticky_posts' => 1,
                        'post_status' => 'publish',
            			'posts_per_page' => $atts['limit'],
                        'offset' => $atts['offset'],
            			// 'meta_key' => '_thumbnail_id', //Only posts that have featured image
            		);
                }
                if ( $atts['category_id'] >= 1 ) {
                    if (strpos($atts['category_id'], ",") > 0) {
                        $bkcategories = explode(',',$atts['category_id'],1000);
                    }else {
                        $bkcategories = $atts['category_id'];
                    }
                    $args[ 'category__in' ] = $bkcategories;
        		}
                if(isset($atts['editor_exclude']) && ($atts['editor_exclude'] != null)) {
                    $editorExcludePosts = array_map('intval', explode(',',$atts['editor_exclude']));
                    $args[ 'post__not_in' ] = $editorExcludePosts;
                }   
                //tag in query
                if(isset($atts['tags']) && ($atts['tags'] != null)) {
    				$args['tag__in'] = array_map('intval', explode(',',$atts['tags']));
    			}
                switch ( $atts['orderby'] ) {
    
    				//Date post
    				case 'date' :
    					$args['orderby'] = 'date';
    					break;
    
    				//Popular comment
    				case 'comment_count' :
    					$args['orderby'] = 'comment_count';
    					break;
    
    				//Modified
    				case 'modified' :
    					$args['orderby'] = 'modified';
    					break;
                        
                    // Review
    				case 'top_review' :
    					$args['meta_key'] = 'bk_review_score';
    					$args['orderby']  = 'meta_value_num';
    					$args['order']    = 'DESC';
    					break;
                    //Speed Reads
                    case 'speed_reads' :
                        $args['meta_key'] = 'bk_post_content__word_count';
    					$args['orderby']  = 'meta_value_num';
    					$args['order']    = 'DESC';
                        break;
    				//Random
    				case 'rand':
    					$args['orderby'] = 'rand';
    					break;
    
    				//Alphabet decs
    				case 'alphabetical_decs':
    					$args['orderby'] = 'title';
    					$args['order']   = 'DECS';
    					break;
    
    				//Alphabet asc
    				case 'alphabetical_asc':
    					$args['orderby'] = 'title';
    					$args['order']   = 'ASC';
    					break;
                    
                    // Default
                    default:
                        $args['orderby'] = 'date';
    					break;
    			}   
            }
            $args['tax_query'] = array(
        		array(
        			'taxonomy' => 'post_format',
        			'field'    => 'slug',
        			'terms' => array('post-format-gallery' ),
        		),
        	);    
            
            $the_query = new WP_Query( $args );
            if($moduleID != null) {
                atbs_core::bk_add_buff('query', $moduleID, 'args', $args);
            }
            unset($args);
            
            wp_reset_postdata();
            
            return $the_query;
        }
        static function query_review_posts($atts, $moduleID = '') {
            $args = array();
            $atts = shortcode_atts(
                array(
                    'orderby'       => 'date',
                    'category_id'   => '',
                    'limit'         => '',
                    'feature'       => '',
                    'offset'        => 0,
                    'order'         => 'date',
                    'editor_pick'   => '',
                    'editor_exclude' => '',
                ),$atts);
            if(isset($atts['editor_pick']) && ($atts['editor_pick'] != null)) {
                $editorPickPosts = array_map('intval', explode(',',$atts['editor_pick']));
                $args = array(
        			'post_type'         => 'post',
        			'posts_per_page'    => $atts['limit'],
                    'post__in'          =>  $editorPickPosts,
                    'orderby'           => 'post__in'
        		);
            }else { 
                if ($atts['feature'] == 'yes') {
                    $args = array(
        				'post__in'  => get_option( 'sticky_posts' ),
        				'post_status' => 'publish',
        				'ignore_sticky_posts' => 1,
        				'posts_per_page' => $atts['limit'],
                        'offset' => $atts['offset'],
                        'post_type' => 'post',
                    );      
                }else {
            		$args = array(
            			'post_type' => 'post',
            			'ignore_sticky_posts' => 1,
                        'post_status' => 'publish',
            			'posts_per_page' => $atts['limit'],
                        'offset' => $atts['offset'],
            			// 'meta_key' => '_thumbnail_id', //Only posts that have featured image
            		);
                }
                if ( $atts['category_id'] >= 1 ) {
                    if (strpos($atts['category_id'], ",") > 0) {
                        $bkcategories = explode(',',$atts['category_id'],1000);
                    }else {
                        $bkcategories = $atts['category_id'];
                    }
                    $args[ 'category__in' ] = $bkcategories;
        		}
                if(isset($atts['editor_exclude']) && ($atts['editor_exclude'] != null)) {
                    $editorExcludePosts = array_map('intval', explode(',',$atts['editor_exclude']));
                    $args[ 'post__not_in' ] = $editorExcludePosts;
                } 
                //tag in query
                if(isset($atts['tags']) && ($atts['tags'] != null)) {
    				$args['tag__in'] = array_map('intval', explode(',',$atts['tags']));
    			}
                switch ( $atts['orderby'] ) {
    
    				//Date post
    				case 'date' :
    					$args['orderby'] = 'date';
    					break;
    
    				//Popular comment
    				case 'comment_count' :
    					$args['orderby'] = 'comment_count';
    					break;
    
    				//Modified
    				case 'modified' :
    					$args['orderby'] = 'modified';
    					break;
                        
                    // Review
    				case 'top_review' :
    					$args['meta_key'] = 'bk_review_score';
    					$args['orderby']  = 'meta_value_num';
    					$args['order']    = 'DESC';
    					break;
                    //Speed Reads
                    case 'speed_reads' :
                        $args['meta_key'] = 'bk_post_content__word_count';
    					$args['orderby']  = 'meta_value_num';
    					$args['order']    = 'DESC';
                        break;
    				//Random
    				case 'rand':
    					$args['orderby'] = 'rand';
    					break;
    
    				//Alphabet decs
    				case 'alphabetical_decs':
    					$args['orderby'] = 'title';
    					$args['order']   = 'DECS';
    					break;
    
    				//Alphabet asc
    				case 'alphabetical_asc':
    					$args['orderby'] = 'title';
    					$args['order']   = 'ASC';
    					break;
                    
                    // Default
                    default:
                        $args['orderby'] = 'date';
    					break;
    			} 
            }
            $args['meta_query'] = array(
        		array(
        			'key' => 'bk_review_checkbox',
            		'value' => '1',
        		),
        	);
            
            $the_query = new WP_Query( $args );
            if($moduleID != null) {
                atbs_core::bk_add_buff('query', $moduleID, 'args', $args);
            }
            unset($args);
            
            wp_reset_postdata();
            
            return $the_query;
        }
    }
}