phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

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.

Secondary Forum Descriptions in viewtopic also


 
Search this topic... | Search MOD Requests... | Search Box
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Author Message
Sylver Cheetah 53
Board Member



Joined: 17 Dec 2008

Posts: 426
Location: Milky Way


flag
PostPosted: Thu Jan 07, 2010 2:02 pm 
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. icon_confused.gif
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. icon_rolleyes.gif

Thanks!

_________________
Image link
My Forum || My Blog

phpBB2 forever! icon_smile.gif
Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 415
Location: Québec


flag
PostPosted: Thu Jan 07, 2010 5: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 icon_smile.gif
Back to top
Sylver Cheetah 53
Board Member



Joined: 17 Dec 2008

Posts: 426
Location: Milky Way


flag
PostPosted: Thu Jan 07, 2010 8: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!
icon_confused.gif
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. icon_sad.gif

_________________
Image link
My Forum || My Blog

phpBB2 forever! icon_smile.gif
Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 415
Location: Québec


flag
PostPosted: Fri Jan 08, 2010 3:48 am 
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 icon_wink.gif
Back to top
Sylver Cheetah 53
Board Member



Joined: 17 Dec 2008

Posts: 426
Location: Milky Way


flag
PostPosted: Fri Jan 08, 2010 9:27 pm 
Post subject: Re: Secondary Forum Descriptions in viewtopic also

That did the trick! Thanks a lot. icon_wink.gif
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! icon_smile.gif

_________________
Image link
My Forum || My Blog

phpBB2 forever! icon_smile.gif
Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 415
Location: Québec


flag
PostPosted: Sat Jan 09, 2010 3:25 am 
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 icon_smile.gif

Good luck icon_smile.gif
Back to top
Display posts from previous:   
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0128 seconds using 15 queries. (SQL 0.0026 Parse 0.0003 Other 0.0100)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo