Where do I find . . . ?

Started by Porty, September 26, 2006, 12:31:27 PM

Previous topic - Next topic

jacortina

If you're using $category['link'], then you're basing this on category and not board (two different things).

But if you're trying to select on category, see if things work (and are easier to work with) using:

$category['catName'].

Porty


Porty

Nope. The echo statement brings up nothing.

Any other ideas?

Thanks for your patience.

jacortina

You're saying that setting $boardid to $category['link'] results in a value being echoed out, but setting it to $category['catName'] results in a blank? That's weird because 'catName' is one of the variable concatenated to build 'link'. Could you paste the result you get when you use 'link'.

Porty

What comes up with echo $boardid; is a 1 or a 0. I can't figure it out. (That is from catName.)

jacortina

Where in Boardindex.template.php is the board_links(...) call (paste a few lines on either side)?

Porty

Here is some more code (with my addition in bold):
// If this category even can collapse, show a link to collapse it.
                if ($category['can_collapse'])
                        echo '
                        <a href="', $category['collapse_href'], '">', $category['collapse_image'], '</a>';

                echo '
                        ', $category['link'], '
                </td>
                <td colspan="2" class="catbg', $category['new'] ? '2' : '', '" height="18" align="right">', board_links($category['catName']), '</td>
        </tr>';

                // Assuming the category hasn't been collapsed...
                if (!$category['is_collapsed'])

Porty

I actually got something! I used $category['name'] (I saw it above in the code somewhere) and the checks work. Now I just have to figure out how to get the links in.  :)

Thank you for all your help. It is much appreciated!

jacortina

Quote from: Porty on September 29, 2006, 04:59:19 PM

// If this category even can collapse, show a link to collapse it.
                if ($category['can_collapse'])
                        echo '
                        <a href="', $category['collapse_href'], '">', $category['collapse_image'], '</a>';

                echo '
                        ', $category['link'], '
                </td>
                <td colspan="2" class="catbg', $category['new'] ? '2' : '', '" height="18" align="right">', [b]board_links($category['catName'])[/b], '</td>
        </tr>';

                // Assuming the category hasn't been collapsed...
                if (!$category['is_collapsed'])

OK. A function call WILL evaluate to success/fail (1/0), which is the value being put in.

You either have to change your function to return a value or beak the function call out of the echo statement it's embedded in. The former is probably cleaner, but the latter allows multiple echos in the function for debug purposes.

                echo '
                        ', $category['link'], '
                </td>
                <td colspan="2" class="catbg', $category['new'] ? '2' : '', '" height="18" align="right">';
                board_links($category['name']);
                echo '</td>
        </tr>';


Porty

Thanks again for all your help.

I ended up checking $category['name'] and then building links depending on what the category was. All seems to be working fine now.

:)

Advertisement: