Delarna som är av intresse för dig är:
Inkludera common.php:
<?php
define('PUN_TURN_OFF_MAINT', 1);
define('PUN_QUIET_VISIT', 1);
define('PUN_ROOT', './forums/');
require PUN_ROOT.'include/common.php';
?>
Inkludera en CSS-fil som reflekterar användarens val i forumet:
<link rel="stylesheet" type="text/css" href="style/<?php echo $pun_user['style'] ?>_site.css" />
Koden som listar de senast aktuella trådarna från forumet:
<?php
$result = $db->query('SELECT t.id, t.subject FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.moved_to IS NULL AND f.id NOT IN(28) ORDER BY t.last_post DESC LIMIT 12') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
while ($cur_topic = $db->fetch_assoc($result))
{
if ($pun_config['o_censoring'] == '1')
$cur_topic['subject'] = censor_words($cur_topic['subject']);
if (pun_strlen($cur_topic['subject']) > 28)
$cur_topic['subject'] = pun_htmlspecialchars(trim(substr($cur_topic['subject'], 0, 25))).' …';
else
$cur_topic['subject'] = pun_htmlspecialchars($cur_topic['subject']);
echo "\t\t\t\t\t\t".'<li><a href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'&action=new">'.$cur_topic['subject'].'</a></li>'."\n";
}
?>
Inkludera news.html:
<?php require PUN_ROOT.'plugins/AP_News_Generator/news.html'; ?>
"Programming is like sex: one mistake and you have to support it for the rest of your life."