Ishimaru-Design > Home > Tutorials > phpBB3 > [prosilver] Category name as image

[phpBB3] [prosilver] Category name as image

  • Author : Ishimaru Chiaki
  • Posted on : 2013-10-24 05:58:32
  • Updated on : 2013-11-13 02:44:30
  • Comments : 0
  • Type : Styles
  • Level : Newbie

This tutorial will show you how to display your category names as images instead of plain text, in order to get a result that looks like this

Note : The tutorial has been tested on a vanilla phpBB 3.0.7-PL1 using Prosilver style

Special thanks to Dakin Quelia and Elglobo from the French community for their help in debugging my modification

Summary

  1. File modifications
  2. Setting up in ACP

File modifications

Warning : It is recommended to backup all your files before modifying them !


The following modifications must be followed as if you were installing a MOD.

OPEN

includes/functions_display.php

FIND, line 312 (this one, not line 469 !)

            'FORUM_IMAGE'            => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="' . $user->lang[$folder_alt] . '" />' : '',

REPLACE WITH

                'FORUM_IMAGE'            => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="' . (($row['forum_type'] == FORUM_CAT) ? $row['forum_name'] : $user->lang[$folder_alt]) . '" />' : '',

OPEN

styles/prosilver/template/forumlist_body.html

FIND, line 10

        <!-- IF forumrow.S_IS_CAT or forumrow.S_FIRST_ROW  or forumrow.S_NO_CAT  -->

AFTER, ADD

            <!-- IF forumrow.S_IS_CAT -->
            <h2 class="category"><a href="{forumrow.U_VIEWFORUM}"><!-- IF forumrow.FORUM_IMAGE -->{forumrow.FORUM_IMAGE}<!-- ELSE -->{forumrow.FORUM_NAME}<!-- ENDIF --></a></h2>
            <!-- ENDIF -->

FIND, line 19

                            <dt><!-- IF forumrow.S_IS_CAT --><a href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a><!-- ELSE -->{L_FORUM}<!-- ENDIF --></dt>

REPLACE WITH

                            <dt>{L_FORUM}</dt>

SAVE AND CLOSE ALL FILES

0 comments - Next