Sida 1 av 1

-LÖST- Problem med External Forum Redirect

Postat: 2005-10-16 18:23
av PazZze
Min index sida ser inte hur som den gjorde innan installationen av modden, någon som har ett förslag på vad man kan göra? (det är iinget akut då forumet inte har några användare (förutom jag), mer som ett test forum, som det ska bli ngt av senare

kolla själva och se hur fint det blir:
http://htmlskolan2.1go.dk/scouthack/phpBB2/

Detta är den enda modd som jag har installerat, förutom em

installerade den via EM, så filen nedan är lite ändrad, men den funkar :)

Kod: Markera allt

################################################################################
##
##   Hack Title:		External Forum Redirect
##   Hack Version:		2.0.0
##   Hack Author:		John McKernan 
## 
##   Hack Description:	This hack allows you to specify a forum as an external
##						forum. When the user clicks on the Forum name (on the 
##						index page) they will be taken to an external url you
##						specify in the Admin Control Panel.
##
##						Seperate counters are maintained to track the number
##						of users and guests clicking the links. This is 
##						displayed on the index page.
##
##						The external url may, optionally, be open in a new
##						browser window, and you can specify a custom folder 
##						image for each external forum.
##
##						Useful to direct users to other boards / sites you may
##						have, or to set-up cross-linking arrangements with
##						outside boards / sites.
##
##   phpBB Version:		2.0.4 - 2.0.6
##		
##   Difficulty Level:	Moderate 
##   Installation Time:	25 Minutes 
##
##   Files To Edit:		(7)
##						\index.php
##						\admin\admin_forums.php
##						\language\lang_english\lang_admin.php
##						\language\lang_english\lang_main.php
##						\templates\subSilver\index_body.tpl
##						\templates\subSilver\subSilver.cfg
##						\templates\subSilver\admin\forum_edit_body.tpl
##
##   Files Included:	(3)
##						\install_hack.php
##						\view_external.php
##						\templates\xxx\images\folder_external.gif
##
##   Release History:
##						2.0.0 - added option to open external link in a new
##								window & specify a custom folder image
##								(Nov 24, 2003)
##						1.0.1 - corrected typo in 'Find' instruction for
##								index.php - thanks to Rapid Dr3am (Sep 7, 2003)
##						1.0.0 - Initial release (Sep 1, 2003)
##
################################################################################
##
##  FOR UPDATES/SUPPORT, please visit http://www.phpbbhacks.com/forums
##
##  Stay up-to-date on the latest news involving our hacks, sign-up for
##  our newsletter at http://wwww.presagemedia.com/lists/?p=subscribe
##
##  This author supports phpBBHacks.com. This hack is made available
##  solely through their database at http://www.phpbbhacks.com
##
##  If you are new to installing hacks for phpBB, may I suggest that you take
##  a look at my 'Installing phpBB Hacks' tutorial at phpBBHacks.com. You can
##  find it here: http://www.phpbbhacks.com/forums/viewtopic.php?t=12211. You
##  may also find my other tutorials helpful, please visit 
##  http://www.presagemedia.com/hacks/cms_articles.php
##
################################################################################
##
##  This hack is released under the GPL License.
##  All Intellectual Property Rights are retained by the hack author(s) 
##  shown above.
##
##  This hack can be freely used, but not distributed, without permission.
##
################################################################################
## Author Notes: 
## 
##     This hack has been tested on phpBB v 2.0.4 & 2.0.6
## 
################################################################################
##
##  BEFORE ADDING THIS HACK TO YOUR FORUM, please be sure to backup ALL
##  affected files.
##
################################################################################

################################################################################
## IMPORTANT: FULL INSTALLATION.
## 
##     These instructions should only be followed if you have not already
##	   installed the 'External Forum Redirect' hack versions 1.0.0 or 1.0.1.
##
##     If you have installed an earlier version of this hack, please
##     disregard these instructions and follow the instructions in the
##     'Upgrade_from_v1.txt' file instead.
## 
################################################################################

##
##----------[ OPEN ]-------------------------------------
##

index.php

##
##----------[ FIND ]-------------------------------------
##

							$template->assign_block_vars('catrow.forumrow',	array(

##
##----------[ BEFORE, ADD ]------------------------------
##

							$forum_target = '';

							if ($forum_data[$j]['forum_external'])
							{
								$forum_url = append_sid("view_external.$phpEx?" . POST_FORUM_URL . "=$forum_id");

								$member_hits = $forum_data[$j]['forum_redirects_user'];
								$guest_hits = $forum_data[$j]['forum_redirects_guest'];
								$all_hits = ($member_hits + $guest_hits);

								$forum_details = $lang['External_text'] . '<b>' . $all_hits . '</b>';

								$forum_details .= ( $all_hits == 1 ) ? $lang['External_hit'] : $lang['External_hits'];
								
								$forum_details .= '<br />(' . $lang['External_members'] . ': <b>' . $member_hits . '</b>&nbsp;&middot;&nbsp;' . $lang['External_guests'] . ': <b>' . $guest_hits . '</b>)';

								$folder_image = ($forum_data[$j]['forum_ext_image']) ?  $forum_data[$j]['forum_ext_image'] : $images['forum_external'];

								$forum_posts = '--';
								$forum_topics = '--';

								$forum_target = ($forum_data[$j]['forum_ext_newwin']) ? 'target="_external"' : '';
							}
							else 
							{	
								$forum_url = append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id");

								$forum_posts = $forum_data[$j]['forum_posts'];
								$forum_topics = $forum_data[$j]['forum_topics'];
								$forum_details = $last_post;
							}

##
##----------[ FIND ]-------------------------------------
##

								'POSTS' => $forum_data[$j]['forum_posts'],
								'TOPICS' => $forum_data[$j]['forum_topics'],

##
##----------[ REPLACE WITH ]-----------------------------
##

								'POSTS' => $forum_posts,
								'TOPICS' => $forum_topics,

##
##----------[ FIND ]-------------------------------------
##

								'LAST_POST' => $last_post,

##
##----------[ REPLACE WITH ]-----------------------------
##

								'LAST_POST' => $forum_details,
								'TARGET' => $forum_target,

##
##----------[ FIND ]-------------------------------------
##

								'U_VIEWFORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id"))

##
##----------[ REPLACE WITH ]-----------------------------
##

								'U_VIEWFORUM' => $forum_url)

##
##----------[ OPEN ]-------------------------------------
##

admin/admin_forums.php

##
##----------[ FIND ]-------------------------------------
##

				$forumstatus = $row['forum_status'];

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

				$forum_external = $row['forum_external'];
				$forum_redirect_url = $row['forum_redirect_url'];
				$forum_ext_newwin = $row['forum_ext_newwin'];
				$forum_ext_image = $row['forum_ext_image'];

##
##----------[ FIND ]-------------------------------------
##

				$forumstatus = FORUM_UNLOCKED;
				$forum_id = ''; 
				$prune_enabled = '';

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

				$forum_external = '0';
				$forum_redirect_url = '';
				$forum_ext_newwin = '0';
				$forum_ext_image = '';

##
##----------[ FIND ]-------------------------------------
##

				'L_DAYS' => $lang['Days'],

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

				'FORUM_EXTERNAL_YES' => ($forum_external) ? 'checked="checked"' : '',
				'FORUM_EXTERNAL_NO' => (!$forum_external) ? 'checked="checked"' : '',
				'FORUM_REDIRECT_URL' => $forum_redirect_url,
				'FORUM_EXT_NEWWIN_YES' => ($forum_ext_newwin) ? 'checked="checked"' : '',
				'FORUM_EXT_NEWWIN_NO' => (!$forum_ext_newwin) ? 'checked="checked"' : '',
				'FORUM_EXT_IMAGE' => $forum_ext_image,
				'L_FORUM_EXT_NEWWIN' => $lang['Forum_ext_newwin'],
				'L_FORUM_EXT_IMAGE' => $lang['Forum_ext_image'],
				'L_FORUM_EXTERNAL' => $lang['Forum_external'],
				'L_FORUM_REDIRECT_URL' => $lang['Forum_redirect_url'],
				'L_NO' => $lang['No'],
				'L_YES' => $lang['Yes'],

##
##----------[ FIND ]-------------------------------------
##
##  There is more to this piece of code than what is
##  shown here. This excerpt is shown since many hacks
##  alter this code, and so yours may be different than
##  the default code. This portion should remain constant.
##

			// 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 . ")
				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 . ")";



##
##----------[ REPLACE WITH ]-------------------------------
##
			// 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, forum_external, forum_redirect_url, forum_ext_newwin, forum_ext_image
 , prune_enable" . $field_sql . ")
				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['forum_external']) . ", '" . $HTTP_POST_VARS['forum_redirect_url'] . "', " . intval($HTTP_POST_VARS['forum_ext_newwin']) . ", '" . $HTTP_POST_VARS['forum_ext_image'] . "', " . intval($HTTP_POST_VARS['prune_enable']) . $value_sql . ")";

##
##----------[ FIND ]-------------------------------------
##
##  There is more to this piece of code than what is
##  shown here. This excerpt is shown since many hacks
##  alter this code, and so yours may be different than
##  the default code. This portion should remain constant.
##

			$sql = "UPDATE " . FORUMS_TABLE . "

##
##----------[ INLINE FIND ]------------------------------
##

forum_status = " . intval($HTTP_POST_VARS['forumstatus']) . "

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

, forum_external = " . intval($HTTP_POST_VARS['forum_external']) . ", forum_redirect_url = '" . str_replace("\'", "''", $HTTP_POST_VARS['forum_redirect_url']) . "', forum_ext_newwin = " . intval($HTTP_POST_VARS['forum_ext_newwin']) . ", forum_ext_image = '" . str_replace("\'", "''", $HTTP_POST_VARS['forum_ext_image']) . "'

##
##----------[ OPEN ]-------------------------------------
##

language/lang_english/lang_admin.php

##
##----------[ FIND ]-------------------------------------
##

//
// That's all Folks!
// -------------------------------------------------

?>

##
##----------[ BEFORE, ADD ]------------------------------
##

// external forum redirect
$lang['Forum_external'] = 'External Site';
$lang['Forum_redirect_url'] = 'External URL';
$lang['Forum_ext_newwin'] = 'Launch external site in new window';
$lang['Forum_ext_image'] = 'Custom folder image for external site';

##
##----------[ OPEN ]-------------------------------------
##

language/lang_english/lang_main.php

##
##----------[ FIND ]-------------------------------------
##

//
// That's all, Folks!
// -------------------------------------------------

?>

##
##----------[ BEFORE, ADD ]------------------------------
##

// External forum redirection
$lang['External_text'] = 'This link has been visited ';
$lang['External_hit'] = ' time.';
$lang['External_hits'] = ' times.';
$lang['External_members'] = 'Users';
$lang['External_guests'] = 'Guests';

##
##----------[ OPEN ]-------------------------------------
##

templates/subSilver/subSilver.cfg

##
##----------[ FIND ]-------------------------------------
##

$images['forum_locked'] = "$current_template_images/folder_locked_big.gif";

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

$images['forum_external'] = "$current_template_images/folder_external.gif";


##
##----------[ OPEN ]-------------------------------------
##

templates/subSilver/admin/forum_edit_body.tpl

##
##----------[ FIND ]-------------------------------------
##

	<tr> 
	  <td class="row1">{L_FORUM_STATUS}</td>
	  <td class="row2"><select name="forumstatus">{S_STATUS_LIST}</select></td>
	</tr>

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

	<tr> 
	  <td class="row1">{L_FORUM_EXTERNAL}</td>
	  <td class="row2"> 
		<input type="radio" name="forum_external" value="1" {FORUM_EXTERNAL_YES} />
		<span class="gen">{L_YES}</span>&nbsp;&nbsp; 
		<input type="radio" name="forum_external" value="0" {FORUM_EXTERNAL_NO} />
		<span class="gen">{L_NO}</span></td>
	</tr>
	<tr> 
	  <td class="row1">{L_FORUM_REDIRECT_URL}</td>
	  <td class="row2"><input class="post" type="text" name="forum_redirect_url" value="{FORUM_REDIRECT_URL}" size="60" class="post" /></td>
	</tr>
	<tr> 
	  <td class="row1">{L_FORUM_EXT_NEWWIN}</td>
	  <td class="row2"> 
		<input type="radio" name="forum_ext_newwin" value="1" {FORUM_EXT_NEWWIN_YES} />
		<span class="gen">{L_YES}</span>&nbsp;&nbsp; 
		<input type="radio" name="forum_ext_newwin" value="0" {FORUM_EXT_NEWWIN_NO} />
		<span class="gen">{L_NO}</span></td>
	</tr>
	<tr> 
	  <td class="row1">{L_FORUM_EXT_IMAGE}</td>
	  <td class="row2"><input class="post" type="text" name="forum_ext_image" value="{FORUM_EXT_IMAGE}" size="60" class="post" /></td>
	</tr>

##
##----------[ OPEN ]-------------------------------------
##

templates/subSilver/index_body.tpl

##
##----------[ FIND ]-------------------------------------
##

<a href="{catrow.forumrow.U_VIEWFORUM}" class="forumlink">

##
##----------[ REPLACE WITH ]-----------------------------
##

<a href="{catrow.forumrow.U_VIEWFORUM}" class="forumlink" {catrow.forumrow.TARGET}>

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

# EoM 

Postat: 2005-10-17 08:43
av Holger
Där har du ändrat din index_body.tpl ordentligt.
Lägg upp den här ...

Postat: 2005-10-17 18:08
av PazZze
mm, fast em gjorde det åt mig...

Kod: Markera allt

<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%" cellpadding="2" cellspacing="1" border="0" class="forumline">
  <tr> 
	<th colspan="2" class="thCornerL" height="25" nowrap="nowrap">&nbsp;{L_FORUM}&nbsp;</th>
	<th width="50" class="thTop" nowrap="nowrap">&nbsp;{L_TOPICS}&nbsp;</th>
	<th width="50" class="thTop" nowrap="nowrap">&nbsp;{L_POSTS}&nbsp;</th>
	<th class="thCornerR" nowrap="nowrap">&nbsp;{L_LASTPOST}&nbsp;</th>
  </tr>
  <!-- BEGIN catrow -->
  <tr> 
	<td class="catLeft" colspan="2" height="28"><span class="cattitle"><a href="{catrow.U_VIEWCAT}" class="cattitle">{catrow.CAT_DESC}</a></span></td>
	<td class="rowpic" colspan="3" align="right">&nbsp;</td>
  </tr>
  <!-- BEGIN forumrow -->
  <tr> 
	<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>
	<td class="row1" width="100%" height="50"><span class="forumlink"> <a href="{catrow.forumrow.U_VIEWFORUM}" class="forumlink">{catrow.forumrow.FORUM_NAME}</a><br />
	  </span> <span class="genmed">{catrow.forumrow.FORUM_DESC}<br />
	  </span><span class="gensmall">{catrow.forumrow.L_MODERATOR} {catrow.forumrow.MODERATORS}</span></td>
	<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{catrow.forumrow.TOPICS}</span></td>
	<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{catrow.forumrow.POSTS}</span></td>
	<td class="row2" align="center" valign="middle" height="50" nowrap="nowrap"> <span class="gensmall">{catrow.forumrow.LAST_POST}</span></td>
  </tr>
  <!-- END forumrow -->
  <!-- END catrow -->
</table>

<table width="100%" cellspacing="0" border="0" align="center" cellpadding="2">
  <tr> 
	<td align="left"><span class="gensmall"><a href="{U_MARK_READ}" class="gensmall">{L_MARK_FORUMS_READ}</a></span></td>
	<td align="right"><span class="gensmall">{S_TIMEZONE}</span></td>
  </tr>
</table>

<table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
  <tr> 
	<td class="catHead" colspan="2" height="28"><span class="cattitle"><a href="{U_VIEWONLINE}" class="cattitle">{L_WHO_IS_ONLINE}</a></span></td>
  </tr>
  <tr> 
	<td class="row1" align="center" valign="middle" rowspan="2"><img src="templates/subSilver/images/whosonline.gif" alt="{L_WHO_IS_ONLINE}" /></td>
	<td class="row1" align="left" width="100%"><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}</span></td>
  </tr>
</table>

<table width="100%" cellpadding="1" cellspacing="1" border="0">
<tr>
	<td align="left" valign="top"><span class="gensmall">{L_ONLINE_EXPLAIN}</span></td>
</tr>
</table>

<!-- BEGIN switch_user_logged_out -->
<form method="post" action="{S_LOGIN_ACTION}">
  <table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
	<tr> 
	  <td class="catHead" height="28"><a name="login"></a><span class="cattitle">{L_LOGIN_LOGOUT}</span></td>
	</tr>
	<tr> 
	  <td class="row1" align="center" valign="middle" height="28"><span class="gensmall">{L_USERNAME}: 
		<input class="post" type="text" name="username" size="10" />
		&nbsp;&nbsp;&nbsp;{L_PASSWORD}: 
		<input class="post" type="password" name="password" size="10" maxlength="32" />
		&nbsp;&nbsp; &nbsp;&nbsp;{L_AUTO_LOGIN} 
		<input class="text" type="checkbox" name="autologin" />
		&nbsp;&nbsp;&nbsp; 
		<input type="submit" class="mainoption" name="login" value="{L_LOGIN}" />
		</span> </td>
	</tr>
  </table>
</form>
<!-- END switch_user_logged_out -->

<br clear="all" />

<table cellspacing="3" border="0" align="center" cellpadding="0">
  <tr> 
	<td width="20" align="center"><img src="templates/subSilver/images/folder_new_big.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/subSilver/images/folder_big.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/subSilver/images/folder_locked_big.gif" alt="{L_FORUM_LOCKED}" /></td>
	<td><span class="gensmall">{L_FORUM_LOCKED}</span></td>
  </tr>
</table>

Postat: 2005-10-18 08:40
av Holger
Hm, som jag ser det så har filen ej ändrats.
Kolla de enstaka stegen manuellt och se om filerna verkligen har ändrats!

/Holger

Postat: 2005-10-19 19:21
av PazZze
räckte med att ändra index_body.tpl sedan fungerade allt :)

hm. undrar varför em inte gillade den filen...

Postat: 2005-10-19 19:41
av Holger
Ah! EM! Det allvetande och allt-kunnande programmet ... :P