Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 09-07-2008, 10:10 AM
legionofangels's Avatar
legionofangels legionofangels is offline
 
Join Date: Mar 2007
Posts: 485
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Array Question

Ok so lets say I'm using, found, or made a code to pull data from certain forum id's and I'm using an Array to show the specific forums I want the data pulled from.

What happens in an instance when ...and this might be a strange question, but lets say I want to restrict it, but I have hundreds of forums that it's to be restricted to. So for example I have 300 forums I want to be in the array, and there id's are in order 165 - 465 is there anyway to code it without typing in every one as 165, 166, 167, 168, 169, 170, 171, etc.???

For example like:

array 165 - 465.

Can this be done, if so can you tell me what that line of code would be to do that?
Reply With Quote
  #2  
Old 09-07-2008, 10:29 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Start by posting hte code you have until now.
Reply With Quote
  #3  
Old 09-07-2008, 10:35 AM
legionofangels's Avatar
legionofangels legionofangels is offline
 
Join Date: Mar 2007
Posts: 485
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Marco van Herwaarden View Post
Start by posting hte code you have until now.
It's not totally complete, going to finish it tomorrow, and double check somethings with my other "coder". However just for the sake of the question, since I don't know why it would be different in some instances, let's say I was using vb.com's customization here:

Code:
<script type="text/javascript" src="external.php?forumids=95,96,97,98&type=js"></script>
We most likely won't be using that, however I'm still wondering how you show an array that's a huge array, without manually typing 300 forum id's.

Thanks Marco for any help.
Reply With Quote
  #4  
Old 09-08-2008, 07:05 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The standard vB external script does not support ranges of forumid's. This would also not make much sense on most boards as id's have no meaning.
Reply With Quote
  #5  
Old 09-08-2008, 04:40 PM
legionofangels's Avatar
legionofangels legionofangels is offline
 
Join Date: Mar 2007
Posts: 485
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Marco van Herwaarden View Post
The standard vB external script does not support ranges of forumid's. This would also not make much sense on most boards as id's have no meaning.
I think you basically answered the question in saying there is no way to code an array of forums without manually typing each of there id's.

But I don't understand how it wouldn't make sense on most boards. The code that we were talking about in the other thread pulls the latest active threads on any page. You can also specify which specific forum's it will pull from, by using the forum id's. The problem is that it seems we cant' use a forum category number and have it pull threads from all it's subforums. It needs to have the specific forum id's, and when you have a large section of a board or you have like 30 to add to the code, it would help if there was a faster way like a range, instead of manully typing them one by one.
Reply With Quote
  #6  
Old 09-09-2008, 05:03 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I mean that a range might not make much sense as the numbers are meaningless.

If you have for example forumid's 1, 2 & 3. 1 & 3 couldbe in the same category, where forumid 2 could be totally unrelated. So using a range would not make much sense.
Reply With Quote
  #7  
Old 09-09-2008, 03:07 PM
legionofangels's Avatar
legionofangels legionofangels is offline
 
Join Date: Mar 2007
Posts: 485
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Marco van Herwaarden View Post
I mean that a range might not make much sense as the numbers are meaningless.

If you have for example forumid's 1, 2 & 3. 1 & 3 couldbe in the same category, where forumid 2 could be totally unrelated. So using a range would not make much sense.
I see what you mean. As the id's are based on just like members that join, therefore if when making my forum I added some forums later and added some within some existing cats, the ranges might not be accurate.

I just wish there was a way to do it though, since there will be large chunks of one section we're using a similar code for that has a ton of forums, but I guess I could do it backwards and just restrict all the other id's on the forum, except for the big section. Therefore making my work less tedious.
Reply With Quote
  #8  
Old 09-09-2008, 04:14 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Making a modification (or request it at vB.com as default feature) to allow sub-forums would be more usefull i guess.
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 01:43 AM.


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.04050 seconds
  • Memory Usage 2,227KB
  • Queries Executed 13 (?)
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
  • (1)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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_postinfo_query
  • fetch_postinfo
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete