[2.0.19] Forum Icon with ACP Control

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
36
60%
Very Good
14
23%
Good
6
10%
Fair
2
3%
Poor
2
3%
 
Total votes: 60

agent00shoe
Registered User
Posts: 373
Joined: Sat Feb 12, 2005 9:39 pm

Post by agent00shoe »

snafumaster wrote: Excellent job. Very happy with it. I opted for the images to be to the right of the forum name/description. For now, untill I can create or locate better images, I just put some semi-apropriate smilies in the spot.

I tried to modify it so that the images are clickable so that it brings you to the apropriate forum. When I did it like this

Code: Select all

<td class="row1" align="center" valign="middle" height="50"><a href="{catrow.forumrow.U_VIEWFORUM}">{catrow.forumrow.FORUM_ICON_IMG}</a></td>  
Image
I got a harsh border around the image. Might someone be able to suggest a better way to make this a link and not have the border. For now, I'll leave without, but I tink it would be better if they were links.

Thanks in advance if someone can assist.


You can either hard-code it in by finding the sections of the mod in index.php that look like this

Code: Select all

								'FORUM_ICON_IMG' => ($icon) ? '<img src="' . $phpbb_root_path . $icon . '" alt="'.$forum_data[$j]['forum_name'].'" title="'.$forum_data[$j]['forum_name'].'" />' : '',	// Forum Icon Mod
and add a border attribute like this

Code: Select all

								'FORUM_ICON_IMG' => ($icon) ? '<img border="0" src="' . $phpbb_root_path . $icon . '" alt="'.$forum_data[$j]['forum_name'].'" title="'.$forum_data[$j]['forum_name'].'" />' : '',	// Forum Icon Mod
or it can be done by adding this to the bottom of the template's external css file or right before the closing </style> tag in overall_header.tpl in the template's folder

Code: Select all

img{
border: none;
}
Last edited by agent00shoe on Sun Sep 11, 2005 12:49 am, edited 1 time in total.

ycl6
Translator
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 »

snafumaster wrote: Image
I got a harsh border around the image. Might someone be able to suggest a better way to make this a link and not have the border. For now, I'll leave without, but I tink it would be better if they were links.

Thanks in advance if someone can assist.

agent00shoe has provided you great solutions :wink:

~Mac

johnxoston
Registered User
Posts: 20
Joined: Mon Mar 28, 2005 4:30 pm

HELP ME PLEASE

Post by johnxoston »

I installed this mod, but in the position of the image in ACP (in every forum), it shows me a "X" ! :?

In the index page, there's space for the images!

But, when i choose a subject of a forum to make a reply or something else, it shows:

Code: Select all

Could not obtain forums information

DEBUG MODE

SQL Error : 1054 Unknown column 'forum_icon' in 'field list'

SELECT forum_icon FROM phpbbforums WHERE forum_id = 1

Line : 202
File : viewtopic.php
I'm not so good using php, but i think that

Code: Select all

#-----[ SQL ]------------------------------------------ 
#
# Remember to change the table prefix used on your database
ALTER TABLE `phpbb_forums` ADD `forum_icon` VARCHAR( 255 ) default NULL;
INSERT INTO `phpbb_config` VALUES ('forum_icon_path', '');
which are written in the explanation txt, causes the problem.....
Because, i can't understand what i have to do.

So.... HELP me please! :D

snafumaster
Registered User
Posts: 77
Joined: Wed Jun 23, 2004 11:07 am
Location: S. of Boston
Name: Matthew Gendreau
Contact:

Post by snafumaster »

agent00shoe wrote: You can either hard-code it in by finding the sections of the mod in index.php that look like this

Code: Select all

								'FORUM_ICON_IMG' => ($icon) ? '<img src="' . $phpbb_root_path . $icon . '" alt="'.$forum_data[$j]['forum_name'].'" title="'.$forum_data[$j]['forum_name'].'" />' : '',	// Forum Icon Mod
and add a border attribute like this

Code: Select all

								'FORUM_ICON_IMG' => ($icon) ? '<img border="0" src="' . $phpbb_root_path . $icon . '" alt="'.$forum_data[$j]['forum_name'].'" title="'.$forum_data[$j]['forum_name'].'" />' : '',	// Forum Icon Mod
or it can be done by adding this to the bottom of the template's external css file or right before the closing </style> tag in overall_header.tpl in the template's folder

Code: Select all

img{
border: none;
}
Thanks agent00shoe! I very much appreciate the help.
:D

I tried doing this on the tpl file. But I guess it has to be done on the php. I'll go with the first sugestion because that way it can only effect this mod.

edit to add:
Worked like a charm.

Thanks again.

snafumaster
Registered User
Posts: 77
Joined: Wed Jun 23, 2004 11:07 am
Location: S. of Boston
Name: Matthew Gendreau
Contact:

Re: HELP ME PLEASE

Post by snafumaster »

johnxoston wrote:

Code: Select all

#-----[ SQL ]------------------------------------------ 
#
# Remember to change the table prefix used on your database
ALTER TABLE `phpbb_forums` ADD `forum_icon` VARCHAR( 255 ) default NULL;
INSERT INTO `phpbb_config` VALUES ('forum_icon_path', '');
You need to enter that into your database. If you have phpmyadmin it's a breeze. Click the little sql button and add just the

Code: Select all

ALTER TABLE `phpbb_forums` ADD `forum_icon` VARCHAR( 255 ) default NULL;
INSERT INTO `phpbb_config` VALUES ('forum_icon_path', '');
and hit ok. That is the location where the adress of your image is stored.

johnxoston
Registered User
Posts: 20
Joined: Mon Mar 28, 2005 4:30 pm

Post by johnxoston »

THANK U VERY MUCH!!!

IT WORKS!!!

I had to change it a little bit, because i use a new version of phpbb, but it's ok!!!

THANK U AGAIN! :lol: :lol: :lol: :lol: :lol:

snafumaster
Registered User
Posts: 77
Joined: Wed Jun 23, 2004 11:07 am
Location: S. of Boston
Name: Matthew Gendreau
Contact:

Post by snafumaster »

johnxoston wrote: THANK U VERY MUCH!!!

IT WORKS!!!

I had to change it a little bit, because i use a new version of phpbb, but it's ok!!!

THANK U AGAIN! :lol: :lol: :lol: :lol: :lol:
You're quite welcome. Always happy to help. I'm not sure what you meant by "newer version of phpbb". Are you using something newer than 2.0.17 :?

johnxoston
Registered User
Posts: 20
Joined: Mon Mar 28, 2005 4:30 pm

Post by johnxoston »

No, 2.0.16! :lol: :lol:

But i had to make some changes in my database! I didn't make the changes alone, but i had some help! :wink:

Thank u for your definitions, anyway! :D

COMMENT: The mod is perfect!!!!!!!!!!!!!!!!!

aka_G
Registered User
Posts: 72
Joined: Sun Mar 13, 2005 3:17 am

plz help me to fix this index_body.tpl right

Post by aka_G »

hi,

Could anyone plz help to fix this index_body.tpl right to suite my Solaris template??? it is quite different with subsilver!!! Thanks a lot

Code: Select all





<!-- ************************************************************************************************** -->

<table width="100%" cellspacing="0" cellpadding="2" border="0" align="center">
  <tr> 
	<td align="left" valign="bottom"><span class="gensmall">
	<!-- BEGIN switch_user_logged_in -->
	{LAST_VISIT_DATE}<br />
	<!-- END switch_user_logged_in -->
	{CURRENT_TIME}<br /></span><span class="nav"><a href="{U_INDEX}" class="nav">{L_INDEX}</a></span></td>
	<td align="right" valign="bottom" class="gensmall">
		<!-- BEGIN switch_user_logged_in -->
		<a href="{U_SEARCH_NEW}" class="gensmall">{L_SEARCH_NEW}</a><br /><a href="{U_SEARCH_SELF}" class="gensmall">{L_SEARCH_SELF}</a><br />
		<!-- END switch_user_logged_in -->
		<a href="{U_SEARCH_UNANSWERED}" class="gensmall">{L_SEARCH_UNANSWERED}</a></td>
  </tr>
</table>



<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr> 
	  <td class="tableborder">
     
<!-- Start Newest Song By DB angel -->
<!-- BEGIN song_newest -->
     <table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
            <tr> 
	             <td align="center" class="catHead" colspan="3" height="28"><span class="cattitle">{song_newest.L_NEWEST_TITLE}</span></td>
            </tr>
     </table>                  
 <table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">		   
   <tr> 
      <th width="12%" class="thTop" nowrap="nowrap">{song_newest.L_NEWEST_SONG_IMAGE}</th> 
      <th width="30%" class="thTop" nowrap="nowrap">{song_newest.L_NEWEST_SONG_TITLE}</th> 
      <th width="15%" class="thTop" nowrap="nowrap">{song_newest.L_NEWEST_NAME}</th> 
      <th width="15%" class="thTop" nowrap="nowrap">{song_newest.L_NEWEST_SINGER}</th> 
      <th width="8%" class="thTop" nowrap="nowrap">{song_newest.L_NEWEST_VIEW}</th>                                   
      <th width="20%" class="thTop" nowrap="nowrap">{song_newest.L_NEWEST_TIME}</th> 
   </tr> 
<!-- END song_newest -->
<!-- BEGIN song --> 
   <tr> 
      <td align="center" class="row1"> 
         <span class="genmed">{song.NEWEST_SONG_IMAGE}</span> 
      </td> 
      <td align="center" class="row2"> 
         <span class="genmed"><a href="{song.NEWEST_SONG_TITLEURL}">{song.NEWEST_SONG_TITLE}</a></span> 
      </td> 
      <td align="center" class="row1"> 
         <span class="genmed"><a href="{song.NEWEST_NAMEURL}">{song.NEWEST_NAME}</a></span> 
      </td> 
      <td align="center" class="row2"> 
         <span class="genmed">{song.NEWEST_SINGER}</span> 
      </td> 
       <td align="center" class="row1"> 
         <span class="genmed">{song.NEWEST_VIEW}</span> 
      </td>                                        
       <td align="center" class="row2"> 
         <span class="genmed">{song.NEWEST_TIME}</span> 
      </td>
   </tr> 
<!-- END song --> 
   <tr> 
      <th align="center" valign="middle" colspan="6"></th> 
   </tr>      
</table>  
<!-- End Newest Song By DB angel -->

<!-- Top Topics on Index 1.1.0 - Begin Code Addition -->
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
  <tr> 
	<th width="25%" class="thTop" nowrap="nowrap">&nbsp;{L_TOPICSRECENT}&nbsp;</th>
	<th width="38%" colspan="2" class="thTop" nowrap="nowrap">&nbsp;{L_TOPICSPOPULAR}&nbsp;</th>
	<th width="37%" colspan="2" class="thTop" nowrap="nowrap">&nbsp;{L_TOPICSPOPULARVIEW}&nbsp;</th>
  </tr>
  <!-- BEGIN topicrecentpopular -->
  <tr> 
	<td width="29%" class="row2" align="left" valign="middle"><span class="gensmall">{topicrecentpopular.TOPICSRECENT}</span></td>
	<td width="31%" class="row2" align="left" valign="middle"><span class="gensmall">{topicrecentpopular.TOPICSPOPULAR}</span></td>
	<td width="6%" class="row2" align="center" valign="middle"><span class="gensmall">{topicrecentpopular.TOPICSPOPULARC}</span></td>
	<td width="29%" class="row2" align="left" valign="middle"><span class="gensmall">{topicrecentpopular.TOPICSPOPULARVIEW}</span></td>
	<td width="6%" class="row2" align="center" valign="middle"><span class="gensmall">{topicrecentpopular.TOPICSPOPULARVIEWC}</span></td>
  </tr>
  <!-- END topicrecentpopular -->
</table>
<!-- Top Topics on Index 1.1.0 - End Code Addition -->
		  
		  <table width="100%" border="0" cellspacing="1">
			  <tr> 
				<td width="73%" class="forumcolumns">&nbsp;{L_FORUM}&nbsp;</td>
				<td width="6%" class="forumcolumns">&nbsp;{L_TOPICS}&nbsp;</td>
				<td width="6%" class="forumcolumns">&nbsp;{L_POSTS}&nbsp;</td>
				<td width="15%" class="forumcolumns">&nbsp;{L_LASTPOST}&nbsp;</td>
			  </tr>

<!-- BEGIN catrow -->		

			  <tr> 
				<td colspan="4" class="categorybar">
		
					  <table border="0">
						<tr>
						  <td><img src="templates/Solaris/images/category_icon.gif" /></td>
						  <td><a href="{catrow.U_VIEWCAT}" class="cattitle">{catrow.CAT_DESC}</a></td>
						</tr>
					  </table>
					  
			 	 </td>
			  </tr>

<!-- BEGIN forumrow -->											
					  
			  <tr> 										  
				<td class="row1">

					<table border="0">
						<tr>
						  <td valign="top"><img src="{catrow.forumrow.FORUM_FOLDER_IMG}" alt="{catrow.forumrow.L_FORUM_FOLDER_ALT}" title="{catrow.forumrow.L_FORUM_FOLDER_ALT}" /></td>
						  <td valign="top"><a href="{catrow.forumrow.U_VIEWFORUM}" class="forumlink">{catrow.forumrow.FORUM_NAME}</a><br />
							  <span class="gensmall">{catrow.forumrow.FORUM_DESC}</span><br />
							  <span class="gensmall">{catrow.forumrow.L_MODERATOR} {catrow.forumrow.MODERATORS}</span></td>
						</tr>
					  </table>									  								  
				  </td>
				<!-- BEGIN switch_forum_link_off -->
					<td class="row1" align="center"><span class="gensmall">{catrow.forumrow.TOPICS}</span></td>
					<td class="row1" align="center"><span class="gensmall">{catrow.forumrow.POSTS}</span></td>
					<td class="row1" align="center"><span class="gensmall">{catrow.forumrow.LAST_POST}</span></td>
				<!-- END switch_forum_link_off -->
				<!-- BEGIN switch_forum_link_on -->
					<td class="row1" align="center" colspan="3"><span class="gensmall">{catrow.forumrow.FORUM_LINK_COUNT}</span></td>
				<!-- END switch_forum_link_on -->
				  </tr>
<!-- END forumrow -->
<!-- END catrow -->  												  

			</table>

				
		</td>
	</tr>
  </table>


<br />

<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr> 
		<td class="tableborder">

	  		<table width="100%" border="0" cellspacing="1">
				<tr> 
					<td colspan="2" bgcolor="#0C0C0C" class="categorybar">
		
						<table border="0">
							<tr>
								<td><img src="templates/Solaris/images/category_icon.gif" /></td>
								<td><span class="cattitle"><a href="{U_VIEWONLINE}" class="cattitle">{L_WHO_IS_ONLINE}</a></span></td>
							</tr>
						</table>
					
					</td>
				</tr>
				<tr>
					<td class="row1" align="center" valign="middle" rowspan="2" width="6%"><img src="templates/Solaris/images/whosonline.gif" alt="{L_WHO_IS_ONLINE}" /></td>
					<td class="row1" align="left" width="94%"><span class="gensmall">{TOTAL_POSTS}<br />{TOTAL_USERS}<br />{NEWEST_USER}</span></td>
				</tr>
				<tr>
					<td class="row1" align="left"><span class="gensmall">{TOTAL_USERS_ONLINE} &nbsp; [ {L_WHOSONLINE_ADMIN} ] &nbsp; [ {L_WHOSONLINE_MOD} ]<br />{RECORD_USERS}<br />{LOGGED_IN_USER_LIST}<br /><i>{L_ONLINE_EXPLAIN}</i></span></td>				
				</tr>
			</table>
		</td>
	</tr>
</table>
						  
<!-- BEGIN switch_user_logged_out -->
<form method="post" action="{S_LOGIN_ACTION}">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr> 
		<td class="tableborder">
					  
	  		<table width="100%" border="0" cellspacing="1" cellpadding="3">
				<tr> 
					<td colspan="3" bgcolor="#0C0C0C" class="categorybar">
							
						<table border="0">
							<tr>
								<td><img src="templates/Solaris/images/category_icon.gif" /></td>
								<td><a name="login"></a><span class="cattitle">{L_LOGIN_LOGOUT}</span></a></td>
							</tr>
						</table>
										  
					</td>
				</tr>
				<tr> 
	  				<td class="row1" align="center" valign="middle">
						<span class="gensmall"><strong>{L_USERNAME}</strong>&nbsp;&nbsp;<input class="post" type="text" name="username" size="10" /></span>
					</td>
					<td class="row1" align="center" valign="middle">
						<span class="gensmall"><strong>{L_PASSWORD}</strong>&nbsp;&nbsp;<input class="post" type="password" name="password" size="10" /></span>
					</td>
					<td class="row1" align="center" valign="middle">
						<span class="gensmall"><input class="text" type="checkbox" name="autologin" style="background-color : #060606;" /> {L_AUTO_LOGIN}</span>
 					</td>
				</tr>
				<tr>
					<td class="row1" align="center" colspan="3">
						<input type="submit" class="mainoption" name="login" value="{L_LOGIN}" />
						</span>
					</td>
				</tr>
			</table>
			
		</td>
	</tr>
</table>
</form>
<!-- END switch_user_logged_out -->								  

<br />

<table cellspacing="3" border="0" align="center" cellpadding="0">
  <tr> 
	<td width="20" align="center"><img src="templates/Solaris/images/folder_new.gif" alt="{L_NEW_POSTS}"/></td>
	<td><span class="gensmall">{L_NEW_POSTS}</span></td>
	<td>&nbsp;&nbsp;</td>
	<td width="20" align="center"><img src="templates/Solaris/images/folder.gif" alt="{L_NO_NEW_POSTS}" /></td>
	<td><span class="gensmall">{L_NO_NEW_POSTS}</span></td>
	<td>&nbsp;&nbsp;</td>
	<td width="20" align="center"><img src="templates/Solaris/images/folder_lock.gif" alt="{L_FORUM_LOCKED}" /></td>
	<td><span class="gensmall">{L_FORUM_LOCKED}</span></td>
  </tr>
</table>

aka_G
Registered User
Posts: 72
Joined: Sun Mar 13, 2005 3:17 am

Post by aka_G »

hi,

i also need your help with my admin_forums.php .... i have tried to fix by all the ways but it's still not right

the codes below is B4 i change

Code: Select all

				'PRUNE_DAYS' => ( isset($pr_row['prune_days']) ) ? $pr_row['prune_days'] : 7,
				'PRUNE_FREQ' => ( isset($pr_row['prune_freq']) ) ? $pr_row['prune_freq'] : 1,
				'FORUM_NAME' => $forumname,
				'DESCRIPTION' => $forumdesc,
				'FORUM_IS_LINK' => ( $forum_is_link == 1 ) ? 'checked="checked"' : '',
				'FORUM_WEBLINK' => $forum_weblink,
				'FORUM_LINK_ICON' => $forum_link_icon)
			);
im using 2.0.17 and i saw 'DESCRIPTION' => $forumdesc,

not like 'DESCRIPTION' => $forumdesc) in the code change list!!!


And After i changed...it's as below:

Code: Select all

				'PRUNE_DAYS' => ( isset($pr_row['prune_days']) ) ? $pr_row['prune_days'] : 7,
				'PRUNE_FREQ' => ( isset($pr_row['prune_freq']) ) ? $pr_row['prune_freq'] : 1,
				'FORUM_NAME' => $forumname,
				'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
				)
				'FORUM_IS_LINK' => ( $forum_is_link == 1 ) ? 'checked="checked"' : '',
				'FORUM_WEBLINK' => $forum_weblink,
				'FORUM_LINK_ICON' => $forum_link_icon)
			);
After changed this statement always showed on the ACP....

Code: Select all

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /pub/home/giang55/htdocs/cxvn/admin/admin_forums.php on line 404
i have checked everything and only those codes above make me feel confusing and complicated

Mod author plz help me to get it work....i really like to add this mod for my board!!!

Thanks

Kang yee
Registered User
Posts: 1
Joined: Fri Sep 23, 2005 10:35 am

forum icon

Post by Kang yee »

i have 'apparent' successfully installed this module. However when i click on "édit forum'' there is no icon selection in the the forum icon drop down box. It empty. Where do i get the icons into the database?

User avatar
SoLoGHoST
Registered User
Posts: 58
Joined: Wed Oct 19, 2005 4:03 am
Contact:

What about forum_icon_new and forum_icon_new_path?

Post by SoLoGHoST »

Okay, I'm using this MOD, however, doesn't allow an image icon for new posts (which I would like to place to change the original image when new posts are posted in that forum, and when no posts are posted, will go back to the original) and was wondering on how hard it would be to implement this with the listbox option in the ACP. This would rock sooo good if only there were another dropdown listbox when editing/creating forums for $forumiconnopost and $forumiconnewpost. Can you please let me know if this would be the correct way to implement this, Thanks! :)

[SQL]

Code: Select all

ALTER TABLE `phpbb_forums` ADD `forum_icon` VARCHAR( 255 ) default NULL;
ALTER TABLE `phpbb_forums` ADD `forum_icon_new` VARCHAR( 255 ) default NULL;
INSERT INTO `phpbb_config` VALUES ('forum_icon_path', '');
INSERT INTO `phpbb_config` VALUES ('forum_icon_new_path', '');
language/lang_english/lang_admin.php

Code: Select all

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

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
$lang['Forum_icon'] = 'Forum icon'; // Forum Icon MOD
$lang['Forum_icon_new'] = 'Forum new icon';
$lang['Forum_icon_path'] = 'Forum Icon Storage Path'; 
$lang['Forum_icon_new_path'] = 'Forum Icon New Path';
$lang['Forum_icon_path_explain'] = 'Path under your phpBB root dir, e.g. images/forum_icons';
$lang['Forum_icon_new_path_explain'] = 'Path under your phpBB root dir, e.g. images/forum_newicons'; // Forum Icon MOD
admin/admin_board.php

Code: Select all

# 
#-----[ 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_NEW_PATH" => $lang['Forum_icon_new_path'], 
	"L_FORUM_ICON_PATH_EXPLAIN" => $lang['Forum_icon_path_explain'],
	"L_FORUM_ICON_NEW_PATH_EXPLAIN" => $lang['Forum_icon_new_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
	"FORUM_ICON_NEW_PATH" => $new['forum_icon_new_path'], // Forum Icon MOD
admin/admin_forums.php

Code: Select all

# 
#-----[ FIND ]------------------------------------------ 
# 
			if ($mode == 'editforum')
			{
				// $newmode determines if we are going to INSERT or UPDATE after posting?

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
#
#----NOT SURE IF THIS CODE IS CORRECT for INPUTTING another LISTBOX IN ACP----- 
			// 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);
			//
			// Do I need to close $file here also before opening it up with the following lines??
			//
			$dir = @opendir($phpbb_root_path . $board_config['forum_icon_new_path']);
			$countnew = 0;
			while( $file = @readdir($dir) )
			{
				if( !@is_dir(phpbb_realpath($phpbb_root_path . $board_config['forum_icon_new_path'] . '/' . $file)) )
				{
					if( preg_match('/(\.gif$|\.png$|\.jpg|\.jpeg)$/is', $file) )
					{
						$forum_icons_new[$countnew] = $file; 
						$countnew++;
					}
				}
			}

			@closedir($dir);
				
			if ($mode == 'addforum')
			{
				$forum_icons_list = "";
				$forum_icons_list_new = "";
				$forum_icons_list .= '<option value="' . $forum_icons[0] . '" selected="selected">' . $forum_icons[0] . '</option>'; 
				$forum_icons_list_new .= '<option value="' . $forum_icons_new[0] . '" selected="selected">' . $forum_icons_new[0] . '</option>'; 
				
				for( $i = 1; $i < count($forum_icons); $i++ )
				{
					$forum_icons_list .= '<option value="' . $forum_icons[$i] . '">' . $forum_icons[$i] . '</option>';
					$default_ficon = $forum_icons[0];
				}
				for( $n = 1; $n < count($forum_icons_new); $n++ )
				{
					$forum_icons_list_new .= '<option value="' . $forum_icons_new[$n] . '">' . $forum_icons_new[$n] . '</option>';
					$default_ficon_new = $forum_icons_new[0];
				}
			}

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

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

				// Forum Icon MOD - New fix for 1.0.8
				$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];
				}
				$forumiconnew = $row['forum_icon_new'];

				$forum_icons_list_new = "";
				for( $n = 0; $n < count($forum_icons_new); $n++ )
				{
					if ($forum_icons_new[$n] == $row['forum_icon_new'])
					{
						$forum_icons_list_new .= '<option value="' . $forum_icons_new[$n] . '" selected="selected">' . $forum_icons_new[$n] . '</option>';
					}
					else
					{
						$forum_icons_list_new .= '<option value="' . $forum_icons_new[$n] . '">' . $forum_icons_new[$n] . '</option>';
					}
					$default_ficon_new = $forum_icons_new[0];
				}

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

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

				$forumicon = ''; // Forum Icon MOD
				$forumiconnew = ''; // Forum Icon MOD

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

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
				'L_FORUM_ICON' => $lang['Forum_icon'], // Forum Icon MOD
				'L_FORUM_ICON_NEW' => $lang['Forum_icon_new'], // 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
				'ICON_LIST_NEW' => $forum_icons_list_new, // Forum Icon MOD
				'ICON_BASEDIR_NEW' => $phpbb_root_path . $board_config['forum_icon_new_path'], // Forum Icon MOD
				'ICON_IMG_NEW' => ( $forumiconnew ) ? $phpbb_root_path . $board_config['forum_icon_new_path'] . '/' . $forumiconnew : $phpbb_root_path . $board_config['forum_icon_new_path'] . '/' . $default_ficon_new // 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

# 
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#
, forum_icon, forum_icon_new

# 
#-----[ 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']) . "

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

# 
#-----[ 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']) . "

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

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

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 					'FORUM_ICON_IMG' => ( $forum_rows[$j]['forum_icon_new'] ) ? '<img src="' . $phpbb_root_path . $board_config['forum_icon_new_path'] .'/' . $forum_rows[$j]['forum_icon_new'] . '" alt="'.$forum_data[$j]['forum_name'].'" title="'.$forum_data[$j]['forum_name'].'" />' : ( $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'].'" />',
index.php

Code: Select all

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

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

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

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 								'FORUM_ICON_IMG' => ($iconnew) ? '<img src="' . $phpbb_root_path . $board_config['forum_icon_new_path'] . '/' . $iconnew . '" alt="'.$forum_data[$j]['forum_name'].'" title="'.$forum_data[$j]['forum_name'].'" />' : ($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
viewforum.php

Code: Select all

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

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
	'FORUM_ICON_IMG' => ($forum_row['forum_icon_new']) ? '<img src="' . $phpbb_root_path . $board_config['forum_icon_new_path'] . '/' . $forum_row['forum_icon_new'] . '" alt="'.$forum_row['forum_name'].'" title="'.$forum_row['forum_name'].'" />&nbsp;' : ($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
viewtopic.php

Code: Select all

# 
#-----[ FIND ]------------------------------------------ 
# 
//
// End auth check
//

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
// Forum Icon Mod
$sql = "SELECT forum_icon_new, forum_icon
	FROM " . FORUMS_TABLE . "
	WHERE forum_id = $forum_id";
if ( !($result = $db->sql_query($sql)) )
{
	message_die(GENERAL_ERROR, 'Could not obtain forums information', '', __LINE__, __FILE__, $sql);
}
$forum_row = $db->sql_fetchrow($result);
$forum_icon_new = $forum_row['forum_icon_new'];
$forum_icon = $forum_row['forum_icon'];

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

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

Code: Select all

# 
#-----[ 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>
	<tr>
		<td class="row1">{L_FORUM_ICON_NEW_PATH} <br /><span class="gensmall">{L_FORUM_ICON_NEW_PATH_EXPLAIN}</span></td>
		<td class="row2"><input class="post" type="text" size="20" maxlength="255" name="forum_icon_new_path" value="{FORUM_ICON_NEW_PATH}" /></td>
	</tr>
templates/subSilver/admin/forum_edit_body.tpl

Code: Select all

# 
#-----[ 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;
}
function update_forum_icon_new(newimage)
{
	document.forum_icon_new.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>
	<tr> 
	  <td class="row1">{L_FORUM_ICON_NEW}</td>
	  <td class="row2"><select name="forumiconnew" onchange="update_forum_icon_new(this.options[selectedIndex].value);">{ICON_LIST_NEW}</select> &nbsp; <img name="forum_icon_new" src="{ICON_IMG_NEW}" border="0" alt="" /> &nbsp;</td>
	</tr>
templates/subSilver/admin/forum_admin_body.tpl

Code: Select all

// Skip this first find step if u already have the MOD installed
# 
#-----[ 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">

# 
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
# 
//
// If you already have the MOD installed, no need to add this, it should already be added there
//

{catrow.forumrow.FORUM_ICON_IMG}&nbsp;&nbsp;
templates/subSilver/index_body.tpl

Code: Select all

# 
#-----[ 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>
// SKIP IF INSTALLED
templates/subSilver/viewforum_body.tpl

Code: Select all

# 
#-----[ 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">

# 
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
# 
{FORUM_ICON_IMG}
// SKIP IF ALREADY INSTALLED
templates/subSilver/viewtopic_body.tpl

Code: Select all

# 
#-----[ FIND ]------------------------------------------ 
# 
	  -> <a href="{U_VIEW_FORUM}" class="nav">{FORUM_NAME}</a></span></td>

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#
<a href="{U_VIEW_FORUM}" class="nav">

# 
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------ 
# 
{FORUM_ICON_IMG}
By The way, this code isn't working, I tried it, but damn I have spent a lot of time trying to figure out how to make NEW POST's IMAGES and stick with the REGULAR IMAGE for No New Posts. I seem to be having the darnest time trying to get FORUM_ICON_IMG to function properly with the 2 listboxes and options. Can you please assist me with this?

Thanks

User avatar
SoLoGHoST
Registered User
Posts: 58
Joined: Wed Oct 19, 2005 4:03 am
Contact:

Post by SoLoGHoST »

Also, wondering if it would be a better idea to just edit the $folder_image variable in index.php and then instead of using FORUM_ICON_IMG, use FORUM_FOLDER_IMG to display the image. But if I do this, would I still be able to use the listbox to include 2 icons in the ACP and then only show 1 icon on the index_body.tpl, templates/subSilver/viewtopic_body.tpl
, and templates/subSilver/viewforum_body.tpl

not really sure on how to make this possible, please, if you can help me with this just a little...some pointers?

Thanks very Much,
SoLoGHoST

User avatar
SoLoGHoST
Registered User
Posts: 58
Joined: Wed Oct 19, 2005 4:03 am
Contact:

Post by SoLoGHoST »

Here's another approach that I'm thinking of taking with this, just wondering if this approach is better since it will fill FORUM_FOLDER_IMG with the correct icon to be placed into the forum (NO/NEW Posts), However, I'm getting a parse error, can anyone spot anything wrong with the follwing code that will be replacing $folder_image??

I'm wondering if it's this line:
};
Here's the code:

Code: Select all

# 
#-----[ FIND ]------------------------------------------ 
# 
								$folder_image = ( $unread_topics ) ? $images['forum_new'] : $images['forum']; 
								$folder_alt = ( $unread_topics ) ? $lang['New_posts'] : $lang['No_new_posts']; 
							}
# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 
                                $folder_alt = ( $unread_topics ) ? $lang['New_posts'] : $lang['No_new_posts']; 
                                if($forum_data[$j]['forum_icon_new']) {
                                    $folder_image = ( $unread_topics ) ? '<img src="' . $phpbb_root_path . $forum_data[$j]['forum_icon_new'] . '" alt="'.$forum_data[$j]['forum_name'].' - '".$folder_alt."'" title="'.$forum_data[$j]['forum_name'].' - '".$folder_alt."'">' : '<img src="' . $phpbb_root_path . $forum_data[$j]['forum_icon'] . '" alt="'.$forum_data[$j]['forum_name'].' - '".$folder_alt."'" title="'.$forum_data[$j]['forum_name'].' - '".$folder_alt."'">';
                                } else{
                                    $folder_image = ( $unread_topics ) ? '<img src="'.$images['forum_new'].'" alt="'.$folder_alt.'" title="'.$folder_alt.'" />' : '<img src="'.$images['forum'].'" alt="'.$folder_alt.'" title="'.$folder_alt.'" />';
                                };
							}

ycl6
Translator
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 »

SoLoGHoST, I can't help you with your problem (too busy with other things), sorry. If you need help with your MOD developmement, you may seek support in MOD Writer's forum.

~Mac

Post Reply

Return to “[2.0.x] MOD Database Releases”