KGodel
07-21-2012, 04:59 PM
Hey all! I am trying to add locations for custom pages (mods) I am using that have different pages using one file, i.e. pages.php?pageid=1 is different than pages.php?pageid=6. Currently, I have the following code:
First Plugin Hook Location: online_location_process
if ($filename == 'pages.php') {
switch ($_GET['pageid']) {
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
case 12:
case 13:
case 14:
case 16:
case 17:
$userinfo['activity'] = 'ltc';
break;
case 15:
case 20:
$userinfo['activity'] = 'rosters';
break;
case 18:
$userinfo['activity'] = 'finances';
break;
default:
$userinfo['activity'] = 'pages';
break;
}
}
elseif ($filename == 'forms.php') {
switch ($_GET['fid']) {
case 1:
$userinfo['activity'] = 'form_complaint';
break;
case 2:
$userinfo['activity'] = 'newapp';
break;
case 3:
$userinfo['activity'] = 'appeal';
break;
case 4:
$userinfo['activity'] = 'goapp';
break;
case 5:
$userinfo['activity'] = 'poapp';
break;
case 6:
$userinfo['activity'] = 'dlapp';
break;
case 7:
$userinfo['activity'] = 'offteam';
break;
case 8:
$userinfo['activity'] = 'eaapp';
break;
case 9:
$userinfo['activity'] = 'adminreq';
break;
case 10:
$userinfo['activity'] = 'joapp';
break;
case 12:
$userinfo['activity'] = 'awardnom';
break;
case 14:
$userinfo['activity'] = 'moapp';
break;
case 15:
$userinfo['activity'] = 'webreq';
break;
case 16:
$userinfo['activity'] = 'gaapp';
break;
case 17:
$userinfo['activity'] = 'unoffteam';
break;
case 18:
$userinfo['activity'] = 'expreq';
break;
default:
$userinfo['activity'] = 'forms';
break;
}
}
Second Plugin Hook Location: online_location_unknown
switch ($userinfo['activity']) {
case 'ltc':
$userinfo['action'] = 'Viewing the Leadership Training Center';
$handled = true;
break;
case 'rosters':
$userinfo['action'] = 'Viewing Clan Rosters';
$handled = true;
break;
case 'finances':
$userinfo['action'] = 'Viewing Clan Finances';
$handled = true;
break;
case 'form_complaint':
$userinfo['action'] = 'Submitting a User Comaplint';
$handled = true;
break;
case 'newapp':
$userinfo['action'] = 'Applying to the Clan';
$handled = true;
break;
case 'appeal':
$userinfo['action'] = 'Submitting an Appeal';
$handled = true;
break;
case 'goapp':
$userinfo['action'] = 'Applying for GO';
$handled = true;
break;
case 'poapp':
$userinfo['action'] = 'Applying for PO';
$userinfo['where'] = '';
$handled = true;
break;
case 'dlapp':
$userinfo['action'] = 'Applying for DL';
$handled = true;
break;
case 'offteam':
$userinfo['action'] = 'Applying for an Official Team';
$handled = true;
break;
case 'eaapp':
$userinfo['action'] = 'Applying for EA';
$handled = true;
break;
case 'adminreq':
$userinfo['action'] = 'Submitting an Admin Request';
$handled = true;
break;
case 'joapp':
$userinfo['action'] = 'Applying for JO';
$handled = true;
break;
case 'awardnom':
$userinfo['action'] = 'Nominating a Member for an Award';
$handled = true;
break;
case 'moapp':
$userinfo['action'] = 'Applying for MO';
$handled = true;
break;
case 'webreq':
$userinfo['action'] = 'Submitting Web Content';
$handled = true;
break;
case 'gaapp':
$userinfo['action'] = 'Applying for GA';
$handled = true;
break;
case 'unoffteam':
$userinfo['action'] = 'Applying for an Unofficial Team';
$handled = true;
break;
case 'expreq':
$userinfo['action'] = 'Submitting an Expansion Request';
$handled = true;
break;
case 'forms':
$userinfo['action'] = 'Viewing Forms';
$handled = true;
break;
case 'pages':
$userinfo['action'] = 'Viewing Custom Page';
$handled = true;
break;
}
Currently, for both cases it only recognized the default cast of the switch. My $_GET doesn't seem to be passing the variable to the code, so I am unable to differentiate. Any help would be greatly appreciated!
First Plugin Hook Location: online_location_process
if ($filename == 'pages.php') {
switch ($_GET['pageid']) {
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
case 12:
case 13:
case 14:
case 16:
case 17:
$userinfo['activity'] = 'ltc';
break;
case 15:
case 20:
$userinfo['activity'] = 'rosters';
break;
case 18:
$userinfo['activity'] = 'finances';
break;
default:
$userinfo['activity'] = 'pages';
break;
}
}
elseif ($filename == 'forms.php') {
switch ($_GET['fid']) {
case 1:
$userinfo['activity'] = 'form_complaint';
break;
case 2:
$userinfo['activity'] = 'newapp';
break;
case 3:
$userinfo['activity'] = 'appeal';
break;
case 4:
$userinfo['activity'] = 'goapp';
break;
case 5:
$userinfo['activity'] = 'poapp';
break;
case 6:
$userinfo['activity'] = 'dlapp';
break;
case 7:
$userinfo['activity'] = 'offteam';
break;
case 8:
$userinfo['activity'] = 'eaapp';
break;
case 9:
$userinfo['activity'] = 'adminreq';
break;
case 10:
$userinfo['activity'] = 'joapp';
break;
case 12:
$userinfo['activity'] = 'awardnom';
break;
case 14:
$userinfo['activity'] = 'moapp';
break;
case 15:
$userinfo['activity'] = 'webreq';
break;
case 16:
$userinfo['activity'] = 'gaapp';
break;
case 17:
$userinfo['activity'] = 'unoffteam';
break;
case 18:
$userinfo['activity'] = 'expreq';
break;
default:
$userinfo['activity'] = 'forms';
break;
}
}
Second Plugin Hook Location: online_location_unknown
switch ($userinfo['activity']) {
case 'ltc':
$userinfo['action'] = 'Viewing the Leadership Training Center';
$handled = true;
break;
case 'rosters':
$userinfo['action'] = 'Viewing Clan Rosters';
$handled = true;
break;
case 'finances':
$userinfo['action'] = 'Viewing Clan Finances';
$handled = true;
break;
case 'form_complaint':
$userinfo['action'] = 'Submitting a User Comaplint';
$handled = true;
break;
case 'newapp':
$userinfo['action'] = 'Applying to the Clan';
$handled = true;
break;
case 'appeal':
$userinfo['action'] = 'Submitting an Appeal';
$handled = true;
break;
case 'goapp':
$userinfo['action'] = 'Applying for GO';
$handled = true;
break;
case 'poapp':
$userinfo['action'] = 'Applying for PO';
$userinfo['where'] = '';
$handled = true;
break;
case 'dlapp':
$userinfo['action'] = 'Applying for DL';
$handled = true;
break;
case 'offteam':
$userinfo['action'] = 'Applying for an Official Team';
$handled = true;
break;
case 'eaapp':
$userinfo['action'] = 'Applying for EA';
$handled = true;
break;
case 'adminreq':
$userinfo['action'] = 'Submitting an Admin Request';
$handled = true;
break;
case 'joapp':
$userinfo['action'] = 'Applying for JO';
$handled = true;
break;
case 'awardnom':
$userinfo['action'] = 'Nominating a Member for an Award';
$handled = true;
break;
case 'moapp':
$userinfo['action'] = 'Applying for MO';
$handled = true;
break;
case 'webreq':
$userinfo['action'] = 'Submitting Web Content';
$handled = true;
break;
case 'gaapp':
$userinfo['action'] = 'Applying for GA';
$handled = true;
break;
case 'unoffteam':
$userinfo['action'] = 'Applying for an Unofficial Team';
$handled = true;
break;
case 'expreq':
$userinfo['action'] = 'Submitting an Expansion Request';
$handled = true;
break;
case 'forms':
$userinfo['action'] = 'Viewing Forms';
$handled = true;
break;
case 'pages':
$userinfo['action'] = 'Viewing Custom Page';
$handled = true;
break;
}
Currently, for both cases it only recognized the default cast of the switch. My $_GET doesn't seem to be passing the variable to the code, so I am unable to differentiate. Any help would be greatly appreciated!