Jump to content

pilot_list.tpl - Advancing the page.


JackPlumb

Recommended Posts

Im not understanding what you have done clearly. The best way to accomplish your goal is to make a new group called in-active pilots and simply change the pilots association with a group ( Either Active, In-active ) as the situation presents itself. Now in that case, you cannot change the plain text because its in a form. Image association is very simple, but please explain your exact problem more clearly and I might be able to help you better.

With regards,

Jake

Link to comment
Share on other sites

Ok, I have added a new 'Profile Field' which is text. I have added this field to show up on pilots_list.tpl, on this list it will either say ACTIVE or INACTIVE. This looks too plain, and therefore I am asking if there is a code that would for example place an image on the pilots_list.tpl if ACTIVE is placed in that field insted of boring text.

Link to comment
Share on other sites

Again, since I do not know the exact code for the situation I can only give you a basic idea of what it will look like.

First of you are checking if the users situation is either ACTIVE or NOTACTIVE, thus the conditiona; statement comes into play.

<?php
if($active == TRUE){
echo 'The image will be spit out here';
}else{
echo 'The not active image will go here';
}?>

Just find the exact code that deals with the profile fields and fill in where required. Ill dig through it later when I get back to my computer at home ( Im on my iPhone ).

*and quick note. You can do what I like to call blocking with HTML and do this...

<?php if($active == TRUE) { ?>
<img src="path here"/>
<?php } else { ?>
<img src="pathhere for the not active image"/>
<?php } ?>

This just allows you to put HTML freely between the tags as opposed to using an echo or print statement to render the image.

Link to comment
Share on other sites

  • Administrators

Ok, I have added a new 'Profile Field' which is text. I have added this field to show up on pilots_list.tpl, on this list it will either say ACTIVE or INACTIVE. This looks too plain, and therefore I am asking if there is a code that would for example place an image on the pilots_list.tpl if ACTIVE is placed in that field insted of boring text.

Hey,

I think it's $pilot

So you can do

if($pilot->retired == 0)
{
   echo '<img src="/path to active image" alt="active" />';
}
else
{
  echo '<img src="/path to inactive image" alt="active" />';
}

With the variable for $pilot, you can get any column from the pilots table with:

$pilot->[column name]

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...