4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: ch€ri{Bi}² on October 01, 2005, 09:34:47 AM

Title: [MOD] Small Calendar with nav, links and search
Post by: ch€ri{Bi}² on October 01, 2005, 09:34:47 AM
this MOD is a small calendar with:
- navigation (by day/month/year)
- automatic research of the images per day (without taking into account the category)

Demo : here (http://patsgallery.free.fr/4images/search.php?date=20040510)
as you can note, the current day is highlighted as well as the days where the user can find images.
when one day is highlighted, by a simple click on it, the user can consult all the images of the concerned day in all categories (of course by checking the permissions).
with the arrows in bottom, the user can travel in time while choosing per day, month or year

Note : you must have installed the following MOD => [MOD] Search between specifyed date (http://www.4homepages.de/forum/index.php?topic=6182.0)
never forget to backup the files which you will modify.

Installation Level:    Easy
Installation Time:     5 Minutes

 >> 03 files to edit from 4images root:

[change]/includes/page_header.php
[change]/includes/functions.php
[change]/templates/<yourtemplate>/search.html

------ Installation ------

STEP 1:
Open /includes/page_header.php
Add at the end of the file, just before ?> :
Code: [Select]
//-------------------------------------------[ [Mod] Calendar with nav and search ]
$nav_calendar = get_calendar('', bordercolor, head2, tablehead, imagerow1, imagerow2, navbar, button_new);
// paramters => function get_calendar($date = '', $class_table, $class_nav, $class_week_days, $class_noday, $class_eachday, $class_today,$class_linkday)
$site_template->register_vars("nav_calendar", $nav_calendar);
 unset($nav_calendar);
//-------------------------------------------[/[Mod] Calendar with nav and search ]
Note : these values ( bordercolor, head2, tablehead, imagerow1, imagerow2, navbar, button_new ) are mine. it correspond to the classes (see in the file style.css into your template directory) who will be used for the calendar.
Do not hesitate to modify them to personalize the colors of your calendar.

Step 2:
Open /includes/functions.php
Add at the end of the file, just before ?> :
Code: [Select]
//-------------------------------------------[ [Mod] Calendar with nav and search ]
/***************************************************************************
                       calendrier.php  -  A calendar
                             -------------------
    begin                : June 2002
    Version : 2.1 (Jan 04)
    copyleft             : (C) 2002-2003 PHPtools4U.com - Mathieu LESNIAK
email                : support@phptools4u.com
website              : http://www.phptools4u.com/scripts/calendrier/                       
***************************************************************************/
function get_calendar($date = '', $class_table, $class_nav, $class_week_days, $class_noday, $class_eachday, $class_today,$class_linkday) {
global $site_db;
global $link_on_day, $PHP_SELF, $params;
global $HTTP_POST_VARS, $HTTP_GET_VARS;

$calendar_txt['french']['monthes']     = array('', 'Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet',
'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre');
$calendar_txt['french']['days']     = array('Lundi', 'Mardi', 'Mercredi','Jeudi', 'Vendredi', 'Samedi', 'Dimanche');
$calendar_txt['french']['first_day']    = 0;
$calendar_txt['french']['misc']     = array('Mois précédent', 'Mois suivant','Jour précédent', 'Jour suivant', 'Année précédente', 'Année suivante');


### English version
$calendar_txt['english']['monthes']     = array('', 'January', 'February', 'March', 'April', 'May', 'June', 'July',
'August', 'September', 'October','November', 'December');
$calendar_txt['english']['days']     = array('Monday', 'Tuesday', 'Wednesday','Thursday', 'Friday', 'Saturday','Sunday');
$calendar_txt['english']['first_day']   = -1;
$calendar_txt['english']['misc']        = array('Previous month', 'Next month', 'Previous day', 'Next day', 'Next year', 'Previous year');



### Spanish version
$calendar_txt['spanish']['monthes']     = array('', 'Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio',
'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre');
$calendar_txt['spanish']['days']        = array('Lunes', 'Martes', 'Mi&eacute;rcoles', 'Jueves', 'Viernes', 'S&aacute;bado', 'Domingo');
$calendar_txt['spanish']['first_day']   = 0;
$calendar_txt['spanish']['misc']        = array('Mes anterior', 'Mes pr&oacute;ximo', 'd&iacute;a anterior', 'd&iacute;a siguiente', 'A&ntilde;o anterior', 'A&ntilde;o siguiente');

### German version
$calendar_txt['german']['monthes']     = array('', 'Januar', 'Februar', 'M&auml;rz', 'April', 'Mai', 'Juni', 'Juli',
'August', 'September', 'Oktober','November', 'Dezember');
$calendar_txt['german']['days']         = array('Montag', 'Dienstag', 'Mittwoch', 'Donnerstag','Freitag','Samstag', 'Sonntag');
$calendar_txt['german']['first_day']    = 0;
$calendar_txt['german']['misc']         = array('Vorhergehender Monat', 'Folgender Monat', 'Vorabend', 'Am n&auml;chsten Tag', 'Vorjahr', 'Folgendes Jahr');

### Default Params

$param_d['calendar_columns'] = 5; // Nb of columns
$param_d['show_day'] = 1; // Show the day bar
$param_d['show_month'] = 1; // Show the month bar
$param_d['nav_link'] = 1; // Add a nav bar below
$param_d['link_after_date'] = 0; // Enable link on days after the current day
$param_d['link_before_date'] = 1; // Enable link on days before the current day
$param_d['link_on_day'] = 'search.php?date=%%dd%%'; // Link to put on each day
$param_d['use_img'] = 1; // Use gif for nav bar on the bottom

### New params V2
$param_d['lang'] = 'french'; // change to your language : french / english / spanish / german
$param_d['day_mode'] = 0; // Set to 1 : Enable day view with hours (nothing to see)
$param_d['time_step'] = 60;
$param_d['time_start'] = '0:00';
$param_d['time_stop'] = '24:00';
$param_d['highlight'] = array();
    // Can be 'highlight' or 'text'
    $param_d['highlight_type']      = 'highlight';
    $param_d['cell_width']          = 20;
    $param_d['cell_height']         = 20;
    $param_d['short_day_name']      = 1;
    $param_d['link_on_hour']        = $PHP_SELF.'?hour=%%hh%%';

### /Params


### Getting all params
while (list($key, $val) = each($param_d)) {
if (isset($params[$key])) {
$param[$key] = $params[$key];
}
else {
$param[$key] = $param_d[$key];
}
}

$monthes_name = $calendar_txt[$param['lang']]['monthes'];
$param['calendar_columns'] = ($param['show_day']) ? 7 : $param['calendar_columns'];
   
    $date = priv_reg_glob_calendar('date');
if ($date == '') {
$timestamp = time();
}
else {
$month = substr($date, 4 ,2);
$day = substr($date, 6, 2);
$year = substr($date, 0 ,4);
$timestamp = mktime(0, 0, 0, $month, $day, $year);
}
   
   
$current_day = date("d", $timestamp);
$current_month = date('n', $timestamp);
$current_month_2 = date('m', $timestamp);
$current_year = date('Y', $timestamp);
    $first_decalage = date("w", mktime(0, 0, 0, $current_month, 1, $current_year));
### Sunday is the _LAST_ day
$first_decalage = ( $first_decalage == 0 ) ? 7 : $first_decalage;


$current_day_index = date('w', $timestamp) + $calendar_txt[$param['lang']]['first_day'] - 1;
$current_day_index = ($current_day_index == -1) ? 7 : $current_day_index;
$current_day_name = $calendar_txt[$param['lang']]['days'][$current_day_index];
$current_month_name = $monthes_name[$current_month];
$nb_days_month = date("t", $timestamp);

$current_timestamp = mktime(23,59,59,date("m"), date("d"), date("Y"));

### CSS

$output  = '<style type="text/css">'."\n";
$output .= '@import url('.TEMPLATE_PATH.'/style.css);'."\n";
$output .= '</style>'."\n";
$output .= '<table width="100%" border="0" class="'.$class_table.'" cellpadding="2" cellspacing="1">'."\n";

### Displaying the current month/year
if ($param['show_month'] == 1) {
$output .= '<tr>'."\n";
$output .= ' <td colspan="'.$param['calendar_columns'].'" align="center" class="'.$class_nav.'">'."\n";
### Insert an img at will
if ($param['use_img'] ) {
$output .= '<img src="'.get_gallery_image("mois.gif").'">&nbsp;&nbsp;';
}
if ( $param['day_mode'] == 1 ) {
$output .= ' '.$current_day_name.' '.$current_day.' '.$current_month_name.' '.$current_year."\n";
}
else {
$output .= ' '.$current_month_name.' '.$current_year."\n";
}
$output .= ' </td>'."\n";
$output .= '</tr>'."\n";

### select  all images for current month
$date_start = mktime(0,0,0,$current_month_2,1,$current_year);
$date_end = mktime(23,59,59,$current_month_2,$nb_days_month,$current_year);

$user_access = get_permission();

$sql = "SELECT image_date, cat_id
             FROM ".IMAGES_TABLE."
             WHERE image_active = 1 AND image_date >= ".$date_start." AND image_date <= ".$date_end;

  $result = $site_db->query($sql);
$date_img_month = array();

while ($row = $site_db->fetch_array($result)) {
if (check_permission("auth_viewcat", $row['cat_id'])) { // check permissions on cat_id
$new_date = date("Ymd",$row['image_date']); // convert the date
        $date_img_month[] = $new_date; // put the date in the array if permissions are OK
}
      }
      // $site_db->free_result();
}

### Building the table row with the days
if ($param['show_day'] == 1 && $param['day_mode'] == 0) {
$output .= '<tr align="center">'."\n";
$first_day = $calendar_txt[$param['lang']]['first_day'];
for ($i = $first_day; $i < 7 + $first_day; $i++) {

$index = ( $i >= 7) ? (7 + $i): $i;
$index = ($i < 0) ? (7 + $i) : $i;
   
            $day_name = ( $param['short_day_name'] == 1 ) ? substr($calendar_txt[$param['lang']]['days'][$index], 0, 1) : $calendar_txt[$param['lang']]['days'][$index];
$output .= ' <td class="'.$class_week_days.'"><b>'.$day_name.'</b></td>'."\n";
}

$output .= '</tr>'."\n";
$first_decalage = $first_decalage - $calendar_txt[$param['lang']]['first_day'];
$first_decalage = ( $first_decalage > 7 ) ? $first_decalage - 7 : $first_decalage;
}
else {
$first_decalage = 0;
}

$output .= '<tr align="center">'."\n";
$int_counter = 0;


if ( $param['day_mode'] == 1 ) {
list($hour_start, $min_start) = explode(':', $param['time_start']);
list($hour_end, $min_end) = explode(':', $param['time_stop']);
$ts_start = ( $hour_start * 60 ) + $min_start;
$ts_end = ( $hour_end * 60 ) + $min_end;
$nb_steps = ceil( ($ts_end - $ts_start) / $param['time_step'] );

for ( $i = 0; $i <= $nb_steps; $i++ ) {
            $current_ts = ($ts_start) + $i * $param['time_step'];
$current_hour = floor($current_ts / 60);
$current_min = $current_ts % 60;
$current_hour = (strlen($current_hour) < 2) ? '0'.$current_hour : $current_hour;
$current_min = (strlen($current_min) < 2) ? '0'.$current_min : $current_min;

    $highlight_current  = ( isset($param['highlight'][date('Ymd', $timestamp).$current_hour.$current_min]) );
            $css_2_use          = ( $highlight_current ) ? 'HL' : 'Days';
            $txt_2_use          = ( $highlight_current && $param['highlight_type'] == 'text') ? $param['highlight'][date('Ymd', $timestamp).$current_hour.$current_min] : '';
 
$output .= '<tr>'."\n";
            if ( $param['link_on_hour'] != '') {
                $output .= ' <td class="'.$class_noday.'" width="10%"><a href="'.str_replace('%%hh%%', date('Ymd', $timestamp).$current_hour.$current_min, $param['link_on_hour']).'">'.$current_hour.':'.$current_min.'</a></td>'."\n";
            }
            else {
                $output .= ' <td class="'.$class_noday.'" width="10%">'.$current_hour.':'.$current_min.'</td>'."\n";
            }
$output .= '    <td class="'.$class_noday.'">'.$txt_2_use.'</td> '."\n";
$output .= '</tr>'."\n";
}

}
else {
# Filling with empty cells at the begining
for ($i = 1; $i < $first_decalage; $i++) {
$output .= '<td class="'.$class_noday.'">&nbsp;</td>'."\n";
$int_counter++;
}
### Building the table
for ($i = 1; $i <= $nb_days_month; $i++) {
### Do we highlight the current day ?
$i_2 = ($i < 10) ? '0'.$i : $i;
    $highlight_current = ( isset($param['highlight'][date('Ym', $timestamp).$i_2]) );
### Row start
if ( ($i + $first_decalage) % $param['calendar_columns'] == 2 && $i != 1) {
$output .= '<tr align="center">'."\n";
$int_counter = 0;
}

$css_2_use = ( $highlight_current ) ? 'HL' : 'Days';
            $txt_2_use = ( $highlight_current && $param['highlight_type'] == 'text') ? '<br>'.$param['highlight'][date('Ym', $timestamp).$i_2] : '';
           
$current_date = $current_year.$current_month_2.$i_2 ;

            if ($i == $current_day) {

if (in_array($current_date, $date_img_month)) { //
$output .= '<td class="'.$class_today.'" align="center"><a href="'.str_replace('%%dd%%', $current_year.$current_month_2.$i_2,$param['link_on_day']).'&search_keywords=***&day_start='.$i_2.'&month_start='.$current_month_2.'&year_start='.$current_year.'&day_end='.$i_2.'&month_end='.$current_month_2.'&year_end='.$current_year.'">'.$i.'</a>'.$txt_2_use.'</td>'."\n";
} else {
$output .= '<td class="'.$class_today.'" align="center">'.$i.$txt_2_use.'</td>'."\n";
}
}
elseif ($param['link_on_day'] != '') {
$loop_timestamp = mktime(0,0,0, $current_month, $i, $current_year);

if (( ($param['link_after_date'] == 0) && ($current_timestamp < $loop_timestamp)) || (($param['link_before_date'] == 0) && ($current_timestamp >= $loop_timestamp)) ){
$output .= '<td class="'.$class_eachday.'">'.$i.$txt_2_use.'</td>'."\n";
}
else {

if (in_array($current_date, $date_img_month)) {
$output .= '<td class="'.$class_linkday.'"><a href="'.str_replace('%%dd%%', $current_year.$current_month_2.$i_2,$param['link_on_day']).'&search_keywords=***&day_start='.$i_2.'&month_start='.$current_month_2.'&year_start='.$current_year.'&day_end='.$i_2.'&month_end='.$current_month_2.'&year_end='.$current_year.'">'.$i.'</a>'.$txt_2_use.'</td>'."\n";
} else {
$output .= '<td class="'.$class_eachday.'">'.$i.$txt_2_use.'</td>'."\n";
}
}

}
else {
$output .= '<td class="'.$class_eachday.'">'.$i.'</td>'."\n";
}
$int_counter++;

### Row end
if (  ($i + $first_decalage) % ($param['calendar_columns'] ) == 1 ) {
$output .= '</tr>'."\n";
}
}
$cell_missing = $param['calendar_columns'] - $int_counter;

for ($i = 0; $i < $cell_missing; $i++) {
$output .= '<td class="'.$class_noday.'">&nbsp;</td>'."\n";
}
$output .= '</tr>'."\n";
}
### Display the nav links on the bottom of the table
if ($param['nav_link'] == 1) {

$previous_day = date("Ymd",
mktime( 12,
0,
0,
$current_month,
$current_day - 1,
$current_year
   )
);

$previous_month = date("Ymd",
mktime( 12,
0,
0,
($current_month - 1),
$current_day,
$current_year
   )
);

$previous_year = date("Ymd",
mktime( 12,
0,
0,
$current_month,
$current_day,
($current_year - 1)
   )
);


$next_day = date("Ymd",
mktime( 1,
12,
0,
$current_month,
$current_day + 1,
$current_year
   )
);
$next_month = date("Ymd",
mktime( 1,
12,
0,
$current_month + 1,
$current_day,
$current_year
   )
);

$next_year = date("Ymd",
mktime( 12,
0,
0,
$current_month,
$current_day,
($current_year + 1)
   )
);


if ($param['use_img']) {
$g = '<img src="'.get_gallery_image("g.gif").'" border="0">';
$gg = '<img src="'.get_gallery_image("gg.gif").'" border="0">';
$ggg = '<img src="'.get_gallery_image("ggg.gif").'" border="0">';
$d = '<img src="'.get_gallery_image("d.gif").'" border="0">';
$dd = '<img src="'.get_gallery_image("dd.gif").'" border="0">';
$ddd = '<img src="'.get_gallery_image("ddd.gif").'" border="0">';
}
else {
$g = '&lt;';
$gg = '&lt;&lt;';
$ggg = '&lt;&lt;&lt;';
$d = '&gt;';
$dd = '&gt;&gt;';
$ddd = '&gt;&gt;&gt;';
}
// nav link for : next day
if ( ($param['link_after_date'] == 0)
&& ($current_timestamp < mktime(0,0,0, $current_month, $current_day+1, $current_year))
) {
$next_day_link = '&nbsp;';
}
else {
$next_day_link = '<a href="search.php?date='.$next_day.'" title="'.$calendar_txt[$param['lang']]['misc'][3].'">'.$d.'</a>'."\n";
}
// nav link for : previous day
if ( ($param['link_before_date'] == 0)
&& ($current_timestamp > mktime(0,0,0, $current_month, $current_day-1, $current_year))
){
$previous_day_link = '&nbsp;';
}
else {
$previous_day_link = '<a href="search.php?date='.$previous_day.'" title="'.$calendar_txt[$param['lang']]['misc'][2].'">'.$g.'</a>'."\n";
}
// nav link for : next month
if ( ($param['link_after_date'] == 0)
&& ($current_timestamp < mktime(0,0,0, $current_month+1, $current_day, $current_year))
) {
$next_month_link = '&nbsp;';
}
else {
$next_month_link = '<a href="search.php?date='.$next_month.'" title="'.$calendar_txt[$param['lang']]['misc'][1].'">'.$dd.'</a>'."\n";
}
// nav link for : previous month
if  ( ($param['link_before_date'] == 0)
&& ($current_timestamp >= mktime(0,0,0, $current_month-1, $current_day, $current_year))
){
$previous_month_link = '&nbsp;';
}
else {
$previous_month_link = '<a href="search.php?date='.$previous_month.'" title="'.$calendar_txt[$param['lang']]['misc'][0].'">'.$gg.'</a>'."\n";
}
// nav link for : next year
if ( ($param['link_after_date'] == 0)
&& ($current_timestamp < mktime(0,0,0, $current_month, $current_day, $current_year+1))
) {
$next_year_link = '&nbsp;';
}
else {
$next_year_link = '<a href="search.php?date='.$next_year.'" title="'.$calendar_txt[$param['lang']]['misc'][5].'">'.$ddd.'</a>'."\n";
}
// nav link for : previous year
if  ( ($param['link_before_date'] == 0)
&& ($current_timestamp >= mktime(0,0,0, $current_month, $current_day, $current_year-1))
){
$previous_year_link = '&nbsp;';
}
else {
$previous_year_link = '<a href="search.php?date='.$previous_year.'" title="'.$calendar_txt[$param['lang']]['misc'][4].'">'.$ggg.'</a>'."\n";
}



$output .= '<tr>'."\n";
$output .= ' <td align="center" colspan="'.$param['calendar_columns'].'" class="'.$class_nav.'">'."\n";
$output .= ' <table width="100%" border="0" >';
$output .= ' <tr>'."\n";
$output .= ' <td width="16%" align="left" >'."\n";
$output .= $previous_year_link;
$output .= ' </td>'."\n";
$output .= ' <td width="16%" align="left" >'."\n";
$output .= $previous_month_link;
$output .= ' </td>'."\n";
$output .= ' <td width="16%" align="center" >'."\n";
$output .= $previous_day_link;
$output .= ' </td>'."\n";
$output .= ' <td width="16%" align="center" >'."\n";
$output .= $next_day_link;
$output .= ' </td>'."\n";
$output .= ' <td width="16%" align="right" >'."\n";
$output .= $next_month_link;
$output .= ' </td>'."\n";
$output .= ' <td width="16%" align="right" >'."\n";
$output .= $next_year_link;
$output .= ' </td>'."\n";
$output .= ' </tr>';
$output .= ' </table>';
$output .= ' </td>'."\n";
$output .= '</tr>'."\n";

}
$output .= '</table>'."\n";
return $output;
}

function priv_reg_glob_calendar($var) {
Global $HTTP_GET_VARS, $HTTP_POST_VARS;

if (isset($HTTP_GET_VARS[$var])) {
return $HTTP_GET_VARS[$var];
}
elseif (isset($HTTP_POST_VARS[$var])) {
return $HTTP_POST_VARS[$var];
}
else {
return '';
}
}
//-------------------------------------------[/[Mod] Calendar with nav and search ]

Note : modify the parameter $param_d['lang'] by making it correspond to your language.

STEP 3:
Open /templates/<yourtemplate>/search.html
or other file like home.html or details.html...

find this code:
Code: [Select]
{endif random_image}add after :
Code: [Select]
 
<!--   //-------------------------------------------[ [Mod] Calendar with nav and search ] -->
   <table width="150" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td class="head2" height="20" background="{template_url}/images/cat.gif"> <img src="{template_url}/images/spacer.gif" alt="" width="4" height="4" />Calendar</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">
    {nav_calendar}
                      </td>
                    </tr>
                    <tr>
                      <td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
                    </tr>
                  </table>


<!--   //-------------------------------------------[/[Mod] Calendar with nav and search ] -->

STEP 4:
Download the attached files, unzip and copy all 7 pics into /templates/<yourtemplate>/images_<yourlanguage>/
You can also choose disable images for nav in the calendar : set parameter $param_d['use_img'] to 0.

------ END of Installation ------

now launch your search page to see the result!
Title: Re: [MOD] Small Calendar with nav, links and search
Post by: urmasmuld on October 01, 2005, 11:44:22 AM
How can I change the Monday to be the first day of the week.
Title: Re: [MOD] Small Calendar with nav, links and search
Post by: ch€ri{Bi}² on October 01, 2005, 11:47:42 AM
How can I change the Monday to be the first day of the week.
in language verion parameters choose your language and change:
Quote
$calendar_txt['english']['first_day']   = -1;
to
Quote
$calendar_txt['english']['first_day']   =0;
Title: Re: [MOD] Small Calendar with nav, links and search
Post by: Bear on October 01, 2005, 08:09:04 PM
excellent mod and as you said very easy and quick
thank you
Title: Re: [MOD] Small Calendar with nav, links and search
Post by: Loda on October 02, 2005, 10:23:12 AM
excellent! great work!

but I found a little problem with the mod "search statistic".
when i click on link of the date to search the images, it makes a new empty field in the search statistic.
it's not a big problem.. and it doesn't matters.
Title: Re: [MOD] Small Calendar with nav, links and search
Post by: ch€ri{Bi}² on October 02, 2005, 11:51:17 AM
 :roll: well, the search on this MOD is based on  :
Quote
search_keywords=***
...and the date
i don't know how the MOD search statistic works but i will try to install it and I keep you informed  :wink:
Title: Re: [MOD] Small Calendar with nav, links and search
Post by: TIMT on October 02, 2005, 06:31:08 PM
cheribib has already mentioned a link to a demo in his post
Quote
Demo : here


http://patsgallery.free.fr/4images/search.php?date=20040510

  :wink:
Title: Re: [MOD] Small Calendar with nav, links and search
Post by: V@no on October 02, 2005, 06:32:15 PM
yes, thank you...missed it somehow...
Title: Re: [MOD] Small Calendar with nav, links and search
Post by: BartAfterDark on November 14, 2005, 05:10:45 PM
what's the clock on your page "Veuillez patienter..." ?
Title: Re: [MOD] Small Calendar with nav, links and search
Post by: ch€ri{Bi}² on November 14, 2005, 05:39:58 PM
what's the clock on your page "Veuillez patienter..." ?

it is a Javascript code to indicate to the user he must have patience during page loading.
it is very useful when some users have a slow connection, so that they know the website is not dead  :wink:
Title: Re: [MOD] Small Calendar with nav, links and search
Post by: BartAfterDark on November 14, 2005, 06:18:59 PM
aha :)
But it never stops on my computer. Just keeps going (under firefox)

what's the clock on your page "Veuillez patienter..." ?

it is a Javascript code to indicate to the user he must have patience during page loading.
it is very useful when some users have a slow connection, so that they know the website is not dead  :wink:
Title: Re: [MOD] Small Calendar with nav, links and search
Post by: JensF on November 30, 2005, 06:15:23 PM
Hi,

where can i change the color for the days i have new pictures??? it´s dark blue and i will change it to an other colot but i can´t the right position. And the style.css i will not change.

Another Thing. When i go forward in the month i come to the search results but i will see the next month in the calendar...
Title: Re: [MOD] Small Calendar with nav, links and search
Post by: ch€ri{Bi}² on December 01, 2005, 12:00:08 AM
where can i change the color for the days i have new pictures??? it´s dark blue and i will change it to an other colot but i can´t the right position. And the style.css i will not change.

just modify the red parameter in your /includes/page_header.php:
Quote
$nav_calendar = get_calendar('', bordercolor, head2, tablehead, imagerow1, imagerow2, navbar, button_new);
// paramters => function get_calendar($date = '', $class_table, $class_nav, $class_week_days, $class_noday, $class_eachday, $class_today,$class_linkday)

as i said in the original post:
Quote from: cheribibi
Note : these values ( bordercolor, head2, tablehead, imagerow1, imagerow2, navbar, button_new ) are mine. it correspond to the classes (see in the file style.css into your template directory) who will be used for the calendar.
Do not hesitate to modify them to personalize the colors of your calendar.

right?  :wink:
Title: Re: [MOD] Small Calendar with nav, links and search
Post by: JensF on December 01, 2005, 03:29:32 PM
Hi,

 i have change this to head2. Is that what you mean? i can´t test it while no user had upload new images in december :(

Another thing. when i go back to november i see a empty search result. but i thing that i must see all images there wehere upload in november, or???
Title: Re: [MOD] Small Calendar with nav, links and search
Post by: ch€ri{Bi}² on December 01, 2005, 05:08:59 PM
well , on home page, the default month is the current month...
if you want to see november 2005, try to add ?date=20051101 after index.php ( test it :arrow: http://www.terraristik-galerie.de/index.php?date=20051101)

since the calendar's links send towards the search page , I advise you to integrate the MOD in the search page too.

 :arrow: so you will be able to browse all days/months/years without coming back to your home page  :wink:


Quote from: JensF
when i go back to november i see a empty search result. but i thing that i must see all images there wehere upload in november, or???
the search is only related to the days (pics for each day), there is no search about the pics of the month at this point. 
 :idea: this can be done (i think)  it's a simple link   :wink:
Title: Re: [MOD] Small Calendar with nav, links and search
Post by: JensF on December 01, 2005, 06:55:42 PM
Hello,

thanks for your answer. Now it works...:)
Title: Re: [MOD] Small Calendar with nav, links and search
Post by: Useieri on October 28, 2006, 07:00:01 AM
which the reason of this error? :cry:

(http://img183.imageshack.us/img183/7241/00000001et6.th.jpg) (http://img183.imageshack.us/my.php?image=00000001et6.jpg)

{in the page: search.php}
Title: Re: [MOD] Small Calendar with nav, links and search
Post by: ch€ri{Bi}² on October 30, 2006, 01:03:46 PM
i think your problem is related to this (http://www.4homepages.de/forum/index.php?topic=9897.msg53388#msg53388)
these values depend on your css stylesheet.
Title: Re: [MOD] Small Calendar with nav, links and search
Post by: Darkness2001 on October 30, 2006, 02:06:31 PM
Hallo,

werde den MOD gleich mal heut Abend einbauen und ausprobieren  :lol:

Grüße Darkness  :mrgreen:
Title: Re: [MOD] Small Calendar with nav, links and search
Post by: Useieri on October 31, 2006, 03:47:01 PM
i think your problem is related to this (http://www.4homepages.de/forum/index.php?topic=9897.msg53388#msg53388)
these values depend on your css stylesheet.
in mine css has all the necessary values =/
Title: Re: [MOD] Small Calendar with nav, links and search
Post by: Darkness2001 on October 31, 2006, 10:41:54 PM
Hallo,

habe auch das Probl. mit des css Einträgen, ist es richtig das ich diese nachträglich in die css einbauen muss ?

Grüße Darkness  :mrgreen:

Notice: Use of undefined constant bordercolor - assumed 'bordercolor' in /homepages/35/d85936339/htdocs/1images/includes/page_header.php on line 693

Notice: Use of undefined constant head2 - assumed 'head2' in /homepages/35/d85936339/htdocs/1images/includes/page_header.php on line 693

Notice: Use of undefined constant tablehead - assumed 'tablehead' in /homepages/35/d85936339/htdocs/1images/includes/page_header.php on line 693

Notice: Use of undefined constant imagerow1 - assumed 'imagerow1' in /homepages/35/d85936339/htdocs/1images/includes/page_header.php on line 693

Notice: Use of undefined constant imagerow2 - assumed 'imagerow2' in /homepages/35/d85936339/htdocs/1images/includes/page_header.php on line 693

Notice: Use of undefined constant navbar - assumed 'navbar' in /homepages/35/d85936339/htdocs/1images/includes/page_header.php on line 693

Notice: Use of undefined constant button_new - assumed 'button_new' in /homepages/35/d85936339/htdocs/1images/includes/page_header.php on line 693
Title: Re: [MOD] Small Calendar with nav, links and search
Post by: ch€ri{Bi}² on November 01, 2006, 04:41:41 PM
in mine css has all the necessary values =/
and these values are ....????

just modify the red parameter in your /includes/page_header.php:
Quote
$nav_calendar = get_calendar('', bordercolor, head2, tablehead, imagerow1, imagerow2, navbar, button_new);
// paramters => function get_calendar($date = '', $class_table, $class_nav, $class_week_days, $class_noday, $class_eachday, $class_today,$class_linkday)

as i said in the original post:
Quote from: cheribibi
Note : these values ( bordercolor, head2, tablehead, imagerow1, imagerow2, navbar, button_new ) are mine. it correspond to the classes (see in the file style.css into your template directory) who will be used for the calendar.
Do not hesitate to modify them to personalize the colors of your calendar.

you must take some  values of classes from your own css stylesheet and replace them in the code...
Title: Re: [MOD] Small Calendar with nav, links and search
Post by: Darkness2001 on November 01, 2006, 05:33:29 PM
Hello,

i dont find the error ?? why

Can your help me please for the error.

my style css  :

.bordercolor {
}
.head2{}
.tablehead{}
.imagerow1{}
.imagerow2 {}
.navbar {}
.button_new {}
.class_table {}

error:

Notice: Use of undefined constant bordercolor - assumed 'bordercolor' in /homepages/35/d85936339/htdocs/1images/includes/page_header.php on line 693

Notice: Use of undefined constant head2 - assumed 'head2' in /homepages/35/d85936339/htdocs/1images/includes/page_header.php on line 693

Notice: Use of undefined constant tablehead - assumed 'tablehead' in /homepages/35/d85936339/htdocs/1images/includes/page_header.php on line 693

Notice: Use of undefined constant imagerow1 - assumed 'imagerow1' in /homepages/35/d85936339/htdocs/1images/includes/page_header.php on line 693

Notice: Use of undefined constant imagerow2 - assumed 'imagerow2' in /homepages/35/d85936339/htdocs/1images/includes/page_header.php on line 693

Notice: Use of undefined constant navbar - assumed 'navbar' in /homepages/35/d85936339/htdocs/1images/includes/page_header.php on line 693

Notice: Use of undefined constant button_new - assumed 'button_new' in /homepages/35/d85936339/htdocs/1images/includes/page_header.php on line 693

Greez Darkness  :mrgreen:


Ps: die css Datei habe ich angepasst. Funktioniert auch soweit, doch die Fehler werden immer angezeigt
Das Kalenderdesign ändert sich auch entsprechend. Komme nur nicht mit den Fehlern klar und finde auch nicht die Fehlerquelle ?? !!
Title: Re: [MOD] Small Calendar with nav, links and search
Post by: Useieri on November 07, 2006, 02:17:21 AM
in mine css has all the necessary values =/
and these values are ....????
bordercolor, head2, tablehead, imagerow1, imagerow2, navbar, button_new and class_table  :wink:

error:
Quote
Notice: Use of undefined constant bordercolor - assumed 'bordercolor' in /home/useieri/public_html/photos/includes/page_header.php on line 373

Notice: Use of undefined constant head2 - assumed 'head2' in /home/useieri/public_html/photos/includes/page_header.php on line 373

Notice: Use of undefined constant tablehead - assumed 'tablehead' in /home/useieri/public_html/photos/includes/page_header.php on line 373

Notice: Use of undefined constant imagerow1 - assumed 'imagerow1' in /home/useieri/public_html/photos/includes/page_header.php on line 373

Notice: Use of undefined constant imagerow2 - assumed 'imagerow2' in /home/useieri/public_html/photos/includes/page_header.php on line 373

Notice: Use of undefined constant navbar - assumed 'navbar' in /home/useieri/public_html/photos/includes/page_header.php on line 373

Notice: Use of undefined constant button_new - assumed 'button_new' in /home/useieri/public_html/photos/includes/page_header.php on line 373

Notice: Undefined offset: 7 in /home/useieri/public_html/photos/includes/functions.php on line 1830
Title: Re: [MOD] Small Calendar with nav, links and search
Post by: ch€ri{Bi}² on November 07, 2006, 09:34:50 AM
my style css :

.bordercolor {
}
.head2{}
.tablehead{}
.imagerow1{}
.imagerow2 {}
.navbar {}
.button_new {}
.class_table {}
these classes should not be empty  :?

1 - open the default 4images stylesheet  (style.css in templates/default dir)
2 - take the original values of classes   
3 - put them in your own stylesheet
Title: Re: [MOD] Small Calendar with nav, links and search
Post by: Darkness2001 on November 07, 2006, 09:55:25 AM
my style css :

.bordercolor {
}
.head2{}
.tablehead{}
.imagerow1{}
.imagerow2 {}
.navbar {}
.button_new {}
.class_table {}
these classes should not be empty  :?

1 - open the default 4images stylesheet  (style.css in templates/default dir)
2 - take the original values of classes   
3 - put them in your own stylesheet

@ch€ri{Bi}²,

i put the class types in the style.css with .... .class_table { background: #000000;  etc. }

I put it in and dont working. I have [see last message] a many error's in the page_header. I think the MOD no working in Vers. 1.7.4


Greez Darkness  :mrgreen:
Title: Re: [MOD] Small Calendar with nav, links and search
Post by: mikevid on November 07, 2006, 04:22:14 PM
Great mod, thank you. 

One fyi-
When I hover previous year <<<, I got next year "alt"
When I hover next year >>>, I got previous year "alt"

I switched the words  'Next year', 'Previous year' at the end of the misc section in functions.php to fix the problem. Now it looks like this:
Code: [Select]
$calendar_txt['english']['misc']        = array('Previous month', 'Next month', 'Previous day', 'Next day', 'Previous year', 'Next year');
Title: Re: [MOD] Small Calendar with nav, links and search
Post by: Darkness2001 on November 07, 2006, 11:47:26 PM
Hello,

i have a idea, see here

http://www.4homepages.de/forum/index.php?topic=15157.msg82793#msg82793

Greez Darkness  :mrgreen:

With this is working ;-)
Title: Re: [MOD] Small Calendar with nav, links and search
Post by: ccsakuweb on March 13, 2007, 08:46:50 PM
Hi! GReat mod, but when i click to a day with images i don't see nothing.. the search doen't work, i think that it is because * doesn't work in my gallery but i don't know how to fix my problem. could you help me please?
Title: Re: [MOD] Small Calendar with nav, links and search
Post by: rinaldos on March 14, 2007, 10:05:16 AM
Hello

If you have installed this MOD :[HACK] Many More colors with only ONE template (http://www.4homepages.de/forum/index.php?topic=9755.0)

then you have to change in /includes/function.php

find:
Code: [Select]
$output .= '@import url('.TEMPLATE_PATH.'/styles.css);'."\n";
change:
Code: [Select]
$output .= '@import url('.TEMPLATE_PATH.'/{mycss});'."\n";

Ingo
Title: Re: [MOD] Small Calendar with nav, links and search
Post by: ccsakuweb on March 16, 2007, 09:25:26 PM
lol I don't use this mod.. but I have a style.css in root.. I desinged other template... and I included the style with the complete url from the style
Title: Re: [MOD] Small Calendar with nav, links and search
Post by: SprinterMadl on June 08, 2009, 04:06:03 PM
Hallo zusammen,

nach kleinen Schwierigkeiten, hab ich es jetzt geschafft, den Mod zu installieren (wer lesen kann, ist klar im Vorteil  :mrgreen: )

Allerding stell ich nun fest, dass nur Bilder angezeigt werden die Keywords haben, die keine haben werden nicht angezeigt.
Im Kalender wird der Tag zwar angezeigt, das dort Bilder sein sollen, aber Sie werden nicht angezeigt.

Ich müßte jetzt bei über 5.200 Bilder Keywords nachrüsten  8O, es reicht ja schon das ich das Datum von Hand ändern muß  :evil:

Besteht da ne Möglichkeit das auch die Bilder in der Suche angezeigt werden die keine Keywords haben?
Fänd ich Klasse...
Title: Re: [MOD] Small Calendar with nav, links and search
Post by: rinaldos on June 08, 2009, 04:09:35 PM
Der Suchlink sieht doch bei dir in etwas so aus, oder?
search.php?date=20090607&search_keywords=***&day_start=07&month_start=06&year_start=2009&day_end=07&month_end=06&year_end=2009

"search_keywords=***" und mit diesem Eintrag werden auch Bilder angezeigt die keine Keywords enthalten. (So der Plan).
Title: Re: [MOD] Small Calendar with nav, links and search
Post by: SprinterMadl on June 08, 2009, 04:17:05 PM
Der Plan hat nicht funktioniert (Du verfolgst mich  :mrgreen: :mrgreen: )
War in der functions.php 2x drin, beides Mal raus, die *** werden in der Suche auch nicht mehr angezeigt, aber die Bilder werden ebenfalls nicht angezeigt.
Title: Re: [MOD] Small Calendar with nav, links and search
Post by: Lesik on August 04, 2009, 11:09:58 AM
what is error ???  Notice: Undefined offset: 7 in /home/www/xxx.xxxxx.xxx/includes/functions.php on line 1953
in string:  $current_day_name = $calendar_txt[$param['lang']]['days'][$current_day_index];

maybe
$current_day_index            = ($current_day_index == -1) ? 6 : $current_day_index;