so how it can be used in phpbb3? or is there even a better way to to it in phpbb3
the code allows gustes to read only the 400 first characters of a post
Code: Select all
$message = substr(($message), 0, 400).'..
Code: Select all
if ((($forum_id == 1) or ($forum_id == 2) or...etc
Code: Select all
// Begin Gusets see only part of posts
# here you can specify certain forums and topics to be excluded from not reading by guests
if ((($forum_id == 1) or ($forum_id == 2) or ($forum_id == 3) or ($forum_id == 4) or ($forum_id == 5) or ($forum_id == 6) or ($forum_id == 7) or ($forum_id == 8) or ($forum_id == 11) or ($forum_id == 14) or ($forum_id == 15) or ($forum_id == 16) or ($forum_id == 21) or ($forum_id == 22) or ($forum_id == 23) or ($forum_id == 28)) && ($topic_id != 31) && ($topic_id != 20))
{
$lettercount = (strlen($message));
if (($userdata['username'] == 'Anonymous') && ($lettercount > 400))
{
$path = __FILE__;
$file = basename ($path);
if ($file != 'portal.php')//needed for portal support, otherwise portal layout will breakout when clips are played.
{
//first check if message has quote in it or a ot, quote box breaks forums layout.
$message = str_replace("[ot", "[ ot", $message);
$message = substr(($message), 0, 400).'... <br><br><table border=1 color=red style="background-color:#99CCFF"><tr><td>'.$lang['onlyforeguser'].'<tr><td><b><a href="http://'.$board_config['server_name'].$board_config['script_path'].'profile.php?mode=register">'.$lang['Register'].'</a><tr><td> '.$lang['or'].' <a href="http://'.$board_config['server_name'].$board_config['script_path'].'login.php?redirect=viewtopic.php?t='.$postrow[$i]['topic_id'].'">'.$lang['Login'].'</a> '.$lang['GuestWantReadAll'].'</b></td></tr></table>';
}
}
}
// End Gusets see only part of posts