Seite 1 von 1

kleiner fehler im "profile guestbook mod" mod

Verfasst: 04.05.2004 12:06
von timo111
hey
hab im "profile guestbook mod" einen kleinen fehler gefunden. wenn man einen einträg löschen will kommt vorher die abfrage "willst du diesen eintrag wirklich löschen: JA oder NEIN". wählt man hier nein bekommt man einen fehler:

Code: Alles auswählen

Fatal error: Call to undefined function: redirect() in forum/includes/usercp_viewprofile.php on line 74
die entsprechende zeile:

Code: Alles auswählen

if ($cancel)
{
	redirect(append_sid("profile.$phpEx?mode=viewprofile&u=" . $id ."&start=".$start."#gb", true));
	exit;
}
mit JA kann man den eintrag problemlos löschen.
jemand ne idee?

Verfasst: 04.05.2004 17:41
von netzmeister
Hallo,
wo gibt es diesen Mod ? Müsste mir mal den Code anschauen.

Gruß netzmeister

Verfasst: 04.05.2004 19:14
von timo111
//edit: http://www.phpbb.com/phpBB/viewtopic.php?t=79775

sorry, kann nichtmehr sagen woher ich es hab. der kopf des mods:

Code: Alles auswählen

######################################################## 
## Mod Title:   profile guestbook mod
## Mod Version: 0.91 beta
## Included mod by neo18tilidie
## Inspired by a comment script by todd
## but has nothing to do with it anymore
##
## History: 
## 0.91 entry count added - typo fixed
## 0.90 Initial release
## 
## Description:  This mod will add a guestbook to each userprofile
## 
## Installation Level:  medium
## Installation Time:  10-15 Minutes 
## Files To Edit:       7
###################################################################
###################################################################
das ist der teil der in die usercp_viewprofile.php eingebaut wird:

Code: Alles auswählen

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

includes/usercp_viewprofile.php

# 
#-----[ NEAR TOP FIND ]------------------------------------------ 
# 

$profiledata = get_userdata(intval($HTTP_GET_VARS[POST_USERS_URL]));

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

// gestbook hack
$id = $u;
$cancel = ( isset($HTTP_POST_VARS['cancel']) ) ? TRUE : 0;
if ($cancel)
{
       redirect(append_sid("profile.$phpEx?mode=viewprofile&u=" . $id ."&start=".$start."#gb", true));
	exit;
}
if ( isset($HTTP_GET_VARS['action']) || isset($HTTP_POST_VARS['action']) )
{
	$action = ( isset($HTTP_GET_VARS['action']) ) ? $HTTP_GET_VARS['action'] : $HTTP_POST_VARS['action'];
	if($action == 'admin')
	{
		
		include($phpbb_root_path . 'gb_display.'.$phpEx);

		exit;
	}
	elseif($action == "post")
	{
		include($phpbb_root_path . 'gb_post.'.$phpEx);
		exit;
	}
}

// gestbook hack end

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

include($phpbb_root_path . 'includes/page_header.'.$phpEx);

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

include($phpbb_root_path . 'gb_display.'.$phpEx);
zeile 74 davon:

Code: Alles auswählen

redirect(append_sid("profile.$phpEx?mode=viewprofile&u=" . $id ."&start=".$start."#gb", true));

Verfasst: 04.05.2004 19:21
von netzmeister
Hallo,
füge mal folgende Zeilen in die usercp_viewprofile.php
oben nach

Code: Alles auswählen

if ( !defined('IN_PHPBB') )
{
	die("Hacking attempt");
	exit;
}
ein.

Code: Alles auswählen

include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
Gruß netzmeister

Verfasst: 04.05.2004 19:52
von timo111
dann kommt folgende fehlermeldung beim aufruf des profils:

Code: Alles auswählen

Fatal error: Cannot redeclare class template in /forum/includes/template.php on line 30
die zeile 30 in der template.php ist leer bzw. dieser bereich:

Code: Alles auswählen

/***************************************************************************

 *

 *   This program is free software; you can redistribute it and/or modify

 *   it under the terms of the GNU General Public License as published by

 *   the Free Software Foundation; either version 2 of the License, or

 *   (at your option) any later version.

 *

 ***************************************************************************/



/**
es geht übrigends ums 2.0.4! falls das einen unterschied macht

Verfasst: 04.05.2004 19:56
von timo111
mir ist gerade aufgefallen das ich ein sehr ähnliches problem schonmal hatte:

http://www.phpbb.de/viewtopic.php?t=51939

an was liegt das?

Verfasst: 05.05.2004 00:48
von netzmeister
Hallo,
änder mal Zeile 74 wie folgt:

Code: Alles auswählen

header("Location: " . append_sid("profile.$phpEx?mode=viewprofile&u=" . $id ."&start=".$start."#gb", true));
Gruß netzmeister

Verfasst: 05.05.2004 10:35
von timo111
geht!
tausend dank netzmeister