How to display FORUM_IMAGE in viewtopic_body.html

Discussions about the phpBB3 Forum. How to get the best from this powerful script.
Note that there is no official support for phpBB3 here, a place to share more than to ask for.

Moderator: Moderators

How to display FORUM_IMAGE in viewtopic_body.html

Postby easyexpat » Wed Mar 17, 2010 2:52 pm

Simple question in the title:
How do I dispaly {FORUM_IMAGE} in viewtopic_body.html ?
I can display the forum description with {FORUM_DESC} but it does not work with the forum image... :?:
easyexpat
 
Posts: 19
Joined: Fri Sep 25, 2009 10:06 am

Advertisement

Re: How to display FORUM_IMAGE in viewtopic_body.html

Postby easyexpat » Fri Mar 19, 2010 6:32 pm

Any idea for this question?

To put more information, I can give the example here: in viewtopic_body.html
Code: Select all
<!-- IF U_MCP --><p>[&nbsp;<a href="{U_MCP}">{L_MCP}</a>&nbsp;]</p><!-- ENDIF -->
<h2><img src="/images/ico-forums.gif" width="35" height="35" align="absbottom">&nbsp;<a href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a>&nbsp;<!-- IF FORUM_IMAGE --><img src="{FORUM_IMAGE}" alt="{FORUM_DESC}" align='absmiddle' /><!-- ENDIF --></h2>

<!-- IF FORUM_DESC -->
{FORUM_DESC}<br />
<!-- ENDIF -->


Here the {FORUM_DESC} works but {FORUM_IMAGE} doesn't.

Any help would be greatly appreciated... :)
easyexpat
 
Posts: 19
Joined: Fri Sep 25, 2009 10:06 am

Re: How to display FORUM_IMAGE in viewtopic_body.html

Postby austin881 » Fri Mar 19, 2010 8:33 pm

OPEN: root/viewtopic.php

FIND:
Code: Select all
   'FORUM_DESC'   => generate_text_for_display($topic_data['forum_desc'], $topic_data['forum_desc_uid'], $topic_data['forum_desc_bitfield'], $topic_data['forum_desc_options']),

AFTER ADD:
Code: Select all
   'FORUM_IMAGE'   => ($topic_data['forum_image']) ? '<img src="' . $phpbb_root_path . $topic_data['forum_image'] . '" alt="' . $topic_data['forum_name'] .  '" />' : '',


Then FORUM_IMAGE will work like you are wanting it to.

OPEN: root/styles/<your style>/template/viewtopic_body.html

FIND:
Code: Select all
<h2><a href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a></h2>

BEFORE ADD:
Code: Select all
<span class="forum-image">{FORUM_IMAGE}</span>
My dev playground: ModernDignity.com
Appreciate my assistance? You can thank me by linking to Chevy Truck Forum or Gas Scooters.
User avatar
austin881
phpBB SEO Team
phpBB SEO Team
 
Posts: 248
Joined: Wed Oct 28, 2009 12:16 am
Location: Boise, Idaho USA

Re: How to display FORUM_IMAGE in viewtopic_body.html

Postby easyexpat » Fri Mar 19, 2010 8:49 pm

Thanks a lot (I was wondering since last week!).
I also got a response here.

Even more straight forward:
Tom wrote:You'll have to make a small edit to a PHP file.

Open viewtopic.php in the phpBB root directory, then find this:

Code: Select all
   'FORUM_DESC'   => generate_text_for_display($topic_data['forum_desc'], $topic_data['forum_desc_uid'], $topic_data['forum_desc_bitfield'], $topic_data['forum_desc_options']),

After that on a new line, add this:

Code: Select all
   'FORUM_IMAGE'    => $topic_data['forum_image'],

Save the file and the forum image should now show for you in viewtopic.
easyexpat
 
Posts: 19
Joined: Fri Sep 25, 2009 10:06 am

Re: How to display FORUM_IMAGE in viewtopic_body.html

Postby susan123 » Mon May 24, 2010 9:31 am

Hi,

I have a little problem with this mod but just in this style:

I'm installing the mod Advertising Management 1.0.8 in this style, I've modified the overall_footer.html and it displays the ads, with some errors

this is how it shows the ads:nce test

Image

I also modified the viewtopic_body.html but nothing happens...

And finally, I have tried to modify the Overall_header.html, but there's some options that doesn't appear like:

<div id="wrapheader">
<div id="wrapcentre">



I have contacted the MOD designer, but he asked me to contact you...

Sorry if I missed something to tell you...

I'll upload the last attachment in the next post(only let me to upload 3 items)

Thanks in advance
susan123
 
Posts: 1
Joined: Mon May 24, 2010 9:25 am

Re: How to display FORUM_IMAGE in viewtopic_body.html

Postby easyexpat » Wed May 26, 2010 9:04 am

susan123 wrote:I have contacted the MOD designer, but he asked me to contact you...

To display FORUM_IMAGE in viewtopic_body.html? It has nothing to do with mod Advertising Management. You are obviously in the wrong topic.
easyexpat
 
Posts: 19
Joined: Fri Sep 25, 2009 10:06 am

Re: How to display FORUM_IMAGE in viewtopic_body.html

Postby nautica » Fri Nov 26, 2010 9:20 pm

Is there any way I can do the same thing but on viewforum_body?

I've tried placing the same forum image code under // Send vars to template like you did in viewtopic_body but it's not working. Please help.
nautica
 
Posts: 1
Joined: Fri Nov 26, 2010 9:15 pm

Re: How to display FORUM_IMAGE in viewtopic_body.html

Postby easyexpat » Mon Nov 29, 2010 6:45 pm

nautica wrote:Is there any way I can do the same thing but on viewforum_body?

But in the viewforum.php, the images ar already displayed as long as you set the images in the ACP:
In viewforum.php line 208 (for me) there is:
Code: Select all
$template->assign_vars(array(
   'U_VIEW_FORUM'         => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id&amp;start=$start"),
   'FORUM_IMAGE'         => $forum_data['forum_image'],
));


And at the beginning of viewforum_body.html I have:
Code: Select all
<!-- INCLUDE overall_header.html -->
<!-- IF U_MCP --><p>[&nbsp;<a href="{U_MCP}">{L_MCP}</a>&nbsp;]</p><!-- ENDIF -->
<h2><img src="/images/ico-forums.gif" width="35" height="35" align="absbottom">&nbsp;<a href="{U_VIEW_FORUM}">{FORUM_NAME}</a>&nbsp;<!-- IF FORUM_IMAGE --><img src="{FORUM_IMAGE}" alt="{FORUM_DESC}" align='absmiddle' /><!-- ENDIF -->
   </h2>
easyexpat
 
Posts: 19
Joined: Fri Sep 25, 2009 10:06 am


Return to phpBB Forum

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: Xee and 8 guests