コード例 #1
0
ファイル: art.php プロジェクト: philum/cms
function template($p, $tpl)
{
    if (!$tpl) {
        $tpl = @$_SESSION['opts']['template'];
    }
    //article
    if (!$tpl) {
        $tpl = $_SESSION['prma']['template'];
    }
    //module
    if (!$tpl) {
        $tmp = template_art();
    }
    if ($tpl == "pubart") {
        $tmp = rstr(55) ? template_u($tpl) : template_pubart();
    } elseif ($tpl == "pubart_j") {
        $tmp = rstr(55) ? template_u($tpl) : template_pubart_j();
    } elseif ($tpl == "pubart_b") {
        $tmp = rstr(55) ? template_u($tpl) : template_pubart_b();
    } elseif ($tpl == "titles") {
        $tmp = rstr(65) ? template_u($tpl) : template_titles();
    } elseif ($tpl == "tracks") {
        $tmp = rstr(66) ? template_u($tpl) : template_tracks();
    } elseif ($tpl == "book") {
        $tmp = rstr(67) ? template_u($tpl) : template_book();
    } elseif ($tpl == "products") {
        $tmp = template_product();
    } elseif ($tpl == "fastart") {
        $tmp = template_fastart();
    } elseif ($tpl == "weblink") {
        $tmp = template_weblink();
    } elseif ($tpl == "panart") {
        $tmp = template_panart();
    } elseif ($tpl == "read" && rstr(88)) {
        $tmp = template_u($tpl);
        if (!$tmp) {
            $tmp = template_read();
        }
    }
    if (!$tmp) {
        $tmp = template_art();
    }
    return template_build($tmp, $p);
}
コード例 #2
0
ファイル: art.php プロジェクト: philum/cms
function template($p, $tpl)
{
    if (!$tpl) {
        $tpl = @$_SESSION['opts']['template'];
    }
    //article
    if (!$tpl) {
        $tpl = $_SESSION['prma']['template'];
    }
    //module
    if ($tpl) {
        $tmp = msql_read('users', $_SESSION['qb'] . '_template', $tpl);
        if (!$tmp) {
            $tmp = msql_read('', 'public_template', $tpl);
        }
    }
    if ($tpl == "pubart") {
        $tmp = rstr(55) && $tmp ? $tmp : template_pubart();
    } elseif ($tpl == "titles") {
        $tmp = rstr(65) && $tmp ? $tmp : template_titles();
    } elseif ($tpl == "tracks") {
        $tmp = rstr(66) && $tmp ? $tmp : template_tracks();
    } elseif ($tpl == "book") {
        $tmp = rstr(67) && $tmp ? $tmp : template_book();
    } elseif ($tpl == "products") {
        $tmp = $tmp ? $tmp : template_product();
    } elseif ($tpl == "fastart") {
        $tmp = $tmp ? $tmp : template_fastart();
    } elseif ($tpl == "weblink") {
        $tmp = $tmp ? $tmp : template_weblink();
    } elseif ($tpl == "read" && rstr(88)) {
        $tmp = $tmp ? $tmp : template_read();
    }
    //if($_SESSION['read'])$tmp=template_read();
    if (!$tmp) {
        $tmp = template_art();
    }
    return template_build($tmp, $p);
}
コード例 #3
0
             }
             if ($rewrite_policy_protasis == null) {
                 $commit_rewirtes_contect .= $rewrite_policy_contect;
             } else {
                 $commit_rewirtes_contect .= "if (" . $rewrite_policy_protasis . ") { \n" . $rewrite_policy_contect . "\t}\n";
             }
         }
     }
     $template_location_file = "template/" . $_POST['template_location'];
     $template_location_buffer = template_read($template_location_file);
     $location_commit_array = array();
     array_push($location_commit_array, $commit_location_info['location_path'], $commit_location_info['alias'], $commit_location_info['root_path'], $commit_location_info['proxy_pass'], $commit_location_info['proxy_next_upstream'], $commit_location_info['access_log'], $commit_rewirtes_contect, $commit_location_info['valid_referers']);
     $commit_location_contect .= preg_replace($location_commit_command, $location_commit_array, $template_location_buffer);
 }
 $template_server_file = "template/server.template";
 $template_server_buffer = template_read($template_server_file);
 $template_server_buffer = preg_replace("/}/", "", $template_server_buffer);
 $commit_server_contect = preg_replace($server_commit_comand, $server_commit_array, $template_server_buffer);
 $commit_nginx_config_content = $commit_upstream_content . $commit_server_contect . $commit_location_contect . " }\n";
 if (commit_config_write($service_config_file, $commit_nginx_config_content)) {
     if (commit_log(time(), $service_name, $service_config_file, $_CONF['commit_log']) == false) {
         die("commit file is ok,write log error!!");
     }
     $md5_code = md5_file($_CONF['commit_log']);
     if (md5file_write($md5_code, $_CONF['md5_file']) == false) {
         die("write md5_file error!!");
     }
     upserivce_status(2, $service_info['id']);
     $header_info = "location: services.php";
     header($header_info);
 } else {