phpnuke portal system
HejJeg sidder og leger med phpnuke.org protal systemet... Det er en NT 2K server med php og mysql (azero.dk) Men jeg får en fejl jeg ikke fatter at rette :-(( (se evt. på www.vels.dk/portal/)
her er fejlen...
Fatal error: Call to unsupported or undefined function preg_match_all() in d:\\home\\velsdk\\www\\portal\\index.php3 on line 74
her er filen index.php3:
------------------------
<?PHP
######################################################################
# PHP-NUKE: Web Portal System
# ===========================
#
# Copyright (c) 2000 by Francisco Burzi (fburzi@ncc.org.ve)
# http://linuxpreview.org
#
# This modules is the main index file
#
# This program is free software. You can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License.
######################################################################
if(!IsSet($mainfile)) { include (\"mainfile.php3\"); }
$index = 1;
include(\"header.php3\");
if (isset($cookie[3])) $storynum = $cookie[3]; else $storynum = 10;
$result = mysql_query(\"SELECT sid, aid, title, time, introtext, fulltext, comments, counter, topic, informant, notes, hits FROM stories ORDER BY sid DESC limit $storynum\");
if(!$result) { echo mysql_errno(). \": \".mysql_error(). \"<br>\"; exit(); }
while (list($s_sid, $aid, $title, $time, $introtext, $fulltext, $comments, $counter, $topic, $informant, $notes, $hits) = mysql_fetch_row($result)) {
getTopics($s_sid);
formatTimestamp($time);
$subject = stripslashes($subject);
$introtext = stripslashes($introtext);
$notes = stripslashes($notes);
$introcount = strlen($introtext);
$fullcount = strlen($fulltext);
$totalcount = $introcount + $fullcount;
$morelink = \"( \";
if ($fullcount > 1) {
$morelink .= \"<a href=\\\"article.php3?sid=$s_sid\";
if (isset($cookie[4])) { $morelink .= \"&mode=$cookie[4]\"; } else { $morelink .= \"&mode=threaded\"; }
if (isset($cookie[5])) { $morelink .= \"&order=$cookie[5]\"; } else { $morelink .= \"&order=0\"; }
$morelink .= \"\\\"><b>\".translate(\"Read More...\").\"</b></a> | $totalcount \".translate(\"bytes more\").\" | \"; }
$count = $comments;
$morelink .= \"<a href=\\\"article.php3?sid=$s_sid\";
if (isset($cookie[4])) { $morelink .= \"&mode=$cookie[4]\"; } else { $morelink .= \"&mode=threaded\"; }
if (isset($cookie[5])) { $morelink .= \"&order=$cookie[5]\"; } else { $morelink .= \"&order=0\"; }
if (isset($cookie[6])) { $morelink .= \"&thold=$cookie[6]\"; } else { $morelink .= \"&thold=0\"; }
$morelink2 = \"<a href=\\\"article.php3?sid=$s_sid\";
if (isset($cookie[4])) { $morelink2 .= \"&mode=$cookie[4]\"; } else { $morelink2 .= \"&mode=threaded\"; }
if (isset($cookie[5])) { $morelink2 .= \"&order=$cookie[5]\"; } else { $morelink2 .= \"&order=0\"; }
if (isset($cookie[6])) { $morelink2 .= \"&thold=$cookie[6]\"; } else { $morelink2 .= \"&thold=0\"; }
if(($count==0)) {
$morelink .= \"\\\">\".translate(\"comments?\").\"</a> )\";
} else {
if (($fullcount<1)) {
if(($count==1)) {
$morelink .= \"\\\"><b>\".translate(\"Read More...\").\"</b></a> | $morelink2\\\">$count \".translate(\"comment\").\"</a> )\";
} else {
$morelink .= \"\\\"><b>\".translate(\"Read More...\").\"</b></a> | $morelink2\\\">$count \".translate(\"comment\").\"s</a> )\";
}
} else {
if(($count==1)) {
$morelink .= \"\\\">$count \".translate(\"comment\").\"</a> )\";
} else {
$morelink .= \"\\\">$count \".translate(\"comment\").\"s</a> )\";
}
}
}
// Following two lines are for add a hit to the database
$sid = $s_sid;
preg_match_all(\"/<\\s*a [^>]*?href=([^>\\s]+).*?>/i\", $introtext, $match, PREG_PATTERN_ORDER);
$a = \"0\";
$i = \"0\";
while ($a < \"10\") {
$url = urlencode($match[1][$i]);
$introtext = ereg_replace(\"<a href=\".$match[1][$i].\">\", \"<a href=redirect.php3?op=redir&sid=$sid&url=$url>\", $introtext);
$a++;
$i++;
}
preg_match_all(\"/<\\s*a [^>]*?href=([^>\\s]+).*?>/i\", $notes, $match, PREG_PATTERN_ORDER);
$a = \"0\";
$i = \"0\";
while ($a < \"10\") {
$url = urlencode($match[1][$i]);
$notes = ereg_replace(\"<a href=\".$match[1][$i].\">\", \"<a href=redirect.php3?op=redir&sid=$sid&url=$url>\", $notes);
$a++;
$i++;
}
themeindex($aid, $informant, $datetime, $title, $counter, $topic, $introtext, $notes, $morelink, $topicname, $topicimage, $topictext, $hits);
}
mysql_free_result($result);
include(\"footer.php3\");
// Save referer info into the database to know who are linking us
include(\"config.php3\");
if ($httpref>0) {
if($HTTP_REFERER==\"\" OR ereg(\"linuxpreview.org\", $HTTP_REFERER) OR ereg(\"unknown\", $HTTP_REREFER) OR ereg(\"ncc.org.ve\", $HTTP_REREFER)) {
} else {
mysql_query(\"insert into referer values(NULL, \'$HTTP_REFERER\')\");
}
}
?>
