Annotation of parser3/www/htdocs/auto.p, revision 1.4

1.4     ! paf         1: @USE
        !             2: common/lib.p
        !             3: common/layout.p
        !             4: common/implode.p
        !             5: common/graph.p
        !             6: date/dtf.p
        !             7: engine_mdm.p
        !             8: mysql.p
        !             9: 
        !            10: 
        !            11: @auto[]
        !            12: ^if(in "/admin/"){
        !            13:        ^use[admin.p]
        !            14: }
        !            15: $MAIN:pSQL[^mysql::init[$SQL.connect-string]]
        !            16: ^detectBrowser[]
        !            17: $MAIN:newsfileDir[/i/news/]
        !            18: #end 
        !            19: 
        !            20: 
        !            21: @exception[origin;source;comment;type;code;stack][i;j]
        !            22: <body>
        !            23: <font color="black">
        !            24: ^if(def $source){$origin '$source'}
        !            25: ${comment}.
        !            26: ^if(def $type){type=$type}
        !            27: ^if(def $code){code=$code}
        !            28: ^if($stack){
        !            29:     <hr>
        !            30:     stack backtrace:<br />
        !            31:     ^stack.menu{
        !            32:         $stack.origin: $stack.name<br />
        !            33:     }
        !            34: }
        !            35: #end
        !            36: 
        !            37: 
        !            38: 
        !            39: #################################################################################################
        !            40: @error404[]
        !            41: ^location[http://$env:SERVER_NAME/404/]
        !            42: #end @error404[]
        !            43: 
        !            44: 
        !            45: 
        !            46: #################################################################################################
        !            47: @pageHeader[header]
        !            48: $header
        !            49: #end @pageHeader[]
        !            50: 
        !            51: 
        !            52: 
        !            53: #################################################################################################
        !            54: @pageFooter[]
        !            55: footer
        !            56: #end @pageFooter[]
        !            57: 
        !            58: 
        !            59: 
        !            60: #################################################################################################
        !            61: @body[content]
        !            62: <body bgcolor="#F4F4F4" text="#000000" link="#0000C4" alink="#0000C4" vlink="#073683" marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" rightmargin="0" onLoad="init()">
        !            63:        $content
        !            64: </body>
        !            65: #end @body[]
        !            66: 
        !            67: 
        !            68: 
        !            69: #################################################################################################
        !            70: @html[header;content]
        !            71: <!-- Copyright (c) Art. Lebedev Studio | http://www.design.ru/ -->
        !            72: <html>
        !            73: <head>
        !            74:        <base target="_top">
        !            75:        <link rel="stylesheet" type="text/css" href="/main.css"></link>
        !            76:        <title>AB.LV^if(def $header){ | ^taint[as-is][$header] }</title>
        !            77: </head>
        !            78: ^body{
        !            79:        <table cellpadding="0" cellspacing="0" border="0" width="100%" bgcolor="#ffffff">
        !            80:        ^pageHeader[]
        !            81:        $content
        !            82:        ^pageFooter[]
        !            83:        </table>
        !            84: }
        !            85: <html>
        !            86: #end @html[]
        !            87: 
        !            88: 
        !            89: #################################################################################################
1.1       paf        90: @main[]
1.4     ! paf        91: ^pSQL.server{
        !            92:        <html>
        !            93:        <head>
        !            94:                ^if(def $prepare){^prepare[]}
        !            95:        </head>
        !            96:        ^body{
        !            97:                ^content[]
        !            98:        }
        !            99:        </html>
        !           100: }
        !           101: # @main[]
        !           102: 
        !           103: 
        !           104: 
        !           105: #################################################################################################
        !           106: @postprocess[body][repl]
        !           107: #paf manually ^rusage[]
        !           108: ^if($MAIN:browser eq "nn" && $MAIN:browser_ver < 5){
        !           109:        $repl[^table::set{a b
        !           110: &hellip^;      &#133^;
        !           111: &rdquo^;       &#148^;
        !           112: &ldquo^;       &#147^;
        !           113: &mdash^;       &#151^;
        !           114: &ndash^;       &#150^;
        !           115: &bull^;        &#149^;}]
        !           116:        $result[^if(def $body){^body.replace[$repl]}]
        !           117: }{
        !           118:        $result[$body]
        !           119: }
        !           120: #end @postprocess[body]
        !           121: 
        !           122: 
        !           123: 
        !           124: #################################################################################################
        !           125: @getNewsType[]
        !           126: $result[^table::sql{
        !           127:        SELECT
        !           128:                news_type_id AS id,
        !           129:                name,
        !           130:                path
        !           131:        FROM
        !           132:                news_type
        !           133:        WHERE
        !           134:                is_published = '1'
        !           135:        ORDER BY
        !           136:                sort_order
        !           137: }]
        !           138: 
        !           139: 
        !           140: 
        !           141: #################################################################################################
        !           142: @sendSubscribeMail[type;from;pass]
        !           143: ^mail:send[
        !           144:        $.to[$form:email]
        !           145:        $.from[$from]
        !           146:        $.charset[KOI8-R]
        !           147:        $.content-type[
        !           148:                $.value[text/plain]
        !           149:                $.charset[KOI8-R]
        !           150:        ]
        !           151:        $.subject[^if($type eq "insert"){mdm subscribe}{mdm update subscription}]
        !           152:        $.body[^if($type eq "insert"){Адрес "$form:email" был внесен в список рассылки новостей сайта МДМ
        !           153: 
        !           154: Чтобы сделать подписку активной и/или изменить ее параметры, достаточно зайти на страницу:
        !           155: http://${env:SERVER_NAME}/press/subscribe/edit/?email=$form:email&code=$pass
        !           156: 
        !           157: Если подписка не будет подтверждена в течение 30  дней с момента
        !           158: отправки  данного  сообщения, ваш адрес будет автоматически удален из
        !           159: базы данных 
        !           160: 
        !           161: С уважением, 
        !           162: Служба новостей МДМ
        !           163: http://${env:SERVER_NAME}/
        !           164: }{Чтобы изменить параметры подписки, достаточно зайти на страницу:
        !           165: http://${env:SERVER_NAME}/press/subscribe/edit/?email=$form:email&code=$pass
        !           166: 
        !           167: С уважением, 
        !           168: Служба новостей МДМ
        !           169: http://${env:SERVER_NAME}/}]
        !           170: ]
        !           171: #end @sendMail[]
        !           172: 
        !           173: 
        !           174: 
        !           175: #################################################################################################
        !           176: # ПАФ сказал добавить :)))
        !           177: @rusage[]
        !           178: $rusage[$status:rusage]
        !           179: $now[^date::now[]]
        !           180: $s[[^now.sql-string[]] $rusage.utime $rusage.stime $rusage.maxrss $rusage.ixrss $rusage.idrss $rusage.isrss $request:uri
        !           181: ]
        !           182: ^s.save[append;/mdm/rusage.log]
        !           183: #end
        !           184: 

E-mail: