str = ''; //Unmodified string $this->oldStr = ''; ///// // The below member variables define the link formatting // for example, for an email address, the default format ('mail:')would // produce a regular email link, as in estrabd@mvdev.com, // but say you had a page called 'contact.php' that produced a form using 'sendTo' in the query // string which you used to pass the email address, you would set the email format below // to './contact.php?sendTo=' . This produces a link such as // //// //URL link format $this->urlFormat = 'href='; //URL link target $this->urlTarget = '_new'; //Email link format $this->emailFormat = './contact.php?sendTo='; // Query string example: //$this->emailFormat='./contact.php?sendTo='; //Email link target $this->emailTarget = '_new'; } /** * Main method --> does parsing and replacing. */ function format($str = '') { $this->str = $str; $this->oldStr = $str; if (! $this->str == '') { //These regular expressions were borrowed from http://www.phpwizard.net . Thanks, guys! $this->str = eregi_replace("([^\"[[:alpha:]]|^)([[:alpha:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])", "\\1urlFormat."\"\\2://\\3\\4\" target=\"".$this->urlTarget."\">\\3\\4", $this->str); $this->str = eregi_replace("(([A-Za-z0-9_]|\\-|\\.)+@([^[:space:]]*)([[:alnum:]-]))", "emailFormat."\\1\" target=\"".$this->emailTarget."\">\\1", $this->str); # $this->str = eregi_replace("([^\:A-Za-z0-9]|^)(([A-Za-z0-9_]|\\-|\\.)+@([^[:space:]]*)([[:alnum:]-]))", "\\1emailFormat."\\2\" target=\"".$this->emailTarget."\">\\2", $this->str); return $this->str; } } /** * Returns original string that was parsed. */ function getOldStr() { return $this->oldStr; } } class http_var { var $classname = "http_vars"; var $var; function set($variable,$value) { $this->var["$variable"] = $value; } function p($variable) { print $this->var["$variable"]; } function f($variable) { return $this->var["$variable"]; } } function updateCount($id) { $qid = new DB_Pecknet; $sql="select readCount from news where id='$id'"; $qid->query($sql); $qid->next_record(); $readCount=$qid->f("readCount")+1; $sql="update news set readCount='$readCount' where id='$id'"; $qid->query($sql); $qid->next_record(); } function box_open($title,$width,$bgcolor) { ?>
|
" . $item->f("topic") . " | " . date("l dS of F Y h:i:s A ",$item->f("datestamp")) . " |
f("image"))
# {
# $image = new Image("icons", basename($item->f("image")));
# $image->resize(93,70);
# print "filename . "\" BORDER=0 VALIGN=TOP ALIGN=RIGHT " . $image->size . ">\n";
# }
$linkObj = new Linker();
$body=$linkObj->format($item->f("body"));
# Convert http:// into Hyper Links..
#$body=eregi_replace("([^\"]http://[a-zA-Z0-9_%=#&?\./\-]*[^\"])","\\1",$body);
#$body=eregi_replace("([^/]+www.[a-zA-Z0-9_%=#&?\./\-]*[^\"])","\\1",$body);
if($limit!=0)
{
if(eregi("