User Selected On/off

Started on the old forum in September 2008 · view the original in the archive · old links redirect here

13 replies · 977 views · started 18 years ago · 1 min read

2 participants
sweetangel Lead · 885 posts #1

I wont add option to view random photo from gallery users at before nickname on/off... if Is on users view at chat msg before nickname a small random images from authors gallery. if OFF normal msg...

any1 can help to code this on/off???

tnks to help

if like my post click:

External image (may be gone)

something else Fellow · 2,296 posts #2
$onoff = mysql_fetch_array(mysql_query("SELECT onoff FROM ibwf_users WHERE id='".$uid."'"));
$photo = mysql_fetch_array(mysql_query("SELECT imageurl FROM ibwf_gallery WHERE uid='".$chat[0]."' ORDER BY RAND() "));
if($onoff[0]=="1"){
echo "<img src=\"$photo[0]\" width=\"50\" height=\"50\" alt=\"$photo[0]\"/>";
}
echo "[$ds]<a href=\"chat.php?action=say2&sid=$sid&who=$chat[0]&rid=$rid&rpw=$rpw\">$optlink</a> - ";
echo "".strtolower($tosay)."
";

then code the rest so you have drop down box n index.php

echo "chat pics:"; echo "<select name="onoff">\n"; echo "<option value="0">off</option>\n"; echo "<option value="1">on</option>\n"; echo "</select>";

think you can code the sql and the rest of the codes 🙂

something else Fellow · 2,296 posts #4

exactly the same way as you did in chatcolourmessage but change the sql to onoff 🙂

something else Fellow · 2,296 posts #8

oh for if a user doesnt have a pic uploaded 🙂

$piccount = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_gallery WHERE uid='".$chat[0]."'")); if ($piccount[0]>0){ $photo = mysql_fetch_array(mysql_query("SELECT imageurl FROM ibwf_gallery WHERE uid='".$chat[0]."' ORDER BY RAND() ")); $photo = $photo[0]; }else{ $photo = "defaultpic.jpg"; }

echo "<img src="$photo" width="50" height="60" alt="$photo"/>";

btw i made a slight error in earlier post ........ corrected now 🙂

something else Fellow · 2,296 posts #10
$piccount = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_gallery WHERE uid='".$chat[0]."'"));
if ($piccount[0]>0){
$photo = mysql_fetch_array(mysql_query("SELECT imageurl FROM ibwf_gallery WHERE uid='".$chat[0]."' ORDER BY RAND() "));
$photo = $photo[0];
}else{
$photo = "defaultpic.jpg";
}
$onoff = mysql_fetch_array(mysql_query("SELECT onoff FROM ibwf_users WHERE id='".$uid."'"));
if($onoff[0]=="1"){
echo "<img src=\"$photo[0]\" width=\"50\" height=\"50\" alt=\"$photo[0]\"/>";
}
something else Fellow · 2,296 posts #13

change

echo "<img src="$photo[0]" width="50" height="50" alt="$photo[0]"/>";

to

echo "<img src="$photo" width="50" height="50" alt="$photo"/>";

btw im inca not inet 🪖

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close