26

(8 replies, posted in Feature requests)

If he would like to use Bootstrap he would have to change php files. Unfortunately there's no way to do it with hooks. I've been creating responsive theme lately, but I haven't got time to finish it.
http://prntscr.com/z9xi9
http://prntscr.com/z9xm1

I've abandoned work because it's way too hard to implement using hooks. Instead I'm creating Oxygen responsive theme, basing on Bootstrap and Twentytwelve Wordpress theme.

*Note - navigation is not ready yet
http://i.imgur.com/7CyVzmc.png
http://i.imgur.com/KUX8RA9.png

28

(5 replies, posted in Discussions)

You should probably contact your hosting administrator.

29

(2 replies, posted in Discussions)

It should, as far as you add it at the end of CSS file ( so it could replace value from line 6 ).

30

(5 replies, posted in Discussions)

http://dev.mysql.com/doc/refman/5.1/en/ … e-do-table

31

(0 replies, posted in PunBB 1.4 troubleshooting)

Hello!
I've written extension for my forum that creates some kind of "group leaders", who can add other users to their groups. I've been basing on "Moderator group assignment" by Yonash ( http://punbb.informer.com/forums/topic/ … ssignment/ ). And I wonder if this is safe.

Could someone please analyse my manifest?

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

<extension engine="1.0">
    <id>kt_group_leader</id>
    <title>KT Group leader</title>
    <version>2.61</version>
    <description>Adds group leader who can add users to his group.</description>
    <author>Kushi Themes</author>
    <minversion>1.4</minversion>
    <maxtestedon>1.4.2</maxtestedon>
    <install><![CDATA[
        if (!$forum_db->field_exists('users', 'group_leader'))
            $forum_db->add_field('users', 'group_leader', 'TINYINT(1)', false, 0);

    ]]></install>

    <uninstall><![CDATA[
        $forum_db->drop_field('users', 'group_leader');
    ]]></uninstall>

    <hooks>
        <hook id="pf_qr_get_user_info"><![CDATA[
            //mark mod as admin if changing group and have permission to do this
            if (isset($_POST['update_group_membership']) && $forum_user['group_leader'] == '1')
            {
                $forum_user['g_id'] = FORUM_ADMIN;
                $temp_mod_as_admin = true;
            }
            else
                $temp_mod_as_admin = false;
        ]]>
        </hook>
        <hook id="pf_change_group_form_submitted"><![CDATA[
            if ($temp_mod_as_admin && $forum_user['id'] == $id && $user['g_id'] == FORUM_ADMIN)
                message($lang_common['No permission']);
        ]]>
        </hook>
        <hook id="pf_view_details_user_info_end"><![CDATA[
        if (($user['g_id'] == $forum_config['o_default_user_group'] || $user['g_id'] == $forum_user['g_id']) && $forum_user['id'] != $id && $forum_user['group_leader'] == '1')
        {
            // Setup form
            $forum_page['group_count'] = $forum_page['item_count'] = $forum_page['fld_count'] = 0;
            $forum_page['form_action'] = forum_link($forum_url['profile_admin'], $id);

            $forum_page['hidden_fields'] = array(
                'form_sent'        => '<input type="hidden" name="form_sent" value="1" />',
                'csrf_token'    => '<input type="hidden" name="csrf_token" value="'.generate_form_token($forum_page['form_action']).'" />'
        );
        ?>    <form class="frm-form" method="post" accept-charset="utf-8" action="<?php echo $forum_page['form_action'] ?>">
        <div class="hidden">
            <?php echo implode("\n\t\t\t\t", $forum_page['hidden_fields'])."\n" ?>
        </div>
                    <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>">
                        <div class="sf-box select">
                            <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_profile['User group'] ?></span></label><br />
                            <span class="fld-input"><select id="fld<?php echo $forum_page['fld_count'] ?>" name="group_id">
        <?php
            $query = array(
                'SELECT'    => 'g.g_id, g.g_title',
                'FROM'        => 'groups AS g',
                'WHERE'        => 'g.g_id!='.FORUM_GUEST.'',
                'ORDER BY'    => 'g.g_title'
            );
            if (file_exists($ext_info['path'].'/lang/'.$forum_user['language'].'/kt_group_leader.php'))
                    include $ext_info['path'].'/lang/'.$forum_user['language'].'/kt_group_leader.php';
            else
                    include $ext_info['path'].'/lang/English/kt_group_leader.php';
            $result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
            while ($cur_group = $forum_db->fetch_assoc($result))
            {
                if($cur_group['g_id'] == $forum_user['g_id'] || $cur_group['g_id'] == $forum_config['o_default_user_group']){
                    if ($cur_group['g_id'] == $user['g_id'] || ($cur_group['g_id'] == $forum_config['o_default_user_group'] && $user['g_id'] == ''))
                        echo "\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'" selected="selected">'.forum_htmlencode($cur_group['g_title']).'</option>'."\n";
                    else
                        echo "\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'">'.forum_htmlencode($cur_group['g_title']).'</option>'."\n";
                }
            }
        ?>
                            </select></span>
                        </div>
                    </div>
                    <div class="sf-set button-set set<?php echo ++$forum_page['item_count'] ?>">
                        <div class="sf-box text">
                            <span class="submit"><input type="submit" name="update_group_membership" value="<?php echo $lang_profile['Update groups'] ?>" /></span>
                        </div>
                    </div>
            </form>
        <?php
        }
        ]]>
        </hook>
        <hook id="pf_change_details_new_section_validation"><![CDATA[
            $form['group_leader'] = (!isset($_POST['form']['group_leader']) || $_POST['form']['group_leader'] != '1') ? '0' : '1';
        ]]></hook>
        <hook id="pf_change_details_admin_pre_user_management"><![CDATA[
            if (file_exists($ext_info['path'].'/lang/'.$forum_user['language'].'/kt_group_leader.php'))
                    include $ext_info['path'].'/lang/'.$forum_user['language'].'/kt_group_leader.php';
            else
                    include $ext_info['path'].'/lang/English/kt_group_leader.php';
            
            if ($forum_user['g_id'] == FORUM_ADMIN && $user['g_id'] != FORUM_ADMIN && $user['g_id'] != $forum_config['o_default_user_group']):
            ?>
        <fieldset class="mf-set set<?php echo ++$forum_page['item_count'] ?>">
                    <legend><span><?php echo $kt_group_leader['Leader']?></span></legend>
                    <div class="mf-box" style="float: left;">
                        <div class="mf-item">
                            <span class="fld-input"><input type="checkbox" id="fld<?php echo ++$forum_page['fld_count'] ?>" name="form[group_leader]" value="1"<?php if ($user['group_leader'] == '1') echo 'checked="checked"' ?> /></span>
                            <label for="fld<?php echo $forum_page['fld_count'] ?>"><?php echo $kt_group_leader['Leader label'] ?></label>
                        </div>
                    </div>
                    <input type="submit" name="update" value="<?php echo $kt_group_leader['Submit group leader'] ?>" style="float: left;margin-left: .5em;margin-top: .2em;">
        </fieldset>
        <?php endif;
        ]]></hook>
        <hook id="vt_qr_get_posts, ul_qr_get_users"><![CDATA[
            $query['SELECT'] .= ', u.group_leader';
        ]]></hook>
        <hook id="vt_row_pre_post_ident_merge"><![CDATA[
            if (file_exists($ext_info['path'].'/lang/'.$forum_user['language'].'/kt_group_leader.php'))
                include $ext_info['path'].'/lang/'.$forum_user['language'].'/kt_group_leader.php';
            else
                include $ext_info['path'].'/lang/English/kt_group_leader.php';
            if ($cur_post['poster_id'] > 1 && $cur_post['group_leader'] == '1')
                $forum_page['post_ident']['byline'] = '<span class="post-byline">'.sprintf((($cur_post['id'] == $cur_topic['first_post_id']) ? $lang_topic['Topic byline'] : $lang_topic['Reply byline']), (($forum_user['g_view_users'] == '1') ? '<a title="'.sprintf($lang_topic['Go to profile'], forum_htmlencode($cur_post['username'])).' ( '.$kt_group_leader['Leader'].' )" href="'.forum_link($forum_url['user'], $cur_post['poster_id']).'">'.forum_htmlencode($cur_post['username']).'</a><img src="'.$ext_info['path'].'/bullet.png" style="margin-bottom: -3px;"/>' : '<strong>'.forum_htmlencode($cur_post['username']).'</strong>')).'</span>';
        ]]></hook>
        <hook id="pf_change_details_about_output_start, pf_view_details_output_start"><![CDATA[
            if ($user['group_leader'] == '1'){
                $forum_page['user_ident']['username'] = '<li class="username'.(($user['realname'] =='') ? ' fn nickname' : ' nickname').'"><strong>'.forum_htmlencode($user['username']).'</strong><img src="'.$ext_info['path'].'/bullet.png" style="margin-bottom: -3px;"/></li>';
            }
        ]]></hook>
        <hook id="ul_results_row_pre_data_output"><![CDATA[
            if ($user_data['group_leader'] == '1'){
                $forum_page['table_row']['username'] = '<td class="tc'.count($forum_page['table_row']).'"><a href="'.forum_link($forum_url['user'], $user_data['id']).'">'.forum_htmlencode($user_data['username']).'</a><img src="'.$ext_info['path'].'/bullet.png" style="margin-bottom: -3px;" /></td>';
            }
        ]]></hook>
        
    </hooks>
</extension>

Personally I think it's PUN

This is great idea but it requires so much work :<.

Anyway I'll try to constantly adapt it in my free time wink. But You have to understand it requires its own extension that would change classes, DOM structure etc.

After 2 hours I've got something like this
http://i.imgur.com/zwSsg.png
and smaller screen
http://i.imgur.com/KdxfD.png
And it's not even beginning smile.

34

(9 replies, posted in PunBB 1.4 additions)

There's a hook

re_page_not_found

It will allow you to modify slightly 404 page. Go to /rewrite.php line around 80 to see details.

otf wrote:

Ho to give permission to all users for the search. What to change on the code:

if ($forum_user['g_read_board'] == '0' || $forum_user['is_guest'] || ($forum_user['g_id'] != '1' && $forum_user['g_id'] != '4'))
    message($lang_common['No view']);

Just delete this part

if ($forum_user['g_read_board'] == '0' || $forum_user['is_guest'] || ($forum_user['g_id'] != '1' && $forum_user['g_id'] != '4'))
    message($lang_common['No view']);

So that message No view wouldn't show anyhow.

SuperMAG wrote:

@Kushi, Is there a way for the pages to be indexed, means shows up in search.

You mean in forum search or Google ( etc ) search? Second one:

define('FORUM_ALLOW_INDEX', 1);

36

(71 replies, posted in PunBB 1.4 additions)

Every user has style setting in his profile.

Aww of course. It was this user signature smile. Glad I could help

Wow, somehow entire DOM is messed up smile.

User storko in post 3.782 managed to quote signature somehow.

This is post entry

<div class="post-entry">
                    <h4 id="pc19861" class="entry-title hn">Re: Mijn ontdekking van vandaag....</h4>
                    <div class="entry-content">
                        <div class="quotebox"><cite>Peter schreef:</cite><blockquote><p>Ik heb al gezien dat iemand een iPad in z'n priv</p>
                        <div class="sig-content"><span class="sig-line"><!-- --></span>"En Pierre, wat hebben zij gewonnen?"</div>
                    </blockquote></div>
                </div>
            </div>

As you can see adding signature to quote has added this line

<div class="sig-content"><span class="sig-line"><!-- --></span>"En Pierre, wat hebben zij gewonnen?"</div>

I assume that parser tought this </div> is ending of

<div class="quotebox">

but it was not ( but I may be wrong since it closed <blockquote> after that ).


Anyway lack of this one </div> after </blockquote></div> ( ending .entry-content ) messed up whole DOM structure.

However in normal way of quoting it's impossible. Perhaps you're using some multiquote extension?

Use Notepad++ and set encoding to UTF8 without BOM.
And everything should be fine smile. Well at least it is with polish characters like ó ą ś ć ż ź ę

Sorry I've found another errors when I was posting this. Uploaded now.

Very good.

I'll implement this feature in version 2 so the links could be added easily from Administration Panel such as here.
http://i.imgur.com/5FbnR.png

But it would take some time.

However I've been checking Google Analytics to see what are the most common browsing paths and searching isn't the most popular action. Well at least on my forum.

//edit
Anyway, version 1.54 is uploaded fixes small bug. For instant hotfix just change efekty.js to

/*KT Mobile 1.54*/
$(function(){

    var browserWidth = $(window).width();
    var browserHeight = $(window).height();
    var slider = browserWidth*0.85;
    var rest = browserWidth;
    var contentHeight = $("#rest > div").height();
    $('#brd-wrap #slider').css("width",slider);
    $('#brd-wrap #rest').css("width",browserWidth);
    $('#brd-wrap .cover').css("width",browserWidth+slider).css("left",-slider).show();
    $('#more_button').toggle(function() {
        $('#brd-wrap .cover').animate({left:0})  /*----- Width of div mystuff (here 160) ------ */
        $(this).addClass('active');
        $('#brd-wrap #rest').css("width",rest);
        $('#brd-wrap').css("height",browserHeight);
        $('#brd-wrap .mystuff').css("height",browserHeight);
    }, function() {
        $('#brd-wrap .cover').animate({left:-slider})
        $(this).removeClass('active');
        $('#brd-wrap #rest').css("width",browserWidth);
        var contentNewHeight = $("#rest > div").height();
        if(contentNewHeight>browserHeight){
            $('#brd-wrap').css("height",contentNewHeight);
            $('#brd-wrap .mystuff').css("height",contentNewHeight);
        }
        else{
            $('#brd-wrap').css("height",browserHeight);
            $('#brd-wrap .mystuff').css("height",browserHeight);
        }
    });
});
(function( win ){
    var doc = win.document;
       
    // If there's a hash, or addEventListener is undefined, stop here
    if( !location.hash && win.addEventListener ){
        //scroll to 1
        window.scrollTo( 0, 1 );
        var scrollTop = 1,
            getScrollTop = function(){
                return win.pageYOffset || doc.compatMode === "CSS1Compat" && doc.documentElement.scrollTop || doc.body.scrollTop || 0;
            },
            //reset to 0 on bodyready, if needed
            bodycheck = setInterval(function(){
                if( doc.body ){
                    clearInterval( bodycheck );
                    scrollTop = getScrollTop();
                    win.scrollTo( 0, scrollTop === 1 ? 0 : 1 );
                }    
            }, 15 );
        win.addEventListener( "load", function(){
            setTimeout(function(){
                    //reset to hide addr bar at onload
                    win.scrollTo( 0, scrollTop === 1 ? 0 : 1 );
            }, 0);
        } );
    }
})( this );

Version 1.5 is out
http://kushithemes.t15.org/blog/extensions/kt-mobile/
I'll edit first post later.

I'll upload new version with dropdown menu as soon as posible. It will eliminate this kind of problems :-).

Add at the end of each CSS you're using

.postfoot .post-actions >span.report-post, .postfoot .post-actions >span.quote-post {
display: none;
}

This may Be something with commas. Last value shouldn't have one at the end.

    '^(pages)[\/_-]1[\/_-](football)[\/_-](news)[\/_-](feed)[\/_-]$'                                                                                            =>    'pages/football-news-feed.php'

Remember to put \ before special characters, such as / . - smile

I've only showed the basis, the rest is sea of possibilities smile.

If you're using folder based redirect I would recommend to put your page in main catalog and instead edit
\include\url\Folder_based_(fancy)\rewrite_rules.php
Something like

    '^page[\/_-]([0-9]+)[\/_-]football-formation-creator[\/_-]'                                                                                                                =>  'football-formation-creator.php'

You have to create extension and in hook
fn_generate_navlinks_end
inject

    $mylink = '<li id="navtutorial"'.((FORUM_PAGE == 'tutorial') ? ' class="isactive"' : '').'><a href="tutorial.php">Tutorial</a></li>';
    array_splice( $links, 5, 0, $mylink );

Where:

$mylink = '<li id="navtutorial"'.((FORUM_PAGE == 'tutorial') ? ' class="isactive"' : '').'><a href="tutorial.php">Tutorial</a></li>';

navtutorial - should be remembered if you wish to style this element later
tutorial - is FORUM_PAGE which you've declared in your custom page.
tutorial.php - is custom page address.
and

array_splice( $links, 5, 0, $mylink );

5 - link position


Note that the proper and more valid way is to edit /include/url/your-link-scheme/forum_urls.php
( eg. I'm editing /include/url/Default/forum_urls.php )
and add at the end another value

    'tutorial'                        =>     'tutorial.php'

(watch out for commas! )

Plus create language array in your extension, so the link could look like this:

    $mylink = '<li id="navtutorial"'.((FORUM_PAGE == 'tutorial') ? ' class="isactive"' : '').'><a href="'.forum_link($forum_url['tutorial']).'">'.$lang_array['mylink'].'</a></li>';


edit.
You're playing very well with title, this will also affect lastcrumb title.

But it works great. Hooks are the same, just change maxtested version.
http://i.imgur.com/zZHW7.png

Why not use
http://punbb.informer.com/forums/topic/ … line-list/
? smile