26

(98 replies, posted in PunBB 1.3 extensions)

Yeah KeyDog, it would be nice if there is automatic info about added attachments (name, ext, size) and upper info about Login requirement, but if you click on it you are redirected to login page.

27

(5 replies, posted in PunBB 1.3 troubleshooting)

What time returns this function on your local server?

date("Y-m-d H:i:s")

Hey deirathe,
Thanks for your profile.php and some minor changes.
Added to my translation, uploaded and added credits in README.

Next time remember all to upload only changes not full translation, it helps me to check what person has translated.
Also leave original README and do not delete, I will add you and your changes at credits in README file dont worry.
... and mainly to deirathe, do not upload your system files (this time it was MacOS) wink.

If you want to add translation, write here links with your changes.
Do not include my files if not changed.
Code it with correct polish signs in UTF8. The best editor is Windows Notepad. No damn trash code...
I will add them as fast as I can to my first post link.

30

(28 replies, posted in PunBB 1.3 additions)

Thanks Garciat for extension.
Translated into Polish:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE extension SYSTEM "ext-1.0.dtd">
 
<!--
/**
 * @copyright topic_title_on_index Copyright (C) 2008 hcs
 * @copyright Copyright (C) 2008 PunBB, partially based on code copyright (C) 2008 FluxBB.org
 * @license http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
 * @package topic_title_on_index
 */
-->
 
<extension engine="1.0">
    <id>topic_title_on_index</id>
    <title>Topic title on forum index </title>
    <version>1.0.0 Beta</version>
    <description>Replace the Last Post link on the index page for the name of the topic instead of the date format.</description>
    <author>hcs</author>
 
    <minversion>1.3</minversion>
    <maxtestedon>1.3.2</maxtestedon>
 
    <hooks>
        <hook id="in_qr_get_cats_and_forums"><![CDATA[
$query['SELECT'] .=', t.subject, u.id as poster_id';
$query['JOINS'][] = array(
    'LEFT JOIN'    => 'topics AS t',
    'ON'        => 'f.last_post_id=t.last_post_id'
);
$query['JOINS'][] = array(
    'LEFT JOIN'    => 'users AS u',
    'ON'        => 'f.last_poster=u.username'
);
        ]]></hook>
 
        <hook id="in_start"><![CDATA[
function words($string, $words)
{
    return implode(" ", array_slice(explode(' ', $string), 0, $words)) . '...';
}
 
function relative_time($timestamp)
{
    $d = time() - $timestamp;
    if ($d < 60)
        return $d." sekund".(($d==1)?'e':'y')." temu";
    else
    {
        $d = floor($d / 60);
        if($d < 60)
            return $d." minut".(($d==1)?'e':'y')." temu";
        else
        {
            $d = floor($d / 60);
            if($d < 24)
                return $d." godzin".(($d==1)?'e':'y')." temu";
            else
            {
                $d = floor($d / 24);
                if($d < 7)
                    return $d." d".(($d==1)?'zień':'ni')." temu";
                else
                {
                    $d = floor($d / 7);
                    if($d < 4)
                        return $d." t".(($d==1)?'ydzień':'ygodnie')." temu";
                }//Week
            }//Day
        }//Hour
    }//Minute
}
 
$words = 4;
        ]]></hook>
 
        <hook id="in_normal_row_pre_display"><![CDATA[
if(strpos($forum_page['item_body']['info']['lastpost'], $lang_index['No post info']) === false && strpos($forum_page['item_body']['info']['lastpost'], $lang_common['Never']) === false)
    $forum_page['item_body']['info']['lastpost'] = '<li class="info-lastpost"><span class="label">'.$lang_index['Last post'].'</span> <strong><a href="'.forum_link($forum_url['post'], $cur_forum['last_post_id']).'">'.forum_htmlencode(words($cur_forum['subject'], $words)).'</a></strong> <cite>'.relative_time($cur_forum['last_post']).' '.sprintf($lang_index['Last poster'], '<a href="'.forum_link($forum_url['user'], $cur_forum['poster_id']).'">'.forum_htmlencode($cur_forum['last_poster']).'</a>').'</cite></li>';
        ]]></hook>
 
    </hooks>
 
</extension>

EDIT:  Sorry found some bugs in language. Polish is so hard and its immposible to do all correclty with this logic.

EDIT2:
Corrected, this time I hope it works correclty, Polish people check it please wink.

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE extension SYSTEM "ext-1.0.dtd">
 
<!--
/**
 * @copyright topic_title_on_index Copyright (C) 2008 hcs
 * @copyright Copyright (C) 2008 PunBB, partially based on code copyright (C) 2008 FluxBB.org
 * @license http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
 * @package topic_title_on_index
 */
-->
 
<extension engine="1.0">
    <id>topic_title_on_index</id>
    <title>Topic title on forum index </title>
    <version>1.0.0 Beta</version>
    <description>Replace the Last Post link on the index page for the name of the topic instead of the date format.</description>
    <author>hcs</author>
 
    <minversion>1.3</minversion>
    <maxtestedon>1.3.2</maxtestedon>
 
    <hooks>
        <hook id="in_qr_get_cats_and_forums"><![CDATA[
$query['SELECT'] .=', t.subject, u.id as poster_id';
$query['JOINS'][] = array(
    'LEFT JOIN'    => 'topics AS t',
    'ON'        => 'f.last_post_id=t.last_post_id'
);
$query['JOINS'][] = array(
    'LEFT JOIN'    => 'users AS u',
    'ON'        => 'f.last_poster=u.username'
);
        ]]></hook>
 
        <hook id="in_start"><![CDATA[
function words($string, $words)
{
    return implode(" ", array_slice(explode(' ', $string), 0, $words)) . '...';
}
 
function relative_time($timestamp)
{
    $ago = ' temu';
    $d = time() - $timestamp;
    if ($d < 60)
    if ($d==1)
        return $d. " sekunde" .$ago;
    elseif (($d%10)>=2 && ($d%10)<=4 && ($d < 12 || $d > 14))
        return $d. " sekundy" .$ago;
    else
        return $d. " sekund" .$ago;       
    else
    {
        $d = floor($d / 60);
        if($d < 60)
                if ($d==1)
            return $d. " minute" .$ago;
        elseif (($d%10)>=2 && ($d%10)<=4 && ($d < 12 || $d > 14))
            return $d. " minuty" .$ago;
        else
            return $d. " minut" .$ago;     
        else
        {
            $d = floor($d / 60);
            if($d < 24)
                    if ($d==1)
                return $d. " godzine" .$ago;
            elseif (($d%10)>=2 && ($d%10)<=4 && ($d < 12 || $d > 14))
                return $d. " godziny" .$ago;
            else
                return $d. " godzin" .$ago; 
            else
            {
                $d = floor($d / 24);
                if($d < 7)
                    return $d." d".(($d==1)?'zień':'ni')." temu";
                else
                {
                    $d = floor($d / 7);
                    if($d < 4)
                       if ($d==1)
                return $d. " tydzień" .$ago;
            elseif (($d%10)>=2 && ($d%10)<=4 && ($d < 12 || $d > 14))
                return $d. " tygodnie" .$ago;
            else
                return $d. " tygodni" .$ago;
                }//Week
            }//Day
        }//Hour
    }//Minute
}
 
$words = 4;
        ]]></hook>
 
        <hook id="in_normal_row_pre_display"><![CDATA[
if(strpos($forum_page['item_body']['info']['lastpost'], $lang_index['No post info']) === false && strpos($forum_page['item_body']['info']['lastpost'], $lang_common['Never']) === false)
    $forum_page['item_body']['info']['lastpost'] = '<li class="info-lastpost"><span class="label">'.$lang_index['Last post'].'</span> <strong><a href="'.forum_link($forum_url['post'], $cur_forum['last_post_id']).'">'.forum_htmlencode(words($cur_forum['subject'], $words)).'</a></strong> <cite>'.relative_time($cur_forum['last_post']).' '.sprintf($lang_index['Last poster'], '<a href="'.forum_link($forum_url['user'], $cur_forum['poster_id']).'">'.forum_htmlencode($cur_forum['last_poster']).'</a>').'</cite></li>';
        ]]></hook>
 
    </hooks>
 
</extension>

Garciat like Polish language? ;P

I made for myself some helpfull notes:

1 sekunde
2-4 sekundy
5-21 sekund
22-24 sekundy
25-31 sekund
32-34 sekundy

1 minute
2-4 minuty
5-21 minut
22-24 minuty
25-31 minut
32-34 minuty

1 godzine
2-4 godziny
5-21 godzin
22-24 godziny
25-31 godzin
32-34 godziny

1 dzień
1+ dni

1 tydzień
2-4 tygodnie
5-21 tygodni
22-24 tygodnie
25-31 tygodni
32-34 tygodnie

31

(28 replies, posted in PunBB 1.3 additions)

Yeah thanks it is working, but still in one place got little crash.
It should depend on chars not words.
Why new line is not with margin? I mean how can I fix it wink.

There is in CSS:

.brd .main-content .main-item li.info-lastpost strong {
     padding-left: 1em;
     font-style: normal;
     font-weight: normal;
    }

... but dunno how to change it. Padding and margin only seems to work for first line.

OK Garciat so tell me only, what does this code do?

if(defined('FORUM_ALLOW_INDEX'))

I replaced it as you said with:

if(true)

...now the desc meta is showing in topics, but is the way to fix?

Now inside of forums it shows:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="NOINDEX, FOLLOW" />
<meta name="description" content="" />
<meta name="keywords" content="Forum Komputerowe, Hardware, Software, Overclocking, Podkręcanie, Sterowniki, Bios, Modding, Diagnostyka" />

On main there is no change, on main it works properly.

EDIT:
I've found that this line:

$first_post = htmlentities(str_replace("\n", "", $first_post));

Clean my $first_post variable.

EDIT2:
Temporarily fixed it.
Replaced

$first_post = htmlentities(str_replace("\n", "", $first_post));

With:

//    $first_post = htmlentities($first_post);
       $first_post = str_replace("\n", " ", $first_post);

It works good.
Htmlenities makes my variable clean dunno why.

What about this replacing?

if(defined('FORUM_ALLOW_INDEX'))

With

if(true)

What does it do?

EDIT3:
FOUND OUT THAT PHP 5.2.5 IS BUGGED.

htmlentities
returns empty string.

Holy fuck...

EDIT4:
Its problem with coding, this code works.

$first_post = htmlentities($first_post, ENT_QUOTES,'UTF-8');

I dont know how its with different version of PHP.

34

(28 replies, posted in PunBB 1.3 additions)

Don't works for me:

Fatal error: Cannot redeclare words() (previously declared in /var/www/pcmod/index.php(211) : eval()'d code:10) in /var/www/pcmod/index.php(211) : eval()'d code on line 13

I am not sure did I make it correctly, but I was not doing it as Garciat said, problem with lines.

Main Page

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="Forum zrzeszające komputerowców. Zajmujemy sie diagnostyką, naprawą, modami, overclockingiem i nie tylko." />
<meta name="keywords" content="Forum Komputerowe, Hardware, Software, Overclocking, Podkręcanie, Sterowniki, Bios, Modding, Diagnostyka" />
<meta name="robots" content="all, index, follow" />
If checked, the meta description tag won't be used.

That works, just hide description tag on main page, on forums doesnt hide and does not show

Forums

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="ROBOTS" content="NOINDEX, FOLLOW" />
If checked, every topic's meta description tag will be the first 160 characters of its first post. 

DOES NOT CHANGE ANYTHING FOR ME.

Changing "If checked, the meta description tag won't be used." does not work for forums too

Anyone have same problem?

Hey Garciat have you got time now to check it and fix it please?

37

(28 replies, posted in PunBB 1.3 additions)

Hi,
Thanks, it works for me, but it does not look good:
http://img65.imageshack.us/img65/5294/93950158ix6.th.jpg

Now my forums are much taller and the description with date and name of topic is little unclear.
The best way to fix it would be adding some width to this column.

38

(8 replies, posted in General discussion)

I did not tried vBulletin, but my friends are saying it is very nice programmed forum.
I love PunBB why? Its free and you can change all, because its easy (if not ask here).
Customizing its the point. Its fast as hell, much faster then phpbb.

Garciat you should not saying that vBulettin sucks, because of appearance. We should not complain about tastes.
You can always mod your CSS file.

When I have this problem I have only punbb_cookie. There was no PHPSESSID.
One click somwhere on forum and I have PHPSESSID also. There is no date of exp of PHPSESSID.
I dont know why know I dont have punbb_cookie_track

I dont know, just got default settings.
I am going to check it on Firefox, or IE. Currently I am using Opera. (I think that no difference)
I have 3 cookies: PHPSESSID, punbb_cookie, punbb_cookie_track when I am logged in.
I am going to check how its with cookies when I am logged in, but when the bug occurs and it says I am not logged in.

My site: http://www.pcmod.pl
Make an account, use automatic login function (save password).
Refresh the page then close the window you have to wait some (go drink a cofee) time (maybe it its a time when you are online). Open my site again.
See that you are not logged in, you have to click somewhere to be logged in.

Ah, forgot about language:
Zarejestruj - Register
Zaloguj - Login

Hehe I was already trying to convert copyright to div it did not worked, beacuse I had a clear: left; wink
Thanks for help, now I know for what property clear is wink

I had sometimes this problem on 1.2.
Here on 1.3 when I am refreshing the forum it sometimes says that I am not logged in.
You can click on Log me In or elsewhere and it says back you are logged in.

I would really appreciate if you fix that.  It could be helpfull for indexing topics for Google wink
If you dont have time, OK. Dont hurry.

Nice idea, I like it. It can really save space, but the most important is more efficient view and faster reading I think.

Thanks it works, but how to change the distance between div and p?
I was trying set margin to 0 but it dont works.

http://img114.imageshack.us/img114/640/78568435xz0.jpg

Hey Garciat I've a problem.

I got Meta Description set and its all fine, but when I mark:
First Post Meta Description Tag
I got no content in desc tag. Is it bug, or am I doing something bad?

I'm having a problem with adding some HTML in new line under "Powered By: PunBB"
The code is always gonna be on the right of line "Powered By: PunBB" "MY HTML"
or if I add float: right to the new HTML code I am getting "MY HTML" "Powered By: PunBB"

I was trying to make "Powered By: PunBB" <br> "MY HTML"  with no result.
I was trying with display: block; property for both of codes, no result.

How can I do it?

When "Allow BBCode parser to detect URLs and put them into (url) tag." option is enabled inserting an image url inside of tag (img)(/img) is immposbile, because paser adds automatically (url)(/url) for image adress and there is an error about insertion (url)(/url) inside of (img)(/img).
I've disabled the "Allow BBCode parser to detect URLs and put them into (url) tag." option, but now it dont parse the links and I've got no link, just plain text.

Translation to Polish language including some extensions.
Still it is not full and propably have some bugs.
Here is the link: http://www.pcmod.pl/punbb_PL.rar
Read the README inside.

Changes:
21.12.2008: Added full translation of many of files.
06.01.2009: Fixed problem with topic_title_on_index extension. Translation updated.
07.01.2009: Added 'deirathe' translation of profile.php, search.php and some replacements in lines I've left.
07.01.2009 (again): Added 'deirathe' translation of admin_bans.php, admin_common.php, admin_bans.php
08.01.2009: Hope that fixed problem with ANSI to UTF8.