4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: rinaldos on October 16, 2008, 01:59:06 AM

Title: [MOD] Top 100
Post by: rinaldos on October 16, 2008, 01:59:06 AM
Code Update 12.11.2008 thanks to Nicky
http://www.4homepages.de/forum/index.php?topic=23055.msg127636#msg127636
---
Code Update 18.04.2009
In der Sektion Settings der TOP100.php können die Spalten aktiviert / deaktiviert werden. Die Thumbnailgrösse ist nun individuell einstellbar.
 
 Folgende Möglichkeiten sind nun gegeben.

  THUMBNAILGRÖSSE:
  $thumb_size = 48;

  Spalten die nun aktiviert bzw. deaktiviert werden können. 0 = deaktiviert 1 = aktiviert
  $top_100_pos_activate = "1"; // Picture Position
  $top_100_picture_activate = "1"; // Thumbnail
  $top_100_picture_id_activate = "0"; // Picture ID
  $top_100_picture_user_name_activate = "0"; // USER NAME
  $top_100_picture_user_name_below_activate = "0"; // Username below Thumbnail
  $top_100_picture_name_activate = "1"; // Picture Name
  $top_100_picture_cat_activate = "1";  // Cat Name
  $top_100_picture_date_activate = "1"; // Picture Date (Upload Date)
  $top_100_picture_hits_activate = "1";  // Picture Hits
  $top_100_picture_votes_activate = "1"; // Picture Votes
  $top_100_picture_rating_activate = "1";  // Picture ratings
  $top_100_picture_downloads_activate = "1";  // Picture downloads
  $top_100_picture_comment_activate = "1";  // Picture Comments
  $top_100_picture_last_view_activate = "1";  // Picture last view
  $top_100_picture_last_view_who_activate = "1";  // Picture seen by
---
Code Update 29.04.2009
Fixed a small error. New PHP file added. top100.php.1.3.1.zip
download and Overwrite the original top100.php
---

Dieser MOD ist dafür ausgelegt, eine dynamische Top 100 zu generieren.
Er zeigt folgende Daten an.

- top 100 Bilder mit den meisten HITS
- top 100 Bilder mit den meisten Stimmen
- top 100 Bilder mit den Bewertungen
- top 100 Bilder mit den meisten Kommentaren
- wer hat zuletzt welches Bild gesehen. Zwar kein Top 100 aber ich mag es

Weiterhin zeigt er auch nur Bilder an, die dem Kriterium entsprechen-
Habe ich nur 12 Bilder mit Bewertungen, dann zeigt er auch nur die zwölf Bilder an.
Bei der installation legt der installer das Datum des letzten views auf das Bilddatum.
Beachtet bitte das ich kein PHP Programmierer bin.

erstellt für die Version 1.7.6

Demo:
http://4images.rinaldos.homeip.net/top100.php?action=hits

Addon with highslide
http://rinaldos.homeip.net/top100.php?action=hits
benötigt dieses Addon
http://www.4homepages.de/forum/index.php?topic=20461.0

in der top100.php findet Ihr schon die passenden Einträge, müssen nur auskommentiert werden.

:flag-en:
This Mod prepares a dynamic TOP100 list. It will show the following data

- top 100 pictures with most hits
- top 100 pictures with most Votes
- the 100 pictures with most rating
- the 100 pictures with most comments
- the pictures which were looked at last. (However, it is no top 100, but i like it)

The mod is designed that if one of the criteria is not met 100 images, then it shows only the images that meet this criterion. As an example. I have  12 pictures with votes, then the mod also shows just the twelve images and no more.
During the installation, the installer set the date of the last view to the image date.
Please note that I'm not a PHP programmer.

works with Version 1.7.6

Demo:
http://4images.rinaldos.homeip.net/top100.php?action=hits

Addon with highslide
http://rinaldos.homeip.net/top100.php?action=hits
need this Addon
http://www.4homepages.de/forum/index.php?topic=20461.0

in the top100.php already find the matching entries, need only be commented.

:flag-de:
folgende Dateien sind neu
:flag-en:
following files are new

/top100_install.php (bitte nach dem ausführen löschen)
/top100.php
/templates/default/top100.html

:flag-de:
folgende Dateien müssen geändert werden
:flag-en:
following files must be changed

/details.php
/includes/page_header.php
/lang/deutsch/main.php
/lang/english/main.php
/templates/default/details.html
/templates/default/user_logininfo.html
/templates/default/user_loginform.html
/admin/checkimages.php
/member.php




1
:flag-de:
Logge dich als Admin ein und führe die Datei top100_install.php aus
:flag-en:
Just login as admin and run the file from top100_install.php

added 29.10.2008 via phpmyadmin
:flag-de:
oder via phpmyadmin
:flag-en:
or via phpmyadmin


ALTER TABLE `4images_images` ADD `image_last_view` INT( 11 ) NOT NULL DEFAULT '0';
ALTER TABLE `4images_images` ADD `image_last_view_who` VARCHAR( 255 ) NOT NULL DEFAULT 'Guest' AFTER `image_last_view`;
UPDATE `4images_images` SET `image_last_view` = `image_date` WHERE `image_last_view` = 0;





2
 :flag-de:
lade die folgenden Dateien hoch
 :flag-en:
 upload the following files

top100.html -> /templates/default/top100.html
top100.php  -> /top100.php

3
:flag-de:
öffne details.php
suche
:flag-en:
open details.php
search
 

if ($user_info['user_level'] != ADMIN) {
  $sql = "UPDATE ".IMAGES_TABLE."
          SET image_hits = image_hits + 1
          WHERE image_id = $image_id";
  $site_db->query($sql);
}


:flag-de:
dahinter einfügen
:flag-en:
insert below:


// ---------  MOD TOP 100   ----------
$user_name_who = $user_info['user_name'];
   if ($user_name_who == "") {
      $user_name_who = Guest;
   }
   else {
        $user_name_who = $user_info['user_name'];
   }
  $sql = "UPDATE ".IMAGES_TABLE."
          SET image_last_view = '".time()."', image_last_view_who = '$user_name_who'
          WHERE image_id = $image_id";
  $site_db->query($sql);
// ---------  MOD TOP 100   ----------


:flag-de:
suche
:flag-en:
search


$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description,


:flag-de:
ersetze
:flag-en:
replace


$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_last_view, i.image_last_view_who,

 corrected these line 04.07.2009
:flag-de:
suche
:flag-en:
search

$is_image_owner = ($image_row['user_id'] > USER_AWAITING && $user_info['user_id'] == $image_row['user_id']) ? 1 : 0;


:flag-de:
dahinter einfügen
:flag-en:
insert below:
 

// ---------  MOD TOP 100   ----------
$image_last_view_date = format_date($config['date_format'],$image_row['image_last_view']);
$image_last_view_time = format_date($config['time_format'],$image_row['image_last_view']);
$image_last_view_who = $image_row['image_last_view_who'];
// ---------  MOD TOP 100   ----------


:flag-de:
suche
:flag-en:
search
 

"lang_next_image" => $lang['next_image'],
 
:flag-de:
dahinter einfügen
:flag-en:
insert below:


// ---------  MOD TOP 100   ----------
  "lang_top100_picture_last_view_date" => $lang['top_100_picture_last_view_date'],
  "lang_top100_picture_last_view_user" => $lang['top_100_picture_last_view_user'],
  "image_last_view_date" => $image_last_view_date,
  "image_last_view_time" => $image_last_view_time,
  "image_last_view_who" => $image_last_view_who,
// ---------  MOD TOP 100   ----------



4
 :flag-de:
öffne includes/page_header.php
suche
 :flag-en:
 open includes/page_header.php
 search


"url_captcha_image" => $site_sess->url(ROOT_PATH."captcha.php"),



:flag-de:
dahinter einfügen
:flag-en:
insert below:


// ---------  MOD TOP 100   ----------
"url_top100" => $site_sess->url(ROOT_PATH."top100.php?action=hits"),
// ---------  MOD TOP 100   ----------


 :flag-de:
 suche
 :flag-en:
 search
 

  "charset" => $lang['charset'],


:flag-de:
dahinter einfügen
:flag-en:
insert below:


// ---------  MOD TOP 100   ----------
 "lang_top100" => $lang['lang_top100'],
// ---------  MOD TOP 100   ----------


5
:flag-de:
öffne templates/default/user_logininfo.html
suche
:flag-en:
open templates/default/user_logininfo.html
search


&raquo; <a href="{url_logout}">{lang_logout}</a></td>



:flag-de:
ersetze
:flag-en:
replace


&raquo; <a href="{url_logout}">{lang_logout}</a><br />
&raquo; <a href="{url_top100}">{lang_top100}</a></td>


6
:flag-de:
öffne templates/default/user_loginform.html
suche
:flag-en:
open templates/default/user_loginform.html
search


&raquo; <a href="{url_register}">{lang_register}</a></td>


 :flag-de:
ersetze
:flag-en:
replace


&raquo; <a href="{url_register}">{lang_register}</a><br />
&raquo;<a href="{url_top100}">{lang_top100}</a></td>


7
:flag-de:
öffne lang/deutsch/main.php
suche
:flag-en:
open lang/deutsch/main.php
search


?>


:flag-de:
davor einfügen
:flag-en:
insert above:


// ---------  MOD TOP 100   ----------
$lang['lang_top100'] = "TOP 100";
$lang['lang_toplist_title_top100'] = " TOP 100";
$lang['lang_toplist_page'] = " Seite:";
$lang['no_top100'] = "Es sind noch keine Bilder mit dem Auswahlkriterium vorhanden";
$lang['top_100_picture'] = "Bild";
$lang['top_100_picture_name'] = "Name";
$lang['top_100_picture_id'] = "ID";
$lang['top_100_picture_cat'] = "Kat.";
$lang['top_100_picture_date'] = "Datum";
$lang['top_100_picture_hits'] = "Hits";
$lang['top_100_picture_votes'] = "Votes";
$lang['top_100_pos'] = "Pos.";
$lang['top_100_picture_rating'] = "Rating";
$lang['top_100_picture_last_view'] = "am";
$lang['top_100_picture_last_view_who'] = "von";
$lang['top_100_picture_last_view_date'] = "zuletzt gesehen am:";
$lang['top_100_picture_last_view_user'] = "zuletzt gesehen von:";
$lang['top_100_picture_downloads'] = "Downl.";
$lang['top_100_picture_comment'] = "Anm.";
$lang['top_100_url_votes'] = "Top100 Votes";
$lang['top_100_url_hits']  = "Top100 Treffer";
$lang['top_100_url_downloads']  = "Top100 Downloads";
$lang['top_100_url_comment']  = "Top100 Kommentare";
$lang['top_100_url_rating'] = "Top100 Rating";
$lang['top_100_url_view']  = "zuletzt angesehen";
$lang['top_100_url_rating'] = "Top100 Bewertung";
// ---------  MOD TOP 100   ----------


7
:flag-de:
öffne lang/english/main.php
suche
:flag-en:
open lang/english/main.php
search


?>


 :flag-de:
 davor einfügen
  :flag-en:
insert above:


// ---------  MOD TOP 100   ----------
$lang['lang_top100'] = "TOP 100";
$lang['lang_toplist_title_top100'] = " TOP 100 Pictures ";
$lang['lang_toplist_page'] = " Page:";
$lang['no_top100'] = "There are no pictures to show";
$lang['top_100_picture'] = "Picture";
$lang['top_100_picture_name'] = "Image Name";
$lang['top_100_picture_id'] = "ID";
$lang['top_100_picture_cat'] = "Category";
$lang['top_100_picture_date'] = "Date";
$lang['top_100_picture_hits'] = "Hits";
$lang['top_100_picture_votes'] = "Votes";
$lang['top_100_pos'] = "Pos.";
$lang['top_100_picture_rating'] = "Rating";
$lang['top_100_picture_last_view'] = "at";
$lang['top_100_picture_last_view_who'] = "seen by";
$lang['top_100_picture_last_view_date'] = "Last view:";
$lang['top_100_picture_last_view_user'] = "Last seen by:";
$lang['top_100_picture_downloads'] = "Downloads";
$lang['top_100_picture_comment'] = "Comments";
$lang['top_100_url_votes'] = "Top100 Votes";
$lang['top_100_url_hits']  = "Top100 Hits";
$lang['top_100_url_downloads']  = "Top100 Downloads";
$lang['top_100_url_comment']  = "Top100 Comments";
$lang['top_100_url_rating'] = "Top100 Rating";
$lang['top_100_url_view']  = "zuletzt angesehen";
$lang['top_100_url_rating'] = "Top100 Bewertung";
// ---------  MOD TOP 100   ----------


8
 :flag-de:
öffne templates/default/details.html
suche
 :flag-en:
 open templates/default/details.html
 search
 

<tr>
 <td valign="top" class="row1"><b>{lang_date}</b></td>
 <td valign="top" class="row1">{image_date}</td>
</tr>



 :flag-de:
 dahinter einfügen
  :flag-en:
insert below


<tr class="row2">
 <td valign="top" class="smalltext" width="295" ><b>{lang_top100_picture_last_view_date}</b></td>
 <td valign="top" class="smalltext">{image_last_view_date} {image_last_view_time}</td>
</tr>
<tr class="row1">
 <td valign="top" class="smalltext" width="295" ><b>{lang_top100_picture_last_view_user}</b></td>
 <td valign="top" class="smalltext">{image_last_view_who}</td>
</tr>


9
 :flag-de:
öffne admin/checkimages.php
suche
 :flag-en:
 open admin/checkimages.php
 search
 
(cat_id, user_id, image_name, image_description, image_keywords, image_date,

:flag-de:
ersetze
:flag-en:
replace

(cat_id, user_id, image_name, image_description, image_keywords, image_date, image_last_view,

 :flag-de:
suche
 :flag-en:
 search

($cat_id, $user_id, '$image_name', '$image_description', '$image_keywords', $image_date,

:flag-de:
ersetze
:flag-en:
replace

($cat_id, $user_id, '$image_name', '$image_description', '$image_keywords', $image_date, $image_date,

10
 :flag-de:
öffne /member.php
suche 2mal
 :flag-en:
 open /member.php
 search 2times
 
(cat_id, user_id, image_name, image_description, image_keywords, image_date,


:flag-de:
ersetze
:flag-en:
replace

(cat_id, user_id, image_name, image_description, image_keywords, image_date, image_last_view,


 :flag-de:
suche 2mal
 :flag-en:
 search 2times

 ($cat_id, ".$user_info['user_id'].", '$image_name', '$image_description', '$image_keywords', $current_time,


:flag-de:
ersetze
:flag-en:
replace

 ($cat_id, ".$user_info['user_id'].", '$image_name', '$image_description', '$image_keywords', $current_time, $current_time,



Gruß
Ingo
Title: Re: [MOD] Top 100
Post by: kai on October 16, 2008, 08:03:21 AM
Danke!

Evtl. kannst Du beim nächsten Mal den php-Code mit dem "php" BB-Code einklammern. Dann kommt die Syntax besser raus. :)
Title: Re: [MOD] Top 100
Post by: qBass17 on October 16, 2008, 08:46:42 AM
Super Mod!!!!
Danke dafür!

@ kai,

kann ja keiner Ahnen das es einen neuen BBCODE gibt! Warum baut ihr denn kein Button dafür ein? bei SMF ist das doch einfach mit dem Package Manager! Oder ersetzt den Standard CODE mit PHP!

LG
Title: Re: [MOD] Top 100
Post by: rinaldos on October 16, 2008, 10:51:53 AM
Codeupdate
Added Step9 and Step 10

Hatte ich heute morgen vergessen. Nun werden auch die Daten beim Upload eingefügt

Gruß
Ingo
Title: Re: [MOD] Top 100
Post by: qBass17 on October 16, 2008, 03:11:09 PM
Hey, super!

Aber rinaldos, du solst anstatt "[code ] .... [/ code]" "[php ] .... [ /php]" nehmen ;)
Title: Re: [MOD] Top 100
Post by: Carpfish on October 29, 2008, 08:16:32 AM
Habe alles Instaliert aber folgende Fehlermeldung bei der Datenbank


DB Error: Bad SQL Query: ALTER TABLE `4images_images` ADD `image_last_view` INT( 11 ) NOT NULL DEFAULT '0' AFTER `image_postcards`
Unbekanntes Tabellenfeld 'image_postcards' in 4images_images

DB Error: Bad SQL Query: ALTER TABLE `4images_images` ADD `image_last_view_who` VARCHAR( 255 ) NOT NULL DEFAULT 'Guest' AFTER `image_last_view`
Unbekanntes Tabellenfeld 'image_last_view' in 4images_images

DB Error: Bad SQL Query: UPDATE `4images_images` SET `image_last_view` = `image_date` WHERE `image_last_view` = 0
Unbekanntes Tabellenfeld 'image_last_view' in where clause

   1. Error
        ALTER TABLE `4images_images` ADD `image_last_view` INT( 11 ) NOT NULL DEFAULT '0' AFTER `image_postcards`

   2. Error
        ALTER TABLE `4images_images` ADD `image_last_view_who` VARCHAR( 255 ) NOT NULL DEFAULT 'Guest' AFTER `image_last_view`

   3. Error
        UPDATE `4images_images` SET `image_last_view` = `image_date` WHERE `image_last_view` = 0


Könnt ihr mir vieleicht weiterhelfen

Danke Andy
Title: Re: [MOD] Top 100
Post by: Nicky on October 29, 2008, 10:48:11 AM
andy,
du musst die top100_install.php.zip  downloaden und top100_install.php auch ausführen damit die felder angelegt werden..
Title: Re: [MOD] Top 100
Post by: Carpfish on October 29, 2008, 05:16:36 PM
@Nicky

Habe ich auch gemacht, aber beim Instalieren der top100_install.php kommt diese fehlermeldung im instalations Display.

Die Daten werden nicht auf die Datenbank geschrieben.

Wollte es manuell eintragen:

1: image_last_view` INT( 11 ) NOT NULL DEFAULT '0'                                                                            in den 4images_image Datenbank
2: image_last_view_who` VARCHAR( 255 ) NOT NULL DEFAULT 'Guest                                                     in den 4images_image Datenbank
3: UPDATE `4images_images` SET `image_last_view` = `image_date` WHERE `image_last_view` = 0        ????????? was sol ich da machen

Was soll ich bei Punkt 3 machen.
Ich hoffe es stimm die Daten in die 4images_image zu schreiben.

Gru0 Andy
Title: Re: [MOD] Top 100
Post by: rinaldos on October 29, 2008, 05:34:24 PM
Wollte es manuell eintragen:
1: image_last_view` INT( 11 ) NOT NULL DEFAULT '0'                                                                            in den 4images_image Datenbank
2: image_last_view_who` VARCHAR( 255 ) NOT NULL DEFAULT 'Guest                                                     in den 4images_image Datenbank
3: UPDATE `4images_images` SET `image_last_view` = `image_date` WHERE `image_last_view` = 0        ????????? was sol ich da machen

Hallo,
also wenn du es manuell eintragen willst, dann mit phpmyadmin, 4images_images auswählen und die Einträge für image_last_view und image_last_view_who löschen (sofern vorhanden). Anschliessend  folgenden sql Befehle ausführen:


ALTER TABLE `4images_images` ADD `image_last_view` INT( 11 ) NOT NULL DEFAULT '0';
ALTER TABLE `4images_images` ADD `image_last_view_who` VARCHAR( 255 ) NOT NULL DEFAULT 'Guest' AFTER `image_last_view`;
UPDATE `4images_images` SET `image_last_view` = `image_date` WHERE `image_last_view` = 0;


Damit sollte es klappen

Gruß
Ingo
Title: Re: [MOD] Top 100
Post by: Nicky on October 29, 2008, 05:39:57 PM
yep rinaldos,

da es die
Code: [Select]
AFTER `image_postcards`nicht gibt ;)

hier die install
Title: Re: [MOD] Top 100
Post by: rinaldos on October 29, 2008, 05:46:21 PM
Hatte gerade den installer neu hochgeladen, und nur diese Zeile geändert

ALTER TABLE `4images_images` ADD `image_last_view` INT( 11 ) NOT NULL DEFAULT '0';

Damit die Tabelleneinträge am ende eingefügt werden, sowie den Schritt 3 in meinem posting geändert. Hatte ein [ /php ] vergessen, somit stand flag de im Code :-(

Gruß
Ingo
Title: Re: [MOD] Top 100
Post by: Carpfish on October 29, 2008, 07:33:25 PM
 :lol: Thanks all

Funkt ohne Probleme.

Andy
Title: Re: [MOD] Top 100
Post by: rinaldos on October 29, 2008, 08:49:01 PM
Das ist schön das nun alles klappt:-)

LG
Ingo
Title: Re: [MOD] Top 100
Post by: Nicky on October 30, 2008, 09:54:13 PM
hey ho rinaldos,

ich schau mir gerade dein mod an..
eine ganz blöde frage, wozu braucht man bei einer top100 paging seiten?
ist das dann eine top100 oder topALL mit
$picture_per_page = 100;
$sort_order = 'DESC';
$max_picture = 100;      //for more pictures change this value
?
:mrgreen: :twisted:

sonnst.. toller mod!
Title: Re: [MOD] Top 100
Post by: rinaldos on October 31, 2008, 06:04:39 AM
Hi,
ich hatte erst nur 25 Bilder angezeigt ($picture_per_page = 25;). Also wurden dann 4 Seiten daraus.
Da ich es aber nicht hinbekommen habe, das dann auf Seite 1 die Nummerierung (Spalte 1 Pos.) 1-25, Seite 2 (Spalte 1 Pos.)26-50 usw ist, habe ich das paging noch drin gelassen, für den Fall das ich noch eine Lösung finde. Ergo habe ich den MOD mit ($picture_per_page = 100;) veröffentlicht.

Du hast recht, so wie er gerade veröffentlicht ist, brauch man kein Paging............

LG
Ingo

Title: Re: [MOD] Top 100
Post by: mawenzi on October 31, 2008, 07:36:18 AM
@rinaldos  ...  ;)
Title: Re: [MOD] Top 100
Post by: Nicky on October 31, 2008, 12:16:50 PM
rinaldos,

die idee mit dem paging ist ja auch nicht schlecht, nur ich hab mich gewundert wozu bei einer top100 liste ;)
Title: Re: [MOD] Top 100
Post by: Nicky on November 12, 2008, 09:18:03 AM
okay,

here are some changes to get it correct displayed

1.)
details html:

change:
Code: [Select]
<tr class="row2">
 <td valign="top" class="smalltext" width="295" ><b>{lang_top100_picture_last_view_date}</b></td>
 <td valign="top" class="smalltext">{image_last_view_date} {image_last_view_time}</td>
</tr>
<tr class="row1">
 <td valign="top" class="smalltext" width="295" ><b>{lang_top100_picture_last_view_user}</b></td>
 <td valign="top" class="smalltext">{image_last_view_who}</td>
</tr>
to:
Code: [Select]
<tr class="row2">
 <td valign="top" class="smalltext" width="295" ><b>{lang_top_100_picture_last_view_date}</b></td>
 <td valign="top" class="smalltext">{image_last_view_date} {image_last_view_time}</td>
</tr>
<tr class="row1">
 <td valign="top" class="smalltext" width="295" ><b>{lang_top_100_picture_last_view_user}</b></td>
 <td valign="top" class="smalltext">{image_last_view_who}</td>
</tr>

2.)
add into lang main.php
Code: [Select]
$lang['top_100_picture_last_view_user'] = "Last seen by:";
$lang['top_100_picture_last_view_date'] = "Last view:";

3.)
change in details.php
Code: [Select]
$image_last_view_date = date("d.m.Y",$image_row['image_last_view']);
$image_last_view_time = date("H:i",$image_row['image_last_view']);
to
Code: [Select]
$image_last_view_date = format_date($config['date_format'],$image_row['image_last_view']);
$image_last_view_time = format_date($config['time_format'],$image_row['image_last_view']);

and in top100.php

change:
Code: [Select]
  $image_last_view_date = date("d.m.Y",$row['image_last_view']);
  $image_last_view_time = date("H:i",$row['image_last_view']);
to
Code: [Select]
  $image_last_view_date = format_date($config['date_format'],$row['image_last_view']);
  $image_last_view_time = format_date($config['time_format'],$row['image_last_view']);

to get correct date and time format from your 4images settings..
Title: Re: [MOD] Top 100
Post by: rinaldos on November 12, 2008, 10:23:25 AM
Thanks to Nicky, I think you mean TOP100.php :-)
I have changed the post with your modification, uploaded a new top100.php with your changes.

Gruß
Ingo
Title: Re: [MOD] Top 100
Post by: Nicky on November 12, 2008, 10:32:32 AM
yeah.. top100.php :)
changed my post..

thx for repost files!
Title: Re: [MOD] Top 100
Post by: Cocker on November 23, 2008, 06:51:21 PM
Hi, ich habe alles problemlos hinbekommen.
Nur die Thumbs sind doch etwas sehr klein.

Könnte mir jemand helfen die etwas größer zu bekommen!
Ich könnte auch in der Liste auf das Uploaddatum und die Kategorie verzichten um meht Platz zu haben.

Gruß Cocker
Title: Re: [MOD] Top 100
Post by: Jasi on November 24, 2008, 09:15:31 PM
Kann mir mal bitte jemand helfen...

Hab ein Problem nach Einbau des MOD in der details.php

Parse error: syntax error, unexpected T_STRING in /home/www/web210/html/4images/details.php on line 47



Dann ist dies nicht vorhanden:

öffne templates/default/user_logininfo.html

&raquo; <a href="{url_logout}">{lang_logout}</a></td>


sowie in dies auch nicht:

öffne templates/default/user_loginform.html


&raquo; <a href="{url_register}">{lang_register}</a></td>



Hier der Code der geänderten detailsp.php nach dem Eibau des MOD:

Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: details.php                                          *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7.6                                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/

$main_template 'details';

define('GET_CACHES'1);
define('ROOT_PATH''./');
include(
ROOT_PATH.'global.php');
require(
ROOT_PATH.'includes/sessions.php');
$user_access get_permission();
include(
ROOT_PATH.'includes/page_header.php');

if (!
$image_id) {
    
redirect($url);
}

$additional_sql "";
if (!empty(
$additional_image_fields)) {
  foreach (
$additional_image_fields as $key => $val) {
    
$additional_sql .= ", i.".$key;
  }
}


$sql "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_last_view, i.image_last_view_who, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.""user_name").get_user_table_field(", u.""user_email")."
//
$sql = "SELECT i.image_idi.cat_idi.user_idi.image_namei.image_descriptioni.image_keywordsi.image_datei.image_activei.image_media_filei.image_thumb_filei.image_download_urli.image_allow_commentsi.image_commentsi.image_downloadsi.image_votesi.image_ratingi.image_hits".$additional_sql."c.cat_name".get_user_table_field("u.", "user_name").get_user_table_field("u.", "user_email")."
        
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_id $image_id AND i.image_active AND c.cat_id i.cat_id";
$image_row = $site_db->query_firstrow($sql);
$cat_id = (isset($image_row['cat_id'])) ? $image_row['cat_id'] : 0;
$is_image_owner = ($image_row['user_id'] > USER_AWAITING && $user_info['user_id'] == $image_row['user_id']) ? 1 : 0;



// ---------  MOD TOP 100   ----------
$image_last_view_date = format_date($config['date_format'],$image_row['image_last_view']);
$image_last_view_time = format_date($config['time_format'],$image_row['image_last_view']);
$image_last_view_who = $image_row['image_last_view_who'];
// ---------  MOD TOP 100   ----------











if (!check_permission("
auth_viewcat", $cat_id) || !check_permission("auth_viewimage", $cat_id) || !$image_row) {
  redirect(
$url);
}

$random_cat_image = (defined("SHOW_RANDOM_IMAGE") && SHOW_RANDOM_IMAGE == 0) ? "" : get_random_image($cat_id);
$site_template->register_vars("random_cat_image", $random_cat_image);
unset(
$random_cat_image);

//-----------------------------------------------------
//--- Show Image --------------------------------------
//-----------------------------------------------------
$image_allow_comments = (check_permission("auth_readcomment", $cat_id)) ? $image_row['image_allow_comments'] : 0;
$image_name = format_text($image_row['image_name'], 2);
show_image(
$image_row$mode, 0, 1);

$in_mode = 0;

$sql = "";
if (
$mode == "lightbox") {
  if (!empty(
$user_info['lightbox_image_ids'])) {
    
$image_id_sql = str_replace(" ", "", trim($user_info['lightbox_image_ids']));
    
$sql = "SELECT image_idcat_idimage_nameimage_media_fileimage_thumb_file
            FROM 
".IMAGES_TABLE."
            
WHERE image_active AND image_id IN ($image_id_sql) AND (cat_id NOT IN (".get_auth_cat_sql("auth_viewimage", "NOTIN")."".get_auth_cat_sql("auth_viewcat", "NOTIN")."))
            
ORDER BY ".$config['image_order']." ".$config['image_sort']."image_id ".$config['image_sort'];
    
$in_mode = 1;
  }
}
elseif (
$mode == "search") {
  if (!isset(
$session_info['searchid']) || empty($session_info['searchid'])) {
    
$session_info['search_id'] = $site_sess->get_session_var("search_id");
  }

  if (!empty(
$session_info['search_id'])) {
    
$search_id = unserialize($session_info['search_id']);
  }

  
$sql_where_query = "";

  if (!empty(
$search_id['image_ids'])) {
    
$sql_where_query .= "AND image_id IN (".$search_id['image_ids']."";
  }

  if (!empty(
$search_id['user_ids'])) {
    
$sql_where_query .= "AND user_id IN (".$search_id['user_ids']."";
  }

  if (!empty(
$search_id['search_new_images']) && $search_id['search_new_images'] == 1) {
    
$new_cutoff = time() - 60 * 60 * 24 * $config['new_cutoff'];
    
$sql_where_query .= "AND image_date >= $new_cutoff ";
  }

  if (!empty(
$search_id['search_cat']) && $search_id['search_cat'] != 0) {
    
$cat_id_sql = 0;
    if (check_permission("
auth_viewcat", $search_id['search_cat'])) {
      
$sub_cat_ids = get_subcat_ids($search_id['search_cat'], $search_id['search_cat'], $cat_parent_cache);
      
$cat_id_sql .= "".$search_id['search_cat'];
      if (!empty(
$sub_cat_ids[$search_id['search_cat']])) {
        foreach (
$sub_cat_ids[$search_id['search_cat']] as $val) {
          if (check_permission("
auth_viewcat", $val)) {
            
$cat_id_sql .= "".$val;
          }
        }
      }
    }
    
$cat_id_sql = $cat_id_sql !== 0 ? "AND cat_id IN ($cat_id_sql)" : "";
  }
  else {
    
$cat_id_sql = get_auth_cat_sql("auth_viewcat", "NOTIN");
    
$cat_id_sql = $cat_id_sql !== 0 ? "AND cat_id NOT IN (".$cat_id_sql.")" : "";
  }

  if (!empty(
$sql_where_query)) {
    
$sql = "SELECT image_idcat_idimage_nameimage_media_fileimage_thumb_file
            FROM 
".IMAGES_TABLE."
            
WHERE image_active 1
            $sql_where_query
            $cat_id_sql
            ORDER BY 
".$config['image_order']." ".$config['image_sort']."image_id ".$config['image_sort'];
    
$in_mode = 1;
  }
}
if (!
$in_mode || empty($sql)) {
  
$sql = "SELECT image_idcat_idimage_nameimage_media_fileimage_thumb_file
          FROM 
".IMAGES_TABLE."
          
WHERE image_active AND cat_id $cat_id
          ORDER BY 
".$config['image_order']." ".$config['image_sort']."image_id ".$config['image_sort'];
}
$result = $site_db->query($sql);

$image_id_cache = array();
$next_prev_cache = array();
$break = 0;
$prev_id = 0;
while(
$row = $site_db->fetch_array($result)) {
  
$image_id_cache[] = $row['image_id'];
  
$next_prev_cache[$row['image_id']] = $row;
  if (
$break) {
    break;
  }
  if (
$prev_id == $image_id) {
    
$break = 1;
  }
  
$prev_id = $row['image_id'];
}
$site_db->free_result();

if (!function_exists("
array_search")) {
  function array_search(
$needle$haystack) {
    
$match = false;
    foreach (
$haystack as $key => $value) {
      if (
$value == $needle) {
        
$match = $key;
      }
    }
    return 
$match;
  }
}

$act_key = array_search($image_id$image_id_cache);
$next_image_id = (isset($image_id_cache[$act_key + 1])) ? $image_id_cache[$act_key + 1] : 0;
$prev_image_id = (isset($image_id_cache[$act_key - 1])) ? $image_id_cache[$act_key - 1] : 0;
unset(
$image_id_cache);

// Get next and previous image
if (!empty(
$next_prev_cache[$next_image_id])) {
  
$next_image_name = format_text($next_prev_cache[$next_image_id]['image_name'], 2);
  
$next_image_url = $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$next_image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""));
  if (!get_file_path(
$next_prev_cache[$next_image_id]['image_media_file'], "media", $next_prev_cache[$next_image_id]['cat_id'], 0, 0)) {
    
$next_image_file = ICON_PATH."/404.gif";
  }
  else {
    
$next_image_file = get_file_path($next_prev_cache[$next_image_id]['image_media_file'], "media", $next_prev_cache[$next_image_id]['cat_id'], 0, 1);
  }
  if (!get_file_path(
$next_prev_cache[$next_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$next_image_id]['cat_id'], 0, 0)) {
    
$next_thumb_file = ICON_PATH."/".get_file_extension($next_prev_cache[$next_image_id]['image_media_file']).".gif";
  }
  else {
    
$next_thumb_file = get_file_path($next_prev_cache[$next_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$next_image_id]['cat_id'], 0, 1);
  }
}
else {
  
$next_image_name = REPLACE_EMPTY;
  
$next_image_url = REPLACE_EMPTY;
  
$next_image_file = REPLACE_EMPTY;
  
$next_thumb_file = REPLACE_EMPTY;
}

if (!empty(
$next_prev_cache[$prev_image_id])) {
  
$prev_image_name = format_text($next_prev_cache[$prev_image_id]['image_name'], 2);
  
$prev_image_url = $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$prev_image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""));
  if (!get_file_path(
$next_prev_cache[$prev_image_id]['image_media_file'], "media", $next_prev_cache[$prev_image_id]['cat_id'], 0, 0)) {
    
$prev_image_file = ICON_PATH."/404.gif";
  }
  else {
    
$prev_image_file = get_file_path($next_prev_cache[$prev_image_id]['image_media_file'], "media", $next_prev_cache[$prev_image_id]['cat_id'], 0, 1);
  }
  if (!get_file_path(
$next_prev_cache[$prev_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$prev_image_id]['cat_id'], 0, 0)) {
    
$prev_thumb_file = ICON_PATH."/".get_file_extension($next_prev_cache[$prev_image_id]['image_media_file']).".gif";
  }
  else {
    
$prev_thumb_file = get_file_path($next_prev_cache[$prev_image_id]['image_thumb_file'], "thumb", $next_prev_cache[$prev_image_id]['cat_id'], 0, 1);
  }
}
else {
  
$prev_image_name = REPLACE_EMPTY;
  
$prev_image_url = REPLACE_EMPTY;
  
$prev_image_file = REPLACE_EMPTY;
  
$prev_thumb_file = REPLACE_EMPTY;
}

$site_template->register_vars(array(
  "
next_image_id" => $next_image_id,
  "
next_image_name" => $next_image_name,
  "
next_image_url" => $next_image_url,
  "
next_image_file" => $next_image_file,
  "
next_thumb_file" => $next_thumb_file,
  "
prev_image_id" => $prev_image_id,
  "
prev_image_name" => $prev_image_name,
  "
prev_image_url" => $prev_image_url,
  "
prev_image_file" => $prev_image_file,
  "
prev_thumb_file" => $prev_thumb_file
));
unset(
$next_prev_cache);

//-----------------------------------------------------
//--- Save Comment ------------------------------------
//-----------------------------------------------------
$error = 0;
if (
$action == "postcomment" && isset($HTTP_POST_VARS[URL_ID])) {
  
$id = intval($HTTP_POST_VARS[URL_ID]);
  
$sql = "SELECT cat_idimage_allow_comments
          FROM 
".IMAGES_TABLE."
          
WHERE image_id $id";
  
$row = $site_db->query_firstrow($sql);

  if (
$row['image_allow_comments'] == 0 || !check_permission("auth_postcomment", $row['cat_id']) || !$row) {
    
$msg = $lang['comments_deactivated'];
  }
  else {
    
$user_name = un_htmlspecialchars(trim($HTTP_POST_VARS['user_name']));
    
$comment_headline = un_htmlspecialchars(trim($HTTP_POST_VARS['comment_headline']));
    
$comment_text = un_htmlspecialchars(trim($HTTP_POST_VARS['comment_text']));

    
$captcha = (isset($HTTP_POST_VARS['captcha'])) ? un_htmlspecialchars(trim($HTTP_POST_VARS['captcha'])) : "";

    // Flood Check
    
$sql = "SELECT comment_ipcomment_date
            FROM 
".COMMENTS_TABLE."
            
WHERE image_id $id
            ORDER BY comment_date DESC
            LIMIT 1
";
    
$spam_row = $site_db->query_firstrow($sql);
    
$spamtime = $spam_row['comment_date'] + 180;

    if (
$session_info['session_ip'] == $spam_row['comment_ip'] && time() <= $spamtime && $user_info['user_level'] != ADMIN)  {
      
$msg .= (($msg != "") ? "<br />" : "").$lang['spamming'];
      
$error = 1;
    }

    
$user_name_field = get_user_table_field("", "user_name");
    if (!empty(
$user_name_field)) {
      if (
$site_db->not_empty("SELECT $user_name_field FROM ".USERS_TABLE." WHERE $user_name_field '".strtolower($user_name)."' AND ".get_user_table_field("", "user_id")." <> '".$user_info['user_id']."'")) {
        
$msg .= (($msg != "") ? "<br />" : "").$lang['username_exists'];
        
$error = 1;
      }
    }
    if (
$user_name == "")  {
      
$msg .= (($msg != "") ? "<br />" : "").$lang['name_required'];
      
$error = 1;
    }
    if (
$comment_headline == "")  {
      
$msg .= (($msg != "") ? "<br />" : "").$lang['headline_required'];
      
$error = 1;
    }
    if (
$comment_text == "")  {
      
$msg .= (($msg != "") ? "<br />" : "").$lang['comment_required'];
      
$error = 1;
    }

    if (
$captcha_enable_comments && !captcha_validate($captcha)) {
      
$msg .= (($msg != "") ? "<br />" : "").$lang['captcha_required'];
      
$error = 1;
    }

    if (!
$error)  {
      
$sql = "INSERT INTO ".COMMENTS_TABLE."
              
(image_iduser_iduser_namecomment_headlinecomment_textcomment_ipcomment_date)
              
VALUES
              
($id".$user_info['user_id']."'$user_name''$comment_headline''$comment_text''".$session_info['session_ip']."'".time().")";
      
$site_db->query($sql);
      
$commentid = $site_db->get_insert_id();
      update_comment_count(
$id$user_info['user_id']);
      
$msg = $lang['comment_success'];
    }
  }
  unset(
$row);
  unset(
$spam_row);
}

//-----------------------------------------------------
//--- Show Comments -----------------------------------
//-----------------------------------------------------
if (
$image_allow_comments == 1) {
  
$site_template->register_vars(array(
      "
has_rss"   => true,
      "
rss_title" => "RSS Feed".$image_name." (".str_replace(':', '', $lang['comments']).")",
      "
rss_url"   => $script_url."/rss.php?action=comments&amp;".URL_IMAGE_ID."=".$image_id
  ));

  
$sql = "SELECT c.comment_idc.image_idc.user_idc.user_name AS comment_user_namec.comment_headlinec.comment_textc.comment_ipc.comment_date".get_user_table_field("u.", "user_level").get_user_table_field("u.", "user_name").get_user_table_field("u.", "user_email").get_user_table_field("u.", "user_showemail").get_user_table_field("u.", "user_invisible").get_user_table_field("u.", "user_joindate").get_user_table_field("u.", "user_lastaction").get_user_table_field("u.", "user_comments").get_user_table_field("u.", "user_homepage").get_user_table_field("u.", "user_icq")."
          
FROM ".COMMENTS_TABLE." c
          LEFT JOIN 
".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." c.user_id)
          
WHERE c.image_id $image_id
          ORDER BY c
.comment_date ASC";
  
$result = $site_db->query($sql);

  
$comment_row = array();
  while (
$row = $site_db->fetch_array($result)) {
    
$comment_row[] = $row;
  }
  
$site_db->free_result($result);
  
$num_comments = sizeof($comment_row);

  if (!
$num_comments) {
    
$comments = "<tr><td class=\"commentrow1\" colspan=\"2\">".$lang['no_comments']."</td></tr>";
  }
  else {
    
$comments "";
    
$bgcounter 0;
    for (
$i 0$i $num_comments$i++) {
      
$row_bg_number = ($bgcounter++ % == 0) ? 2;

      
$comment_user_email "";
      
$comment_user_email_save "";
      
$comment_user_mailform_link "";
      
$comment_user_email_button "";
      
$comment_user_homepage_button "";
      
$comment_user_icq_button "";
      
$comment_user_profile_button "";
      
$comment_user_status_img REPLACE_EMPTY;
      
$comment_user_name format_text($comment_row[$i]['comment_user_name'], 2);
      
$comment_user_info $lang['userlevel_guest'];

      
$comment_user_id $comment_row[$i]['user_id'];

      if (isset(
$comment_row[$i][$user_table_fields['user_name']]) && $comment_user_id != GUEST) {
        
$comment_user_name format_text($comment_row[$i][$user_table_fields['user_name']], 2);

        
$comment_user_profile_link = !empty($url_show_profile) ? $site_sess->url(preg_replace("/{user_id}/"$comment_user_id$url_show_profile)) : $site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$comment_user_id);
        
$comment_user_profile_button "<a href=\"".$comment_user_profile_link."\"><img src=\"".get_gallery_image("profile.gif")."\" border=\"0\" alt=\"".$comment_user_name."\" /></a>";

        
$comment_user_status_img = ($comment_row[$i][$user_table_fields['user_lastaction']] >= (time() - 300) && ((isset($comment_row[$i][$user_table_fields['user_invisible']]) && $comment_row[$i][$user_table_fields['user_invisible']] == 0) || $user_info['user_level'] == ADMIN)) ? "<img src=\"".get_gallery_image("user_online.gif")."\" border=\"0\" alt=\"Online\" />" "<img src=\"".get_gallery_image("user_offline.gif")."\" border=\"0\" alt=\"Offline\" />";

        
$comment_user_homepage = (isset($comment_row[$i][$user_table_fields['user_homepage']])) ? format_url($comment_row[$i][$user_table_fields['user_homepage']]) : "";
        if (!empty(
$comment_user_homepage)) {
          
$comment_user_homepage_button "<a href=\"".$comment_user_homepage."\" target=\"_blank\"><img src=\"".get_gallery_image("homepage.gif")."\" border=\"0\" alt=\"".$comment_user_homepage."\" /></a>";
        }

        
$comment_user_icq = (isset($comment_row[$i][$user_table_fields['user_icq']])) ? format_text($comment_row[$i][$user_table_fields['user_icq']]) : "";
        if (!empty(
$comment_user_icq)) {
          
$comment_user_icq_button "<a href=\"http://www.icq.com/people/about_me.php?uin=".$comment_user_icq."\" target=\"_blank\"><img src=\"http://status.icq.com/online.gif?icq=".$comment_user_icq."&img=5\" width=\"18\" height=\"18\" border=\"0\" alt=\"".$comment_user_icq."\" /></a>";
        }

        if (!empty(
$comment_row[$i][$user_table_fields['user_email']]) && (!isset($comment_row[$i][$user_table_fields['user_showemail']]) || (isset($comment_row[$i][$user_table_fields['user_showemail']]) && $comment_row[$i][$user_table_fields['user_showemail']] == 1))) {
          
$comment_user_email format_text($comment_row[$i][$user_table_fields['user_email']]);
          
$comment_user_email_save format_text(str_replace("@"" at "$comment_row[$i][$user_table_fields['user_email']]));
          if (!empty(
$url_mailform)) {
            
$comment_user_mailform_link $site_sess->url(preg_replace("/{user_id}/"$comment_user_id$url_mailform));
          }
          else {
            
$comment_user_mailform_link $site_sess->url(ROOT_PATH."member.php?action=mailform&amp;".URL_USER_ID."=".$comment_user_id);
          }
          
$comment_user_email_button "<a href=\"".$comment_user_mailform_link."\"><img src=\"".get_gallery_image("email.gif")."\" border=\"0\" alt=\"".$comment_user_email_save."\" /></a>";
        }

        if (!isset(
$comment_row[$i][$user_table_fields['user_level']]) || (isset($comment_row[$i][$user_table_fields['user_level']]) && $comment_row[$i][$user_table_fields['user_level']] == USER)) {
          
$comment_user_info $lang['userlevel_user'];
        }
        elseif (
$comment_row[$i][$user_table_fields['user_level']] == ADMIN) {
          
$comment_user_info $lang['userlevel_admin'];
        }

        
$comment_user_info .= "<br />";
        
$comment_user_info .= (isset($comment_row[$i][$user_table_fields['user_joindate']])) ? "<br />".$lang['join_date']." ".format_date($config['date_format'], $comment_row[$i][$user_table_fields['user_joindate']]) : "";
        
$comment_user_info .= (isset($comment_row[$i][$user_table_fields['user_comments']])) ? "<br />".$lang['comments']." ".$comment_row[$i][$user_table_fields['user_comments']] : "";
      }

      
$comment_user_ip = ($user_info['user_level'] == ADMIN) ? $comment_row[$i]['comment_ip'] : "";

      
$admin_links "";
      if (
$user_info['user_level'] == ADMIN) {
        
$admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=editcomment&amp;comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['edit']."</a>&nbsp;";
        
$admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=removecomment&amp;comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['delete']."</a>";
      }
      elseif (
$is_image_owner) {
        
$admin_links .= ($config['user_edit_comments'] != 1) ? "" "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editcomment&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['edit']."</a>&nbsp;";
        
$admin_links .= ($config['user_delete_comments'] != 1) ? "" "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removecomment&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['delete']."</a>";
      }

      
$site_template->register_vars(array(
        
"comment_id" => $comment_row[$i]['comment_id'],
        
"comment_user_id" => $comment_user_id,
        
"comment_user_status_img" => $comment_user_status_img,
        
"comment_user_name" => $comment_user_name,
        
"comment_user_info" => $comment_user_info,
        
"comment_user_profile_button" => $comment_user_profile_button,
        
"comment_user_email" => $comment_user_email,
        
"comment_user_email_save" => $comment_user_email_save,
        
"comment_user_mailform_link" => $comment_user_mailform_link,
        
"comment_user_email_button" => $comment_user_email_button,
        
"comment_user_homepage_button" => $comment_user_homepage_button,
        
"comment_user_icq_button" => $comment_user_icq_button,
        
"comment_user_ip" => $comment_user_ip,
        
"comment_headline" => format_text($comment_row[$i]['comment_headline'], 0$config['wordwrap_comments'], 00),
        
"comment_text" => format_text($comment_row[$i]['comment_text'], $config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments']),
        
"comment_date" => format_date($config['date_format']." ".$config['time_format'], $comment_row[$i]['comment_date']),
        
"row_bg_number" => $row_bg_number,
        
"admin_links" => $admin_links
      
));
      
$comments .= $site_template->parse_template("comment_bit");
    } 
// end while
  
//end else
  
$site_template->register_vars("comments"$comments);
  unset(
$comments);

  
//-----------------------------------------------------
  //--- BBCode & Form -----------------------------------
  //-----------------------------------------------------
  
$allow_posting check_permission("auth_postcomment"$cat_id);
  
$bbcode "";
  if (
$config['bb_comments'] == && $allow_posting) {
    
$site_template->register_vars(array(
      
"lang_bbcode" => $lang['bbcode'],
      
"lang_tag_prompt" => $lang['tag_prompt'],
      
"lang_link_text_prompt" => $lang['link_text_prompt'],
      
"lang_link_url_prompt" => $lang['link_url_prompt'],
      
"lang_link_email_prompt" => $lang['link_email_prompt'],
      
"lang_list_type_prompt" => $lang['list_type_prompt'],
      
"lang_list_item_prompt" => $lang['list_item_prompt']
    ));
    
$bbcode $site_template->parse_template("bbcode");
  }

  if (!
$allow_posting) {
    
$comment_form "";
  }
  else {
    
$user_name = (isset($HTTP_POST_VARS['user_name']) && $error) ? format_text(trim(stripslashes($HTTP_POST_VARS['user_name'])), 2) : (($user_info['user_level'] != GUEST) ? format_text($user_info['user_name'], 2) : "");
    
$comment_headline = (isset($HTTP_POST_VARS['comment_headline']) && $error) ? format_text(trim(stripslashes($HTTP_POST_VARS['comment_headline'])), 2) : "";
    
$comment_text = (isset($HTTP_POST_VARS['comment_text']) && $error) ? format_text(trim(stripslashes($HTTP_POST_VARS['comment_text'])), 2) : "";

    
$site_template->register_vars(array(
      
"bbcode" => $bbcode,
      
"user_name" => $user_name,
      
"comment_headline" => $comment_headline,
      
"comment_text" => $comment_text,
      
"lang_post_comment" => $lang['post_comment'],
      
"lang_name" => $lang['name'],
      
"lang_headline" => $lang['headline'],
      
"lang_comment" => $lang['comment'],
      
"lang_captcha" => $lang['captcha'],
      
"lang_captcha_desc" => $lang['captcha_desc'],
      
"captcha_comments" => (bool)$captcha_enable_comments
    
));
    
$comment_form $site_template->parse_template("comment_form");
  }
  
$site_template->register_vars("comment_form"$comment_form);
  unset(
$comment_form);
// end if allow_comments

// Admin Links
$admin_links "";
if (
$user_info['user_level'] == ADMIN) {
  
$admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("images.php?action=editimage&amp;image_id=".$image_id))."\" target=\"_blank\">".$lang['edit']."</a>&nbsp;";
  
$admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("images.php?action=removeimage&amp;image_id=".$image_id))."\" target=\"_blank\">".$lang['delete']."</a>";
}
elseif (
$is_image_owner) {
  
$admin_links .= ($config['user_edit_image'] != 1) ? "" "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editimage&amp;".URL_IMAGE_ID."=".$image_id)."\">".$lang['edit']."</a>&nbsp;";
  
$admin_links .= ($config['user_delete_image'] != 1) ? "" "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removeimage&amp;".URL_IMAGE_ID."=".$image_id)."\">".$lang['delete']."</a>";
}
$site_template->register_vars("admin_links"$admin_links);

// Update Hits
if ($user_info['user_level'] != ADMIN) {
  
$sql "UPDATE ".IMAGES_TABLE."
          SET image_hits = image_hits + 1
          WHERE image_id = 
$image_id";
  
$site_db->query($sql);
}


// ---------  MOD TOP 100   ----------
$user_name_who $user_info['user_name'];
   if (
$user_name_who == "") { 
      
$user_name_who Guest
   }
   else { 
        
$user_name_who $user_info['user_name']; 
   }
  
$sql "UPDATE ".IMAGES_TABLE."
          SET image_last_view = '"
.time()."', image_last_view_who = '$user_name_who'
          WHERE image_id = 
$image_id";
  
$site_db->query($sql);
// ---------  MOD TOP 100   ----------





//-----------------------------------------------------
//---Clickstream---------------------------------------
//-----------------------------------------------------
$clickstream "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'];

if (
$mode == "lightbox" && $in_mode) {
  
$page_url "";
 if (
preg_match("/".URL_PAGE."=([0-9]+)/"$url$regs)) {
    if (!empty(
$regs[1]) && $regs[1] != 1) {
      
$page_url "?".URL_PAGE."=".$regs[1];
    }
  }
  
$clickstream .= "<a href=\"".$site_sess->url(ROOT_PATH."lightbox.php".$page_url)."\" class=\"clickstream\">".$lang['lightbox']."</a>".$config['category_separator'];
}
elseif (
$mode == "search" && $in_mode) {
  
$page_url "";
  if (
preg_match("/".URL_PAGE."=([0-9]+)/"$url$regs)) {
    if (!empty(
$regs[1]) && $regs[1] != 1) {
      
$page_url "&amp;".URL_PAGE."=".$regs[1];
    }
  }
  
$clickstream .= "<a href=\"".$site_sess->url(ROOT_PATH."search.php?show_result=1".$page_url)."\" class=\"clickstream\">".$lang['search']."</a>".$config['category_separator'];
}
else {
  
$clickstream .= get_category_path($cat_id1).$config['category_separator'];
}
$clickstream .= $image_name."</span>";

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
  
"msg" => $msg,
  
"clickstream" => $clickstream,
  
"lang_category" => $lang['category'],
  
"lang_added_by" => $lang['added_by'],
  
"lang_description" => $lang['description'],
  
"lang_keywords" => $lang['keywords'],
  
"lang_date" => $lang['date'],
  
"lang_hits" => $lang['hits'],
  
"lang_downloads" => $lang['downloads'],
  
"lang_rating" => $lang['rating'],
  
"lang_votes" => $lang['votes'],
  
"lang_author" => $lang['author'],
  
"lang_comment" => $lang['comment'],
  
"lang_prev_image" => $lang['prev_image'],
  
"lang_next_image" => $lang['next_image'],


// ---------  MOD TOP 100   ----------
  
"lang_top100_picture_last_view_date" => $lang['top_100_picture_last_view_date'],
  
"lang_top100_picture_last_view_user" => $lang['top_100_picture_last_view_user'],
  
"image_last_view_date" => $image_last_view_date,
  
"image_last_view_time" => $image_last_view_time,
  
"image_last_view_who" => $image_last_view_who,
// ---------  MOD TOP 100   ----------


  
"lang_file_size" => $lang['file_size']
));

$site_template->print_template($site_template->parse_template($main_template));
include(
ROOT_PATH.'includes/page_footer.php');
?>



Danke euch schon mal!

Title: Re: [MOD] Top 100
Post by: fasciatus1 on March 11, 2009, 06:32:16 PM
How to change the link "top.php" for "top100.php?

I don't want to have 2 top list!

Only one!
And of course, top100!  :D
Title: Re: [MOD] Top 100
Post by: rinaldos on March 13, 2009, 07:24:02 AM
How to change the link "top.php" for "top100.php?
I don't want to have 2 top list!

You have to change every Template. Find in your template:

<td align="right">
<a href="{url_top_images}"><b>{lang_top_images}</b></a>&nbsp;
<a href="{url_new_images}"><b>{lang_new_images}</b></a>&nbsp;
</td>


and change it to this

<td align="right">
<a href="{url_top100}"><b>{lang_top100}</b></a>&nbsp;
<a href="{url_new_images}"><b>{lang_new_images}</b></a>&nbsp;
</td>



You have to remove this in user_logininfo.html an user_loginform.html Step 5 and Step 6

&raquo; <a href="{url_top100}">{lang_top100}</a>


Gruß
Ingo


Title: Re: [MOD] Top 100
Post by: fasciatus1 on March 13, 2009, 03:56:59 PM
OK, thanks!!

And one more thing.

Is it possible to show the owner of the top 100 pictures?
In this mod show many things, but de owner of the picture?

Thank you!
Title: Re: [MOD] Top 100
Post by: rinaldos on March 13, 2009, 04:04:17 PM
Yes it is possible, but one more row in the table needs a complete redesign. Maybe I do a redesign later on :-)

Gruß
Ingo
Title: Re: [MOD] Top 100
Post by: crs on April 11, 2009, 05:24:26 PM
Hi, ich habe alles problemlos hinbekommen.
Nur die Thumbs sind doch etwas sehr klein.

Könnte mir jemand helfen die etwas größer zu bekommen!
Ich könnte auch in der Liste auf das Uploaddatum und die Kategorie verzichten um meht Platz zu haben.

Gruß Cocker

I also want to know, how i can show the thumbnails in the original size or in a bigger size.

Thanks for help.
Title: Re: [MOD] Top 100
Post by: rinaldos on April 13, 2009, 02:20:36 PM
Code Update 18.04.2009
In der Sektion Settings der TOP100.php können die Spalten aktiviert / deaktiviert werden. Die Thumbnailgrösse ist nun individuell einstellbar.
 
 Folgende Möglichkeiten sind nun gegeben.

  THUMBNAILGRÖSSE:
  $thumb_size = 48;

  Spalten die nun aktiviert bzw. deaktiviert werden können. 0 = deaktiviert 1 = aktiviert
  $top_100_pos_activate = "1"; // Picture Position
  $top_100_picture_activate = "1"; // Thumbnail
  $top_100_picture_id_activate = "0"; // Picture ID
  $top_100_picture_user_name_activate = "0"; // USER NAME
  $top_100_picture_user_name_below_activate = "0"; // Username below Thumbnail
  $top_100_picture_name_activate = "1"; // Picture Name
  $top_100_picture_cat_activate = "1";  // Cat Name
  $top_100_picture_date_activate = "1"; // Picture Date (Upload Date)
  $top_100_picture_hits_activate = "1";  // Picture Hits
  $top_100_picture_votes_activate = "1"; // Picture Votes
  $top_100_picture_rating_activate = "1";  // Picture ratings
  $top_100_picture_downloads_activate = "1";  // Picture downloads
  $top_100_picture_comment_activate = "1";  // Picture Comments
  $top_100_picture_last_view_activate = "1";  // Picture last view
  $top_100_picture_last_view_who_activate = "1";  // Picture seen by

Die neue top100.php wurde im ersten Posting eingefügt.
Title: Re: [MOD] Top 100
Post by: fasciatus1 on April 21, 2009, 04:50:15 PM
Thanks!!

Good! update!

But,   I see that the table "image last view" and "image last view who" makes very slow the web.

How can I disable this tables?
But the rest of the mod I'd like to run!!

Is it possible?

Thanks.
Title: Re: [MOD] Top 100
Post by: rinaldos on April 21, 2009, 05:20:40 PM
@fasciatus1
I don't think so, that the two upgrades makes the web slowly.

If you like, do not insert the modifications in details.php.

And then set these values to "0"

$top_100_picture_last_view_activate = "1";  // Picture last view
$top_100_picture_last_view_who_activate = "1";  // Picture seen by

I think thats all. Now the tables "image last view" and "image last view who" won't show and no updates were made in the database by details.php.

Gruß

Ingo
Title: Re: [MOD] Top 100
Post by: rinaldos on April 29, 2009, 01:41:53 PM
Codeupdate for this MOD, fixed the numbering of Positions, if you show more the 100 Images ....
Version 1.3.1 is online and added into the first post.


Gruß
Ingo
Title: Re: [MOD] Top 100
Post by: Sebas Bonito on June 24, 2009, 03:45:16 PM
Compatible-error between this MOD (http://www.4homepages.de/forum/index.php?topic=23055.0) and [MOD] Google Friendly Urls (http://www.4homepages.de/forum/index.php?topic=17598.0)

I don't know why... The part is obviously this one in the details.php:
Quote
// ---------  MOD TOP 100   ----------
$image_last_view_date = format_date($config['date_format'],$image_row['image_last_view']);
$image_last_view_time = format_date($config['time_format'],$image_row['image_last_view']);
$image_last_view_who = $image_row['image_last_view_who'];
// ---------  MOD TOP 100   ----------
My server gave me this hint (error-log)... I deleted this part, and now it works. Anybody knows why?
In my top100.php I only use the "hits", so there are no negatives or errors on my site after deleting this part.
Title: Re: [MOD] Top 100
Post by: satine88 on July 03, 2009, 11:25:43 PM
Compatible-error between this MOD (http://www.4homepages.de/forum/index.php?topic=23055.0) and [MOD] Google Friendly Urls (http://www.4homepages.de/forum/index.php?topic=17598.0)

I don't know why... The part is obviously this one in the details.php:
Quote
// ---------  MOD TOP 100   ----------
$image_last_view_date = format_date($config['date_format'],$image_row['image_last_view']);
$image_last_view_time = format_date($config['time_format'],$image_row['image_last_view']);
$image_last_view_who = $image_row['image_last_view_who'];
// ---------  MOD TOP 100   ----------
My server gave me this hint (error-log)... I deleted this part, and now it works. Anybody knows why?
In my top100.php I only use the "hits", so there are no negatives or errors on my site after deleting this part.

Me too :(
Title: Re: [MOD] Top 100
Post by: rinaldos on July 04, 2009, 09:47:37 AM
Hi

What kind of error do you get?

Ingo
Title: Re: [MOD] Top 100
Post by: satine88 on July 04, 2009, 02:38:22 PM
Hi

What kind of error do you get?

Ingo

Error :

Code: [Select]
Parse error: syntax error, unexpected ';' in /home/www/5079565f25315af9bcd81d8cc489f6ec/web/details.php on line 61
line 61 :
$image_last_view_date = format_date($config['date_format'],$image_row['image_last_view']);
Title: Re: [MOD] Top 100
Post by: rinaldos on July 04, 2009, 02:59:25 PM
Please post 10 line before and ten lines after, maybe there is an error before :-) Because line 61 is correct ......
Title: Re: [MOD] Top 100
Post by: satine88 on July 04, 2009, 03:09:42 PM
Ok :)

Code: [Select]
52 :
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_last_view, i.image_last_view_who, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email")."
        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_id = $image_id AND i.image_active = 1 AND c.cat_id = i.cat_id";
$image_row = $site_db->query_firstrow($sql);
$cat_id = (isset($image_row['cat_id'])) ? $image_row['cat_id'] : 0;
$is_image_owner = ($image_row['user_id'] >

// ---------  MOD TOP 100   ----------
$image_last_view_date = format_date($config['date_format'],$image_row['image_last_view']);
$image_last_view_time = format_date($config['time_format'],$image_row['image_last_view']);
$image_last_view_who = $image_row['image_last_view_who'];
// ---------  MOD TOP 100   ----------

USER_AWAITING && $user_info['user_id'] == $image_row['user_id']) ? 1 : 0;

if (!check_permission("auth_viewcat", $cat_id) || !check_permission("auth_viewimage", $cat_id) || !$image_row) {
  redirect($url);
}

$random_cat_image = (defined("SHOW_RANDOM_IMAGE") && SHOW_RANDOM_IMAGE == 0) ? "" : get_random_image($cat_id);
$site_template->register_vars("random_cat_image", $random_cat_image);
unset($random_cat_image);
-- 74
Title: Re: [MOD] Top 100
Post by: rinaldos on July 04, 2009, 03:23:29 PM
You have not correctly insert the Code. The posted LINE 8 should not be

$is_image_owner = ($image_row['user_id'] >


Maybe it should be like:

$is_image_owner = ($image_row['user_id'] > USER_AWAITING && $user_info['user_id'] == $image_row['user_id']) ? 1 : 0;



You have insert the code into these Line .... You see the little Mistake?


This is the correct Version!

$is_image_owner = ($image_row['user_id'] > USER_AWAITING && $user_info['user_id'] == $image_row['user_id']) ? 1 : 0;
// ---------  MOD TOP 100   ----------
$image_last_view_date = format_date($config['date_format'],$image_row['image_last_view']);
$image_last_view_time = format_date($config['time_format'],$image_row['image_last_view']);
$image_last_view_who = $image_row['image_last_view_who'];
// ---------  MOD TOP 100   ----------



Gruß

P.S. I have seen the mistake in the first POST and corrected the line. My Mistake :-(
Title: Re: [MOD] Top 100
Post by: satine88 on July 04, 2009, 03:29:55 PM
Yes  :D

Thanks !!!  :wink:

EDIT :

Hello,
What can you modif the urls that this mod is compatible with http://www.4homepages.de/forum/index.php?topic=17598.0  :?: :?:
Title: Re: [MOD] Top 100
Post by: Hagen-Roderich on August 04, 2009, 08:33:27 AM
Hallo,
toller MOD (auch wenn ich nur einen kleinen Teil davon nutze).
Wie kann man die Hintergrundfarbe in den Ergebnisfeldern ändern? Ich habe schon "white" gegen "black" getauscht, aber das ändert nur den Hintergrund vom "mainframe".

Danke
Title: Re: [MOD] Top 100
Post by: rinaldos on August 04, 2009, 10:14:55 AM
Guten Morgen :-)
Du kannst die Farbwerte in der datei styles.css ändern. Nimm einfach andere Werte für die Definitionen commentrow1 und commentrow2. Sollte dir das nicht gefallen kannst du auch eigene Klassen in der styles.css anlegen. Du musst dann nur in der top100.php alles was commentrow / commentrow1 heisst gegen deine neuen Variabeln austauschen :-)

LG
Ingo
Title: Re: [MOD] Top 100
Post by: Hagen-Roderich on August 04, 2009, 12:28:54 PM
Danke, hat wunderbar funktioniert.
Title: Re: [MOD] Top 100
Post by: Markus/TSC on January 31, 2010, 07:54:34 PM
Hallo!

Ich habe ein Problem mit dem MOD. Er hat die ersten Tage nach Einbau wunderbar funktioniert, aber jetzt sind die Auswahlmöglichkeiten wonach man sortieren kann weg und werden nicht mehr dargestellt (siehe Bild im Anhang). Desweiteren ist auch aus dem Link (roter Kreis links) die Schrift "Top100" weg???

Worin kann das Problem liegen? Ich habe nur an den Formatierungen der Tabellen etwas verändert?!?!

Gruß

Markus
Title: Re: [MOD] Top 100
Post by: rinaldos on January 31, 2010, 09:43:19 PM
Hi,
da hast du den MOD wegformatiert :-) Einfach deine formatierungen wieder rückgängig machen, und dann klappt es auch wieder. Musst eben aufpassen, das auch alle Tabellen < table > und < td > < tr > auch geschlossen werden. Sobald du eine übersiehst, kommt schnell ein Kuddelmuddel raus ...

Gruß
Title: Re: [MOD] Top 100
Post by: tramfahrer on February 15, 2010, 10:26:33 PM
Hallo, habde den Mod nach Seite 1 eingebaut alles schritt für Schritt durchgegangen, nun erhalte ich aber eine Fehlermeldung bim Upload von Dateien....

DB Error: Bad SQL Query: INSERT INTO 4images_images (cat_id, user_id, image_name, image_description, image_keywords, image_date, image_active, image_media_file, image_thumb_file, image_download_url, image_allow_comments) VALUES (16, 1, 'Testbild', 'da issn NGT zu sehen ', 'Keywords', 1266264986, 1266264986, 1, 'IMG_2315_2.jpg', 'IMG_2315_2.jpg', '', 1)
Column count doesn't match value count at row 1


woran kann das jetz liegen ?? Bitte um Hilfe .....
www.tram-und-bahnbilder.de

Gruß
Tobias
Title: Re: [MOD] Top 100
Post by: rinaldos on February 15, 2010, 11:04:20 PM
Hi,
hast du auch Schritt 1 ausgeführt?

Gruß
Title: Re: [MOD] Top 100
Post by: tramfahrer on February 15, 2010, 11:13:34 PM
ja habe ich  alles schritt für schritt ....

Title: Re: [MOD] Top 100
Post by: rinaldos on February 16, 2010, 12:22:56 AM
du musst irgendetwas in deiner member.php verändert haben. Beim Upload versucht er einen Wert mehr in die Datenbank zu schreiben als Felder da sind. Da die top100 nichts mit dem Upload zutun hat, kann es nun nicht an dem MOD liegen. Schau doch mal was du sonst noch geändert hast. GGF melde dich mal via PN

Gruß
Title: Re: [MOD] Top 100
Post by: tramfahrer on February 16, 2010, 06:00:20 AM
habe eben schnell die Änderungen weggemacht, der upload geht wieder ohne Probleme hmmm

im Anhang meine Member.PHP ...

ein Problem hbe ich da aber noch gefunden:
http://www.tram-und-bahnbilder.de/img2225.htm  man sieht nicht die Hinweise: zuletzte gesehen von, und zulest gesehen am  die zeigt er auch nicht an obwohl das in den beiden Sprachdateien eingefügt wurde ....

Grüße
TObias
Title: Re: [MOD] Top 100
Post by: Rembrandt on February 16, 2010, 06:03:32 AM
Hi!
@rinaldos, in step 9.) und10.) jeweils die letzte zeile im eg post.
 ist das korrekt das dort "$image_date" b.z.w. "$current_time" jeweils doppelt vorkommen?

mfg Andi
Title: Re: [MOD] Top 100
Post by: tramfahrer on February 16, 2010, 06:16:44 AM
Darüber bin ich auch drüber gestolpert, ...  vllt is das der Grund
Title: Re: [MOD] Top 100
Post by: rinaldos on February 16, 2010, 09:43:08 AM
Eigentlich ist das Korrekt, denn es wird das Datum des letzten Besuches auf das "image_date" gesetzt. Ich habe ja auch zusätzlich das Feld image_last_view drin. Aber er sagt ja auch beim Upload in welcher Datei die Fehlermeldung kommt, und ich bin nun nicht von der Datei checkimages ausgegangen.
Wo genau, kommt nun welcher Fehler?

Gruß
Title: Re: [MOD] Top 100
Post by: tramfahrer on February 16, 2010, 09:18:29 PM
Sobald ich deinen Mod in der member.php einbaue gehen die Uploads nicht mehr ...

habe vorhin die unbearbeitete member.php hochgeladen, ist da evtl ein mod mit bei der mit dem Top 100 kollidieren könnte ??

der andere Fehler ist der, in der Bilderdetailansichtansicht dass die

Code: [Select]

<tr class="row2">
 <td valign="top" class="smalltext" width="295" ><b>{lang_top_100_picture_last_view_date}</b></td>
 <td valign="top" class="smalltext">{image_last_view_date} {image_last_view_time}</td>
</tr>
<tr class="row1">
 <td valign="top" class="smalltext" width="295" ><b>{lang_top_100_picture_last_view_user}</b></td>
 <td valign="top" class="smalltext">{image_last_view_who}</td>
</tr>


{lang_top_100_picture_last_view_user} zum Beispiel nicht angezeigt werden, obwohl die in den Sprachdateien eingefügt wurden ....
Title: Re: [MOD] Top 100
Post by: Sun on March 18, 2010, 02:13:52 PM
2 little error in top100.php

1. here valign=\"middle\" write two times in two places:
Code: [Select]
  if ($top_100_picture_user_name_below_activate == 1) {
  $toplist .= "<td  valign=\"middle\" align=\"center\" valign=\"middle\">".$image."<br>".$user_name."</td>\n";
  $top_100_picture_activate = "0";
  }
  if ($top_100_picture_activate == 1) {
  $toplist .= "<td  valign=\"middle\" align=\"center\" valign=\"middle\">".$image."</td>\n";
  }

2. 'alt' is not for tag <a>, i will change it for 'title'

Code: [Select]
$cat_name = "<a href=\"".ROOT_PATH."categories.php?cat_id=".$row['cat_id']."\" alt=\"".$row['cat_name']."\">".$cat_name_small."</a>";
and for image_name i add 'title'

Code: [Select]
$image_name = "<a href=\"".ROOT_PATH."details.php?image_id=".$row['image_id']."\" title=\"".$row['image_name']."\">".$image_name_small."</a>";
Title: Re: [MOD] Top 100
Post by: surferboy on April 21, 2010, 04:53:10 AM
Hi -

Thanks for the great MOD!  The installation has gone well. Using v.1.7.7

Some issues to report:

Problem 1:  In the details.html, for the language for the fields {lang_top_100_picture_last_view_date} and {lang_top_100_picture_last_view_user} does not appear although the data for the fields {image_last_view_date} {image_last_view_time} and {image_last_view_who} does appear so I know my paste is correct, and the colors do work.  

checked the details.php and here is the code:
Quote
$site_template->register_vars(array(
  "msg" => $msg,
  "clickstream" => $clickstream,
  "lang_category" => $lang['category'],
  "lang_added_by" => $lang['added_by'],
  "lang_description" => $lang['description'],
  "lang_keywords" => $lang['keywords'],
  "lang_date" => $lang['date'],
  "lang_hits" => $lang['hits'],
  "lang_downloads" => $lang['downloads'],
  "lang_rating" => $lang['rating'],
  "lang_votes" => $lang['votes'],
  "lang_author" => $lang['author'],
  "lang_comment" => $lang['comment'],
  "lang_prev_image" => $lang['prev_image'],
  "lang_next_image" => $lang['next_image'],
// ---------  MOD TOP 100   ----------
  "lang_top100_picture_last_view_date" => $lang['top_100_picture_last_view_date'],
  "lang_top100_picture_last_view_user" => $lang['top_100_picture_last_view_user'],
  "image_last_view_date" => $image_last_view_date,
  "image_last_view_time" => $image_last_view_time,
  "image_last_view_who" => $image_last_view_who,
// ---------  MOD TOP 100   ----------
  "lang_file_size" => $lang['file_size']

and here is the main.php code:

Quote
$lang['top_100_picture_last_view_date'] = "Most recently viewed on:";
$lang['top_100_picture_last_view_user'] = "Most recent viewer:";

any ideas?

Problem 2: With version 1.7.7, the details.html for row1 and row2 data list has a default format that is different than your provided code.

Resolution: update your MOD instructions to match this:
Quote
<tr>
                          <td valign="top" class="row2"><b>{lang_top_100_picture_last_view_date}</b></td>
                          <td valign="top" class="row2">{image_last_view_date} {image_last_view_time}</td>
                          </tr>
                          <tr>
                          <td valign="top" class="row1"><b>{lang_top_100_picture_last_view_user}</b></td>
                          <td valign="top" class="row1">{image_last_view_who}</td>
                          </tr>

Problem 3: The Top 100 Downloads returns this: Found: 0 image(s) on 0 page(s). Displayed: image 0 to 0. which is correct and yet it still displays 25 pics although there is no page counter.  I thought the MOD would return whatever the result was, so if 0, then it would just say 0.

Problem 4: The Top 100 Last Viewed is not a top 100, as you say, but soon we'll have upwards of 5,000 + pics. Is there any way to limit this number? Maybe to a 100? :))

Correction to MOD instructions:
in your main.php english file, your last two lines, 26 and 27, are still in german:
Quote
$lang['top_100_url_view']  = "zuletzt angesehen";
$lang['top_100_url_rating'] = "Top100 Bewertung";

Resolution: May I offer this fix:
Quote
$lang['top_100_url_view']  = "Top100 Recently Viewed";
$lang['top_100_url_rating'] = "Top100 Rated";

A formatting Issue: The column widths do not enlarge/shrink as some of the columns are disabled.  On your demo site, which is gorgeous, the columns are nice and tight and just wide enough for the data. How can we achieve that with the MOD you created?

A Humble Request: Is there anyway to add a link to the username that appears under the thumbnail? I have done this with the username in the comments and shoutbox but it would be so killer to have that link on the top 100 as well.

Thanks for your help and input, if you can offer any insight.

- Brian

Title: Re: [MOD] Top 100
Post by: rinaldos on April 21, 2010, 05:36:13 AM
Hi,
thanks for your statement. It's an very old MOD, so I have forgot this POST :-)

I started with Problem 2, its easier ....

This is not a bug, its a Designfeature :-) Everybody has another Design, so it is no Problem to change this for everybody .... (I think)

Problem 4.
Thats right, you can change this line:
In section you find another $max_picture = 1000; Comment it out with "//". Then the section uses the Variabel from the top of .....
The same in section LAST VIEW SEARCHBOT, there is $max_picture = 5000 . Maybe these are some rests from my testing code.

I call it an undokumentet feature ;-)

Problem 1/3:
Don't know, why no Pictures are shown. I used the original code from this MOD and its working on my site

Please give me an url, to take a look :-)





Title: Re: [MOD] Top 100
Post by: surferboy on April 21, 2010, 05:58:52 AM
Hi -

I literally figured out the solution to Problem 1 in the shower. Truly!  I just toweled off and came in and checked and yes, the problem is in the MOD instructions. Here it is:

in the details php, you instruct this:

Quote
// ---------  MOD TOP 100   ----------
  "lang_top100_picture_last_view_date" => $lang['top_100_picture_last_view_date'],
  "lang_top100_picture_last_view_user" => $lang['top_100_picture_last_view_user'],
  "image_last_view_date" => $image_last_view_date,
  "image_last_view_time" => $image_last_view_time,
  "image_last_view_who" => $image_last_view_who,
// ---------  MOD TOP 100   ----------

but in the details html, you instruct this:

Quote
<tr class="row2">
 <td valign="top" class="smalltext" width="295" ><b>{lang_top_100_picture_last_view_date}</b></td>
 <td valign="top" class="smalltext">{image_last_view_date} {image_last_view_time}</td>
</tr>
<tr class="row1">
 <td valign="top" class="smalltext" width="295" ><b>{lang_top_100_picture_last_view_user}</b></td>
 <td valign="top" class="smalltext">{image_last_view_who}</td>
</tr>

so the problem was to delete the underscore between top and 100 in the details.html.

As for problem 3, I have no idea... and now I will look at fixing the code in top100.php as you suggest.

Thanks,

Brian
Title: Re: [MOD] Top 100
Post by: rinaldos on April 21, 2010, 07:01:53 AM
you are right, i did not see the underscore :-) It is very early in Germany :-) Thanks for this. I will fix it in the description ....
Title: Re: [MOD] Top 100
Post by: surferboy on April 21, 2010, 09:31:00 AM
Hi -

Thanks so much for taking the time to get back to me. I modified the max=### in top100.php and that took care of most of it. not sure why the downloads are still showing as they are.  Another issue - hits show 25 images and the paging sequence; votes list 8 images but only show 7; rated list 8 images but only show 7; downloads list 0 images but show 25; last view list 13 images but only 12 show;  will PM you site access.

but if you get a chance, if you have any thoughts on these other two issues, I'd love to know as well:

A formatting Issue: The column widths do not enlarge/shrink as some of the columns are disabled.  On your demo site, which is gorgeous, the columns are nice and tight and just wide enough for the data. How can we achieve that with the MOD you created?  You'll see the file name doesn't expand and the category name doesn't expand even though there is room.

A Humble Request: Is there anyway to add a link to the username that appears under the thumbnai or change the link of the thumbnaill from opening a new image and instead opening the user upload profile? I have done this with the username in the comments and shoutbox but it would be so killer to have that link on the top 100 as well.

Also, I sent you a PM as well asking about using the highslide for only certain thumbnails. Not sure quite how to do that.  I went to the Highslide MOD and found that you said you could only have the thumbnails active on some pages depending on how you code the templates, but I think that's for the main picture in the details page.

Hope the weather is nice in Germany.

It's overcast in Los Angeles these days. We call it 'June Gloom.'

- Brian

[UPDATE]

I decided to use the Tooltip Mod instead of the Highslide because I really want to encourage our community to open the details and make comments. Having the Highslide, although super sexy, may deter folks from moving towards the details page.

I decide to copy,cut, and paste the link in the user_name in the top100.php file into the link for the image so that when folks click on it, they will be taken to the details page, thereby providing more and more gentle nudging to get them to comment.

About the formatting of the columns, it was a cold, gloomy day [well, still is] in Los Angeles so I stayed at the computer most of the day doing some trial and error ,and V@no I hope will be please, looking up some php code definitions. I was able to adjust the 'substr' code around the the user_image_small from 0, 8 to 0, 40 and then delete the three periods in the quotes to make the columns fill in nicely and see the full titles of the image names and the category names.  I also used the php code for specifiying the column width for the most viewed and that helped round out the look.

So the errant code of the 8 images but only 7 are listed remains as well as the listing of 25 pics for the top 100 downloads when the pageing says zero but not a huge deal. Let me know if you have any ideas.

Thanks.
Title: Re: [MOD] Top 100
Post by: satine88 on August 21, 2010, 10:05:54 PM
Hello
How do I set Google and other search engines will not index the links module TOP 100?
For he can not rewrite url but details.php? Image_id = 25802

Can you help me?
Thank you
Title: Re: [MOD] Top 100
Post by: satine88 on August 25, 2010, 04:03:32 PM
Hello
How do I set Google and other search engines will not index the links module TOP 100?
For he can not rewrite url but details.php? Image_id = 25802

Can you help me?
Thank you

Hello
Nobody has any idea?

Thank you for your help
Title: Re: [MOD] Top 100
Post by: satine88 on August 31, 2010, 05:10:47 PM
Up :)
Title: Re: [MOD] Top 100
Post by: Hagen-Roderich on September 01, 2010, 05:02:26 PM
Up :)

Point 8 => http://www.4homepages.de/forum/index.php?topic=3914.0  :wink:
Title: Re: [MOD] Top 100
Post by: satine88 on September 01, 2010, 11:42:43 PM
Sorry, but that the subject is important for me, I just wished to show that I still have problem
Title: Re: [MOD] Top 100
Post by: V@nо on September 02, 2010, 01:15:25 AM
maybe through robots.txt (http://www.robotstxt.org/) ?

Or in top100.php find:
  $site_template->register_vars("toplist", $toplist);

Insert above :above::
  $toplist = str_replace('<a href="', '<a rel="nofollow" href="', $toplist);


If you don't want them visit top100 at all, then add rel="nofollow" into link in user_login.html and user_loginform.html templates.
Title: Re: [MOD] Top 100
Post by: satine88 on September 02, 2010, 12:01:52 PM
V @ no thank you very much!
My problem is now solved:)
Title: Re: [MOD] Top 100
Post by: MrAndrew on September 28, 2011, 09:30:25 AM
Step 3 from first post need to be correct:

by this line:

$user_name_who = GUEST;
Title: Re: [MOD] Top 100
Post by: V@no on September 28, 2011, 02:16:06 PM
Technically username cannot be blank, therefore that line never get executed anyhow...
Title: Re: [MOD] Top 100
Post by: Niedersachse on April 15, 2019, 04:33:01 PM
Hallo verbliebene 4images Begeisterte 8)

Vielfach habe ich die Tipps und Mods nutzen können, um meine Galerie nach meinem Geschmack anzupassen. Gerne würde ich auch die "Top-100" einbinden, aber hier werden ja scheinbar in der Datenbank noch zusätzliche Einträge generiert. Da ich die v1.8 nutze und der letzte Hinweis für ein upgrade dieses Mods aus 2009 stammt bin ich in diesem Fall ein wenig vorsichtiger, ob dieser Mod auch für meine Version der 4images funktioniert? Im Falle, dass ich meine DB zerschieße wäre ich ziemlich hilflos, da ich mich mit mysql & Co nicht wirklich auskenne.

Vielen Dank für eine Rückmeldung!

LG

Niedersachse
Title: Re: [MOD] Top 100
Post by: Jasi on April 15, 2019, 04:43:04 PM
Hallo Niedersachse,

Mittelfranken is calling…

du kannst den Top100 Mod auch in die 1.8 einpflanzen ;-) Läuft, ich hab ihn in die 1.8 integriert.
https://pictureworld24.de/archiv18/index.php (https://pictureworld24.de/archiv18/index.php)

Sichere dir auf alle Fälle zuvor deine 4images und die dazugehörige Datenbank.

Grüße Jasi
Title: Re: [MOD] Top 100
Post by: Niedersachse on April 15, 2019, 09:10:13 PM
Hallo Jasi,

vielen Dank für Deine schnelle Antwort. Ist dann ab sofort in meine "todo"-Liste aufgenommen worden :)

Herzliche Grüße nach Mittelfranken

Niedersachse

PS: Hast eine sehr ansprechende Seite gebaut mit einer sehr freundlichen Farbgebung. Werde Dich dort sicherlich demnächst besuchen und mal schaun, was Du sonst so alles "out of the box" implementiert hast ...
Title: Re: [MOD] Top 100
Post by: Jasi on April 15, 2019, 09:45:14 PM
Hallo Niedersachse,

erst einmal danke für deine PN, dass Netz läuft uns nicht weg, im Gegensatz zum Support hier!

Wollte nicht drängen, war mir nur nicht sicher ob du es mitbekommen hast, dass ich relativ schnell geantwortet hatte.

Familie, Job und der tgl. Wahnsinn haben Vorrang.

Ich hab eigentlich nicht wirklich vor dort eine Galerie aufzuziehen mit 4images. Hatte es eher als Testbase eben genau für solche Experimente genommen, ob die guten alten Modis auch größtenteils in der V1.8 (die ja auch schon wieder 2 Jahre alt ist, PHP 7.2 ist inzwischen angesagt und die V1.8 kann soweit ich mitbekommen habe nur bis PHP 7).
Hatte mir zwar die Arbeit gemacht 201 Galerien (Kategorien) manuell anzulegen und nun bräuchte es nur je Kategorie das erste Bild um das dieses dann autom. als Kategorienbild erscheint.

https://pictureworld24.de/pictures/ (https://pictureworld24.de/pictures/) da geht die easy Post ab. Ein paar Modifikation installiert, geht alles über den Adminbereich, da wählst die Modifikation aus und Klick auf INSTALLIEREN und fertig. Man kann jede Modi (eigentlich Plugin oder Style im Adminbereich auch wieder deaktivieren wenn man es nicht mehr braucht. Ist SAUSCHNELL das Teil und kostenlos. Dagegen ist 4images Steinzeit.

Jedoch habe ich 4images schon seit 12 Jahren immer mal wieder in Betrieb und komme einfach nicht davon los. Ist halt nur immer eine menge Arbeit die Mods einzubauen.

Ich bekommen für diesen Thread oder wenn jemand eine PN sendet, immer eine Mailnachricht. Also falls ich irgendwo helfen kann? Den Style gabs es übrigens vor Jahren schon kostenlos den ich auf der 4images V1.8 laufen habe. Kann dir das zip-Filchen senden.

Wir sehen und lesen uns, schönen Restabend und gutes Gelingen
Jasi