Author Topic: Number of images of the user in profile  (Read 26203 times)

0 Members and 1 Guest are viewing this topic.

Offline tansamalaja

  • Full Member
  • ***
  • Posts: 185
    • View Profile
Number of images of the user in profile
« on: September 19, 2006, 05:46:45 PM »
I want to display the number of all images by the user in the profile.

I get the number if I click on "Display all images added by XYZ" and
I want to have these number always in the profile.

If the Admins deleting some pictures of the user the number must
getting lower, with this MOD ist doesn't work...
http://www.4homepages.de/forum/index.php?topic=11993.0
« Last Edit: October 24, 2006, 02:47:53 PM by tansamalaja »

Offline tansamalaja

  • Full Member
  • ***
  • Posts: 185
    • View Profile
Re: Number of images of the user in profile
« Reply #1 on: October 24, 2006, 02:48:22 PM »
Can anybody help me?

Ich möchte gerne die Anzahl der Bilder des Users ins einem Profil anzeigen lassen.
Wenn ich auf "Alle Bilder von XYZ anzeigen" klicke, dann bekomme ich die Anzahl
ja, möchte sie aber in der Profilansicht stehen haben...

Offline Egly

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Re: Number of images of the user in profile
« Reply #2 on: October 24, 2006, 11:19:56 PM »
Hi!

öffne member.php und finde:

Code: [Select]
else {
      $user_email = REPLACE_EMPTY;
      $user_email_save = REPLACE_EMPTY;
      $user_mailform_link = REPLACE_EMPTY;
      $user_email_button = REPLACE_EMPTY;
    }
    $site_template->register_vars(array(
      "user_id" => $user_row['user_id'],

ersetze es durch:

Code: [Select]
else {
      $user_email = REPLACE_EMPTY;
      $user_email_save = REPLACE_EMPTY;
      $user_mailform_link = REPLACE_EMPTY;
      $user_email_button = REPLACE_EMPTY;
    }

$sql = "SELECT COUNT(image_id) AS totimg
         FROM ".IMAGES_TABLE."
         WHERE  user_id = $user_id";
  $result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$uploaded_images = $row['totimg'];

    $site_template->register_vars(array(
  "uploaded_imgs" => $uploaded_images,
      "user_id" => $user_row['user_id'],

danach füge in der Datei /templates/*deintemplate*/member_profile.html folgendes ein, wo du die Anzahl der Bilder angezeigt haben willst:

Code: [Select]
{uploaded_imgs}
Ich hoffe es funktioniert, bei mir hats das getan...

Gruß Bastian

Offline tansamalaja

  • Full Member
  • ***
  • Posts: 185
    • View Profile
Re: Number of images of the user in profile
« Reply #3 on: October 25, 2006, 10:57:31 AM »
Super! Funzt! Danke... :D

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: Number of images of the user in profile
« Reply #4 on: November 11, 2007, 02:37:29 PM »
Hi guys,

How can I use this MOD in member_editprofile.html instead of in member_profile.html?

I tried to copy this code to the (edit_profile) section on profile.php, but it does not work. :?

Many thanks in advance,
Cruxy

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Number of images of the user in profile
« Reply #5 on: November 11, 2007, 03:24:26 PM »
Quote
profile.php

No file exist profile.php in 4images ...
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: Number of images of the user in profile
« Reply #6 on: November 11, 2007, 03:26:33 PM »
Quote
No file exist profile.php in 4images ...

Oh sorry. I mean member.php. :oops:

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Number of images of the user in profile
« Reply #7 on: November 11, 2007, 03:44:45 PM »
In member.php file,

find:

Quote
if ($config['account_activation'] == 2 && $user_info['user_level'] != ADMIN) {
    $edit_profile_msg .= $lang['edit_profile_email_msg_admin'];
}

Add after:

Code: [Select]
$sql = "

SELECT COUNT(image_id) AS total_upload_images
FROM " . IMAGES_TABLE . "
WHERE user_id = " . $user_info['user_id'];

$row = $site_db->query_firstrow($sql);
$total_upload_images = (isset($row['total_upload_images'])) ? (int)$row['total_upload_images'] : 0;

find:

Quote
"user_invisible_no" => $user_invisible_no,

add after:

Code: [Select]
"total_upload_images" => (isset($total_upload_images) && !empty($total_upload_images)) ? $total_upload_images : "",

In member_editprofile.html file, use: {if total_upload_images}{total_upload_images}{endif total_upload_images} .
« Last Edit: November 11, 2007, 05:45:53 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: Number of images of the user in profile
« Reply #8 on: November 11, 2007, 05:41:38 PM »
Quote
In member_profile.html file, use: {if total_upload_images}{total_upload_images}{endif total_upload_images}

Do you mean member_editprofile.html? because that was my request.


Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Number of images of the user in profile
« Reply #9 on: November 11, 2007, 05:46:12 PM »
This is right - I fix post. ;)
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: Number of images of the user in profile
« Reply #10 on: November 11, 2007, 06:34:55 PM »
Works excatly the way I wanted. :D

Many thanks Thunderstrike

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.805
  • I ♥ 4I
    • View Profile
Re: Number of images of the user in profile
« Reply #11 on: August 19, 2009, 03:34:42 PM »
Hi!

öffne member.php und finde:

Code: [Select]
else {
      $user_email = REPLACE_EMPTY;
      $user_email_save = REPLACE_EMPTY;
      $user_mailform_link = REPLACE_EMPTY;
      $user_email_button = REPLACE_EMPTY;
    }
    $site_template->register_vars(array(
      "user_id" => $user_row['user_id'],

ersetze es durch:

Code: [Select]
else {
      $user_email = REPLACE_EMPTY;
      $user_email_save = REPLACE_EMPTY;
      $user_mailform_link = REPLACE_EMPTY;
      $user_email_button = REPLACE_EMPTY;
    }

$sql = "SELECT COUNT(image_id) AS totimg
         FROM ".IMAGES_TABLE."
         WHERE  user_id = $user_id";
  $result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$uploaded_images = $row['totimg'];

    $site_template->register_vars(array(
  "uploaded_imgs" => $uploaded_images,
      "user_id" => $user_row['user_id'],

danach füge in der Datei /templates/*deintemplate*/member_profile.html folgendes ein, wo du die Anzahl der Bilder angezeigt haben willst:

Code: [Select]
{uploaded_imgs}
Ich hoffe es funktioniert, bei mir hats das getan...

Gruß Bastian

Added to my List!
Thanks!
http://www.4homepages.de/forum/index.php?topic=24888.0

Offline Bommel

  • Full Member
  • ***
  • Posts: 114
    • View Profile
Re: Number of images of the user in profile
« Reply #12 on: February 01, 2010, 08:05:15 PM »
Hallo allerseits,

vielen Dank für diese MOD. :thumbup:

Hierzu aber noch eine Frage - wie definiere ich {lang_uploaded_imgs}? Eintrag in der main.php ist mir bekannt:

$lang['uploaded_imgs'] = "Anzahl der hochgeladenen Dateien:";

doch was muss noch gemacht werden, dass mir mit {lang_uploaded_imgs} auch der Wert angezeigt wird?

Freundliche Grüße, Bommel
Freundliche Grüße, Bommel

Nicht die Geduld mit mir verlieren, ich bin noch am Lernen./ Do not lose the patience with me, I am still in the learning. ;)

Offline Jan-Lukas

  • Addicted member
  • ******
  • Posts: 1.289
    • View Profile
    • Discover the New World of Kindersurprise
Re: Number of images of the user in profile
« Reply #13 on: February 01, 2010, 08:29:56 PM »
wie immer in der page_header.php  :wink:

hier drunter, ob nun eine bestimmte Stelle ??

// Replace Globals in $lang
$lang $site_template->parse_array($lang);

$site_template->register_vars(array(


LG Harald
Danke Harald




Offline Bommel

  • Full Member
  • ***
  • Posts: 114
    • View Profile
Re: Number of images of the user in profile
« Reply #14 on: February 01, 2010, 09:04:31 PM »
Hallo Jan-Lukas,

danke für die Antwort. :)

Ich ging eigentlich davon aus, dass ich dies in der member.php eintragen muss, da dieser Wert nur im Benutzerprofil angezeigt werden soll. Und zwar unmittelbar nach:

      "lang_rank" => $lang['rank'],

doch irgendwie funktioniert es nicht.

Freundliche Grüße, Bommel

Nachtrag:

OK... habe jetzt noch mal meine Änderung nachvollzogen. Schlichter Flüchtigkeitsfehler in der main.php - habe statt dem abschließenden Semikolon ein Komma gesetzt. Jetzt funktioniert es, wie es soll. :D
« Last Edit: February 01, 2010, 09:28:58 PM by Bommel »
Freundliche Grüße, Bommel

Nicht die Geduld mit mir verlieren, ich bin noch am Lernen./ Do not lose the patience with me, I am still in the learning. ;)