コード例 #1
0
ファイル: mainpage.php プロジェクト: Gioowp/scrummer
function __scrm_plugin_environment()
{
    $funcdir = __DIR__ . "/funcs/";
    if (!is_file($funcdir . 'sys.php')) {
        return false;
    }
    require_once "{$funcdir}sys.php";
    if (get_site_option("{$GLOBALS['plgn_shortname']}_version") < $GLOBALS["{$GLOBALS['plgn_shortname']}_version"]) {
        __scrm_plugin_install();
    }
    //	print "{$funcdir}sys.php";
    $tmp = scandir($funcdir);
    foreach ($tmp as $v) {
        if (!strpos($v, '.php')) {
            continue;
        }
        require_once "{$funcdir}{$v}";
    }
    $GLOBALS['act'] = $act = __action_maker();
    $GLOBALS['p'] = $p = __action_maker('p');
    $GLOBALS['fl'] = $fl = __action_maker('fl');
    //print_rr(__chek_w3i_form());
    if (chek_val($p, '1')) {
        setcookie($p[1], decode($_GET), time() + 86400 * 15, '/');
    }
    // Registrieren der WordPress-Hooks
    add_action('admin_menu', "__{$GLOBALS['plgn_shortname']}_plugin_admin_menu");
    add_action('init', 'loadScrummerPostTypes', 0);
    //////// plugin public actions
    if (!is_admin()) {
        __scrmActions();
        add_action("template_redirect", 'my_theme_redirect');
    }
    return;
}
コード例 #2
0
ファイル: function.php プロジェクト: Gioowp/scrummer
function saveBoard()
{
    //    print_r($_POST);
    if (!chek_val($_POST, 'new-board-title')) {
        return false;
    }
    $term = strip_tags($_POST['new-board-title']);
    $ar = get_term_by('name', $term, 'scrummer_board', ARRAY_A);
    //    print_r($ar);
    if (isset($ar['term_id'])) {
        return "Ooops... <br /> Board with name {$term} already exists. <br /> Try another one!";
    }
    wp_insert_term($term, 'scrummer_board');
    return "All is Ok <br /> New board created";
}
コード例 #3
0
ファイル: sys.php プロジェクト: Gioowp/scrummer
 function __update_fl($position = 1, $newvar = '')
 {
     /// chatenis cvlads dagenerirebul GET paramertshi. mag.: fl-shi chatenis meore cvlads
     global $fl;
     $ret = array();
     for ($i = 1; $i <= 5; $i++) {
         if ($position == $i) {
             $ret[$i] = $newvar;
             continue;
         }
         $ret[$i] = chek_val($fl, $i);
     }
     $GLOBALS['fl'] = $ret;
     $_GET['fl'] = base64_encode(implode('.', $ret));
     return false;
 }