Exemplo n.º 1
0
function my_theme_redirect()
{
    global $wp;
    $plugindir = dirname(__FILE__) . '/';
    if (!empty($wp->request) && strpos($wp->request, '/') !== false) {
        $request = substr($wp->request, 0, strpos($wp->request, '/'));
    } else {
        $request = $wp->request;
    }
    $file = __chek_file("file={$request}&dir=view&plugin=scrummer");
    if ($file) {
        loadScrummerPostTypes();
        global $post, $wp_query;
        include $file;
        exit;
    }
    return;
}
Exemplo n.º 2
0
 function __file_part($cf = '')
 {
     //v1
     //////// get file
     $cf = __params($cf, 'file=&dir=part&data=ar&plugin=');
     if (empty($cf['file'])) {
         return false;
     }
     global $wpdb, $p, $act, $fl;
     $incfile = __chek_file("file={$cf['file']}&dir={$cf['dir']}&plugin={$cf['plugin']}");
     if (!$incfile) {
         //pp($cf);
         //print __chek_file("file={$cf['file']}&dir={$cf['dir']}&plugin={$cf['plugin']}&return=dir")."{$cf['file']}.php";
         file_put_contents(__chek_file("file={$cf['file']}&dir={$cf['dir']}&plugin={$cf['plugin']}&return=dir") . "{$cf['file']}.php", $cf['file']);
         return false;
     }
     ob_start();
     include $incfile;
     $ret = ob_get_contents();
     ob_end_clean();
     return $ret;
 }