-
Vorwort :- Mit diesem MOD kann die Anzahl der versendeten Postkarten pro Bild auf der Detailseite und
die insgesamt von der Website versendeten Postkarten z.B. in Statistiken ausgegeben werden. - Bei diesem MOD handelt es sich um eine "Wiederveröffentlichung" mit meinen Kommentaren und Erweiterungen.
- Das Original wurde 2003 von Cr@zy Sash veröffentlicht und ist seit dem Forum-Hack verloren ...
- Aus Fragmenten auf meiner Platte und auf besonderen Wunsch ( hier ) versuche ich nun die "republication" .
-
Preface :- With this MOD the number of dispatched postcards per picture can shown on detail page and
all from the Website dispatched postcards can shown e.g. in statistics. - This MOD is a "republication" with my comments and extensions.
- The original was published 2003 by Cr@zy Sash and is lost since the forum-hack ...
- From fragments on my PC and on special desire ( here ) I try now a "republication".
/
-
Version :- 12.12.2007 - Version 1.0 - Bugfix Größe Thumbnails in Top10
- 18.09.2006 - Version 1.0 - Top10-Erweiterung php5-kompatibel
- 28.02.2006 - Version 1.0 - Top10-Erweiterung
- 30.12.2005 - Version 1.0 - English MOD translation
- 15.11.2005 - Version 1.0 - Veröffentlichung
-
Dateien die zu ändern sind : -
Files to change are :- details.php
- postcards.php
- includes/functions.php
- templates/<your_template>/details.html
- lang/<your_language>/main.php
-
Installation :WICHTIG : Mache vor der Installation von den genannten Dateien ein Backup. Zusätzlich auch von deiner DB, da es auch hier eine Veränderung geben wird. Nur zur eigenen Sicherheit und nicht dass keiner das Selbstverständliche nochmals erwähnt hätte ... .
-
Installation :IMPORTANT : Before the installation make a backup of the files. Additionally also of your database, there is also a change needed. Only for your own security ....
-
1. SchrittÖffne die Datei
details.php sowie die Datei
search.php und finde :
-
1. Step Open the file
details.php and also the file
search.php and find:
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, 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")."
- und ersetze in beiden Dateien dieses durch den folgenden Code :
- and replace in both files this by the following code :
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, 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, i.image_postcards".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email")."
- weiterhin finde :
- further find :
"lang_comment" => $lang['comment'],
- und füge darunter den folgenden Code ein :
- and insert below it the following code:
"lang_postcards" => $lang['postcards'],
-
2. SchrittÖffne die Datei
postcards.php und finde :
-
2. StepOpen the file
postcards.php and find:
$site_email->set_body("postcard_message", $config['language_dir']);
$site_email->send_email();
- und füge darunter den folgenden Code ein :
- and insert below the following code :
$sql = "UPDATE ".IMAGES_TABLE."
SET image_postcards = image_postcards + 1
WHERE image_id = $image_id";
$site_db->query($sql);
-
3. SchrittÖffne die Datei
includes/functions.php und finde :
-
3. StepOpen the file
includes/functions.php and find :
"image_downloads" => $image_row['image_downloads'],
- und füge darunter den folgenden Code ein :
- and insert below the following code :
"image_postcards" => $image_row['image_postcards'],
-
4. SchrittÖffne die Datei
lang/<deine_Sprache>/main.php und finde :
-
4. Step Open the file
lang/<your_language>/main.php and find:
//-----------------------------------------------------
//--- Postcards ---------------------------------------
//-----------------------------------------------------
- und füge darunter den folgenden Code ein :
$lang['postcards'] = "Postkarten:";
$lang['total_postcards'] = "Alle Postkarten:";
$lang['new_postcards'] = "Neue Postkarten:";
- and insert below the following code :
$lang['postcards'] = "Postcards:";
$lang['total_postcards'] = "All Postcards:";
$lang['new_postcards'] = "New Postcards:";
-
5. SchrittIn deinem Details-Template kannst du nun folgende Tags verwenden :
{lang_postcards} und
{image_postcards}Für das Standard-Template (und ähnliche) kann das wie folgt realisiert werden.
Öffne die Datei
templates/<dein_Template>/details.html und finde :
-
5. StepIn your detail-template you can now use the following tags :
{lang_postcards} and
{image_postcards}For the standard-template (and similar) that can be realized as follows.
Open the file
templates/<your_template>/details.html and find :
<tr>
<td valign="top" class="row1"><b>{lang_downloads}</b></td>
<td valign="top" class="row1">{image_downloads}</td>
</tr>
<tr>
<td valign="top" class="row2"><b>{lang_rating}</b></td>
<td valign="top" class="row2">{image_rating} ({image_votes} {lang_votes})</td>
</tr>
<tr>
<td valign="top" class="row1"><b>{lang_file_size}</b></td>
<td valign="top" class="row1">{image_file_size}</td>
</tr>
<tr>
<td valign="top" class="row2"><b>{lang_added_by}</b></td>
<td valign="top" class="row2">{user_name_link}</td>
</tr>
- und ersetze dieses durch den folgenden Code :
- and replace this by the following code :
<tr>
<td valign="top" class="row1"><b>{lang_downloads}</b></td>
<td valign="top" class="row1">{image_downloads}</td>
</tr>
<tr>
<td valign="top" class="row2"><b>{lang_postcards}</b></td>
<td valign="top" class="row2">{image_postcards}</td>
</tr>
<tr>
<td valign="top" class="row1"><b>{lang_rating}</b></td>
<td valign="top" class="row1">{image_rating} ({image_votes} {lang_votes})</td>
</tr>
<tr>
<td valign="top" class="row2"><b>{lang_file_size}</b></td>
<td valign="top" class="row2">{image_file_size}</td>
</tr>
<tr>
<td valign="top" class="row1"><b>{lang_added_by}</b></td>
<td valign="top" class="row1">{user_name_link}</td>
</tr>
-
6. Schritt- Datenbankerweiterung in der Tabelle '4images_images' um ein neues Feld ( 'image_postcards' ) mit einer Installations-Datei.
- Lade dir dazu die im Anhang befindliche postcards_install.php als Zip-Datei auf deinen PC.
- Entpacke die postcards_install.php und kopiere sie in dein Root-Verzeichnis von 4images.
- Zur Installation rufe die postcards_install.php in deiner Browser-Adress-Leiste auf und folge den Anweisungen.
( z.B. http:.//.yourhost.com/your4images/postcards_install.php ).
-
6. Step- Database extension in the table '4images_images' by a new field ( 'image_postcards' ) with an installation file.
- Download the postcards_install.php as zip file on your PC.
- Unpack postcards_install.php and copy it into your root directory of 4images.
- For installation calls up postcards_install.php in your Browser address bar and follow the instructions.
( eg. http:.//.yourhost.com/your4images/postcards_install.php ).
-
Fertig : ... In der Detailansicht der Bilder wird nun auch die Anzahl der mit dem jeweiligen Bild verschickten Postkarten (eCards) angezeigt.
-
Finish : ... In detail pages of the pictures is now also shown the number of postcards (eCards), sent away with the respective picture.
-
7. Statistik - Zusatz :Für die Verwendung in Statistik-MODs, d.h. für die Anzeige
aller und
aller neuen von der Website gesendeten Postkarten, können folgende SQL-Befehle / Codes verwendet werden. e.g. in den folgenden MODs ...
-
7. Statistics - Additive : For the use in statistics MODs, i.e. for showing of
all and
all new postcards sent from the website , the following SQL- instructions / codes can be used. E.G. into the following MODs...
-
7.1 Statistik - alle Postkarten -
7.1 Statistics - all postcards //-----------------------------------------------------
//--- Postcard - Counter - ALL ---
//-----------------------------------------------------
$sql = "SELECT SUM(image_postcards) AS sum
FROM ".IMAGES_TABLE;
$row = $site_db->query_firstrow($sql);
$sum = (isset($row['sum'])) ? $row['sum'] : 0;
$total_postcards = $row['sum'];
$lang_total_postcards = $lang['total_postcards'];
$site_template->register_vars("total_postcards", $total_postcards);
$site_template->register_vars("lang_total_postcards", $lang_total_postcards);
unset($total_postcards);
unset($lang_total_postcards);
- In dem entsprechenden Template können als Summe
aller Postkarten (Counter) die folgenden Tags verwendet werden.
- In the appropriate template the following tags can be used as sum of
all postcards (Counter).
{lang_total_postcards} {total_postcards}
- Und erzeugt die Anzeige z.B. so :
Alle Postkarten: 375 - And now the count is shown in such a way :
All Postcards: 375
-
7.2 Statistik - alle neuen Postkarten -
7.2 Statistics - all new postcards //-----------------------------------------------------
//--- Postcard - Counter - NEW ---
//-----------------------------------------------------
$new_postcard_cutoff = time() - 60 * 60 * 24 * $new_cutoff;
$sql = "SELECT COUNT(*) AS new_postcards
FROM ".POSTCARDS_TABLE."
WHERE postcard_date > ".$new_postcard_cutoff;
$row = $site_db->query_firstrow($sql);
$new_postcards = $row['new_postcards'];
$lang_new_postcards = $lang['new_postcards'];
$site_template->register_vars("new_postcards", $new_postcards);
$site_template->register_vars("lang_new_postcards", $lang_new_postcards);
unset($new_postcards);
unset($lang_new_postcards);
- In dem entsprechenden Template können dann als Summe
aller neuen Postkarten (Counter) die folgenden Tags verwendet werden.
- In the appropriate template the following tags can be used as sum of
all new postcards (Counter).
{lang_new_postcards} {new_postcards}
- Und erzeugt die Anzeige z.B. so :
Neue Postkarten: 12 - And now the count is shown in such a way :
New Postcards: 12
-
8. Top10 - Zusatz : - füge in deine
top.php den folgenden Code ein :
-
8. Top 10 - Additive :- insert in your
top.php the following code :
//--- Start Top10 nach Postkarten -----------------------------------------------
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_postcards, c.cat_name".get_user_table_field(", u.", "user_name").", i.image_thumb_file, i.image_media_file
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_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
$cat_match_sql
ORDER BY i.image_postcards DESC, i.image_name ASC
LIMIT 10";
$result = $site_db->query($sql);
$top_list = array();
$i = 1;
while ($row = $site_db->fetch_array($result)) {
$top_list[$i] = $row;
$i++;
}
$site_db->free_result();
for ($i = 1; $i <= 10; $i++) {
if (isset($top_list[$i])) {
if (empty($top_list[$i]['image_thumb_file'])) {
$thumb_file = ICON_PATH."/".get_file_extension($top_list[$i]['image_media_file']).".gif";
}else {
$thumb_file = (is_remote($top_list[$i]['image_thumb_file'])) ? $top_list[$i]['image_thumb_file'] : THUMB_PATH."/".$top_list[$i]['cat_id']."/".$top_list[$i]['image_thumb_file'];
}
}
if (isset($top_list[$i])) {
$register_array['image_postcards_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
$register_array['image_postcards_openwindow_'.$i] = (check_permission("auth_viewimage", $top_list[$i]['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".htmlspecialchars($top_list[$i]['image_name'])."</a>" : htmlspecialchars($top_list[$i]['image_name']);
if (isset($top_list[$i][$user_table_fields['user_name']]) && $top_list[$i]['user_id'] != GUEST) {
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $top_list[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$top_list[$i]['user_id'];
$register_array['image_postcards_user_'.$i] = "<a href=\"".$site_sess->url($user_profile_link)."\">".htmlspecialchars($top_list[$i][$user_table_fields['user_name']])."</a>";
}
else {
$register_array['image_postcards_user_'.$i] = $lang['userlevel_guest'];
}
$register_array['image_postcards_cat_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$top_list[$i]['cat_id'])."\">".htmlspecialchars($top_list[$i]['cat_name'])."</a>";
$register_array['image_postcards_number_'.$i] = "<b>".$top_list[$i]['image_postcards']."</b>";
$register_array['image_postcards_thumb_'.$i] = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$top_list[$i]['image_id'])."\"><img src=\"".$thumb_file."\" border=\"1\" vspace=\"3\" alt=\"\" />";
}
else {
$register_array['image_postcards_'.$i] = "--";
$register_array['image_postcards_user_'.$i] = "--";
$register_array['image_postcards_cat_'.$i] = "--";
$register_array['image_postcards_number_'.$i] = "--";
$register_array['image_postcards_thumb_'.$i] = "--";
}
}
//--- Ende Top10 nach Postkarten -----------------------------------------------
-
8.1 Top10 - Zusatz : - füge in deine
top.html die folgenden Tags ein :
-
8.1 Top 10 - Additive :- insert in your
top.html the following tags :
{image_postcards_thumb_1}
{image_postcards_1}
{image_postcards_user_1}
{image_postcards_cat_1}
{image_postcards_number_1}
.....
{image_postcards_thumb_10}
{image_postcards_10}
{image_postcards_user_10}
{image_postcards_cat_10}
{image_postcards_number_10}
Den MOD in Aktion findet ihr u.a. auch auf meiner Seite ...
You can find the MOD in action among others also on my website ...
mawenzi