Support Forums | Demo Gallery [1.x] [2.x] | Downloads | News | Site Map ]
Nuked Gallery
  Create a FREE account or Login   As a guest, you don't have access to our FULL navigation system.
 Forum FAQForum FAQ   StatisticsStatistics   SearchSearch   UsergroupsUsergroups   FavoritesFavorites  

switching graphics with if/then statements

 
Post new topic   Reply to topic    NukedGallery.net Forum Index » PHP-Nuke Issues » Other PHPNuke Issues View previous topicPrinter friendly versionView next topic
Author Message
jaredg16

Wizard
Wizard


Joined: Feb 22, 2006
Posts: 76
Location: Baton Rouge, LA

PostPosted: Fri Mar 31, 2006 7:22 pm    Post subject: switching graphics with if/then statements Reply with quote

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
Hidden View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
AdBot
   Post subject: switching graphics with if/then statements  

Back to top
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6274
Location: Washington Township, NJ, USA

PostPosted: Mon Apr 03, 2006 7:28 am    Post subject: Re: switching graphics with if/then statements Reply with quote

this is what is used here:
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 ($numrow <> "0") {
            echo "<a href=\"/modules.php?name=Private_Messages\"><img src=\"/themes/NG/img/pm.gif\" border=0 alt=\"You have $numrow PM\"></a>";
                        } else {
                                echo "<a href=\"/modules.php?name=Private_Messages\"><img src=\"/themes/NG/img/nopm.gif\" border=0 alt=\"Send a PM\"></a>";
                        }
                        echo " ]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
                }

_________________
Back to top
Offline View user's profile Send private message Visit poster's website
jaredg16

Wizard
Wizard


Joined: Feb 22, 2006
Posts: 76
Location: Baton Rouge, LA

PostPosted: Mon Apr 03, 2006 12:27 pm    Post subject: Re: switching graphics with if/then statements Reply with quote

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"
          ."&nbsp;&nbsp;[<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"
         "&nbsp;&nbsp;"._HELLO." $username!&nbsp;&nbsp;</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>&nbsp;&nbp;[&nbsp;<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 " ]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
                }
         "&nbsp;|&nbsp;<a href=\"modules.php?name=Private_Messages\">Messages</a>&nbsp;|&nbsp;<a href=\"modules.php?name=Journal&file=edit\">Journal</a>&nbsp;|&nbsp;<a href='modules.php?name=gallery2&g2_view=members.MembersItems&g2_userId=$g2_userId'>e-Gallery Pics</a>&nbsp;]"
         "</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
Hidden View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6274
Location: Washington Township, NJ, USA

PostPosted: Mon Apr 03, 2006 12:32 pm    Post subject: Re: switching graphics with if/then statements Reply with quote

you need to put an echo before that last line (the one with the link for private messages, journal, etc).
_________________
Back to top
Offline View user's profile Send private message Visit poster's website
jaredg16

Wizard
Wizard


Joined: Feb 22, 2006
Posts: 76
Location: Baton Rouge, LA

PostPosted: Mon Apr 03, 2006 1:29 pm    Post subject: Re: switching graphics with if/then statements Reply with quote

Still trouble.. hmmm...

Quote: › $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"
."&nbsp;&nbsp;["._LOGINCREATE."] or ["._LOGIN."]\n"
."</font></td>\n";
} else {
echo "<td height=\"20\" width=\"30%\"><font class=\content\">\n"
."&nbsp;&nbsp;"._HELLO." $username!&nbsp;&nbsp;
["._LOGOUT."]"
."</font></td>\n"
."<td align=\"center\" width=\"50%\"><font class=\"supertiny\">YOUR ACCOUNT:&nbsp;&nbsp;[&nbsp;Profile&nbsp;|&nbsp;";
if ($numrow <> "0") {
echo "<img src=\"/public_html/portal/themes/Anagram/images/pm-yes.gif\" border=0 alt=\"You have $numrow PM\">&nbsp;|&nbsp;Messages&nbsp;|&nbsp;Journal&nbsp;|&nbsp;e-Gallery Pics&nbsp;]</font></td>\n"
} else {
echo "<img src=\"/public_html/portal/themes/Anagram/images/pm-no.gif\" border=0 alt=\"Send a PM\">&nbsp;|&nbsp;Messages&nbsp;|&nbsp;Journal&nbsp;|&nbsp;e-Gallery Pics&nbsp;]</font></td>\n";

echo "<td align=\"right\" width=\"20%\"><font class=\"content\">\n"
Back to top
Hidden View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6274
Location: Washington Township, NJ, USA

PostPosted: Mon Apr 03, 2006 1:34 pm    Post subject: Re: switching graphics with if/then statements Reply with quote

you need a semicolon at the end of the last line.
_________________
Back to top
Offline View user's profile Send private message Visit poster's website
jaredg16

Wizard
Wizard


Joined: Feb 22, 2006
Posts: 76
Location: Baton Rouge, LA

PostPosted: Mon Apr 03, 2006 1:46 pm    Post subject: Re: switching graphics with if/then statements Reply with quote

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
Hidden View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6274
Location: Washington Township, NJ, USA

PostPosted: Mon Apr 03, 2006 1:55 pm    Post subject: Re: switching graphics with if/then statements Reply with quote

try now.
_________________
Back to top
Offline View user's profile Send private message Visit poster's website
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6274
Location: Washington Township, NJ, USA

PostPosted: Mon Apr 03, 2006 2:02 pm    Post subject: Re: switching graphics with if/then statements Reply with quote

it should work, you just need to get the two images from here:
http://www.nukedgallery.net/themes/NG/img/nopm.gif
and
http://www.nukedgallery.net/themes/NG/img/pm.gif
_________________
Back to top
Offline View user's profile Send private message Visit poster's website
jaredg16

Wizard
Wizard


Joined: Feb 22, 2006
Posts: 76
Location: Baton Rouge, LA

PostPosted: Mon Apr 03, 2006 2:10 pm    Post subject: Re: switching graphics with if/then statements Reply with quote

still doesn't work. Smile

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
Hidden View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    NukedGallery.net Forum Index » PHP-Nuke Issues » Other PHPNuke Issues View previous topicPrinter friendly versionView next topic

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours

Powered by phpBB © phpBB Group



Sponsors: Web HostingDedicated ServersDomain NamesDomain Name RegistrationDedicated Web HostingSearch Engine OptimisationSEOWeb Design New YorkSEO Web DesignWeb hosting AustraliaSEO

6th year online! 2003-2008
Legal • Use of this site consitutes agreement to the Acceptable Use Policy
Hosted by Implosion WorksSourceForge.net Logo • Theme by TonicMedia