Welcome to Geeklog, Anonymous Friday, April 26 2024 @ 10:38 am EDT

Geeklog Forums

Blocks Under Multiple Topics


Status: offline

inquest750

Forum User
Regular Poster
Registered: 03/04/05
Posts: 72
I need help in making certain blocks appear within about 5+ different sets of topics. Is there a way I can enter code in the actual article.php file so that with certain topics it ALWAYS pulls up certain blocks? Basically I want to be able to tell geeklog that is any of these articles are called, please always display these "blocks", if these articles are displayed , please display these blocks instead. I know that you can adjust this functionality within the admin but I need something where I can set these permissions for at least 4 articles per set. This would really help me accomplish a huge task with great ease. I am even willing to pay an amount for a hack like this.
 Quote

Status: offline

inquest750

Forum User
Regular Poster
Registered: 03/04/05
Posts: 72
Dirk, any suggestions other than creating a WHOLE LOT of blocks for each topic?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Nope.

Geeklog does not support multiple topics, sorry.

bye, Dirk
 Quote

Status: offline

inquest750

Forum User
Regular Poster
Registered: 03/04/05
Posts: 72
Quote by Dirk: Nope.

Geeklog does not support multiple topics, sorry.

bye, Dirk


ok, so I have a question then. When you create a block and specify the "Topic" in which for it to display. Where is that code written? What file specifically?

Ricardo
 Quote

Status: offline

LWC

Forum User
Full Member
Registered: 02/19/04
Posts: 818
public_html/lib-common.php
Mostly function COM_showBlocks

If I were you, I'd use PHPMyAdmin to manually change your chosen block's tid to something like "all, topicX, topicY, etc." - that is, a comma separated list (with spaces so it's more comfortable) of topics' names instead of just one, that starts with "all"' (e.g. "all, news, general").

Then, change this part in the aforementioned function
Text Formatted Code
    if( !empty( $topic ))
    {
        $sql .= " AND (tid = '$topic' OR (tid = 'all' AND type <> 'layout'))";
    }

 

to
Text Formatted Code
    if( !empty( $topic ))
    {
        $sql .= " AND (tid LIKE ', $topic' OR (tid = 'all' AND type <> 'layout'))";
    }

 

I've simply changed "tid = '$topic'" to "LIKE ', $topic'".

But you'd have to re-prepare that list in MyPHPAdmin each time after you edit your block in Geeklog (assuming you can even edit it in Geeklog without changing it back to using only one topic first).
 Quote

All times are EDT. The time is now 10:38 am.

  • 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