Welcome to Geeklog, Anonymous Saturday, December 28 2024 @ 10:29 am EST

Geeklog Forums

Hand-coding Topics Block


GeekyBodhi

Anonymous
Hi,

If I understand correctly, GL has a variable that stores all the topics and uses the variable fill up the Topics block?

(1) What variable is it?

Now suppose I have 6 topics. But I only want to display 4 in the Topics block. The other two I want to display in another custom block. Adding links to topics in a custom block is a walk-in-the-park. I jkust put simple HTML links to the topics in the new block.

(2) But, which file do I modify to tell GL not to use the variable values for the topics block and rather display the links that I have hard-coded?

!
GeekyBodhi
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by GeekyBodhi: If I understand correctly, GL has a variable that stores all the topics and uses the variable fill up the Topics block?

There's no such variable. Geeklog stores the topics in the database.

The function COM_showTopics in lib-common.php displays the Topics block. You could make a copy of that function (put it into your lib-custom.php) and modify it to your needs.

bye, Dirk
 Quote

GeekyBodhi

Anonymous
Thanks for clearing that up Dirk. But still how do I restrict the number of entries in the Topics/Sections block? I can't use the WHERE clause as it is being appended to the query in the function.

If I modify the original SQL statement
$sql = "SELECT tid,topic,imageurl FROM {$_TABLES['topics']}";

and include some WHERE OR clauses, can I modify this statement

$sql .= " WHERE (tid NOT IN ('" . str_replace( ' ', "','", $tids )
. "'))" . COM_getPermSQL( 'AND' );

and instead of WHERE say AND?

I know this isn't an issue of GL but rather SQL. Any help would be appreciated.

!
GK
 Quote

GeekyBodhi

Anonymous
BTW, just wondering......if I disable the function COM_showTopics and create my own custom simple HTML blocks, what functionalities do I stand to loose? Does anyone think this is a better option than what I have proposed above?
 Quote

Helper 3

Anonymous
you will not lose any functionality.

if you are starting a fresh site and have predetermined topics , u can just put off the GL topics block and use ur own html block

in future if u add new topic just edit this html block

ideally, the topics block shud have been 'editable' - which topics to show and 'up down' movements but all things in the world are not ideal

but at least u can make things appear as u want with GL
 Quote

All times are EST. The time is now 10:29 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