PDA

View Full Version : Array Question


legionofangels
09-07-2008, 10:10 AM
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?

Marco van Herwaarden
09-07-2008, 10:29 AM
Start by posting hte code you have until now.

legionofangels
09-07-2008, 10:35 AM
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:

<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.

Marco van Herwaarden
09-08-2008, 07:05 AM
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.

legionofangels
09-08-2008, 04:40 PM
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.

Marco van Herwaarden
09-09-2008, 05:03 AM
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.

legionofangels
09-09-2008, 03:07 PM
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.

Marco van Herwaarden
09-09-2008, 04:14 PM
Making a modification (or request it at vB.com as default feature) to allow sub-forums would be more usefull i guess.