Forum Moderators: coopster
I installed my module
Activated it
And get this message when I go to view the statistics page
"Parse error: parse error, unexpected T_STRING in /home/johnlacy/public_html/dev/modules/top_referrals/module.php on line 54"
Now Line 54 is blank.
This is lines 47-59 of my module.php
$core->pre_defined('rank'),'username' => $lang['Username'],
'referrals' => $lang['Referral_Total'],
$core->pre_defined('percent'),
$core->pre_defined('graph'))
Now I'm getting
"Parse error: parse error, unexpected ';' in /home/johnlacy/public_html/dev/modules/top_referrals/module.php on line 32"
Here are lines 21-35
if (!defined('IN_PHPBB') ){
die("Hacking attempt");
}
//
// Top Referrals
//
[edited by: jatar_k at 3:53 pm (utc) on May 7, 2003]
Here is the module as it is writing in .pak format
3.0.0
#
# This file contains Installation Informations.
# This file does not include Installation Instructions for the normal User.
# Please do not edit this file if you are not the Module Author.
#
# Please read the provided install.txt for Informations on how to install this Module.
#
# Module Name
[name]
Top Referrals
[/name]
# Module Directory Name
[short_name]
top_referrals
[/short_name]
# your name
[author]
Laced
Top Referral Mod: Laced
[/author]
# your email
[email]
Site History Mod:
[/email]
# your webpage url
[url]
[/url]
# module version
[version]
1.0.0
[/version]
# required minimum Statistics Mod Version
[stats_mod_version]
3.0.0
[/stats_mod_version]
# default update time
[update_time]
update_time_from top_referrals
1
[/update_time]
[check_update_site]
[/check_update_site]
# extra info for the user
[extra_info]
This Module DOES require the Referral Mod by
and the newest Statistics Mod by
This module will display the top referrals on your forum.
[/extra_info]
<?php
[lang_english]
$lang['module_name'] = 'Top Referrals';
[/lang_english]
?>
<?php
if (!defined('IN_PHPBB') )
{
die("Hacking attempt")
}
//
// Top Referrals
//
$core->start_module(true);
$core->set_content('bars');
$core->set_view('rows', $core->return_limit);
$core->set_view('columns', 5);
$core->define_view('set_columns', array(
$core->pre_defined('rank'),
'username' => $lang['Username'],
'Total Referrals' => $lang['Referral_Total'],
$core->pre_defined('percent'),
$core->pre_defined('graph'),
);
$content->percentage_sign = TRUE;
$core->set_header($lang['module_name']);
$core->assign_defined_view('align_rows', array(
'left',
'left',
'center',
'center',
'left')
);
$sql = "SELECT COUNT(referral_id) AS referral_total FROM " . REFERRAL_TABLE . "WHERE ruid = $ruid";
$result = $core->sql_query($sql, 'Unable to retrieve users data');
$row = $core->sql_fetchrow($result);
$referral_total = $row['Referral_Total'];
$sql = "SELECT COUNT(referral_id) AS referral_total
FROM " . REFERRAL_TABLE . "
WHERE ruid = $ruid
ORDER BY referral_total DESC
LIMIT " . $core->return_limit;
$result = $core->sql_query($sql, 'Unable to retrieve users data');
$data = $core->sql_fetchrowset($result);
$content->init_math('referrals', $data[0]['Referral_Total'], $referrals);
$core->set_data($data);
$core->define_view('set_rows', array(
'$core->pre_defined()',
'$core->generate_link(append_sid($phpbb_root_path . \'profile.php?mode=viewprofile&u=\' . $core->data(\'user_id\')), $core->data(\'username\'), \'target="_blank"\')',
'$core->data(\'user_posts\')',
'$core->pre_defined()',
'$core->pre_defined()')
);
$core->run_module();
?>
[edited by: jatar_k at 7:06 pm (utc) on May 7, 2003]
[edit reason] trimmed specifics and funny chars [/edit]
$core->define_view('set_columns', array(
$core->pre_defined('rank'),
'username' => $lang['Username'],
'Total Referrals' => $lang['Referral_Total'],
$core->pre_defined('percent'),
$core->pre_defined('graph'), [b]< the , should be a ) - needed to end the array.[/b]
); to read - $core->pre_defined('graph'))
//
if (!defined('IN_PHPBB') )
{
die("Hacking attempt") [b]< you [i]could[/i] put a semicolon here, for good luck ;o)[/b]
} to read - die("Hacking attempt");
See anything else Adam?
T