Thanks Drakla I tried that but it didn't work.
Logank I don't know PHP all that well, just enough to get by.
So I am posting the tags.php hopefully someone can tell me how to include tags.php?show=limit.
<? ob_start("ob_gzhandler");
include_once("data/config.php");
if(count($_GET)) {
foreach ($_GET as $k => $v){
$add .= "$".$k."=\"".$v."\";";
} eval($add);
}
if ($_COOKIE['data']['rate']) $refresh = trim($_COOKIE['data']['rate']);
if ($_COOKIE['data']['time']) {
$myLast = $_COOKIE['data']['time'];
} else {
$myLast = 1;
}
if ($c && ($_COOKIE['lastTime'] > $_COOKIE['data']['time']))
setcookie ("data[time]", $_COOKIE['lastTime'], time() + 3600);
if (is_dir("styles/".$_GET['skin'])) { $skin = $_GET['skin'] . "/"; } else { $skin = ""; }
?>
<head>
</head>
<body>
<?
function formatDate($format,$currently,$offset) {
$offset = $offset * 3600;
$currently = $currently - $offset;
$new_date = date($format, $currently);
return $new_date;
}
function textFormat($str) {
global $smileFile, $curseFile, $smilies, $curses, $BBCodeFile, $BBCode;
if ($smilies) {
$file = file($smileFile);
foreach($file as $value){
list($code, $image)=explode("|", $value);
$src = "<img src=\"smilies/".trim($image)."\" alt=\"".$code."\" />";
$str = str_replace($code, $src, $str);
}
}
if ($curses) {
$curse = file($curseFile);
foreach($curse as $value){
list($curse, $bleep)=explode("|", $value);
$str = preg_replace("/".$curse."/i", $bleep, $str);
}
}
if ($BBCode) {
include($BBCodeFile);
}
$str = eregi_replace("\" \" target=\"","\" target=\"",$str);
return $str;
}
function textWrap($str, $cols, $cut = " ") {
$len = strlen($str);
$tag = 0;
for ($i = 0; $i < $len; $i++) {
$chr = $str[$i];
if ($chr == '<') {
$tag++;
} elseif ($chr == '>') {
$tag--;
} elseif ((!$tag) && (ctype_space($chr))) {
$wordlen = 0;
} elseif (!$tag) {
$wordlen++;
}
if ((!$tag) && ($wordlen) && (!($wordlen % $cols))) {
$chr .= $cut;
}
$result .= $chr;
}
return $result;
}
function autoDelete() {
global $tagLife, $entryFile;
if ($tagLife) {
$tagLife = $tagLife * 86400;
$file = file($entryFile);
while(list(,$value)=each($file)){
list($dname, $dcomment, $dwebsite, $ddate, $dip) = explode("|",$value);
$diff = time() - $tagLife;
if ($ddate < $diff) {
$fp = fopen($entryFile, "r");
$data = fread($fp, filesize($entryFile));
fclose($fp);
$old = $dname."|".$dcomment."|".$dwebsite."|".$ddate."|".$dip."|\n";
$new = "";
$data = str_replace($old, $new, $data);
$fp = fopen($entryFile, "w");
fputs($fp, $data);
fclose($fp);
}
}
}
}
// An idea from Simon Willison (http://simon.incutio.com/)
function contentFilter($content, $filter='none') {
if (function_exists($filter)) {
$content = preg_replace_callback('/(?(?<=>)|\A)([^<>]+)(?(?=<)|\Z)/s', $filter, $content);
}
return $content;
}
function array_apply_regexp($patterns,$content) {
$keys = array_keys($patterns);
$values = array_values($patterns);
$content = preg_replace($keys,$values,$content);
return $content;
}
function getLinks($str) {
$str = " " . $str;
$str = preg_replace("#([\t\r\n ])([a-z0-9]+?){1}://([\w\-]+\.([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^ \"\n\r\t<]*)?)#i", '\1<a href="\2://\3" target="_blank">(link)</a>', $str);
// show URL instead of http
// $str = preg_replace("#([\t\r\n ])(www|ftp)\.(([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^ \"\n\r\t<]*)?)#i", '\1<a href="http://\2.\3" target="_blank">\2.\3</a>', $str);
$str = preg_replace("#([\t\r\n ])(www|ftp)\.(([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^ \"\n\r\t<]*)?)#i", '\1<a href="http://\2.\3" target="_blank">(link)</a>', $str);
$str = preg_replace("#([\t\r\n ])([a-z0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">(mail)</a>", $str);
$str = substr($str, 1);
return $str;
}
include_once($filterFile);
if (!$show || $show == "")
$show = "limit";
$strings = "";
if ($show == "limit") {
$limits = $limit-1;
if ($max) {} else { $max="$limits"; }
if ($min) {} else { $min="0"; }
$tag = file ($entryFile);
$count = "0"; while (list ($key, $val) = each ($tag)) {
if ($key >= $min && $key <= $max) {
list($name, $comment, $website, $date, $ip) = explode("|",$val);
if ($name == "Host") $name = "";
if ($_COOKIE['data']['filter']) $comment = contentFilter($comment, $_COOKIE['data']['filter']);
if ($website == "http://" || $website == "") {
$name = $name;
} else {
if (substr($website, 0, 7) == "http://") {
$name = "<a href=\"$website\" title=\"\" target=\"_blank\">$name</a>";
} else {
$name = "<a href=\"mailto:$website\" title=\"\">$name</a>";
}
}
if($count % 2 == 1) {
$altStyle = "altColor1";
} else {
$altStyle = "altColor2";
}
if ($_COOKIE['data']['admin'] == md5($wm_pass) || $_COOKIE['data']['ip'] == $ip && $name != "") {
$del = "<a href=\"sign.php?remove=true&TAG_time=".$date."&skin=".$_GET['skin']."\" title=\"Remove tag\" onclick=\"alertConfirm(this.href, 'delete'); return false;\">[x]</a>";
if ($_COOKIE['data']['admin'] == md5($wm_pass)) {
$del .= "<a href=\"sign.php?ban=true&TAG_ip=".$ip."&skin=".$_GET['skin']."\" title=\"Ban IP Address\" onclick=\"alertConfirm(this.href, 'ban'); return false;\">[b]</a>";
}
} else {
$del = "";
}
$comment = textWrap(getLinks($comment), $wrapLength);
$entry = str_replace("{name}", $name, $entryFormat);
$entry = str_replace("{comment}", textFormat($comment), $entry);
$entry = str_replace("{date}", formatDate($format, $date, $timezone), $entry);
$entry = str_replace("{ip}", $ip, $entry);
$entry = str_replace("{del_ban}", $del, $entry);
$entry = str_replace("{altStyle}", $altStyle, $entry);
$strings .= "\n" . $entry;
}
$count++;
}
} else {
$limits = $limit-1;
if (!$max) { $max = $limits; }
if (!$min) { $min = 0; }
$tag = file ($entryFile);
$count = "0"; while (list ($key, $val) = each ($tag)) {
if ($key >= $min && $key <= $max) {
list($name, $comment, $website, $date, $ip) = explode("|",$val);
if ($name == "Host") $name = "";
if ($_COOKIE['data']['1337']) $comment = formatLeet($comment);
if ($website == "http://" || $website == "") {
$name = $name;
} else {
$name = "<a href=\"$website\" title=\"\" target=\"_blank\">$name</a>";
}
if($count % 2 == 1) {
$altStyle = "altColor1";
} else {
$altStyle = "altColor2";
}
if ($_COOKIE['data']['admin'] == md5($wm_pass) || $_COOKIE['data']['ip'] == $ip && $name != "") {
$del = "<a href=\"sign.php?remove=true&TAG_time=".$date."&skin=".$_GET['skin']."\" title=\"Remove tag\" onclick=\"alertConfirm(this.href, 'delete'); return false;\">[x]</a>";
if ($_COOKIE['data']['admin'] == md5($wm_pass)) {
$del .= "<a href=\"sign.php?ban=true&TAG_ip=".$ip."&skin=".$_GET['skin']."\" title=\"Ban IP Address\" onclick=\"alertConfirm(this.href, 'ban'); return false;\">[b]</a>";
}
} else {
$del = "";
}
$comment = textWrap(getLinks($comment), $wrapLength);
// fix URL THINGY error
// please ignore my bad coding here, it was a fast alternative :)
$comment = str_replace("[url=[<a href=\"", "[url=", $comment);
$comment = eregi_replace("title=\"([^\\[]*)\" target=\"_blank\">link</a>\\]\\]","]",$comment);
$comment = str_replace("</a>", "[/url]", $comment);
$entry = str_replace("{name}", $name, $entryFormat);
$entry = str_replace("{comment}", textFormat($comment), $entry);
$entry = str_replace("{date}", formatDate($format, $date, $timezone), $entry);
$entry = str_replace("{ip}", $ip, $entry);
$entry = str_replace("{del_ban}", $del, $entry);
$entry = str_replace("{altStyle}", $altStyle, $entry);
$strings .= "\n" . $entry;
}
$count++;
}
$strings2 .= "<center>";
if ($count == "0") {
$strings2 .= "<center>0 entries in total";
} else if ($count == "1") {
$strings2 .= "<center>1 entry in total";
} else if ($count >= "2") {
$strings2 .= "<center>$count entries in total<br /><br />";
}
if ($min > 0) {
$n_max = $max - $limit;
$n_min = $min - $limit;
$strings2 .= "<a href=\"tags.php?show=all&max=$n_max&min=$n_min\" title=\"\"><b>Previous</b></a> ";
} if ($count > $max) {
$n_max = $max + $limit;
$n_min = $min + $limit;
$strings2 .= "<a href=\"tags.php?show=all&max=$n_max&min=$n_min\" title=\"\"><b>Next</b></a>";
}
$strings2 .= "<br /><a href=\"http://www.venturenine.com\" title=\"TagBoard from Venture Nine PHP Web Solutions\" target=\"_blank\">Tagger LE</a></center>";
}
autoDelete();
echo $headText . "\n";
echo '<table class="tabularData" border="0" cellspacing="0" cellpadding="0" summary="Venture Nine Tagger entries">';
echo "\n" . $strings;
echo "\n</table>" . $strings2;
echo $footText;
echo "<img src=\"buffer.php\" name=\"refresh\" alt=\"\" width=\"0\" height=\"0\" />";
?>
</body>
</html>
<? ob_end_flush(); ?>
The main reason I need to include tags.php?show=limit is to give the user the ability to delete his or her shout. When tags.php is displayed it just shows the shouts.