| Author |
Message |
jaredg16
Wizard


Joined: Feb 22, 2006 Posts: 76 Location: Baton Rouge, LA
|
Posted: Fri Mar 31, 2006 7:22 pm Post subject: switching graphics with if/then statements |
|
|
Yo Dari!
What is the code for switching the picture for private messages? What I mean by that... if a user does NOT have any private messages unread in his indox, then the graphic shown is the non-blinking graphic. If the user DOES have unread/new messages in his indox, then the graphic that shows is the blinking one. I know how to do if then statements, but I don't know what the code is to do it regarding whether or not a message is in the indox.
Does this make sense?
J |
|
| Back to top |
|
|
AdBot
|
| Post subject: switching graphics with if/then statements |
|
|
|
|
|
| Back to top |
|
 |
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6274 Location: Washington Township, NJ, USA
|
|
| Back to top |
|
|
jaredg16
Wizard


Joined: Feb 22, 2006 Posts: 76 Location: Baton Rouge, LA
|
Posted: Mon Apr 03, 2006 12:27 pm Post subject: Re: switching graphics with if/then statements |
|
|
Code: › $sql = "select user_new_privmsg from ".$user_prefix."_users where username='$username'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$numrow = $row['user_new_privmsg'];
if ($username == "Anonymous") {
echo "<td width=\"80%\" nowrap><font class=\"content\">\n"
." [<a href=\"modules.php?name=Your_Account&op=new_user\">"._LOGINCREATE."</a>] or [<a href=\"modules.php?name=Your_Account\">"._LOGIN."</a>]\n"
."</font></td>\n";
} else {
echo "<td height=\"20\" width=\"30%\"><font class=\content\"><b>\n"
" "._HELLO." $username! </b>[<a href=\"modules.php?name=Your_Account&op=logout\">"._LOGOUT."</a>]";
"</font></td>\n"
"<td align=\"center\" width=\"50%\"><font class=\"supertiny\"><b>YOUR ACCOUNT:</b> &nbp;[ <a href=\"modules.php?name=Your_Account&op=edituser\">Profile</a>";
if ($numrow <> "0") {
echo "<a href=\"/modules.php?name=Private_Messages\"><img src=\"/images/pm-yes.gif\" border=0 alt=\"You have $numrow PM\"></a>";
} else {
echo "<a href=\"/modules.php?name=Private_Messages\"><img src=\"/images/pm-no.gif\" border=0 alt=\"Send a PM\"></a>";
}
echo " ] ";
}
" | <a href=\"modules.php?name=Private_Messages\">Messages</a> | <a href=\"modules.php?name=Journal&file=edit\">Journal</a> | <a href='modules.php?name=gallery2&g2_view=members.MembersItems&g2_userId=$g2_userId'>e-Gallery Pics</a> ]"
"</font></td>\n";
}
This is what I did and I am getting the following error message: "Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /home/nseconne/public_html/portal/themes/Anagram/theme.php on line 134
"
What's the problem?
Thanks! |
|
| Back to top |
|
|
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6274 Location: Washington Township, NJ, USA
|
Posted: Mon Apr 03, 2006 12:32 pm Post subject: Re: switching graphics with if/then statements |
|
|
you need to put an echo before that last line (the one with the link for private messages, journal, etc). _________________
 |
|
| Back to top |
|
|
jaredg16
Wizard


Joined: Feb 22, 2006 Posts: 76 Location: Baton Rouge, LA
|
Posted: Mon Apr 03, 2006 1:29 pm Post subject: Re: switching graphics with if/then statements |
|
|
Still trouble.. hmmm...
|
|
| Back to top |
|
|
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6274 Location: Washington Township, NJ, USA
|
Posted: Mon Apr 03, 2006 1:34 pm Post subject: Re: switching graphics with if/then statements |
|
|
you need a semicolon at the end of the last line. _________________
 |
|
| Back to top |
|
|
jaredg16
Wizard


Joined: Feb 22, 2006 Posts: 76 Location: Baton Rouge, LA
|
Posted: Mon Apr 03, 2006 1:46 pm Post subject: Re: switching graphics with if/then statements |
|
|
Still trouble. I can't seem to find the small problem. haha And I know it's just an easy easy fix to this! ARGH!
Check out the entire page's code at https://host475.ipowerweb.com:8087/pane ... Ftheme.php (using the username and password I gave you in the PM.
J |
|
| Back to top |
|
|
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6274 Location: Washington Township, NJ, USA
|
Posted: Mon Apr 03, 2006 1:55 pm Post subject: Re: switching graphics with if/then statements |
|
|
try now. _________________
 |
|
| Back to top |
|
|
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6274 Location: Washington Township, NJ, USA
|
|
| Back to top |
|
|
jaredg16
Wizard


Joined: Feb 22, 2006 Posts: 76 Location: Baton Rouge, LA
|
Posted: Mon Apr 03, 2006 2:10 pm Post subject: Re: switching graphics with if/then statements |
|
|
still doesn't work.
https://host475.ipowerweb.com:8087/pane ... ogress.php
I made the changes for the two images as you can see in the file above. (I have this one that I'm working on but the current one named "theme" is a previous working file. I simply use this "theme-in-progress" to try to get it to work and once this file works I'll save it in place of the "theme" file.
J |
|
| Back to top |
|
|
|
|
|
|
|