Downsize Any Larges Images
Verfasst: 06.06.2005 15:01
wieso klappt das verkleinern bei den meisten styles nicht kann man daran irgendwas ändern?
phpBB.de - Die deutsche phpBB-Community
https://www.phpbb.de/community/
Code: Alles auswählen
##############################################################
## MOD Title: Downsize Any Larges Images
## MOD Author: rossmcclymont < rossmcclymont@gmail.com > (Ross McClymont) http://www.xboxelite.co.uk
## MOD Description: This simple script will downsize ANY image on any page of your forum with the full header included. Admin configurable.
## MOD Version: 1.0.0
##
## Installation Level: (Easy)
## Installation Time: ~5 Minutes (~1 minute with Nutty99's great EasyMOD!)
## Files To Edit:
## admin_board.php
## board_config_body.tpl
## lang_admin.php
## page_header.php
## overall_header.tpl
## Included Files: N/A
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes:
## - This script will downsize ANY images on any page with the full header on it.
## - That includes your logo if it's bigger than your specified maximum!
## - I've defaulted the maximum width to 500px.
## - If you don't want it to be 500, you can change it on the Admin Config page.
##############################################################
## MOD History:
##
## 2004-11-08 - Version 1.0.0
## - Submitted into phpBB.com's MOD Database - first official release!
##
## 2004-11-07 - Version 0.1.0
## - Made maximum width configurable through Admin Panel.
##
## 2004-10-27 - Version 0.0.3
## - Added full-sized images in pop-up functionality.
##
## 2004-10-26 - Version 0.0.2
## - Fixed a rather important bug. :D
##
## 2004-10-25 - Version 0.0.1
## - Initial testing release!
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ SQL ]---------------------------------
#
INSERT INTO `phpbb_config` VALUES ('imagewidth', '500');
#
#-----[ OPEN ]---------------------------------
#
admin/admin_board.php
#
#-----[ FIND ]---------------------------------
#
"L_ENABLE_PRUNE" => $lang['Enable_prune'],
#
#-----[ AFTER, ADD ]---------------------------------
#
"L_IMAGEWIDTH" => $lang['imagewidth'],
"L_IMAGEWIDTH_EXPLAIN" => $lang['imagewidth_explain'],
#
#-----[ FIND ]---------------------------------
#
"PRUNE_NO" => $prune_no,
#
#-----[ AFTER, ADD ]---------------------------------
#
"IMAGEWIDTH" => $new['imagewidth'],
#
#-----[ OPEN ]---------------------------------
#
templates/subSilver/admin/board_config_body.tpl
#
#-----[ FIND ]---------------------------------
#
<tr>
<td class="row1">{L_ENABLE_PRUNE}</td>
<td class="row2"><input type="radio" name="prune_enable" value="1" {PRUNE_YES} /> {L_YES} <input type="radio" name="prune_enable" value="0" {PRUNE_NO} /> {L_NO}</td>
</tr>
#
#-----[ AFTER, ADD ]---------------------------------
#
<tr>
<td class="row1">{L_IMAGEWIDTH}<br /><span class="gensmall">{L_IMAGEWIDTH_EXPLAIN}</span></td>
<td class="row2"><input class="post" type="text" maxlength="3" size="5" name="imagewidth" value="{IMAGEWIDTH}" /></td>
</tr>
#
#-----[ OPEN ]------------------------------------------------
#
language/lang_english/lang_admin.php
#
#-----[ FIND ]------------------------------------------------
#
//
// That's all Folks!
#
#-----[ BEFORE, ADD ]------------------------------------------
#
$lang['imagewidth'] = "Maximum Image Width (pixels)";
$lang['imagewidth_explain'] = "Make sure none of your template files are bigger than this width!";
#
#-----[ OPEN ]---------------------------------
#
includes/page_header.php
#
#-----[ FIND ]---------------------------------
#
'PRIVMSG_IMG' => $icon_pm,
#
#-----[ AFTER, ADD ]---------------------------------
#
'IMAGEWIDTH' => $board_config['imagewidth'],
#
#-----[ OPEN ]---------------------------------
#
templates/subSilver/overall_header.tpl
#
#-----[ FIND ]---------------------------------
#
<!-- END switch_enable_pm_popup -->
#
#-----[ AFTER, ADD ]---------------------------------
#
<script>
window.onload = resizeimg;
function resizeimg()
{
if (document.getElementsByTagName)
{
for (i=0; i<document.getElementsByTagName('img').length; i++)
{
im = document.getElementsByTagName('img')[i];
if (im.width > {IMAGEWIDTH})
{
im.style.width = '{IMAGEWIDTH}px';
eval("pop" + String(i) + " = new Function(\"pop = window.open('" + im.src + " ','fullscale','width=400,height=400,scrollbars=1,resizable=1'); pop.focus();\")");
eval("im.onclick = pop" + String(i) + ";");
if (document.all) im.style.cursor = 'hand';
if (!document.all) im.style.cursor = 'pointer';
im.title = 'Click to enlarge';
}
}
}
}
</script>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM