Firefox PHP

Output forum titles on all pages

Posted by stephanR 
Output forum titles on all pages
August 12, 2013 09:59AM
Hi,

I am new to phorum and have a problem with my template / view:

I want to show the main forum titles on all (some) pages.
So I looked at the index.tpl how it is done there and I copied the LOOP FORUMS into list.tpl, but that doesn't work.
I couldn't find where the variable FORUMS is build.

Is my request possible or must I create a module?

Thank you for help,
Stephan
Re: Output forum titles on all pages
August 12, 2013 08:01PM
that's build in index.php or the dependant functions. All data is only loaded for the views where its expected to be used.

Well, there are some modules which load the data and show them. jumpmenu module for example which shows a menu with the titles of the forums.
So a module would be the way to go but you could start with an existing one.


Thomas Seifert
Phorum Development Team / Mysnip-Solutions.de
Custom Phorum and general software development
worry-free Phorum Hosting




Edited 1 time(s). Last edit at 08/12/2013 08:16PM by Thomas Seifert.
Re: Output forum titles on all pages
August 14, 2013 08:57AM
That's what I thought. :)

OK, I found the jumpmenu allready and I think I will build a new module and take snippets of the jumpmenu.

Thank you!
Re: Output forum titles on all pages
August 15, 2013 09:28AM
Hi Stephan,

perhaps this module is the right one:

Module: Pervasive Forum

Regards
Oliver


Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Re: Output forum titles on all pages
August 15, 2013 03:14PM
Hi Oliver,

thank you for the hint!

I installed it, enabled it and defined the settings - but it doesn't seem to work.
Maybe it is not what I am looking for?

I managed it with a quick and very dirty solution: I put some PHP-Code with SQL-Queries in the template files, where I want it to show. :-)
I know, this is not a good solution, but it works. And if I have enough time one day, I will try it again with a module.

Stephan
Re: Output forum titles on all pages
August 15, 2013 03:22PM
Hi Stephan,

Quote
stephanR
I managed it with a quick and very dirty solution: I put some PHP-Code with SQL-Queries in the template files, where I want it to show. :-)

Were can we see it? Can you contribute the URL to your forum?

Regards
Oliver


Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Re: Output forum titles on all pages
August 16, 2013 08:55AM
Sorry, it is under development and just on my local machine. When it is online, I post the URL.

Here is the code snippet to show the forum titles:
Language: PHP
<?php $user_name = "###"; $password = "###"; $database = "###"; $server = "###"; $db_handle = mysql_connect($server, $user_name, $password); $db_found = mysql_select_db($database, $db_handle); if ($db_found) { $SQL = "SELECT forum_id, name FROM phorum_forums ORDER BY display_order"; $result = mysql_query($SQL); while ($db_field = mysql_fetch_assoc($result)) { echo "<tr><td><a href=\"list.php?" . $db_field[';forum_id';] . "\">" . $db_field[';name';] . "</a></td></tr>"; } mysql_close($db_handle); } else { print "Database NOT Found"; } ?>
Sorry, only registered users may post in this forum.

Click here to login