ทดสอบ ultraviolet highlight plugin

Posted by Revolution Wed, 21 Nov 2007 07:35:22 GMT

<?php
require 'DB.php';

$dsn = 'mysql://root:bank24@localhost/vhcs2';

$dbh = DB::connect($dsn);

if(DB::isError($dbh)){
        die ($dbh->getMessage());
}
$result = $dbh->query("select * from admin");
if(DB::isError($result)) { die($result->getMessage());}

while($row = $result->fetchRow()){
        print $row[0]."\n";
        }

#$result = $dbh->query("select * from admin");
#if(DB::isError($result)) { die($result->getMessage());}

#while($result->fetchInto($row)){
#        print $row[0]."\n";
#        }       
$row = $dbh->getAll("select * from admin");
print_r($row);
?>

ใช้กับ textile ไม่ได้แหะ ลองอีก code

def self.macrofilter(blog,content,attrib,params,text="")

        lang       = attrib['lang'] || "plain_text"
        title      = attrib['title']
        cssclass   = attrib['class'] || 'iplastic'
        linenumber = attrib['linenumber'] || false

        text = text.to_s.gsub(/\r/,'').gsub(/\A\n/,'').chomp
        convertor = Uv
        text = convertor.parse(text, "xhtml", lang, linenumber, cssclass)

        "<div class=\"typocode\">#{text}</div>"   

      end

Comments - (Leave a comment)

Trackbacks

Use the following link to trackback from your own site:
/articles/trackback/2135

Leave a comment