4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: Rembrandt on August 11, 2009, 06:58:02 PM
-
Hi!
mit diesen mod ist es möglich anzuzeigen, welcher user die letzten uploads gemacht hat.
angezeigt werden: datum, user, bildname, bild beschreibung, kategorie.
demo: demo.vienna-pictures (http://www.demo.vienna-pictures.com)
1.)search in index.php
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
add before:
//###################################### Start Mod Last Upload #################################################
$last_upload_num ="5"; // number e.g. 1,2,3,10,15,20,50,100... e.t.c
$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")."
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 c.cat_id = i.cat_id AND i.cat_id NOT IN (".get_auth_cat_sql("auth_viewcat", "NOTIN").")
ORDER BY i.image_date DESC
LIMIT $last_upload_num";
$result = $site_db->query($sql);
$last_upload = "<table style=\"width:".$config['image_table_width']."; border-style:none;\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"summary=\"new thumbs\">";
$last_upload .= "<tr class=\"imagerow2\">\n";
$last_upload .= "<td style=\"width:8%;text-align:center; \"><b>".$lang['date']."</b></td>\n";
$last_upload .= "<td style=\"width:12%;text-align:center; \"><b>".$lang['added_by']."</b></td>\n";
$last_upload .= "<td style=\"width:25%;text-align:center; \"><b>".$lang['image_name']."</b></td>\n";
$last_upload .= "<td style=\"width:40%;text-align:center; \"><b>".$lang['description']."</b></td>\n";
$last_upload .= "<td style=\"width:15%;text-align:center; \"><b>".$lang['category']."</b></td>\n";
$last_upload .= "</tr>\n";
$count = 0;
$bgcounter = 0;
while ($image_row2 = $site_db->fetch_array($result)){
$img_date = strftime ( '%d.%m.%Y',$image_row2['image_date']);
$row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
$last_upload .= "<tr class=\"imagerow".$row_bg_number."\">\n";
$last_upload .= "<td style=\"width:8%;text-align:center; \">".$img_date."</td>\n";
$last_upload .= "<td style=\"width:12%; \"><a href=\"./member.php?action=showprofile&user_id=$image_row2[user_id]\">".$image_row2[user_name]."</a></td>\n";;
$last_upload .= "<td style=\"width:25%; \"><a href=\"./details.php?image_id=$image_row2[image_id]\">".$image_row2[image_name]."</a></td>\n";
$last_upload .= "<td style=\"width:40%; \">".un_htmlspecialchars(format_text($image_row2['image_description']))."</td>\n";
$last_upload .= "<td style=\"width:15%; \"><a href=\"./categories.php?cat_id=$image_row2[cat_id]\">".$image_row2[cat_name]."</a></td>\n";
$count++;
if ($count == $last_upload_num) {
$last_upload .= "</tr>\n";
$count = 0;
}
} // end while
if ($count > 0) {
$leftover = ($last_upload_num - $count);
if ($leftover >= 1) {
for ($f = 0; $f < $leftover; $f++) {
$last_upload .= "<td style=\"width:".$imgtable_width."\">\n \n</td>\n";
}
$last_upload .= "</tr>\n";
}
}
$last_upload .= "</table>\n";
$site_template->register_vars("last_upload", $last_upload);
unset($last_upload);
//###################################### End Mod Last Upload #################################################
in home.html write wherever you want: {last_upload}
or for default_full templates:
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="head1">
<table width="100%" border="0" cellspacing="0" cellpadding="4">
<tr>
<td class="head1" valign="top">Last Upload</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="head1">{last_upload}</td>
</tr>
</table>
<br />
mfg Andi
-
... gefällt mir, wie immer auch deine Umsetzung und Präsentation, kann ich so direkt nach "Mods & Plugins (Releases & Support)" verschieben ...
... doch warum dieser Sprachsprung ... ;)
-
Schaut super aus und der Einbau klappt easy. Wer den Kategorie Namen angezeigt haben will sollte nur eine Zeile ändern.
$last_upload .= "<td style=\"width:8%;text-align:center; \"><a href=\"./categories.php?cat_id=$image_row2[cat_id]\">".$image_row2[cat_id]."</td>\n";
durch diese ersetzen
$last_upload .= "<td style=\"width:8%;text-align:center; \"><a href=\"./categories.php?cat_id=$image_row2[cat_id]\">".$image_row2[cat_name]."</td>\n";
Ich habe aber in Erinnerung das es soetwas ähnliches schonmal gab. Finde es nur auf Anhieb nicht.
LG
Ingo
-
Hi!
@rinaldos, das wollte ich eigentlich machen, habe es aber dann vergessen.
ist wahrscheinlich das Nitro, denn im moment habe ich die maler hinter mir :)
@mawenzi, ja ich bin mir selber noch nicht sicher wie ich für mich am einfachsten einen mod präsentiere,
b.z.w. das es die meisten verstehn,das ist bald mehr arbeit als der mod selber.
für den einbau und funktion ist die erklärung nicht so wichtig, glaube ich.
und 'add after' oder 'before' denke ich, verstehen auch die jenigen die nicht englisch können.
mfg Andi
-
Und das ganze statt mit Datum mit Thumb Image??
-
Hi!
Und das ganze statt mit Datum mit Thumb Image??
//###################################### Start Mod Last Upload #################################################
$last_upload_num ="6"; // number e.g. 1,2,3,10,15,20,50,100... e.t.c
$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")."
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 c.cat_id = i.cat_id AND i.cat_id NOT IN (".get_auth_cat_sql("auth_viewcat", "NOTIN").")
ORDER BY i.image_date DESC
LIMIT $last_upload_num";
$result = $site_db->query($sql);
$last_upload = "<table style=\"width:".$config['image_table_width']."; border-style:none;\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"summary=\"new thumbs\">";
$last_upload .= "<tr class=\"imagerow2\">\n";
$last_upload .= "<td style=\"width:8%;text-align:center; \"><b>".$lang['date']."</b></td>\n";
$last_upload .= "<td style=\"width:8%;text-align:center; \"><b>".$lang['added_by']."</b></td>\n";
$last_upload .= "<td style=\"width:25%;text-align:center; \"><b> </b></td>\n";
$last_upload .= "<td style=\"width:15%;text-align:center; \"><b>".$lang['image_name']."</b></td>\n";
$last_upload .= "<td style=\"width:30%;text-align:center; \"><b>".$lang['description']."</b></td>\n";
$last_upload .= "<td style=\"width:15%;text-align:center; \"><b>".$lang['category']."</b></td>\n";
$last_upload .= "</tr>\n";
$count = 0;
$bgcounter = 0;
while ($image_row2 = $site_db->fetch_array($result)){
$img_date = strftime ( '%d.%m.%Y',$image_row2['image_date']);
$row_bg_number = (++$bgcounter == 1) ? 1 : 2;
if ($bgcounter == 3){
$row_bg_number = 3;
$bgcounter = 0;
}
$last_upload .= "<tr class=\"imagerow".$row_bg_number."\">\n";
$last_upload .= "<td style=\"width:8%;text-align:center; \">".$img_date."</td>\n";
$last_upload .= "<td style=\"width:8%; \"><a href=\"./member.php?action=showprofile&user_id=$image_row2[user_id]\">".$image_row2[user_name]."</a></td>\n";;
$last_upload .= "<td style=\"width:12%; \">".get_thumbnail_code($image_row2['image_media_file'], $image_row2['image_thumb_file'], $image_row2['image_id'], $image_row2['cat_id'], format_text(trim($image_row2['image_name']), 2), $mode, 1)."</td>\n";
$last_upload .= "<td style=\"width:15%; \"><a href=\"./details.php?image_id=$image_row2[image_id]\">".$image_row2[image_name]."</a></td>\n";
$last_upload .= "<td style=\"width:30%; \">".un_htmlspecialchars(format_text($image_row2['image_description']))."</td>\n";
$last_upload .= "<td style=\"width:15%; \"><a href=\"./categories.php?cat_id=$image_row2[cat_id]\">".$image_row2[cat_name]."</a></td>\n";
$count++;
if ($count == $last_upload_num) {
$last_upload .= "</tr>\n";
$count = 0;
}
} // end while
if ($count > 0) {
$leftover = ($last_upload_num - $count);
if ($leftover >= 1) {
for ($f = 0; $f < $leftover; $f++) {
$last_upload .= "<td style=\"width:".$imgtable_width."\">\n \n</td>\n";
}
$last_upload .= "</tr>\n";
}
}
$last_upload .= "</table>\n";
$site_template->register_vars("last_upload", $last_upload);
unset($last_upload);
//###################################### End Mod Last Upload #################################################
mit den weiten der einzelnen Spalten mußt du dich noch selber spielen.
mfg Andi
-
ging aber schnell...
Danke
Ich hab 200 px thumbnails, ich hätte noch gern gewußt wie ich in den Code durch Eingabe von width und height die thumbnails auf 100 px reduzieren kann.. oder noch besser.. die Thumbnail weg und in der Zeile "Bildname" eine Mouseover Vorschau des Bildes.. in der Größe von 100 px
-
suche hilft:
http://www.4homepages.de/forum/index.php?topic=25017.0
mfg Andi
-
Danke