homer09001 Posted March 8, 2010 Report Share Posted March 8, 2010 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? You can see the script here: http://testdomain.dth-scripts.com/Flyoasis/createid.php Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted March 9, 2010 Administrators Report Share Posted March 9, 2010 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 Quote Link to comment Share on other sites More sharing options...
homer09001 Posted March 9, 2010 Author Report Share Posted March 9, 2010 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 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? Quote Link to comment Share on other sites More sharing options...
homer09001 Posted March 9, 2010 Author Report Share Posted March 9, 2010 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? Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted March 9, 2010 Administrators Report Share Posted March 9, 2010 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 Quote Link to comment Share on other sites More sharing options...
homer09001 Posted March 9, 2010 Author Report Share Posted March 9, 2010 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 8Warning: 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? Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted March 9, 2010 Administrators Report Share Posted March 9, 2010 Clean it? Depends where you're getting it from. And make sure about the path it's case-sensitive Quote Link to comment Share on other sites More sharing options...
homer09001 Posted March 9, 2010 Author Report Share Posted March 9, 2010 Clean it? Depends where you're getting it from. And make sure about the path it's case-sensitive Hang on a sec, i think i've been getting the id the wrong way, i can't check until i can get the id card showing in the profile. regarding the placement of the file: phpVMS: http://testdomain.dth-scripts.com/PHPVMS/ createid.php: http://testdomain.dth-scripts.com/PHPVMS/PilotIDs/ Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted March 9, 2010 Administrators Report Share Posted March 9, 2010 Hang on a sec, i think i've been getting the id the wrong way, i can't check until i can get the id card showing in the profile. regarding the placement of the file: phpVMS: http://testdomain.dt...pts.com/PHPVMS/ createid.php: http://testdomain.dt...HPVMS/PilotIDs/ The ID if you're linking to it from the pilot profile, just use $pilot->pilotid, which is the numeric ID Quote Link to comment Share on other sites More sharing options...
homer09001 Posted March 9, 2010 Author Report Share Posted March 9, 2010 (edited) 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???? Edited March 9, 2010 by homer09001 Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted March 9, 2010 Administrators Report Share Posted March 9, 2010 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???? How are you linking to the change image page? Is it an <img src="">? Quote Link to comment Share on other sites More sharing options...
homer09001 Posted March 9, 2010 Author Report Share Posted March 9, 2010 How are you linking to the change image page? Is it an <img src="">? no just <? include "PilotIDs/createid.php"; ?> I've tried wrapping it in an img tag but that yields the same result? Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted March 9, 2010 Administrators Report Share Posted March 9, 2010 no just <? include "PilotIDs/createid.php"; ?> I've tried wrapping it in an img tag but that yields the same result? try <img src="/PilotIDs/createid.php?pilotid=<?php echo $pilot->pilotid;?>" /> Then inside that createid.php with that above code to include the codon.inc.php and the other stuff, and then create your image Quote Link to comment Share on other sites More sharing options...
homer09001 Posted March 9, 2010 Author Report Share Posted March 9, 2010 try <img src="/PilotIDs/createid.php?pilotid=<?php echo $pilot->pilotid;?>" /> Then inside that createid.php with that above code to include the codon.inc.php and the other stuff, and then create your image Thanks Nabeel got it eventualy Has to change the code you gave me a bit to get it to work: <img src="/PHPVMS/PilotIDs/createid.php?pilotid=<?php echo $userinfo->pilotid;?>" /> Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted March 9, 2010 Administrators Report Share Posted March 9, 2010 Great, I always forget those variable names Quote Link to comment Share on other sites More sharing options...
homer09001 Posted March 9, 2010 Author Report Share Posted March 9, 2010 Great, I always forget those variable names one small issue, the rank tape below the card is broken now, yet i've not touched its code?? :S Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted March 9, 2010 Administrators Report Share Posted March 9, 2010 You might be not closing a quote or something somewhere Quote Link to comment Share on other sites More sharing options...
homer09001 Posted March 9, 2010 Author Report Share Posted March 9, 2010 You might be not closing a quote or something somewhere hmm, will check that out thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.