|
|
| version 1.6, 2002/02/26 12:49:46 | version 1.22.8.1, 2005/07/27 14:04:15 |
|---|---|
| Line 1 | Line 1 |
| @USE | |
| common/lib.p | |
| common/layout.p | |
| common/implode.p | |
| date/dtf.p | |
| mysql.p | |
| ################################################################################################# | |
| @auto[] | |
| # id объекта с 404 ошибкой: | |
| $MAIN:error404ObjectId(23) | |
| # id объекта, где лежат глобальные данные о сайте: | |
| $MAIN:siteDataObjectId(21) | |
| # id корневого объекта раздела вопросы и ответы | |
| $MAIN:faq_category_root_id(3) | |
| $MAIN:pSQL[^mysql::init[$SQL.connect-string;^if(^env:QUERY_STRING.pos[mode=debug] >= 0 || ^request:uri.pos[block_edit] >= 0){debug}]] | |
| #^detectBrowser[] | |
| # константа для новостей | |
| $MAIN:objIdNews(1) | |
| # эта табличка нужна для очистки всякой фигни от ентитей/тегов | |
| $repl[^table::create{a b | |
|  ^; | |
| &hellip^; ... | |
| &rdquo^; " | |
| &ldquo^; " | |
| »^; " | |
| «^; " | |
| &mdash^; - | |
| &ndash^; - | |
| №^; № | |
| &bull^; }] | |
| #end @auto[] | |
| ################################################################################################# | |
| @unhandled_exceptionXXX[exception;stack][i;j] | |
| $response:content-type[ | |
| $.value[text/html] | |
| $.charset[$response:charset] | |
| ] | |
| <title>Server error.</title> | |
| <body bgcolor=white> | |
| <font color=black> | |
| <pre>В настоящее время на сервере проводятся регламентные работы. | |
| Пожалуйста, зайдите позже.<br /> | |
| Приносим наши извинения за возможные неудобства.<br /> | |
| Если вы хотите оставить нам сообщение, пишите: <a href="mailto:mailbox@parser.ru">mailbox@parser.ru</a></pre> | |
| <!-- | |
| comment: | |
| ^untaint{$exception.comment} | |
| ^if(def $exception.source){ | |
| source: $exception.source | |
| file: ^untaint{$exception.file^($exception.lineno^)} | |
| } | |
| ^if(def $exception.type){type: exception.type=$exception.type} | |
| ^if($stack){ | |
| stack backtrace: | |
| ^stack.menu{$stack.name $stack.file^($stack.lineno^)}[^#0A] | |
| } | |
| //--> | |
| #end | |
| ################################################################################################# | |
| @error404[][err_lang] | |
| ^location[/404/] | |
| #end @error404[] | |
| ################################################################################################# | |
| @pageHeader[header] | |
| $header | |
| #end @pageHeader[] | |
| ################################################################################################# | |
| @pageFooter[] | |
| footer | |
| #end @pageFooter[] | |
| ################################################################################################# | |
| @body[content] | |
| <body bgcolor="#F4F4F4" text="#000000" link="#0000C4" alink="#0000C4" vlink="#073683" marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" rightmargin="0" onLoad="init()"> | |
| $content | |
| </body> | |
| #end @body[] | |
| ################################################################################################# | |
| @html[header;content] | |
| <!-- Copyright (c) Art. Lebedev Studio | http://www.design.ru/ --> | |
| <html> | |
| <head> | |
| <base target="_top"> | |
| <link rel="stylesheet" type="text/css" href="/main.css"></link> | |
| <title>AB.LV^if(def $header){ | ^taint[as-is][$header] }</title> | |
| </head> | |
| ^body{ | |
| <table cellpadding="0" cellspacing="0" border="0" width="100%" bgcolor="#ffffff"> | |
| ^pageHeader[] | |
| $content | |
| ^pageFooter[] | |
| </table> | |
| } | |
| <html> | |
| #end @html[] | |
| ################################################################################################# | |
| @main[] | @main[] |
| /auto.p main | ^pSQL.server{ |
| <html> | |
| <head> | |
| ^if(def $prepare){^prepare[]} | |
| </head> | |
| ^body{^content[]} | |
| </html> | |
| } | |
| # @main[] | |
| ################################################################################################# | |
| @postprocess[body][repl;tmp] | |
| ^if(def $body){ | |
| ^if($MAIN:browser eq "nn" && $MAIN:browser_ver < 5){ | |
| $repl[^table::create{a b | |
| &hellip^; …^; | |
| &rdquo^; ”^; | |
| &ldquo^; “^; | |
| &mdash^; —^; | |
| &ndash^; –^; | |
| &bull^; •^;}] | |
| $result[^body.replace[$repl]] | |
| }{ | |
| $result[$body] | |
| } | |
| $not_optimized_space[^taint[as-is][ ]] | |
| $not_optimized_tab[^taint[as-is][^#09]] | |
| $not_optimized_enter[^taint[as-is][^#0A]] | |
| $result[^result.match[прОбЭл][g]{$not_optimized_space}] | |
| $result[^result.match[тАб][g]{$not_optimized_tab}] | |
| $result[^result.match[энтЕр][g]{$not_optimized_enter}] | |
| ^rem{ *** обрабатываем [parser]код[/parser] *** } | |
| $result[^result.match[\[(parser)\](.+?)\[/\1\]][g]{^taint[as-is][^process{$match.2}]}] | |
| }{ | |
| $result[] | |
| } | |
| ^getStat[] | |
| ^rusage[] | |
| # а это мы можем вывести список макросов, которые outdated, но которые вызывались... | |
| # ^printOutdatedMacro[] | |
| #end @postprocess[body] | |
| ################################################################################################# | |
| @rusage[msg][rusage] | |
| #^if(!in "/admin/"){ | |
| $rusage[$status:rusage] | |
| $now[^date::now[]] | |
| $s[[^now.sql-string[]] $rusage.utime $rusage.stime $rusage.maxrss $rusage.ixrss $rusage.idrss $rusage.isrss $request:uri $env:REMOTE_ADDR [$status:memory.used/$status:memory.free/$status:memory.since_compact/$status:memory.process] $msg^#0A] | |
| ^s.save[append;/../data/rusage.log] | |
| #} | |
| #end @rusage[] | |
| ################################################################################################# | |
| # этот метод выведет статистику, собранную экземпляром класса $MAIN:pSQL | |
| @getStat[] | |
| ^if(def $MAIN:pSQL && $MAIN:pSQL.debug){ | |
| $result[^MAIN:pSQL.getStatistics[/../data/sql.txt]] | |
| }{ | |
| $result[] | |
| } | |
| #end @stat[] | |
| ################################################################################################# | |
| # метод достает названия методов с комментариями у указаного файла и показывает их | |
| @getComments[f][file;fd;t;comments] | |
| $file[^if(def $f){$f}{/../data/classes/engine.p}] | |
| ^if(-f $file){ | |
| $fd[^file::load[text;$file]] | |
| $t[$fd.text] | |
| $t[^t.match[^^##[^^#]*^$][mg]{}] | |
| $t[^t.match[(\n){3,}][g]{${match.1}$match.1}] | |
| $comments[^t.match[(#{5,}\n#\s.*?\n@.+?\^])][g]] | |
| $result[^taint[as-is][^comments.menu{$comments.1^#0A^#0A^#0A}]] | |
| } | |
| #end @getComments[] |