News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Linktree links for custom action

Started by Karmalakas, July 27, 2005, 08:22:47 AM

Previous topic - Next topic

Karmalakas

1st sorry if it was somewhere (couldn't find)

2nd my problem:
I added custom action and made it as home page.  On this home page I dont want a link tree to appear so i removed ', theme_linktree(), ' from the template, but...

... when i go to ......../index.php?action=forum then the linktree itself is ok but the 1st two links are:
http://www.mysite.lt/discuss/index.php and http://www.mysite.lt/discuss/index.php#1 (which links to home page) :(
other links are ok cause there's some ...?action... or ...?board=... and so on

sory for such explanation of my problem but couldn't explain more clearly

any advices?
thanx in advance

Karmalakas

So if noone knows the answer i think i'll just remove ', theme_linktree(), ' from index template :(

[Unknown]

The linktree is loaded in Load.php:

// Build up the linktree.
$context['linktree'] = array_merge(
$context['linktree'],
array(array(
'url' => $scripturl . '#' . $board_info['cat']['id'],
'name' => $board_info['cat']['name']
)),
array_reverse($board_info['parent_boards']),
array(array(
'url' => $scripturl . '?board=' . $board . '.0',
'name' => $board_info['name']
))
);


// Set the top level linktree up.
array_unshift($context['linktree'], array(
'url' => &$scripturl,
'name' => &$context['forum_name']
));


-[Unknown]

Karmalakas

Quote from: [Unknown] on August 02, 2005, 06:04:18 AM

// Set the top level linktree up.
array_unshift($context['linktree'], array(
'url' => &$scripturl,
'name' => &$context['forum_name']
));


that means i just have to add this code?

[Unknown]

You'll have to change it to have whatever URLs you want... that code is already there.

-[Unknown]

Karmalakas

Thanx [Unknown]
that works just fine ;)

But another similar link problem in category titles (not in linktree)
where should i change that? cause it shows http://www.mysite.lt/discuss/index.php#1 for General category

Thanx again

Karmalakas

One more thing i noticed
in wap i have to enter ......./discuss/index.php?action=forum;wap2
it's ok, but after loging in it redirects to ...../discuss/index.php :(
any ideas?

[Unknown]

Quote from: CRONUS on August 03, 2005, 03:26:50 AM
Thanx [Unknown]
that works just fine ;)

But another similar link problem in category titles (not in linktree)
where should i change that? cause it shows http://www.mysite.lt/discuss/index.php#1 for General category

Thanx again

That's in the first block of code I quoted.

Quote from: CRONUS on August 04, 2005, 08:14:01 AM
One more thing i noticed
in wap i have to enter ......./discuss/index.php?action=forum;wap2
it's ok, but after loging in it redirects to ...../discuss/index.php :(
any ideas?

I'm afraid you'll have to look for places where it says:

redirectexit();

And change to:

redirectexit('action=forum');

-[Unknown]

Karmalakas

Quote from: [Unknown] on August 06, 2005, 03:30:32 PM
That's in the first block of code I quoted.

Well i've changed 'url' => $scripturl . '#' . $board_info['cat']['id'], to 'url' => $scripturl . '?action=forum#' . $board_info['cat']['id'], and it's ok with the linktree and when you're logged in it ok because there's
.../index.php?action=collapse;c=1;sa=collapse;#1
but if you're logged out it's
.../index.php#1
and i need
.../index.php?action=forum#1

www.mobiles.lt/discuss/index.php?action=forum

[Unknown]

That's in the BoardIndex.template.php file, I'm afraid...

-[Unknown]

Karmalakas

I think it's the code
// 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'], '


But what to change to what?  :-[
Sorry if i'm bothering You but i'm really not strong in PHP

[Unknown]

Replace:

', $category['link'], '

With:

<a href="', $scripturl, '?action=forum#', $category['id'], '">', $category['name'], '</a>

-[Unknown]

Karmalakas

#12
Works like a charm :)

and maybe the last question related with categories

Where to search to change the same thing for Dropdown menu at the bottom where "Jump To:" is
I found in MessageIndex.template.php
// Show each category - they all have an id, name, and the boards in them.
foreach ($context['jump_to'] as $category)
{
// Show the category name with a link to the category. (index.php#id)
echo '
<option value="" disabled="disabled">-----------------------------</option>
<option value="#', $category['id'], '">', $category['name'], '</option>
<option value="" disabled="disabled">-----------------------------</option>';

but i'm not sure what to change :(


[edit] i've changed <option value="#', $category['id'], '"> to <option value="?action=forum#', $category['id'], '"> and it's ok in viewing topic list, but i can't find where to change so it would be ok when viewing Posts (i was looking in Post.template.php but couldn't find) [/edit]

[Unknown]

Look at Display.template.php.

-[Unknown]

Karmalakas

Thanks ;)
I found it and it works fine :)

Karmalakas

Now another problem :-\

i've made action=forum because my home page is not forum
so when i go to forum in linktree it shows:
MOBILES.lt | Forum
but if i go to board or topic then it shows:
MOBILES.lt | Board | Topic
how to make so MOBILES.lt | Forum | Board | Topic would be shown in linktree when viewing board or topics ???

Thanx

Karmalakas

I think that support is getting worse and worse without [Unknown] and Grudge :(

Sheepy

Grudge is focusing on RC2 I think.  Look for in function loadTheme() in Load.php, find    "// Set the top level linktree up." which is where the forum name is added.

Karmalakas

#18
But in my site "// Set the top level linktree up." has to be "MOBILES.lt" as it is now
i just need to make so that "Forum" would the second in linktree when browsing the forum


ok i made it so instead of category name it shows "Forum" but links to category :P ;)

Sheepy

Aha. You see, you can append to the top level linktree, which adds a new second tire linktree, instead of replacing it.

Advertisement: