Hi there everyone!
I've done something to my forum system that is causing functions to be redeclaring themselves at the end of the function. Here's what I mean.
I get this error on a page:
Fatal error: Cannot redeclare get_tapatlk_location() (previously declared in /home/air/public_html/forum/mobiquo/include/function_hook.php:4) in /home/air/public_html/forum/mobiquo/hook/function_hook.php on line 62
And here's the function(I have commented line 4 and 62):
function get_tapatlk_location()
{
global $user,$phpbb_root_path; //Line 4
$location = $user->extract_current_page($phpbb_root_path);
$param_arr = array();
switch ($location['page_name'])
{
case "viewforum.php":
if(!empty($_GET['f']))
{
$param_arr['fid'] = $_GET['f'];
}
$param_arr['location'] = 'forum';
break;
case "index.php":
case '':
$param_arr['location'] = 'index';
break;
case "ucp.php":
if(!empty($_GET['i']) && ($_GET['i'] == "pm"))
{
$param_arr['location'] = 'message';
if(!empty($_GET['p']))
$param_arr['mid'] = $_GET['p'];
}
if(!empty($_GET['mode']) && ($_GET['mode'] == 'login'))
{
$param_arr['location'] = 'login';
}
break;
case "search.php":
$param_arr['location'] = "search";
break;
case "viewtopic.php":
if(!empty($_GET['t']))
{
//$param_arr['fid'] = $parameters['fid'];
$param_arr['location'] = 'topic';
$param_arr['tid'] = $_GET['t'];
}
break;
case "memberlist.php":
if(!empty($_GET['mode']) && $_GET['mode'] == "viewprofile" && !empty($_GET['u']))
{
$param_arr['location'] = 'profile';
$param_arr['uid'] = $_GET['u'];
}
break;
case "viewonline.php":
$param_arr['location'] = 'online';
break;
default:
$param_arr['location'] = 'index';
break;
}
$queryString = http_build_query($param_arr);
$url = generate_board_url() . '/?' .$queryString;
$url = preg_replace('/^(http|https)/isU', 'tapatalk', $url);
return $url;
} //Line 62
Does anyone know what could cause the end of a function to be redefining the function itself? Is there anything I might be able to do to track down the issue?
Thanks for your time!