Запись [a:nice.sns] < dev.sky.1.001
Версия 1.001
en | NICE.SNS (Not Index Central Enter) +No Output Buffering (NOB) |
• N1: SKIP IMITATE:
• N2: HEAD: ?
001 002 003 004 005 006 007 008 009 010 011 012 013 | author: energy
script tested: yes
edited manualy: yes
ftrd: A^36/6/5/7 D^0/0/0/0 E^0/0/1/_ R^0/0/_/0
this script: auto, 11 records, 55 objects, 106513 bytes
reused code: coresky jquery
rollback: yes
rollback wind: yes
text files: php inc html htm tpl js css txt htaccess cfg svg
include paths: /
exclude paths: _dev _arch dev.php
include tables: /
exclude tables: _dev_
|
• N3: RUN RECORDS: 2
• N4: DELETE FILES:
001 002 003 004 005 006 007 | index.php
label/_x_test.html
label/_sample.php
label/_analytics.html
view/_article.php
view/foot.php
view/head.php
|
• N5: DELETE DIRS:
001 | cache
|
• N6: UPDATE CELL: memory.5.tmemo
001 002 003 | htaccess admin main view label
index pub pub/img
php 10
|
• N7: WRITE FILE: index.php
001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 021 022 023 024 025 026 027 028 029 030 031 032 | <?php $val = @current($_GET); define('START', in_array($key = @key($_GET), array('_', 'AJAX')) && 'adm' == $val ? 'admin' : 'front'); define('AJAX', 'AJAX' == $key); if ('admin' == START || AJAX) array_shift($_GET); require 'main/conf.php'; eval(SKY_WING::PROC); require 'main/front.php'; require 'main/mvc.php'; new SKY_VIEW($front = new SKY_FRONT); eval(SKY_FRONT::PROC); ?><!doctype html> <html> <head><? $sky->head() ?> <meta http-equiv="imagetoolbar" content="no" /> <meta name="resource-type" content="document" /> <meta name="distribution" content="global" /> </head> <body> <div id="wrapper"> <div id="head"><? require 'view/head.php' ?></div> <div id="content"> <div id="body"><? eval($sky) ?></div> <div id="right"><h3>Menu</h3><?=$y_menu?></div> </div> <div id="foot"><? require 'view/foot.php' ?></div> </div> <? $sky->tail(false) ?> </body> </html> |
• N8: WRITE FILE: main/ajax.php
001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 | <?php defined('START') or die; switch (PAGE): case 'main': switch ($PVAL) { case 'next': require 'label/_articles.php'; break; case 'test': sql("select 'wrong query' from absent_table") or 1 / 0; break; case '': # show ajax cell $sky->debug = false; echo sql("+select tmemo from memory where id=1"); break; } break; default: if (is_file($file = "main/a_$PAGE.php")) require $file; else exit('ajax'); endswitch; |
• N9: WRITE FILE: main/common.php
001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 | <?php defined('START') or die; $menu = ['article' => 'Article', 'svg' => 'SVG']; $sky->_y += [ 'menu' => menu($PAGE, $menu += $user->id ? ['user' => $user->login, 'user?logout' => 'Logout'] : ['user?login' => 'Login'], '%s'), 'show_list' => true, ]; $sky->_v += [ 'head' => '', 'title' => $s_title, 'keywords' => $s_keywords, 'description' => $s_desc, ]; $sky->body = $PAGE; $sky->layout = 'main'; |
• N10: WRITE FILE: article.php
001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 021 022 023 024 025 026 027 028 029 030 031 032 033 034 035 036 | <?php define('START', 'front'); require 'main/conf.php'; $sky = new SKY_WING; $s_cnt = extract($sky->load(), EXTR_PREFIX_ALL | EXTR_REFS, 's') or exit('err mem'); if ($sky->debug) require 'main/debug.php'; require 'main/common.php'; if ($PVAL && 'p' != $PVAL) { preg_match("/^[a-z\d]+$/", $PVAL) or die; $q = sql("select * from article where uri='$PVAL'"); if (eval(fetch)) { sql("update article set viewed=1+viewed where id=$r_id"); $sky->_v = [ 'h_title' => $r_title, 'h_keywords' => $r_meta_k, 'h_description' => $r_meta_d, 'content' => "<h1>$r_title</h1>$r_content<p><br>" . a('open all', 'article'), ] + $sky->_v; $sky->_y = ['show_list' => false] + $sky->_y; } else $sky->body = '404'; } else { # list $sql = "from article"; list ($v_pagination, $start, $v_cur, $v_pc, $v_prev, $v_next) = pagination(sql("+select count(1) $sql"), $ipp = 15); $q = sql("select * $sql limit $start, $ipp"); $sky->_v = [ 'h_title' => "Articles - $s_title", 'h_keywords' => $s_keywords, 'h_description' => $s_desc, ] + $sky->_v; } require 'main/front.php'; require 'view/layout.php'; |
• N11: WRITE FILE: svg.php
001 002 003 004 005 006 007 008 009 010 011 | <?php define('START', 'front'); require 'main/conf.php'; $sky = new SKY_WING; $s_cnt = extract($sky->load(), EXTR_PREFIX_ALL | EXTR_REFS, 's') or exit('err mem'); if ($sky->debug) require 'main/debug.php'; require 'main/common.php'; require 'main/front.php'; require 'view/layout.php'; |
• N12: WRITE FILE: test.php
001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 | <?php define('START', 'front'); require 'main/conf.php'; $sky = new SKY_WING; $s_cnt = extract($sky->load(), EXTR_PREFIX_ALL | EXTR_REFS, 's') or exit('err mem'); if ($sky->debug) require 'main/debug.php'; require 'main/common.php'; switch ($sky->body): case 'test': sql("select 'wrong query' from absent_table"); 1 / 0; break; endswitch; require 'main/front.php'; require 'view/layout.php'; |
• N13: WRITE FILE: user.php
001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 021 022 023 024 025 026 027 028 029 | <?php define('START', 'front'); require 'main/conf.php'; $sky = new SKY_WING; $s_cnt = extract($sky->load(), EXTR_PREFIX_ALL | EXTR_REFS, 's') or exit('err mem'); if ($sky->debug) require 'main/debug.php'; require 'main/common.php'; switch ($sky->body = $PVAL) { case 'login': if ($_POST) { $uid = $user->login(); if ($uid) jump(true); } break; case 'logout': $user->logout(); break; } $sky->_v = [ 'h_title' => "Login - $s_title", 'h_keywords' => 'login', 'h_description' => 'Enter page for users', ] + $sky->_v; require 'main/front.php'; require 'view/layout.php'; |
• N14: WRITE FILE: view/_article.php
001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 021 022 023 024 025 026 027 028 029 030 031 032 033 034 035 036 037 038 039 040 041 042 | <?php eval($me) or die ?>
<h1><?=html($v_h1)?></h1>
<?if('list' == $k_->type):?>
<?=$e_article->pagination?>
<form method="post">
<table width="100%">
<?for(;eval($e_article->row);):?>
<tr>
<td><?=$row->id?></td>
<td><?=$row->title?></td>
<td><?=$row->dt?></td>
<?if(1==$user->pid):?><td><?=$row->_del?></td><?endif?>
</tr>
<?endfor?>
</table>
<?if(1==$user->pid):?><div class="fr"><input type="submit" value="delete checked"></div><?endif?>
</form>
<?=$e_article->pagination?>
<?elseif('show' == $k_->type):?>
<table width="100%">
<tr><td>id</td><td><?=$row->id?></td></tr>
<tr><td>title</td><td><?=$row->title?></td></tr>
<tr><td>txt</td><td><?=$row->txt?></td></tr>
<tr><td>dt</td><td><?=$row->dt?></td></tr>
</table>
<br><a href="?edit=<?=$row->id?>">edit</a>
<?if(1==$user->pid):?><br><a href="?delete=<?=$row->id?>">delete</a><?endif?>
<?else: #edit new ?>
<?if($v_mess):?><div class="message"><?=$v_mess?></div><?endif?>
<form method="post">
<table width="100%">
<tr><td>title</td><td><input type="text" name="title" value="<?=$row->title?>" /></td></tr>
<tr><td>txt</td><td><textarea name="txt"><?=$row->txt?></textarea></td></tr>
</table>
<input type="submit" value="do post" />
</form>
<?endif?>
|
• N15: WRITE FILE: view/layout.php
001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 021 022 023 024 025 026 027 028 029 030 031 032 033 034 035 036 037 038 039 040 041 042 | <?php defined('START') or die;
extract($sky->view(), EXTR_REFS);
?><!doctype html>
<html>
<head><? $sky->head() ?>
<meta http-equiv="imagetoolbar" content="no" />
<meta name="resource-type" content="document" />
<meta name="distribution" content="global" />
</head>
<body>
<div id="wrapper">
<div id="head">
<div class="fr">
you are: <b><?=$user->login ? $user->login : 'Anonymous'?></b>
<br><?pdaxt()?>
</div>
<a href="<?=LINK?>" style="text-decoration:none" title="Main page">
<svg height="50" width="130">
<line x1="0" y1="0" x2="130" y2="50" style="stroke:rgb(99,99,99);stroke-width:1" />
<line x1="0" y1="50" x2="130" y2="0" style="stroke:rgb(99,99,99);stroke-width:1" />
<text x="23" y="38" fill="#333" style="font-family:Verdana;font-size:35">NICE</text>
LOGO
</svg>
</a>
</div>
<div id="content">
<div id="body"><? eval(view) ?></div>
<div id="right"><? require 'view/right.php' ?></div>
</div>
<div id="foot">
<? echo date('Y'); ?> year.
<div class="fr">
<b>SKY. null-site NICE</b>, see <a href="http://coresky.net/">The SKY. project</a>
</div>
</div>
</div>
<? $sky->tail(false) ?>
</body>
</html>
|
• N16: OPEN FILE: .htaccess
• N17: SEARCH:
001 | RewriteRule ^(\w+)$ index.php?$1=%1 [L,QSA]
|
• N18: REPLACE:
001 | RewriteRule ^(\w+)$ $1.php?$1=%1 [L,QSA]
|
• N19: OPEN FILE: label/_articles.php
• N20: SEARCH:
001 002 003 004 005 006 007 008 009 | <?if(!AJAX):?>
</div>
<?if($GLOBALS['y_show_list']):?>
<div style="margin-top: -10px;">%PHP_SAMPLE%</div>
<?else:?>
%PHP_SAMPLE%
<?endif?>
%HTML_ANALYTICS%
<?endif?>
|
• N21: REPLACE:
001 | <?if(!AJAX):?></div><?endif?>
|
• N22: OPEN FILE: main/conf.php
• N23: SEARCH:
001 | define('NOB', false);
|
• N24: REPLACE:
001 | define('NOB', true);
|
• N25: OPEN FILE: view/right.php
• N26: SEARCH:
001 002 003 | %PHP_SAMPLE%
</div>
<h3>Info</h3>
|
• N27: REPLACE:
001 002 003 | Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</div>
<h3>Info</h3>
|
• N28: SEARCH:
001 002 003 004 005 006 007 | <?cache('art')?>
<h3>Articles</h3>
%PHP_ARTICLES%
<?cache()?>
<?endif?>
Not shown on DEV: %HTML_X_TEST%
<?#die?>
|
• N29: REPLACE:
001 002 | <? require 'label/_articles.php' ?>
<?endif?>
|
• N30: OPEN FILE: view/_login.php
• N31: SEARCH:
001 002 003 004 005 006 | <?php eval($me) or die;
head("Login
login
Enter page
");
?>
|
• N32: REPLACE:
001 | <?php eval($me) or die ?>
|
• N33: OPEN FILE: view/_main.php
• N34: SEARCH:
001 002 003 004 005 | <?php eval($me) or die; head("Main Main page, $s_keywords $s_desc"); ?> |
• N35: REPLACE:
001 | <?php eval($me) or die ?>
|
• N36: END:
Записи Codebase (89)
Статус SKY.
Current version: 1.001
Coresky records: 22
Local (DEV) records: 89
Web (all) records: 105
Download: dev.php
Coresky records: 22
Local (DEV) records: 89
Web (all) records: 105
Download: dev.php