display pic below users profile

Started on the old forum in July 2012 · view the original in the archive · old links redirect here

9 replies · 706 views · started 14 years ago · 1 min read

6 participants
mirror Developer · 108 posts #1

hey friends i want to display the pics below users profile , this is the coding for gallery link in profile how can i display their gallery pics as thumbnails ,

$countpics = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_usergallery WHERE uid='".$who."'"));
  echo "<a href=\"usergallery.php?action=viewuserphoto&who=$who&sid=$sid\">MY GALLERY</a>($countpics[0])<br/>";
arnage Lead · 811 posts #2

Cant count that, try this. * means something like ALL

$countpics = mysql_fetch_array(mysql_query("SELECT * FROM ibwf_usergallery WHERE uid='".$who."'"));
  echo "<a href=\"usergallery.php?action=viewuserphoto&who=$who&sid=$sid\">MY GALLERY</a>($countpics[0])<br/>";
<!DOCTYPE html PUBLIC "-//***WAPFORUM**.**RS***
mirror Developer · 108 posts #4

arnage wrote: Cant count that, try this. * means something like ALL

$countpics = mysql_fetch_array(mysql_query("SELECT * FROM ibwf_usergallery WHERE uid='".$who."'"));
  echo "<a href=\"usergallery.php?action=viewuserphoto&who=$who&sid=$sid\">MY GALLERY</a>($countpics[0])<br/>";

not working bro , do i hve to use phpthumb

mirror Developer · 108 posts #6

Rksk wrote: this code just print a link to user gallery. do u want to show photo thumbs? yes bro i want to show photos of a users profile as thumbnails below their profiles , i have the column of imageurl for path, in my ibwf_gallery , how to link it to show image , images are uploaded in folder gallery

Rksk Developer · 54 posts #7

Try below one. *I coded it using general lavalair file names. It can be changed in ur site. *this will show 3 random photos of the user.

echo "<p><a href='gallery2.php?action=viewuserphoto&who=$who'>";

$items= mysql_query("SELECT `imageurl` FROM `ibwf_usergallery` where `uid`='$who' ORDER BY RAND() LIMIT 3");
  while ($pic = mysql_fetch_array($items))
  {
    echo "<img alt='Loading...' src='phpthumb.php?image=$pic[0]' width='30' height='30'>";
  }

echo "</a></p>";
Vayne Developer · 106 posts #8
ORDER BY RAND()

i hope those users dont have tons of pictures. anyway, better would be randomize in php side.

Nous Ne Dansos Pas, Nous Sommes Le Danse.!

arevel Newbie · 4 posts #9

this is the right syntax

$countpics = mysql_num_rows(mysql_query ("SELECT * FROM ibwf_usergallery WHERE
uid='".$who."'")); echo "<a href=\"usergallery.php? action=viewuserphoto&who= $who&sid=$sid\">MY GALLERY</a>('.$countpics.')<br/ >";

.

Rksk Developer · 54 posts #10
ORDER BY RAND()

this will select 3 random photos only if available. if the user haven't photos, this wont return anything.

  1. don't post crazy replies without reading the whole thread!

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