4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: tansamalaja on September 19, 2006, 05:46:45 PM

Title: Number of images of the user in profile
Post by: tansamalaja 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
Title: Re: Number of images of the user in profile
Post by: tansamalaja 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...
Title: Re: Number of images of the user in profile
Post by: Egly 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
Title: Re: Number of images of the user in profile
Post by: tansamalaja on October 25, 2006, 10:57:31 AM
Super! Funzt! Danke... :D
Title: Re: Number of images of the user in profile
Post by: Sun Zaza 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
Title: Re: Number of images of the user in profile
Post by: thunderstrike on November 11, 2007, 03:24:26 PM
Quote
profile.php

No file exist profile.php in 4images ...
Title: Re: Number of images of the user in profile
Post by: Sun Zaza on November 11, 2007, 03:26:33 PM
Quote
No file exist profile.php in 4images ...

Oh sorry. I mean member.php. :oops:
Title: Re: Number of images of the user in profile
Post by: thunderstrike 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} .
Title: Re: Number of images of the user in profile
Post by: Sun Zaza 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.

Title: Re: Number of images of the user in profile
Post by: thunderstrike on November 11, 2007, 05:46:12 PM
This is right - I fix post. ;)
Title: Re: Number of images of the user in profile
Post by: Sun Zaza on November 11, 2007, 06:34:55 PM
Works excatly the way I wanted. :D

Many thanks Thunderstrike
Title: Re: Number of images of the user in profile
Post by: Sunny C. 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
Title: Re: Number of images of the user in profile
Post by: Bommel 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
Title: Re: Number of images of the user in profile
Post by: Jan-Lukas 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
Title: Re: Number of images of the user in profile
Post by: Bommel 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
Title: Re: Number of images of the user in profile
Post by: Jan-Lukas on February 01, 2010, 09:27:24 PM
stimmt, hab es auch nur in der main.php

$lang['user_hobby'] = "Hobby";

und in der member_editprofile.html und in der member_profile.html stehen

in der member.php habe ich nichts drin stehen

LG Harald
Title: Re: Number of images of the user in profile
Post by: Bommel on February 01, 2010, 09:34:24 PM
Hallo Jan-Lukas,

das Problem hat sich mittlerweile geklärt. War ein Fehler beim abschließenden Semikolon in der main.php - der Punkt darüber wollte wohl eher zu "Pixar Studios".  :lol:

Jetzt läuft es. Danke für deine Hilfe.

Freundliche Grüße, Bommel
Title: Re: Number of images of the user in profile
Post by: surferboy on April 19, 2010, 04:13:56 AM
Hi -

Okay, I was totally lost. I understand this MOD and I have followed the steps but there is some code missing or some missing steps.

The mod is installed and it is working sort of ... it shows the total number of images in the user profile after inserting {uploaded_imgs} but the value just hangs therre without explanation. 

Here is the code I have posted in member_profile.html:

Quote
<tr>
          <td class="row2"><b>{lang_total_images}</b></td>
          <td class="row2">{uploaded_imgs}</td>
        </tr>

I guess I am slowly learning.  I knew from experience there was another step not mentioned in this MOD (well, it was inferred but not specifically stated):

open your lang/main.php file and add a lang definition:
this is what I added just above ?>

//--------------------------------------------------------
//--- Total Images Uploaded Member Profile Display--------
//--------------------------------------------------------
$lang['totupld_imgs'] = "Total Images I have uploaded:";

Then I knew I had to place some code somewhere that will pull the language code I added in the main.php file.  Again, this MOD doesn't tell you but it is inferred with the discussions between Jan and Bommel.

So I added this code in member.php file:  "lang_total_images" => $lang['totupld_imgs'],

I know, you're thinking... that's great dude but where? If I am learning, I deduced that it needed to go under one of these many

$site_template->register_vars(array(

sections and it should be in the main section that says  if ($action == "showprofile") {

although it is really hard to tell when that 'if action section' ends but I made a guess,

and finally, I just kind of looked around for a $site_template->register_vars(array( and found one and slid the "lang_total_images" phrase in among some other similar code. It worked. I can't tell you where to put yours because I have various MOD's added to the member.php that you don't but if that helps anybody else trying to figure this out, good!

- Brian
Title: Re: Number of images of the user in profile
Post by: Jan-Lukas on February 18, 2012, 10:58:53 PM
Da dass Thema gerade wieder aktuell ist, hier noch mal die Sprachdatei dazu
hoffe das in englisch ist OK  :oops:

in der lang/main.php suche nach
//-----------------------------------------------------
//--- Image Details -----------------------------------
//-----------------------------------------------------

füge da drunter z.B. folgendes ein
 :flag-de:
$lang['uploaded_imgs'] = "Anzahl der hochgeladenen Bilder:";
 :flag-en:
$lang['uploaded_imgs'] = "Number of high-loaded pictures:";

in der includes/page_header.php füge nach
"lang_sub_categories" => $lang['sub_categories'],

folgendes ein

"lang_uploaded_imgs" => $lang['uploaded_imgs'],

bei mir sieht es dann in der templates/dein Ordner/member_profile.html so aus

Code: [Select]
<tr>
          <td class="row2"><b>{lang_uploaded_imgs}</b></td>
          <td class="row2">{uploaded_imgs}</td>
        </tr>

LG