صفحة 2 من 2 الأولىالأولى 12
النتائج 16 إلى 30 من 30

الموضوع: [هاك] مواضيع الأقسام الفرعية

  1. #16
    عضو فعال
    تاريخ التسجيل
    Feb 2003
    المشاركات
    1,308


    تم تحديث الهاك
    ولا يحتاج تعديل في ملف
    -----
    لإضافة اسم القسم :
    افتح قالب threadbit
    ابحث عن الكود التالي :
    كود:
    <a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]" id="thread_title_$thread[realthreadid]"<if condition="$show['gotonewpost']"> style="font-weight:bold"</if>>$thread[threadtitle]</a>
    أضف أسفله :
    كود:
    <span style="float:left"><a href="forumdisplay.php?f=$thread[forumid]">[$thread[forumtitle]]</a></span>
    وإحفظ القالب

    تحديث: طبعا سوالف سوفت لا تريد أحد أن يقوم بتعديل موضوعه فأنا مظطر إلى وضع المثال هنا





    الصور المرفقة الصور المرفقة  
    الملفات المرفقة الملفات المرفقة

  2. #17
    عضو نشيط
    تاريخ التسجيل
    May 2007
    المشاركات
    214


    هلا يالطيب ماظبط معاي وطلع هالخطا
    كود PHP:
    Database error in vBulletin 3.6.7:

    Invalid SQL:

            
    SELECT 
                
    IF(votenum >= 1votenum0) AS votenum,
                IF(
    votenum >= AND votenum 0votetotal votenum0) AS voteavg,
             
    post.pagetext AS preview,
                
    thread.threadidthread.title AS threadtitlethread.forumidpollidopenreplycountpostusernamepostuseridthread.iconid AS threadiconid,
                
    thread.lastpostthread.lastposterthread.lastpostidthread.dateline, IF(views<=replycountreplycount+1views) AS viewsnotesthread.visiblestickyvotetotalthread.attach,
                
    hiddencountdeletedcount
                
    NOT ISNULL(subscribethread.subscribethreadid) AS issubscribed
                
    deletionlog.userid AS del_useriddeletionlog.username AS del_usernamedeletionlog.reason AS del_reason
                
                
    threadredirect.expires
                
            FROM thread 
    AS thread
                LEFT JOIN deletionlog 
    AS deletionlog ON(thread.threadid deletionlog.primaryid AND deletionlog.type 'thread')
                 
    LEFT JOIN subscribethread AS subscribethread ON(subscribethread.threadid thread.threadid AND subscribethread.userid 2893 AND canview 1)
                
                
    LEFT JOIN post AS post ON(post.postid thread.firstpostid)
                
                
    LEFT JOIN threadredirect AS threadredirect ON(thread.open 10 AND thread.threadid threadredirect.threadid)
                
            
    WHERE thread.threadid IN (0,3781,3835,3805,3796,3800,3788,3756,3786,3742,3746,3777,3778,3780,3768,3703,3723,3713,3731,3735,3721,) 
            
    ORDER BY sticky DESClastpost DESC;

    MySQL Error  You have an error in your SQL syntaxcheck the manual that corresponds to your MySQL server version for the right syntax to use near ') 
            ORDER BY sticky DESC, lastpost DESC' 
    at line 21
    Error Number 
    1064
    Date         
    WednesdayJune 27th 2007 06:27:12 PM
    Script       
    http:/xxxxx/vb/forumdisplay.php?f=15
    Referrer     
    http://xxxxxxx/vb/index.php
    IP Address   xxxxxxx
    Username     
    xxxxxxxxx
    Classname    
    vb_database 






    __________________


  3. #18
    عضو نشيط جدا
    تاريخ التسجيل
    Sep 2006
    المشاركات
    592


    شغال من اروع مايكون على نسخة 3.6.4 وعلى اخر نسخه 3.6.7

    بس طلعت في الاخير من القالب مو من الملف

    الله يوفقك وانا اخوك كثير اللي كانوا يسألون عن الطريقه

    اخوي Basim تأكد من تعديلك على الملف ونسخ كامل الكود اللي وضعه اخونا fnan4arab





    التعديل الأخير تم بواسطة ابن غياث ; 28-06-2007 الساعة 10:30 AM سبب آخر: اضافة تجربة اخر نسخه 3.6.7

  4. #19
    عضو نشيط
    تاريخ التسجيل
    May 2007
    المشاركات
    214


    هلا اخوي ابن غاياث هذا الملف كامل اذا كان فيه خطا ياليت تعلمني
    كود PHP:
    <?php
    /*======================================================================*\
    || #################################################################### ||
    || # vBulletin 3.6.7 PL1 - Licence Number *********
    || # ---------------------------------------------------------------- # ||
    || # Copyright ©2000-2007 Jelsoft Enterprises Ltd. All Rights Reserved. ||
    || # This file may not be redistributed in whole or significant part. # ||
    || # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
    || # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
    || #################################################################### ||
    \*======================================================================*/

    // ####################### SET PHP ENVIRONMENT ###########################
    error_reporting(E_ALL & ~E_NOTICE);

    // #################### DEFINE IMPORTANT CONSTANTS #######################
    define('THIS_SCRIPT''forumdisplay');

    // ################### PRE-CACHE TEMPLATES AND DATA ######################
    // get special phrase groups
    $phrasegroups = array('forumdisplay''inlinemod');

    // get special data templates from the datastore
    $specialtemplates = array(
        
    'iconcache',
        
    'mailqueue'
    );

    // pre-cache templates used by all actions
    $globaltemplates = array();

    // pre-cache templates used by specific actions
    $actiontemplates = array(
        
    'none' => array(
            
    'FORUMDISPLAY',
            
    'threadbit',
            
    'threadbit_deleted',
            
    'threadbit_announcement',
            
    'forumhome_lastpostby',
            
    'forumhome_forumbit_level1_post',
            
    'forumhome_forumbit_level2_post',
            
    'forumhome_forumbit_level1_nopost',
            
    'forumhome_forumbit_level2_nopost',
            
    'forumhome_subforumbit_nopost',
            
    'forumhome_subforumseparator_nopost',
            
    'forumdisplay_loggedinuser',
            
    'forumhome_moderator',
            
    'forumdisplay_moderator',
            
    'forumdisplay_sortarrow',
            
    'forumhome_subforumbit_post',
            
    'forumhome_subforumseparator_post',
            
    'forumhome_markread_script',
            
    'forumrules',
            
    'threadadmin_imod_menu_thread',
        )
    );

    // ####################### PRE-BACK-END ACTIONS ##########################
    function exec_postvar_call_back()
    {
        global 
    $vbulletin;

        
    $vbulletin->input->clean_array_gpc('r', array(
            
    'forumid'    => TYPE_STR,
        ));

        
    // jump from forumjump
        
    switch ($vbulletin->GPC['forumid'])
        {
            case 
    'search':    $goto 'search'; break;
            case 
    'pm':        $goto 'private'; break;
            case 
    'wol':        $goto 'online'; break;
            case 
    'cp':        $goto 'usercp'; break;
            case 
    'subs':    $goto 'subscription'; break;
            case 
    'home':
            case 
    '-1':        $goto $vbulletin->options['forumhome']; break;
        }

        
    // intval() forumid since having text in it is not expected anywhere else and it can't be "cleaned" a second time
        
    $vbulletin->GPC['forumid'] = intval($vbulletin->GPC['forumid']);

        if (
    $goto != '')
        {
            if (!empty(
    $vbulletin->session->vars['sessionurl_js']))
            {
                
    exec_header_redirect("$goto.php?" $vbulletin->session->vars['sessionurl_js']);
            }
            else
            {
                
    exec_header_redirect("$goto.php");
            }
        }
        
    // end forumjump redirects
    }

    // ######################### REQUIRE BACK-END ############################
    require_once('./global.php');
    require_once(
    DIR '/includes/functions_forumlist.php');
    require_once(
    DIR '/includes/functions_bigthree.php');
    require_once(
    DIR '/includes/functions_forumdisplay.php');

    // #######################################################################
    // ######################## START MAIN SCRIPT ############################
    // #######################################################################

    ($hook vBulletinHook::fetch_hook('forumdisplay_start')) ? eval($hook) : false;

    // ############################### start mark forums read ###############################
    if ($_REQUEST['do'] == 'markread')
    {
        require_once(
    DIR '/includes/functions_misc.php');
        
    $mark_read_result mark_forums_read($foruminfo['forumid']);

        
    $vbulletin->url $mark_read_result['url'];
        eval(
    print_standard_redirect($mark_read_result['phrase']));
    }

    // Don't allow access to anything below if an invalid $forumid was specified
    if (!$foruminfo['forumid'])
    {
        eval(
    standard_error(fetch_error('invalidid'$vbphrase['forum'], $vbulletin->options['contactuslink'])));
    }

    // ############################### start enter password ###############################
    if ($_REQUEST['do'] == 'doenterpwd')
    {
        
    $vbulletin->input->clean_array_gpc('r', array(
            
    'newforumpwd' => TYPE_STR,
            
    'url' => TYPE_STR,
            
    'postvars' => TYPE_STR,
        ));

        if (
    $foruminfo['password'] == $vbulletin->GPC['newforumpwd'])
        {
            
    // set a temp cookie for guests
            
    if (!$vbulletin->userinfo['userid'])
            {
                
    set_bbarray_cookie('forumpwd'$foruminfo['forumid'], md5($vbulletin->userinfo['userid'] . $vbulletin->GPC['newforumpwd']));
            }
            else
            {
                
    set_bbarray_cookie('forumpwd'$foruminfo['forumid'], md5($vbulletin->userinfo['userid'] . $vbulletin->GPC['newforumpwd']), 1);
            }

            if (
    $vbulletin->GPC['url'] == $vbulletin->options['forumhome'] . '.php')
            {
                
    $vbulletin->GPC['url'] = 'forumdisplay.php?' $vbulletin->session->vars['sessionurl'] . "f=$foruminfo[forumid]";
            }
            else if (
    $vbulletin->GPC['url'] != '' AND $vbulletin->GPC['url'] != 'forumdisplay.php')
            {
                
    $vbulletin->GPC['url'] = str_replace('"'''$vbulletin->GPC['url']);
            }
            else
            {
                
    $vbulletin->GPC['url'] = 'forumdisplay.php?' $vbulletin->session->vars['sessionurl'] . "f=$foruminfo[forumid]";
            }

            
    // Allow POST based redirection...
            
    if ($vbulletin->GPC['postvars'] != '')
            {
                if ((
    $check verify_client_string($vbulletin->GPC['postvars'])) !== false)
                {
                    
    $temp unserialize($check);
                    if (
    $temp['do'] != 'doenterpwd')
                    { 
    // ...but prevent an infinite loop
                        
    require_once(DIR '/includes/functions_misc.php');
                        
    $vbulletin->GPC['postvars'] = construct_hidden_var_fields($check);
                    }
                    else
                    {
                        
    $vbulletin->GPC['postvars'] = '';
                    }
                }
                else
                {
                    
    $vbulletin->GPC['postvars'] = '';
                }
            }

            
    // workaround IIS cookie+location header bug
            
    $forceredirect = (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== false);
            eval(
    print_standard_redirect('forumpasswordcorrect'true$forceredirect));
        }
        else
        {
            require_once(
    DIR '/includes/functions_misc.php');

            
    $vbulletin->GPC['url'] = str_replace('&''&'$vbulletin->GPC['url']);
            
    $postvars construct_post_vars_html();
            eval(
    standard_error(fetch_error('forumpasswordincorrect',
                
    $vbulletin->session->vars['sessionhash'],
                
    htmlspecialchars_uni($vbulletin->GPC['url']),
                
    $foruminfo['forumid'],
                
    $postvars,
                
    $stylevar['cellpadding'],
                
    $stylevar['cellspacing']
            )));
        }
    }

    // ###### END SPECIAL PATHS

    // These $_REQUEST values will get used in the sort template so they are assigned to normal variables
    $perpage =  $vbulletin->input->clean_gpc('r''perpage'TYPE_UINT);
    $pagenumber $vbulletin->input->clean_gpc('r''pagenumber'TYPE_UINT);
    $daysprune $vbulletin->input->clean_gpc('r''daysprune'TYPE_INT);
    $sortfield $vbulletin->input->clean_gpc('r''sortfield'TYPE_STR);

    // get permission to view forum
    $_permsgetter_ 'forumdisplay';
    $forumperms fetch_permissions($foruminfo['forumid']);
    if (!(
    $forumperms $vbulletin->bf_ugp_forumpermissions['canview']))
    {
        
    print_no_permission();
    }

    // disable thread preview if we can't view threads
    if (!($forumperms $vbulletin->bf_ugp_forumpermissions['canviewthreads']))
    {
        
    $vbulletin->options['threadpreview'] = 0;
    }

    // check if there is a forum password and if so, ensure the user has it set
    verify_forum_password($foruminfo['forumid'], $foruminfo['password']);

    // get vbulletin->iforumcache - for use by makeforumjump and forums list
    // fetch the forum even if they are invisible since its needed
    // for the title but we'll unset that further down
    // also fetch subscription info for $show['subscribed'] variable
    cache_ordered_forums(11$vbulletin->userinfo['userid']);

    $show['newthreadlink'] = iif(!$show['search_engine'] AND $foruminfo['allowposting'], truefalse);
    $show['threadicons'] = iif ($foruminfo['allowicons'], truefalse);
    $show['threadratings'] = iif ($foruminfo['allowratings'], truefalse);
    $show['subscribed_to_forum'] = ($vbulletin->forumcache["$foruminfo[forumid]"]['subscribeforumid'] != '' true false);

    if (!
    $daysprune)
    {
        if (
    $vbulletin->userinfo['daysprune'])
        {
            
    $daysprune $vbulletin->userinfo['daysprune'];
        }
        else
        {
            
    $daysprune iif($foruminfo['daysprune'], $foruminfo['daysprune'], 30);
        }
    }

    // ### GET FORUMS, PERMISSIONS, MODERATOR iCACHES ########################
    cache_moderators();

    // draw nav bar
    $navbits = array();
    $parentlist array_reverse(explode(','substr($foruminfo['parentlist'], 0, -3)));
    foreach (
    $parentlist AS $forumID)
    {
        
    $forumTitle $vbulletin->forumcache["$forumID"]['title'];
        
    $navbits['forumdisplay.php?' $vbulletin->session->vars['sessionurl'] . "f=$forumID"] = $forumTitle;
    }

    // pop the last element off the end of the $nav array so that we can show it without a link
    array_pop($navbits);

    $navbits[''] = $foruminfo['title'];
    $navbits construct_navbits($navbits);
    eval(
    '$navbar = "' fetch_template('navbar') . '";');

    $moderatorslist '';
    $listexploded explode(','$foruminfo['parentlist']);
    $showmods = array();
    $show['moderators'] = false;
    $totalmods 0;
    foreach (
    $listexploded AS $parentforumid)
    {
        if (!
    $imodcache["$parentforumid"] OR $parentforumid == -1)
        {
            continue;
        }
        foreach (
    $imodcache["$parentforumid"] AS $moderator)
        {
            if (
    $showmods["$moderator[userid]"] === true)
            {
                continue;
            }

            (
    $hook vBulletinHook::fetch_hook('forumdisplay_moderator')) ? eval($hook) : false;

            
    $showmods["$moderator[userid]"] = true;
            if (
    $moderatorslist == '')
            {
                
    $show['moderators'] = true;
                eval(
    '$moderatorslist = "' fetch_template('forumdisplay_moderator') . '";');
            }
            else
            {
                eval(
    '$moderatorslist .= ", ' fetch_template('forumdisplay_moderator') . '";');
            }
            
    $totalmods++;
        }
    }

    // ### BUILD FORUMS LIST #################################################

    // get an array of child forum ids for this forum
    $foruminfo['childlist'] = explode(','$foruminfo['childlist']);

    $comma '';

    // define max depth for forums display based on $vbulletin->options[forumhomedepth]
    define('MAXFORUMDEPTH'$vbulletin->options['forumdisplaydepth']);

    if ((
    $vbulletin->options['showforumusers'] == OR $vbulletin->options['showforumusers'] == OR ($vbulletin->options['showforumusers'] > AND $vbulletin->userinfo['userid'])) AND !$show['search_engine'])
    {
        
    $datecut TIMENOW $vbulletin->options['cookietimeout'];
        
    $forumusers $db->query_read_slave("
            SELECT user.username, (user.options & " 
    $vbulletin->bf_misc_useroptions['invisible'] . ") AS invisible, user.usergroupid, session.userid, session.inforum, session.lastactivity,
                IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, infractiongroupid
            FROM " 
    TABLE_PREFIX "session AS session
            LEFT JOIN " 
    TABLE_PREFIX "user AS user ON(user.userid = session.userid)
            WHERE session.lastactivity > 
    $datecut
            ORDER BY" 
    iif($vbulletin->options['showforumusers'] == OR $vbulletin->options['showforumusers'] == 3" username ASC,") . " lastactivity DESC
        "
    );

        
    $numberregistered 0;
        
    $numberguest 0;
        
    $doneuser = array();

        if (
    $vbulletin->userinfo['userid'])
        {
            
    // fakes the user being in this forum
            
    $loggedin = array(
                
    'userid'        => $vbulletin->userinfo['userid'],
                
    'username'      => $vbulletin->userinfo['username'],
                
    'invisible'     => $vbulletin->userinfo['invisible'],
                
    'invisiblemark' => $vbulletin->userinfo['invisiblemark'],
                
    'inforum'       => $foruminfo['forumid'],
                
    'lastactivity'  => TIMENOW,
                
    'musername'     => $vbulletin->userinfo['musername'],
            );
            
    $numberregistered 1;
            
    fetch_online_status($loggedin);

            (
    $hook vBulletinHook::fetch_hook('forumdisplay_loggedinuser')) ? eval($hook) : false;

            eval(
    '$activeusers = "' fetch_template('forumdisplay_loggedinuser') . '";');
            
    $doneuser["{$vbulletin->userinfo['userid']}"] = 1;
            
    $comma ', ';
        }

        
    $inforum = array();

        
    // this require the query to have lastactivity ordered by DESC so that the latest location will be the first encountered.
        
    while ($loggedin $db->fetch_array($forumusers))
        {
            if (empty(
    $doneuser["$loggedin[userid]"]))
            {
                if (
    in_array($loggedin['inforum'], $foruminfo['childlist']) AND $loggedin['inforum'] != -1)
                {
                    if (!
    $loggedin['userid'])
                    {
                        
    // this is a guest
                        
    $numberguest++;
                        
    $inforum["$loggedin[inforum]"]++;
                    }
                    else
                    {
                        
    $numberregistered++;
                        
    $inforum["$loggedin[inforum]"]++;

                        (
    $hook vBulletinHook::fetch_hook('forumdisplay_loggedinuser')) ? eval($hook) : false;

                        if (
    fetch_online_status($loggedin))
                        {
                            
    fetch_musername($loggedin);
                            eval(
    '$activeusers .= "' $comma fetch_template('forumdisplay_loggedinuser') . '";');
                            
    $comma ', ';
                        }
                    }
                }
                if (
    $loggedin['userid'])
                {
                    
    $doneuser["$loggedin[userid]"] = 1;
                }
            }
        }

        if (!
    $vbulletin->userinfo['userid'])
        {
            
    $numberguest = ($numberguest == 0) ? $numberguest;
        }
        
    $totalonline $numberregistered $numberguest;
        unset(
    $joingroupid$key$datecut $comma$invisibleuser$userinfo$userid$loggedin$index$value$forumusers$parentarray );

        
    $show['activeusers'] = true;
    }
    else
    {
        
    $show['activeusers'] = false;
    }

    // #############################################################################
    // get read status for this forum and children
    $unreadchildforums 0;
    foreach (
    $foruminfo['childlist'] AS $val)
    {
        if (
    $val == -OR $val == $foruminfo['forumid'])
        {
            continue;
        }

        if (
    $vbulletin->options['threadmarking'] AND $vbulletin->userinfo['userid'])
        {
            
    $lastread_child max($vbulletin->forumcache["$val"]['forumread'], TIMENOW - ($vbulletin->options['markinglimit'] * 86400));
        }
        else
        {
            
    $lastread_child max(intval(fetch_bbarray_cookie('forum_view'$val)), $vbulletin->userinfo['lastvisit']);
        }

        if (
    $vbulletin->forumcache["$val"]['lastpost'] > $lastread_child)
        {
            
    $unreadchildforums 1;
            break;
        }
    }

    $forumbits construct_forum_bit($foruminfo['forumid']);

    // admin tools
    $show['adminoptions'] = can_moderate($foruminfo['forumid']);
    $show['post_new_announcement'] = can_moderate($foruminfo['forumid'], 'canannounce');
    $show['addmoderator'] = ($permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel']);

    $curforumid $foruminfo['forumid'];
    construct_forum_jump();

    /////////////////////////////////
    if ($foruminfo['cancontainthreads'])
    {
        
    /////////////////////////////////
        
    if ($vbulletin->options['threadmarking'] AND $vbulletin->userinfo['userid'])
        {
            
    $foruminfo['forumread'] = $vbulletin->forumcache["$foruminfo[forumid]"]['forumread'];
            
    $lastread max($foruminfo['forumread'], TIMENOW - ($vbulletin->options['markinglimit'] * 86400));
        }
        else
        {
            
    $bbforumview intval(fetch_bbarray_cookie('forum_view'$foruminfo['forumid']));
            
    $lastread max($bbforumview$vbulletin->userinfo['lastvisit']);
        }

        
    // Inline Moderation
        
    $show['movethread'] = (can_moderate($forumid'canmanagethreads')) ? true false;
        
    $show['deletethread'] = (can_moderate($forumid'candeleteposts') OR can_moderate($forumid'canremoveposts')) ? true false;
        
    $show['approvethread'] = (can_moderate($forumid'canmoderateposts')) ? true false;
        
    $show['openthread'] = (can_moderate($forumid'canopenclose')) ? true false;
        
    $show['inlinemod'] = ($show['movethread'] OR $show['deletethread'] OR $show['approvethread'] OR $show['openthread']) ? true false;
        
    $url $show['inlinemod'] ? SCRIPTPATH '';

        
    // fetch popup menu
        
    if ($show['popups'] AND $show['inlinemod'])
        {
            eval(
    '$threadadmin_imod_menu_thread = "' fetch_template('threadadmin_imod_menu_thread') . '";');
        }
        else
        {
            
    $threadadmin_imod_thread_menu '';
        }

        
    // get announcements

        
    $announcebits '';
        if (
    $show['threadicons'] AND $show['inlinemod'])
        {
            
    $announcecolspan 6;
        }
        else if (!
    $show['threadicons'] AND !$show['inlinemod'])
        {
            
    $announcecolspan 4;
        }
        else
        {
            
    $announcecolspan 5;
        }

        
    $mindate TIMENOW 2592000// 30 days

        
    $announcements $db->query_read_slave("
            SELECT
                announcement.announcementid, startdate, title, announcement.views,
                user.username, user.userid, user.usertitle, user.customtitle, user.usergroupid,
                IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, infractiongroupid
                " 
    . (($vbulletin->userinfo['userid']) ? ", NOT ISNULL(announcementread.announcementid) AS readannounce" "") . "
            FROM " 
    TABLE_PREFIX "announcement AS announcement
            " 
    . (($vbulletin->userinfo['userid']) ? "LEFT JOIN " TABLE_PREFIX "announcementread AS announcementread ON (announcementread.announcementid = announcement.announcementid AND announcementread.userid = " $vbulletin->userinfo['userid'] . ")" "") . "
            LEFT JOIN " 
    TABLE_PREFIX "user AS user ON(user.userid = announcement.userid)
            WHERE startdate <= " 
    TIMENOW "
                AND enddate >= " 
    TIMENOW "
                AND " 
    fetch_forum_clause_sql($foruminfo['forumid'], 'forumid') . "
            ORDER BY startdate DESC, announcement.announcementid DESC
            " 
    iif($vbulletin->options['oneannounce'], "LIMIT 1"));

        while (
    $announcement $db->fetch_array($announcements))
        {
            
    fetch_musername($announcement);
            
    $announcement['postdate'] = vbdate($vbulletin->options['dateformat'], $announcement['startdate']);
            if (
    $announcement['readannounce'] OR $announcement['startdate'] <= $mindate)
            {
                
    $announcement['statusicon'] = 'old';
            }
            else
            {
                
    $announcement['statusicon'] = 'new';
            }
            
    $announcement['views'] = vb_number_format($announcement['views']);
            
    $announcementidlink iif(!$vbulletin->options['oneannounce'] , "&a=$announcement[announcementid]");

            (
    $hook vBulletinHook::fetch_hook('forumdisplay_announcement')) ? eval($hook) : false;

            eval(
    '$announcebits .= "' fetch_template('threadbit_announcement') . '";');
        }

        
    // display threads
        
    if (!($forumperms $vbulletin->bf_ugp_forumpermissions['canviewothers']))
        {
            
    $limitothers "AND postuserid = " $vbulletin->userinfo['userid'] . " AND " $vbulletin->userinfo['userid'] . " <> 0";
        }
        else
        {
            
    $limitothers '';
        }

        if (
    can_moderate($foruminfo['forumid']))
        {
            
    $redirectjoin "LEFT JOIN " TABLE_PREFIX "threadredirect AS threadredirect ON(thread.open = 10 AND thread.threadid = threadredirect.threadid)";
        }
        else
        {
            
    $redirectjoin '';
        }

        
    // filter out deletion notices if can't be seen
        
    if ($forumperms $vbulletin->bf_ugp_forumpermissions['canseedelnotice'] OR can_moderate($foruminfo['forumid']))
        {
            
    $canseedelnotice true;
            
    $deljoin "LEFT JOIN " TABLE_PREFIX "deletionlog AS deletionlog ON(thread.threadid = deletionlog.primaryid AND deletionlog.type = 'thread')";
        }
        else
        {
            
    $canseedelnotice false;
            
    $deljoin '';
        }

        
    // remove threads from users on the global ignore list if user is not a moderator
        
    if ($Coventry fetch_coventry('string') AND !can_moderate($foruminfo['forumid']))
        {
            
    $globalignore "AND postuserid NOT IN ($Coventry) ";
        }
        else
        {
            
    $globalignore '';
        }

        
    // look at thread limiting options
        
    $stickyids '';
        
    $stickycount 0;
        if (
    $daysprune != -1)
        {
            if (
    $vbulletin->userinfo['userid'] AND in_coventry($vbulletin->userinfo['userid'], true))
            {
                
    $tachyjoin "LEFT JOIN " TABLE_PREFIX "tachythreadpost AS tachythreadpost ON " .
                    
    "(tachythreadpost.threadid = thread.threadid AND tachythreadpost.userid = " $vbulletin->userinfo['userid'] . ")";
                
    $datecut " AND (thread.lastpost >= " . (TIMENOW - ($daysprune 86400)) . " OR tachythreadpost.lastpost >= " . (TIMENOW - ($daysprune 86400)) . ")";
            }
            else
            {
                
    $datecut "AND lastpost >= " . (TIMENOW - ($daysprune 86400));
                
    $tachyjoin "";
            }
            
    $show['noposts'] = false;
        }
        else
        {
            
    $tachyjoin "";
            
    $datecut "";
            
    $show['noposts'] = true;
        }

        
    // complete form fields on page
        
    $daysprunesel iif($daysprune == -1'all'$daysprune);
        
    $daysprunesel = array($daysprunesel => 'selected="selected"');

        
    $vbulletin->input->clean_array_gpc('r', array(
            
    'sortorder' => TYPE_NOHTML,
        ));

        
    // default sorting methods
        
    if (empty($sortfield))
        {
            
    $sortfield $foruminfo['defaultsortfield'];
        }
        if (empty(
    $vbulletin->GPC['sortorder']))
        {
            
    $vbulletin->GPC['sortorder'] = $foruminfo['defaultsortorder'];
        }

        
    // look at sorting options:
        
    if ($vbulletin->GPC['sortorder'] != 'asc')
        {
            
    $sqlsortorder 'DESC';
            
    $order = array('desc' => 'selected="selected"');
            
    $vbulletin->GPC['sortorder'] = 'desc';
        }
        else
        {
            
    $sqlsortorder '';
            
    $order = array('asc' => 'selected="selected"');
        }

        switch (
    $sortfield)
        {
            case 
    'title':
                
    $sqlsortfield 'thread.title';
                break;
            case 
    'lastpost':
                
    $sqlsortfield 'lastpost';
                break;
            case 
    'replycount':
            case 
    'views':
            case 
    'postusername':
                
    $sqlsortfield $sortfield;
                break;
            case 
    'voteavg':
                if (
    $foruminfo['allowratings'])
                {
                    
    $sqlsortfield 'voteavg';
                    break;
                }
            case 
    'dateline':
                
    $sqlsortfield 'thread.dateline';
                break;
            
    // else, use last post
            
    default:
                
    $handled false;
                (
    $hook vBulletinHook::fetch_hook('forumdisplay_sort')) ? eval($hook) : false;
                if (!
    $handled)
                {
                    
    $sqlsortfield 'lastpost';
                    
    $sortfield 'lastpost';
                }
        }
        
    $sort = array($sortfield => 'selected="selected"');

        if (!
    can_moderate($forumid'canmoderateposts'))
        {
            if (!(
    $forumperms $vbulletin->bf_ugp_forumpermissions['canseedelnotice']))
            {
                
    $visiblethreads " AND visible = 1 ";
            }
            else
            {
                
    $visiblethreads " AND visible IN (1,2)";
            }
        }
        else
        {
            
    $visiblethreads " AND visible IN (0,1,2)";
        }

        
    $hook_query_fields $hook_query_joins $hook_query_where '';
        (
    $hook vBulletinHook::fetch_hook('forumdisplay_query_threadscount')) ? eval($hook) : false;

        
    # Include visible IN (0,1,2) in order to hit upon the 4 column index
        
    $threadscount $db->query_first_slave("
            SELECT COUNT(*) AS threads, SUM(IF(thread.lastpost > 
    $lastread AND open <> 10, 1, 0)) AS newthread
            
    $hook_query_fields
            FROM " 
    TABLE_PREFIX "thread AS thread
            
    $tachyjoin
            
    $hook_query_joins
            WHERE forumid = 
    $foruminfo[forumid]
                AND sticky = 0
                
    $visiblethreads
                
    $globalignore
                
    $limitothers
                
    $datecut
                
    $hook_query_where
        "
    );
        
    $totalthreads $threadscount['threads'];
        
    $newthreads $threadscount['newthread'];

        
    // set defaults
        
    sanitize_pageresults($totalthreads$pagenumber$perpage200$vbulletin->options['maxthreads']);

        
    // get number of sticky threads for the first page
        // on the first page there will be the sticky threads PLUS the $perpage other normal threads
        // not quite a bug, but a deliberate feature!
        
    if ($pagenumber == OR $vbulletin->options['showstickies'])
        {

            
    // Fnan4arab : SubThread
            // هاك مواضيع الأقسام الفرعية
            
    $getparent_id '';
            
    $getparentid $db->query_read("SELECT * FROM " TABLE_PREFIX "forum WHERE parentid='" $foruminfo[forumid] . "'");
            
            while (
    $getparentids $db->fetch_array($getparentid)) {
                
                
    $getparent_id .= ',' $getparentids[forumid];
                
            }
            
    // End SubThread
            
            
    $stickies $db->query_read_slave("
                SELECT thread.threadid, lastpost, open
                FROM " 
    TABLE_PREFIX "thread AS thread
                WHERE forumid IN (" 
    $foruminfo[forumid] . $getparent_id ")
                    AND sticky = 1
                    
    $visiblethreads
                    
    $limitothers
                    
    $globalignore
            "
    );
            
    // End SubThread        while ($thissticky = $db->fetch_array($stickies))
            
    {
                
    $stickycount++;
                if (
    $thissticky['lastpost'] >= $lastread AND $thissticky['open'] <> 10)
                {
                    
    $newthreads++;
                }
                
    $stickyids .= ",$thissticky[threadid]";
            }
            
    $db->free_result($stickies);
            unset(
    $thissticky$stickies);
        }


        
    $limitlower = ($pagenumber 1) * $perpage;
        
    $limitupper = ($pagenumber) * $perpage;

        if (
    $limitupper $totalthreads)
        {
            
    $limitupper $totalthreads;
            if (
    $limitlower $totalthreads)
            {
                
    $limitlower = ($totalthreads $perpage) - 1;
            }
        }
        if (
    $limitlower 0)
        {
            
    $limitlower 0;
        }

        if (
    $foruminfo['allowratings'])
        {
            
    $vbulletin->options['showvotes'] = intval($vbulletin->options['showvotes']);
            
    $votequery "
                IF(votenum >= " 
    $vbulletin->options['showvotes'] . ", votenum, 0) AS votenum,
                IF(votenum >= " 
    $vbulletin->options['showvotes'] . " AND votenum > 0, votetotal / votenum, 0) AS voteavg,
            "
    ;
        }
        else
        {
            
    $votequery '';
        }

        if (
    $vbulletin->options['threadpreview'] > 0)
        {
            
    $previewfield "post.pagetext AS preview,";
            
    $previewjoin "LEFT JOIN " TABLE_PREFIX "post AS post ON(post.postid = thread.firstpostid)";
        }
        else
        {
            
    $previewfield '';
            
    $previewjoin '';
        }

        if (
    $vbulletin->userinfo['userid'] AND in_coventry($vbulletin->userinfo['userid'], true))
        {
            
    $lastpost_info1 ",IF(tachythreadpost.userid IS NULL, thread.lastpost, tachythreadpost.lastpost) AS lastpost";
            
    $lastpost_info2 "IF(tachythreadpost.userid IS NULL, thread.lastpost, tachythreadpost.lastpost) AS lastpost, " .
                
    "IF(tachythreadpost.userid IS NULL, thread.lastposter, tachythreadpost.lastposter) AS lastposter, " .
                
    "IF(tachythreadpost.userid IS NULL, thread.lastpostid, tachythreadpost.lastpostid) AS lastpostid";

            
    $tachyjoin "LEFT JOIN " TABLE_PREFIX "tachythreadpost AS tachythreadpost ON " .
                
    "(tachythreadpost.threadid = thread.threadid AND tachythreadpost.userid = " $vbulletin->userinfo['userid'] . ')';
        }
        else
        {
            
    $lastpost_info1 "";
            
    $lastpost_info2 "thread.lastpost, thread.lastposter, thread.lastpostid";
            
    $tachyjoin "";
        }

        
    $hook_query_fields $hook_query_joins $hook_query_where '';
        (
    $hook vBulletinHook::fetch_hook('forumdisplay_query_threadid')) ? eval($hook) : false;


        
    // Fnan4arab : SubThread
        // هاك مواضيع الأقسام الفرعية
        
    $getparent_id '';
        
    $getparentid $db->query_read("SELECT * FROM " TABLE_PREFIX "forum WHERE parentid='" $foruminfo[forumid] . "'");
        while (
    $getparentids $db->fetch_array($getparentid)) {
        
    $getparent_id .= ',' $getparentids[forumid];
        }
        
        
    $getthreadids $db->query_read_slave("
            SELECT " 
    iif($sortfield == 'voteavg'$votequery) . " thread.threadid
                
    $lastpost_info1
                
    $hook_query_fields
            FROM " 
    TABLE_PREFIX "thread AS thread
            
    $tachyjoin
            
    $hook_query_joins
            WHERE forumid IN (" 
    $foruminfo[forumid] . $getparent_id ")
                AND sticky = 0
                
    $visiblethreads
                
    $globalignore
                
    $limitothers
                
    $datecut
                
    $hook_query_where
            ORDER BY sticky DESC, 
    $sqlsortfield $sqlsortorder
            LIMIT 
    $limitlower$perpage
        "
    );
        
    // End SubThread
        
    $ids '';
        while (
    $thread $db->fetch_array($getthreadids))
        {
            
    $ids .= ',' $thread['threadid'];
        }

        
    $ids .= $stickyids;

        
    $db->free_result($getthreadids);
        unset (
    $thread$getthreadids);

        
    $hook_query_fields $hook_query_joins $hook_query_where '';
        (
    $hook vBulletinHook::fetch_hook('forumdisplay_query')) ? eval($hook) : false;

        
    $threads $db->query_read_slave("
            SELECT 
    $votequery $previewfield
                thread.threadid, thread.title AS threadtitle, thread.forumid, pollid, open, replycount, postusername, postuserid, thread.iconid AS threadiconid,
                
    $lastpost_info2, thread.dateline, IF(views<=replycount, replycount+1, views) AS views, notes, thread.visible, sticky, votetotal, thread.attach,
                hiddencount, deletedcount
                " 
    . (($vbulletin->options['threadsubscribed'] AND $vbulletin->userinfo['userid']) ? ", NOT ISNULL(subscribethread.subscribethreadid) AS issubscribed" "") . "
                " 
    . ($deljoin ", deletionlog.userid AS del_userid, deletionlog.username AS del_username, deletionlog.reason AS del_reason" "") . "
                " 
    . (($vbulletin->options['threadmarking'] AND $vbulletin->userinfo['userid']) ? ", threadread.readtime AS threadread" "") . "
                " 
    . ($redirectjoin ", threadredirect.expires" "") . "
                
    $hook_query_fields
            FROM " 
    TABLE_PREFIX "thread AS thread
                
    $deljoin
                " 
    . (($vbulletin->options['threadsubscribed'] AND $vbulletin->userinfo['userid']) ?  " LEFT JOIN " TABLE_PREFIX "subscribethread AS subscribethread ON(subscribethread.threadid = thread.threadid AND subscribethread.userid = " $vbulletin->userinfo['userid'] . " AND canview = 1)" "") . "
                " 
    . (($vbulletin->options['threadmarking'] AND $vbulletin->userinfo['userid']) ? " LEFT JOIN " TABLE_PREFIX "threadread AS threadread ON (threadread.threadid = thread.threadid AND threadread.userid = " $vbulletin->userinfo['userid'] . ")" "") . "
                
    $previewjoin
                
    $tachyjoin
                
    $redirectjoin
                
    $hook_query_joins
            WHERE thread.threadid IN (0
    $ids$hook_query_where
            ORDER BY sticky DESC, 
    $sqlsortfield $sqlsortorder
        "
    );
        unset(
    $limitothers$delthreadlimit$deljoin$datecut$votequery$sqlsortfield$sqlsortorder$threadids);

        
    // Get Dot Threads
        
    $dotthreads fetch_dot_threads_array($ids);
        if (
    $vbulletin->options['showdots'] AND $vbulletin->userinfo['userid'])
        {
            
    $show['dotthreads'] = true;
        }
        else
        {
            
    $show['dotthreads'] = false;
        }

        unset(
    $ids);

        
    // prepare sort things for column header row:
        
    $sorturl 'forumdisplay.php?' $vbulletin->session->vars['sessionurl'] . "f=$forumid&daysprune=$daysprune";
        
    $oppositesort iif($vbulletin->GPC['sortorder'] == 'asc''desc''asc');

        if (
    $totalthreads OR $stickyids)
        {
            if (
    $totalthreads 0)
            {
                
    $limitlower++;
            }
            
    // check to see if there are any threads to display. If there are, do so, otherwise, show message

            
    if ($vbulletin->options['threadpreview'] > 0)
            {
                
    // Get Buddy List
                
    $buddy = array();
                if (
    trim($vbulletin->userinfo['buddylist']))
                {
                    
    $buddylist preg_split('/( )+/'trim($vbulletin->userinfo['buddylist']), -1PREG_SPLIT_NO_EMPTY);
                    foreach (
    $buddylist AS $buddyuserid)
                    {
                        
    $buddy["$buddyuserid"] = 1;
                    }
                }
                
    DEVDEBUG('buddies: ' implode(', 'array_keys($buddy)));
                
    // Get Ignore Users
                
    $ignore = array();
                if (
    trim($vbulletin->userinfo['ignorelist']))
                {
                    
    $ignorelist preg_split('/( )+/'trim($vbulletin->userinfo['ignorelist']), -1PREG_SPLIT_NO_EMPTY);
                    foreach (
    $ignorelist AS $ignoreuserid)
                    {
                        if (!
    $buddy["$ignoreuserid"])
                        {
                            
    $ignore["$ignoreuserid"] = 1;
                        }
                    }
                }
                
    DEVDEBUG('ignored users: ' implode(', 'array_keys($ignore)));
            }

            
    $show['threads'] = true;
            
    $threadbits '';
            
    $threadbits_sticky '';

            
    $counter 0;
            
    $toread 0;

            while (
    $thread $db->fetch_array($threads))
            { 
    // AND $counter++ < $perpage)

                // build thread data
                
    $thread process_thread_array($thread$lastread$foruminfo['allowicons']);
                
    $realthreadid $thread['realthreadid'];

                if (
    $thread['sticky'])
                {
                    
    $threadbit =& $threadbits_sticky;
                }
                else
                {
                    
    $threadbit =& $threadbits;
                }

                (
    $hook vBulletinHook::fetch_hook('threadbit_display')) ? eval($hook) : false;

                
    // Soft Deleted Thread
                
    if ($thread['visible'] == 2)
                {
                    
    $thread['deletedcount']++;
                    
    $show['threadtitle'] = (can_moderate($forumid) OR ($vbulletin->userinfo['userid'] != AND $vbulletin->userinfo['userid'] == $thread['postuserid'])) ? true false;
                    
    $show['deletereason'] = (!empty($thread['del_reason'])) ?  true false;
                    
    $show['viewthread'] = (can_moderate($forumid)) ? true false;
                    
    $show['managethread'] = (can_moderate($forumid'candeleteposts') OR can_moderate($forumid'canremoveposts')) ? true false;
                    
    $show['moderated'] = ($thread['hiddencount'] > AND can_moderate($forumid'canmoderateposts')) ? true false;
                    
    $show['deletedthread'] = $canseedelnotice;
                    eval(
    '$threadbit .= "' fetch_template('threadbit_deleted') . '";');
                }
                else
                {
                    if (!
    $thread['visible'])
                    {
                        
    $thread['hiddencount']++;
                    }
                    
    $show['moderated'] = ($thread['hiddencount'] > AND can_moderate($forumid'canmoderateposts')) ? true false;
                    
    $show['deletedthread'] = ($thread['deletedcount'] > AND $canseedelnotice) ? true false;
                    eval(
    '$threadbit .= "' fetch_template('threadbit') . '";');
                }
            }
            
    $db->free_result($threads);
            unset(
    $thread$counter);

            
    $pagenav construct_page_nav($pagenumber$perpage$totalthreads'forumdisplay.php?' $vbulletin->session->vars['sessionurl'] . "f=$forumid"""
                
    . (!empty($vbulletin->GPC['perpage']) ? "&pp=$perpage"")
                . (!empty(
    $vbulletin->GPC['sortfield']) ? "&sort=$sortfield"")
                . (!empty(
    $vbulletin->GPC['sortorder']) ? "&order=" $vbulletin->GPC['sortorder'] : "")
                . (!empty(
    $vbulletin->GPC['daysprune']) ? "&daysprune=$daysprune"")
            );

            eval(
    '$sortarrow[' $sortfield '] = "' fetch_template('forumdisplay_sortarrow') . '";');
        }
        unset(
    $threads$dotthreads);

        
    // get colspan for bottom bar
        
    $foruminfo['bottomcolspan'] = 6;
        if (
    $foruminfo['allowicons'])
        {
            
    $foruminfo['bottomcolspan']++;
        }
        if (
    $foruminfo['allowratings'])
        {
            
    $foruminfo['bottomcolspan']++;
        }

        
    $show['threadslist'] = true;

        
    /////////////////////////////////
    // end forum can contain threads
    else
    {
        
    $show['threadslist'] = false;
    }
    /////////////////////////////////

    if ($newthreads AND $unreadchildforums 1)
    {
        
    mark_forum_read($foruminfo$vbulletin->userinfo['userid'], TIMENOW);
    }

    eval(
    '$forumhome_markread_script = "' fetch_template('forumhome_markread_script') . '";');

    construct_forum_rules($foruminfo$forumperms);

    $show['forumsearch'] = iif (!$show['search_engine'] AND $forumperms $vbulletin->bf_ugp_forumpermissions['cansearch'] AND $vbulletin->options['enablesearches'], truefalse);
    $show['forumslist'] = iif ($forumshowntruefalse);
    $show['stickies'] = iif ($threadbits_sticky != ''truefalse);

    (
    $hook vBulletinHook::fetch_hook('forumdisplay_complete')) ? eval($hook) : false;

    eval(
    'print_output("' fetch_template('FORUMDISPLAY') . '");');


    /*======================================================================*\
    || ####################################################################
    || # Downloaded: 15:12, Wed Jun 27th 2007
    || # CVS: $RCSfile$ - $Revision: 16928 $
    || ####################################################################
    \*======================================================================*/
    ?>






    __________________


  5. #20
    عضو نشيط جدا
    تاريخ التسجيل
    Sep 2006
    المشاركات
    592


    المشكله عندك من تعديلك على الملف

    اذا كان فيه برنامج لتحرير ملفات الـ php

    شوف الخطا في سطر 721

    كود PHP:
     // End SubThread        while ($thissticky = $db->fetch_array($stickies)) 
    والمفروض تكون بالطريقه هذي

    كود PHP:
           // End SubThread   
                 
    while ($thissticky $db->fetch_array($stickies)) 
    احذف كود الملف من ردك اللي من شوي

    تحياتي لك






  6. #21
    عضو نشيط
    تاريخ التسجيل
    May 2007
    المشاركات
    214


    يعطيك العافية وبيض الله وجهك ضبظطت بس موبكل الاقسام وبعضها يطلع هالخطا
    لم يكن بالإمكان تسجيل الكوكيز .
    الملف : $filename
    السطر : $linenum





    __________________


  7. #22
    عضو نشيط جدا
    تاريخ التسجيل
    Sep 2006
    المشاركات
    592


    كانت التجربه على السيرفر الشخصي واللحين على منتدى قائم بأعضائه

    لاحظ عنوانين المواضيع في دورة التعامل مع اج نيوك كلها في قسم تطوير المواقع

    http://www.ssdaa.com/vb/forumdisplay.php?f=26

    حتى تطمن اخوي ان الهاك شغال تمام

    افضل حل لك تجيب ملف نضيف لنسخة منتداك وتسوي التعديلات من جديد عليه

    والافضل طبعا بأي برنامج لتحرير ملفات php






  8. #23
    عضو نشيط
    تاريخ التسجيل
    May 2007
    المشاركات
    214


    لا اخوي اش دعوى ماكذبتك داري انه مظبوط عندك بس فعلا واجهتني المشكلة اللي حطيتها لك
    وهذا الملف اللي استخدمته هل فيه خطا؟
    كود PHP:
     <?php
    /*======================================================================*\
    || #################################################################### ||
    || # vBulletin 3.6.7 PL1 - Licence Number ****************
    || # ---------------------------------------------------------------- # ||
    || # Copyright ©2000-2007 Jelsoft Enterprises Ltd. All Rights Reserved. ||
    || # This file may not be redistributed in whole or significant part. # ||
    || # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
    || # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
    || #################################################################### ||
    \*======================================================================*/

    // ####################### SET PHP ENVIRONMENT ###########################
    error_reporting(E_ALL & ~E_NOTICE);

    // #################### DEFINE IMPORTANT CONSTANTS #######################
    define('THIS_SCRIPT''forumdisplay');

    // ################### PRE-CACHE TEMPLATES AND DATA ######################
    // get special phrase groups
    $phrasegroups = array('forumdisplay''inlinemod');

    // get special data templates from the datastore
    $specialtemplates = array(
        
    'iconcache',
        
    'mailqueue'
    );

    // pre-cache templates used by all actions
    $globaltemplates = array();

    // pre-cache templates used by specific actions
    $actiontemplates = array(
        
    'none' => array(
            
    'FORUMDISPLAY',
            
    'threadbit',
            
    'threadbit_deleted',
            
    'threadbit_announcement',
            
    'forumhome_lastpostby',
            
    'forumhome_forumbit_level1_post',
            
    'forumhome_forumbit_level2_post',
            
    'forumhome_forumbit_level1_nopost',
            
    'forumhome_forumbit_level2_nopost',
            
    'forumhome_subforumbit_nopost',
            
    'forumhome_subforumseparator_nopost',
            
    'forumdisplay_loggedinuser',
            
    'forumhome_moderator',
            
    'forumdisplay_moderator',
            
    'forumdisplay_sortarrow',
            
    'forumhome_subforumbit_post',
            
    'forumhome_subforumseparator_post',
            
    'forumhome_markread_script',
            
    'forumrules',
            
    'threadadmin_imod_menu_thread',
        )
    );

    // ####################### PRE-BACK-END ACTIONS ##########################
    function exec_postvar_call_back()
    {
        global 
    $vbulletin;

        
    $vbulletin->input->clean_array_gpc('r', array(
            
    'forumid'    => TYPE_STR,
        ));

        
    // jump from forumjump
        
    switch ($vbulletin->GPC['forumid'])
        {
            case 
    'search':    $goto 'search'; break;
            case 
    'pm':        $goto 'private'; break;
            case 
    'wol':        $goto 'online'; break;
            case 
    'cp':        $goto 'usercp'; break;
            case 
    'subs':    $goto 'subscription'; break;
            case 
    'home':
            case 
    '-1':        $goto $vbulletin->options['forumhome']; break;
        }

        
    // intval() forumid since having text in it is not expected anywhere else and it can't be "cleaned" a second time
        
    $vbulletin->GPC['forumid'] = intval($vbulletin->GPC['forumid']);

        if (
    $goto != '')
        {
            if (!empty(
    $vbulletin->session->vars['sessionurl_js']))
            {
                
    exec_header_redirect("$goto.php?" $vbulletin->session->vars['sessionurl_js']);
            }
            else
            {
                
    exec_header_redirect("$goto.php");
            }
        }
        
    // end forumjump redirects
    }

    // ######################### REQUIRE BACK-END ############################
    require_once('./global.php');
    require_once(
    DIR '/includes/functions_forumlist.php');
    require_once(
    DIR '/includes/functions_bigthree.php');
    require_once(
    DIR '/includes/functions_forumdisplay.php');

    // #######################################################################
    // ######################## START MAIN SCRIPT ############################
    // #######################################################################

    ($hook vBulletinHook::fetch_hook('forumdisplay_start')) ? eval($hook) : false;

    // ############################### start mark forums read ###############################
    if ($_REQUEST['do'] == 'markread')
    {
        require_once(
    DIR '/includes/functions_misc.php');
        
    $mark_read_result mark_forums_read($foruminfo['forumid']);

        
    $vbulletin->url $mark_read_result['url'];
        eval(
    print_standard_redirect($mark_read_result['phrase']));
    }

    // Don't allow access to anything below if an invalid $forumid was specified
    if (!$foruminfo['forumid'])
    {
        eval(
    standard_error(fetch_error('invalidid'$vbphrase['forum'], $vbulletin->options['contactuslink'])));
    }

    // ############################### start enter password ###############################
    if ($_REQUEST['do'] == 'doenterpwd')
    {
        
    $vbulletin->input->clean_array_gpc('r', array(
            
    'newforumpwd' => TYPE_STR,
            
    'url' => TYPE_STR,
            
    'postvars' => TYPE_STR,
        ));

        if (
    $foruminfo['password'] == $vbulletin->GPC['newforumpwd'])
        {
            
    // set a temp cookie for guests
            
    if (!$vbulletin->userinfo['userid'])
            {
                
    set_bbarray_cookie('forumpwd'$foruminfo['forumid'], md5($vbulletin->userinfo['userid'] . $vbulletin->GPC['newforumpwd']));
            }
            else
            {
                
    set_bbarray_cookie('forumpwd'$foruminfo['forumid'], md5($vbulletin->userinfo['userid'] . $vbulletin->GPC['newforumpwd']), 1);
            }

            if (
    $vbulletin->GPC['url'] == $vbulletin->options['forumhome'] . '.php')
            {
                
    $vbulletin->GPC['url'] = 'forumdisplay.php?' $vbulletin->session->vars['sessionurl'] . "f=$foruminfo[forumid]";
            }
            else if (
    $vbulletin->GPC['url'] != '' AND $vbulletin->GPC['url'] != 'forumdisplay.php')
            {
                
    $vbulletin->GPC['url'] = str_replace('"'''$vbulletin->GPC['url']);
            }
            else
            {
                
    $vbulletin->GPC['url'] = 'forumdisplay.php?' $vbulletin->session->vars['sessionurl'] . "f=$foruminfo[forumid]";
            }

            
    // Allow POST based redirection...
            
    if ($vbulletin->GPC['postvars'] != '')
            {
                if ((
    $check verify_client_string($vbulletin->GPC['postvars'])) !== false)
                {
                    
    $temp unserialize($check);
                    if (
    $temp['do'] != 'doenterpwd')
                    { 
    // ...but prevent an infinite loop
                        
    require_once(DIR '/includes/functions_misc.php');
                        
    $vbulletin->GPC['postvars'] = construct_hidden_var_fields($check);
                    }
                    else
                    {
                        
    $vbulletin->GPC['postvars'] = '';
                    }
                }
                else
                {
                    
    $vbulletin->GPC['postvars'] = '';
                }
            }

            
    // workaround IIS cookie+location header bug
            
    $forceredirect = (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== false);
            eval(
    print_standard_redirect('forumpasswordcorrect'true$forceredirect));
        }
        else
        {
            require_once(
    DIR '/includes/functions_misc.php');

            
    $vbulletin->GPC['url'] = str_replace('&''&'$vbulletin->GPC['url']);
            
    $postvars construct_post_vars_html();
            eval(
    standard_error(fetch_error('forumpasswordincorrect',
                
    $vbulletin->session->vars['sessionhash'],
                
    htmlspecialchars_uni($vbulletin->GPC['url']),
                
    $foruminfo['forumid'],
                
    $postvars,
                
    $stylevar['cellpadding'],
                
    $stylevar['cellspacing']
            )));
        }
    }

    // ###### END SPECIAL PATHS

    // These $_REQUEST values will get used in the sort template so they are assigned to normal variables
    $perpage =  $vbulletin->input->clean_gpc('r''perpage'TYPE_UINT);
    $pagenumber $vbulletin->input->clean_gpc('r''pagenumber'TYPE_UINT);
    $daysprune $vbulletin->input->clean_gpc('r''daysprune'TYPE_INT);
    $sortfield $vbulletin->input->clean_gpc('r''sortfield'TYPE_STR);

    // get permission to view forum
    $_permsgetter_ 'forumdisplay';
    $forumperms fetch_permissions($foruminfo['forumid']);
    if (!(
    $forumperms $vbulletin->bf_ugp_forumpermissions['canview']))
    {
        
    print_no_permission();
    }

    // disable thread preview if we can't view threads
    if (!($forumperms $vbulletin->bf_ugp_forumpermissions['canviewthreads']))
    {
        
    $vbulletin->options['threadpreview'] = 0;
    }

    // check if there is a forum password and if so, ensure the user has it set
    verify_forum_password($foruminfo['forumid'], $foruminfo['password']);

    // get vbulletin->iforumcache - for use by makeforumjump and forums list
    // fetch the forum even if they are invisible since its needed
    // for the title but we'll unset that further down
    // also fetch subscription info for $show['subscribed'] variable
    cache_ordered_forums(11$vbulletin->userinfo['userid']);

    $show['newthreadlink'] = iif(!$show['search_engine'] AND $foruminfo['allowposting'], truefalse);
    $show['threadicons'] = iif ($foruminfo['allowicons'], truefalse);
    $show['threadratings'] = iif ($foruminfo['allowratings'], truefalse);
    $show['subscribed_to_forum'] = ($vbulletin->forumcache["$foruminfo[forumid]"]['subscribeforumid'] != '' true false);

    if (!
    $daysprune)
    {
        if (
    $vbulletin->userinfo['daysprune'])
        {
            
    $daysprune $vbulletin->userinfo['daysprune'];
        }
        else
        {
            
    $daysprune iif($foruminfo['daysprune'], $foruminfo['daysprune'], 30);
        }
    }

    // ### GET FORUMS, PERMISSIONS, MODERATOR iCACHES ########################
    cache_moderators();

    // draw nav bar
    $navbits = array();
    $parentlist array_reverse(explode(','substr($foruminfo['parentlist'], 0, -3)));
    foreach (
    $parentlist AS $forumID)
    {
        
    $forumTitle $vbulletin->forumcache["$forumID"]['title'];
        
    $navbits['forumdisplay.php?' $vbulletin->session->vars['sessionurl'] . "f=$forumID"] = $forumTitle;
    }

    // pop the last element off the end of the $nav array so that we can show it without a link
    array_pop($navbits);

    $navbits[''] = $foruminfo['title'];
    $navbits construct_navbits($navbits);
    eval(
    '$navbar = "' fetch_template('navbar') . '";');

    $moderatorslist '';
    $listexploded explode(','$foruminfo['parentlist']);
    $showmods = array();
    $show['moderators'] = false;
    $totalmods 0;
    foreach (
    $listexploded AS $parentforumid)
    {
        if (!
    $imodcache["$parentforumid"] OR $parentforumid == -1)
        {
            continue;
        }
        foreach (
    $imodcache["$parentforumid"] AS $moderator)
        {
            if (
    $showmods["$moderator[userid]"] === true)
            {
                continue;
            }

            (
    $hook vBulletinHook::fetch_hook('forumdisplay_moderator')) ? eval($hook) : false;

            
    $showmods["$moderator[userid]"] = true;
            if (
    $moderatorslist == '')
            {
                
    $show['moderators'] = true;
                eval(
    '$moderatorslist = "' fetch_template('forumdisplay_moderator') . '";');
            }
            else
            {
                eval(
    '$moderatorslist .= ", ' fetch_template('forumdisplay_moderator') . '";');
            }
            
    $totalmods++;
        }
    }

    // ### BUILD FORUMS LIST #################################################

    // get an array of child forum ids for this forum
    $foruminfo['childlist'] = explode(','$foruminfo['childlist']);

    $comma '';

    // define max depth for forums display based on $vbulletin->options[forumhomedepth]
    define('MAXFORUMDEPTH'$vbulletin->options['forumdisplaydepth']);

    if ((
    $vbulletin->options['showforumusers'] == OR $vbulletin->options['showforumusers'] == OR ($vbulletin->options['showforumusers'] > AND $vbulletin->userinfo['userid'])) AND !$show['search_engine'])
    {
        
    $datecut TIMENOW $vbulletin->options['cookietimeout'];
        
    $forumusers $db->query_read_slave("
            SELECT user.username, (user.options & " 
    $vbulletin->bf_misc_useroptions['invisible'] . ") AS invisible, user.usergroupid, session.userid, session.inforum, session.lastactivity,
                IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, infractiongroupid
            FROM " 
    TABLE_PREFIX "session AS session
            LEFT JOIN " 
    TABLE_PREFIX "user AS user ON(user.userid = session.userid)
            WHERE session.lastactivity > 
    $datecut
            ORDER BY" 
    iif($vbulletin->options['showforumusers'] == OR $vbulletin->options['showforumusers'] == 3" username ASC,") . " lastactivity DESC
        "
    );

        
    $numberregistered 0;
        
    $numberguest 0;
        
    $doneuser = array();

        if (
    $vbulletin->userinfo['userid'])
        {
            
    // fakes the user being in this forum
            
    $loggedin = array(
                
    'userid'        => $vbulletin->userinfo['userid'],
                
    'username'      => $vbulletin->userinfo['username'],
                
    'invisible'     => $vbulletin->userinfo['invisible'],
                
    'invisiblemark' => $vbulletin->userinfo['invisiblemark'],
                
    'inforum'       => $foruminfo['forumid'],
                
    'lastactivity'  => TIMENOW,
                
    'musername'     => $vbulletin->userinfo['musername'],
            );
            
    $numberregistered 1;
            
    fetch_online_status($loggedin);

            (
    $hook vBulletinHook::fetch_hook('forumdisplay_loggedinuser')) ? eval($hook) : false;

            eval(
    '$activeusers = "' fetch_template('forumdisplay_loggedinuser') . '";');
            
    $doneuser["{$vbulletin->userinfo['userid']}"] = 1;
            
    $comma ', ';
        }

        
    $inforum = array();

        
    // this require the query to have lastactivity ordered by DESC so that the latest location will be the first encountered.
        
    while ($loggedin $db->fetch_array($forumusers))
        {
            if (empty(
    $doneuser["$loggedin[userid]"]))
            {
                if (
    in_array($loggedin['inforum'], $foruminfo['childlist']) AND $loggedin['inforum'] != -1)
                {
                    if (!
    $loggedin['userid'])
                    {
                        
    // this is a guest
                        
    $numberguest++;
                        
    $inforum["$loggedin[inforum]"]++;
                    }
                    else
                    {
                        
    $numberregistered++;
                        
    $inforum["$loggedin[inforum]"]++;

                        (
    $hook vBulletinHook::fetch_hook('forumdisplay_loggedinuser')) ? eval($hook) : false;

                        if (
    fetch_online_status($loggedin))
                        {
                            
    fetch_musername($loggedin);
                            eval(
    '$activeusers .= "' $comma fetch_template('forumdisplay_loggedinuser') . '";');
                            
    $comma ', ';
                        }
                    }
                }
                if (
    $loggedin['userid'])
                {
                    
    $doneuser["$loggedin[userid]"] = 1;
                }
            }
        }

        if (!
    $vbulletin->userinfo['userid'])
        {
            
    $numberguest = ($numberguest == 0) ? $numberguest;
        }
        
    $totalonline $numberregistered $numberguest;
        unset(
    $joingroupid$key$datecut $comma$invisibleuser$userinfo$userid$loggedin$index$value$forumusers$parentarray );

        
    $show['activeusers'] = true;
    }
    else
    {
        
    $show['activeusers'] = false;
    }

    // #############################################################################
    // get read status for this forum and children
    $unreadchildforums 0;
    foreach (
    $foruminfo['childlist'] AS $val)
    {
        if (
    $val == -OR $val == $foruminfo['forumid'])
        {
            continue;
        }

        if (
    $vbulletin->options['threadmarking'] AND $vbulletin->userinfo['userid'])
        {
            
    $lastread_child max($vbulletin->forumcache["$val"]['forumread'], TIMENOW - ($vbulletin->options['markinglimit'] * 86400));
        }
        else
        {
            
    $lastread_child max(intval(fetch_bbarray_cookie('forum_view'$val)), $vbulletin->userinfo['lastvisit']);
        }

        if (
    $vbulletin->forumcache["$val"]['lastpost'] > $lastread_child)
        {
            
    $unreadchildforums 1;
            break;
        }
    }

    $forumbits construct_forum_bit($foruminfo['forumid']);

    // admin tools
    $show['adminoptions'] = can_moderate($foruminfo['forumid']);
    $show['post_new_announcement'] = can_moderate($foruminfo['forumid'], 'canannounce');
    $show['addmoderator'] = ($permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel']);

    $curforumid $foruminfo['forumid'];
    construct_forum_jump();

    /////////////////////////////////
    if ($foruminfo['cancontainthreads'])
    {
        
    /////////////////////////////////
        
    if ($vbulletin->options['threadmarking'] AND $vbulletin->userinfo['userid'])
        {
            
    $foruminfo['forumread'] = $vbulletin->forumcache["$foruminfo[forumid]"]['forumread'];
            
    $lastread max($foruminfo['forumread'], TIMENOW - ($vbulletin->options['markinglimit'] * 86400));
        }
        else
        {
            
    $bbforumview intval(fetch_bbarray_cookie('forum_view'$foruminfo['forumid']));
            
    $lastread max($bbforumview$vbulletin->userinfo['lastvisit']);
        }

        
    // Inline Moderation
        
    $show['movethread'] = (can_moderate($forumid'canmanagethreads')) ? true false;
        
    $show['deletethread'] = (can_moderate($forumid'candeleteposts') OR can_moderate($forumid'canremoveposts')) ? true false;
        
    $show['approvethread'] = (can_moderate($forumid'canmoderateposts')) ? true false;
        
    $show['openthread'] = (can_moderate($forumid'canopenclose')) ? true false;
        
    $show['inlinemod'] = ($show['movethread'] OR $show['deletethread'] OR $show['approvethread'] OR $show['openthread']) ? true false;
        
    $url $show['inlinemod'] ? SCRIPTPATH '';

        
    // fetch popup menu
        
    if ($show['popups'] AND $show['inlinemod'])
        {
            eval(
    '$threadadmin_imod_menu_thread = "' fetch_template('threadadmin_imod_menu_thread') . '";');
        }
        else
        {
            
    $threadadmin_imod_thread_menu '';
        }

        
    // get announcements

        
    $announcebits '';
        if (
    $show['threadicons'] AND $show['inlinemod'])
        {
            
    $announcecolspan 6;
        }
        else if (!
    $show['threadicons'] AND !$show['inlinemod'])
        {
            
    $announcecolspan 4;
        }
        else
        {
            
    $announcecolspan 5;
        }

        
    $mindate TIMENOW 2592000// 30 days

        
    $announcements $db->query_read_slave("
            SELECT
                announcement.announcementid, startdate, title, announcement.views,
                user.username, user.userid, user.usertitle, user.customtitle, user.usergroupid,
                IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, infractiongroupid
                " 
    . (($vbulletin->userinfo['userid']) ? ", NOT ISNULL(announcementread.announcementid) AS readannounce" "") . "
            FROM " 
    TABLE_PREFIX "announcement AS announcement
            " 
    . (($vbulletin->userinfo['userid']) ? "LEFT JOIN " TABLE_PREFIX "announcementread AS announcementread ON (announcementread.announcementid = announcement.announcementid AND announcementread.userid = " $vbulletin->userinfo['userid'] . ")" "") . "
            LEFT JOIN " 
    TABLE_PREFIX "user AS user ON(user.userid = announcement.userid)
            WHERE startdate <= " 
    TIMENOW "
                AND enddate >= " 
    TIMENOW "
                AND " 
    fetch_forum_clause_sql($foruminfo['forumid'], 'forumid') . "
            ORDER BY startdate DESC, announcement.announcementid DESC
            " 
    iif($vbulletin->options['oneannounce'], "LIMIT 1"));

        while (
    $announcement $db->fetch_array($announcements))
        {
            
    fetch_musername($announcement);
            
    $announcement['postdate'] = vbdate($vbulletin->options['dateformat'], $announcement['startdate']);
            if (
    $announcement['readannounce'] OR $announcement['startdate'] <= $mindate)
            {
                
    $announcement['statusicon'] = 'old';
            }
            else
            {
                
    $announcement['statusicon'] = 'new';
            }
            
    $announcement['views'] = vb_number_format($announcement['views']);
            
    $announcementidlink iif(!$vbulletin->options['oneannounce'] , "&a=$announcement[announcementid]");

            (
    $hook vBulletinHook::fetch_hook('forumdisplay_announcement')) ? eval($hook) : false;

            eval(
    '$announcebits .= "' fetch_template('threadbit_announcement') . '";');
        }

        
    // display threads
        
    if (!($forumperms $vbulletin->bf_ugp_forumpermissions['canviewothers']))
        {
            
    $limitothers "AND postuserid = " $vbulletin->userinfo['userid'] . " AND " $vbulletin->userinfo['userid'] . " <> 0";
        }
        else
        {
            
    $limitothers '';
        }

        if (
    can_moderate($foruminfo['forumid']))
        {
            
    $redirectjoin "LEFT JOIN " TABLE_PREFIX "threadredirect AS threadredirect ON(thread.open = 10 AND thread.threadid = threadredirect.threadid)";
        }
        else
        {
            
    $redirectjoin '';
        }

        
    // filter out deletion notices if can't be seen
        
    if ($forumperms $vbulletin->bf_ugp_forumpermissions['canseedelnotice'] OR can_moderate($foruminfo['forumid']))
        {
            
    $canseedelnotice true;
            
    $deljoin "LEFT JOIN " TABLE_PREFIX "deletionlog AS deletionlog ON(thread.threadid = deletionlog.primaryid AND deletionlog.type = 'thread')";
        }
        else
        {
            
    $canseedelnotice false;
            
    $deljoin '';
        }

        
    // remove threads from users on the global ignore list if user is not a moderator
        
    if ($Coventry fetch_coventry('string') AND !can_moderate($foruminfo['forumid']))
        {
            
    $globalignore "AND postuserid NOT IN ($Coventry) ";
        }
        else
        {
            
    $globalignore '';
        }

        
    // look at thread limiting options
        
    $stickyids '';
        
    $stickycount 0;
        if (
    $daysprune != -1)
        {
            if (
    $vbulletin->userinfo['userid'] AND in_coventry($vbulletin->userinfo['userid'], true))
            {
                
    $tachyjoin "LEFT JOIN " TABLE_PREFIX "tachythreadpost AS tachythreadpost ON " .
                    
    "(tachythreadpost.threadid = thread.threadid AND tachythreadpost.userid = " $vbulletin->userinfo['userid'] . ")";
                
    $datecut " AND (thread.lastpost >= " . (TIMENOW - ($daysprune 86400)) . " OR tachythreadpost.lastpost >= " . (TIMENOW - ($daysprune 86400)) . ")";
            }
            else
            {
                
    $datecut "AND lastpost >= " . (TIMENOW - ($daysprune 86400));
                
    $tachyjoin "";
            }
            
    $show['noposts'] = false;
        }
        else
        {
            
    $tachyjoin "";
            
    $datecut "";
            
    $show['noposts'] = true;
        }

        
    // complete form fields on page
        
    $daysprunesel iif($daysprune == -1'all'$daysprune);
        
    $daysprunesel = array($daysprunesel => 'selected="selected"');

        
    $vbulletin->input->clean_array_gpc('r', array(
            
    'sortorder' => TYPE_NOHTML,
        ));

        
    // default sorting methods
        
    if (empty($sortfield))
        {
            
    $sortfield $foruminfo['defaultsortfield'];
        }
        if (empty(
    $vbulletin->GPC['sortorder']))
        {
            
    $vbulletin->GPC['sortorder'] = $foruminfo['defaultsortorder'];
        }

        
    // look at sorting options:
        
    if ($vbulletin->GPC['sortorder'] != 'asc')
        {
            
    $sqlsortorder 'DESC';
            
    $order = array('desc' => 'selected="selected"');
            
    $vbulletin->GPC['sortorder'] = 'desc';
        }
        else
        {
            
    $sqlsortorder '';
            
    $order = array('asc' => 'selected="selected"');
        }

        switch (
    $sortfield)
        {
            case 
    'title':
                
    $sqlsortfield 'thread.title';
                break;
            case 
    'lastpost':
                
    $sqlsortfield 'lastpost';
                break;
            case 
    'replycount':
            case 
    'views':
            case 
    'postusername':
                
    $sqlsortfield $sortfield;
                break;
            case 
    'voteavg':
                if (
    $foruminfo['allowratings'])
                {
                    
    $sqlsortfield 'voteavg';
                    break;
                }
            case 
    'dateline':
                
    $sqlsortfield 'thread.dateline';
                break;
            
    // else, use last post
            
    default:
                
    $handled false;
                (
    $hook vBulletinHook::fetch_hook('forumdisplay_sort')) ? eval($hook) : false;
                if (!
    $handled)
                {
                    
    $sqlsortfield 'lastpost';
                    
    $sortfield 'lastpost';
                }
        }
        
    $sort = array($sortfield => 'selected="selected"');

        if (!
    can_moderate($forumid'canmoderateposts'))
        {
            if (!(
    $forumperms $vbulletin->bf_ugp_forumpermissions['canseedelnotice']))
            {
                
    $visiblethreads " AND visible = 1 ";
            }
            else
            {
                
    $visiblethreads " AND visible IN (1,2)";
            }
        }
        else
        {
            
    $visiblethreads " AND visible IN (0,1,2)";
        }

        
    $hook_query_fields $hook_query_joins $hook_query_where '';
        (
    $hook vBulletinHook::fetch_hook('forumdisplay_query_threadscount')) ? eval($hook) : false;

        
    # Include visible IN (0,1,2) in order to hit upon the 4 column index
        
    $threadscount $db->query_first_slave("
            SELECT COUNT(*) AS threads, SUM(IF(thread.lastpost > 
    $lastread AND open <> 10, 1, 0)) AS newthread
            
    $hook_query_fields
            FROM " 
    TABLE_PREFIX "thread AS thread
            
    $tachyjoin
            
    $hook_query_joins
            WHERE forumid = 
    $foruminfo[forumid]
                AND sticky = 0
                
    $visiblethreads
                
    $globalignore
                
    $limitothers
                
    $datecut
                
    $hook_query_where
        "
    );
        
    $totalthreads $threadscount['threads'];
        
    $newthreads $threadscount['newthread'];

        
    // set defaults
        
    sanitize_pageresults($totalthreads$pagenumber$perpage200$vbulletin->options['maxthreads']);

        
    // get number of sticky threads for the first page
        // on the first page there will be the sticky threads PLUS the $perpage other normal threads
        // not quite a bug, but a deliberate feature!
        
    if ($pagenumber == OR $vbulletin->options['showstickies'])
        {

            
    // Fnan4arab : SubThread
            // هاك مواضيع الأقسام الفرعية
            
    $getparent_id '';
            
    $getparentid $db->query_read("SELECT * FROM " TABLE_PREFIX "forum WHERE parentid='" $foruminfo[forumid] . "'");
            
            while (
    $getparentids $db->fetch_array($getparentid)) {
                
                
    $getparent_id .= ',' $getparentids[forumid];
                
            }
            
    // End SubThread
            
            
    $stickies $db->query_read_slave("
                SELECT thread.threadid, lastpost, open
                FROM " 
    TABLE_PREFIX "thread AS thread
                WHERE forumid IN (" 
    $foruminfo[forumid] . $getparent_id ")
                    AND sticky = 1
                    
    $visiblethreads
                    
    $limitothers
                    
    $globalignore
            "
    );
    // End SubThread   
                 
    while ($thissticky $db->fetch_array($stickies))          {
                
    $stickycount++;
                if (
    $thissticky['lastpost'] >= $lastread AND $thissticky['open'] <> 10)
                {
                    
    $newthreads++;
                }
                
    $stickyids .= ",$thissticky[threadid]";
            }
            
    $db->free_result($stickies);
            unset(
    $thissticky$stickies);
        }


        
    $limitlower = ($pagenumber 1) * $perpage;
        
    $limitupper = ($pagenumber) * $perpage;

        if (
    $limitupper $totalthreads)
        {
            
    $limitupper $totalthreads;
            if (
    $limitlower $totalthreads)
            {
                
    $limitlower = ($totalthreads $perpage) - 1;
            }
        }
        if (
    $limitlower 0)
        {
            
    $limitlower 0;
        }

        if (
    $foruminfo['allowratings'])
        {
            
    $vbulletin->options['showvotes'] = intval($vbulletin->options['showvotes']);
            
    $votequery "
                IF(votenum >= " 
    $vbulletin->options['showvotes'] . ", votenum, 0) AS votenum,
                IF(votenum >= " 
    $vbulletin->options['showvotes'] . " AND votenum > 0, votetotal / votenum, 0) AS voteavg,
            "
    ;
        }
        else
        {
            
    $votequery '';
        }

        if (
    $vbulletin->options['threadpreview'] > 0)
        {
            
    $previewfield "post.pagetext AS preview,";
            
    $previewjoin "LEFT JOIN " TABLE_PREFIX "post AS post ON(post.postid = thread.firstpostid)";
        }
        else
        {
            
    $previewfield '';
            
    $previewjoin '';
        }

        if (
    $vbulletin->userinfo['userid'] AND in_coventry($vbulletin->userinfo['userid'], true))
        {
            
    $lastpost_info1 ",IF(tachythreadpost.userid IS NULL, thread.lastpost, tachythreadpost.lastpost) AS lastpost";
            
    $lastpost_info2 "IF(tachythreadpost.userid IS NULL, thread.lastpost, tachythreadpost.lastpost) AS lastpost, " .
                
    "IF(tachythreadpost.userid IS NULL, thread.lastposter, tachythreadpost.lastposter) AS lastposter, " .
                
    "IF(tachythreadpost.userid IS NULL, thread.lastpostid, tachythreadpost.lastpostid) AS lastpostid";

            
    $tachyjoin "LEFT JOIN " TABLE_PREFIX "tachythreadpost AS tachythreadpost ON " .
                
    "(tachythreadpost.threadid = thread.threadid AND tachythreadpost.userid = " $vbulletin->userinfo['userid'] . ')';
        }
        else
        {
            
    $lastpost_info1 "";
            
    $lastpost_info2 "thread.lastpost, thread.lastposter, thread.lastpostid";
            
    $tachyjoin "";
        }

        
    $hook_query_fields $hook_query_joins $hook_query_where '';
        (
    $hook vBulletinHook::fetch_hook('forumdisplay_query_threadid')) ? eval($hook) : false;


        
    // Fnan4arab : SubThread
        // هاك مواضيع الأقسام الفرعية
        
    $getparent_id '';
        
    $getparentid $db->query_read("SELECT * FROM " TABLE_PREFIX "forum WHERE parentid='" $foruminfo[forumid] . "'");
        while (
    $getparentids $db->fetch_array($getparentid)) {
        
    $getparent_id .= ',' $getparentids[forumid];
        }
        
        
    $getthreadids $db->query_read_slave("
            SELECT " 
    iif($sortfield == 'voteavg'$votequery) . " thread.threadid
                
    $lastpost_info1
                
    $hook_query_fields
            FROM " 
    TABLE_PREFIX "thread AS thread
            
    $tachyjoin
            
    $hook_query_joins
            WHERE forumid IN (" 
    $foruminfo[forumid] . $getparent_id ")
                AND sticky = 0
                
    $visiblethreads
                
    $globalignore
                
    $limitothers
                
    $datecut
                
    $hook_query_where
            ORDER BY sticky DESC, 
    $sqlsortfield $sqlsortorder
            LIMIT 
    $limitlower$perpage
        "
    );
        
    // End SubThread
        
    $ids '';
        while (
    $thread $db->fetch_array($getthreadids))
        {
            
    $ids .= ',' $thread['threadid'];
        }

        
    $ids .= $stickyids;

        
    $db->free_result($getthreadids);
        unset (
    $thread$getthreadids);

        
    $hook_query_fields $hook_query_joins $hook_query_where '';
        (
    $hook vBulletinHook::fetch_hook('forumdisplay_query')) ? eval($hook) : false;

        
    $threads $db->query_read_slave("
            SELECT 
    $votequery $previewfield
                thread.threadid, thread.title AS threadtitle, thread.forumid, pollid, open, replycount, postusername, postuserid, thread.iconid AS threadiconid,
                
    $lastpost_info2, thread.dateline, IF(views<=replycount, replycount+1, views) AS views, notes, thread.visible, sticky, votetotal, thread.attach,
                hiddencount, deletedcount
                " 
    . (($vbulletin->options['threadsubscribed'] AND $vbulletin->userinfo['userid']) ? ", NOT ISNULL(subscribethread.subscribethreadid) AS issubscribed" "") . "
                " 
    . ($deljoin ", deletionlog.userid AS del_userid, deletionlog.username AS del_username, deletionlog.reason AS del_reason" "") . "
                " 
    . (($vbulletin->options['threadmarking'] AND $vbulletin->userinfo['userid']) ? ", threadread.readtime AS threadread" "") . "
                " 
    . ($redirectjoin ", threadredirect.expires" "") . "
                
    $hook_query_fields
            FROM " 
    TABLE_PREFIX "thread AS thread
                
    $deljoin
                " 
    . (($vbulletin->options['threadsubscribed'] AND $vbulletin->userinfo['userid']) ?  " LEFT JOIN " TABLE_PREFIX "subscribethread AS subscribethread ON(subscribethread.threadid = thread.threadid AND subscribethread.userid = " $vbulletin->userinfo['userid'] . " AND canview = 1)" "") . "
                " 
    . (($vbulletin->options['threadmarking'] AND $vbulletin->userinfo['userid']) ? " LEFT JOIN " TABLE_PREFIX "threadread AS threadread ON (threadread.threadid = thread.threadid AND threadread.userid = " $vbulletin->userinfo['userid'] . ")" "") . "
                
    $previewjoin
                
    $tachyjoin
                
    $redirectjoin
                
    $hook_query_joins
            WHERE thread.threadid IN (0
    $ids$hook_query_where
            ORDER BY sticky DESC, 
    $sqlsortfield $sqlsortorder
        "
    );
        unset(
    $limitothers$delthreadlimit$deljoin$datecut$votequery$sqlsortfield$sqlsortorder$threadids);

        
    // Get Dot Threads
        
    $dotthreads fetch_dot_threads_array($ids);
        if (
    $vbulletin->options['showdots'] AND $vbulletin->userinfo['userid'])
        {
            
    $show['dotthreads'] = true;
        }
        else
        {
            
    $show['dotthreads'] = false;
        }

        unset(
    $ids);

        
    // prepare sort things for column header row:
        
    $sorturl 'forumdisplay.php?' $vbulletin->session->vars['sessionurl'] . "f=$forumid&daysprune=$daysprune";
        
    $oppositesort iif($vbulletin->GPC['sortorder'] == 'asc''desc''asc');

        if (
    $totalthreads OR $stickyids)
        {
            if (
    $totalthreads 0)
            {
                
    $limitlower++;
            }
            
    // check to see if there are any threads to display. If there are, do so, otherwise, show message

            
    if ($vbulletin->options['threadpreview'] > 0)
            {
                
    // Get Buddy List
                
    $buddy = array();
                if (
    trim($vbulletin->userinfo['buddylist']))
                {
                    
    $buddylist preg_split('/( )+/'trim($vbulletin->userinfo['buddylist']), -1PREG_SPLIT_NO_EMPTY);
                    foreach (
    $buddylist AS $buddyuserid)
                    {
                        
    $buddy["$buddyuserid"] = 1;
                    }
                }
                
    DEVDEBUG('buddies: ' implode(', 'array_keys($buddy)));
                
    // Get Ignore Users
                
    $ignore = array();
                if (
    trim($vbulletin->userinfo['ignorelist']))
                {
                    
    $ignorelist preg_split('/( )+/'trim($vbulletin->userinfo['ignorelist']), -1PREG_SPLIT_NO_EMPTY);
                    foreach (
    $ignorelist AS $ignoreuserid)
                    {
                        if (!
    $buddy["$ignoreuserid"])
                        {
                            
    $ignore["$ignoreuserid"] = 1;
                        }
                    }
                }
                
    DEVDEBUG('ignored users: ' implode(', 'array_keys($ignore)));
            }

            
    $show['threads'] = true;
            
    $threadbits '';
            
    $threadbits_sticky '';

            
    $counter 0;
            
    $toread 0;

            while (
    $thread $db->fetch_array($threads))
            { 
    // AND $counter++ < $perpage)

                // build thread data
                
    $thread process_thread_array($thread$lastread$foruminfo['allowicons']);
                
    $realthreadid $thread['realthreadid'];

                if (
    $thread['sticky'])
                {
                    
    $threadbit =& $threadbits_sticky;
                }
                else
                {
                    
    $threadbit =& $threadbits;
                }

                (
    $hook vBulletinHook::fetch_hook('threadbit_display')) ? eval($hook) : false;

                
    // Soft Deleted Thread
                
    if ($thread['visible'] == 2)
                {
                    
    $thread['deletedcount']++;
                    
    $show['threadtitle'] = (can_moderate($forumid) OR ($vbulletin->userinfo['userid'] != AND $vbulletin->userinfo['userid'] == $thread['postuserid'])) ? true false;
                    
    $show['deletereason'] = (!empty($thread['del_reason'])) ?  true false;
                    
    $show['viewthread'] = (can_moderate($forumid)) ? true false;
                    
    $show['managethread'] = (can_moderate($forumid'candeleteposts') OR can_moderate($forumid'canremoveposts')) ? true false;
                    
    $show['moderated'] = ($thread['hiddencount'] > AND can_moderate($forumid'canmoderateposts')) ? true false;
                    
    $show['deletedthread'] = $canseedelnotice;
                    eval(
    '$threadbit .= "' fetch_template('threadbit_deleted') . '";');
                }
                else
                {
                    if (!
    $thread['visible'])
                    {
                        
    $thread['hiddencount']++;
                    }
                    
    $show['moderated'] = ($thread['hiddencount'] > AND can_moderate($forumid'canmoderateposts')) ? true false;
                    
    $show['deletedthread'] = ($thread['deletedcount'] > AND $canseedelnotice) ? true false;
                    eval(
    '$threadbit .= "' fetch_template('threadbit') . '";');
                }
            }
            
    $db->free_result($threads);
            unset(
    $thread$counter);

            
    $pagenav construct_page_nav($pagenumber$perpage$totalthreads'forumdisplay.php?' $vbulletin->session->vars['sessionurl'] . "f=$forumid"""
                
    . (!empty($vbulletin->GPC['perpage']) ? "&pp=$perpage"")
                . (!empty(
    $vbulletin->GPC['sortfield']) ? "&sort=$sortfield"")
                . (!empty(
    $vbulletin->GPC['sortorder']) ? "&order=" $vbulletin->GPC['sortorder'] : "")
                . (!empty(
    $vbulletin->GPC['daysprune']) ? "&daysprune=$daysprune"")
            );

            eval(
    '$sortarrow[' $sortfield '] = "' fetch_template('forumdisplay_sortarrow') . '";');
        }
        unset(
    $threads$dotthreads);

        
    // get colspan for bottom bar
        
    $foruminfo['bottomcolspan'] = 6;
        if (
    $foruminfo['allowicons'])
        {
            
    $foruminfo['bottomcolspan']++;
        }
        if (
    $foruminfo['allowratings'])
        {
            
    $foruminfo['bottomcolspan']++;
        }

        
    $show['threadslist'] = true;

        
    /////////////////////////////////
    // end forum can contain threads
    else
    {
        
    $show['threadslist'] = false;
    }
    /////////////////////////////////

    if ($newthreads AND $unreadchildforums 1)
    {
        
    mark_forum_read($foruminfo$vbulletin->userinfo['userid'], TIMENOW);
    }

    eval(
    '$forumhome_markread_script = "' fetch_template('forumhome_markread_script') . '";');

    construct_forum_rules($foruminfo$forumperms);

    $show['forumsearch'] = iif (!$show['search_engine'] AND $forumperms $vbulletin->bf_ugp_forumpermissions['cansearch'] AND $vbulletin->options['enablesearches'], truefalse);
    $show['forumslist'] = iif ($forumshowntruefalse);
    $show['stickies'] = iif ($threadbits_sticky != ''truefalse);

    (
    $hook vBulletinHook::fetch_hook('forumdisplay_complete')) ? eval($hook) : false;

    eval(
    'print_output("' fetch_template('FORUMDISPLAY') . '");');


    /*======================================================================*\
    || ####################################################################
    || # Downloaded: 15:12, Wed Jun 27th 2007
    || # CVS: $RCSfile$ - $Revision: 16928 $
    || ####################################################################
    \*======================================================================*/
    ?>
    ويعطيكم العافية





    __________________


  9. #24
    عضو فعال
    تاريخ التسجيل
    Feb 2003
    المشاركات
    1,308


    هل تأخرت ؟
    الهاك ماله دخل بالكوكيز، التعديل فقط بإستعلام
    تحرى الأمر يمكن المشكلة من صوت ثاني

    المهم هذا ملف ال forumdisplay معدل لكن إحفظ نسخة احتياطية لملف القديم

    جرب وشوف





    الملفات المرفقة الملفات المرفقة

  10. #25
    عضو نشيط
    تاريخ التسجيل
    May 2007
    المشاركات
    214


    نفس الشيء يالغالي يقابلني هذا الخطا
    كود:
     لم يكن بالإمكان تسجيل الكوكيز .
      الملف : $filename
      السطر : $linenum
    عندما اقوم بالدخول لمنتدى لايوجد به اقسام فرعية احصل على الخطا الذي بالاعلى
    شاكر لك صبرك عليا وجزاك الله خير





    __________________


  11. #26
    عضو فعال
    تاريخ التسجيل
    Feb 2003
    المشاركات
    1,308


    يمكن عندك خطأ في includes/functions.php أو أحد الملفات
    عالعموم انا بضيفك عندي






  12. #27
    عضو فعال
    تاريخ التسجيل
    Feb 2003
    المشاركات
    1,308


    اللي يواجه مشكلة بالكوكيز يستخدم الملف المرفق
    تم حل مشكلة الأخ باسم وجزاه الله خير تعاونا على حل المشكلة





    الملفات المرفقة الملفات المرفقة

  13. #28
    عضو نشيط جدا
    تاريخ التسجيل
    Sep 2006
    المشاركات
    319


    في خطاء في كود بعض المواضيع الاقسام ماتنزل تحت في منتدى الرسمي

    ارجو الرد والاصلاح






  14. #29
    عضو نشيط
    تاريخ التسجيل
    Aug 2007
    المشاركات
    51


    تسلم يا غالى






  15. #30


    عمل رائع

    لو تقدر تعمله برودكت يتم التحكم فيه من لوحة التكم بكون شي رائع

    اقترح اضافة خيارات ::
    * لو كان القسم به 3 فروع ان يتم التحكم بعرض مواضيع فرع واحد فقط يتم اختياره او فرعين او الجميع او منع الكل
    * خاصية التشغيل والايقاف
    * بالاضافة لخاصية ظهور اسم الفرع او لا

    بارك الله فيكم





    __________________
    مهندس أحمد
    إتصالات وإلكترونيات
    مسلم عربي فلسطيني
    I Allah

    مرئية فلسطين على اليوتيوب

    خلجات قلب ....





ضوابط المشاركة

  • لا تستطيع إضافة مواضيع جديدة
  • لا تستطيع الرد على المواضيع
  • لا تستطيع إرفاق ملفات
  • لا تستطيع تعديل مشاركاتك
  •  

أضف موقعك هنا| اخبار السيارات | حراج | شقق للايجار في الكويت | بيوت للبيع في الكويت | دليل الكويت العقاري | مقروء | شركة كشف تسربات المياه | شركة عزل اسطح بالرياض | عزل فوم بالرياض| عزل اسطح بالرياض | كشف تسربات المياة بالرياض | شركة عزل اسطح بالرياض