• [MOD] Download Counter User Images in Profile 5 0 5 1
Currently:  

Author Topic: [MOD] Download Counter User Images in Profile  (Read 18742 times)

0 Members and 1 Guest are viewing this topic.

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
[MOD] Download Counter User Images in Profile
« on: July 10, 2008, 07:24:01 PM »
- zunächst einmal nur in deutsch ...
- a englisch version is coming soon ... or later ...  ;) ... meanwhile use this  English-Google-Translation ...
     - but don't use the php-/html-code from this translation, use the php-/html-code from the original topic ...

Vorbemerkung :

... die Anfrage für diese Modifizierung stammt von Mr Kennedy und ist hier nachzulesen :  ...
... worum geht es konkret ... ?
... im User-Profil soll angezeigt werden, die Anzahl des Downloads von wievielen Bildern die der betreffende User hochgeladen hat ...
... das ist eine interessante statistische Auskunft, die ich so noch nicht hier im Forum für die 4images Galerie gefunden habe ...
... nach Installation dieser Modifizierung erscheint die folgende zusätzliche Zeile im User-Profil ... z.B. ...

Download von Bildern des Users:  gesamt 123 Downloads von 43 Bildern

... oder auch im Singular ...

Download von Bildern des Users:  gesamt 1 Download von 1 Bild

... oder auch die Kombination, wenn gegeben, aus beiden ...
... folgende Änderungen wären dazu durchzuführen ...

Installation :

1. Schritt
Öffne die Datei member.php und finde im Abschnitt //--- Show Profile ---- :
Code: [Select]
    else {
      $user_email = REPLACE_EMPTY;
      $user_email_save = REPLACE_EMPTY;
      $user_mailform_link = REPLACE_EMPTY;
      $user_email_button = REPLACE_EMPTY;
    }

und füge danach folgende Codezeilen ein
Code: [Select]
//--- Ab hier zusätzliche Infos im Benutzerprofil -----------------------------------------
//--- Download von Bildern des Users im Profil , von mawenzi , 10.07.2008 -----------------
    $sql = "SELECT SUM(image_downloads) AS sum_downloads
            FROM ".IMAGES_TABLE."
            WHERE ".get_user_table_field("", "user_id")." = ".$user_id."";
    $row = $site_db->query_firstrow($sql);
    $sum_downloads = (isset($row['sum_downloads'])) ? $row['sum_downloads'] : 0;
    $sql = "SELECT COUNT(*) AS count_downloads
            FROM ".IMAGES_TABLE."
            WHERE ".get_user_table_field("", "user_id")." = ".$user_id."
            AND image_downloads > 0";
    $row = $site_db->query_firstrow($sql);
    $count_downloads = (isset($row['count_downloads'])) ? $row['count_downloads'] : 0;
    $lang['lang_downloads'] = "Download von Bildern des Users:";
    $lang['lang_downloads_1'] = "gesamt";
    if ($sum_downloads == 1) {
        $lang['lang_downloads_2'] = "Download von";
    } else {
        $lang['lang_downloads_2'] = "Downloads von";
    }
    if ($count_downloads == 1) {
        $lang['lang_downloads_3'] = "Bild";
    } else {
        $lang['lang_downloads_3'] = "Bildern";
    }
    $site_template->register_vars(array(
      "lang_downloads" => $lang['lang_downloads'],
      "sum_downloads" => $lang['lang_downloads_1']." ".$sum_downloads." ".$lang['lang_downloads_2']." ".$count_downloads." ".$lang['lang_downloads_3'],
     ));
//--- Download von Bildern des Users im Profil , von mawenzi , 10.07.2008 -----------------

2.Schritt
Öffne die Datei templates/<dein_template>/member_profile.html und finde :
Code: [Select]
<tr>
          <td class="row1"><b>{lang_comments}</b></td>
          <td class="row1">{user_comments}</td>
</tr>

und füge danach folgende Codezeilen ein :
Code: [Select]
<tr>
          <td class="row2" ><b>{lang_downloads}</b></td>
          <td class="row2">{sum_downloads}</td>
</tr>

Die Template-Anpassung ist natürlich deine Sache, wobei ich noch auf die class="row2" hinweisen möchte, die entsprechend deinem Template und der Stelle, an der du die Profilerweiterung in die Tabelle einfügst, auch z.B. class="row1" oder noch anders benannt werden muss.

Den MOD in Aktion findet ihr u.a. auch auf meiner Seite ...   :wink:

mawenzi
« Last Edit: July 10, 2008, 08:38:37 PM by mawenzi »
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 ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline Mr Kennedy

  • Jr. Member
  • **
  • Posts: 81
    • View Profile
Re: [MOD] Download Counter User Images in Profile
« Reply #1 on: July 10, 2008, 08:15:39 PM »
klasse, vielen dank  :)

edit: noch besser wäre er wenn das nur angezeigt wird wenns da auch was zum anzeigen gibt außer 0 Downloads von 0 Bildern  :mrgreen:

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] Download Counter User Images in Profile
« Reply #2 on: July 10, 2008, 08:16:47 PM »
@ivan
... zunächst ... danke ...  8)
... auf den Hinweis mit den Sprachtags habe ich schon gewartet ...  :mrgreen:
... aber ich denke ... User, die eine Sprachauswahl anbieten (wie du), die wissen auch wie die {lang_tags} zu setzen sind ...
... etwas knifflig wird es sicher mit der Singular- / Plural-Sprachausgabe ...
... aber man kann das ja auch, wie sonst in 4images üblich, mit Klammern lösen ... z.B. ... Download(s) ... Bild(ern) ... ;)

@MrKennedy
... bitte ...  8)
... edit ... auch das geht natürlich ... aber 0 von 0 ist ja auch eine statistische Aussage ...
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 ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline Mr Kennedy

  • Jr. Member
  • **
  • Posts: 81
    • View Profile
Re: [MOD] Download Counter User Images in Profile
« Reply #3 on: July 10, 2008, 08:26:04 PM »
Passt schon so ;)
Intressant wäre vllt noch dass da auch iwie die ganze Bildanzahl angezeigt wird

Download von Bildern des Users:    gesamt 18008 Downloads von 1922 Bildern

und dnan vllt iwie
Download von Bildern des Users:    gesamt 18008 Downloads von 1922 (gesamtanzahl) Bildern

Wenn das vllt iwie machtbar wäre  :wink:

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] Download Counter User Images in Profile
« Reply #4 on: July 10, 2008, 08:33:37 PM »
@Mr Kennedy
... die Gesamtanzahl der vom User hochgeladenen Bilder für das User-Profil gibt es hier im Forum schon ...
... und auch weitere Ergänzungen für das User-Profile ...
... habe den Link aber jetzt nicht parat ... also mal ein bischen suchen ...
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 ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline sanko86

  • Sr. Member
  • ****
  • Posts: 310
    • View Profile
    • Elemegim
Re: [MOD] Download Counter User Images in Profile
« Reply #5 on: February 03, 2009, 08:05:09 PM »
thank you

best mod

ý am use
Web site:http://www.anlatiyoruz.com
Hayat zorluklarla doludur.Ama en zoru insanýn insana düþmanlýðýdýr.

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] Download Counter User Images in Profile
« Reply #6 on: February 03, 2009, 10:22:53 PM »
... thanks softbal10 for your statement ... ;)
 
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 ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline sanko86

  • Sr. Member
  • ****
  • Posts: 310
    • View Profile
    • Elemegim
Re: [MOD] Download Counter User Images in Profile
« Reply #7 on: February 03, 2009, 10:31:13 PM »
ı am sorry

my little english language

but ı understand;)

ı live in turkey.

4images fan:)
Web site:http://www.anlatiyoruz.com
Hayat zorluklarla doludur.Ama en zoru insanýn insana düþmanlýðýdýr.

Offline Pearl

  • Pre-Newbie
  • Posts: 8
    • View Profile
    • Artnskins
Re: [MOD] Download Counter User Images in Profile
« Reply #8 on: February 04, 2009, 08:59:48 PM »
Can someone translate this in english pls?
Download von Bildern des Users:gesamt 0 Downloads von 0 Bildern

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] Download Counter User Images in Profile
« Reply #9 on: February 04, 2009, 10:09:09 PM »
Can someone translate this in english pls?
Download von Bildern des Users:gesamt 0 Downloads von 0 Bildern

... ok ... it is possible to misunderstand ... so, we are on the user-profile-site to read that after this modification ...
... and here is a short translation ...

image downloads of 'images by this user' : total 0 image downloads of total 0 'images from this user'

... that means ...
... downloads 'from all users' of images by 'this user from this profile' ...
... : ...
... there are no downloads 'from all users' of images by 'this user from this profile' ...
... and ...
... there are no images from 'this user from this profile' in your gallery ...

... please note each of the apostrophes ...
... maybe there is a better and shorter translation in english ... :oops:
« Last Edit: February 04, 2009, 10:40:49 PM by mawenzi »
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 ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline Pearl

  • Pre-Newbie
  • Posts: 8
    • View Profile
    • Artnskins
Re: [MOD] Download Counter User Images in Profile
« Reply #10 on: February 05, 2009, 01:31:39 AM »
First of all thank you so much...is there a copy of this in english?



//--- Ab hier zusätzliche Infos im Benutzerprofil -----------------------------------------
//--- Download von Bildern des Users im Profil , von mawenzi , 10.07.2008 -----------------
    $sql = "SELECT SUM(image_downloads) AS sum_downloads
            FROM ".IMAGES_TABLE."
            WHERE ".get_user_table_field("", "user_id")." = ".$user_id."";
    $row = $site_db->query_firstrow($sql);
    $sum_downloads = (isset($row['sum_downloads'])) ? $row['sum_downloads'] : 0;
    $sql = "SELECT COUNT(*) AS count_downloads
            FROM ".IMAGES_TABLE."
            WHERE ".get_user_table_field("", "user_id")." = ".$user_id."
            AND image_downloads > 0";
    $row = $site_db->query_firstrow($sql);
    $count_downloads = (isset($row['count_downloads'])) ? $row['count_downloads'] : 0;
    $lang['lang_downloads'] = "Download von Bildern des Users:";
    $lang['lang_downloads_1'] = "gesamt";
    if ($sum_downloads == 1) {
        $lang['lang_downloads_2'] = "Download von";
    } else {
        $lang['lang_downloads_2'] = "Downloads von";
    }
    if ($count_downloads == 1) {
        $lang['lang_downloads_3'] = "Bild";
    } else {
        $lang['lang_downloads_3'] = "Bildern";
    }
    $site_template->register_vars(array(
      "lang_downloads" => $lang['lang_downloads'],
      "sum_downloads" => $lang['lang_downloads_1']." ".$sum_downloads." ".$lang['lang_downloads_2']." ".$count_downloads." ".$lang['lang_downloads_3'],
     ));
//--- Download von Bildern des Users im Profil , von mawenzi , 10.07.2008 -----------------

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] Download Counter User Images in Profile
« Reply #11 on: February 05, 2009, 01:42:29 AM »
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 ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline paule

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
Re: [MOD] Download Counter User Images in Profile
« Reply #12 on: April 08, 2009, 08:35:04 PM »
Hallo,

ich habe alles geändert und bekomme aber leider folgende Fehlermeldung:
Parse error: syntax error, unexpected T_STRING in /var/www/member.php on line 939 (siehe Anhang)

Was tun?

Gruß paule