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.

[Release] Forum Logo and Logo Link in ACP


 
Search this topic... | Search MOD Development... | Search Box
Register or Login to Post    Index » MOD Development  Previous TopicPrint TopicNext Topic
Author Message
espicom
Board Member



Joined: 24 Nov 2008

Posts: 55
Location: Woodstock, IL


flag
PostPosted: Tue Jan 13, 2009 8:36 am 
Post subject: [Release] Forum Logo and Logo Link in ACP

Author notes: The files linked in this message are TEXT files. They are not compressed, they do not contain any support files, nor do they contain any extra XML stuff. As such, the SQL statements included within the MODs must be manually executed by you, using a tool like phpmyadmin, or whatever your host provides as a means of manipulating your database.

They should be opened with a TEXT editor. Notepad is an example of a TEXT editor. UltraEdit is an example of a really good, but not free, text editor. Don't let Windows try to figure out how to open it on its own, because it will get it wrong. How wrong it will get it depends upon what software you have previously installed.

If you are unfamiliar with how to "open a text file", or it bothers you that a MODification file has a file extension that is also used by several dozen other programs, change the file extension to ".txt". Windows usually figures that one out. You can also select the contents of the CODE boxes below, copy the text to your clipboard, and then paste it into a TEXT editor on your system, and, finally, save them to any file name or extension you wish.


MOD Name: Logo to Admin CP
Author: espicom
MOD Description: Move the configuration of path for the forum logo to the admin control panel, and allow different styles to have their own, configurable logo

MOD Version: 1.1.3

Download File: LogoConfigTheme1_1_3.MOD
File Size: 9939 Bytes

Support for these MODs need to be asked within this topic. All have been tested with version 2.0.19 and later of phpBB.

Author notes: The files linked in this message are TEXT files. They should be opened it with a TEXT editor. Notepad is a TEXT editor. Don't let Windows try to figure it out, because it will get it wrong. How wrong it will get it depends upon what software you have previously installed.

If you are unfamiliar with how to "open a text file", or it bothers you that a MODification file has a file extension that is also used by several dozen other programs, change the file extension to ".txt". Windows usually figures that one out. You can also select the contents of the CODE boxes below, copy the text to your clipboard, and then paste it into a TEXT editor on your system, and, finally, save them to any file name or extension you wish.

Code:
##############################################################
## MOD Title: Move forum logo setting to phpbb_config table
## MOD Author: espicom < phpbb2mods@espi.com > http://espi.com/
## MOD Description: Removes hard-coded logo from overall_header.tpl
## MOD Version: 1.1.3
##
## Installation Level: Easy
## Installation Time: ~10 Minutes
## Files To Edit: includes/page_header.php,
##                admin/admin_board.php,
##                admin/admin_styles.php,
##                templates/subSilver/overall_header.tpl,
##                templates/subSilver/admin/board_config_body.tpl,
##                templates/subSilver/admin/styles_edit_body.tpl,
##                language/lang_english/lang_admin.php
## Included Files: n/a
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes:
## This version of the MOD adds provision for changing this value through PHPBB's ACP.
## I put this together so that I could remove the hard-coded logo value in overall_header.tpl,
## so that it is easier to mass-upgrade our forums as PHPBB is upgraded. Since the config table
## value would be separate for each forum, simply copying the updated files into place from the
## master copy would accomplish the update with minimum fuss.
##
## Updated version allows you to have theme-specific logos, if desired.
##
## Prior to installing this mod, you need to add a configuration item to your phpbb_config table,
## and alter your phpbb_theme table.
##
## INSERT INTO phpbb_config (config_name,config_value) VALUES ('forum_logo','/path/to/desired/logo');
## ALTER TABLE phpbb_themes ADD theme_logo VARCHAR( 255 ) NOT NULL AFTER head_stylesheet;
##
## Of course, you need to substitute the names for YOUR config table and the path to your logo.
## The path to the logo file must be the same path the browser would use to retrieve it. It can be
## relative, absolute, or "fully qualified". Examples, assuming your site is accessed as
## http://www.mysite.com/phpbb2/ and your logo is in phpbb2/templates/subSilver/images/mylogo.gif,
## you can use either of these paths:
## /phpbb2/templates/subSilver/images/mylogo.gif  (absolute path)
## templates/subSilver/images/mylogo.gif          (relative path)
## http://www.mysite.com/phpbb2/templates/subSilver/images/mylogo.gif (fully qualified path)
##
## Logo is in /images/mylogo.gif, off your main site, you can use:
## /images/mylogo.gif                             (absolute path)
## ../images/mylogo.gif                           (relative path)
## http://www.mysite.com/images/mylogo.gif        (fully qualified path)
##
## Logo is hosted on another server, http://www.othersite.com/images/mylogo.gif, must use:
## http://www.othersite.com/images/mylogo.gif     (fully qualified path)
##
## When saving the files to a live site, save include/page_header.php first, so that everything will
## be in place when the revised template/subSilver/overall_header.tpl is saved. As long as you do not
## go into the Administrative Control Panel, the order of saving the other files is unimportant.
##
## IMPORTANT!!!!!!!!!!!!!
## If you are using any templates other than subSilver, overall_header.tpl, admin/board_config_body.tpl,
## and admin/styles_edit_body.tpl in each of them will need to be modified, as well.
##
## If you are using any languages other than English, lang_admin.php in each language will need to
## be modified, as well.
##
## Note to EasyMOD users, per Throckmorton:
## Even though EasyMOD will install to multiple templates, overall_header.tpl still needs to be edited
## manually in any template that does not initially point to "templates/subSilver/images/logo_phpBB.gif"
## as the logo source.
##
##############################################################
## MOD History:
##
##   2006-02-01 - Version 1.1.3
##      - Changes to make it more likely EasyMOD will be able to edit templates with other MODs in them,
##        including the FIND string I broke when I submitted a bug report...
##   2006-01-16 - Version 1.1.2
##      - No substantive changes, other than for MODDB submission criteria
##   2005-08-15 - Version 1.1.1
##      - Fixed spelling problem per correction by Throckmorton
##   2005-08-14 - Version 1.1.0
##      - Added the ability to select different logos for different themes
##   2005-08-10 - Version 1.0.4
##      - Fixed spelling problem to make compatible with EasyMOD per suggestion by Throckmorton
##   2005-03-05 - Version 1.0.3
##      - Moved L_SITE_LOGO_EXPLAIN to more logical location
##   2005-03-05 - Version 1.0.2
##      - Adminstrative Control Panel interface added
##   2005-03-04 - Version 1.0.1
##      - Path explanation expanded
##   2005-03-04 - Version 1.0.0
##      - mod created
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#-----[ SQL ]-------------------------------------------
#
INSERT INTO phpbb_config(config_name, config_value) VALUES ('forum_logo', 'templates/subSilver/images/logo_phpBB.gif');
ALTER TABLE phpbb_themes ADD theme_logo VARCHAR( 255 ) NOT NULL DEFAULT '';
#
#-----[ OPEN ]------------------------------------------
#
includes/page_header.php
#
#-----[ FIND ]------------------------------------------
#
   'SITE_DESCRIPTION' => $board_config['site_desc'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
   'SITE_LOGO' => ($theme['theme_logo'] == '' ? $board_config['forum_logo'] : $theme['theme_logo']),
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_board.php
#
#-----[ FIND ]------------------------------------------
#
   "L_SITE_DESCRIPTION" => $lang['Site_desc'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
   'L_SITE_LOGO' => $lang['Forum_logo'],
   'L_SITE_LOGO_EXPLAIN' => $lang['Site_logo_explain'],
#
#-----[ FIND ]------------------------------------------
#
   "SITE_DESCRIPTION" => $new['site_desc'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
   "SITE_LOGO" => $new['forum_logo'],
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_styles.php
#
#-----[ FIND ]------------------------------------------
#
         $updated['head_stylesheet'] = $HTTP_POST_VARS['head_stylesheet'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
         $updated['theme_logo'] = $HTTP_POST_VARS['theme_logo'];
#
#-----[ FIND ]------------------------------------------
#
            "L_STYLESHEET" => $lang['Stylesheet'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
            "L_THEME_LOGO" => $lang['Theme_logo'],
            "L_THEME_LOGO_EXPLAIN" => $lang['Theme_logo_explain'],
#
#-----[ FIND ]------------------------------------------
#
            "HEAD_STYLESHEET" => $selected['head_stylesheet'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
            "THEME_LOGO" => $selected['theme_logo'],
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/overall_header.tpl
#
#-----[ FIND ]------------------------------------------
#
            <td><a href="{U_INDEX}">
#
#-----[ IN-LINE FIND ]------------------------------------------
#
<img src="templates/subSilver/images/logo_phpBB.gif"
#
#-----[ IN-LINE REPLACE WITH ]---------------------------------------------
#
<img src="{SITE_LOGO}"
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/board_config_body.tpl
#
#-----[ FIND ]------------------------------------------
#
      <td class="row1">{L_SITE_DESCRIPTION}</td>
#
#-----[ FIND ]------------------------------------------
#
   </tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
   <tr>
      <td class="row1">{L_SITE_LOGO}<br /><span class="gensmall">{L_SITE_LOGO_EXPLAIN}</span></td>
      <td class="row2"><input class="post" type="text" size="40" maxlength="255" name="forum_logo" value="{SITE_LOGO}" /></td>
   </tr>
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/styles_edit_body.tpl
#
#-----[ FIND ]------------------------------------------
#
      <td class="row1">{L_STYLESHEET}:<br />
#
#-----[ FIND ]------------------------------------------
#
   </tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
   <tr>
      <td class="row1">{L_THEME_LOGO}<br /><span class="gensmall">{L_THEME_LOGO_EXPLAIN}</span></td>
      <td class="row2"><input class="post" type="text" size="25" maxlength="255" name="theme_logo" value="{THEME_LOGO}" /></td>
      <td class="row2">&nbsp;</td>      
   </tr>
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php
#
#-----[ FIND ]------------------------------------------
#
$lang['Site_desc'] = 'Site description';
#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['Forum_logo'] = 'Forum logo path';
$lang['Site_logo_explain'] = 'The path where your default forum logo graphic is located relative to the domain name.';
#
#-----[ FIND ]------------------------------------------
#
$lang['Stylesheet'] = 'CSS Stylesheet';
#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['Theme_logo'] = 'Forum logo path';
$lang['Theme_logo_explain'] = 'The path where your theme-specific forum logo graphic is located relative to the domain name.';
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM


What it looks like:
Image link

Version 1.1.x adds the ability to have theme-specific logos, as well as a default logo for those themes where you do not have a special logo. Management of these theme-specific logos is under the Style Admin->Management section of the Admin Control Panel:
Image link

From the forum side, it looks just like any other hard-coded logo.

Note: If you are using the Extreme Styles MOD, ABDev has provided the following additional edits, to make them work together. I make no representations as to being able say this is correct, because I do not use Extreme Styles, and have not tested this:

Code:
#
#-----[ OPEN ]------------------------------------------
#
admin/xs_edit_data.php
#
#-----[ FIND ]------------------------------------------
#
$vars_100 = array('head_stylesheet', 'body_background');
#
#-----[ AFTER, ADD ]------------------------------------------
#
$vars_255 = array('theme_logo');
#
#-----[ FIND ]------------------------------------------
#
   $len = 100;
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
         elseif(xs_in_array($var, $vars_255) || xs_in_array($sub, $vars_255))
         {
            $len = 255;
         }
#
#-----[ OPEN ]------------------------------------------
#
admin/xs_include.php
#
#-----[ FIND ]------------------------------------------
#
# This may be a partial find and not the whole line(s)
$vars = array('template_name'
#
#-----[ IN-LINE FIND ]------------------------------------------
#
, 'style_name'
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, 'theme_logo'
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_xs.php
#
#-----[ FIND ]------------------------------------------
#
# This may be a partial find and not the whole line(s)
#
$lang['xs_data_unknown']
#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['xs_data_theme_logo'] = 'Forum logo path';
#
#-----[ OPEN ]------------------------------------------
#
language/lang_french/lang_xs.php
#
#-----[ FIND ]------------------------------------------
#
# This may be a partial find and not the whole line(s)
#
$lang['xs_data_unknown']
#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['xs_data_theme_logo'] = 'Chemin du Logo du forum';
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM


Optional MOD: Logo link to Admin CP
Download File: LogoTarget.MOD
File Size: 6691 Bytes

MOD Version: 0.0.4
Installation Level: Easy
Installation Time: ~ 5 Minutes

This MOD is adds the capability to specify the target of the logo link in the Admin Control Panel. It does not require the logo MOD above, but it is compatible with it. That is why there is no separate screen shot for this MOD; it appears in the screen shot above, blurred just a bit.

Code:
##############################################################
## MOD Title: Logo link target setting to phpbb_config table
## MOD Author: espicom < phpbb2mods@espi.com > http://espi.com/
## MOD Description: Allow forum logo link to be changed in Admin Control Panel
## MOD Version: 0.0.4
##
## Installation Level: Easy
## Installation Time: ~10 Minutes
## Files To Edit: admin/page_header_admin.php
##                admin/admin_board.php
##                includes/page_header.php
##                language/lang_english/lang_admin.php
##                templates/subSilver/admin/board_config_body.tpl
##                templates/subSilver/overall_header.tpl
## Included Files: n/a
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes:
## This version of the MOD adds provision for changing the target of the forum logo link
## through PHPBB's ACP. Sometimes you need to override the default, calculated-by-PHPBB target
## with something else, such as a web site's main page instead of the forum's index page.
## While this normally isn't something you would change often, this MOD centralizes doing so.
## It is compatible with the Forum Logo to ACP MOD, which allows you to change the forum logo
## as well.
##
## Prior to installing this mod, you need to add a configuration item to your phpbb_config table.
##
## INSERT INTO phpbb_config (config_name,config_value) VALUES ('forum_logo_link','http://mysite.com/');
##
## Of course, you need to substitute the names for YOUR config table and the URL you want to use.
##
## IMPORTANT!!!!!!!!!!!!!
## If you are using any templates other than subSilver, admin/board_config_body.tpl
## will need to be modified in each of them, as well.
##
## If you are using any languages other than English, lang_admin.php in each language will need to
## be modified, as well.
##
## If you change the logo link in the ACP, it does not change the logo link on the page you are
## viewing until you refresh it in your browser. This is due to the nature of frames; the logo and
## its link are in a separate from from the configuration page.
##
## You should use fully-qualified URLs for the target. Relative URLs (without the http:// in front
## of them) will not work in all places where this link will be inserted. In particular, the ACP logo
## link will be incorrect if the non-ACP link works, and vice-versa. So make sure the link starts with
## "http://", has a proper domain name, and any necessary path information.
##
##############################################################
## MOD History:
##
##   2006-02-18 - Version 0.0.4
##      - Change how the logo is set to fix problem with board navigation
##   2006-02-16 - Version 0.0.3
##      - Changes to notes
##   2006-02-14 - Version 0.0.2
##      - Changes to notes and spelling corrections
##   2006-02-14 - Version 0.0.1
##      - mod created
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#-----[ SQL ]-------------------------------------------
# Replace http://www.mysite.com/ with a valid URL as a starting point
INSERT INTO phpbb_config(config_name, config_value) VALUES ('forum_logo_link', 'http://www.mysite.com/');
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_board.php
#
#-----[ FIND ]------------------------------------------
#
   "L_SITE_DESCRIPTION" => $lang['Site_desc'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
   'L_SITE_LOGO_LINK' => $lang['Forum_logo_link'],
   'L_SITE_LOGO_LINK_EXPLAIN' => $lang['Site_logo_link_explain'],
#
#-----[ FIND ]------------------------------------------
#
   "SITE_DESCRIPTION" => $new['site_desc'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
   "SITE_LOGO_LINK" => $new['forum_logo_link'],
#-----[ OPEN ]------------------------------------------
#
admin/page_header_admin.php
#
#-----[ FIND ]------------------------------------------
#
   'U_INDEX' => append_sid('../index.'.$phpEx),
#
#-----[ AFTER, ADD ]------------------------------------------
#
   'U_LOGO_LINK' => ($board_config['forum_logo_link'] != '' ? $board_config['forum_logo_link'] : append_sid('../index.'.$phpEx)),
#
#-----[ OPEN ]------------------------------------------
#
includes/page_header.php
#
#-----[ FIND ]------------------------------------------
#
   'U_INDEX' => append_sid('index.'.$phpEx),
#
#-----[ AFTER, ADD ]------------------------------------------
#
   'U_LOGO_LINK' => ($board_config['forum_logo_link'] != '' ? $board_config['forum_logo_link'] : append_sid('../index.'.$phpEx)),
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php
#
#-----[ FIND ]------------------------------------------
#
$lang['Site_desc'] = 'Site description';
#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['Forum_logo_link'] = 'Forum logo link URL';
$lang['Site_logo_link_explain'] = 'The URL you want users to be sent to when they click on your Forum Logo';
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/board_config_body.tpl
#
#-----[ FIND ]------------------------------------------
#
      <td class="row1">{L_SITE_DESCRIPTION}</td>
#
#-----[ FIND ]------------------------------------------
#
   </tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
   <tr>
      <td class="row1">{L_SITE_LOGO_LINK}<br /><span class="gensmall">{L_SITE_LOGO_LINK_EXPLAIN}</span></td>
      <td class="row2"><input class="post" type="text" size="40" maxlength="255" name="forum_logo_link" value="{SITE_LOGO_LINK}" /></td>
   </tr>
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/overall_header.tpl
#
#-----[ FIND ]------------------------------------------
#
            <td><a href="{U_INDEX}">
#
#-----[ IN-LINE FIND ]------------------------------------------
#
{U_INDEX}
#
#-----[ IN-LINE REPLACE WITH ]---------------------------------------------
#
{U_LOGO_LINK}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Back to top
Display posts from previous:   
Register or Login to Post    Index » MOD Development  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.0273 seconds using 15 queries. (SQL 0.0070 Parse 0.0005 Other 0.0199)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo