Icon mod

Hulp nodig bij een modificaties of op zoek naar een MOD? Bekijk ons archief. Support wordt helaas niet meer verleend.
Forumregels

Sinds 1 januari 2009 wordt phpBB2 niet meer ondersteund.
Onderstaande informatie is verouderd en dient uitsluitend als archief.
phpBB2.0.x
Gesloten
Lextravaganza
Berichten: 111
Lid geworden op: 24 apr 2005, 17:26

Icon mod

Bericht door Lextravaganza » 03 mei 2005, 22:02

Hoi,

Ik heb de iconmod van Mac geïnstalleerd, wat ik 100% zeker goed heb gedaan.
Hij geeft ook geen enkele foutmelding, alleen ik kan nog steeds geen plaatjes voor mijn fora zetten (op de index).
Waar kan ik plaatjes uploaden, waar zet ik dat neer...
Het enige wat bij mij is veranderd na het draaien van deze mod zie je in bijgaande screen.... :help:

Afbeelding


Groetjes, Lex

Gebruikersavatar
Bee
Berichten: 13403
Lid geworden op: 29 aug 2004, 10:30

Bericht door Bee » 04 mei 2005, 07:11

Je kan de locatie waar de icoontjes staan veranderen in de Algemene Configuratie.
... Maar ik modereer (nog) niet.

Lextravaganza
Berichten: 111
Lid geworden op: 24 apr 2005, 17:26

Bericht door Lextravaganza » 04 mei 2005, 16:21

Hoi,

Inderdaad had ik dat over het hoofd gezien :oops:
Maar als ik nu de link invul in bijgevoegde screen met de path die er staat (die ik uiteraard ook heb aangemaakt) en op ok klik...is het veld erna weer blanco...hij pakt hem dus op één of andere manier niet.
Afbeelding

Hieronder de modinstall....wie o wie helpt me uit de brand :shock:

Code: Selecteer alles

######################################################## 
## MOD Title:		Forum Icon with ACP Control - List Box Option
## MOD Version:		1.0.4
## MOD Author:		Mac (Y.C. LIN) < ycl_6@sinamail.com > http://endless-tw.net
##
## MOD Description:	This mod allow admin to give each forum a icon in the ACP
##			Icons will show on index
## 
## Installation Level:	Easy 
## Installation Time:	5 Minutes 
##
## Files To Edit:	10
##	index.php
##	viewforum.php
##	admin/admin_board.php
##	admin/admin_forums.php
##	language/lang_english/lang_admin.php
##	templates/subSilver/admin/forum_admin_body.tpl
##	templates/subSilver/admin/board_config_body.tpl
##	templates/subSilver/admin/forum_edit_body.tpl
##	templates/subSilver/index_body.tpl
##	templates/subSilver/viewforum_body.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:
##	Set your forum icon image paths as those rank images
##
##	If you wish to using the DEFAULT option,
##	you have to follow the default instruction. Please DO NOT using the below code!
##	Both options CANNOT be used together.
## 
############################################################## 
## MOD History: 
##
##   2003-11-04 - Version 1.0.0
##      - Initial Release
##
##   2003-11-08 - Version 1.0.1
##      - Checked for 2.0.6 competibility, no change in coding
##
##   2003-11-15 - Version 1.0.2
##      - Corrections were made for phpBB MOD Database submission
##
##   2003-12-01 - Version 1.0.3
##      - Forum icon selectable using list box (Option 2)
##	- Add forum icon image to Forum Administration main panel
##	- Add forum icon image to corresponding the viewforum.php
##
##   2004-02-11 - Version 1.0.4
##      - Fix ListBox no-picture problem when icon is slected for the first time
##		People using the default option DOES NOT need to upgrade
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
##############################################################
# 
#-----[ SQL ]------------------------------------------ 
#
# Remember to change the table prefix used on your database
ALTER TABLE `phpbb2_forums` ADD `forum_icon` VARCHAR( 255 ) default NULL;
INSERT INTO `phpbb2_config` VALUES ('forum_icon_path', '');

# 
#-----[ OPEN ]------------------------------------------ 
# 
language/lang_english/lang_admin.php

# 
#-----[ FIND ]------------------------------------------ 
#
$lang['Forum_status'] = 'Forum status';

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
$lang['Forum_icon'] = 'Forum icon'; // Forum Icon MOD
$lang['Forum_icon_path'] = 'Forum Icon Storage Path'; // Forum Icon MOD
$lang['Forum_icon_path_explain'] = 'Path under your phpBB root dir, e.g. images/forum_icons'; // Forum Icon MOD

# 
#-----[ OPEN ]------------------------------------------ 
# 
admin/admin_board.php

# 
#-----[ FIND ]------------------------------------------ 
#
	"L_AVATAR_GALLERY_PATH_EXPLAIN" => $lang['Avatar_gallery_path_explain'],

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
	"L_FORUM_ICON_PATH" => $lang['Forum_icon_path'], // Forum Icon MOD
	"L_FORUM_ICON_PATH_EXPLAIN" => $lang['Forum_icon_path_explain'], // Forum Icon MOD

# 
#-----[ FIND ]------------------------------------------ 
#
	"AVATAR_GALLERY_PATH" => $new['avatar_gallery_path'],

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
	"FORUM_ICON_PATH" => $new['forum_icon_path'], // Forum Icon MOD

# 
#-----[ OPEN ]------------------------------------------ 
#  
admin/admin_forums.php

# 
#-----[ FIND ]------------------------------------------ 
# 
				$row = get_info('forum', $forum_id);


# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
				// Forum Icon MOD
				$dir = @opendir($phpbb_root_path . $board_config['forum_icon_path']);
				$count = 0;
				while( $file = @readdir($dir) )
				{
					if( !@is_dir(phpbb_realpath($phpbb_root_path . $board_config['forum_icon_path'] . '/' . $file)) )
					{
						if( preg_match('/(\.gif$|\.png$|\.jpg|\.jpeg)$/is', $file) )
						{
							$forum_icons[$count] = $file; 
							$count++;
						}
					}
				}

				@closedir($dir);
				
				$forum_icons_list = "";
				for( $i = 0; $i < count($forum_icons); $i++ )
				{
					if ($forum_icons[$i] == $row['forum_icon'])
						$forum_icons_list .= '<option value="' . $forum_icons[$i] . '" selected="selected">' . $forum_icons[$i] . '</option>'; 
					else 
						$forum_icons_list .= '<option value="' . $forum_icons[$i] . '">' . $forum_icons[$i] . '</option>';
					$default_ficon = $forum_icons[0];
				}

# 
#-----[ FIND ]------------------------------------------ 
# 
				$forumstatus = $row['forum_status'];

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
				$forumicon = $row['forum_icon']; // Forum Icon MOD

# 
#-----[ FIND ]------------------------------------------ 
# 
				$forumstatus = FORUM_UNLOCKED;

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
				$forumicon = ''; // Forum Icon MOD

# 
#-----[ FIND ]------------------------------------------ 
# 
				'L_FORUM_STATUS' => $lang['Forum_status'],

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
				'L_FORUM_ICON' => $lang['Forum_icon'], // Forum Icon MOD

# 
#-----[ FIND ]------------------------------------------ 
#
				'DESCRIPTION' => $forumdesc)

# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
				'DESCRIPTION' => $forumdesc, 
				'ICON_LIST' => $forum_icons_list, // Forum Icon MOD
				'ICON_BASEDIR' => $phpbb_root_path . $board_config['forum_icon_path'], // Forum Icon MOD
				'ICON_IMG' => ( $forumicon ) ? $phpbb_root_path . $board_config['forum_icon_path'] . '/' . $forumicon : $phpbb_root_path . $board_config['forum_icon_path'] . '/' . $default_ficon // Forum Icon MOD
				)

# 
#-----[ FIND ]------------------------------------------ 
#
			// There is no problem having duplicate forum names so we won't check for it.
			$sql = "INSERT INTO " . FORUMS_TABLE . " (forum_id, forum_name, cat_id, forum_desc, forum_order, forum_status, prune_enable" . $field_sql . ")

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#
forum_status

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
, forum_icon

# 
#-----[ FIND ]------------------------------------------ 
#
				VALUES ('" . $next_id . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', $next_order, " . intval($HTTP_POST_VARS['forumstatus']) . ", " . intval($HTTP_POST_VARS['prune_enable']) . $value_sql . ")";

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#
, " . intval($HTTP_POST_VARS['forumstatus']) . "

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
, '" . str_replace("\'", "''", $HTTP_POST_VARS['forumicon']) . "'

# 
#-----[ FIND ]------------------------------------------ 
#
			$sql = "UPDATE " . FORUMS_TABLE . "
				SET forum_name = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', cat_id = " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", forum_desc = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', forum_status = " . intval($HTTP_POST_VARS['forumstatus']) . ", prune_enable = " . intval($HTTP_POST_VARS['prune_enable']) . "
				WHERE forum_id = " . intval($HTTP_POST_VARS[POST_FORUM_URL]);
# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#
, forum_status = " . intval($HTTP_POST_VARS['forumstatus']) . "

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
, forum_icon = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumicon']) . "'

# 
#-----[ FIND ]------------------------------------------ 
# 
					'FORUM_DESC' => $forum_rows[$j]['forum_desc'],

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
					'FORUM_ICON_IMG' => ( $forum_rows[$j]['forum_icon'] ) ? '<img src="' . $phpbb_root_path . $board_config['forum_icon_path'] .'/' . $forum_rows[$j]['forum_icon'] . '" alt="'.$forum_data[$j]['forum_name'].'" title="'.$forum_data[$j]['forum_name'].'" />' : '', // Forum Icon Mod

# 
#-----[ OPEN ]------------------------------------------ 
#  
index.php

# 
#-----[ FIND ]------------------------------------------ 
# 
							$posts = $forum_data[$j]['forum_posts'];
							$topics = $forum_data[$j]['forum_topics'];

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
							$icon = $forum_data[$j]['forum_icon'];	// Forum Icon Mod

# 
#-----[ FIND ]------------------------------------------ 
# 
								'FORUM_FOLDER_IMG' => $folder_image, 

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
								'FORUM_ICON_IMG' => ($icon) ? '<img src="' . $phpbb_root_path . $board_config['forum_icon_path'] . '/' . $icon . '" alt="'.$forum_data[$j]['forum_name'].'" title="'.$forum_data[$j]['forum_name'].'" />' : '',	// Forum Icon Mod

# 
#-----[ OPEN ]------------------------------------------ 
#  
viewforum.php

# 
#-----[ FIND ]------------------------------------------ 
# 
	'FORUM_NAME' => $forum_row['forum_name'],

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
	'FORUM_ICON_IMG' => ($forum_row['forum_icon']) ? '<img src="' . $phpbb_root_path . $board_config['forum_icon_path'] . '/' . $forum_row['forum_icon'] . '" alt="'.$forum_row['forum_name'].'" title="'.$forum_row['forum_name'].'" />&nbsp;' : '', // Forum Icon Mod

# 
#-----[ OPEN ]------------------------------------------ 
#  
templates/subSilver/admin/board_config_body.tpl

# 
#-----[ FIND ]------------------------------------------ 
# 
	<tr>
		<td class="row1">{L_SYSTEM_TIMEZONE}</td>
		<td class="row2">{TIMEZONE_SELECT}</td>
	</tr>

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
	<tr>
		<td class="row1">{L_FORUM_ICON_PATH} <br /><span class="gensmall">{L_FORUM_ICON_PATH_EXPLAIN}</span></td>
		<td class="row2"><input class="post" type="text" size="20" maxlength="255" name="forum_icon_path" value="{FORUM_ICON_PATH}" /></td>
	</tr>

# 
#-----[ OPEN ]------------------------------------------ 
#  
templates/subSilver/admin/forum_edit_body.tpl

# 
#-----[ FIND ]------------------------------------------ 
# 
<p>{L_FORUM_EXPLAIN}</p>

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
<script language="javascript" type="text/javascript">
<!--
function update_forum_icon(newimage)
{
	document.forum_icon.src = "{ICON_BASEDIR}/" + newimage;
}
//-->
</script>

# 
#-----[ FIND ]------------------------------------------ 
# 
	<tr> 
	  <td class="row1">{L_FORUM_NAME}</td> 
	  <td class="row2"><input type="text" size="25" name="forumname" value="{FORUM_NAME}" class="post" /></td> 
	</tr> 

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
	<tr> 
	  <td class="row1">{L_FORUM_ICON}</td>
	  <td class="row2"><select name="forumicon" onchange="update_forum_icon(this.options[selectedIndex].value);">{ICON_LIST}</select> &nbsp; <img name="forum_icon" src="{ICON_IMG}" border="0" alt="" /> &nbsp;</td>
	</tr>

# 
#-----[ OPEN ]------------------------------------------ 
#  
templates/subSilver/admin/forum_admin_body.tpl

# 
#-----[ FIND ]------------------------------------------ 
# 
		<td class="row2"><span class="gen"><a href="{catrow.forumrow.U_VIEWFORUM}" target="_new">{catrow.forumrow.FORUM_NAME}</a></span><br /><span class="gensmall">{catrow.forumrow.FORUM_DESC}</span></td>

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#
		<td class="row2"><span class="gen">

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
{catrow.forumrow.FORUM_ICON_IMG}&nbsp;&nbsp;

# 
#-----[ OPEN ]------------------------------------------ 
# 
templates/subSilver/index_body.tpl

# 
#-----[ FIND ]------------------------------------------ 
# 
	<th colspan="2" class="thCornerL" height="25" nowrap="nowrap">&nbsp;{L_FORUM}&nbsp;</th>

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#
colspan="2"

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 
colspan="3"

# 
#-----[ FIND ]------------------------------------------ 
#
	<td class="catLeft" colspan="2" height="28"><span class="cattitle"><a href="{catrow.U_VIEWCAT}" class="cattitle">{catrow.CAT_DESC}</a></span></td>

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#
colspan="2"

# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
colspan="3"

# 
#-----[ FIND ]------------------------------------------ 
#
	<td class="row1" align="center" valign="middle" height="50"><img src="{catrow.forumrow.FORUM_FOLDER_IMG}" width="46" height="25" alt="{catrow.forumrow.L_FORUM_FOLDER_ALT}" title="{catrow.forumrow.L_FORUM_FOLDER_ALT}" /></td>

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
	<td class="row1" align="center" valign="middle" height="50">{catrow.forumrow.FORUM_ICON_IMG}</td>

# 
#-----[ OPEN ]------------------------------------------ 
# 
templates/subSilver/viewforum_body.tpl

# 
#-----[ FIND ]------------------------------------------ 
# 
	  <td align="left" valign="bottom" colspan="2"><a class="maintitle" href="{U_VIEW_FORUM}">{FORUM_NAME}</a>

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#
	  <td align="left" valign="bottom" colspan="2">

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
{FORUM_ICON_IMG}

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 

# EoM

Groetjes, Lex

Lextravaganza
Berichten: 111
Lid geworden op: 24 apr 2005, 17:26

Bericht door Lextravaganza » 05 mei 2005, 16:57

Ben er nog steeds niet uit...iemand?

Gebruikersavatar
Luuk
Berichten: 7311
Lid geworden op: 22 okt 2003, 10:07
Locatie: Delft

Bericht door Luuk » 06 mei 2005, 16:10

Het pad dat je opgeeft is vanaf de phpBB root map, dus bijvoorbeeld http://www.domein.nl/forum. Als je plaatjes staan in http://www.domein.nl/forum/images/icons/ moet je daar images/icons invullen.
Afbeelding

Lextravaganza
Berichten: 111
Lid geworden op: 24 apr 2005, 17:26

Bericht door Lextravaganza » 06 mei 2005, 16:34

Dat vul ik daar ook in... en precies zoals het moet, maar het veld is nadat ik op OK klik weer blanco... en het toevoegen werkt daardoor dus ook niet :(

Gebruikersavatar
Luuk
Berichten: 7311
Lid geworden op: 22 okt 2003, 10:07
Locatie: Delft

Bericht door Luuk » 06 mei 2005, 16:45

Heb je ook de sql uitgevoerd die bij de mod zat?
Afbeelding

Lextravaganza
Berichten: 111
Lid geworden op: 24 apr 2005, 17:26

Bericht door Lextravaganza » 07 mei 2005, 14:37

Ik kreeg de volgende fout met het draaien van de SQL:

Afbeelding

Dat had ik gevraagd aan iemand en die zei dat dat geen probleem was, omdat de table al bestond, wat best mogelijk is omdat ik al een eerdere iconmod had geprobeerd en dus ook die SQL had gedraaid.


Groetjes, Lex


Ps: Kom er dus nog steeds niet uit :help:

Gesloten