Jump to content

Awards [SOLVED]


TAV1702

Recommended Posts

Hi Nabeel.  I was just wondering, with the coding the way it is now, how hard would it be to make it so that  awards name and description is a tooltip ( Alt Text ) when you mouse over an award image instead of it appearing beside the image. I think it would simply be for asthetics of course.

I'm not asking  for this to be a built in feature, was just a thought I had. I was going to take a stab at it, but I decided against it.

Reason: Since I am on Beta, I hate to come back and report something broke after I altered it. That is not fair to waste your time like that on something that might be my fault.  ;)

Link to comment
Share on other sites

Well, that is exactly what I started to do except, the code in the template is used to call up any award issued so it can not be hard coded.

As far as admin side goes, all I have is the name, description, and a link to the image. So there is really no where to add the alt text. Am I correct or am I missing something?

I am on the old ladies Laptop at the moment getting all her FS stuff back in order. As soon as I get on my PC I will post a pic and some code so I know we are on the same page. From time to time my explanations are not the best.  ;D

As usual, thanks for the quick reply Nabeel.

Link to comment
Share on other sites

Well actually, the template is mine, BUT the public profile and pilot center templates have never been touched. The only thing different is the css info to change color.

And yeah, my girlfriend is trying to learn how to do the whole FS thing. I add so much crap on her simulator, she is lost. lol One thing at a time and she will know it all more than any of us do.  ;D

Here are some pics and I'll narrate as I go.

Ok here is the ACP side of things. First things first.....  is the image supposed to show up here or just the link to it? I thought the image was supposed to but... That's what I get for thinking  ;D

image1.jpg

Now here is another ACP side of things. I do not think it is possible to add code to the description field for it to show up as alt text over pic.

ACP.jpg

Here is the Pilot Center. Originally, the image never showed up until I did this

<strong>Awards</strong>
         <?php
         if(is_array($allawards))
         {         
         ?>
         <ul>
            <?php foreach($allawards as $award)
            { 
               /* To show the image:*/?>
               <li><?php echo $award->name ?><img src="<?php echo $award->image?>" alt="<?php echo $award->descrip?>" /></li>
             
         <?php } ?>
         </ul>

But that gave the award name twice. And on one of them, it was Award Name with description RIGHT next to it then the pic to the right of it. So it would be like this

ATC Of The Month  For being the best controller on the scopes this month ( PIC HERE)

Now I altered that code to do the following which made it look MUCH better IMO and got rid of the double award name..... And that means it was listed 2 times each one with a bullet next to it.

awards2.jpg

Notice how the Award name is on top and the image is below it? Much cleaner looking to me. Now it would be sweet if I moused over that image and got a tool tip.

My problem with hard coding it is, I will then get the same description for different awards.

I just hope I have not confused you any worse than I most likely already have.

If you want me to, I can change the code back to the way it was originally and get a screen shot for you so you can see the double image name and LONG description.

Link to comment
Share on other sites

Yeah it is not showing the description at all when mousing over an image.  It did originally place it next to the award name and the award image was WAY to the right of the page.

something like this

AWARDS

  • Pilot of the Month              Pilot of the Moth - For being the most active pilot for the month. ( IMAGE HERE)
  • Pilot of the Month

Notice how it listed the award name twice in the list? AND when it lists the award the first time, it gives the name twice, puts the description beside it, then the image beside it.

It should have only listed the award once in the list and then showed the pic and when mousing over it, it pulls the description as alt text.... Is that correct? If so, that is not what it does.

And as I said before, the pilot center and public profile pages are un altered. The code is yours. I'm sure it is one of those simple things that are going to make me go DOH!!! in the end.  ;D

The only changes I made were in the css file when I made my make shift skin.

Link to comment
Share on other sites

Hey Nabeel, my apologies. I failed to give you some key info. 

All along since I initially installed the Full Install some time back when I first found phpVMS, this feature has never worked accordingly for me. All it showed was the list bullet and award name.

To get it to the point it is now, I used the code I found in THIS thread.

Link to comment
Share on other sites

And full install upgraded to 816 does the same thing. It has the bullet from the list then gives the award name. No image no nothing.

I am going to add the code to it from that thread I posted about and let you know what happens.

Oh and can you tell me what this means please.... I am sure I have a permissions error going on while trying to upload an avatar.

Warning: imagesy(): supplied argument is not a valid Image resource in /home/xxxxxxxx/public_html/test/core/common/PilotData.class.php on line 345

Warning: imagesx(): supplied argument is not a valid Image resource in /home/xxxxxx/public_html/test/core/common/PilotData.class.php on line 346

Warning: Division by zero in /home/xxxxxxx/public_html/test/core/common/PilotData.class.php on line 349

Warning: imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions in /home/xxxxxx/public_html/test/core/common/PilotData.class.php on line 351

Warning: imagecopyresized(): supplied argument is not a valid Image resource in /home/xxxxxxx/public_html/test/core/common/PilotData.class.php on line 352

Warning: imagepng(): supplied argument is not a valid Image resource in /home/xxxxxx/public_html/test/core/common/PilotData.class.php on line 356

Warning: imagedestroy(): supplied argument is not a valid Image resource in /home/xxxxxx/public_html/test/core/common/PilotData.class.php on line 357

The x's were my doing for security purposes.

Link to comment
Share on other sites

Ok the double award name was my fault. I found my error. But none the less, the rest is the same.

I have on my test site, build 816 with code added from that thread to make the image show up.

The code is

<strong>Awards</strong>
         <?php
         if(is_array($allawards))
         {         
         ?>
         <ul>
            <?php foreach($allawards as $award)
            { 
               /* To show the image:*/?>
               <li><?php echo $award->name ?><img src="<?php echo $award->image?>" alt="<?php echo $award->descrip?>" /></li>
             
         <?php } ?>
         </ul>

I have created a test account with full admin rights If you want to go in and mess around for a few minutes to see it first hand in action. If you do, let me know and I'll PM you the info.  ;)

Link to comment
Share on other sites

  • 7 months later...

Well guys/gals (if any), I have finally fixed my mouse over problem after all this time and version later. alt does not work for firefox.

The code was originally

<li><?php echo $award->name ?><br />
                                       <img src="<?php echo $award->image?>" alt="<?php echo $award->descrip?>" />
                                       </li>

I changed it to

<li><?php echo $award->name ?><br />
                                       <img src="<?php echo $award->image?>" alt="<?php echo $award->descrip?>" title="<?php echo $award->descrip?>"/>
                                       </li>

And now it works just fine. I had to do that for the pilot_public_profile as well as the profile_main.tpl

Go to http://thunderva.com and go to my pilots page and view a pilots profile. Like mine or doug or matt. Mouse over an award and see what happens.

Link to comment
Share on other sites

Nice, I lake that Ray. I also like your header image. B)

Oh the Thunder VA banner/logo? A guy over at Real World ATC made it for me. They have since closed their doors for operation.

Did you happen to notice the dates for my posts in that thread? ;) Took me that dam long just to come up with the title idea. :(

Link to comment
Share on other sites

Hi Ray, Just for interest sake, the alt tag is what is meant show as the placeholder if the image does not load. If memory serves me only IE uses the alt tag to display the tool-tip, all the other browsers will ignore it, But the title tag is the correct one to use for the tool-tip.

Link to comment
Share on other sites

Hi Ray, Just for interest sake, the alt tag is what is meant show as the placeholder if the image does not load. If memory serves me only IE uses the alt tag to display the tool-tip, all the other browsers will ignore it, But the title tag is the correct one to use for the tool-tip.

Yeah that's what I was thinking all along. I just simply forgot about fixing that until I added my awards in again. I got rid of my old temporary ones and put all my new ones in and that is when I remembered to fix it. So do you know if the title tag works for opera and the rest of them? So far the only browsers I have tested my site with are IE7 and IE8 and firefox and slim browser.

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...