1

(23 replies, posted in PunBB 1.3 extensions)

maststef, you mean need insert current date because need know when be update post? That is logical. I dont think about this.

But why in you example PM/AM for 24-hour format (09:15, after 13:15, 14:15, etc)? smile

I code replace:

$l['ago'] = l_ago((time() - $l['post']['posted']), 3, array('ago' => 'after'));

to this:

$l['ago'] = date('d/m/Y H:i:s');

Format for: DD/MM/YY HH:MM:SS

or to this:

$l['ago'] = date('m/d/Y g:i:s A');

Format for (USA format?): MM/DD/YY H:MM:SS AM (or PM)

And this alternative from dimka.linux@gmail.com Fancy Merge Posts (i not found it on forum and upload to my site).

2

(23 replies, posted in PunBB 1.3 extensions)

I do not know what problem. I subscribed (via second account) and postint (via first account) but no error exists.

KeyDog maybe you use some extension with "fn_send_subscriptions_qr_get_users_to_notify" hook. And this extension incompatible with merge_posts. I testing on PunBB 1.3.2 without extensions and with extesions pun_attachment, pun_pm and pun_repository.

3

(23 replies, posted in PunBB 1.3 extensions)

KeyDog, thank you! Most better. Update code and post (was mine "englesh" now you text).

Parpalak, but why error? In extention replace only $query in function add_post() local namespace. And another $query in function replaces because every $query is new array.

4

(23 replies, posted in PunBB 1.3 extensions)

Writing to Parpalak about debugging SQL. I hope he make something. smile

5

(23 replies, posted in PunBB 1.3 extensions)

KeyDog, i update code to version 1.1. Was bug. And rename author to "lexazloy" (name not need save file in utf8 encoding). Please reinstall extention.

KeyDog wrote:

Database reported: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND (fp.read_forum IS NULL OR fp.read_forum=1) AND s.topic_id=7 AND u.id!=2' at line 1 (Errno: 1064).

Sorry i dont know about this bug. I try find in PunBB this SQL query but too many. Need all query in error message (need write about it to developers). Debugging in PunBB sux.

KeyDog wrote:

EDIT 2: I see "1 month, 2 weeks and 10 hours after:" is before the Test 123 but in same font  as my background - so invisible - in admin mode I can see it light grey. But that's a style issue my side not ext problem....

Sorry i dont understand. I try but translating (Google Translit) not help me. smile

upd edit 3 help me understand! smile

KeyDog wrote:

changed the color cccccc to 333333 in second post now (above is the original extension code)

#cccccc good for default theme (oxygen). I think all users use default theme, i was wrong sorry.

6

(23 replies, posted in PunBB 1.3 extensions)

Parpalak, maybe it important for someone who optimization fan. smile

P.S. Thank you for help translate.

7

(23 replies, posted in PunBB 1.3 extensions)

Hi.

Search in forum but this extention dosnt exists (lazy developers! smile) and i made it self.

This extension merges posts. Example: one user posting after prior own post. Both posts are automatically merged.

In extensions directory make directory with name merge_posts. In this directory make file manifest.xml with content:

<?xml version="1.0" encoding="utf-8"?>

<extension engine="1.0">
    <id>merge_posts</id>
    <title>Merge posts</title>
    <description>This extension merges posts. Example: one user posting after prior own post. Both posts are automatically merged.</description>
    <version>1.1</version>

    <minversion>1.3.2</minversion>
    <maxtestedon>1.3.2</maxtestedon>

    <author>lexazloy</author>

    <hooks>
        <hook id="fn_add_post_qr_add_post"><![CDATA[
            function l_plural($int, $array, $noint = false){
                list($banan, $banana, $bananov) = (!is_array($array) ? explode('/', $array) : $array);

                $n1 = substr($int, -1);
                $n2 = substr($int, -2);
                $string = $bananov;

                if ($n2 >= 10 and $n2 <= 20)
                    $string = $bananov;
                elseif ($n1 == 1)
                    $string = $banan;
                elseif ($n1 >= 2 and $n1 <= 4)
                    $string = $banana;

                return trim($noint ? $string : $int.' '.$string);
            }

////////////////////////////////////////////////////////////////////////////////

            // http://php.net/datetime/#78025
            function l_ago($second, $len = 3, $plural = array()){
                $plural = array_merge(array(
                    'separator' => ',',
                    'seconds' => 'second/seconds/seconds',
                    'minutes' => 'minute/minutes/minutes',
                    'hours' => 'hour/hours/hours',
                    'days' => 'day/days/days',
                    'weeks' => 'week/weeks/weeks',
                    'months' => 'month/months/months',
                    'years' => 'year/years/years',
                    'ago' => 'ago',
                    'and' => 'and'
                ), $plural);
                $period = array(
                    'years'   => 31556926,
                    'months'  => 2629743,
                    'weeks'   => 604800,
                    'days'    => 86400,
                    'hours'   => 3600,
                    'minutes' => 60,
                    'seconds' => 1
                );

                foreach ($period as $k => $v)
                    if ($second >= $v){
                        $durations = floor($second / $v);
                        $second -= ($durations * $v);
                        $array[] = l_plural($durations, $plural[$k]);
                    }

                if (count($array) > 1){
                    if (count($array) == 2){
                        $result = $array[0].($len != 1 ? ' '.$plural['and'].' '.$array[1] : '');
                    } elseif (count($array) <= $len){
                        $end = array_pop($array);
                        $result = join($plural['separator'].' ', $array).' '.$plural['and'].' '.$end;
                    } else {
                        if ($len = count($result = array_slice($array, 0, $len - 1)))
                            $result = join($plural['separator'].' ', $result).' '.$plural['and'].' '.$array[$len];
                        else
                            $result = $array[$len];
                    }
                } else {
                    $result = $array[0];
                }

                return trim($result.' '.$plural['ago']);
            }

////////////////////////////////////////////////////////////////////////////////

            $l = array();
            $l['query'] = array('SELECT' => 'id, poster_id, posted', 'FROM' => 'posts', 'WHERE' => 'topic_id = '.$post_info['topic_id'], 'ORDER BY' => 'id desc', 'LIMIT' => 1);

            $l['post'] = $forum_db->query_build($l['query']) or error(__FILE__, __LINE__);
            $l['post'] = $forum_db->fetch_assoc($l['post']);

            $l['ago'] = l_ago((time() - $l['post']['posted']), 3, array('ago' => 'after'));
            $l['ago'] = sprintf('\n\n[i][color=#cccccc]%s:[/color][/i]\n\n', $l['ago']);

            if ($l['edit'] = ($post_info['poster_id'] == $l['post']['poster_id']))
                $query = array(
                    'UPDATE' => 'posts',
                    'WHERE'  => 'id = '.$l['post']['id'],
                    'SET'    => 'message = concat(message, "'.$l['ago'].'", "'.$forum_db->escape($post_info['message']).'")'
                );
        ]]></hook>

        <hook id="fn_add_post_qr_get_topic_reply_count"><![CDATA[
            if ($l['edit'])
                $new_pid = $l['post']['id'];
        ]]></hook>
    </hooks>
</extension>

P.S. +1 query to database. But very simple and fast query.

upd: Alternative from dimkalinux Fancy Merge Posts.

First. In file include/dblayer/common_db.php find:

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

ater add:

$forum_db->query('set names utf8');

And second. Try change collation to "utf8_general_ci".

9

(52 replies, posted in PunBB 1.3 additions)

Good themes, but Oxygen better because neutral. roll

10

(1 replies, posted in PunBB 1.2 discussion)

If you use ExpressionEngine and you need community on site (e.g.: with one user base for post news), i think ExpressionEngine Forum is better idea.

P.S. But pay ~1/2 ($45) ExpressionEngine ($100) for a modul... Drupal/MODx/"SupaDupaCMS" + PunBB real better. roll

11

(1 replies, posted in PunBB 1.2 discussion)

Lexx, 1) because is international forum. PunBB was international and be.

P.S.
2) Одно и тоже, да.
4) Потому что см. свой пункт 3.
5) Отпиши Анатолию (ищи по "Anatoly") и предложи идеи. Делов-то. Я думаю, это была бы хорошая затея сделать форумы как у MODx: там на одном форуме собраны подфорумы на разных языках с английских во главе.

12

(70 replies, posted in News)

MattF wrote:
lexazloy wrote:

Anatoly, why 1.3 not in trunk? It not main version?

It's in RC status. It hasn't reached stable yet. 1.2* is still the current stable version.

Exactly! 1.3 is RC. 1.2 stable version, but not main version now (and i happy).

13

(70 replies, posted in News)

Anatoly, why 1.3 not in trunk? It not main version?

14

(3 replies, posted in PunBB 1.3 extensions)

No, this ping system using for informating services about site updading. I post new answer in forum and it post faster added to feedburner.com. And no need waiting.

P.S. In Wordpress trackback and pingback. For forums trackback/pingback system it like a spam. smile

15

(3 replies, posted in PunBB 1.3 extensions)

Ping me baby one more time. Yeh.

Ok. It extension ping only 2 site: yandex.ru (good for me) and feedburner.com (good for you if you burn you Atom or RSS feed via Feedburner).

How it work: user add new post and you site pinged yandex.ru and feedburner.com. Simple.

If you have pinged another sites (with weblogUpdates.ping menthod), change manifest.xml:

$pings = array(
    'http://ping.blogs.yandex.ru/RPC2',
    'http://ping.feedburner.com/RPC2'
);

to

$pings = array(
    'http://ping.blogs.yandex.ru/RPC2', // remove it if you want
    'http://ping.feedburner.com/RPC2', // remove it too if you want too :)
    'another URL here'
);

Download on PunRes.org.

Ok, example. I write extension for viewtopic.php and need rewrite param 0 in array $pun_page['user_ident']. What i be do, if somebody in another extension put new param to $pun_page['user_ident'] like array_unshift()?

array_unshift($pun_page['user_ident'], 'Lexazloy stupid!');

Please, use associations arrays:
$pun_page['user_ident']['avatar'], $pun_page['user_ident']['username'], etc. in viewtopic.php another files.

$pun_page['user_ident'][] = 'some';
$pun_page['user_ident'][] = 'another some';
$pun_page['user_ident'][] = 'another another some';

Realy not good.

upd please. smile

17

(28 replies, posted in PunBB 1.3 extensions)

Yes, just .htaccess file better idea, but i try make rewrite rule and loose. sad

Sorry, about null bytes i dont understand you 100%. First time i think null butes you mean empty... Now i think about \xNN in URL or something. No?

Not check POST data it sketch. For full work need see PunBB code more.

About $real_pun_domain you right. Why i put it in loop i dont know. %)

18

(28 replies, posted in PunBB 1.3 extensions)

Smartys, how about this version? Without not PunBB style html in manager, shorts tags and bug with quick jump. smile

SuperMAG, upload to punres and update first post.

19

(28 replies, posted in PunBB 1.3 extensions)

Thank you. smile
With $_GET['domain'] just example.

Ok. Tomorrow i make first version. And now go sleep. Thank you for help!

20

(28 replies, posted in PunBB 1.3 extensions)

Yes. But without admin panel for each domain only on main copy. Or make "global get" $_POST and if is main copy write to database, if is subdomain copy to special config file. But, i dont know how good idea make directory like  extensions/domain/config right 0777.

I have in extensions/domain/config sav configs for subdomains like 1.example.com.php and if in address ?domain=1.example.com.php check and include:

if (is_file($file = dirname(__file__).'/config/'.$_GET['domain'].'.php'))
    include $file;
else
    return;

$pun_domain['base_url'] = 'http://'.$_GET['domain'];
$pun_domain['category'] = $_GET['category'];

And in admin panel (main copy) make submenu for generated empty config files:

1.example.com.php
2.example.com.php

21

(28 replies, posted in PunBB 1.3 extensions)

Yes, i think about it (new mod_rewrite rule) too.

If make in admin panel new menu "domains" with textarea and coma separator list domains. Or like made new menu in PunBB:

domain = caterories list

With new line separator. And if domain exists in domains list append "subdomain=test.example.com&category=categories list".

Tomorow test it.

22

(28 replies, posted in PunBB 1.3 extensions)

Hm. How about simple check like that:

if (
    is_bool(strpos($_GET['file'], '..')) and
    is_file($file = PUN_ROOT.$_GET['file']) and
    in_array(strrchr($_GET['file'], '.'), array('.php', '.html', '.htm', '.tpl', '.txt', '.xml'))
)
    include $file;
else
    include PUN_ROOT.'index.php';

23

(28 replies, posted in PunBB 1.3 extensions)

Update my first post.

Cool now? smile

24

(28 replies, posted in PunBB 1.3 extensions)

sad
Need sleep. Two stupid error per day.

Fix now.

25

(28 replies, posted in PunBB 1.3 extensions)

Sorry i dont understand what you say. My english very bad.