How to replace a value with a image?

Download, Present, and receive support for third party WoWRoster AddOns and modifications
WoWRoster AddOns and Mods are supported by the author only
Please understand that some AddOns and Mods may require advanced skills to employ

How to replace a value with a image?

Postby elminster » Mon Sep 11, 2006 2:21 am

I everyone i'm working a new addon (for the attunement guild) but I was wondering how I can "replace" the value from the DB (it's a boolean value) to a Image

So let say if the value is true I want a Image who say the attunement is completed instead of the 1 value.

And if the Value is false I want to put a X instead of a 0

you can check the demo here

Code: Select all
Also here the way the query is show:

$content .= '<td class="membersRow'. (($striping_counter % 2) +1) .'">'.$row['attun_onyxia'].'</td>';
elminster
WR.net Apprentice
WR.net Apprentice
 
Posts: 4
Joined: Sat Jul 08, 2006 2:53 am

How to replace a value with a image?

Postby Averen » Mon Sep 11, 2006 2:33 am

Try
Code: Select all
If($value == 1){
$content .= "<img src='img.jpg' alt='img'>";
} else {
$content .= "X";
}
 


Is that what you mean?
User avatar
Averen
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 152
Joined: Thu Jul 20, 2006 5:18 am

How to replace a value with a image?

Postby elminster » Mon Sep 11, 2006 3:51 am

It work and not...

it's seems that the value the DB put out isnt correct anymore...

here the code
Code: Select all
   If($row['attunement_onyxia'] == 1){
      $classco2 .= "<img src='http://www.wowroster.net/images/avatars/gallery/blank.gif' alt='img'>";}
      
   else {
      $classco2 .= "X";}

   $content .= "<tr>\n";
      $content .= '<td class="membersRow'. (($striping_counter % 2) +1) .'">'.$classco2.'</td>';
elminster
WR.net Apprentice
WR.net Apprentice
 
Posts: 4
Joined: Sat Jul 08, 2006 2:53 am

Re: How to replace a value with a image?

Postby elminster » Mon Sep 11, 2006 5:10 am

Hmm here my problem:

How I can compare my value in the DB to see if it's a 1 or 0.
This is the code to show the output

Code: Select all
$content .= "<tr>\n";
        $content .= '<td class="membersRow'. (($striping_counter % 2) +1) .'">'.'<a href="char.php?'.$charURLname.'='.$row['name'].'&'.$charURLserver.'='.$row['server'].'">'.$row['name'].'</a></td>';
        $content .= '<td class="membersRow'. (($striping_counter % 2) +1) .'">'.$classcol.'</td>';
        $content .= '<td class="membersRow'. (($striping_counter % 2) +1) .'">'.$row['level'].'</td>';
        $content .= '<td class="membersRow'. (($striping_counter % 2) +1) .'">'.$row['attunement_bwl'].'</td>';


How I can check it X member have there attunement_bwl true or false and after To put the output I want like the:

Code: Select all
If($value == 1){$content .= "<img src='img.jpg' alt='img'>";} else {$content .= "X";}
post sooner by Averen (it's working btw)
Last edited by elminster on Mon Sep 11, 2006 5:11 am, edited 1 time in total.
elminster
WR.net Apprentice
WR.net Apprentice
 
Posts: 4
Joined: Sat Jul 08, 2006 2:53 am


Return to AddOns and Mods

Who is online

Users browsing this forum: No registered users and 0 guests

cron