1

(5 replies, posted in PunBB 1.2 discussion)

Meh dont ruin this, it woud be a major event under punbb users and I think it woud be a lot of fun.

2

(5 replies, posted in PunBB 1.2 discussion)

K well I hope it will be excuted then tongue or atleast when 1.3 is delayed after 2008 yust hold the contest xD?

Hello gy's

Some forum systems use a content under there users to see wish punbb is the best for fame or money. It woud be really nice to have such a contest here. Like for best layout or besy modification or all over best. Stuff like that. I shoud really think we shoud have a contest like that here ^^

It woud motivate people even more to make there punbb forum better ^^

Might be hijacking a topic but umm do you sell your punbb hosting script?

Smartys wrote:

Try removing

require PUN_ROOT.'include/rewrite.php';

from sitemap.php

Woohoo ^^ I love you man, I was trying to figure it out forever XD I thaught it was some titel duplicate problem Xd. Thanxs a lot man apriciate it.

Smartys wrote:

Then no wink

Woudt it be by coninsidence that its your service smartys? ^^ and um maybe contact the free hosting and offer to pay them for your database details?

Ye I wish it was that eassy, I will share the code of the sitemap and the rewrite.php.

sitemap:

<?php
/***********************************************************************

  Copyright (C) 2002-2005  Neal Poole (smartys@gmail.com)

  This file is part of PunBB.

  PunBB 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,
  or (at your option) any later version.

  PunBB is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  MA  02111-1307  USA

************************************************************************/

define('PUN_QUIET_VISIT', 1);
define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';
require PUN_ROOT.'include/rewrite.php';

// false = write to file, true = dynamic
$dynamic = true;

// This only matters if you're writing to the file
$filename = 'sitemap.xml';


// Get the topics
$result = $db->query('SELECT t.id as topic_id, subject, last_post, sticky, num_replies FROM '.$db->prefix.'topics AS t LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=t.forum_id AND fp.group_id=3) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.moved_to IS NULL ORDER BY last_post DESC') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());

// Get the forums
$result2 = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE fp.read_forum IS NULL OR fp.read_forum=1 ORDER BY c.disp_position, c.id, f.disp_position') or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());

$output = '<?xml version="1.0" encoding="UTF-8"?>'."\n";
$output .= '<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">'."\n";

// The board itself
$output .= "<url>\n";
$output .= "\t<loc>".$pun_config['o_base_url']."/</loc>\n";
$output .= "\t<lastmod>".gmdate('Y-m-d\TH:i:s+00:00', time())."</lastmod>\n";
$output .= "\t<priority>1.0</priority>\n";
$output .= "</url>\n\n";


// Output the data for the forums
while ($cur_forum = $db->fetch_assoc($result2))
{
    $lastmodified = gmdate('Y-m-d\TH:i:s+00:00', $cur_forum['last_post']);
    $viewforum = makeurl("f", $cur_forum['fid'], $cur_forum['forum_name']);
    $priority = '1.0';

    $output .= "<url>\n";
    $output .= "\t<loc>".$pun_config['o_base_url']."/".$viewforum."</loc>\n";
    $output .= "\t<lastmod>$lastmodified</lastmod>\n";
    $output .= "\t<priority>$priority</priority>\n";
    $output .= "</url>\n\n";
        
    if ($cur_forum['num_topics'] >= $pun_config['o_disp_topics_default'])
    {
        $num_pages = ceil($cur_forum['num_topics'] / $pun_config['o_disp_topics_default']);

        //Add page number for subsequent pages
        for ($i = 2; $i <= $num_pages; $i++)
        {
            $output .= "<url>\n";
            $output .= "\t<loc>".$pun_config['o_base_url']."/".$viewforum."&p=".$i."</loc>\n";
            $output .= "\t<lastmod>$lastmodified</lastmod>\n";
            $output .= "\t<priority>$priority</priority>\n";
            $output .= "</url>\n\n";
        }
    }
}

// Output the data for the topics
while ($cur_topic = $db->fetch_assoc($result))
{
    $lastmodified = gmdate('Y-m-d\TH:i:s+00:00', $cur_topic['last_post']);
    $viewtopic = makeurl("t", $cur_topic['topic_id'], $cur_topic['subject']);
    $priority = ($cur_topic['sticky'] == '1') ? '1.0' : '0.5';

    $output .= "<url>\n";
    $output .= "\t<loc>".$pun_config['o_base_url']."/".$viewtopic."</loc>\n";
    $output .= "\t<lastmod>$lastmodified</lastmod>\n";
    $output .= "\t<priority>$priority</priority>\n";
    $output .= "</url>\n\n";
        
    if ($cur_topic['num_replies'] >= $pun_config['o_disp_posts_default'])
    {
        // We add one because the first post is not counted as a reply but needs to be
        // taken into account for display
        $num_pages = ceil(($cur_topic['num_replies'] + 1) / $pun_config['o_disp_posts_default']);

        for ($i = 2; $i <= $num_pages; $i++)
        {
            $output .= "<url>\n";
            $output .= "\t<loc>".$pun_config['o_base_url']."/".$viewtopic."&p=".$i."</loc>\n";
            $output .= "\t<lastmod>$lastmodified</lastmod>\n";
            $output .= "\t<priority>$priority</priority>\n";
            $output .= "</url>\n\n";
        }
    }
}
$output .= "</urlset>\n";

// If we chose dynamic, we output the sitemap
// Otherwise, we write it to the file
if ($dynamic)
{
    header('Content-type: application/xml');
    echo $output;
}
else
{
    $file = fopen($filename, "w");
    fwrite($file, $output);
    fclose($file);
    echo "Done";
}
?>

And the rewrite.

<?php

function makeurl($type, $id, $name, $navoegsel = NULL) {
    # Type must be "f" for forum, "t" for topic or "p" for post
    # ID is the id of the content wanted
    # Name is the title of the category or topic
    

    $words = explode(" ", $name);
    $url;
    foreach ($words as $word) {
        if(strlen($word) > 3)
            $url .= '-' . $word;
    }
    $url = strtr($url,'ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ/','AAAAAAaaaaaaOOOOOOooooooEEEEeeeeCcIIIIiiiiUUUUuuuuyNn-');
    $url = urlencode($type . $id . $url . ".html");
    
    if(isset($navoegsel))
        $url = $url."#".$navoegsel;

    return $url;
}

?>

Im really hoping for some help cause I cant make much of it. Every help is apriciate it.

Greetings Special.

bumpy

Hello gy's

Im having this error on my page, for some seo related issue's, coud you gys possible help me out and tell me what to do plz ?:) error can be found here:

http://www.animeresource.org/sitemap.php

<?php

function makeurl($type, $id, $name, $navoegsel = NULL) {
    # Type must be "f" for forum, "t" for topic or "p" for post
    # ID is the id of the content wanted
    # Name is the title of the category or topic
    

    $words = explode(" ", $name);
    $url;
    foreach ($words as $word) {
        if(strlen($word) > 3)
            $url .= '-' . $word;
    }
    $url = strtr($url,'ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ/','AAAAAAaaaaaaOOOOOOooooooEEEEeeeeCcIIIIiiiiUUUUuuuuyNn-');
    $url = urlencode($type . $id . $url . ".html");
    
    if(isset($navoegsel))
        $url = $url."#".$navoegsel;

    return $url;
}

?>

10

(12 replies, posted in PunBB 1.2 troubleshooting)

<?php
/***********************************************************************

  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)

  This file is part of PunBB.

  PunBB 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,
  or (at your option) any later version.

  PunBB is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  MA  02111-1307  USA

************************************************************************/


// Tell header.php to use the admin template
define('PUN_ADMIN_CONSOLE', 1);

define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';
require PUN_ROOT.'include/common_admin.php';


if ($pun_user['g_id'] > PUN_MOD)
    message($lang_common['No permission']);


$action = isset($_GET['action']) ? $_GET['action'] : null;

// Check for upgrade
if ($action == 'check_upgrade')
{
    if (!ini_get('allow_url_fopen'))
        message('Unable to check for upgrade since \'allow_url_fopen\' is disabled on this system.');

    $fp = @fopen('http://www.punbb.org/latest_version', 'r');
    $latest_version = trim(@fread($fp, 16));
    @fclose($fp);

    if ($latest_version == '')
        message('Check for upgrade failed for unknown reasons.');

    $cur_version = str_replace(array('.', 'dev', 'beta', ' '), '', strtolower($pun_config['o_cur_version']));
    $cur_version = (strlen($cur_version) == 2) ? intval($cur_version) * 10 : intval($cur_version);

    $latest_version = str_replace('.', '', strtolower($latest_version));
    $latest_version = (strlen($latest_version) == 2) ? intval($latest_version) * 10 : intval($latest_version);

    if ($cur_version >= $latest_version)
        message('You are running the latest version of PunBB.');
    else
        message('A new version of PunBB has been released. You can download the latest version at <a href="http://www.punbb.org/">PunBB.org</a>.');
}


// Show phpinfo() output
else if ($action == 'phpinfo' && $pun_user['g_id'] == PUN_ADMIN)
{
    // Is phpinfo() a disabled function?
    if (strpos(strtolower((string)@ini_get('disable_functions')), 'phpinfo') !== false)
        message('The PHP function phpinfo() has been disabled on this server.');

    phpinfo();
    exit;
}


// Get the server load averages (if possible)
if (@file_exists('/proc/loadavg') && is_readable('/proc/loadavg'))
{
    // We use @ just in case
    $fh = @fopen('/proc/loadavg', 'r');
    $load_averages = @fread($fh, 64);
    @fclose($fh);

    $load_averages = @explode(' ', $load_averages);
    $server_load = isset($load_averages[2]) ? $load_averages[0].' '.$load_averages[1].' '.$load_averages[2] : 'Not available';
}
else if (!in_array(PHP_OS, array('WINNT', 'WIN32')) && preg_match('/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/i', @exec('uptime'), $load_averages))
    $server_load = $load_averages[1].' '.$load_averages[2].' '.$load_averages[3];
else
    $server_load = 'Not available';


// Get number of current visitors
$result = $db->query('SELECT COUNT(user_id) FROM '.$db->prefix.'online WHERE idle=0') or error('Unable to fetch online count', __FILE__, __LINE__, $db->error());
$num_online = $db->result($result);


// Get the database system version
switch ($db_type)
{
    case 'sqlite':
        $db_version = 'SQLite '.sqlite_libversion();
        break;

    default:
        $result = $db->query('SELECT VERSION()') or error('Unable to fetch version info', __FILE__, __LINE__, $db->error());
        $db_version = $db->result($result);
        break;
}


// Collect some additional info about MySQL
if ($db_type == 'mysql' || $db_type == 'mysqli')
{
    $db_version = 'MySQL '.$db_version;

    // Calculate total db size/row count
    $result = $db->query('SHOW TABLE STATUS FROM `'.$db_name.'`') or error('Unable to fetch table status', __FILE__, __LINE__, $db->error());

    $total_records = $total_size = 0;
    while ($status = $db->fetch_assoc($result))
    {
        $total_records += $status['Rows'];
        $total_size += $status['Data_length'] + $status['Index_length'];
    }

    $total_size = $total_size / 1024;

    if ($total_size > 1024)
        $total_size = round($total_size / 1024, 2).' MB';
    else
        $total_size = round($total_size, 2).' KB';
}


// Check for the existance of various PHP opcode caches/optimizers
if (function_exists('mmcache'))
        $php_accelerator = '<a href="Turck">http://turck-mmcache.sourceforge.net/">Turck MMCache</a>';
else if (isset($_PHPA))
        $php_accelerator = '<a href="ionCube">http://www.php-accelerator.co.uk/">ionCube PHP Accelerator</a>';
else if (ini_get('apc.enabled'))
        $php_accelerator ='<a href="Alternative">http://www.php.net/apc/">Alternative PHP Cache (APC)</a>';
else if (ini_get('zend_optimizer.optimization_level'))
        $php_accelerator = '<a href="Zend">http://www.zend.com/products/zend_optimizer/">Zend Optimizer</a>';
else if (ini_get('eaccelerator.enable'))
        $php_accelerator = '<a href="eAcceleratorhttp://eaccelerator.net/">eAccelerator</a>';
else if (ini_get('xcache.cacher'))
        $php_accelerator = '<a href="XCachehttp://trac.lighttpd.net/xcache/">XCache</a>';
else
        $php_accelerator = 'N/A';


$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin';
require PUN_ROOT.'header.php';

generate_admin_menu('index');

?>
    <div class="block">
        <h2>Forum administration</h2>
        <div id="adintro" class="box">
            <div class="inbox">
                <p>
                    Welcome to the PunBB administration control panel. From here you can control vital aspects of the forum. Depending on whether you are an administrator or a moderator you can<br /><br />
                     - organize categories and forums.<br />
                     - set forum-wide options and preferences.<br />
                     - control permissions for users and guests.<br />
                     - view IP statistics for users.<br />
                     - ban users.<br />
                     - censor words.<br />
                     - set up user ranks.<br />
                     - prune old posts.<br />
                     - handle post reports.
                </p>
            </div>
        </div>

        <h2 class="block2"><span>Statistics</span></h2>
        <div id="adstats" class="box">
            <div class="inbox">
                <dl>
                    <dt>PunBB version</dt>
                    <dd>
                        PunBB <?php echo $pun_config['o_cur_version'] ?> - <a href="admin_index.php?action=check_upgrade">Check for upgrade</a><br />
                        © Copyright 2002, 2003, 2004, 2005 Rickard Andersson
                    </dd>
                    <dt>Server load</dt>
                    <dd>
                        <?php echo $server_load ?> (<?php echo $num_online ?> users online)
                    </dd>
<?php if ($pun_user['g_id'] == PUN_ADMIN): ?>                    <dt>Environment</dt>
                    <dd>
                        Operating system: <?php echo PHP_OS ?><br />
                        PHP: <?php echo phpversion() ?> - <a href="admin_index.php?action=phpinfo">Show info</a><br />
                        Accelerator: <?php echo $php_accelerator."\n" ?>
                    </dd>
                    <dt>Database</dt>
                    <dd>
                        <?php echo $db_version."\n" ?>
<?php if (isset($total_records) && isset($total_size)): ?>                        <br />Rows: <?php echo $total_records."\n" ?>
                        <br />Size: <?php echo $total_size."\n" ?>
<?php endif; endif; ?>                    </dd>
                </dl>
            </div>
        </div>
    </div>
    <div class="clearer"></div>
</div>
<?php

require PUN_ROOT.'footer.php';

My code phpinfo cant do xD

11

(12 replies, posted in PunBB 1.2 troubleshooting)

Hmm Even when I alter the code it stil display no, this really means no accelerator is installd?

12

(12 replies, posted in PunBB 1.2 troubleshooting)

Ye it dusent but stil I like to have it so can you tell us how to emplement the code in wish file and where please ^^ like I asked.

13

(12 replies, posted in PunBB 1.2 troubleshooting)

Well I stil woud like it to work so some advise xD?

14

(12 replies, posted in PunBB 1.2 troubleshooting)

Indeed zend is installd on my server, but I herd the version 1.15 and lower have problems with it, so I found this so I dont know where to put it. So im requesting help smile

15

(12 replies, posted in PunBB 1.2 troubleshooting)

Hello gy's

Im looking for a way to fix this status to enabled, ive used the forum search found some line of code but I have no clue where to place it. If some1 coud tell me wish line to remove and what to add it woud be great to me. To be sure that I have a accelerator ofc smile

I saw this code:

// Check for the existance of various PHP opcode caches/optimizers
if (function_exists('mmcache'))
        $php_accelerator = '<a href="Turck">http://turck-mmcache.sourceforge.net/">Turck MMCache</a>';
else if (isset($_PHPA))
        $php_accelerator = '<a href="ionCube">http://www.php-accelerator.co.uk/">ionCube PHP Accelerator</a>';
else if (ini_get('apc.enabled'))
        $php_accelerator ='<a href="Alternative">http://www.php.net/apc/">Alternative PHP Cache (APC)</a>';
else if (ini_get('zend_optimizer.optimization_level'))
        $php_accelerator = '<a href="Zend">http://www.zend.com/products/zend_optimizer/">Zend Optimizer</a>';
else if (ini_get('eaccelerator.enable'))
        $php_accelerator = '<a href="eAcceleratorhttp://eaccelerator.net/">eAccelerator</a>';
else if (ini_get('xcache.cacher'))
        $php_accelerator = '<a href="XCachehttp://trac.lighttpd.net/xcache/">XCache</a>';
else
        $php_accelerator = 'N/A';

I dunno where to place it please help me with what line and what to replace ill be really greatfull smile

Hello I have a download page on my anime website. vieuw ( http://www.animeresource.org/downloads.html )

I woud like to have something simulair for punbb, I will upload true ftp and I woud like a page where I can stick my downloads on. So not in topics but in a seperated page if possible can any1 help me?

greetings