Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)

Reply
 
Thread Tools Display Modes
  #21  
Old 03-30-2003, 01:01 AM
Pollo Pollo is offline
 
Join Date: Jul 2002
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello, all of this seems really helpful, and gets me close to what I'd like, which is:

Choose certain forums (not all) to be displayed by the time/date of initial post of each thread. In other words, once threads are posted, there isn't a way to bump them to the top. They just stay in the order they are posted.

Could anyone help with the coding for this? Needed for about 5 forums out of the total (though it seems easy to add or subtract addl. forums as needed).
Reply With Quote
  #22  
Old 05-08-2003, 10:35 AM
GMeadows GMeadows is offline
 
Join Date: Jun 2002
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is almost perfect for what we need...

My question...how to make

if($foruminfo[forumid]==1)

apply to a range of forum id's? So that a few different sections can be sorted alphabetically.

Gary
Reply With Quote
  #23  
Old 05-09-2003, 10:39 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

if(in_array($foruminfo['forumid'], array(a,x,y,...,z)))
Reply With Quote
  #24  
Old 05-11-2003, 04:10 PM
Michael2's Avatar
Michael2 Michael2 is offline
 
Join Date: Nov 2001
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, this is really messed up. I thought I had it until someone tried going to page 2. I have thread started for each state and want them to appear in alphabetical order. This is what I have, which (I think) should be right...

Quote:
default:
if(in_array($foruminfo['forumid'], array(74,76,77)))
{
$sortfield='title';
$sqlsortorder='';
} else $sortfield='lastpost';
}
if ($sortfield=="voteavg" and !$foruminfo[allowratings]) {
$sortfield="lastpost";
}

$sort = array();
$sort[$sortfield]='selected';
74, 76, and 77 are the three forums I want listed alphabetically. Problem is I have Alabama down through Mass. on on page 1 but then on page two it starts with Mass. at the top and goes down to Alabama.

Any ideas?
Reply With Quote
  #25  
Old 05-23-2003, 11:54 AM
Michael2's Avatar
Michael2 Michael2 is offline
 
Join Date: Nov 2001
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone?
Reply With Quote
  #26  
Old 06-10-2003, 04:26 AM
LilDragonWings LilDragonWings is offline
 
Join Date: Mar 2003
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
03-30-03 at 05:01 AM Pollo said this in Post #21
Hello, all of this seems really helpful, and gets me close to what I'd like, which is:

Choose certain forums (not all) to be displayed by the time/date of initial post of each thread. In other words, once threads are posted, there isn't a way to bump them to the top. They just stay in the order they are posted.
I'm also interested in this solution.... I'm not fluent enough to figure it out on my own yet
Reply With Quote
  #27  
Old 01-12-2004, 01:50 AM
chrisvonc's Avatar
chrisvonc chrisvonc is offline
 
Join Date: Apr 2002
Location: Austin, TX
Posts: 161
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice mod. Thank you, I found it very useful for a new section I am opening on my forum!

Chris
Reply With Quote
  #28  
Old 03-03-2004, 11:19 PM
chrisvonc's Avatar
chrisvonc chrisvonc is offline
 
Join Date: Apr 2002
Location: Austin, TX
Posts: 161
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi again, a follow up question if anyone is checking this...

I used this but ran into the problem that if the threads flowed over to a 2nd page, the order would start over again, repeating the threads from the 1st page. Anyway I tried Chens version (http://www.vbulletin.com/forum/showt...015#post621015) and got that working but I was wondering if it is possible to change the "Last Thread - Next Thread" links to go the next/last thread alphabetically rather than by post ID?

I am using vB 2.3.2 and the forums that I have the alpha sort applied to are using a seperate style template so if its a template change it wont impact the rest of my forum.

Or should I create a new request rather than adding to this thread?

Thanks!

Chris
Reply With Quote
  #29  
Old 04-11-2005, 04:34 PM
Reaktor7 Reaktor7 is offline
 
Join Date: Mar 2005
Location: Port Lincoln, SA
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok guys, i beleive i have this one sorted..

What happens is with your present setup the sort order is passed onto the next page link.. With Xenons hack it overides the default. Here is my "hack" which should make it work. However, it doesnt fix an issue with teh sort arrow being rendered useless on the first click (you need to click it twice for the order to change)

Heres my code:

PHP Code:
    $forumArray = array(x,y,z); //set your forumids here
    
if (!in_array($foruminfo['forumid'], $forumArray)  AND $sortorder != 'asc')
//If its not in our special forum array, we will set the default to Descending (ie so its ordered by last post)
    
{
        
$sqlsortorder 'DESC';
        
$order = array('desc' => HTML_SELECTED);
    }
    elseif (
in_array($foruminfo['forumid'], $forumArray) AND $sortorder == 'desc')
//We have just removed the "default" setting for all forums which are in our array. This removes the ability for the list to be sorted descendingly. We now need to state it manually to get it in descending order.
    
{
        
$sqlsortorder 'DESC';
        
$order = array('desc' => HTML_SELECTED);
    }
    else
//If the above two requirements arent met, we will set the order to Ascending.
    
{
        
$sqlsortorder '';
        
$order = array('asc' => HTML_SELECTED);
    }

    switch (
$sortfield)
    {
        case 
'title':
            
$sqlsortfield 'thread.title';
            break;
        case 
'lastpost':
        case 
'replycount':
        case 
'views':
        case 
'category':
        case 
'postusername':
            
$sqlsortfield $sortfield;
            break;
        case 
'voteavg':
            if (
$foruminfo['allowratings'])
            {
                
$sqlsortfield 'voteavg';
                break;
            } 
// else, use last post
        
default:
            if (
in_array($foruminfo['forumid'], $forumArray))
//if we are viewing a forum in our array, we need to set it to default to ascending, and sort by the title.
            
{
                
$sqlsortfield 'thread.title';
                
$sortfield 'title';
            }
            else
//If not, we set it to the default sort order: descending.
            
{
                
$sqlsortfield 'lastpost';
                
$sortfield 'lastpost';
            }
    } 
Hopefully this helps you our whoever needs it.. I wouldnt class this a hack by anymeans.. but if you do need some help.. Let me know

Fixed the sorting arrow issues -
find:
PHP Code:
    $oppositesort iif($sortorder == 'asc''asc''asc'); 
replace with
PHP Code:
    if (in_array($foruminfo['forumid'],$forumArray))
    {
        if(
$sortorder == 'asc' OR $sortorder == '')
        {
            
$oppositesort 'desc';
        }
        else
        {
            
$oppositesort 'asc';
        }
    }
    elseif (!
in_array($foruminfo['forumid'],$forumArray))
    {
        
$oppositesort iif($sortorder == 'asc''desc''asc');
    } 
hope this helps anyone who needs it
Reply With Quote
  #30  
Old 08-18-2006, 05:24 PM
Bernievn Bernievn is offline
 
Join Date: Oct 2005
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm now running VB 3.5.

I tried the following which does not change the display. What am I doing wrong?

default:
$handled = false;
($hook = vBulletinHook::fetch_hook('forumdisplay_sort')) ? eval($hook) : false;
if (!$handled)
{
$sqlsortfield = 'lastpost';
$sortfield='title';

Thanks Bernie
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:36 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.13207 seconds
  • Memory Usage 2,281KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete