Author Topic: [Request] Show user images in profile  (Read 16912 times)

0 Members and 1 Guest are viewing this topic.

Offline Lucifix

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
    • http://www.slo-foto.net
[Request] Show user images in profile
« on: June 09, 2005, 07:08:00 PM »
Before new forum I have installed mod that shows user images in profile.

But this mod has few bugs and it's made without image paging.

See how it looks:
http://www.slo-foto.net/modules.php?name=Galerija&file=member&action=showprofile&user_id=75&l=english

Does anyone else has idea how could this mod be improved?

You can find this code members.php

Code: [Select]
///////// Start Show member photos ///////////////// 
  $sql = "SELECT i.image_id, i.cat_id, i.image_points, i.image_week, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name
          FROM ".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c
          WHERE i.image_active = 1 AND i.user_id = ".$user_row['user_id']." AND c.cat_id = i.cat_id AND i.cat_id IN (".get_auth_cat_sql("auth_viewcat").")
          ORDER BY i.image_date DESC
          ";
  $result = $site_db->query($sql);
  $num_rows = $site_db->get_numrows($result);
  if (!$num_rows)  {
    $last_images = "<tr class=\"imagerow1\"><td>";
    $last_images .= $lang['no_last_images'];
    $last_images .= "</td></tr>";
  }
  else  {
    $last_images = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">";
    $count = 0;
    $bgcounter = 0;
     $last_images = "";
    while ($image_row = $site_db->fetch_array($result)){
      if ($count == 0) {
        $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
        $last_images .= "<tr class=\"imagerow".$row_bg_number."\">\n";
      }
   
$last_images .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";
 
      show_image($image_row);
      $last_images .= $site_template->parse_template("thumbnail_bit");
      $last_images .= "\n</td>\n";
      $count++;
      if ($count == $config['image_cells']) {
        $last_images .= "</tr>\n";
        $count = 0;
      }
    } // end while
 
    if ($count > 0)  {
      $leftover = ($config['image_cells'] - $count);
      if ($leftover >= 1) {
        for ($f = 0; $f < $leftover; $f++) {
          $last_images .= "<td width=\"".$imgtable_width."\">\n&nbsp;\n</td>\n";
        }
        $last_images .= "</tr>\n";
      }
    }
    $last_images .= "</table>\n";
  } // end else
 
///////// End Show member photos ///////////////// 

Offline Lucifix

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
    • http://www.slo-foto.net
Re: [Request] Show user images in profile
« Reply #1 on: June 15, 2005, 12:11:03 AM »
Nobody tried this?  :(

Offline Stoleti

  • Hero Member
  • *****
  • Posts: 574
    • View Profile
Re: [Request] Show user images in profile
« Reply #2 on: December 07, 2005, 04:36:22 PM »
i've tried and this give mysql db error ... :roll:

Offline ccsakuweb

  • Sr. Member
  • ****
  • Posts: 498
  • Patri
    • View Profile
    • My Art
Re: [Request] Show user images in profile
« Reply #3 on: August 27, 2006, 04:12:48 PM »
wow the profile looks great!!!  :D

there is a lot of interesting mod, for example star ranking down of the image and a award .. where can i find that mods??

and.. does this mod work ok or this hasnīt support  :cry: ??

please.. Lucifux in your gallery looks fine! could you help me to install it?
:arrow: 4images Paid Mods: Links, Blog, Albums, Subdomains for users, Diferent templates for user profile, Related picture in details, Last pictures in details.
And the mod that you request me.   Demo: http://www.myart.es

A website dedicated to artist people who loves drawing, design, writing and more

Offline mariano

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: [Request] Show user images in profile
« Reply #4 on: September 23, 2006, 05:53:49 AM »
Hey, I have tested and works great :wink:
It is possible to show XX images instead of all images?
I can see pagination on your member profile, how to add this feature?

Mariano

Offline Lucifix

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
    • http://www.slo-foto.net
Re: [Request] Show user images in profile
« Reply #5 on: September 23, 2006, 03:38:01 PM »
LImit number of image (member.php)

LIMIT number 8

Code: [Select]
  $sql = "SELECT i.image_id, i.cat_id, i.image_points, i.image_week, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name
          FROM ".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c
          WHERE i.image_active = 1 AND i.user_id = ".$user_row['user_id']." AND c.cat_id = i.cat_id AND i.cat_id IN (".get_auth_cat_sql("auth_viewcat").")
          ORDER BY i.image_date DESC
         LIMIT 8
          ";

Paging:

Code: [Select]
    $sql = "SELECT COUNT(*) AS num_rows_all
            FROM ".IMAGES_TABLE." i
            WHERE i.image_active = 1
    AND i.user_id = ".$user_row['user_id']."";
    $row = $site_db->query_firstrow($sql);
      $num_rows_all = $row['num_rows_all'];

      $perpage = 28; //how many images per page
      $getpaging = new Paging($page, $perpage, $num_rows_all, $link_arg);
      $offset = $getpaging->get_offset();
 
    $site_template->register_vars(array(
      "paging" => $getpaging->get_paging(),
      "paging_stats" => $getpaging->get_paging_stats()
    ));



And in SQL sentece add:

Code: [Select]
          ORDER BY $orderby DESC LIMIT $offset, $perpage";

Offline Stoleti

  • Hero Member
  • *****
  • Posts: 574
    • View Profile
Re: [Request] Show user images in profile
« Reply #6 on: September 23, 2006, 04:34:19 PM »
maybe a step by step , explaining how install it , would be useful  :wink:

Offline ccsakuweb

  • Sr. Member
  • ****
  • Posts: 498
  • Patri
    • View Profile
    • My Art
Re: [Request] Show user images in profile
« Reply #7 on: September 23, 2006, 06:40:03 PM »
yes, i didn`t understand.. what code i have to add in member_profile.html??? after I added the code in member.php??? and i donīt know where i can to add the code for the paging

please, help me.. -.-
« Last Edit: September 24, 2006, 01:06:17 AM by ccsakuweb »
:arrow: 4images Paid Mods: Links, Blog, Albums, Subdomains for users, Diferent templates for user profile, Related picture in details, Last pictures in details.
And the mod that you request me.   Demo: http://www.myart.es

A website dedicated to artist people who loves drawing, design, writing and more

Offline Lucifix

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
    • http://www.slo-foto.net
Re: [Request] Show user images in profile
« Reply #8 on: September 24, 2006, 11:40:27 AM »
Open member_profile.html and add somewhere at the end:

Code: [Select]
            <table width="100%"  border="0" cellpadding="0">
              <tr>
                <td><p align="center">{last_images}</p>
                    <p align="center">{paging}</p></td>
              </tr>
            </table>

I don't know what style are you using so you have to do some few stylish modifications ;)

Offline dosensteck

  • Full Member
  • ***
  • Posts: 160
    • View Profile
Re: [Request] Show user images in profile
« Reply #9 on: September 25, 2006, 03:29:31 AM »
i use this code

Code: [Select]
    ///////// Start Show member photos /////////////////
 $imagesperpage = 12;
   
     $sql = "SELECT COUNT(user_id) AS images
         FROM ".IMAGES_TABLE."
         WHERE user_id = ".$user_id;
  $result = $site_db->query_firstrow($sql);
  $num_images = $result['images'];
$site_db->free_result();
$num_rows_all = (isset($num_images)) ? $num_images : 0;
$link_arg = $site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=$user_id");
include(ROOT_PATH.'includes/paging.php');
$getpaging = new Paging($page, $imagesperpage, $num_rows_all, $link_arg);
$offset = $getpaging->get_offset();
$site_template->register_vars(array(
 "paging" => $getpaging->get_paging(),
 "paging_stats" => $getpaging->get_paging_stats()
));
   
   
  $sql = "SELECT i.image_id, i.cat_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name
          FROM ".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c
          WHERE i.image_active = 1 AND i.user_id = ".$user_row['user_id']." AND c.cat_id = i.cat_id AND i.cat_id IN (".get_auth_cat_sql("auth_viewcat").")
          ORDER BY i.image_date DESC
          LIMIT $offset, $imagesperpage";
  $result = $site_db->query($sql);
  $num_rows = $site_db->get_numrows($result);
  if (!$num_rows)  {
    $last_images = "<tr class=\"row1\"><td>";
    $last_images .= "Keine Bilder von diesem Benutzer vorhanden";
    $last_images .= "</td></tr>";
  }
  else  {
    $last_images = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">";
    $count = 0;
    $bgcounter = 0;
     $last_images = "";
    while ($image_row = $site_db->fetch_array($result)){
      if ($count == 0) {
        $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
        $last_images .= "<tr class=\"row1\">\n";
      }

$last_images .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";

      show_image($image_row);
      $last_images .= $site_template->parse_template("thumbnail_bit");
      $last_images .= "\n</td>\n";
      $count++;
      if ($count == $config['image_cells']) {
        $last_images .= "</tr>\n";
        $count = 0;
      }
    } // end while

    if ($count > 0)  {
      $leftover = ($config['image_cells'] - $count);
      if ($leftover >= 1) {
        for ($f = 0; $f < $leftover; $f++) {
          $last_images .= "<td width=\"".$imgtable_width."\">\n&nbsp;\n</td>\n";
        }
        $last_images .= "</tr>\n";
      }
    }
   // $last_images .= "</table>\n";
  } // end else

///////// End Show member photos /////////////////

not the best ;)

Offline ccsakuweb

  • Sr. Member
  • ****
  • Posts: 498
  • Patri
    • View Profile
    • My Art
Re: [Request] Show user images in profile
« Reply #10 on: September 26, 2006, 06:11:47 PM »
i add the code ("Show member photos") before ?>
and at the end from member_profile.html the next
Code: [Select]
            <table width="100%"  border="0" cellpadding="0">
              <tr>
                <td><p align="center">{last_images}</p>
                    <p align="center">{paging}</p></td>
              </tr>
            </table>

but.. the images doesn't show in profile.. where can i have to add the code from Lucifix or Dosensteck??? before ?> is rigth?
:arrow: 4images Paid Mods: Links, Blog, Albums, Subdomains for users, Diferent templates for user profile, Related picture in details, Last pictures in details.
And the mod that you request me.   Demo: http://www.myart.es

A website dedicated to artist people who loves drawing, design, writing and more

Offline keemo

  • Newbie
  • *
  • Posts: 30
    • View Profile
    • http://www.zaffix.com
Re: [Request] Show user images in profile
« Reply #11 on: October 13, 2006, 06:38:11 AM »
Is it possible that someone may be able to point out where exactly the code should added to the member.php? Also, any direction with where the paging code and sql line may go would be very helpful. Thanks a bunch.

Offline Vladec

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: [Request] Show user images in profile
« Reply #12 on: October 27, 2006, 03:54:59 AM »
Can anyone help, where in member.php i'm adding the code. i have the same problem: i've added the code, but there is no images on member profile page.

Offline Vladec

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: [Request] Show user images in profile
« Reply #13 on: November 04, 2006, 05:07:13 PM »
Hey there! to bad no one is talking about this mod, in my opinion it's a good mod to make your gallery more conviniet and atractiv.

my problem with the scripts above is: paging is working but the images are not. This is what i get:

Quote
DB Error: Bad SQL Query: SELECT i.image_id, i.cat_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, c.cat_name FROM 4images_images i, 4images_categories c WHERE i.image_active = 1 AND i.user_id = AND c.cat_id = i.cat_id AND i.cat_id IN (0, 13, 1, 2, 3, 4, 7, 8, 9, 10, 11, 14, 15, 6, 12, 5) ORDER BY i.image_date DESC LIMIT 0, 12
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND c.cat_id = i.cat_id AND i.cat_id IN (0, 13, 1, 2, 3, 4, 7, 8, 9, 10, 11, 14,' at line 3

I think we should do something about this mod. if i'll get it work, i deffently will post it!

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [Request] Show user images in profile
« Reply #14 on: November 05, 2006, 12:14:17 AM »
i did it so > http://crash.nicky.net/u1 but it's without paging because there is still > "Display all images added by Nicky"

i can give you codes but w.o. support

@Lucifix, nice coding.. but edit always your 1st post and explain where the codes should be added.
thx
Nicky
cheers
Nicky
Your first three "must do" before you ask a question ! (Đ by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi