Topic: Some modifications for online consultation

Hello all

There are a couple of simple features I'd like to modify PunBB to achieve.  They are pretty simple so I'm not sure a full-blown extension is required, which is why I'm posting here.  Anyway, here they are:

1.  Display the forum description on the forum page.  This is to allow an introductory paragraph above the topics.  Pretty simple, I'm sure.  I'd like to remove the description from the category (home) page, because the descriptions will be pretty long in my forum, and place them instead above the table of topics on the forum page.

2.  Allow each forum to have a link set, which will appear below the table of topics.  In other words, in the Edit screen of a forum, have a field at the bottom where the administrator can paste in a URL, which will appear as a link below the topics.  The URL will link to a PDF survey, or an online survey, or whatever.

...the idea being that the category page lists the various consultations ('forums'), the forum page has a long description of the project that is being consulted on, users can discuss their ideas and forum their opinions, then they can click the link at the bottom of the project ('forum') page to go to the consultation itself (either in the forum of a document they fill out and email in, or an online survey, or whatever).

I imagine the first one is pretty simple, because it should just involve placing the template element which displays the description on the forum page instead of the category page.  The second one, I'm not so sure about.  I don't know how easy it would be to add an extra field to a forum's properties.

Any help or suggestions would be much appreciated!

-melat0nin

Re: Some modifications for online consultation

RE 1.

Pretty good idea; you want
'forum_desc'  taken out of
index.php  lines after  // Setup the forum description and mod list
then add it to
viewforum.php   maybe near // Setup main header

Would be a neat ext.

Re: Some modifications for online consultation

KeyDog wrote:

RE 1.

Pretty good idea; you want
'forum_desc'  taken out of
index.php  lines after  // Setup the forum description and mod list
then add it to
viewforum.php   maybe near // Setup main header

Would be a neat ext.

Excellent, I will give it a try. 

How about the second one?  I'm guessing all that's needed is to assign a variable, say $ext_url to the forum's attributes, then spit this out in a link in the template, something like this:

<a href="<?php echo $ext_url; ?>">Click here to complete the survey</a>

Adding to the software's core is a bit harder than just shuffling about template elements tho big_smile

Re: Some modifications for online consultation

Bump

Any ideas?  I think the first issue is easy - just templating. But how about the second?  Should be pretty simple for an extension - it's just adding a database field to each forum to contain a URL, which is displayed below the forum as a link.

Re: Some modifications for online consultation

Any thoughts?  I didn't think this would be a complicated extension.

Re: Some modifications for online consultation

Here is the short plan of extension.
Installation.
You should add new column to the table "forums". The code will look like:

<install><![CDATA[
     $forum_db->add_field('forums', 'consult_url', 'VARCHAR(200)', true);
]]></install>

Viewforum page.
You need to get consult_url of forum. The best place to do it - hook "vf_qr_get_forum_info". The code of extensions will look like:

        
<hook id="vt_qr_get_topic_info"><![CDATA[
      $query['SELECT'] .= ', f.consult_url';
]]></hook>

The consult_url stored in $cur_forum['consult_url'] now.
For output link you can use hook "vf_pre_topic_loop_start".
Forums page. Study out the code of "<FORUM_ROOT>/admin/forums.php" (lines 251-400). You can find here how to update forums parameters. If you have some questions, we will help you smile