Author Topic: [MOD] - Show upload images foreach uploader in member editprofile  (Read 30701 times)

0 Members and 1 Guest are viewing this topic.

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
This show link in editprofile user for all upload image of her / him.

// Step 1

In member.php file,

find:

Quote
if ($action == "editprofile") {
  $txt_clickstream = $lang['control_panel'];

add before:

Code: [Select]
//-----------------------------------------------------
//--- Show uploaded images from edit profile ----------
//-----------------------------------------------------
if ($action == "show_uploaded_images") {
       
$sql1 = "

SELECT i.image_id, i.image_name, i.image_thumb_file, i.image_media_file, i.cat_id" . get_user_table_field(", u.", "user_name") . "
FROM (" . IMAGES_TABLE . " i, " . CATEGORIES_TABLE . " c)
LEFT JOIN " . USERS_TABLE . " u ON (" . get_user_table_field("u.", "user_id") . " = i.user_id)
WHERE i.image_active = 1 AND i.cat_id = c.cat_id AND " . get_user_table_field("u.", "user_id") . " = i.user_id AND i.user_id = " . $user_info['user_id'] . " AND (i.cat_id NOT IN (".get_auth_cat_sql("auth_viewimage", "NOTIN").", ".get_auth_cat_sql("auth_viewcat", "NOTIN")."))
ORDER BY i.image_date DESC

";

$result = $site_db->query($sql1);
$num_rows = $site_db->get_numrows($result);

if (!$num_rows)  {
  $uploaded_images_from_edit_profile = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"><tr class=\"imagerow1\"><td>";
  $uploaded_images_from_edit_profile .= $lang['no_new_images'];
  $uploaded_images_from_edit_profile .= "</td></tr></table>";
}
else  {
  $uploaded_images_from_edit_profile = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">";
  $count = 0;
  $bgcounter = 0;
  while ($uploaded_images_from_edit_profile_row = $site_db->fetch_array($result)) {
      $user_name = format_text(trim(ucfirst($uploaded_images_from_edit_profile_row[$user_table_fields['user_name']]), 2));
     
    if ($count == 0) {
      $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
      $uploaded_images_from_edit_profile .= "<tr class=\"imagerow".$row_bg_number."\">\n";
    }
    $uploaded_images_from_edit_profile .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";

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

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


$site_template->register_vars("lang_uploaded_images_from_edit_profile", $lang['uploaded_images_from_edit_profile']);
$site_template->register_vars("uploaded_images_from_edit_profile", $uploaded_images_from_edit_profile);
$site_template->register_vars("lang_uploaded_images_go_back", $lang['uploaded_images_go_back']);
$content = $site_template->parse_template("member_editprofile");
$txt_clickstream = $lang['show_uploaded_images'];

unset($uploaded_images_from_edit_profile);
}

// Step 1.1

(same file) - find:

Quote
"lang_edit_profile_msg" => $edit_profile_msg,

add after:

Code: [Select]
"lang_show_uploaded_images" => $lang['show_uploaded_images'],

// Step 2

In lang/english/main.php file,

Add top of ?>:

Code: [Select]
$lang['show_uploaded_images'] = "Show uploaded images";
$lang['uploaded_images_from_edit_profile'] = "Uploaded images from you";
$lang['uploaded_images_go_back'] = "<span class=\"smalltext\">[ Go back ]</span>";

// Step 3

In templates/your_template/member_editprofile.html file ... well - I post in attach of post so integrate for way you want (and use IF and ENDIF tags I use in template file).

Finish.
« Last Edit: November 08, 2007, 09:36:18 PM by thunderstrike »
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: [MOD] - Show upload images foreach uploader in member editprofile
« Reply #1 on: November 08, 2007, 09:29:51 PM »
Hi Thunderstrike, :)

I just install it on a (fresh gallery), but nothing is showing (No images, no text).
See screenshot :roll:

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] - Show upload images foreach uploader in member editprofile
« Reply #2 on: November 08, 2007, 09:30:56 PM »
And ... you use member_editprofile.rar attach file for compare ?
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: [MOD] - Show upload images foreach uploader in member editprofile
« Reply #3 on: November 08, 2007, 09:32:44 PM »
Yes, I used your member_editprofile.

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] - Show upload images foreach uploader in member editprofile
« Reply #4 on: November 08, 2007, 09:34:42 PM »
I no see what miss ... all is there and I see all upload image from my user ID ...
[edit] - I add step 1.1 . Sorry. ;)
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: [MOD] - Show upload images foreach uploader in member editprofile
« Reply #5 on: November 08, 2007, 10:00:48 PM »
Hi Thunderstrike,

I had to add:     
"lang_show_uploaded_images" => $lang['show_uploaded_images'], in member.php to {show lang_show_uploaded_images}. Perfect :D

Actually I wanted something like other MOD. I mean the images are showing in member_editprofile.html without using the link.
Is it a lot of work?
I think if we can shows the images in member_profile.html ([MOD] - See other upload images by uploader from details page ),
it will be easy to show it in the member_editprofile.html. :roll:

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] - Show upload images foreach uploader in member editprofile
« Reply #6 on: November 08, 2007, 10:06:58 PM »
Quote
Is it a lot of work?

No but is more resource ...
Paging is need for add so no 100 image (or more) is load at same time ...
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: [MOD] - Show upload images foreach uploader in member editprofile
« Reply #7 on: November 08, 2007, 10:10:20 PM »
I do not need pages :). So maybe the version 1.0 without paging and when you have more time you code version 2.0 with paging :idea:

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] - Show upload images foreach uploader in member editprofile
« Reply #8 on: November 08, 2007, 10:10:56 PM »
Quote
So maybe the version 1.0 without paging

Sorry ... I no like this.
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: [MOD] - Show upload images foreach uploader in member editprofile
« Reply #9 on: November 08, 2007, 10:13:38 PM »
I understand you very well! If you do something, you do it good! Respect :wink:

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] - Show upload images foreach uploader in member editprofile
« Reply #10 on: November 08, 2007, 10:16:08 PM »
Thank for posting.
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: [MOD] - Show upload images foreach uploader in member editprofile
« Reply #11 on: November 08, 2007, 10:18:58 PM »
I forgot to thank you about this great mod :wink:

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: [MOD] - Show upload images foreach uploader in member editprofile
« Reply #12 on: November 09, 2007, 06:03:00 PM »
Hi thunderstrike,

I want to give some feedback:

I installed this mod in two galleries:
Fresh gallery: works perfect
Normal gallery (With mods): does not shows any images when you click on (show_uploaded_images).

What strange is that the other similar mod http://www.4homepages.de/forum/index.php?topic=15390.msg82566#msg82566][MOD]http://www.4homepages.de/forum/index.php?topic=15390.msg82566#msg82566 of Vladec (Almost the same code) works perfect on both galleries.

I will give you more feedback and I will test your Mod till you get it work. Just let me know what I have to change. :)

Cruxy

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] - Show upload images foreach uploader in member editprofile
« Reply #13 on: November 09, 2007, 06:31:18 PM »
Quote
Normal gallery (With mods): does not shows any images when you click on (show_uploaded_images)

And ... what is list of MOD ?
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: [MOD] - Show upload images foreach uploader in member editprofile
« Reply #14 on: November 10, 2007, 01:41:07 AM »
This is a list of the mods on my gallery, but before I have to say something.
I test the mod with a fresh MEMBER.PHP (Without mods) on my gallery with mods. The result: no images shows.

[Mod] Add a keyword list to the search form v.2            
[Mod] Display random images on homepage, if no new images            
[MOD] ACP Notice Field in Users Profile             
[MOD] Ban v1.7            
[Mod] More Like This link or button - search w/ all keywords            
[Mod] Add/Remove image to/from lightbox without page refresh            
[MOD] 4images searchform with keywords - like google suggest by using ajax            
[MOD] - Report a picture (configurable from ACP + over HTML template files)            
[Mod] Popup message when user clicks thumbnail where they have no permission            
[MOD] Tag cloud ( keyword & cat cloud in web2.0 style)            
[MOD] Last comments v1            
[MOD] All Comments (Alle Kommentare) V.1.3            
[Mod] Memberlist / Mitgliederliste > for/für v 1.7            
[MOD] guestbook            
[MOD] Sitemap v1.0            
[MOD] Simple News Publishing            
[Mod] Show user's comments from his profile            
[MOD] Information if Guest follows direct link to an image/category            
[MOD] eCard Counter / Postkartenzähler             
[MOD] Search between specifyed date            
[MOD] Small Calendar with nav, links and search            
[req] Birthday mod for users profile with gif image (like in smf profile)            
[Mod] Maintenance Page - Set from Admin Control panel            
[Mod] Mouseover/hover rateform             
[MOD] Show user images in profile            
[MOD] - MCP (Moderator Control Panel)            
[MOD] Keyword Tag Cloud (on custom page)            
[MOD] last images viewed            
[Mod] Different cat templates / Verschiedene Kategorie Templates            
[Mod] Let visitors to chose how to sort images(date,name,..)            
[MOD] Custom Page Members Access            
[MOD] Export Emails to csv            
[MOD] Custom Search Template            
[Mod] Randomizing {new_images}            
[MOD] Mini MOD: User GIS            
[MOD] Tag cloud ( keyword & cat cloud in web2.0 style)            
[MOD] Last comments v1