I’ve designed a Pilot ID Card style avatar that is dynamically updated, how can i put this in place of the pilot normal avatar?
I’ve tried editing the template for the profile by putting a standard php include to the custom script but it says it does not exist yet I know it does?
Looks good, you can dynamically generate that with something liek:
createid.php?pilotid=XXX123
And inside, you can use the API with something like:
include 'core/codon.inc.php';
$pilotid = DB::escape($_GET['pilotid']);
$pilot_info = PilotData::getPilotData($pilotid);
// Now you can create that badge...
$pilotinfo->hub;
$pilotinfo->totalhours;
$avatar_link = PilotData::getPilotAvatar($pilotid);
//etc
// Now you can create that badge…
$pilotinfo->hub;
$pilotinfo->totalhours;
$avatar_link = PilotData::getPilotAvatar($pilotid);
//etc
The only problem im having is where should i put my file so i can include it on the profile page because i want to place my ID card when the avatar is?
At the moment is says file not found when i try to include it, and i’ve tried placing my file in the Profile module folder
Also im having issues getting the pilot data, it pulls the avatar no problem but it isn’t retrieving anything else?
function CreateID($pilotid){
include 'core/codon.config.php';
$pilotid = DB::escape($pilotid);
$pilotinfo = PilotData::getPilotData($pilotid);
// DEBUG ECHO
echo $pilotinfo->hub;
echo $pilotinfo->totalhours;
echo $pilotinfo->pilotid;
All 3 of those DEBUG Echo’s don’t print on the screen?
Ok i have worked out why it wasn’t getting the pilot info, because its being given the full pilot id which is TVA0001 which is not how pilot ids aren’t stored in the database so what suggestions are there for getting the id in the correct format to retrieve their data?
Ok i have worked out why it wasn’t getting the pilot info, because its being given the full pilot id which is TVA0001 which is not how pilot ids aren’t stored in the database so what suggestions are there for getting the id in the correct format to retrieve their data?
Pilot IDs are stored in the id column which is numeric only.
You can place it in a file called createid.php in the same folder as the index.php, or you can create a module. Either way is fine, but for simplicity’s sake, you can create a file in the same directory as the index.php file
Pilot IDs are stored in the id column which is numeric only.
You can place it in a file called createid.php in the same folder as the index.php, or you can create a module. Either way is fine, but for simplicity’s sake, you can create a file in the same directory as the index.php file
ok that is where the file is placed at the moment in a folder called PilotIDs in the root folder but when i try to include the file in the Profile template, it says the createid.php file does not exist
Warning: include(../PilotIDs/createids.php) [function.include]: failed to open stream: No such file or directory in /home/.philadelphia/homer09001/testdomain.dth-scripts.com/PHPVMS/core/templates/profile_main.tpl on line 8
Warning: include() [function.include]: Failed opening ‘../PilotIDs/createids.php’ for inclusion (include_path=‘.:/usr/local/php5/lib/php:/usr/local/lib/php’) in /home/.philadelphia/homer09001/testdomain.dth-scripts.com/PHPVMS/core/templates/profile_main.tpl on line 8
Fatal error: Call to undefined function createid() in /home/.philadelphia/homer09001/testdomain.dth-scripts.com/PHPVMS/core/templates/profile_main.tpl on line 9
on the other point of the pilot id number, how can i clean it so its only the actual numeric entry?
Its obviously done in PHPVMS before with the login script but i can work it out?
The ID if you’re linking to it from the pilot profile, just use $pilot->pilotid, which is the numeric ID
Fatal error: Cannot redeclare codon_autoload() (previously declared in /home/.philadelphia/homer09001/testdomain.dth-scripts.com/PHPVMS/core/classes/autoload.php:42) in /home/.philadelphia/homer09001/testdomain.dth-scripts.com/PHPVMS/core/classes/autoload.php on line 65
this is when this include is in my script: include ‘core/codon.config.php’;
without it i can load the profile page but my image is broken?
Edit: if i change include ‘core/codon.config.php’; to require_once it lets me load the Profile page but my image is still broken???