Welcome to Geeklog, Anonymous Sunday, December 22 2024 @ 01:51 pm EST

Geeklog Forums

Can you hide a Topic?


Status: offline

amy

Forum User
Junior
Registered: 08/11/10
Posts: 15
Location:Springfield, Mo
I'd like to write articles that are targeted towards long tail keywords, but not really relevant to my Topics index. Is there anyway to hide a topic from appearing in the Topics block?
Thank you.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
You could set the topic's permissions such that it's not visible for anonymous users. But that would then also apply to the stories under that topic, so it's probably not what you want.

Plan B: Disable the Topics block and replace it with a "normal" block where you list the topics yourself (in plain HTML).

bye, Dirk
 Quote

Status: offline

amy

Forum User
Junior
Registered: 08/11/10
Posts: 15
Location:Springfield, Mo
I'm thinking of a Plan C. Where is the code that lists the block topics at? I'm thinking a properly inserted "if" statement in that logic should do it. Now.. I'm new to "writing" php so this will be a chore.. but I'll give it a try!
Smile
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
function COM_showTopics() in lib-common.php

We recommend against changing Geeklog's core code since it usually causes pains when you upgrade. So may I suggest Plan D:

Copy the code from COM_showTopics into a new function in lib-custom.php, call it phpblock_mytopics or something similar (but starting with phpblock_). Then create a new "PHP block", specifying the name of the function you used. Then you should get a second topics block, after which you can disable the original and modify the copied code to suit your needs.

bye, Dirk
 Quote

Status: offline

amy

Forum User
Junior
Registered: 08/11/10
Posts: 15
Location:Springfield, Mo
Brilliant. I'll give it a go and let you know how it turns out.

Thanks, Dirk!
 Quote

Status: offline

amy

Forum User
Junior
Registered: 08/11/10
Posts: 15
Location:Springfield, Mo
Actually.. one last thought. The whole reason I was hoping to assign it to a Topic is so that it would appear in the rss feed (otherwise I could just use a static page). So.. with that in mind, does the rss feed look for the block topics before pulling the story to the rss feed? If so, then I probably won't try it.
Thanks again.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
You can create a feed for any public topic (i.e. one that anonymous users can see). It doesn't have anything to do with the Topics block.

bye, Dirk
 Quote

Status: offline

amy

Forum User
Junior
Registered: 08/11/10
Posts: 15
Location:Springfield, Mo
Alright.. Mission accomplished. Here's what I did... Created a new Topic called 'Articles'. In lib-common.php, I found the function you gave me (COM_showTopics) and found where it was grabbing the array.

Text Formatted Code
    while ($A = DB_fetchArray($result)) {
        $topicname = stripslashes($A['topic']);        
        $sections->set_var('option_url', $_CONF['site_url']
                                         . '/index.php?topic=' . $A['tid']);

I then added this right underneath that:
Text Formatted Code
                if($topicname == "Articles") {
         $sections->set_var('option_label', '');
            }

and then I took the next existing line of code and wrapped an else around it.. to form this:
Text Formatted Code
  else {                                                                  
        $sections->set_var('option_label', $topicname);
  }

Works perfect! I now have a topic that doesn't show up in the topic list.. but shows as featured or front page.. and in the rss feed. I then created a new block and manually linked to the topic, for segregation from my main topic list.

Sadly.. this took me about 3 hours! I kept going through the page code (trying to figure out what it was doing) and using php.net, but in the end, I was still pretty proud because I did it. Smile

Off to bed....
 Quote

All times are EST. The time is now 01:51 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content