Problem on a mod

This forum is now closed as part of retiring phpBB2.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

This forum is now closed due to phpBB2.0 being retired.
Post Reply
remid1985
Registered User
Posts: 47
Joined: Wed Jun 04, 2003 9:17 pm

Problem on a mod

Post by remid1985 »

hello , i m a newbie in mod .
I ' d like to stick up my classement of prognostics of football on a page with templates of phpbb.

I looked a statistic mod and i inspire about it.

My classement

Code: Select all

CREATE TABLE recap (
  pseudo varchar(40) default NULL,
  ptsgen int(3) default '0',
  21j int(2) default '0',
  23j int(2) default '0',
  24j int(2) default '0',
  25j int(2) default '0',
  26j int(2) default '0',
  27j int(2) default '0',
  28j int(2) default '0',
  29j int(2) default '0',
  30j int(2) default '0',
  31j int(2) default '0',
  32j int(2) default '0',
  33j int(2) default '0',
  34j int(2) default '0',
  35j int(2) default '0',
  36j int(2) default '0',
  37j int(2) default '0',
  38j int(2) default '0',
  place int(4) default NULL,
  journee int(3) default NULL,
  tonequipe varchar(30) default NULL
) TYPE=MyISAM;

#
# Contenu de la table `recap`
#

INSERT INTO recap VALUES ('remid1985', 95, 3, 5, 10, 9, 10, 3, 13, 9, 4, 10, 5, 4, 7, 3, 0, 0, 0, 6, 15, 'Nantes');
INSERT INTO recap VALUES ('Phoceen25', 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 1, 'Marseille');
INSERT INTO recap VALUES ('ASMSoik', 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 73, 3, 'Monaco');
INSERT INTO recap VALUES ('psgman113', 108, 1, 10, 9, 12, 5, 3, 7, 10, 6, 12, 10, 8, 5, 10, 0, 0, 0, 2, 15, 'Paris');
INSERT INTO recap VALUES ('babom93', 108, 7, 8, 9, 11, 12, 2, 13, 10, 6, 7, 5, 2, 9, 7, 0, 0, 0, 3, 15, 'Marseille');
INSERT INTO recap VALUES ('Djibrigoal', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 91, 0, 'Auxerre');
INSERT INTO recap VALUES ('monaco', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 0, 'Monaco');
INSERT INTO recap VALUES ('nonda59', 111, 9, 9, 7, 11, 9, 1, 15, 11, 3, 8, 8, 2, 9, 9, 0, 0, 0, 1, 14, 'Monaco');
INSERT INTO recap VALUES ('Tsubasa', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 93, 0, 'Marseille');
INSERT INTO recap VALUES ('le sanglier du sud', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94, 0, 'Sedan');

test.php

Code: Select all

$sql = "SELECT  *
FROM recap
ORDER BY ptsgen DESC";

if (!$result = $db->sql_query($sql))
{
	message_die(GENERAL_ERROR, "Couldn't retrieve users data", "", __LINE__, __FILE__, $sql);
}

$user_count = $db->sql_numrows($result);
$user_data = $db->sql_fetchrowset($result);




for ($i = 0; $i < $user_count; $i++)
{

	$template->assign_block_vars("users", array(
	"RANK" => $i+1,
	"CLASS" => ( !($i+1 % 2) ) ? $theme['td_class2'] : $theme['td_class1'],
	"USERNAME" => $user_data[$i]['pseudo'],
	"JOURNEES" => $user_data[$i]['ptsgen'],
	"EQUIPE" => $user_data[$i]['tonequipe'],
        "PTS" => $user_data[$i]['ptsgen'])
	);
}

test.tpl

<tr>
<td class="{users.CLASS}" align="left" width="10%"><span class="gen">{users.RANK}</span></td>


Error

Parse error: parse error, unexpected $ in c:\program files\easyphp\www\forum\includes\template.php(127) : eval()'d code on line 30

i use phpbb v 2.0.4

Why this erro , please?

User avatar
morpheus2matrix
Former Team Member
Posts: 9171
Joined: Wed Apr 10, 2002 7:31 pm
Location: France
Contact:

Post by morpheus2matrix »

try this

Code: Select all

<!-- BEGIN users -->
<tr> 
<td class="{users.CLASS}" align="left" width="10%"><span class="gen">{users.RANK}</span></td> 
<!-- END users -->

Former phpBB MOD-Team Member -

Forgive my bad English :(

No support by PM/Email - Thanks - You can thanks me here :) - Pay me for installing MOD's :lol:

remid1985
Registered User
Posts: 47
Joined: Wed Jun 04, 2003 9:17 pm

Post by remid1985 »

it's good . I go on.

User avatar
morpheus2matrix
Former Team Member
Posts: 9171
Joined: Wed Apr 10, 2002 7:31 pm
Location: France
Contact:

Post by morpheus2matrix »

:wink:
Former phpBB MOD-Team Member -

Forgive my bad English :(

No support by PM/Email - Thanks - You can thanks me here :) - Pay me for installing MOD's :lol:

Post Reply

Return to “[2.0.x] MOD Writers Discussion”