| Author |
Message |
Nemesis
Corporal


Joined: Apr 06, 2003
Posts: 65
|
Posted:
Wed Apr 23, 2003 12:54 pm |
  |
i am trying to make a module which will list members of my gaming group and also give them option of selecting icons for games they play on server. the problem i run into is i am calling the image from the database to the list page incorrectly. any input would be greatly appreciated
i use this code for each select box in profile (with differnt names )
| Code: |
<?php echo _CLSC; ?>:
<?php
if ( $cl[m_sc] != "" ) {
$m_sc = $cl['m_sc'];
} else {
$m_sc = "blank.gif";
}
?>
<select name="m_sc">
<option value="" <?php echo (empty($cl['m_sc'])) ? 'selected' :
''; ?>></option>
<option value="Star" <?php echo ($cl['m_sc'] ==
"images/icons/star.gif") ?
'selected' : ''; ?>>Star</option>
</select> |
and i use this to call the image to the list page
| Code: |
| echo "<td bgcolor=\"$dcolor\" align=\"left\"><img src=\"modules/$module_name/images/icons/$m_sc\" width=\"25\" height=\"15\" align=\"right\" border=\"0\">\n"; |
but i get a broken image with:
http://myurl/modules/modulename/images/icons/
the path is correct but the image itself isnt being called . Any ideas or input be great . this newb needs all the help he can get |
|
|
     |
 |
Raven
General


Joined: Mar 22, 2003
Posts: 5233
Location: USA
|
Posted:
Wed Apr 23, 2003 2:47 pm |
  |
Why do you have tick marks around this? $m_sc = $cl['m_sc']; but not this $cl[m_sc] ? Could be your problem. |
_________________ Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff |
|
    |
 |
Nemesis
Corporal


Joined: Apr 06, 2003
Posts: 65
|
Posted:
Wed Apr 23, 2003 2:50 pm |
  |
i was told by someone at php it was proper orginially i didnt have the tic marks
origianl was
| Code: |
if ( $cl[m_sc] != "" ) {
$m_sc = $cl[m_sc]; |
i was told this is incorrect nad listened. i am new to php . is this the problem? |
|
|
     |
 |
Raven
General


Joined: Mar 22, 2003
Posts: 5233
Location: USA
|
Posted:
Wed Apr 23, 2003 2:52 pm |
  |
Well without the tic marks it will substitute the value of m_sc. With the tick marks it substitues m_sc. Since it's an array, then chances are you want an array element, which means you do NOT want the tick marks. |
_________________ Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff |
|
    |
 |
Nemesis
Corporal


Joined: Apr 06, 2003
Posts: 65
|
Posted:
Wed Apr 23, 2003 2:53 pm |
  |
thank you ill give it a wirl. this little addon is kicking my butt hehe i jsut get the pathway with no call for image |
|
|
     |
 |
Raven
General


Joined: Mar 22, 2003
Posts: 5233
Location: USA
|
Posted:
Wed Apr 23, 2003 3:11 pm |
  |
Well, I don't know if the module works, but your problem would be in that area because the syntax isn't right. Let me know. |
_________________ Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff |
|
    |
 |
Nemesis
Corporal


Joined: Apr 06, 2003
Posts: 65
|
Posted:
Wed Apr 23, 2003 3:12 pm |
  |
tried it , the module actually works , its just the images broken on this one area i want them . i dont get it pathway ther something in my $m_sc isnt callnig the image correctly
i had the call for the select drops in edit area. and the call to show images in the list . it isnt major coding . but damn if i can get it right |
|
|
     |
 |
Raven
General


Joined: Mar 22, 2003
Posts: 5233
Location: USA
|
Posted:
Wed Apr 23, 2003 3:17 pm |
  |
In this piece of code
| Code: |
if ( $cl[m_sc] != "" ) {
$m_sc = $cl['m_sc'];
} else {
$m_sc = "blank.gif";
}
|
Add a debug statement like this:
| Code: |
if ( $cl[m_sc] != "" ) {
$m_sc = $cl[m_sc];
} else {
$m_sc = "blank.gif";
}
echo $m_sc;die();
|
If $m_sc is empty, that's your problem. Then you have to figure out why. |
_________________ Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff |
|
    |
 |
Nemesis
Corporal


Joined: Apr 06, 2003
Posts: 65
|
Posted:
Wed Apr 23, 2003 3:18 pm |
  |
hehe wow kewl thanks didnt know that little tid bit hehe. i did say i was newb . btw rate where gonig thsi should be an pm ROFL
hmmmmmmmm i did it and got CLSC: blank.gif instead of my normal drop menu |
|
|
     |
 |
Raven
General


Joined: Mar 22, 2003
Posts: 5233
Location: USA
|
Posted:
Wed Apr 23, 2003 3:53 pm |
  |
|
    |
 |
Nemesis
Corporal


Joined: Apr 06, 2003
Posts: 65
|
Posted:
Wed Apr 23, 2003 3:54 pm |
  |
was it suppsoed to do that? it liked killed al lmy code following and showed me the default blank.gif which is supposed to be if they didnt choose the image |
|
|
     |
 |
Raven
General


Joined: Mar 22, 2003
Posts: 5233
Location: USA
|
Posted:
Wed Apr 23, 2003 4:00 pm |
  |
The die(); kills it to allow you to see the value to determine if that is what you were expecting. Now, remove that code and correct this. I just noticed this:
$cl[m_sc] should probably be $cl[$m_sc]. |
_________________ Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff |
|
    |
 |
Nemesis
Corporal


Joined: Apr 06, 2003
Posts: 65
|
Posted:
Wed Apr 23, 2003 4:10 pm |
  |
thank you very much for all your time. i think maybe i over stepped myself |
|
|
     |
 |
Raven
General


Joined: Mar 22, 2003
Posts: 5233
Location: USA
|
Posted:
Wed Apr 23, 2003 4:19 pm |
  |
As a very wise man once said: We learn by doing (James T. Kirk)
Damn it Jim, I'm a programmer, not a magician! (paraphrase of Bones) |
_________________ Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff |
|
    |
 |
Nemesis
Corporal


Joined: Apr 06, 2003
Posts: 65
|
Posted:
Wed Apr 23, 2003 4:27 pm |
  |
i liked scotie much better " im given all shes got captain ........she cant take much more of this" hehehe
hehe nah thinknig mabye i should eigher scrap and total redo this part of module or try something simpler for my first time |
|
|
     |
 |
|
|