1

بابه‌ت: [پێوەکراو]چۆنیەتى دانانى ژێرمەکۆ بۆپڕۆگرامۆکەى FluxBB 1.4.5

سڵاو هاورێیان,

لەم بابەتەدا باس لە چۆنیەتى دامەزراندنى پێوەکراوێکى تر دەکەم.

دەربارەى پێوەکراو

ناوى پێوەکراو : Sub Forum Mod

وەشانی پێوەكراو : 1.0.9.6

كاردەكات لەسەر :  FluxBB 1.4.5

دانەری پێوەكراو : pabb

بەرواری دەرچوون : 2011-03-31

كاریگەری لەسەر فایلەكان : بەڵێ كاریگەری هەیه لەسەر  فایلەکانى

viewtopic.php
                   viewforum.php
                  admin_forums.php
                   search.php
                include/cache.php
                  style/nawestyle.css

كاریگەری لەسەر بنكەدراو : كاریگەری هەیه تكایه باك ئەپ هەڵگره.

باسكردنی پێوەكراو : ئەم پێوەكراوه ڕێگە بەبەرێوەبەرانى مەکۆکان دەدات ژێرمەکۆ بۆ مەکۆکانیان زیاد بکەن.


============================================================================================================================================================================

سەرەتا پێوەکراوەکە لێرە دابگرە

================================================================================================================================================================

ئەو پێوەكراوەی داتگرتووه بەم شێوەیه بەرزی بكەوه بۆ مەكۆكەت

*lang/Kurdish/sub_forum.php ---------> to ---------->lang/Kurdish

*install_mod.php  -------------------> to ----------> root

===========================================================================================================================================================

پێوەکراوەکە بەم شێوەیە دامەزرێنە

 *wwww.nawewebsite.com/FluxBB/install_mod.php

تێبینى : ناوى FluxBB ى بکە بەناوى فۆڵدەرى مەکۆکەت
---------------------------------

وەئەگەر بارت کردۆتە سەر root بەم شێوەیە دیامەزرێنە

 *wwww.nawewebsite.com/install_mod.php

دواتر کرتە لە Install بکە.

===============================================================================================================================================================

دواى دامەزراندن ئەمە بسڕەوە

 install_mod.php

===============================================================================================================================================================

ئەمە بکەوە

index.php

-----------------------------------------------------------------------

بگەڕێ بەدواى

define('PUN_ALLOW_INDEX', 1);
define('PUN_ACTIVE_PAGE', 'index');
require PUN_ROOT.'header.php';

-------------------------------------------------------------------

ئەمە لەدواى زۆربکە

################################################################################
########################### Sub Forum MOD (start) ##############################
################################################################################
if (file_exists(PUN_ROOT.'lang/'.$pun_user['language'].'/sub_forum.php'))
    require PUN_ROOT.'lang/'.$pun_user['language'].'/sub_forum.php';
else
    require PUN_ROOT.'lang/English/sub_forum.php';

$sfdb = array();

$forums_info = $db->query('SELECT f.num_topics, f.num_posts, f.parent_forum_id, f.last_post_id, f.last_poster, f.last_post, f.id, f.forum_name FROM '.$db->prefix.'forums AS f LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.parent_forum_id <> 0 ORDER BY disp_position') or error(implode($db->error(),''),__FILE__,__LINE__,$db->error());

while ($current = $db->fetch_assoc($forums_info)) 
{
    if (!isset($sfdb[$current['parent_forum_id']]))
        $sfdb[$current['parent_forum_id']] = array();
        
    $sfdb[$current['parent_forum_id']][] = $current;
}
################################################################################
########################### Sub Forum MOD ( end ) ##############################
################################################################################


--------------------------------------------------------------------------------------------------------------------------------------------------------------------

بگەڕێ بەدواى


// Print the categories and forums
$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE fp.read_forum IS NULL OR fp.read_forum=1 ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());


------------------------------------------------------------------------------------------------------------------------------------------

بیگۆڕە بەم کۆدە


// Print the categories and forums
$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster, f.parent_forum_id FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND (f.parent_forum_id IS NULL OR f.parent_forum_id=0) ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());



---------------------------------------------------------------------------------------------------------------------------------------------------------

بگەڕی بەدواى


        $num_topics = $cur_forum['num_topics'];
        $num_posts = $cur_forum['num_posts'];

----------------------------------------------------------------------------------------------------------------------------


ئەمە لەدواى زۆربکە


################################################################################
########################### Sub Forum MOD (start) ##############################
################################################################################
        if (isset($sfdb[$cur_forum['fid']]))
        {
            foreach ($sfdb[$cur_forum['fid']] as $cur_subforum)
            {
                $num_topics += $cur_subforum['num_topics'];
                $num_posts += $cur_subforum['num_posts'];
                if ($cur_forum['last_post'] < $cur_subforum['last_post'])
                {
                    $cur_forum['last_post_id'] = $cur_subforum['last_post_id'];
                    $cur_forum['last_poster'] = $cur_subforum['last_poster'];
                    $cur_forum['last_post'] = $cur_subforum['last_post'];
                }
            }
        }
################################################################################
########################### Sub Forum MOD ( end ) ##############################
################################################################################



----------------------------------------------------------------------------------------------------------------------------------------------


بگەڕی بەدواى


$last_post = $lang_common['Never'];


----------------------------------------------------------------------------------------------------------------------------------------------------


ئەمە لەدواى زۆربکە

    // Are there new posts since our last visit?
    if (!empty($sfdb) && isset($sfdb[$cur_forum['fid']]))
    {
        foreach ($sfdb[$cur_forum['fid']] as $cur_subforum)
        {
            if (!$pun_user['is_guest'] && $cur_subforum['last_post'] > $pun_user['last_visit'] && (empty($tracked_topics['forums'][$cur_subforum['id']]) || $cur_forum['last_post'] > $tracked_topics['forums'][$cur_subforum['id']]))
            {
                // There are new posts in this forum, but have we read all of them already?
                foreach ($new_topics[$cur_subforum['id']] as $check_topic_id => $check_last_post)
                {
                    if ((empty($tracked_topics['topics'][$check_topic_id]) || $tracked_topics['topics'][$check_topic_id] < $check_last_post) && (empty($tracked_topics['forums'][$cur_subforum['id']]) || $tracked_topics['forums'][$cur_subforum['id']] < $check_last_post))
                    {
                        $item_status .= ' inew';
                        $forum_field_new = '<span class="newtext">[ <a href="search.php?action=show_new&amp;fid='.$cur_forum['fid'].'">'.$lang_common['New posts'].'</a> ]</span>';
                        $icon_type = 'icon icon-new';

                        break;
                    }
                }
            }
        }
    }


------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


بگەڕێ بەدواى

<tr class="<?php echo $item_status ?>">
                    <td class="tcl">
                        <div class="<?php echo $icon_type ?>"><div class="nosize"><?php echo forum_number_format($forum_count) ?></div></div>
                        <div class="tclcon">
                            <div>
                                <?php echo $forum_field."\n".$moderators ?>

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------

ئەمە لەدواى زۆربکە


<?php
                $sub_forums_list = array();
                if (!empty($sfdb) && isset($sfdb[$cur_forum['fid']]))
                {
                    foreach ($sfdb[$cur_forum['fid']] as $cur_subforum)
                        $sub_forums_list[] = '<a class="subforum_name" href="viewforum.php?id='.$cur_subforum['id'].'">'.pun_htmlspecialchars($cur_subforum['forum_name']).'</a>';

                    // EDIT THIS FOR THE DISPLAY STYLE OF THE SUBFORUMS ON MAIN PAGE
                    if(!empty($sub_forums_list))
                    {
                        // Leave one $sub_forums_list commented out to use the other (between the ###..)
                        ################################
                        // This is Single Line Wrap Style
                        $sub_forums_list = "\t\t\t\t\t\t\t\t".'<span class="subforum">'.$lang_sub_forum['Sub forums'].':</span> '.implode(', ', $sub_forums_list)."\n";
                        // This is List Style
                        //$sub_forums_list = "\n".'<b><em>'.$lang_sub_forum['Sub forums'].':</em></b><br />&nbsp; -- &nbsp;'.implode('<br />&nbsp; -- &nbsp;', $sub_forums_list)."\n";
                        ################################
                        /* if ($cur_forum['forum_desc'] != NULL)
                        echo "<br />";
                        */
                        // TO TURN OFF DISPLAY OF SUBFORUMS ON INDEX PAGE, COMMENT OUT THE FOLLOWING LINE
                        echo $sub_forums_list;
                    }
                }
?>





=======================================================================================================================================================================================



ئەمە بکەوە


viewforum.php

----------------------------------------------------------------------------------------------------------------------------------------------------------------------

بگەڕێ بەدواى



require PUN_ROOT.'lang/'.$pun_user['language'].'/forum.php';


-------------------------------------------------------------------------------------------------------------------------------------------------------------


ئەمە لەدواى زۆربکە



require PUN_ROOT.'lang/'.$pun_user['language'].'/index.php';


-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


بگەڕێ بەدواى

if (!$pun_user['is_guest'])
    $result = $db->query('SELECT f.forum_name, f.redirect_url, f.moderators, f.num_topics, f.sort_by, fp.post_topics, s.user_id AS is_subscribed FROM '.$db->prefix.'forums AS f LEFT JOIN '.$db->prefix.'forum_subscriptions AS s ON (f.id=s.forum_id AND s.user_id='.$pun_user['id'].') LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.id='.$id) or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error());
else
    $result = $db->query('SELECT f.forum_name, f.redirect_url, f.moderators, f.num_topics, f.sort_by, fp.post_topics, 0 AS is_subscribed FROM '.$db->prefix.'forums AS f LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.id='.$id) or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error());


-------------------------------------------------------------------------------------------------------------------------------------------------------------------------


بیگۆڕە بەمە



if (!$pun_user['is_guest'])
    $result = $db->query('SELECT pf.forum_name AS parent_forum, f.parent_forum_id, f.forum_name, f.redirect_url, f.moderators, f.num_topics, f.sort_by, fp.post_topics, s.user_id AS is_subscribed FROM '.$db->prefix.'forums AS f LEFT JOIN '.$db->prefix.'forum_subscriptions AS s ON (f.id=s.forum_id AND s.user_id='.$pun_user['id'].') LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') LEFT JOIN '.$db->prefix.'forums AS pf ON f.parent_forum_id=pf.id  WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.id='.$id) or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error());
else
    $result = $db->query('SELECT pf.forum_name AS parent_forum, f.parent_forum_id, f.forum_name, f.redirect_url, f.moderators, f.num_topics, f.sort_by, fp.post_topics, 0 AS is_subscribed FROM '.$db->prefix.'forums AS f LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') LEFT JOIN '.$db->prefix.'forums AS pf ON f.parent_forum_id=pf.id  WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.id='.$id) or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error());


----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


بگەڕێ بەدواى

// Get topic/forum tracking data
if (!$pun_user['is_guest'])
    $tracked_topics = get_tracked_topics();

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


بیگۆڕە بەمە

if (!$pun_user['is_guest'])
{
    $result = $db->query('SELECT t.forum_id, t.id, t.last_post FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.last_post>'.$pun_user['last_visit'].' AND t.moved_to IS NULL') or error('Unable to fetch new topics', __FILE__, __LINE__, $db->error());

    $new_topics = array();
    while ($cur_topic = $db->fetch_assoc($result))
        $new_topics[$cur_topic['forum_id']][$cur_topic['id']] = $cur_topic['last_post'];

    $tracked_topics = get_tracked_topics();
}


------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

بگەڕێ بەدواى


require PUN_ROOT.'header.php';

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

ئەمە لەدواى زۆربکە




# Option Note: if you do not want the subforums displaying at the top
# when you go into the main forum topic 
# then in the following $sub_forum_result query change  
# - ORDER BY disp_position')        -  to
# - ORDER BY disp_position', true)  -  (without the dashes)
#

if (!isset($_GET['p']) || $_GET['p'] == 1)
{
    if (file_exists(PUN_ROOT.'lang/'.$pun_user['language'].'/sub_forum.php'))
        require PUN_ROOT.'lang/'.$pun_user['language'].'/sub_forum.php';
    else
        require PUN_ROOT.'lang/English/sub_forum.php';

    $subforum_result = $db->query('SELECT f.forum_desc, f.forum_name, f.id, f.last_post, f.last_post_id, f.last_poster, f.moderators, f.num_posts, f.num_topics, f.redirect_url FROM '.$db->prefix.'forums AS f LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND parent_forum_id='.$id.' ORDER BY disp_position') or error('Unable to fetch sub forum info',__FILE__,__LINE__,$db->error());
    if ($db->num_rows($subforum_result))
    {


?>
<div class="linkst">
    <div class="inbox crumbsplus">
        <ul class="crumbs">
            <li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li>
            <li><span>»&#160;</span><a href="viewforum.php?id=<?php echo $id ?>"><strong><?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?></strong></a></li>
        </ul>
        <div class="clearer"></div>
    </div>
</div>

<div id="punindex" class="subforumlist">

<div id="vf1" class="blocktable">
    <h2><span><?php echo $lang_sub_forum['Sub forums'] ?></span></h2>
    <div class="box">
        <div class="inbox">
            <table cellspacing="0">
            <thead>
                <tr>
                    <th class="tcl" scope="col"><?php echo $lang_common['Forum'] ?></th>
                    <th class="tc2" scope="col"><?php echo $lang_index['Topics'] ?></th>
                    <th class="tc3" scope="col"><?php echo $lang_common['Posts'] ?></th>
                    <th class="tcr" scope="col"><?php echo $lang_common['Last post'] ?></th>
                </tr>
            </thead>
            <tbody>
<?php
        $subforum_count = 0;

        while ($cur_subforum = $db->fetch_assoc($subforum_result))
        {
            ++$subforum_count;
            $item_status = '';
            $icon_type = 'icon';

            // Are there new posts?
            if (!$pun_user['is_guest'] && $cur_subforum['last_post'] > $pun_user['last_visit'] && (empty($tracked_topics['forums'][$cur_subforum['id']]) || $cur_subforum['last_post'] > $tracked_topics['forums'][$cur_subforum['id']]))
            {
                // There are new posts in this forum, but have we read all of them already?
                foreach ($new_topics[$cur_subforum['id']] as $check_topic_id => $check_last_post)
                {
                    if ((empty($tracked_topics['topics'][$check_topic_id]) || $tracked_topics['topics'][$check_topic_id] < $check_last_post) && (empty($tracked_topics['forums'][$cur_subforum['id']]) || $tracked_topics['forums'][$cur_subforum['id']] < $check_last_post))
                    {
                        $item_status = 'inew';
                        $icon_type = 'icon inew';

                        break;
                    }
                }
            }

            // Is this a redirect forum?
            if ($cur_forum['redirect_url'] != '')
            {
                $forum_field = '<h3><a href="'.pun_htmlspecialchars($cur_subforum['redirect_url']).'" title="'.$lang_index['Link to'].' '.pun_htmlspecialchars($cur_subforum['redirect_url']).'">'.pun_htmlspecialchars($cur_subforum['forum_name']).'</a></h3>';
                $num_topics = $num_posts = '&nbsp;';
                $item_status = 'iredirect';
                $icon_type = 'icon';
            }
            else
            {
                $forum_field = '<h3><a href="viewforum.php?id='.$cur_subforum['id'].'">'.pun_htmlspecialchars($cur_subforum['forum_name']).'</a></h3>';
                $num_topics = $cur_subforum['num_topics'];
                $num_posts = $cur_subforum['num_posts'];
            }

            if ($cur_subforum['forum_desc'] != '')
                $forum_field .= "\n\t\t\t\t\t\t\t\t".$cur_subforum['forum_desc'];

            // If there is a last_post/last_poster
            if ($cur_subforum['last_post'] != '')
                $last_post = '<a href="viewtopic.php?pid='.$cur_subforum['last_post_id'].'#p'.$cur_subforum['last_post_id'].'">'.format_time($cur_subforum['last_post']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_subforum['last_poster']).'</span>';
            else if ($cur_subforum['redirect_url'] != '')
                $last_post = '- - -';
            else
                $last_post = $lang_common['Never'];

            if ($cur_subforum['moderators'] != '')
            {
                $mods_array = unserialize($cur_subforum['moderators']);
                $moderators = array();

                foreach ($mods_array as $mod_username => $mod_id)
                {
                    if ($pun_user['g_view_users'] == '1')
                        $moderators[] = '<a href="profile.php?id='.$mod_id.'">'.pun_htmlspecialchars($mod_username).'</a>';
                    else
                        $moderators[] = pun_htmlspecialchars($mod_username);
                }

                $moderators = "\t\t\t\t\t\t\t\t".'<p class="modlist">(<em>'.$lang_common['Moderated by'].'</em> '.implode(', ', $moderators).')</p>'."\n";
            }
?>
                <tr<?php if ($item_status != '') echo ' class="'.$item_status.'"'; ?>>
                    <td class="tcl">
                        <div class="intd">
                            <div class="<?php echo $icon_type ?>"><div class="nosize"><?php echo forum_number_format($subforum_count) ?></div></div>
                            <div class="tclcon">
                                <?php echo $forum_field;
                                if ($cur_subforum['moderators'] != '') {
                                    echo "\n".$moderators;
                                }
                                ?>
                            </div>
                        </div>
                    </td>
                    <td class="tc2"><?php echo $num_topics ?></td>
                    <td class="tc3"><?php echo $num_posts ?></td>
                    <td class="tcr"><?php echo $last_post ?></td>
                </tr>
<?php
        }
?>
            </tbody>
            </table>
        </div>
    </div>
</div>

</div>
<?php
    }
}


-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

بگەڕێ بەدواى ئەمە

<li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li>


------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

لەدواى ئەمە زۆربکە

<?php if($cur_forum['parent_forum']) echo "\t\t".'<li><span>»&#160;</span><a href="viewforum.php?id='.$cur_forum['parent_forum_id'].'">'.pun_htmlspecialchars($cur_forum['parent_forum']).'</a></li> '; ?>

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


بگەڕێ بەدواى ئەمە


<li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li>

---------------------------------------------------------------------------------------------------------------------------------------------------------------------


لەدواى ئەمە زۆربکە


<?php if($cur_forum['parent_forum']) echo "\t\t".'<li><span>»&#160;</span><a href="viewforum.php?id='.$cur_forum['parent_forum_id'].'">'.pun_htmlspecialchars($cur_forum['parent_forum']).'</a></li> '; ?>



=====================================================================================================================================================================================


ئەمە بکەوە

viewtopic.php


-------------------------------------------------------------------------------------------------------------------------------------------------------------------------

بگەڕێ بەدواى


if (!$pun_user['is_guest'])
    $result = $db->query('SELECT t.subject, t.closed, t.num_replies, t.sticky, t.first_post_id, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, s.user_id AS is_subscribed FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'topic_subscriptions AS s ON (t.id=s.topic_id AND s.user_id='.$pun_user['id'].') LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id='.$id.' AND t.moved_to IS NULL') or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error());
else
    $result = $db->query('SELECT t.subject, t.closed, t.num_replies, t.sticky, t.first_post_id, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, 0 AS is_subscribed FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id='.$id.' AND t.moved_to IS NULL') or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error());



----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

بیگۆڕە بەمە

if (!$pun_user['is_guest'])
    $result = $db->query('SELECT pf.forum_name AS parent_forum, f.parent_forum_id, t.subject, t.closed, t.num_replies, t.sticky, t.first_post_id, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, s.user_id AS is_subscribed FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'topic_subscriptions AS s ON (t.id=s.topic_id AND s.user_id='.$pun_user['id'].') LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') LEFT JOIN '.$db->prefix.'forums AS pf ON f.parent_forum_id=pf.id WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id='.$id.' AND t.moved_to IS NULL') or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error());
else
    $result = $db->query('SELECT pf.forum_name AS parent_forum, f.parent_forum_id, t.subject, t.closed, t.num_replies, t.sticky, t.first_post_id, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, 0 AS is_subscribed FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') LEFT JOIN '.$db->prefix.'forums AS pf ON f.parent_forum_id=pf.id WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id='.$id.' AND t.moved_to IS NULL') or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error());

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

بگەڕێ بەدواى


<li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li>

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

ئەمە لەدواى زۆربکە

<?php if ($cur_topic['parent_forum']) echo "\t\t".'<li><span>»&#160;</span><a href="viewforum.php?id='.$cur_topic['parent_forum_id'].'">'.pun_htmlspecialchars($cur_topic['parent_forum']).'</a></li> '; ?>

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


بگەڕێ بەدواى


<li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li>



-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

ئەمە لەدواى زۆربکە


<?php if ($cur_topic['parent_forum']) echo "\t\t".'<li><span>»&#160;</span><a href="viewforum.php?id='.$cur_topic['parent_forum_id'].'">'.pun_htmlspecialchars($cur_topic['parent_forum']).'</a></li> '; ?>



========================================================================================================================================================================================



ئەمە بکەوە



admin_forums.php

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

بگەڕێ بەدواى


$redirect_url = isset($_POST['redirect_url']) ? trim($_POST['redirect_url']) : null;



-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

لەدواى ئەمە زۆربکە

$parent_forum_id = intval($_POST['parent_forum']);

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


بگەڕێ بەدواى

$db->query('UPDATE '.$db->prefix.'forums SET forum_name=\''.$db->escape($forum_name).'\', forum_desc='.$forum_desc.', redirect_url='.$redirect_url.', sort_by='.$sort_by.', cat_id='.$cat_id.' WHERE id='.$forum_id) or error('Unable to update forum', __FILE__, __LINE__, $db->error());



-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

بیگۆڕە بەمە

$db->query('UPDATE '.$db->prefix.'forums SET forum_name=\''.$db->escape($forum_name).'\', forum_desc='.$forum_desc.', redirect_url='.$redirect_url.', sort_by='.$sort_by.', cat_id='.$cat_id.', parent_forum_id='.$parent_forum_id.' WHERE id='.$forum_id) or error('Unable to update forum', __FILE__, __LINE__, $db->error());





-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

بگەڕێ بەدواى

$result = $db->query('SELECT id, forum_name, forum_desc, redirect_url, num_topics, sort_by, cat_id FROM '.$db->prefix.'forums WHERE id='.$forum_id) or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error());

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


بیگۆڕە بەمە


$result = $db->query('SELECT id, forum_name, forum_desc, redirect_url, num_topics, sort_by, cat_id, parent_forum_id FROM '.$db->prefix.'forums WHERE id='.$forum_id) or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error());

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

بگەڕێ بەدواى


$cur_forum = $db->fetch_assoc($result);

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

ئەمە لەدواى زۆربکە


    if (file_exists(PUN_ROOT.'lang/'.$pun_user['language'].'/sub_forum.php'))
        require PUN_ROOT.'lang/'.$pun_user['language'].'/sub_forum.php';
    else
        require PUN_ROOT.'lang/English/sub_forum.php';

    $parent_forums = Array();
    $result = $db->query('SELECT DISTINCT parent_forum_id FROM '.$db->prefix.'forums WHERE parent_forum_id != 0');
    while ($r = $db->fetch_row($result))
        $parent_forums[] = $r[0];

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


بگەڕێ بەدواى

<th scope="row"><?php echo $lang_admin_forums['Redirect label'] ?></th>
                                    <td><?php echo ($cur_forum['num_topics']) ? $lang_admin_forums['Redirect help'] : '<input type="text" name="redirect_url" size="45" maxlength="100" value="'.pun_htmlspecialchars($cur_forum['redirect_url']).'" tabindex="5" />'; ?></td>
                                </tr>

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

ئەمە لەدواى زۆربکە

<tr>
                                    <th scope="row"><?php echo $lang_sub_forum['Parent forum'] ?></th>
                                    <td>
                                        <select name="parent_forum">
                                            <option value="0"><?php echo $lang_sub_forum['No parent forum'] ?></option>
<?php

    if (!in_array($cur_forum['id'],$parent_forums))
    {
        $result = $db->query('SELECT c.id AS cid, c.cat_name, f.id, f.forum_name, f.redirect_url, f.parent_forum_id FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());

        $cur_category = 0;
        while ($forum_list = $db->fetch_assoc($result))
        {
            if ($forum_list['cid'] != $cur_category) // A new category since last iteration?
            {
                if ($cur_category)
                    echo "\t\t\t\t\t\t".'</optgroup>'."\n";

                echo "\t\t\t\t\t\t".'<optgroup label="'.pun_htmlspecialchars($forum_list['cat_name']).'">'."\n";
                $cur_category = $forum_list['cid'];
            }
            
            $selected = ($forum_list['id'] == $cur_forum['parent_forum_id']) ? ' selected="selected"' : '';

            if(!$forum_list['parent_forum_id'] && $forum_list['id'] != $cur_forum['id'])
                echo "\t\t\t\t\t\t\t".'<option value="'.$forum_list['id'].'"'.$selected.'>'.pun_htmlspecialchars($forum_list['forum_name']).'</option>'."\n";
        }
    }

?>
                                            </optgroup>
                                        </select>
                                    </td>
                                </tr>


---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


بگەڕێ بەدواى



$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.disp_position FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id ORDER BY c.disp_position, c.id, f.disp_position') or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


بیگۆڕە بەمە


$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.disp_position, f.parent_forum_id FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id ORDER BY c.disp_position, c.id, f.disp_position') or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


بگەڕێ بەدواى


<td class="tcr"><strong><?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?></strong></td>


-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


بیگۆڕە بەمە

<td class="tcr"><strong><?php echo ($cur_forum['parent_forum_id'] == 0 ? '' : '&nbsp;&nbsp;&nbsp;').pun_htmlspecialchars($cur_forum['forum_name']) ?></strong></td>



==============================================================================================================================================================================================================


ئەمە بکەوە


search.php

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


بگەڕێ بەدواى


$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.redirect_url FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.redirect_url IS NULL ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());




-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


بیگۆڕە بەمە



$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.redirect_url, f.parent_forum_id FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.redirect_url IS NULL ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());



---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


بگەڕێ بەدواى

echo "\t\t\t\t\t\t\t\t".'<option value="'.$cur_forum['fid'].'">'.pun_htmlspecialchars($cur_forum['forum_name']).'</option>'."\n";

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


بیگۆڕە بەمە

echo "\t\t\t\t\t\t\t\t".'<option value="'.$cur_forum['fid'].'">'.($cur_forum['parent_forum_id'] == 0 ? '' : '&nbsp;&nbsp;&nbsp;').pun_htmlspecialchars($cur_forum['forum_name']).'</option>'."\n";



==============================================================================================================================================================================================================


ئەمە بکەوە


include/cache.php


---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


بگەڕێ بەدواى

$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.redirect_url FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$group_id.') WHERE fp.read_forum IS NULL OR fp.read_forum=1 ORDER BY c.disp_position, c.id, f.disp_position') or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


بیگۆڕە بەمە

$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.redirect_url, f.parent_forum_id FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$group_id.') WHERE fp.read_forum IS NULL OR fp.read_forum=1 ORDER BY c.disp_position, c.id, f.disp_position') or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());


---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


بگەڕێ بەدواى

$output .= "\t\t\t\t\t\t\t".'<option value="'.$cur_forum['fid'].'"<?php echo ($forum_id == '.$cur_forum['fid'].') ? \' selected="selected"\' : \'\' ?>>'.pun_htmlspecialchars($cur_forum['forum_name']).$redirect_tag.'</option>'."\n";

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


بیگۆڕە بەمە

$output .= "\t\t\t\t\t\t\t".'<option value="'.$cur_forum['fid'].'"<?php echo ($forum_id == '.$cur_forum['fid'].') ? \' selected="selected"\' : \'\' ?>>'.($cur_forum['parent_forum_id'] == 0 ? '' : '&nbsp;&nbsp;&nbsp;').pun_htmlspecialchars($cur_forum['forum_name']).$redirect_tag.'</option>'."\n";


==============================================================================================================================================================================================================


ئەمە بکەوە


style/nawestyle.css

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


بگەڕێ بەدواى


#punindex #brdmain .blocktable h2, #punsearch #vf h2 {


-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


بیگۆڕە بەمە


#punindex #brdmain .blocktable h2, #punindex.subforumlist .blocktable h2, #punsearch #vf h2 {

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

مەبەستم لە nawestyle.css ئەوەیە کامە ستایل = ڕووکار وەکو ڕووکارى سەرەکى بەکاردەبەى بۆى زیادبکە بۆدەرکەوتنى ئەم پێوەکراوە.

=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=

بۆ بینینى کارى پێوەکراوەکە + چۆنیەتى بەکاهێنانى

سەیرى ئەم بەستەرە بکە

http://www.webchin.org/Meko/viewtopic.php?id=24581

=====================================================================

لە کۆتایى کاتێکى خۆش.

====================================================================================================

ڕاستیمان لێ بۆته‌ خه‌ون و خه‌ونیش ڕاستی.
(new_z)

2

وه‌ڵام: [پێوەکراو]چۆنیەتى دانانى ژێرمەکۆ بۆپڕۆگرامۆکەى FluxBB 1.4.5

سو پاس