51

(69 replies, posted in News)

You should post that line and  the line before that...

What if you are the last person to post in that topic and you just want to see if something new is there?

Great template, do you plan to release it for download?

54

(27 replies, posted in Feature requests)

Great smile

55

(17 replies, posted in General discussion)

Well, old habits die hard, lot's off applications (e-mail) use this alt+s shortcut as well. Didn't read any documents on the topic you are mentioning, but  the difference between desktop applications and web applications are becoming smaller every day.

I don't see what users acctually get with URLs like "topics/222/page/2/", beacuse Google will index Punbb default URLs as well, and since there is a Google Sitemap mod I don't see any need for this if the webmaster wont be able to male URLs SEO friendly (add some text to them).

If the rules are well writen (most used rules at the begining with a flag telling Apache not to parse any more rules) 50 rules won't be a big overhead to the server.

57

(17 replies, posted in General discussion)

Yes, I am aware of that. But when I write a message I just wont to press alt+s, pressing shift-esc-alt*s is an overkill smile

58

(27 replies, posted in Feature requests)

Yuu are missing ? befor xml in:

$output = '<xml version="1.0" encoding="UTF-8"?>'."\n";

I also edited a code a little bit, so that the first page in the thread doesn't get "&p=1", this is what I ended with:

<?php
/***************************************************************************
 *                              googlesitemapgenerator.php
 *                            -------------------
 *   Copyright/Support          http://www.pentapenguin.com
 *   Last Modified: 06/05/05
 *     Modified by Smartys for use with PunBB
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program 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.
 *
 ***************************************************************************/

define('PUN_QUIET_VISIT', 1);
define('PUN_ROOT', './');
require PUN_ROOT.'include/common.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, 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 f.id as forum_id, last_post, num_topics FROM '.$db->prefix.'forums AS f 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 ORDER BY f.id DESC') or error('Unable to fetch 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 = 'viewforum.php?id='.$cur_forum['forum_id'];
    $priority = '1.0';

    if ($cur_forum['num_topics'] >= $pun_config['o_disp_topics_default'])
    {
        $num_pages = ceil($cur_forum['num_topics'] / $pun_config['o_disp_topics_default']);

        //Don't add &p=1 to the firs page
        $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";

        //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";
        }
    }
    else
    {
        $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";
    }
}

// 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 = 'viewtopic.php?id='.$cur_topic['topic_id'];
    $priority = ($cur_topic['sticky'] == '1') ? '1.0' : '0.5';

    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']);

        $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";

        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";
        }
    }
    else
    {
        $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";
    }
}
$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";
}
?>

offtopic:

What do you get out of serving application/xhtml+xml?

Face it, IE is here, and it is going to be here for a long time sad

60

(27 replies, posted in Feature requests)

All pages are linked from forums index.php if you look at it that way smile

If you don't do it, I'll do it, just need to get some spare time...

61

(27 replies, posted in Feature requests)

There is one problem with this mod. This mod only provides link to the first page of the topic. What about subsequent pages. I guess this  mod should be rewriten to check the configuration info on posts per page setting, count the number of posts in each thread, and than create additional links...

I don't like the way extern.php is supposed to work. If you have maybe seen SMF's SSI.php you should now what's it supposed to like like.

extern.php must be "includeable" form any directory, and should give the webmaster a choice between returning an array or outputing to the broser.

Why would you convert everything to HTML? It is ok to send XHTML 1.0 as text. XHTML 1.1 is the one that should be send as application/xhtml+xml only...

smile

Good, now back to your editor and give us 1.3 ASAP smile

I have an UTF-8 board.

1. Edit /include/dblayer/common_db.php, put this line at the end of the file, just afer:

$db = new DBLayer($db_host, $db_username, $db_password, $db_name, $db_prefix, $p_connect);

Add

$db->query("SET NAMES 'UTF8'");

This will make sure that mysql-connection handles everhing as UTF-8.

If you are running MySQL >= 4.1 edit search_words table in the database so that field "word" is varbinary, not varchar. Also check that all your collations are set to UTF-8. If you are running MySQL < 4.1 everything is fine.

And finaly change your language common.php to declare the proper code page to be inserted into <head></head>

lang_encoding' => 'utf-8'

Maybe we could also send UTF-8 header to the client so that this META code page stuff isn't really necessary?

Also, don't forget to edit all of your language files so that they are saved as UTF-8. This really doesn't matter if you use english lanugage, because iso-8859-1 characters are the same in utf-8. But if you use something else then you have to do this. For example I had a croatian translation with code page win-1250 and I had to open every file and change it's encoding for everything to work well.

Most users don't use language specific characters for the username, because if you find yourself abroad and try to login to the board there are big chances that you won't find appropriate characters on the keyboad smile

67

(5 replies, posted in PunBB 1.2 troubleshooting)

d3dsh33p wrote:

Thank you! That worked perfect. New problem though sad

I'm not an admin anymore, I guess it demoted me when I converted. Is there a solution to this?

You can just edit your database directly (or with phpMyAdmin or something like that). Find table users, edit the row which contains your data and give yourself group_id -> 1.

68

(20 replies, posted in Feature requests)

The reason why they recommend this is because everything located inside <head></head> (sripts, css files, etc.) should be loaded before the page...

69

(17 replies, posted in General discussion)

It's a shame they didn't launch Opera as freeware a long time ago. I can't leave without Webdeleoper & other extensions in Firefox. Not the mention the problem witch acces keys. I couldn't post on boards with alt+s combination as I'm used to tongue

70

(20 replies, posted in Feature requests)

Do you put the Google Analytics HTML code into your <head> or <body>...

I had the in <head>, and they still are there for my main site, but I've put it just before </body></html> 'cause thats what it says on the Google Analytics home page, when they give you the code. Funny, it probably wasn't there the first time I was getting my code.

71

(0 replies, posted in PunBB 1.2 show off)

I've finally converter my PhpBB forum tu PunBB. Used code-page is UTF-8 on MySQL 4.0.x.

I've converted the released Croatian translation from win-1250 to utf-8, and made sam changes in the faulty translation. Where should I send the complete translation (once I'm happy with the changes) so it shows up on the donwnload page?

I have some other things to do on the template (move topic titles away from that icon, and change that icon completely, shrink the last colum for displaying date of last post, and shirnk the left column in post-view).

I'm happy for now smile

Tnx to Rickard Andersson for all his good work, I hope you will continue to do so in the future, managing something like this must be time consuming....

I allmost forgot the link for the lazy smile -> http://www.info-mob.com/forum/