TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,973
  • Latest: NonStop
Stats
  • Total Posts: 196,217
  • Total Topics: 21,351
  • Online today: 556
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online

stripping out the linktree - except while in the forums

Started by iowamf, November 06, 2005, 12:21:11 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

iowamf

The link tree is a valuable navigation tool while in the forums.  While not in the forums, it's use is questionable?

Question:  can I strip the linktree out - but keep it for use in the forums?

I've seen where the linktree() code is ... I'd just like to add an if statement at the beginning of the function to exit without doing anything unless the user is in the forums.  Is there some magic global "in_forums" context variable to do an "if" on in the linktree() function?

If anyone thinks this is a really stupid idea - please feel free chime in - wouldn't be the first time.
I can't see a purpose for the linktree outside of the forums.

Regards -

==

Quote from: Bloc on November 04, 2005, 11:47:34 AM
Stripping out linktree..the easiest is to just remove everything between

function linktree();
{
...and
}
- leaving just a empty function. For even more control copy it first, and name it linktree2, then call link-tree2 exactly where you want it, and in just the templates you need it to be. I have done that in quite a few themes...

Tippmaster

#1
you can use this.

if (@$_REQUEST['action'] == 'forum')
echo' ', theme_linktree(), '';


it's saying to display the linktree if and only if the action "forum" is requested.

iowamf

Thanks - that partially works.

Upon 1st entry into the forum (shot #1) the linktree is present.
However,  as soon as anything in the forum is selected, the link tree goes away (shot #2).

I wasn't sure what file to add your suggestion to - so I added the "if" as the first line of code in the function linktree() in the file index.template.php (and of course - closed off the if with another bracket near the end of the file).

if (@$_REQUEST['action'] == 'forum') {

Quote from: Tippmaster on November 06, 2005, 03:57:44 AM
you can use this.

if (@$_REQUEST['action'] == 'forum')
echo' ', theme_linktree(), '';


it's saying to display the linktree if and only if the action "forum" is requested.

Tippmaster

ah, i see. i guess i didnt realize how tp works. i thought that action=forum would be called the whole time you are in the forum, but it isnt, like in topic views, or even while im posting this message...

hang on. ill come up with something for you today.

bloc

Just take out the linktree call from TPortal.template, TPortalAdmin.template and TPmodules.template and it will show only in forum... ;)

iowamf

Excellent - thanks to all - only one edit in two files (it doesn't look like TPortalAdmin calls linktree).

Notes for the record (TinyPortal v.0.75):

I removed the call to "theme_linktree()" in files:


  • TPortal.template.php
  • TPmodules.template.php




Tippmaster

hehe. I forgot the linktree is called in each template individually. I was thinking it was in index.template, which would make it display everywhere (without the if statement)

my bad.  :D

houston


Rocket

Yes, it would be nice to easily disable that feature as it throws off the center bar so that it does not line up properly.  Maybe a checkbox in TP Admin? 

bloc

I can add it as a option - I can see it not being desireable in all situations.

This website is proudly hosted on Crocweb Cloud Website Hosting.