ok, will try later when back from work
thanks
ok, made it work like this
PHP Code:
<?php
require_once('./global.php');
$mod_options['code'] = "media";
$mod_options['limit'] = "5";
$mod_options['forumid'] = "35";
if (!$mod_options['replace']) {
$mod_options['replace'] = $mod_options['code'];
}
$poststuffs = $db->query_read_slave("
SELECT post.pagetext
FROM " . TABLE_PREFIX . "post AS post
INNER JOIN " . TABLE_PREFIX . "thread USING (threadid)
WHERE forumid = ".$mod_options['forumid']."
AND pagetext LIKE '%[".$mod_options['code']."]%[/".$mod_options['code']."]%'
AND pagetext NOT LIKE '%[".$mod_options['code']."]%mp3[/".$mod_options['code']."]%'
AND pagetext NOT LIKE '%[".$mod_options['code']."]mms%[/".$mod_options['code']."]%'
AND pagetext NOT LIKE '%[quote]%[".$mod_options['code']."]%[/".$mod_options['code']."]%[/quote]%'
ORDER BY post.dateline DESC LIMIT ".$mod_options['limit']."
");
while ($poststuff = $db->fetch_array($poststuffs)) {
$poststring[] = preg_replace("#^.*\[".$mod_options['code']."\](.*)\[/".$mod_options['code']."\].*$#si", "[".$mod_options['replace']."]$1[/".$mod_options['code']."]", $poststuff[pagetext]);
}
print_r($poststring);
?>
thanks