truemo9 Posted August 9, 2011 Report Share Posted August 9, 2011 Hey guys, i was wondering if i could intergrate a about me box for people to see what,who,why we are.. I would like this in the public profile page.. Thanks 1 Quote Link to comment Share on other sites More sharing options...
truemo9 Posted August 9, 2011 Author Report Share Posted August 9, 2011 bump Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted August 9, 2011 Report Share Posted August 9, 2011 Please allow our users here time to answer you back. If in an emergency, a bump a couple days alter may be in order, but minutes later is not going to get you anywhere real fast. All the users here have a life outside of the website here and freely give their time and effort when they are on. Patience is a virtue. Wait and see! Waiting over....... You can add any extra pages you want to do. It is real easy. Simply go in the admin panel and click on the link called Pages. You can use the html editor to add code if your page is more than simple text. If you wish to add ANY php or special links like we use in core_nav, create your page and simply save it. Then open that page in Dreamweaver or editor of your choice and edit it otherwise special urls and php will not stay in the added pages. The path to the added pages is public_html/core/pages Presto! Enjoy your newly added page. 3 Quote Link to comment Share on other sites More sharing options...
truemo9 Posted August 10, 2011 Author Report Share Posted August 10, 2011 Sorry about the bump, I mean on the /index.php/profile/view/1 That page have a box called About me, 1 Quote Link to comment Share on other sites More sharing options...
Jeff Posted August 10, 2011 Report Share Posted August 10, 2011 Ray, I think what he means is have a short text form added in the profile_main.tpl so that each member (not admin) can add a short summary about themselves and that will show up in the pilot_public_profile.tpl so everyone can view info on each member. I think it would be a great add-on if someone would like to tackle this task. Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted August 10, 2011 Report Share Posted August 10, 2011 Ray, I think what he means is have a short text form added in the profile_main.tpl so that each member (not admin) can add a short summary about themselves and that will show up in the pilot_public_profile.tpl so everyone can view info on each member. I think it would be a great add-on if someone would like to tackle this task. I got ya. That is a quick easy one to do. I can not do it tonight though. I will try it in the morning. I got a whopping 1 hour sleep last night. I'm tired and heading to bed now. Quote Link to comment Share on other sites More sharing options...
Guest lorathon Posted August 10, 2011 Report Share Posted August 10, 2011 Just add a field to the pilot table. Call it aboutme. then just write the code to save/edit and display the data. I would modify the core/modules/profile file. to display would be $pilotinfo->aboutme or $userinfo->aboutme or Auth::$userinfo->aboutme. You get the picture Quote Link to comment Share on other sites More sharing options...
truemo9 Posted August 10, 2011 Author Report Share Posted August 10, 2011 Right so design a table in pilot_public_profile Problem is, im not the best at doing coding, so u could give me an example of a code to add in.. 1 Quote Link to comment Share on other sites More sharing options...
Guest lorathon Posted August 10, 2011 Report Share Posted August 10, 2011 Actually I meant in the pilots table in the DB. Quote Link to comment Share on other sites More sharing options...
truemo9 Posted August 10, 2011 Author Report Share Posted August 10, 2011 Just give me some steps about adding in the db, cos im like a lost man in a database, with the coding Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted August 10, 2011 Report Share Posted August 10, 2011 Just add a field to the pilot table. Call it aboutme. then just write the code to save/edit and display the data. I would modify the core/modules/profile file. to display would be $pilotinfo->aboutme or $userinfo->aboutme or Auth::$userinfo->aboutme. You get the picture We need to come up with a way to do this so that no core files are edited at all. I know this way is the best way, but I hate getting my files over written in updates. I suppose we could write up a module for it, but that much work for a simple about me field is almost overkill I'm guessing. Now maybe if we added a little to it like simple profile comments or something like that...... It would sweeten the deal up some. Quote Link to comment Share on other sites More sharing options...
Jeff Posted August 10, 2011 Report Share Posted August 10, 2011 Isn't there a way to actually place it in the Edit Profile page so they will be able to update it at any time? I was fiddling with it last night, but couldn't get it to show. I added a custom profile field in the admin center but couldn't figure out how to have it work correctly since I've never tried the custom profile before. Quote Link to comment Share on other sites More sharing options...
Moderators joeri Posted August 10, 2011 Moderators Report Share Posted August 10, 2011 woulnd it be so easy yes it is just add a custom field in the admin section and just name it "about me" then check the boxes show in profile and show at registration and thats it i think most off us alted so manny that we lose the grip on the things already in there Quote Link to comment Share on other sites More sharing options...
Jeff Posted August 10, 2011 Report Share Posted August 10, 2011 I got the boxes to show last night, but when I typed in them and clicked Update Profile, the field was blank. It just said... About Me: Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted August 10, 2011 Report Share Posted August 10, 2011 I have added it to the edit profile tpl file as well as got the database in order. I did get side tracked before I was able to finish it though. I forgot I had a class today. Last one of the term for me. I will get back on it tonight if able. Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted August 11, 2011 Report Share Posted August 11, 2011 I have this all working now. BUT for some reason when I submit, it is not updating the database. My query is wrong or something. If I go in phpMyAdmin and edit the aboutme field, it shows on the profile just fine. Back to work on this dang query. Quote Link to comment Share on other sites More sharing options...
truemo9 Posted August 11, 2011 Author Report Share Posted August 11, 2011 if you have the code for it, please send.. Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted August 12, 2011 Report Share Posted August 12, 2011 I hadn't got to mess with it today at all. I plan on working on it in the morning. I just had to much going on today. Quote Link to comment Share on other sites More sharing options...
truemo9 Posted August 12, 2011 Author Report Share Posted August 12, 2011 ok Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted August 13, 2011 Report Share Posted August 13, 2011 Hey I have this in it's entirety. I can not get the about me to populate the database though. If someone can toss a query at me that I can try, I will give it a go. I hate to give out the code and it not work. If I can't get it to work, I'll scrap it. Nahh probably not, but I would love to show you all a working product. Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted August 13, 2011 Report Share Posted August 13, 2011 THis thread probably needs moved by now to the addons thread. Quote Link to comment Share on other sites More sharing options...
truemo9 Posted August 13, 2011 Author Report Share Posted August 13, 2011 That Looks excellent ray, but get the query, and it would be in the add on Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted August 14, 2011 Moderators Report Share Posted August 14, 2011 Code is incomplete, Once its all there it can be moved. Quote Link to comment Share on other sites More sharing options...
truemo9 Posted August 14, 2011 Author Report Share Posted August 14, 2011 ^ Agreed Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted August 15, 2011 Report Share Posted August 15, 2011 Hi Guys. I have had a VERY bad couple days and not been on the PC. I do plan on having this fixed today. I was actually able to query the db on submit. However, it is not updating with what I type in the box. So at least it is connecting. Maybe something with the value or what ever I am trying to do. Oh well back to the drawing board. Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted August 15, 2011 Moderators Report Share Posted August 15, 2011 Ray, I am just having a look at this and if you add a custom field then you can edit this and have it displayed already by the code. <h3>Edit Profile</h3> <form action="<?php echo url('/profile');?>" method="post" enctype="multipart/form-data"> <dl> <dt>Name</dt> <dd><?php echo $userinfo->firstname . ' ' . $userinfo->lastname;?></dd> <dt>Airline</dt> <dd><?php echo $userinfo->code?> <p>To request a change, contact your admin</p> </dd> <dt>Email Address</dt> <dd><input type="text" name="email" value="<?php echo $userinfo->email;?>" /> <?php if(isset($email_error) && $email_error == true) echo '<p class="error">Please enter your email address</p>'; ?> </dd> <dt>Location</dt> <dd><select name="location"> <?php foreach($countries as $countryCode=>$countryName) { if($userinfo->location == $countryCode) $sel = 'selected="selected"'; else $sel = ''; echo '<option value="'.$countryCode.'" '.$sel.'>'.$countryName.'</option>'; } ?> </select> <?php if(isset($location_error) && $location_error == true) echo '<p class="error">Please enter your location</p>'; ?> </dd> <dt>Signature Background</dt> <dd><select name="bgimage"> <?php foreach($bgimages as $image) { if($userinfo->bgimage == $image) $sel = 'selected="selected"'; else $sel = ''; echo '<option value="'.$image.'" '.$sel.'>'.$image.'</option>'; } ?> </select> </dd> <?php if($customfields) { foreach($customfields as $field) { echo '<dt>'.$field->title.'</dt> <dd>'; if($field->type == 'dropdown') { $field_values = SettingsData::GetField($field->fieldid); $values = explode(',', $field_values->value); echo "<select name=\"{$field->fieldname}\">"; if(is_array($values)) { foreach($values as $val) { $val = trim($val); if($val == $field->value) $sel = " selected "; else $sel = ''; echo "<option value=\"{$val}\" {$sel}>{$val}</option>"; } } echo '</select>'; } elseif($field->type == 'textarea') { echo '<textarea class="customfield_textarea"></textarea>'; } else { echo '<input type="text" name="'.$field->fieldname.'" value="'.$field->value.'" />'; } echo '</dd>'; } } ?> <dt>Avatar:</dt> <dd><input type="hidden" name="MAX_FILE_SIZE" value="<?php echo Config::Get('AVATAR_FILE_SIZE');?>" /> <input type="file" name="avatar" size="40"> <p>Your image will be resized to <?php echo Config::Get('AVATAR_MAX_HEIGHT').'x'.Config::Get('AVATAR_MAX_WIDTH');?>px</p> </dd> <dt>Current Avatar:</dt> <dd><?php if(!file_exists(SITE_ROOT.AVATAR_PATH.'/'.$pilotcode.'.png')) { echo 'None selected'; } else { ?> <img src="<?php echo SITE_URL.AVATAR_PATH.'/'.$pilotcode.'.png';?>" /></dd> <?php } ?> <dt></dt> <dd><input type="hidden" name="action" value="saveprofile" /> <input type="submit" name="submit" value="Save Changes" /></dd> </dl> </form> 1 Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted August 15, 2011 Report Share Posted August 15, 2011 I'll have to take a peak at that mark. That is much longer and drawn out then mine, but probably the best way to do it. I really am having issues working with this whole codeon module style to be honest. Funny how I can code a php website from scratch and make it run flawless, but I have so much trouble here. Dealing with a couple issues here at home with one of the young'uns right now. As soon as I can here in a bit, I will dive in to this. Thanks Mark! Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted August 15, 2011 Moderators Report Share Posted August 15, 2011 I know what thats like i have 2 here myself. roll on their bed time lol Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted August 16, 2011 Report Share Posted August 16, 2011 Hey Mark, I got thinking about it some. If we make it a field in registration as the code suggests as a custom field, then the person will never be able to update their about me ever again. Thus the need to be able to update the database from the edit profile page. Am I looking to far into your suggestion? Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted August 17, 2011 Report Share Posted August 17, 2011 Ray, I am just having a look at this and if you add a custom field then you can edit this and have it displayed already by the code. <h3>Edit Profile</h3> <form action="<?php echo url('/profile');?>" method="post" enctype="multipart/form-data"> <dl> <dt>Name</dt> <dd><?php echo $userinfo->firstname . ' ' . $userinfo->lastname;?></dd> <dt>Airline</dt> <dd><?php echo $userinfo->code?> <p>To request a change, contact your admin</p> </dd> <dt>Email Address</dt> <dd><input type="text" name="email" value="<?php echo $userinfo->email;?>" /> <?php if(isset($email_error) && $email_error == true) echo '<p class="error">Please enter your email address</p>'; ?> </dd> <dt>Location</dt> <dd><select name="location"> <?php foreach($countries as $countryCode=>$countryName) { if($userinfo->location == $countryCode) $sel = 'selected="selected"'; else $sel = ''; echo '<option value="'.$countryCode.'" '.$sel.'>'.$countryName.'</option>'; } ?> </select> <?php if(isset($location_error) && $location_error == true) echo '<p class="error">Please enter your location</p>'; ?> </dd> <dt>Signature Background</dt> <dd><select name="bgimage"> <?php foreach($bgimages as $image) { if($userinfo->bgimage == $image) $sel = 'selected="selected"'; else $sel = ''; echo '<option value="'.$image.'" '.$sel.'>'.$image.'</option>'; } ?> </select> </dd> <?php if($customfields) { foreach($customfields as $field) { echo '<dt>'.$field->title.'</dt> <dd>'; if($field->type == 'dropdown') { $field_values = SettingsData::GetField($field->fieldid); $values = explode(',', $field_values->value); echo "<select name=\"{$field->fieldname}\">"; if(is_array($values)) { foreach($values as $val) { $val = trim($val); if($val == $field->value) $sel = " selected "; else $sel = ''; echo "<option value=\"{$val}\" {$sel}>{$val}</option>"; } } echo '</select>'; } elseif($field->type == 'textarea') { echo '<textarea class="customfield_textarea"></textarea>'; } else { echo '<input type="text" name="'.$field->fieldname.'" value="'.$field->value.'" />'; } echo '</dd>'; } } ?> <dt>Avatar:</dt> <dd><input type="hidden" name="MAX_FILE_SIZE" value="<?php echo Config::Get('AVATAR_FILE_SIZE');?>" /> <input type="file" name="avatar" size="40"> <p>Your image will be resized to <?php echo Config::Get('AVATAR_MAX_HEIGHT').'x'.Config::Get('AVATAR_MAX_WIDTH');?>px</p> </dd> <dt>Current Avatar:</dt> <dd><?php if(!file_exists(SITE_ROOT.AVATAR_PATH.'/'.$pilotcode.'.png')) { echo 'None selected'; } else { ?> <img src="<?php echo SITE_URL.AVATAR_PATH.'/'.$pilotcode.'.png';?>" /></dd> <?php } ?> <dt></dt> <dd><input type="hidden" name="action" value="saveprofile" /> <input type="submit" name="submit" value="Save Changes" /></dd> </dl> </form> Ok I gave this a go and I can not get it to show anything on the profile page. I can enter the text in the about me section of the edit profile page and I get the same results as before. Nothing is showing after I submit. 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.