display pic below users profile

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    display pic below users profile

    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 ,
    PHP Code:
    $countpics mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM ibwf_usergallery WHERE uid='".$who."'"));
      echo 
    "<a href=\"usergallery.php?action=viewuserphoto&amp;who=$who&amp;sid=$sid\">MY GALLERY</a>($countpics[0])<br/>"

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

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

    Comment


      #3
      use a while coding

      Comment


        #4
        Originally posted by arnage View Post
        Cant count that, try this. * means something like ALL

        PHP Code:
        $countpics mysql_fetch_array(mysql_query("SELECT * FROM ibwf_usergallery WHERE uid='".$who."'"));
          echo 
        "<a href=\"usergallery.php?action=viewuserphoto&amp;who=$who&amp;sid=$sid\">MY GALLERY</a>($countpics[0])<br/>"
        not working bro , do i hve to use phpthumb

        Comment


          #5
          this code just print a link to user gallery. do u want to show photo thumbs?

          Comment


            #6
            Originally posted by Rksk View Post
            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

            Comment


              #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.
              PHP Code:
              echo "<p><a href='gallery2.php?action=viewuserphoto&who=$who'>";

              $itemsmysql_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>"

              Comment


                #8
                PHP Code:
                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.!

                Comment


                  #9
                  this is the right syntax
                  PHP Code:
                  $countpics mysql_num_rows(mysql_query ("SELECT * FROM ibwf_usergallery WHERE
                  uid='"
                  .$who."'")); echo "<a href=\"usergallery.php? action=viewuserphoto&amp;who= $who&amp;sid=$sid\">MY GALLERY</a>('.$countpics.')<br/ >"
                  .
                  Last edited by arnage; 31.07.12, 17:38.

                  Comment


                    #10
                    01.
                    Code:
                    ORDER BY RAND()
                    this will select 3 random photos only if available. if the user haven't photos, this wont return anything.

                    02. don't post crazy replies without reading the whole thread!
                    Last edited by Rksk; 29.07.12, 17:46.

                    Comment

                    Working...
                    X