326

(18 replies, posted in PunBB 1.4 troubleshooting)

There is no ready decision for PHP 5.5.x.
Here is how it was made for FluxBB:
Old

function do_bbcode($text, $is_signature = false)
{
    global $lang_common, $pun_user, $pun_config, $re_list;

    if (strpos($text, '[quote') !== false)
    {
        $text = preg_replace('%\[quote\]\s*%', '</p><div class="quotebox"><blockquote><div><p>', $text);
        $text = preg_replace('%\[quote=(&quot;|&\#039;|"|\'|)(.*?)\\1\]%se', '"</p><div class=\"quotebox\"><cite>".str_replace(array(\'[\', \'\\"\'), array(\'&#91;\', \'"\'), \'$2\')." ".$lang_common[\'wrote\']."</cite><blockquote><div><p>"', $text);
        $text = preg_replace('%\s*\[\/quote\]%S', '</p></div></blockquote></div><p>', $text);
    }

    if (!$is_signature)
    {
        $pattern[] = $re_list;
        $replace[] = 'handle_list_tag(\'$2\', \'$1\')';
    }

    $pattern[] = '%\[b\](.*?)\[/b\]%ms';
    $pattern[] = '%\[i\](.*?)\[/i\]%ms';
    $pattern[] = '%\[u\](.*?)\[/u\]%ms';
    $pattern[] = '%\[s\](.*?)\[/s\]%ms';
    $pattern[] = '%\[del\](.*?)\[/del\]%ms';
    $pattern[] = '%\[ins\](.*?)\[/ins\]%ms';
    $pattern[] = '%\[em\](.*?)\[/em\]%ms';
    $pattern[] = '%\[colou?r=([a-zA-Z]{3,20}|\#[0-9a-fA-F]{6}|\#[0-9a-fA-F]{3})](.*?)\[/colou?r\]%ms';
    $pattern[] = '%\[h\](.*?)\[/h\]%ms';

    $replace[] = '<strong>$1</strong>';
    $replace[] = '<em>$1</em>';
    $replace[] = '<span class="bbu">$1</span>';
    $replace[] = '<span class="bbs">$1</span>';
    $replace[] = '<del>$1</del>';
    $replace[] = '<ins>$1</ins>';
    $replace[] = '<em>$1</em>';
    $replace[] = '<span style="color: $1">$2</span>';
    $replace[] = '</p><h5>$1</h5><p>';

    if (($is_signature && $pun_config['p_sig_img_tag'] == '1') || (!$is_signature && $pun_config['p_message_img_tag'] == '1'))
    {
        $pattern[] = '%\[img\]((ht|f)tps?://)([^\s<"]*?)\[/img\]%e';
        $pattern[] = '%\[img=([^\[]*?)\]((ht|f)tps?://)([^\s<"]*?)\[/img\]%e';
        if ($is_signature)
        {
            $replace[] = 'handle_img_tag(\'$1$3\', true)';
            $replace[] = 'handle_img_tag(\'$2$4\', true, \'$1\')';
        }
        else
        {
            $replace[] = 'handle_img_tag(\'$1$3\', false)';
            $replace[] = 'handle_img_tag(\'$2$4\', false, \'$1\')';
        }
    }

    $pattern[] = '%\[url\]([^\[]*?)\[/url\]%e';
    $pattern[] = '%\[url=([^\[]+?)\](.*?)\[/url\]%e';
    $pattern[] = '%\[email\]([^\[]*?)\[/email\]%';
    $pattern[] = '%\[email=([^\[]+?)\](.*?)\[/email\]%';
    $pattern[] = '%\[topic\]([1-9]\d*)\[/topic\]%e';
    $pattern[] = '%\[topic=([1-9]\d*)\](.*?)\[/topic\]%e';
    $pattern[] = '%\[post\]([1-9]\d*)\[/post\]%e';
    $pattern[] = '%\[post=([1-9]\d*)\](.*?)\[/post\]%e';
    $pattern[] = '%\[forum\]([1-9]\d*)\[/forum\]%e';
    $pattern[] = '%\[forum=([1-9]\d*)\](.*?)\[/forum\]%e';
    $pattern[] = '%\[user\]([1-9]\d*)\[/user\]%e';
    $pattern[] = '%\[user=([1-9]\d*)\](.*?)\[/user\]%e';

    $replace[] = 'handle_url_tag(\'$1\')';
    $replace[] = 'handle_url_tag(\'$1\', \'$2\')';
    $replace[] = '<a href="mailto:$1">$1</a>';
    $replace[] = '<a href="mailto:$1">$2</a>';
    $replace[] = 'handle_url_tag(\''.get_base_url(true).'/viewtopic.php?id=$1\')';
    $replace[] = 'handle_url_tag(\''.get_base_url(true).'/viewtopic.php?id=$1\', \'$2\')';
    $replace[] = 'handle_url_tag(\''.get_base_url(true).'/viewtopic.php?pid=$1#p$1\')';
    $replace[] = 'handle_url_tag(\''.get_base_url(true).'/viewtopic.php?pid=$1#p$1\', \'$2\')';
    $replace[] = 'handle_url_tag(\''.get_base_url(true).'/viewforum.php?id=$1\')';
    $replace[] = 'handle_url_tag(\''.get_base_url(true).'/viewforum.php?id=$1\', \'$2\')';
    $replace[] = 'handle_url_tag(\''.get_base_url(true).'/profile.php?id=$1\')';
    $replace[] = 'handle_url_tag(\''.get_base_url(true).'/profile.php?id=$1\', \'$2\')';

    // This thing takes a while! :)
    $text = preg_replace($pattern, $replace, $text);

    return $text;
}

New

function do_bbcode($text, $is_signature = false)
{
    global $lang_common, $pun_user, $pun_config, $re_list;

    if (strpos($text, '[quote') !== false)
    {
        $text = preg_replace('%\[quote\]\s*%', '</p><div class="quotebox"><blockquote><div><p>', $text);
        $text = preg_replace_callback('%\[quote=(&quot;|&\#039;|"|\'|)(.*?)\\1\]%s', create_function('$matches', 'global $lang_common; return "</p><div class=\"quotebox\"><cite>".str_replace(array(\'[\', \'\\"\'), array(\'&#91;\', \'"\'), $matches[2])." ".$lang_common[\'wrote\']."</cite><blockquote><div><p>";'), $text);
        $text = preg_replace('%\s*\[\/quote\]%S', '</p></div></blockquote></div><p>', $text);
    }
    if (!$is_signature)
    {
        $pattern_callback[] = $re_list;
        $replace_callback[] = 'handle_list_tag($matches[2], $matches[1])';
    }

    $pattern[] = '%\[b\](.*?)\[/b\]%ms';
    $pattern[] = '%\[i\](.*?)\[/i\]%ms';
    $pattern[] = '%\[u\](.*?)\[/u\]%ms';
    $pattern[] = '%\[s\](.*?)\[/s\]%ms';
    $pattern[] = '%\[del\](.*?)\[/del\]%ms';
    $pattern[] = '%\[ins\](.*?)\[/ins\]%ms';
    $pattern[] = '%\[em\](.*?)\[/em\]%ms';
    $pattern[] = '%\[colou?r=([a-zA-Z]{3,20}|\#[0-9a-fA-F]{6}|\#[0-9a-fA-F]{3})](.*?)\[/colou?r\]%ms';
    $pattern[] = '%\[h\](.*?)\[/h\]%ms';

    $replace[] = '<strong>$1</strong>';
    $replace[] = '<em>$1</em>';
    $replace[] = '<span class="bbu">$1</span>';
    $replace[] = '<span class="bbs">$1</span>';
    $replace[] = '<del>$1</del>';
    $replace[] = '<ins>$1</ins>';
    $replace[] = '<em>$1</em>';
    $replace[] = '<span style="color: $1">$2</span>';
    $replace[] = '</p><h5>$1</h5><p>';

    if (($is_signature && $pun_config['p_sig_img_tag'] == '1') || (!$is_signature && $pun_config['p_message_img_tag'] == '1'))
    {
        $pattern_callback[] = '%\[img\]((ht|f)tps?://)([^\s<"]*?)\[/img\]%';
        $pattern_callback[] = '%\[img=([^\[]*?)\]((ht|f)tps?://)([^\s<"]*?)\[/img\]%';
        if ($is_signature)
        {
            $replace_callback[] = 'handle_img_tag($matches[1].$matches[3], true)';
            $replace_callback[] = 'handle_img_tag($matches[2].$matches[4], true, $matches[1])';
        }
        else
        {
            $replace_callback[] = 'handle_img_tag($matches[1].$matches[3], false)';
            $replace_callback[] = 'handle_img_tag($matches[2].$matches[4], false, $matches[1])';
        }
    }

    $pattern_callback[] = '%\[url\]([^\[]*?)\[/url\]%';
    $pattern_callback[] = '%\[url=([^\[]+?)\](.*?)\[/url\]%';
    $pattern[] = '%\[email\]([^\[]*?)\[/email\]%';
    $pattern[] = '%\[email=([^\[]+?)\](.*?)\[/email\]%';
    $pattern_callback[] = '%\[topic\]([1-9]\d*)\[/topic\]%';
    $pattern_callback[] = '%\[topic=([1-9]\d*)\](.*?)\[/topic\]%';
    $pattern_callback[] = '%\[post\]([1-9]\d*)\[/post\]%';
    $pattern_callback[] = '%\[post=([1-9]\d*)\](.*?)\[/post\]%';
    $pattern_callback[] = '%\[forum\]([1-9]\d*)\[/forum\]%';
    $pattern_callback[] = '%\[forum=([1-9]\d*)\](.*?)\[/forum\]%';
    $pattern_callback[] = '%\[user\]([1-9]\d*)\[/user\]%';
    $pattern_callback[] = '%\[user=([1-9]\d*)\](.*?)\[/user\]%';

    $replace_callback[] = 'handle_url_tag($matches[1])';
    $replace_callback[] = 'handle_url_tag($matches[1], $matches[2])';
    $replace[] = '<a href="mailto:$1">$1</a>';
    $replace[] = '<a href="mailto:$1">$2</a>';
    $replace_callback[] = 'handle_url_tag(\''.get_base_url(true).'/viewtopic.php?id=\'.$matches[1])';
    $replace_callback[] = 'handle_url_tag(\''.get_base_url(true).'/viewtopic.php?id=\'.$matches[1], $matches[2])';
    $replace_callback[] = 'handle_url_tag(\''.get_base_url(true).'/viewtopic.php?pid=\'.$matches[1].\'#p\'.$matches[1])';
    $replace_callback[] = 'handle_url_tag(\''.get_base_url(true).'/viewtopic.php?pid=\'.$matches[1].\'#p\'.$matches[1], $matches[2])';
    $replace_callback[] = 'handle_url_tag(\''.get_base_url(true).'/viewforum.php?id=\'.$matches[1])';
    $replace_callback[] = 'handle_url_tag(\''.get_base_url(true).'/viewforum.php?id=\'.$matches[1], $matches[2])';
    $replace_callback[] = 'handle_url_tag(\''.get_base_url(true).'/profile.php?id=\'.$matches[1])';
    $replace_callback[] = 'handle_url_tag(\''.get_base_url(true).'/profile.php?id=\'.$matches[1], $matches[2])';

    // This thing takes a while! :)
    $text = preg_replace($pattern, $replace, $text);
    $count = count($pattern_callback);
    for($i = 0 ; $i < $count ; $i++)
    {
        $text = preg_replace_callback($pattern_callback[$i], create_function('$matches', 'return '.$replace_callback[$i].';'), $text);
    }
    return $text;
}

327

(18 replies, posted in PunBB 1.4 troubleshooting)

...
    $pattern[] = '#\[url\]([^\[]*?)\[/url\]#e';
    $pattern[] = '#\[url=([^\[]+?)\](.*?)\[/url\]#e';
    $pattern[] = '#\[email\]([^\[]*?)\[/email\]#';
    $pattern[] = '#\[email=([^\[]+?)\](.*?)\[/email\]#';
...
    $text = preg_replace($pattern, $replace, $text);
...

http://www.php.net/manual/en/migration55.deprecated.php

It is required to update a parser code in order that it correctly worked in PHP 5.5.x
This question should be addressed to the PunBB developers wink

328

(18 replies, posted in PunBB 1.4 troubleshooting)

PHP 5.5.x ?

This code influences only deleting of posts. It doesn't influence editing. You watch forum settings.

Constant FORUM_PAGE.
Open the header.php file and look at conditions with FORUM_PAGE use.

Change extensions which add these js.

Create folfer not_delete in folder /extensions.
Create file manifest.xml in folder /extensions/not_delete:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE extension SYSTEM "ext-1.0.dtd">


<extension engine="1.0">
    <id>not_delete</id>
    <title>Not delete for moderators</title>
    <version>1.0.0</version>
    <description>Not delete for moderators</description>
    <author>Visman</author>

    <minversion>1.4.2</minversion>
    <maxtestedon>1.4.2</maxtestedon>

    <hooks>

        <hook id=" dl_pre_permission_check"><![CDATA[
            $forum_page['is_admmod'] = ($forum_user['g_id'] == FORUM_ADMIN) ? true : false;
        ]]></hook>


    </hooks>
</extension>

Go to Administration → Extensions → Manage extensions and install Not delete for moderators

hook dl_pre_permission_check

$forum_page['is_admmod'] = ($forum_user['g_id'] == FORUM_ADMIN) ? true : false;

334

(8 replies, posted in PunBB 1.4 troubleshooting)

There will be more clarity if to find in a code an output here this unit:

                <footer>
                    
                    <section class="legal-notice">
                        <div>
                            <ul>
                                <li>&copy;&nbsp;2013&nbsp;DeLeuksteTaarten.nl.&nbsp;Alle rechten voorbehouden.</li>
                                <li><a href="http://www.deleukstetaarten.nl/sitemap">Sitemap</a></li>

                                <li><a href="http://www.panoramastudios.nl/" target="_blank">Website door Panorama Studios</a></li>
                            </ul>
                        </div>
                    </section>
                </footer>
            </div>


<script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
    
    ga('create', 'UA-885478-3', 'auto');
    ga('send', 'pageview');
</script>

335

(8 replies, posted in PunBB 1.4 troubleshooting)

The footer.php file differs from the standard?

336

(8 replies, posted in PunBB 1.4 troubleshooting)

It is a question of this (forum.deleukstetaarten.nl) forum?
Scripts simply on simply aren't loaded.
Your forum:

<!-- forum_debug -->
    </div>
    </div>
    </div>
                <footer>
                    
                    <section class="legal-notice">
                        <div>
                            <ul>
                                <li>&copy;&nbsp;2013&nbsp;DeLeuksteTaarten.nl.&nbsp;Alle rechten voorbehouden.</li>
                                <li><a href="http:// www. deleukstetaarten .nl/sitemap">Sitemap</a></li>

                                <li><a href="http://www. panoramastudios .nl/" target="_blank">Website door Panorama Studios</a></li>
                            </ul>
                        </div>
                    </section>
                </footer>
            </div>


<script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
    
    ga('create', 'UA-885478-3', 'auto');
    ga('send', 'pageview');
</script>
</body>
</html>

We will compare to this forum:

<!-- forum_debug -->
    </div>
    </div>
    <script>if (typeof PUNBB === 'undefined' || !PUNBB) {
        var PUNBB = {};
    }

    PUNBB.env = {
        base_url: "http:// punbb .informer .com/forums/",
        base_js_url: "http:// punbb .informer .com/forums/include/js/",
        user_lang: "English",
        user_style: "Oxygen",
        user_is_guest: "1",
        page: "index"
    };</script>
<script src="http:// punbb .informer .com/forums/include/js/min/punbb.common.min.js"></script>
<script>(function () {
    var forum_quickjump_url = "http:// punbb .informer .com/forums/forum/$1/$2/";
    var sef_friendly_url_array = new Array(26);
    sef_friendly_url_array[48] = "news";
    sef_friendly_url_array[23] = "feature-requests";
    sef_friendly_url_array[68] = "discussions";
    sef_friendly_url_array[78] = "development";
    sef_friendly_url_array[71] = "punbb-show-off";
    sef_friendly_url_array[80] = "punbb-14-bug-reports";
    sef_friendly_url_array[79] = "supported-extensions";
    sef_friendly_url_array[81] = "punbb-14-troubleshooting";
    sef_friendly_url_array[82] = "punbb-14-additions";
    sef_friendly_url_array[83] = "language-packs";
    sef_friendly_url_array[70] = "punbb-13-bug-reports";
    sef_friendly_url_array[65] = "punbb-13-extensions";
    sef_friendly_url_array[64] = "punbb-13-troubleshooting";
    sef_friendly_url_array[69] = "punbb-13-additions";
    sef_friendly_url_array[73] = "punbb-13-discussion";
    sef_friendly_url_array[22] = "punbb-12-bug-reports";
    sef_friendly_url_array[24] = "punbb-12-troubleshooting";
    sef_friendly_url_array[35] = "punbb-12-modifications-plugins-and-integrations";
    sef_friendly_url_array[34] = "punbb-12-show-off";
    sef_friendly_url_array[40] = "punbb-12-discussion";
    sef_friendly_url_array[74] = "punbbnet-discussion";
    sef_friendly_url_array[25] = "general-discussion";
    sef_friendly_url_array[26] = "programming";
    sef_friendly_url_array[72] = "fun";
    sef_friendly_url_array[47] = "archive";
    sef_friendly_url_array[28] = "test-forum";

    PUNBB.common.addDOMReadyEvent(function () { PUNBB.common.attachQuickjumpRedirect(forum_quickjump_url, sef_friendly_url_array); });
}());</script>
<script>
    $LAB.setOptions({AlwaysPreserveOrder:false})
    .script("http:// punbb .informer .com/forums/extensions/pun_jquery/js/jquery-1.6.4.min.js").wait()
    .wait(function () { PUNBB.common.addDOMReadyEvent(function(){var a=null,b=document.getElementsByTagName("head")[0],a=PUNBB.common.arrayOfMatched(function(a){return a.getAttribute("rel")&&a.getAttribute("rel")==="next"},document.getElementsByTagName("link"));if(a[0]&&b){var a=a[0],c=document.createElement("link");c.setAttribute("href",a.getAttribute("href"));c.setAttribute("rel","prerender");b.appendChild(c)}}); })
    .script("http:// punbb .informer .com/forums/extensions/fancy_scroll_to_top/js/fancy_scroll_to_top.min.js");
</script>
<script type="text/javascript"><!--
    document.write("<img src='http:// hits .informer .com/log.php?id=3&r="+ Math.round(100000 * Math.random()) + "' />");
--></script>
<script type="text/javascript"><!--
    var gaJsHost = (("https:" == document.location.protocol) ? "https:// ssl ." : "http:// www .");
    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics .com/ga.js' type='text/javascript'%3E%3C/script%3E"));
--></script>
<script type="text/javascript"><!--
    var pageTracker = _gat ._getTracker("UA-5138883-2");
    pageTracker._initData();
    pageTracker._trackPageview();
--></script>
</body>
</html>

Who adapted a forum for a site? Ask them a question that changed in a forum code.

337

(8 replies, posted in PunBB 1.4 troubleshooting)

1. Update all plugins to the last versions.
2. Open the console of the browser and you watch mistakes which appear during the work with your forum.

P.S. If use style containing template, in this template there has to be a code" <!-- - forum_javascript--->"

338

(4 replies, posted in Feature requests)

hook pf_change_details_identity_pre_url

ob_start();

hook pf_change_details_identity_pre_facebook

ob_end_clean();

in table users clear the url column

339

(2 replies, posted in PunBB 1.4 troubleshooting)

These are bots tongue
--
In hook fn_generate_navlinks_end

$links['index'] = '<li id="navindex"'.((FORUM_PAGE == 'index') ? ' class="isactive"' : '').'><a href="'.forum_link($forum_url['index']).'">Forums</a></li>';
array_unshift($links, '<li id="navsite"><a href="LINK TO YOU SITE">'.$lang_common['Index'].'</a></li>');

340

(13 replies, posted in Supported extensions)

kudataz wrote:

then..
if im post like this

[spoiler]zzz/spoiler][spoiler]zzz/spoiler]

there is not getting eror warning, n then make strang result in post.php sad

use http://punbb.informer.com/forums/topic/ … vaspoiler/ tongue

341

(41 replies, posted in PunBB 1.4 additions)

v 0.9.5
Adds video of vk.com, audio of mixcloud.com and hulkshare.com.

342

(2 replies, posted in PunBB 1.4 troubleshooting)

extension id != extension folder name

343

(41 replies, posted in PunBB 1.4 additions)

This my expansion from FluxBB.
Adds javascript which will transform links in the browser of the user to media a content.

It is supported
video: YouTube, Vimeo, Rutube, Dailymotion, Sibnet, Facebook, Coub, Vine, VK, IGN, Gamespot, OK.ru, _www.aparat.com, izlesene.com, vlipsy.com and direct urls for mp4, m4v, ogv, webm, webmv;
audio: SoundCloud, ZippyShare, PromoDJ, Mixcloud, Hulkshare and direct urls for mp3, m4a, ogg, oga, webma, wav, flac;
maps: Google Maps, Yandex Maps.

v 0.9.5  https://github.com/MioVisman/punbb_exte … va_mediajs

look topic http://punbb.informer.com/forums/topic/ … -xsrfcsrf/

345

(5 replies, posted in PunBB 1.4 additions)

In the Russian subject my sequence of actions is written wink
I took the manifest.xml file from the Fancy Spoiler expansion, I removed all superfluous, I inserted a spoiler code from my mod for FluxBB _h t t p s : / / fluxbb.org/resources/mods/spoiler/
This spoiler works even in the list
http://jpegshare.net/images/ef/0f/ef0fba014666f854ec9fbd440af825c6.png

346

(5 replies, posted in PunBB 1.4 additions)

Add BBcode tag «spoiler»

v 1.0.3 https://github.com/MioVisman/punbb_exte … va_spoiler

P.S. You can use only one of the extensions at a time: either sva_spoiler or sva_spoiler_nojs.

347

(2 replies, posted in Discussions)

return sprintf($lang_common['Years'], $way);

in russian common.php

'Years' => 'бурум-пурум %s',

in bulgaria common.php

'Years' => '%s пурум-бурум' ,

348

(1 replies, posted in PunBB 1.4 troubleshooting)

PHP v 5.5?