4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: thunderstrike on November 08, 2007, 08:55:22 PM

Title: [MOD] - Show upload images foreach uploader in member editprofile
Post by: thunderstrike on November 08, 2007, 08:55:22 PM
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.
Title: Re: [MOD] - Show upload images foreach uploader in member editprofile
Post by: Sun Zaza 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:
Title: Re: [MOD] - Show upload images foreach uploader in member editprofile
Post by: thunderstrike on November 08, 2007, 09:30:56 PM
And ... you use member_editprofile.rar attach file for compare ?
Title: Re: [MOD] - Show upload images foreach uploader in member editprofile
Post by: Sun Zaza on November 08, 2007, 09:32:44 PM
Yes, I used your member_editprofile.
Title: Re: [MOD] - Show upload images foreach uploader in member editprofile
Post by: thunderstrike 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. ;)
Title: Re: [MOD] - Show upload images foreach uploader in member editprofile
Post by: Sun Zaza 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:
Title: Re: [MOD] - Show upload images foreach uploader in member editprofile
Post by: thunderstrike 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 ...
Title: Re: [MOD] - Show upload images foreach uploader in member editprofile
Post by: Sun Zaza 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:
Title: Re: [MOD] - Show upload images foreach uploader in member editprofile
Post by: thunderstrike on November 08, 2007, 10:10:56 PM
Quote
So maybe the version 1.0 without paging

Sorry ... I no like this.
Title: Re: [MOD] - Show upload images foreach uploader in member editprofile
Post by: Sun Zaza on November 08, 2007, 10:13:38 PM
I understand you very well! If you do something, you do it good! Respect :wink:
Title: Re: [MOD] - Show upload images foreach uploader in member editprofile
Post by: thunderstrike on November 08, 2007, 10:16:08 PM
Thank for posting.
Title: Re: [MOD] - Show upload images foreach uploader in member editprofile
Post by: Sun Zaza on November 08, 2007, 10:18:58 PM
I forgot to thank you about this great mod :wink:
Title: Re: [MOD] - Show upload images foreach uploader in member editprofile
Post by: Sun Zaza 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 (http://[MOD) 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
Title: Re: [MOD] - Show upload images foreach uploader in member editprofile
Post by: thunderstrike 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 ?
Title: Re: [MOD] - Show upload images foreach uploader in member editprofile
Post by: Sun Zaza 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   
      
Title: Re: [MOD] - Show upload images foreach uploader in member editprofile
Post by: thunderstrike on November 10, 2007, 01:43:52 AM
In the list - no MOD I code and you ask why is no work with my code if no fresh gallery :?:  8O
Title: Re: [MOD] - Show upload images foreach uploader in member editprofile
Post by: Sun Zaza on November 10, 2007, 01:50:01 AM
I said to you before that the MOD works fine on the fresh gallery, but not on the gallery with other mods.

Do you make Mods only for fresh galleries? I think that any mod should be working also on the galleries with mods. Am I wrong? :|
Title: Re: [MOD] - Show upload images foreach uploader in member editprofile
Post by: thunderstrike on November 10, 2007, 01:55:15 AM
Quote
Am I wrong?

Yes. Is say on forum each post MOD is user responsible. Is why, I no integrate my MOD with other author.
Title: Re: [MOD] - Show upload images foreach uploader in member editprofile
Post by: Sun Zaza on November 10, 2007, 02:00:10 AM
Oke then. I understand. I will try to solve it myself. If does not work, I will find another solution (mod) to realise my idea.

I will let you know if I find the reason why the mod does not want to work on my gallery. :)
Title: Re: [MOD] - Show upload images foreach uploader in member editprofile
Post by: thunderstrike on November 10, 2007, 02:03:06 AM
No problem - please post result in chit / chat after find.

One help I post for you - the list MOD you use - many include no return value with function. Is direct code in target PHP file and two diff MOD can use same file in same / diff action. This is problem.
Title: Re: [MOD] - Show upload images foreach uploader in member editprofile
Post by: Art By Vicky on November 12, 2007, 12:33:09 AM
Thunderstrike, I'm unable to do step 3 as my computer doesn't recognize .rar files.  Can you either zip or txt the file so I can view it?

Thanks!
Title: Re: [MOD] - Show upload images foreach uploader in member editprofile
Post by: thunderstrike on November 12, 2007, 12:40:07 AM
Quote
Thunderstrike, I'm unable to do step 3 as my computer doesn't recognize .rar files.  Can you either zip or txt the file so I can view it?

If download WinRAR from RARSoft site - http://www.rarsoft.com - is possible for recognize RAR file. ;)
Title: Re: [MOD] - Show upload images foreach uploader in member editprofile
Post by: Art By Vicky on November 12, 2007, 01:24:10 AM
Sorry, don't want to download another program just for this mod.  If I wanted to do that, I could have downloaded WinZip.  I guess I just won't use this mod then...

Thank you anyway.
Title: Re: [MOD] - Show upload images foreach uploader in member editprofile
Post by: Sun Zaza on November 12, 2007, 09:38:39 AM
Quote
Incorrect. Winzip is no read RAR - is read ZIP. If no want for use RAR, please no use this MOD - is too much for you.

Hey guys, what happening now. We come on this forum because we love 4images. So please do not spoil that.
4images is a professional gallery. So please keep it that way.

@Art By Vicky
WinRAR is a basis program for any pc. Thunderstrike is not trying to sell something to you :|

Anyway, here is the member_editprofile.html of the RAR file:

Code: [Select]
{ifno uploaded_images_from_edit_profile}
{lang_edit_profile_msg}<br />
<form method="post" action="{url_member}">
  <table width="100%" border="0" cellspacing="0" cellpadding="1">
    <tr>
      <td valign="top" class="head1">
        <table width="100%" border="0" cellpadding="4" cellspacing="0">
          <tr>
            <td colspan="2" width="50%" align="left" valign="top" class="head1">{lang_profile_of} {user_name}</td>
    <td colspan="2" width="50%" align="right" valign="top" class="row1"><a href="{url_member}?action=show_uploaded_images">{lang_show_uploaded_images}</a></td>
          </tr>
</table>
<table width="100%" border="0" cellpadding="4" cellspacing="0">
          <tr>
            <td width="100%" valign="top" class="row2">&nbsp;</td>    
          </tr>
</table>
<table width="100%" border="0" cellpadding="4" cellspacing="0">
  <tr>
            <td class="row1"><b>{lang_user_firstname}</b></td>
            <td class="row1"><input type="text" name="user_firstname"  size="30" value="{user_firstname}" class="input" /></td>
          </tr>
  <tr>
            <td class="row1"><b>{lang_user_lastname}</b></td>
            <td class="row1"><input type="text" name="user_lastname"  size="30" value="{user_lastname}" class="input" /></td>
          </tr>
          <tr>
            <td class="row1"><b>{lang_email}</b></td>
            <td class="row1"><input type="text" name="user_email"  size="30" value="{user_email}" class="input" /></td>
          </tr>
          <tr>
            <td class="row2"><b>{lang_email_confirm}</b></td>
            <td class="row2"><input type="text" name="user_email2"  size="30" value="{user_email2}" class="input" /></td>
          </tr>
          <tr>
            <td class="row1"><b>{lang_show_email}</b></td>
            <td class="row1">
              <input type="radio" name="user_showemail" value="1"{user_showemail_yes} />
              {lang_yes}&nbsp;&nbsp;&nbsp;
              <input type="radio" name="user_showemail" value="0"{user_showemail_no} />
              {lang_no}</td>
          </tr>
  <tr>
            <td class="row2"><b>{lang_allow_emails}</b></td>
            <td class="row2">
              <input type="radio" name="user_allowemails" value="1"{user_allowemails_yes} />
              {lang_yes}&nbsp;&nbsp;&nbsp;
              <input type="radio" name="user_allowemails" value="0"{user_allowemails_no} />
              {lang_no}
</td>
          </tr>
          <tr>
            <td class="row1"><b>{lang_invisible}</b></td>
            <td class="row1">
              <input type="radio" name="user_invisible" value="1"{user_invisible_yes} />
              {lang_yes}&nbsp;&nbsp;&nbsp;
              <input type="radio" name="user_invisible" value="0"{user_invisible_no} />
              {lang_no}
</td>
          </tr>
          <tr>
            <td colspan="2" class="head1">{lang_optional_infos}</td>
          </tr>
          <tr>
            <td class="row1"><b>{lang_homepage}</b></td>
            <td class="row1"><input type="text" name="user_homepage"  size="30" value="{user_homepage}" class="input" /></td>
          </tr>
          <tr>
            <td class="row2"><b>{lang_icq}</b></td>
            <td class="row2"><input type="text" name="user_icq"  size="30" value="{user_icq}" class="input" /></td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
  <input type="hidden" name="action" value="updateprofile" />
  <p align="center">
    <input type="submit" value="{lang_save}" class="button" />
    <input type="reset" value="{lang_reset}" class="button" />
  </p>
</form>
<br />
<form method="post" action="{url_member}">
  <table width="100%" border="0" cellspacing="0" cellpadding="1">
    <tr>
      <td valign="top" class="head1">
        <table width="100%" border="0" cellpadding="4" cellspacing="0">
          <tr>
            <td colspan="2" valign="top" class="head1">{lang_change_password}</td>
          </tr>
          <tr>
            <td class="row1"><b>{lang_old_password}</b></td>
            <td class="row1"><input type="password" name="current_user_password" size="30" class="input" /></td>
          </tr>
          <tr>
            <td class="row2"><b>{lang_new_password}</b></td>
            <td class="row2"><input type="password" name="user_password" size="30" class="input" /></td>
          </tr>
          <tr>
            <td class="row1"><b>{lang_new_password_confirm}</b></td>
            <td class="row1"><input type="password" name="user_password2" size="30" class="input" /></td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
  <input type="hidden" name="action" value="updatepassword" />
  <p align="center">
    <input type="submit" value="{lang_change_password}" class="button" />
    <input type="reset" value="{lang_reset}" class="button" />
  </p>
</form>
{endifno uploaded_images_from_edit_profile}

{if uploaded_images_from_edit_profile}
<table width="450" border="0" cellspacing="0" cellpadding="0">
  <tr>
  <td class="row2">     
    <table width="100%" border="0" cellspacing="0" cellpadding="4">
    <tr>
    <td class="head1" valign="top">{lang_uploaded_images_from_edit_profile}</td>
    </tr>
    </table>
    <table width="100%" border="0" cellspacing="0" cellpadding="4">
    <tr>
    <td class="row2" align="left" valign="top"><a href="{url_member}?action=editprofile" class="link" />{lang_uploaded_images_go_back}</a></td>
    </tr>
    </table>
  </td>
  </tr>
  <tr>
  <td class="head1">{uploaded_images_from_edit_profile}</td>
  </tr>
</table>
<br />
{endif uploaded_images_from_edit_profile}

Love, make no war :wink:
Title: Re: [MOD] - Show upload images foreach uploader in member editprofile
Post by: thunderstrike on November 12, 2007, 01:24:04 PM
Why I post in file is for addon in someday. Limit space in post. ;)
Title: Re: [MOD] - Show upload images foreach uploader in member editprofile
Post by: Art By Vicky on November 13, 2007, 05:56:43 AM
I wasn't being nasty in my post.  I was just stating a fact.  I meant no disrespect or anything negative.  Thunderstrike has been very helpful and provides wonderful information and mods, so nothing negative was meant by my post.  Thunderstrike, please accept my apologies if that is how you interpreted my post.
Title: Re: [MOD] - Show upload images foreach uploader in member editprofile
Post by: Warz on April 12, 2008, 07:40:04 PM
Hi,

I installed this MOD today, it works if user has few images, but if user has many images it doesn't load and my server resource (CPU) goes red. I believe this is because it's trying to load all the images at once, and in one page? Is there any way to limit the amount of images displayed to for example 10-20?

Any help would be highly appreciated. Thank You  :)
Title: Re: [MOD] - Show upload images foreach uploader in member editprofile
Post by: Pearl on April 16, 2008, 05:30:25 AM
That would be nice to see next page images instead all images on one page..any help is apprecated!

Thanks!
Title: Re: [MOD] - Show upload images foreach uploader in member editprofile
Post by: mawenzi on April 16, 2008, 09:27:31 AM
@Pearl
... here ...
... http://www.4homepages.de/forum/index.php?topic=21162.0 ...
... thanks to Warz and asd.m ...
Title: Re: [MOD] - Show upload images foreach uploader in member editprofile
Post by: Pearl on April 17, 2008, 04:44:01 AM
Thanks mawenzi !

Sorry for the late respond, I'm still learning  my way around! :D
Title: Re: [MOD] - Show upload images foreach uploader in member editprofile
Post by: mstgokcen on March 14, 2009, 12:12:55 PM
Tnx for the mod.

How can i put the button(link) "Show uploaded images" to the user_logininfo.html (near the "logout" / "control panel")

The place of the button is no good for me