Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Reorganize Subscribed Forums by Numerical Order Instead Of Alphabetical Order Details »»
Reorganize Subscribed Forums by Numerical Order Instead Of Alphabetical Order
Version: , by larryd larryd is offline
Developer Last Online: Jun 2011 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 05-26-2002 Last Update: Never Installs: 0
 
No support by the author.

Ive been toying around tonight with creating a new page called favorites.php that will allow me to display just the forums that Ive maked as the ones I want to suscribe to with a little bit of other basic information. Basically I reworked the usercp page, the only problem Im running into is that the forums are showing up in alphabetical format and thats not what i want, I want them to show up in the order they are displayed on the index.php file.. What do I have to change to do this? Here is the code for it

Code:
// ############################### start subscribed forums ###############################
$forums=$DB_site->query("SELECT * FROM forum,subscribeforum WHERE subscribeforum.forumid=forum.forumid AND userid=$bbuserinfo[userid] ORDER BY title");
$totalforums=$DB_site->num_rows($forums);

$forumbits = '';
if ($totalforums>0) {
  while ($forum=$DB_site->fetch_array($forums)) {

    $forumperms=getpermissions($forum[forumid]);
    if (!$hideprivateforums) {
      $forumperms[canview]=1;
    }
    if ($forumperms[canview]) {
      $forumshown=1;

      // do light bulb
      if ($bbuserinfo[lastvisitdate]=="Never") {
        $forum[onoff]="on";
      } else {
        if (isset($bbforumview[$forum['forumid']]) and $bbforumview[$forum['forumid']]>$bbuserinfo['lastvisit']) {
          $userlastvisit=$bbforumview[$forum['forumid']];
        } else {
          $userlastvisit=$bbuserinfo['lastvisit'];
        }
        if ($userlastvisit<$forum['lastpost']) {
          $forum[onoff]="on";
        } else {
          $forum[onoff]="off";
        }
      }

      if ((!$forumperms['canpostnew'] and $showlocks) or $forum['allowposting']==0) {
        $forum[onoff].="lock";
      }

      // prepare template vars
      if (!$showforumdescription) {
        $forum[description]="";
      }

      // dates
      if ($forum[lastpost]>0) {
        $forum[lastpostdate]=vbdate($dateformat,$forum[lastpost]);
        $forum[lastposttime]=vbdate($timeformat,$forum[lastpost]);
        eval("\$forum[lastpostinfo] = \"".gettemplate("forumhome_lastpostby")."\";");
      } else {
        $forum[lastpostinfo]="Never";
      }

      eval("\$forumbits .= \"".gettemplate("favorites_forumbit")."\";");

    } // if can view
  } // while forums

  eval("\$forumlist = \"".gettemplate("usercp_forums")."\";");

} else {
  eval("\$forumlist = \"".gettemplate("usercp_noforums")."\";");
}
if you want to see exactly what im talking about the page is located here

http://www.newcelica.org/forums/favorites.php?s=

Im still gonna change a few other things but the biggest thing I want to change is the display order of the forums from alphabetical to numercial.. thanks in advance guys..

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 05-26-2002, 09:52 AM
Dark_Wizard Dark_Wizard is offline
 
Join Date: Nov 2001
Location: North Carolina
Posts: 1,251
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Change this >> ORDER BY title << to what you need....could be id etc....
Reply With Quote
  #3  
Old 05-26-2002, 10:02 AM
larryd larryd is offline
 
Join Date: Nov 2001
Location: Newark, DE
Posts: 93
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

but what is the column name if its not title.. im not familair with the dbase setup
Reply With Quote
  #4  
Old 05-26-2002, 10:29 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<font face="Courier">ORDER BY forum.forumid</font>
Reply With Quote
  #5  
Old 05-26-2002, 10:38 AM
larryd larryd is offline
 
Join Date: Nov 2001
Location: Newark, DE
Posts: 93
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

close but now i got a nother issue.. that did arrange them by forum id, but thats not the way there displayed on the main page, on the main page there displayed by Forum Order which is specified in the forum control panel.. can i do the same here?
Reply With Quote
  #6  
Old 05-26-2002, 10:41 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That would be more complicated I'm afraid.
Reply With Quote
  #7  
Old 05-26-2002, 10:43 AM
larryd larryd is offline
 
Join Date: Nov 2001
Location: Newark, DE
Posts: 93
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yeah i figured as much, I dont understand why it has to be so complex.. I mean I can figure out the logic

go through the forums the same way the main page does and display them in display order and only show them if its marked as a favorite.. this would be a nice hack if I could figure out this one last thing
Reply With Quote
  #8  
Old 05-26-2002, 10:45 AM
Dark_Wizard Dark_Wizard is offline
 
Join Date: Nov 2001
Location: North Carolina
Posts: 1,251
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Why not ORDER BY forum.displayorder
Reply With Quote
  #9  
Old 05-26-2002, 10:47 AM
larryd larryd is offline
 
Join Date: Nov 2001
Location: Newark, DE
Posts: 93
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

wow.. that was simple.. that worked.. I just didnt know the right identifier.. AWESOME.. thanks everyone I might compile this whole mess up nicer and release it as a hack
Reply With Quote
  #10  
Old 05-26-2002, 10:49 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Dark_Wizard
Why not ORDER BY forum.displayorder
Because displayorders gets reset under each category.

See the screenshot if you don't understand.
Attached Files
File Type: (21.3 KB, 10 views)
Reply With Quote
Reply


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 12:50 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.20131 seconds
  • Memory Usage 2,319KB
  • Queries Executed 24 (?)
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)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (1)postbit_attachment
  • (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
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete