hat ein bischen länger gedauert, hatte ein neues projekt.....
so die php vorlage habe ich von hier genommen:
http://www.4homepages.de/forum/index.php?topic=28819.msg154776#msg154776die SQL abfrage aus der search.php und ein wenig abgeändert.
die statistic.php in den root kopieren:
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: statistic.php *
* Copyright: (C) 2002-2009 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.7.9 *
* File Version: 1.0.0 (by Rembrandt www.vienna-pictures.com) *
* 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 = 'statistic'; // <-- Your Template Title
define('GET_CACHES', 1);
define('ROOT_PATH', './');
define('MAIN_SCRIPT', __FILE__);
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');
include(ROOT_PATH.'includes/page_header.php');
$txt_clickstream = $lang['statistic_page_title']; // <-- Clickstream Name
//################## EXAMPLE CUSTOM PHP CODE STARTS HERE ############################
$imgtable_width = ceil((intval($config['image_table_width'])) / $config['image_cells']);
if ((substr($config['image_table_width'], -1)) == "%") {
$imgtable_width .= "%";
}
$additional_sql = "";
if (!empty($additional_image_fields)) {
foreach ($additional_image_fields as $key => $val) {
$additional_sql .= ", i.".$key;
}
}
$datum_heute = date("d.m.Y");
//,date_format( str_to_date( i.image_datum, '%m.%d.%Y' ) , '%m.%d.%Y' ) AS my_date
$sql = "SELECT i.image_gestorben, 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 i.image_gestorben != ''
$sql_where_query
AND c.cat_id = i.cat_id $cat_id_sql
ORDER BY STR_TO_DATE(image_gestorben, '%d.%m.%Y') DESC
";
$result = $site_db->query($sql);
$liste = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">\n";
$count = 0;
$bgcounter = 0;
$config['image_cells'] = 1;
while ($image_row = $site_db->fetch_array($result)) {
$ausgabe="";
//array "$datum_gestorben" erstellen
$datum_gestorben = explode(".",$image_row['image_gestorben']);
//$datum_gestorben[0] =tag; $datum_gestorben[1] =monat; $datum_gestorben[2] =Jahr
//jetzt wird der tag und das monat zusammen gesetzt
$gestorben = $datum_gestorben[0].$datum_gestorben[1];
//bspl. 04.03.1945 aus der DB ergibt: "0403"
//jetzt brauchen wir noch das aktuelle datum (mittels date()), mit dem wir genauso verfahren.
$datum_heute = explode(".", date("d.m.Y"));
// tag und das monat wieder zusammen setzen
$heute = $datum_heute[0].$datum_heute[1]; // ergibt zurzeit :) 0102
//mit der jahreszahl verfahren wir genauso:
$jahr = ($datum_heute[2]) - ($datum_gestorben[2]);
//jetzt vergleichen wir die zahl "$gestorben" und die zahl "$heute"
//sind die beiden zahlen gleich dann geben wir eine meldung aus.
if($gestorben == $heute ){
$ausgabe = "heute vor ".$jahr." jahren am ".$image_row['image_gestorben']." ist ".$image_row['image_name']." gestorben";
}
//print_r($ausgabe);
if(!empty($ausgabe)){
if ($count == 0) {
$row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
$liste .= "<tr class=\"imagerow".$row_bg_number."\">\n";
}
$liste .= "<td width=\"".$imgtable_width."\" valign=\"top\"><a href=\"./details.php?image_id=$image_row[image_id]\">".$ausgabe."</a></td>\n";
// $liste .= "<td width=\"".$imgtable_width."\" valign=\"top\"></td>\n";
$liste .= "</tr>\n";
$count++;
if ($count == $config['image_cells']) {
$liste .= "</tr>\n";
$count = 0;
}
} // end while
}
$liste .= "</table>\n";
$content = $liste;
unset($liste);
// end if
//Here starts the lang register
$site_template->register_vars(array(
"content" => $content, // <-- It is important that the same name used as in PHP Code above (in this example "my_php")
"lang_statistic_page_title" => $lang['statistic_page_title'] // <-- Page Title
// <-- the "example_text" must still be registered in the "lang/your language/main.php"
));
//################## EXAMPLE CUSTOM PHP CODE END HERE ################################
//-----------------------------------------------------
//--- Clickstream -------------------------------------
//-----------------------------------------------------
$clickstream = "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'].$txt_clickstream."</span>";
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
"content" => $content,
"msg" => $msg,
"clickstream" => $clickstream
));
$site_template->print_template($site_template->parse_template($main_template));
include(ROOT_PATH.'includes/page_footer.php');
?>
ich habe dir zu der datums geschichte jeweils einen hinweistext dazu geschrieben lies dir das durch, dann wird einiges klarer.
die statistic.html in deinen template ordner:
{header}
<table width="960" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tablehead">
<tr>
<td width="100%" colspan="4"><table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="6"><img src="{template_url}/images/header_top_left.gif" width="6" height="6" alt="" ></td>
<td width="100%"><img src="{template_url}/images/header_top.gif" width="100%" height="6" alt="" ></td>
<td width="6"><img src="{template_url}/images/header_top_right.gif" width="6" height="6" alt="" ></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="6"><img src="{template_url}/images/header_left.gif" width="6" height="60" alt="" ></td>
<td width="100%"><img src="{template_url}/images/header_logo.gif" width="405" height="60" alt="" ></td>
<td width="225" align="right">
<form method="post" action="{url_search}">
<table border="0" cellspacing="0" cellpadding="1">
<tr>
<td>
<input type="text" name="search_keywords" size="15" class="searchinput" >
</td>
<td>
<input type="submit" value="{lang_search}" class="button" name="submit" >
</td>
</tr>
<tr valign="top">
<td colspan="2"><a href="{url_search}" class="smalltext">{lang_advanced_search}</a></td>
</tr>
</table>
</form>
</td>
<td align="right" width="6"><img src="{template_url}/images/header_right.gif" width="6" height="60" alt="" ></td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="bordercolor">
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td class="tablebgcolor">
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td class="navbar" height="23">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="{template_url}/images/spacer.gif" width="4" height="4" alt="" >{clickstream}</td>
<td align="right">
<a href="{url_top_images}"><b>{lang_top_images}</b></a>
<a href="{url_new_images}"><b>{lang_new_images}</b></a>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="150" valign="top" class="row2">
<table width="150" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="head2" height="20"><img src="{template_url}/images/spacer.gif" alt="" width="4" height="4" >{lang_registered_user}</td>
</tr>
<tr>
<td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" ></td>
</tr>
<tr>
<td align="center" class="row1">{user_box} </td>
</tr>
<tr>
<td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" ></td>
</tr>
</table>
{if random_image}
<table width="150" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="head2" height="20"> <img src="{template_url}/images/spacer.gif" alt="" width="4" height="4" >{lang_random_image}</td>
</tr>
<tr>
<td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" ></td>
</tr>
<tr>
<td align="center" class="row1">
<br >
{random_image}
<br >
<br >
</td>
</tr>
<tr>
<td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" ></td>
</tr>
</table>
{endif random_image}
</td>
<td width="1" class="bordercolor" valign="top"><img src="{template_url}/images/spacer.gif" width="1" height="1" alt="" ></td>
<td width="18" valign="top"><img src="{template_url}/images/spacer.gif" width="18" height="18" alt="" ></td>
<td width="100%" valign="top"><br >
<b class="title">{lang_statistic_page_title}
</b>
<hr size="1" >
{content}
</br></br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>{category_dropdown_form}</td>
<td align="right">{setperpage_dropdown_form}</td>
</tr>
</table>
<p> </p>
</td>
<td width="20" valign="top"><img src="{template_url}/images/spacer.gif" width="19" height="19" alt="" ></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tablebottom">
<tr>
<td width="6" nowrap><img src="{template_url}/images/footer_left.gif" width="6" height="19" alt="" ></td>
<td width="100%"></td>
<td width="6" nowrap><img src="{template_url}/images/footer_right.gif" width="6" height="19" alt="" ></td>
</tr>
</table>
</td>
</tr>
</table>
{footer}
in die lang/main:
$lang['statistic_page_title'] = "Statistic";suche in der includes/ page_header.php:
"lang_registered_user" => $lang['registered_user'],füge darunter ein:
"lang_statistic_page_title" => $lang['statistic_page_title'],in der home.html suche:
<a href="{url_top_images}"><b>{lang_top_images}</b></a>
füge darüber ein:
<a href="statistic.php"><b>{lang_statistic_page_title}</b></a>
so ich hoffe ich habe alles...
mfg Andi