예제 #1
0
<?php

/**
 * Loads the NXTClass environment and template.
 *
 * @package NXTClass
 */
if (!isset($nxt_did_header)) {
    $nxt_did_header = true;
    require_once dirname(__FILE__) . '/nxt-load.php';
    nxt();
    require_once ABSPATH . nxtINC . '/template-loader.php';
}
예제 #2
0
function mixhall($hall, $order)
{
    $mix = array();
    $nor = array();
    $total = 0;
    for ($i = 0; $i < count($hall); $i++) {
        //looped for an hall
        $k = $order[$i];
        $tot = count($hall[$k]);
        $total = $total + $tot - 1;
        //echo 'tot = '.$tot;
        for ($j = 1; $j < $tot; $j++) {
            // arranging department wise
            $nor[] = $hall[$k][$j];
        }
        //normal has been formed
    }
    //echo 'total = '.$total;
    //$table = array();
    //$table2 = array();
    for ($i = 0; $i < 25; $i++) {
        //echo 'i = '.$i;
        /*if( $i < 13 ){
        			$j = (2*$i);
        			//$table[$i] = $j;
        			//$table2[$i] = ($i/2);
        			$mix[$j] = $nor[$i];//$mix[$i] = $nor[($i/2)];
        		}else{
        			$j = (($i - 12) + ($i - 13));
        			//$table[$i] = $j;
        			//$table2[$i] = (12 + (($i+1)/2));
        			$mix[$j] = $nor[$i];//$mix[$i] = $nor[(12 + (($i+1)/2))];
        		}*/
        $j = nxt($i);
        if (isset($nor[$i])) {
            $mix[$j] = $nor[$i];
        } else {
            $mix[$j] = '';
        }
    }
    //mix has been formed   |^| above is 12 because we will have total of 25
    return $mix;
}
예제 #3
0
파일: post.php 프로젝트: nxtclass/NXTClass
/**
 * {@internal Missing Short Description}}
 *
 * @since 2.5.0
 *
 * @param unknown_type $q
 * @return unknown
 */
function nxt_edit_attachments_query($q = false)
{
    if (false === $q) {
        $q = $_GET;
    }
    $q['m'] = isset($q['m']) ? (int) $q['m'] : 0;
    $q['cat'] = isset($q['cat']) ? (int) $q['cat'] : 0;
    $q['post_type'] = 'attachment';
    $post_type = get_post_type_object('attachment');
    $states = 'inherit';
    if (current_user_can($post_type->cap->read_private_posts)) {
        $states .= ',private';
    }
    $q['post_status'] = isset($q['status']) && 'trash' == $q['status'] ? 'trash' : $states;
    $media_per_page = (int) get_user_option('upload_per_page');
    if (empty($media_per_page) || $media_per_page < 1) {
        $media_per_page = 20;
    }
    $q['posts_per_page'] = apply_filters('upload_per_page', $media_per_page);
    $post_mime_types = get_post_mime_types();
    $avail_post_mime_types = get_available_post_mime_types('attachment');
    if (isset($q['post_mime_type']) && !array_intersect((array) $q['post_mime_type'], array_keys($post_mime_types))) {
        unset($q['post_mime_type']);
    }
    if (isset($q['detached'])) {
        add_filter('posts_where', '_edit_attachments_query_helper');
    }
    nxt($q);
    if (isset($q['detached'])) {
        remove_filter('posts_where', '_edit_attachments_query_helper');
    }
    return array($post_mime_types, $avail_post_mime_types);
}