Welcome to all phpBB2 Refugees!This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area. |
|
Author |
Message |
Sylver Cheetah 53 Board Member
Joined: 17 Dec 2008
Posts: 426 Location: Milky Way
|
Posted: Thu Jan 07, 2010 10:02 am Post subject: Secondary Forum Descriptions in viewtopic also |
|
|
Hi!
I am using Secondary Forum Descriptions MOD, wich puts a more detailed description on viewforum, like in phpBB3. But I want it to show up in viewtopic also.
The install instructions can be found here.
I have tryed this:
Code: | OPEN
viewtopic.php
FIND
'TOPIC_TITLE' => $topic_title,
AFTER, ADD
'FORUM_DESC_LONG' => $forum_desc_long,
OPEN
viewtopic_body.tpl
FIND
<td align="left" valign="bottom" colspan="2"><a class="maintitle" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a><br />
AFTER, ADD
<span class="gen">{FORUM_DESC_LONG}</span><br /> |
But it doesn't work. Probably I have to try something else in the PHP file, but can't figure out just what.
Thanks! _________________ Image link
My Forum || My Blog
phpBB2 forever! |
|
Back to top |
|
|
Salvatos Board Member
Joined: 19 Feb 2009
Posts: 449 Location: Québec
|
Posted: Thu Jan 07, 2010 1:38 pm Post subject: Re: Secondary Forum Descriptions in viewtopic also |
|
|
I haven't looked at the MOD, so I'll just give you a clue about what could be the problem.
I am guessing the MOD adds some code to viewforum.php to create the $forum_desc_long variable you refer to and "exports" it to the .tpl the same way you did above. However, if you want to use it in viewtopic.php, you also have to create it in there because it does not exist yet. You can probably use a piece of code similar to what has been done in viewforum.php to create $forum_desc_long there as well and the rest of your modification should work as a charm.
Hope that helps |
|
Back to top |
|
|
Sylver Cheetah 53 Board Member
Joined: 17 Dec 2008
Posts: 426 Location: Milky Way
|
Posted: Thu Jan 07, 2010 4:35 pm Post subject: Re: Secondary Forum Descriptions in viewtopic also |
|
|
Thanks for your reply and interest!
What is this MOD ask me to put in viewforum.php is simply this:
Code: | FIND
'FORUM_NAME' => $forum_row['forum_name'],
AFTER, ADD
'FORUM_DESC_LONG' => $forum_row['forum_desc_long'], |
That's it!
And in viewforum_body.tpl is this:
Code: | FIND
<td align="left" valign="bottom" colspan="2"><a class="maintitle" href="{U_VIEW_FORUM}">
IN LINE FIND
{FORUM_NAME}</a>
IN LINE AFTER, ADD
<br /><span class="gen">{FORUM_DESC_LONG}</span> |
Well, I've tryed to adapt it, as you can see in my previous post, but can't get it to work. _________________ Image link
My Forum || My Blog
phpBB2 forever! |
|
Back to top |
|
|
Salvatos Board Member
Joined: 19 Feb 2009
Posts: 449 Location: Québec
|
Posted: Thu Jan 07, 2010 11:48 pm Post subject: Re: Secondary Forum Descriptions in viewtopic also |
|
|
Alright, I took a look at the MOD file you linked to and it's pretty much what I thought.
viewforum.php uses the $forum_row variable to retrieve the forum's description at the same time as the rest of the forum's information, so all you have to do is to add the forum_desc_long template variable to the rest.
viewtopic.php, however, uses $forum_topic_data to retrieve the topic's relevant information but only a few details about the forum. Thus, what you have to do is to add the forum's long description to the data that is fetched.
I won't tell you how to do that because I am not advanced enough for phpBB's way of handling SQL, but if it were me looking for a fix, I'd try to add an element to this query:
Code: | $sql = "SELECT t.topic_id, t.topic_title, t.topic_status (...) |
Something that would look like "f.forum_desc_long", then use $forum_topic_data['forum_desc_long'] to set 'FORUM_DESC_LONG'.
I'm not sure it would work, though |
|
Back to top |
|
|
Sylver Cheetah 53 Board Member
Joined: 17 Dec 2008
Posts: 426 Location: Milky Way
|
Posted: Fri Jan 08, 2010 5:27 pm Post subject: Re: Secondary Forum Descriptions in viewtopic also |
|
|
That did the trick! Thanks a lot.
I did this:
Code: | FIND
$sql = "SELECT t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, t.topic_last_post_id
IN LINE FIND
f.forum_name,
IN LINE AFTER, ADD
f.forum_desc_long,
FIND
$forum_name = $forum_topic_data['forum_name'];
AFTER, ADD
$forum_desc_long = $forum_topic_data['forum_desc_long'];
FIND
'FORUM_NAME' => $forum_name,
AFTER, ADD
'FORUM_DESC_LONG' => $forum_desc_long, |
It seems I was on the right track but needed a hand. I wish you all the best! _________________ Image link
My Forum || My Blog
phpBB2 forever! |
|
Back to top |
|
|
Salvatos Board Member
Joined: 19 Feb 2009
Posts: 449 Location: Québec
|
Posted: Fri Jan 08, 2010 11:25 pm Post subject: Re: Secondary Forum Descriptions in viewtopic also |
|
|
I'm glad we got it. Haven't seriously done PHP in months, so it feels good to still be able to find fixes like that
Good luck |
|
Back to top |
|
|
|
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0492 seconds using 17 queries. (SQL 0.0098 Parse 0.0007 Other 0.0386) |
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com
|
|