Hello,

Parse error: syntax error, unexpected T_WHILE in /www/gamerscafe.nl/testing/www/portal/block/multiplay.php on line 35

got that error with the next code:

<?php
/*
*
* @name blank_block.php
* @package phpBB3 Portal XL 5.0
* @version $Id: blank_block.php,v 1.2 2009/05/15 22:32:06 damysterious Exp $
*
* @copyright (c) 2007, 2009 Portal XL Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
if (!defined('IN_PHPBB'))
{
exit;
}

/**
*/

/*
* Start session management
*/

/*
* Begin block script here
*/


if ($user->data['is_registered']){
$dat = $user->data['user_id'];
$link = '<iframe src ="http://www.come2play.com/channel_auth.asp?channel_id=33202&uid=';;
$link .= $dat;
$link .= '&nick_name=';
$result = mysql_query('SELECT * FROM '. USERS_TABLE .' WHERE user_id="$dat" ')
while($row = mysql_fetch_array( $result ))
{
$link .= $row ['username'];
}
$link .='&auth_sig=';
$channel = '23b7f054e101a14674b51c9f0d7dfee2';
$combine = $dat|$channel;
$combimix= md5($combine);
$link .= $combimix ;
$link .='" width="850" height="520" frameborder="0" scrolling="no" allowtransparency="true" >';
$link .='<p>Your browser does not support iframes.</p>';
$link .='</iframe>';
}else{
link. = '<center> You need to be logd in to see this iframe';
}


// Set the filename of the template you want to use for this file.
$template->set_filenames(array(
'body' => 'portal/block/multiplay.html',
));

?>

somebody has an idea?
mysql_query() will not work inside phpbb3, compare against any other phpbb3 query. Inside phpbb3 there is no need to connect to database especially as the database is always available by internal caching system. Don't forget to call globals, such as $user etc., in your file if needed.


Dus ik hoef het niet te doen, toch raar dat ik die error krijg.


Het zou kunnen wezen dat de rechten van de root@localhost niet goed zitten

Controleer je database inlog gegevens nog even:)
Het ligt niet aan de db gegevens want, ik gebruik geen root.

De rest van de portal werkt namelijk wel.

er is iets met de input en de output

<?php
/*


*/
if (!defined('IN_PHPBB'))
{
exit;
}



if ($user->data['is_registered']){
$dat = $user->data['user_id'];
$link = '<iframe src ="http://www.come2play.com/channel_auth.asp?channel_id=33202&uid=';;
$link .= $dat;
$link .= '&nick_name=';
$result = mysql_query('SELECT * FROM '. USERS_TABLE .' WHERE user_id="$dat" ') ;
while($row = mysql_fetch_array( $result ))
{
$link .= $row ['username'];
}
$link .='&auth_sig=';
$channel = '23b7f054e101a14674b51c9f0d7dfee2';
$combine = $dat|$channel;
$combimix = md5($combine);
$link .= $combimix ;
$link .='"width="850" height="520" frameborder="0" scrolling="no" allowtransparency="true" >';
$link .='<p>Your browser does not support iframes.</p>';
$link .='</iframe>';
}else{
$link .= '<center> You need to be logged in to see this iframe';

}


// Set the filename of the template you want to use for this file.

$template->assign_vars(array(
'MULTI_PLAY' => $link,
));

$template->set_filenames(array(
'body' => 'portal/block/multiplay.html',
));

?>

de html file:


<table cellspacing="0" width="100%">
<!--<tr>
<th>{MULTI_PLAY}</td>
</tr>-->
<tr>
<td valign="top" align="center">

{MULTI_PLAY}

</td>
</tr>
</table>
marco schreef op 08.01.2010 09:29

... Access denied for user 'root'@'localhost' (using password: NO) ...

Beetje eigenwijs ben je wel natuurlijk.
Hiet staat toch echt user root en password no.
Vandaar dat ik het zei:)
Je include toch wel de common.php? Anders werkt het dacht ik niet.

<?php
define('IN_PHPBB', true);
$phpbb_root_path = "phpBB3/"; //pad naar PHPBB3
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
?>
<?php

if (!defined('IN_PHPBB'))
{
exit;
}

global $user, $db;


if ($user->data['is_registered']){
$dat = $user->data['user_id'];
$link = '<iframe src ="http://www.come2play.com/channel_auth.asp?channel_id=33202&uid=';;
$link .= $dat;
$link .= '&nick_name=';
$link.= $user->data['username'];
$link .='&auth_sig=';
$channel = '23b7f054e101a14674b51c9f0d7dfee2';
$combine = $dat|$channel;
$combimix= md5($combine);
$link .= $combimix ;
$link .='" width="850" height="520" frameborder="0" scrolling="no" allowtransparency="true" >';
$link .='<p>Your browser does not support iframes.</p>';
$link .='</iframe>';
}else{
$link .= '<center> You need to be logd in to see this iframe';
}

// Assign specific vars
$template->assign_vars(array(
'I_FRAME' => $link,
));
$template->set_filenames(array(
'body' => 'portal/block/multiplay.html',
));

?>

werkend :-) allthans geen errors

Reageren