Author Topic: Suchergebnissausgabe  (Read 66947 times)

0 Members and 2 Guests are viewing this topic.

Rembrandt

  • Guest
Re: Suchergebnissausgabe
« Reply #15 on: January 31, 2011, 04:00:15 PM »
bist du schon damit weitergekommen?

Offline kubiczek

  • Full Member
  • ***
  • Posts: 211
    • View Profile
    • Gross Peterwitz
Re: Suchergebnissausgabe
« Reply #16 on: January 31, 2011, 09:32:29 PM »
hallo,

kein stück weiter,  versuch mich da einzulesen,  http://php.net/manual/de/function.date.php

aber komme leider nicht vorwärts...... :cry: :cry: :cry:


vieleicht könnte man den Birthday Mod umbauen http://www.4homepages.de/forum/index.php?topic=11558.0



gruß






Rembrandt

  • Guest
Re: Suchergebnissausgabe
« Reply #17 on: February 01, 2011, 10:33:39 PM »
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#msg154776

die 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++ % == 0) ? 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:
Code: [Select]
{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>&nbsp;
<a href="{url_new_images}"><b>{lang_new_images}</b></a>&nbsp;
 </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>&nbsp;</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:
Code: [Select]
<a href="{url_top_images}"><b>{lang_top_images}</b></a>&nbsp;füge darüber ein:
Code: [Select]
<a href="statistic.php"><b>{lang_statistic_page_title}</b></a>&nbsp;
so ich hoffe ich habe alles...

mfg Andi
« Last Edit: February 02, 2011, 10:50:35 PM by Rembrandt »

Offline kubiczek

  • Full Member
  • ***
  • Posts: 211
    • View Profile
    • Gross Peterwitz
Re: Suchergebnissausgabe
« Reply #18 on: February 02, 2011, 05:34:33 AM »
 Hallo

wow mir fehlen die worte. Ist alles sehr verständlich und nachvollziehbar


aber bei der der ausgabe ist was faul,


habe die statistic.php angepasst.

<?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");
  
$sql "SELECT i.image_gestorbenGP, 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_gestorbenGP = '
$datum_heute'
          
$sql_where_query
          AND c.cat_id = i.cat_id 
$cat_id_sql
          ORDER BY  STR_TO_DATE(image_gestorbenGP, '%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_gestorbenGP']);
    
//$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_gestorbenGP']." ist ".$image_row['image_name']." gestorben";
    }
    
//print_r($ausgabe);
    
    
if ($count == 0) {
      
$row_bg_number = ($bgcounter++ % == 0) ? 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";
    
$count++;
    if (
$count == $config['image_cells']) {
      
$liste .= "</tr>\n";
      
$count 0;
    }
  } 
// end while
  
if ($count 0)  {
    
$leftover = ($config['image_cells'] - $count);
    if (
$leftover >= 1) {
      for (
$i 0$i $leftover$i++) {
        
$liste .= "<td width=\"".$imgtable_width."\">\n&nbsp;\n</td>\n";
      }
      
$liste .= "</tr>\n";
    }
  }
  
$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'); 
?>


$sql "SELECT i.image_gestorben, i.image_id,

in geändert
$sql "SELECT i.image_gestorbenGP, i.image_id,





dann kamm  ein fehler


DB Error
Bad SQL QuerySELECT i.image_gestorbenGPi.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_hitsi.image_gmap_latitudei.image_gmap_longitudei.image_gmap_zoomi.image_gmap_typei.image_gmap_showi.image_dienstgradi.image_gefallenami.image_gefallenini.image_begrabeni.image_geboreni.image_gestorbenGPi.image_geborenini.image_lagei.image_truppenteili.image_strasseni.image_group_imagei.image_groupi.image_Makei.image_Modeli.image_DateTimeOriginali.image_ISOSpeedRatingsi.image_ExposureTimei.image_FNumberi.image_FocalLengthi.image_ExposureBiasValuei.image_ApertureValuei.image_MaxApertureValuei.image_MeteringModei.image_Flashi.image_ExposureProgrami.image_ExposureModei.image_WhiteBalancei.image_GPSLatitudei.image_GPSLatitudeRefi.image_GPSLongitudei.image_GPSLongitudeRefi.image_GPSAltitudei.image_GPSTracki.image_pin_allowi.image_gebautc.cat_nameu.user_name FROM (friedhof_images ifriedhof_categories cLEFT JOIN 4images_users u ON (u.user_id i.user_idWHERE i.image_active AND i.image_datum '02.02.2011' AND c.cat_id i.cat_id ORDER BY STR_TO_DATE(image_datum'%d.%m.%Y'DESC
Unknown column 
'i.image_datum' in 'where clause'


habe dann

WHERE i.image_active AND i.image_datum '$datum_heute'
          
$sql_where_query
          
AND c.cat_id i.cat_id $cat_id_sql
          ORDER BY  STR_TO_DATE
(image_datum'%d.%m.%Y'DESC


in

 WHERE i.image_active AND i.image_gestorbenGP '$datum_heute'
          
$sql_where_query
          
AND c.cat_id i.cat_id $cat_id_sql
          ORDER BY  STR_TO_DATE
(image_gestorbenGP'%d.%m.%Y'DESC


bzw. image_date geändert

aber es wird nicht ausgegeben  , noch nicht mal ein fehler

http://www.grosspeterwitz.org/friedhof/4images/statistic.php

gruß

Rembrandt

  • Guest
Re: Suchergebnissausgabe
« Reply #19 on: February 02, 2011, 05:42:31 AM »
diese fehler meldung kann ja nicht von deiner static.php kommen dieses feld "image_datum" hast du ja überall rausgelöscht, aber in der fehlermeldung taucht es auf?

Offline kubiczek

  • Full Member
  • ***
  • Posts: 211
    • View Profile
    • Gross Peterwitz
Re: Suchergebnissausgabe
« Reply #20 on: February 02, 2011, 09:59:13 PM »
ich habe jetzt alles noch mal eingebaut,  

das image_datum  habe ich ersetzt durch image_gestorbenGP,  da sonst der fehler wie oben beschrieben aufpopt.


es wird aber nichts ausgegeben.
http://www.grosspeterwitz.org/friedhof/4images/statistic.php
<?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");
  
$sql "SELECT i.image_gestorbenGP, 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_gestorbenGP = '
$datum_heute'
          
$sql_where_query
          AND c.cat_id = i.cat_id 
$cat_id_sql
          ORDER BY  STR_TO_DATE(image_gestorbenGP, '%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_gestorbenGP']);
    
//$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_gestorbenGP']." ist ".$image_row['image_name']." gestorben";
    }
    
//print_r($ausgabe);
    
    
if ($count == 0) {
      
$row_bg_number = ($bgcounter++ % == 0) ? 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";
    
$count++;
    if (
$count == $config['image_cells']) {
      
$liste .= "</tr>\n";
      
$count 0;
    }
  } 
// end while
  
if ($count 0)  {
    
$leftover = ($config['image_cells'] - $count);
    if (
$leftover >= 1) {
      for (
$i 0$i $leftover$i++) {
        
$liste .= "<td width=\"".$imgtable_width."\">\n&nbsp;\n</td>\n";
      }
      
$liste .= "</tr>\n";
    }
  }
  
$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'); 
?>



Rembrandt

  • Guest
Re: Suchergebnissausgabe
« Reply #21 on: February 02, 2011, 10:03:45 PM »
wenn heute kein sterbetag von jemanden ist wird nichts ausgegeben.
edit: sehe gerade ich habe eine fehler drinnen.....*sh***

in der statistic.php suche:
 AND i.image_gestorben '$datum_heute'
lösche das, ist ein kompletter schwachsinn von mir gewesen...   :mrgreen:


edit: habe die statistic.php erneuert.....
« Last Edit: February 02, 2011, 10:39:21 PM by Rembrandt »

Offline kubiczek

  • Full Member
  • ***
  • Posts: 211
    • View Profile
    • Gross Peterwitz
Re: Suchergebnissausgabe
« Reply #22 on: February 02, 2011, 10:35:52 PM »
hi :roll:

jetzt wird was auf dem server abgefragt,  und als zeile mit leerausgabe angezeigt

http://www.grosspeterwitz.org/friedhof/4images/statistic.php

<?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");
  
$sql "SELECT i.image_gestorbenGP, 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 
          
$sql_where_query
          AND c.cat_id = i.cat_id 
$cat_id_sql
          ORDER BY  STR_TO_DATE(image_gestorbenGP, '%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_gestorbenGP']);
    
//$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_gestorbenGP']." ist ".$image_row['image_name']." gestorben";
    }
    
//print_r($ausgabe);
    
    
if ($count == 0) {
      
$row_bg_number = ($bgcounter++ % == 0) ? 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";
    
$count++;
    if (
$count == $config['image_cells']) {
      
$liste .= "</tr>\n";
      
$count 0;
    }
  } 
// end while
  
if ($count 0)  {
    
$leftover = ($config['image_cells'] - $count);
    if (
$leftover >= 1) {
      for (
$i 0$i $leftover$i++) {
        
$liste .= "<td width=\"".$imgtable_width."\">\n&nbsp;\n</td>\n";
      }
      
$liste .= "</tr>\n";
    }
  }
  
$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'); 
?>

Rembrandt

  • Guest
Re: Suchergebnissausgabe
« Reply #23 on: February 02, 2011, 10:41:33 PM »
ich habe die statistic.php erneuert, das mit den leerzeilen ist mir auch aufgefallen.

Offline kubiczek

  • Full Member
  • ***
  • Posts: 211
    • View Profile
    • Gross Peterwitz
Re: Suchergebnissausgabe
« Reply #24 on: February 03, 2011, 06:08:17 AM »
Klasse funktioniert PERFEKT :wink:

da bekomme ich wieder lust die restlichen Sterbedaten zu den Bildern einzutippen (stapelarbeit)


bin schon am erwitern auf das feld image_geboren. Dank deiner SUUUUPER beschreibung verstehe ich die arbeitsweise, nur an der abfrage aus SQL hänge ich fest.

http://www.grosspeterwitz.org/friedhof/4images/statistic.php

$sql "SELECT i.image_gestorbenGP, image_geboren, 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_gestorbenGP, '%d.%m.%Y') DESC



wie bekomme ich das feld image_geboren  in die folgende zeile eingebaut?

   WHERE i.image_active AND i.image_gestorben != ''


   WHERE i.image_active AND i.image_gestorbenGPimage_geboren != ''     geht nicht

   WHERE i.image_active AND i.image_gestorbenGP OR image_gestorben != ''  geht nicht


gruß

Rembrandt

  • Guest
Re: Suchergebnissausgabe
« Reply #25 on: February 03, 2011, 06:11:17 AM »
   WHERE i.image_active AND i.image_gestorben != ''  AND image_geboren != '' 

hoffe ich...  :D

Offline kubiczek

  • Full Member
  • ***
  • Posts: 211
    • View Profile
    • Gross Peterwitz
Re: Suchergebnissausgabe
« Reply #26 on: February 03, 2011, 01:54:47 PM »
nicht ganz :(

WHERE i.image_active AND i.image_gestorbenGP != ''  AND image_geboren != ''  funktioniert nicht.



<?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_gestorbenGP, i.image_geboren, 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_gestorbenGP != ''  AND image_geboren != ''
          
$sql_where_query
          AND c.cat_id = i.cat_id 
$cat_id_sql
          ORDER BY  STR_TO_DATE(image_gestorbenGP, '%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_gestorbenGP']);
    
//$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_gestorbenGP']." ist ".$image_row['image_name']." gestorben";
    }
    
//print_r($ausgabe);
	

	

	

	
$ausgabe1="";
    
//array "$datum_gestorben" erstellen
    
$datum_gestorben explode(".",$image_row['image_geboren']);
    
//$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 ){
    
$ausgabe1 =  "heute vor ".$jahr." jahren wurde  ".$image_row['image_geboren']."  ".$image_row['image_name']." geboren";
    }
    
//print_r($ausgabe);
	

	

    
    if(!empty(
$ausgabe)){
    
    if (
$count == 0) {
      
$row_bg_number = ($bgcounter++ % == 0) ? 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\"><a href=\"./details.php?image_id=$image_row[image_id]\">".$ausgabe1."</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'); 
?>


http://www.grosspeterwitz.org/friedhof/4images/statistic.php







Rembrandt

  • Guest
Re: Suchergebnissausgabe
« Reply #27 on: February 03, 2011, 08:48:46 PM »
funktioniert schon, nur mußt du auch den php teil richtig schreiben. :)

<?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_gestorbenGP, i.image_geboren, 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_gestorbenGP != '' AND i.image_geboren != '' 
          
$sql_where_query
          AND c.cat_id = i.cat_id 
$cat_id_sql
          ORDER BY  STR_TO_DATE(image_gestorbenGP, '%d.%m.%Y') DESC
         "
;
  
$result $site_db->query($sql);
  
  
  
$liste "<table style=\"text-align:center;\" width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">\n";
  
$liste .= "<tr><td style=\"font-size:18px;font-weight:bold;text-decoration:underline;\">Gestorben</td></tr>";
  
$liste .= "</table>";
  
  
$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_gestorbenGP']);
    
//$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_gestorbenGP']." ist <b>".$image_row['image_name']."</b> Gestorben";
    }
    
//print_r($ausgabe);
  
    
if(!empty($ausgabe)){
      if (
$count == 0) {
        
$row_bg_number = ($bgcounter++ % == 0) ? 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\">".$image_row['image_datumr']."</td>\n";
      
      
$liste .= "</tr>\n";
      
$count++;
      if (
$count == $config['image_cells']) {
       
$liste .= "</tr>\n";
        
$count 0;
      }
    } 
  }
// end while
  
$liste .= "</table>\n";
//----------------------------------------------------------------------     
    

  
$result $site_db->query($sql); 

  
$liste .= "<table style=\"margin-top:20px;text-align:center;\" width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">\n";
  
$liste .= "<tr><td style=\"font-size:18px;font-weight:bold;text-decoration:underline;\">Geboren</td></tr>";
  
$liste .= "</table>";
    
  
$liste .= "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">\n";

  
$count 0;
  
$bgcounter 0;
  while (
$image_row $site_db->fetch_array($result)) { 
    
$ausgabe1="";
    
$datum_geboren explode(".",$image_row['image_geboren']);
    
$geboren $datum_geboren[0].$datum_geboren[1];
    
$datum_heute explode("."date("d.m.Y"));
    
$heute $datum_heute[0].$datum_heute[1];
    
$jahr = ($datum_heute[2]) - ($datum_geboren[2]);

    if(
$geboren == $heute ){
      
$ausgabe1 =  "Heute vor ".$jahr." Jahren am ".$image_row['image_geboren']." wurde <b>".$image_row['image_name']."</b> Geboren";
    }
    
//print_r($ausgabe);
    
if(!empty($ausgabe1)){
      if (
$count == 0) {
        
$row_bg_number = ($bgcounter++ % == 0) ? 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]\">".$ausgabe1."</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);

//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'); 
?>


mfg Andi

Offline kubiczek

  • Full Member
  • ***
  • Posts: 211
    • View Profile
    • Gross Peterwitz
Re: Suchergebnissausgabe
« Reply #28 on: February 03, 2011, 09:45:32 PM »
geschaft

es funzt........ nur

wenn ich

WHERE i.image_active AND i.image_gestorbenGP != '' AND i.image_geboren != '' 

in

WHERE i.image_active 1  

ändere.
habe es durch zufall festgestellt.

meine php kenntnisse sind dürftig.

Ohne solche HILFSBEREITEN USER wie Dich währen viele sachen für mich nicht durchführbar.

Ich habe echt viele Ideen, aber sehr oft scheitere ich an mangelden Programmierkenntnissen. 


vielen Dank nochmal

Rembrandt

  • Guest
Re: Suchergebnissausgabe
« Reply #29 on: February 03, 2011, 10:19:42 PM »
past schon hauptsache es funktioniert jetzt, könntest du das bitte bei dir nochmal ausprobieren?
WHERE i.image_active AND (image_gestorbenGP <> '' OR image_geboren <> ''