Forum icons (read/unread) for index.php 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
Timk
Berichten: 3
Lid geworden op: 26 nov 2006, 11:35

Forum icons (read/unread) for index.php mod

Bericht door Timk » 26 nov 2006, 11:49

Wat is het probleem? Parse error: parse error, unexpected '"' in D:\Server\xampp\htdocs\phpBB2\index.php on line 400
Wanneer ontstond het probleem? Bij het instaleren van Forum icons (read/unread) for index.php mod
Adres van je forum: Draai lokaal
Geïnstalleerde mods: Geen op de gene na waar hier over gepraat word
Huidige template: subSilver - Eigenversie
phpBB versie: 2.0.11
Host: Xampp lokaal
Heb je onlangs een mod of stijl geïnstalleerd? Nee
Heb je gezocht naar een antwoord? Ja hier en op phpbb.com en phpbbhacks.com

Code: Selecteer alles

######################################################## 
## MOD Title:		Forum icons (read/unread) for index.php
## MOD Author:		Sergeant < sergeant@vladmobile.com > http://www.vladivostok.ru/forum4
##
## MOD Description:	This mod allows admin to assign two icons to each forum of the board
## One icon will show up in case of new messages, other will be shown when there are
## no new messages. These icons will be in main table (index.php).
## If no icons specified will be shown default icon.
##
## Author notes: This mod is an improved variant of 'Forum Icon with ACP Control' mod (by Mac (Y.C. LIN)).
##
## Usage: After installation you'll have to put two images (for each forum you would like to modify)
## for both conditions (read/unread) to your root dir (where index.php is located).
## The last thing will be entering the names of those images in forum properties (via admin control panel).
## 
## Installation Level:	Easy 
## Installation Time:	3 Minutes 
##
## Files To Edit:	5
##	index.php
##	admin/admin_forums.php
##	language/lang_english/lang_admin.php
##	templates/subSilver/admin/forum_edit_body.tpl
##	templates/subSilver/index_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/ 
##
############################################################## 
## 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 `phpbb_forums` ADD `forum_icon_new_post` VARCHAR( 255 ) default NULL;
ALTER TABLE `phpbb_forums` ADD `forum_icon_no_post` VARCHAR( 255 ) default NULL;

#
# Remember to do this for each installed language pack!
#
#-----[ OPEN ]------------------------------------------ 
# 
language/lang_english/lang_admin.php

# 
#-----[ FIND ]------------------------------------------ 
#
//
// That's all Folks!
// -------------------------------------------------

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
#
//Forum icons
$lang['Forum_icon_new_post'] = 'Forum icon (new posts)';
$lang['Forum_icon_no_post'] = 'Forum icon (no new post)';
//Forum icons

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

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


# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
//Forum icons
				$forumiconnewpost = $row['forum_icon_new_post'];
				$forumiconnopost = $row['forum_icon_no_post'];
//Forum icons
# 
#-----[ FIND ]------------------------------------------ 
# 
				$forumstatus = FORUM_UNLOCKED;

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
//Forum icons
				$forumiconnewpost = '';
				$forumiconnopost = '';
//Forum icons

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

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
//Forum icons
				'L_FORUM_ICON_NEW_POST' => $lang['Forum_icon_new_post'],
				'L_FORUM_ICON_NO_POST' => $lang['Forum_icon_no_post'],
//Forum icons

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

# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
				'DESCRIPTION' => $forumdesc,
//Forum icons
				'ICONNEWPOST' => ( $forumiconnewpost ) ? $forumiconnewpost : '',
				'ICONNEWPOST_DISPLAY' => ( $forumiconnewpost ) ? '<img src="' . $phpbb_root_path . $forumiconnewpost . '" />' : '',

				'ICONNOPOST' => ( $forumiconnopost ) ? $forumiconnopost : '',
				'ICONNOPOST_DISPLAY' => ( $forumiconnopost ) ? '<img src="' . $phpbb_root_path . $forumiconnopost . '" />' : ''
//Forum icons
				)

# 
#-----[ 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_new_post, forum_icon_no_post

# 
#-----[ 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['forumiconnewpost']) . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumiconnopost']) . "'

# 
#-----[ 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_new_post = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumiconnewpost']) . "', forum_icon_no_post = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumiconnopost']) . "'

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

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
//Forum icons
					'FORUM_ICON_NEW_POST_IMG' => ( $forum_rows[$j]['forum_icon_new_post'] ) ? '<img src="' . $phpbb_root_path . $forum_rows[$j]['forum_icon_new_post'] . '" alt="'.$forum_data[$j]['forum_name'].'" title="'.$forum_data[$j]['forum_name'].'" />' : '',
					'FORUM_ICON_NO_POST_IMG' => ( $forum_rows[$j]['forum_icon_no_post'] ) ? '<img src="' . $phpbb_root_path . $forum_rows[$j]['forum_icon_no_post'] . '" alt="'.$forum_data[$j]['forum_name'].'" title="'.$forum_data[$j]['forum_name'].'" />' : '',
//Forum icons

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

# 
#-----[ 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_post']) {
                                    $folder_image = ( $unread_topics ) ? '<img src="' . $phpbb_root_path . $forum_data[$j]['forum_icon_new_post'] . '" 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_no_post'] . '" 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.'" />';
                                };
							}

#
# Remember to do this for each installed template!
#
#-----[ OPEN ]------------------------------------------ 
#  
templates/subSilver/admin/forum_edit_body.tpl

# 
#-----[ 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_NEW_POST}</td>
	  <td class="row2"><input type="text" size="35" name="forumiconnewpost" value="{ICONNEWPOST}" class="post" />&nbsp;&nbsp;&nbsp;{ICONNEWPOST_DISPLAY}</td>
	</tr>
	</tr>
	<tr> 
	  <td class="row1">{L_FORUM_ICON_NO_POST}</td>
	  <td class="row2"><input type="text" size="35" name="forumiconnopost" value="{ICONNOPOST}" class="post" />&nbsp;&nbsp;&nbsp;{ICONNOPOST_DISPLAY}</td>
	</tr>

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

# 
#-----[ FIND ]------------------------------------------ 
# 
<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}" />

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 
{catrow.forumrow.FORUM_FOLDER_IMG}

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

# EoM
Dit is de mod en het liep fout op het openen van de index.php en het veranderen!

TWEagle
Berichten: 782
Lid geworden op: 18 nov 2005, 19:45
Locatie: Peer
Contacteer:

Bericht door TWEagle » 26 nov 2006, 14:18

kun je de code van index.php posten van laat ons zeggen 390 tot 420

Timk
Berichten: 3
Lid geworden op: 26 nov 2006, 11:35

Bericht door Timk » 26 nov 2006, 14:30

Code: Selecteer alles

											{
												$unread_topics = false;
											}
										}

									}
								}

                                $folder_alt = ( $unread_topics ) ? $lang['New_posts'] : $lang['No_new_posts'];
                                if($forum_data[$j]['forum_icon_new_post']) {
                                    $folder_image = ( $unread_topics ) ? '<img src="' . $phpbb_root_path . $forum_data[$j]['forum_icon_new_post'] . '" 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_no_post'] . '" 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.'" />';
                                };
                     } 
							

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

							if ( $forum_data[$j]['forum_last_post_id'] )
	{
								$last_post_time = create_date($board_config['default_dateformat'], $forum_data[$j]['post_time'], $board_config['board_timezone']);

								$last_post = $last_post_time . '<br />';

								$last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '='  . $forum_data[$j]['user_id']) . '">' . $forum_data[$j]['username'] . '</a> ';
								
								$last_post .= '<a href="' . append_sid("viewtopic.$phpEx?"  . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>';
							}
							else
Van 390 tot 420

Timk
Berichten: 3
Lid geworden op: 26 nov 2006, 11:35

Bericht door Timk » 27 nov 2006, 15:57

Kickje.

Niemand weet en oplossing voor dit probleem?

Gebruikersavatar
Mickroz
Berichten: 307
Lid geworden op: 05 nov 2005, 06:28
Locatie: Hoogvliet
Contacteer:

Bericht door Mickroz » 29 nov 2006, 13:37

Code: Selecteer alles

'".$folder_alt."'"
veranderen naar

Code: Selecteer alles

'.$folder_alt.'"
4 keer
Als het niet gaat zoals het moet, dan moet het zoals het gaat!
I don't need to "get a life." I'm a Gamer, I have lots of lives!
Forumer (n). 1) One who runs a forum or is an active member of one or more web forums.

Gesloten