Change style index.

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
gies
Berichten: 682
Lid geworden op: 16 jan 2005, 00:14
Locatie: - MordoX! -
Contacteer:

Change style index.

Bericht door gies » 22 jul 2006, 08:07

Ik heb de mod change style on index geinstalleerd.

Ik krijg nu deze error:
Parse error: parse error, unexpected T_ELSE in includes/functions.php on line 491
ik heb de uitvoering van de mod 3x op de functions.php uitgevoerd.

Dit is mijn functions.php:

http://www.mordox.org/test/functions.txt

Wat is er fout?


dit is de opdracht:



Code: Selecteer alles

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

includes/functions.php

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

function init_userprefs($userdata)
{


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

	global $db, $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS;

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

	//
	// Set up style
	//
	if ( !$board_config['override_user_style'] )
	{

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

		if ( isset($HTTP_GET_VARS[STYLE_URL]) )
		{
			$style = urldecode( $HTTP_GET_VARS[STYLE_URL] );
			if ( $theme = setup_style($style) )
			{
				if ( $userdata['user_id'] != ANONYMOUS )
				{
					// user logged in --> save new style ID in user profile
					$sql = "UPDATE " . USERS_TABLE . " 
						SET user_style = " . $theme['themes_id'] . "
						WHERE user_id = " . $userdata['user_id'];
					if ( !$db->sql_query($sql) )
					{
						message_die(CRITICAL_ERROR, 'Error updating user style', '', __LINE__, __FILE__, $sql);
					}

					$userdata['user_style'] = $theme['themes_id'];
				} else {
					// user not logged in --> save new style ID in cookie
					setcookie($board_config['cookie_name'] . '_style', $style, time() + 31536000, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);
				}
				return;
			}
		}


		if ( $userdata['user_id'] == ANONYMOUS && isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_style']) )
		{
			$style = $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_style'];
			if ( $theme = setup_style($style) )
			{
				return;
			}
		}

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

function setup_style($style)
{
	global $db, $board_config, $template, $images, $phpbb_root_path;


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

	if ( !is_numeric($style) )
	{
		$sql = "SELECT *
			FROM " . THEMES_TABLE . "
			WHERE style_name = '$style'";
	}
	else
	{


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

	$sql = "SELECT *
		FROM " . THEMES_TABLE . "
		WHERE themes_id = $style";

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

[/size]
Afbeelding

svenn
Berichten: 5001
Lid geworden op: 14 jul 2004, 13:00
Locatie: Kortrijk
Contacteer:

Bericht door svenn » 22 jul 2006, 09:01

vind

Code: Selecteer alles

function setup_style($style)
{
	global $db, $board_config, $template, $images, $phpbb_root_path;
		if ( !is_numeric($style) )
	{
		$sql = "SELECT *
			FROM " . THEMES_TABLE . "
			WHERE style_name = '$style'";
	}
	}
	else
	{


	$sql = 'SELECT *
		FROM ' . THEMES_TABLE . '
		WHERE themes_id = ' . (int) $style;
	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(CRITICAL_ERROR, 'Could not query database for theme info');
	}
vervang met

Code: Selecteer alles

function setup_style($style)
{
	global $db, $board_config, $template, $images, $phpbb_root_path;
		if ( !is_numeric($style) )
	{
		$sql = "SELECT *
			FROM " . THEMES_TABLE . "
			WHERE style_name = '$style'";

	}
	else
	{


	$sql = 'SELECT *
		FROM ' . THEMES_TABLE . '
		WHERE themes_id = ' . (int) $style;
	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(CRITICAL_ERROR, 'Could not query database for theme info');
	}

gies
Berichten: 682
Lid geworden op: 16 jan 2005, 00:14
Locatie: - MordoX! -
Contacteer:

Bericht door gies » 22 jul 2006, 11:24

Dan krijg ik deze error:

Code: Selecteer alles

Parse error: parse error, unexpected $ in includes/functions.php on line 1021
(line 1021 is de laatste line van de functions.php)
Afbeelding

Gebruikersavatar
Xanland
Berichten: 828
Lid geworden op: 23 jan 2005, 17:02
Locatie: Apeldoorn, The Netherlands
Contacteer:

Bericht door Xanland » 22 jul 2006, 12:04

Haal alle spatie's en enters achter ?> weg!
Mvg, Xanland.
phpBBmods
---
Muziekforum
---

gies
Berichten: 682
Lid geworden op: 16 jan 2005, 00:14
Locatie: - MordoX! -
Contacteer:

Bericht door gies » 22 jul 2006, 12:13

Dan krijg ik dit:

Code: Selecteer alles

Parse error: parse error, unexpected $ in includes/functions.php on line 1020
dit is de nieuwe functions:

http://www.mordox.org/test/functions.txt
Afbeelding

svenn
Berichten: 5001
Lid geworden op: 14 jul 2004, 13:00
Locatie: Kortrijk
Contacteer:

Bericht door svenn » 22 jul 2006, 13:01

weet het niet zeker dus eerst backuppen

zoek

Code: Selecteer alles

   $sql = 'SELECT * 
      FROM ' . THEMES_TABLE . ' 
      WHERE themes_id = ' . (int) $style; 
erna

gies
Berichten: 682
Lid geworden op: 16 jan 2005, 00:14
Locatie: - MordoX! -
Contacteer:

Bericht door gies » 22 jul 2006, 14:02

perfect het werkt! thanx!
Afbeelding

Gesloten