Code Update 12.11.2008 thanks to Nickyhttp://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=hitsAddon with highslide
http://rinaldos.homeip.net/top100.php?action=hitsbenötigt dieses Addon
http://www.4homepages.de/forum/index.php?topic=20461.0in der top100.php findet Ihr schon die passenden Einträge, müssen nur auskommentiert werden.
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=hitsAddon with highslide
http://rinaldos.homeip.net/top100.php?action=hitsneed this Addon
http://www.4homepages.de/forum/index.php?topic=20461.0in the top100.php already find the matching entries, need only be commented.
folgende Dateien sind neu
following files are new
/top100_install.php (bitte nach dem ausführen löschen)
/top100.php
/templates/default/top100.html
folgende Dateien müssen geändert werden
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
1Logge dich als Admin ein und führe die Datei top100_install.php aus
Just login as admin and run the file from top100_install.php
added 29.10.2008 via phpmyadminoder via phpmyadmin
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 lade die folgenden Dateien hoch
upload the following files
top100.html -> /templates/default/top100.html
top100.php -> /top100.php
3öffne details.php
suche
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);
}
dahinter einfügen
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 ----------
suche
search
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description,
ersetze
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.2009suche
search
$is_image_owner = ($image_row['user_id'] > USER_AWAITING && $user_info['user_id'] == $image_row['user_id']) ? 1 : 0;
dahinter einfügen
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 ----------
suche
search
"lang_next_image" => $lang['next_image'],
dahinter einfügen
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 öffne includes/page_header.php
suche
open includes/page_header.php
search
"url_captcha_image" => $site_sess->url(ROOT_PATH."captcha.php"),
dahinter einfügen
insert below:
// --------- MOD TOP 100 ----------
"url_top100" => $site_sess->url(ROOT_PATH."top100.php?action=hits"),
// --------- MOD TOP 100 ----------
suche
search
"charset" => $lang['charset'],
dahinter einfügen
insert below:
// --------- MOD TOP 100 ----------
"lang_top100" => $lang['lang_top100'],
// --------- MOD TOP 100 ----------
5öffne templates/default/user_logininfo.html
suche
open templates/default/user_logininfo.html
search
» <a href="{url_logout}">{lang_logout}</a></td>
ersetze
replace
» <a href="{url_logout}">{lang_logout}</a><br />
» <a href="{url_top100}">{lang_top100}</a></td>
6öffne templates/default/user_loginform.html
suche
open templates/default/user_loginform.html
search
» <a href="{url_register}">{lang_register}</a></td>
ersetze
replace
» <a href="{url_register}">{lang_register}</a><br />
»<a href="{url_top100}">{lang_top100}</a></td>
7öffne lang/deutsch/main.php
suche
open lang/deutsch/main.php
search
?>
davor einfügen
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öffne lang/english/main.php
suche
open lang/english/main.php
search
?>
davor einfügen
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 öffne templates/default/details.html
suche
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>
dahinter einfügen
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 öffne admin/checkimages.php
suche
open admin/checkimages.php
search
(cat_id, user_id, image_name, image_description, image_keywords, image_date,ersetze
replace
(cat_id, user_id, image_name, image_description, image_keywords, image_date, image_last_view, suche
search
($cat_id, $user_id, '$image_name', '$image_description', '$image_keywords', $image_date,ersetze
replace
($cat_id, $user_id, '$image_name', '$image_description', '$image_keywords', $image_date, $image_date,10 öffne /member.php
suche 2mal
open /member.php
search 2times
(cat_id, user_id, image_name, image_description, image_keywords, image_date,ersetze
replace
(cat_id, user_id, image_name, image_description, image_keywords, image_date, image_last_view, suche 2mal
search 2times
($cat_id, ".$user_info['user_id'].", '$image_name', '$image_description', '$image_keywords', $current_time,ersetze
replace
($cat_id, ".$user_info['user_id'].", '$image_name', '$image_description', '$image_keywords', $current_time, $current_time,Gruß
Ingo