I have problems with fancy_video_tag

PunBB v1.4.6 by Visman
Fancy Video Tag 0.4.11.2 by dimka.linux

It renders the text: ".fancy_video_tag_parse($matches[1])." instead of showing the videos.

It has in its manifest;

<hook id="ps_do_bbcode_replace"><![CDATA[
    // ADD PARSER, EXCEPT SIG
    if (!$is_signature) {
        $pattern[] = '`\[video\]([^\[]+)\[/video\]`';
        $replace[] = '".fancy_video_tag_parse($matches[1])."';
    }
]]></hook>

It looks like it successfully matches the "video" tags, but instead of running the "fancy_video_tag_parse" function, it shows it as text smile

I managed to run it by changing the manifest to:

<hook id="ps_do_bbcode_replace"><![CDATA[
    // ADD PARSER, EXCEPT SIG
    if (!$is_signature) {
        $pattern_callback[] = '`\[video\]([^\[]+)\[/video\]`';
        $replace_callback[] = function ($matches) { return fancy_video_tag_parse($matches[1]); };
    }
]]></hook>

Is this a good solution?

2

(118 replies, posted in Supported extensions)

Error when the actual attachment doesn't exist.

Got error 'PHP message: PHP Warning:  getimagesize(./extensions/pun_attachment/attachments/94fd47...626d/3e57...838.attach): failed to open stream: No such file or directory in /home/XXX/forum/extensions/pun_attachment/include/attach_func.php on line 297'

I assume the error comes when the getimagesize function cannot find the actual file.

How to fix it?

Do we need to add a check if the file exists?

Edit:

My quick fix is to check if file_exists in the functions show_attachments and show_attachments_post

$show_image = false;
if (in_array($attach['file_ext'], array('png', 'jpg', 'gif', 'tiff')) && $forum_config['attach_disp_small'] == '1')
{
    $attach_file_path = FORUM_ROOT.$forum_config['attach_basefolder'].$attach['file_path'];
    if ( file_exists($attach_file_path) ) {
        list($width, $height,,) = getimagesize($attach_file_path);
        $attach['img_width' ] = $width;
        $attach['img_height'] = $height;
        $show_image = ($attach['img_height'] <= $forum_config['attach_small_height']) &&
                      ($attach['img_width' ] <= $forum_config['attach_small_width' ]);
    }
}

To fix it, we have to replace "function($matches, $errors)" with "function($matches) use (&$errors)" in two places:

Line 58

        $text = preg_replace_callback($pattern_callback, function($matches, $errors) {
            return preparse_list_tag($matches[2], $matches[1], $errors);
        }, $text);

To become

        $text = preg_replace_callback($pattern_callback, function($matches) use (&$errors) {
            return preparse_list_tag($matches[2], $matches[1], $errors);
        }, $text);

And line 532

        $content = preg_replace_callback($pattern_callback, function($matches, $errors) {
            return preparse_list_tag($matches[2], $matches[1], $errors);
        }, $content);

To become

        $content = preg_replace_callback($pattern_callback, function($matches) use (&$errors) {
            return preparse_list_tag($matches[2], $matches[1], $errors);
        }, $content);

Thank you for your hard work!

I'll try your fork.

Can you please attach the fixed `parser.php`?

I'm asking because it crashes in another place when I add this line.

Try to post the following markup.

[list]
    [*]Example list item 1.[/*]
    [*]Example list item 2.[/*]
    [*]Example list item 3.[/*]
[/list]

It provides:

This page isn’t working
punbb.informer.com is currently unable to handle this request.
HTTP ERROR 500

Log message on my server:

AH01071: Got error 'PHP message: PHP Warning:  count(): Parameter must be an array or an object that implements Countable in /.../forum/include/parser.php on line 820'

Hello,

I'm using PunBB from 14 years and I'm very happy with it. Now my hosting company Webfaction terminates work and I'm moving on another hosting. However, I cannot set the forum properly.

The problem is that when I'm trying to log in, it redirects to https://hostanme/login but the actual rout must be https://hostname/forum/login. It is PunBB 1.4.5

I suppose that the problem comes from the way I set virtual hosts.

Nginx proxy:

server {
    listen 443 ssl;
    server_name example.com;

    index index.html;
    root /my/web/dir;

    location /forum/ {
        rewrite  ^/forum/(.*) /$1 break;
        proxy_pass http://127.0.0.1:6666;
    }
}

Apache virtual host:

<VirtualHost 127.0.0.1:6666>
    ServerName example.com
    DocumentRoot /my/web/dir/forum

    <Directory /my/web/dir/forum>
            Options FollowSymLinks
            AllowOverride All
            Require all granted
    </Directory>
</VirtualHost>

.htaccess

<IfModule mod_rewrite.c>
  Options -MultiViews

  RewriteEngine On

  RewriteBase /

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . rewrite.php [L]
</IfModule>

config.php

$base_url = 'https://example.com/forum';

This was the only way I succeed at least to show the forum. However, the login and probably other stuff doesn't work.

When I try to log in, the "Confirm action" appears with wrong links in the form.

<form method="post" action="https://example.com/login/">
    <div class="hidden">
        <input type="hidden" name="prev_url" value="https://example.com/login/">
        <input type="hidden" name="redirect_url" value="https://example.com/">
        ...
    </div>
    ...
</form>

The correct links are _https://example.com/forum/login

Please help me to solve the problem or to make virtual hosting in a better way.

On the old hosting, the .htaccess has `RewriteBase /forum`, however with it, the forum doesn't work here.

If I remove `rewrite  ^/forum/(.*) /$1 break;`, it gives "Request exceeded the limit of 10 internal redirects due to probable configuration error."

8

(5 replies, posted in PunBB 1.4 bug reports)

The problem still persists and an answer is not available. The linked website is unreachable.

The error appears also here:

Deprecated: Function create_function() is deprecated in .../admin/index.php on line 73

Vistman, please post your answer here instead of a link. It would be better for the visitors of this forum and also will make your answer useful in case of the linked page is not available.

You are awesome!

You saved my day.

Miroslav Popov

Hello Lion,

Did you find a solution?

I have the same problem.

Hello,

I installed a SSL certificate on my forum and want to access it under: _https://forexsb.com/forum/

I can read the forum, however when I want to post or to login, it gives an error as follows:

http://s10.postimg.org/6sfmf2h55/screenshot_234.png

After clicking to confirm, it gives error trying to access the site on port 80:

http://s10.postimg.org/kbwgkrv49/screenshot_235.png

My config.php is:

...
$p_connect = false;

$base_url = 'https://forexsb.com/forum'; 

$cookie_name = 'forum_cookie';
$cookie_domain = '.forexsb.com';
$cookie_path = '/';
$cookie_secure = 0;
define('FORUM', 1);
define('PUN_EXTENSIONS_USED', 1);
//define('FORUM_DEBUG', 1);

Any ideas how to fix it?

12

(154 replies, posted in Supported extensions)

PanBB.Ru you are very helpful  !!! how much time took you to post these links? And how mach time would take you to fix this official extension?  pun_pm is an official extension right?

I'm also developing and providing free software from 10 years. The fact PunBB is free and open source is not an excuse for unfinished work. PunBB 1.4.4 is online from 2 months. Why you don't take a look at the official extensions?

I would be more than happy if it was a commercial support for this software and there was a service for fixing such issues.

Maintaining a free and open source product is a responsibility to provide not worse but better quality than the commercial ones.

13

(154 replies, posted in Supported extensions)

After updating to punbb v1.4.4 I receive an error message with  Private Messaging 2.4.2 extension:

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in ../extensions/pun_pm/functions.php on line 627
    $str1 = preg_replace('#^Re\[(\d{1,10})\]: #eu', '\'Re[\'.(\\1 + 1).\']: \'', $str);

Any idea how to fix it?

14

(85 replies, posted in News)

Thank you,
it works fine.

15

(85 replies, posted in News)

I'm facing Fancy Video Tag v 0.4.10

When I enable it, I receive the following error:

Warning: preg_replace_callback(): Modifier /e cannot be used with replacement callback in /home/.../forum/include/parser.php on line 811

16

(85 replies, posted in News)

Visman wrote:
string(30) "`\[video\]([^\[]+)\[/video\]`e"

The extension containing the video bb-code is guilty.

Can we fix this plugin in order to work in Punbb 1.4.4 ?
I'm using it in my forum from long time and I have many videos posted.

17

(39 replies, posted in News)

However, I encountered a bug with the responsive menu. On smarphones, tablets and PCs with smaller screen everything works fine, but on my 23-inch monitor I get something like this:

Press Ctrl+F5 to reload the new CSS files.

Visman wrote:

$base_url in config.php?

Excellent!!!

I forgot that I set it for testing the new hosting before moving.

Thank you.

Hello,

I changed my hosting company.

After transferring the forum, it works fine, but the internal links point to the server of the hosting company.

you can check it here: forexsb.com/forum

http://s28.postimg.org/ag1nsbaal/wrong_server_links.png

Any ideas?

20

(7 replies, posted in Discussions)

For v1.4.2 the line you have to correct is 662 in file include/parser.php.

old line

        return '<a href="'.$full_url.'">'.$link.'</a>';

new line

        return '<a href="'.$full_url.'" rel="nofollow">'.$link.'</a>';

21

(2 replies, posted in Feature requests)

These addons can help:

Antispam System 1.3.4 Created by PunBB Development Team
Adds CAPTCHA to registration, login and guest posting forms. Puts restrictions on adding user signatures and website links.

and

Fancy Stop SPAM 1.3.53 Created by dimka.linux@gmail.com
Antispam system for PunBB 1.4

Extension will be nice. It will allow setting of TimeSpan interval, option for excluding closed topics and optionally filtering out selected forums.
For example my forum has a General category, which I'm not interested to read frequently. I need to see only my specified categories in New Posts and Active Discussions.

In details I want New Posts to show posts only from Category #3.

First I added  to the request 'show_new' at line 450

'WHERE'        => 'f.cat_id=3 AND (fp.read_forum IS NULL OR fp.read_forum=1) AND t.last_post>'.$forum_user['last_visit'].' AND t.moved_to IS NULL',

It works for "New Posts" link that is below the forum nav menu bar but it breaks the New posts link that appear next to the forum title for the forums in other categories.

So my second attempt is to change line 454 to:


            if ($value == -1)
                $query['WHERE'] .= ' AND f.cat_id=3';
            else
                $query['WHERE'] .= ' AND f.id='.$value;

Actually I'm not sure what exactly $value is when searching new posts. I only suppose that  $value == -1 when using the top link and $value is the number of the forum when we use the forum link.

Is this correct?

Filtering out closed topics

t.closed=0

sad

t.last_post>'.(time() - 946080000).' AND 

Doesn't work.

I googled further and changed it to

t.last_post>'.strtotime("-1 year", time()).' AND

It works fine.


Remains the problem with Closed status.

Hello,
I want to change "Unanswered topics" command behaviour.

I want it to show topics that are not closed and that are not older than 1 year.

I found out that have to change line 694 of .\include\search_functions.php

'WHERE' => '(fp.read_forum IS NULL OR fp.read_forum=1) AND t.num_replies=0 AND t.moved_to IS NULL',

I have to add:

t.last_post>'.(time() - 946080000).' AND 

where 946080000 is seconds for one year. 60*60*24*30*365

Is this correct?

..

How to filter out Closed topics?