Advanced Category options - Category management and displaying

Started by Gardain, September 14, 2009, 03:18:57 PM

Previous topic - Next topic

Arantor

And when following the tip did you use $settings or $context? My code uses $context because that's the proper place the variable should have been added, not $settings.

Gardain

it slipped from my attention it seems. Sorry for that. Ive changed it to context but im still receving the same error on the log  as well as seeing all the categories at once.

// Action and board are both empty... BoardIndex!
if (empty($board) && empty($topic))
{

$context['is_board_index'] = true;
require_once($sourcedir . '/BoardIndex.php');
return 'BoardIndex';

}

Arantor

Really not having a good time of this, am I? Oh well.

      WHERE ' . (!empty($context['is_board_index'] && $context['is_board_index']) ? 'b.id_board IN (44,45) AND ' : '') . '{query_see_board}' . (empty($boardIndexOptions['countChildPosts']) ? (empty($boardIndexOptions['base_level']) ? '' : '

Gardain

Im sure it started to get in to your nerves. If after this- still there is problem. Ill give it a rest for the night and bump the tread latter on.


Parse error: syntax error, unexpected T_BOOLEAN_AND, expecting ')' in /Sources/Subs-BoardIndex.php on line 74

Arantor

It's funny; I've been running this almost exact code between you and someone else in 2.x Support, and this one's my screw-up (which I fixed there just now too!)

      WHERE ' . ((!empty($context['is_board_index']) && $context['is_board_index']) ? 'b.id_board IN (44,45) AND ' : '') . '{query_see_board}' . (empty($boardIndexOptions['countChildPosts']) ? (empty($boardIndexOptions['base_level']) ? '' : '

* Arantor shouldn't try coding at gone 1am. At least not while coding two other projects at the same time.

Gardain

There is no error on the log.

But - still i see all the other boards.

Ok for now i rest my case. Thanks for your effort. Until now i managed without this feature - i think i can survive few more days. Ill bump the tread tomarow. ill be up all night doing few other things. Ill check the tread just in case.

Here is the final code that ive submited on my sub-boardindex
      WHERE ' . ((!empty($context['is_board_index']) && $context['is_board_index']) ? 'b.id_board IN (44,45) AND ' : '') . '{query_see_board}' . (empty($boardIndexOptions['countChildPosts']) ? (empty($boardIndexOptions['base_level']) ? '' : '
         AND b.child_level >= {int:child_level}') : '
         AND b.child_level BETWEEN ' . $boardIndexOptions['base_level'] . ' AND ' . ($boardIndexOptions['base_level'] + 1)),
      array(
         'current_member' => $user_info['id'],
         'child_level' => $boardIndexOptions['base_level'],
         'blank_string' => '',
      )



Arantor


Gardain

The code
// Action and board are both empty... BoardIndex!
if (empty($board) && empty($topic))
{

$context['is_board_index'] = true;
require_once($sourcedir . '/BoardIndex.php');
return 'BoardIndex';

}


Arantor


Gardain

no error filled.
Im refreshing as i look through pages.
But the log is currently empty

Ps: the first few codes did work on hiding the boards. (if you remember) But than the rest of the boards were not appearing . Maybe there might be an alternative way to access the boards which i can use.



Arantor

It's got to be a conditionally applied statement to hide the boards while you're on the board index, and not elsewhere.

Gardain

Quote from: Arantor on September 14, 2009, 09:25:20 PM
It's got to be a conditionally applied statement to hide the boards while you're on the board index, and not elsewhere.

I didnt understand this but to answer the part with the index. Yes. Those boards should be hidden in index while i may have access to them from external link.

Ps: You said (at the begining) your code was hiding the boards. Now we are going the other way around. May be if you give the code with the boards numbers that should be hidden, ill enter them one by one and give that a try

Arantor

The problem is that the code I used was from a mod whose purpose was to hide the boards fully. This needs to be more permissive but it's late and I'm not sure what's wrong with it.

Gardain

Ok than. Thanks again.
Ill hopefully bump the tread tomarow or the day after.
Till than I hope any one reading this and has idea also would like to share with us.

Gardain


Advertisement: