NXPOWER - Forum 100NX - Tuning 100NX - MĂ©canique 100NX - Annonces 100NX - Photos 100NX

NXPOWER : forum dédié à la Nissan 100NX

En savoir plus sur les forums

Les news du site, ou du forum, messages du webmaster ...

Modérateurs: carbunx, TriadeOne, Modérateurs

En savoir plus sur les forums

Messagepar JP » Mar 3 FĂ©v 2004 22:40

Salut ? tous.

:idea: Ce message s'adresse aux curieux ; je voulais vous faire partager le travail que j'effectue sur le site, et depuis 6 mois sur ces forums :

Un forum comme celui-ci , ?? commence par le t?l?chargement d'un ensemble de fichiers, qui une fois tous r?unit sur le net, permettent de faire fonctionner le forum. Jusque l? rien d'extraordinaire 8)

L? o? ?? commence ? se compliquer c'est quand il faut ajouter des fonctionnalit?s suppl?mentaires comme l'insertion de fichiers, l'album etc ... (liste des modifs ici => http://www.nxpower.fr/phpBB2/viewtopic.php?t=9)

Quand on en arrive l?, c'est qu'on veut am?liorer le forum d'origine, cel? s'appelle des MODS (nouvelles fonctions). Ces mods ne s'installent pas tous seuls en executant un "install.exe" comme n'importe quel utilitaire ou autre que vous t?l?chargez sur le net ...

Il faut la plupart du temps, r?ouvrir un par un les fichiers d'origines du forum, et y ajouter des lignes de codes (le fameux langage PHP).

Un exemple ?? vous dit ? :wink:

Actuellment je bosse sur le MOD "birthday", qui comme son nom l'indique, permettra de surveiller les anniversaires des membres. C'est tout couillon, c'est un "extra" qui demande tout de m?me les modifs suivantes (je vous laisse essayer de comprendre ... ) :

##############################################################
## MOD Title: Birthday
## MOD Author: Niels < ncr@db9.dk > (Niels Chr. R?d) http://mods.db9.dk
## MOD Description: This mod will add a birthday field into your
## user's profile and make users age viewable
## to others when viewing posts.
## MOD Version: 1.5.4
## Compatibility: 2.0.6
##
## Installation Level: Advanced
## Installation Time: 30 Minutes (1mn by EasyMOD of Nuttzy)
## Files To Edit: 18
## index.php
## viewtopic.php
## admin/admin_board.php
## admin/admin_users.php
## includes/functions.php
## includes/page_header.php
## includes/usercp_avatar.php
## includes/usercp_register.php
## includes/usercp_viewprofile.php
## language/lang_english/lang_admin.php
## language/lang_english/lang_main.php
## templates/subSilver/index_body.tpl
## templates/subSilver/overall_header.tpl
## templates/subSilver/profile_add_body.tpl
## templates/subSilver/profile_view_body.tpl
## templates/subSilver/viewtopic_body.tpl
## templates/subSilver/admin/board_config_body.tpl
## templates/subSilver/admin/user_edit_body.tpl
##
## Included Files: 3
## birthday_db_update.php
## root/birthday_popup.php
## root/templates/subSilver/greeting_popup.tpl
##
## Author Notes:
##
## Full MOD description
## -----------
## This mod will add a birthday field into your user's profile
## and make users age viewable to others when viewing posts.
## Users who not specify a birthday, the script will default
## to "None Specified."
## At the day of the users birthday (next visit) the board can
## be configured to display a birthday greeting .
##
################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ COPY ]------------------------------------------------
#
copy birthday_db_update.php to birthday_db_update.php
copy root/birthday_popup.php to birthday_popup.php
copy root/templates/subSilver/greeting_popup.tpl to templates/subSilver/greeting_popup.tpl

#
# This MOD need a database update.
# Then, as you must have now copied the birthday_db_update.php file
# in your phpBB root directory, run it with your navigator...
# http://www.yourWebSite.xxx/phpbbRootDir ... update.php
#
# ...and then delete it from the phpBB root directory!!!
#
# Please, do it NOW! Before editing phpBB files by EM or manually!!!
# Otherwise, you may have an error message during your next
# connection.
#

#
#-----[ OPEN ]------------------------------------------------
#
index.php

#
#-----[ FIND ]------------------------------------------------
#
//
// Start output of page

#
#-----[ BEFORE, ADD ]-----------------------------------------
#
// Birthday Mod, Show users with birthday
$sql = ($board_config['birthday_check_day']) ? "SELECT user_id, username, user_birthday,user_level FROM " . USERS_TABLE. " WHERE user_birthday!=999999 ORDER BY username" :"";
if($result = $db->sql_query($sql))
{
if (!empty($result))
{
$time_now = time();
$this_year = create_date('Y', $time_now, $board_config['board_timezone']);
$date_today = create_date('Ymd', $time_now, $board_config['board_timezone']);
$date_forward = create_date('Ymd', $time_now+($board_config['birthday_check_day']*86400), $board_config['board_timezone']);
while ($birthdayrow = $db->sql_fetchrow($result))
{
usleep(2);
$user_birthday2 = $this_year.($user_birthday = realdate("md",$birthdayrow['user_birthday'] ));
if ( $user_birthday2 < $date_today ) $user_birthday2 += 10000;
if ( $user_birthday2 > $date_today && $user_birthday2 <= $date_forward )
{
// user are having birthday within the next days
$user_age = ( $this_year.$user_birthday < $date_today ) ? $this_year - realdate ('Y',$birthdayrow['user_birthday'])+1 : $this_year- realdate ('Y',$birthdayrow['user_birthday']);
switch ($birthdayrow['user_level'])
{
case ADMIN :
$birthdayrow['username'] = '<b>' . $birthdayrow['username'] . '</b>';
$style_color = 'style="color:#' . $theme['fontcolor3'] . '"';
break;
case MOD :
$birthdayrow['username'] = '<b>' . $birthdayrow['username'] . '</b>';
$style_color = 'style="color:#' . $theme['fontcolor2'] . '"';
break;
default: $style_color = '';
}
$birthday_week_list .= ' <a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $birthdayrow['user_id']) . '"' . $style_color .'>' . $birthdayrow['username'] . ' ('.$user_age.')</a>,';
} else if ( $user_birthday2 == $date_today )
{
//user have birthday today
$user_age = $this_year - realdate ( 'Y',$birthdayrow['user_birthday'] );
switch ($birthdayrow['user_level'])
{
case ADMIN :
$birthdayrow['username'] = '<b>' . $birthdayrow['username'] . '</b>';
$style_color = 'style="color:#' . $theme['fontcolor3'] . '"';
break;
case MOD :
$birthdayrow['username'] = '<b>' . $birthdayrow['username'] . '</b>';
$style_color = 'style="color:#' . $theme['fontcolor2'] . '"';
break;
default: $style_color = '';
}

$birthday_today_list .= ' <a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $birthdayrow['user_id']) . '"' . $style_color .'>' . $birthdayrow['username'] . ' ('.$user_age.')</a>,';
}

}
if ($birthday_today_list) $birthday_today_list[ strlen( $birthday_today_list)-1] = ' ';
if ($birthday_week_list) $birthday_week_list[ strlen( $birthday_week_list)-1] = ' ';
}
$db->sql_freeresult($result);
}

#
#-----[ FIND ]------------------------------------------------
#
'L_FORUM' =>

#
#-----[ BEFORE, ADD ]-----------------------------------------
#

// Start add - Birthday MOD
'L_WHOSBIRTHDAY_WEEK' => ($board_config['birthday_check_day']>1) ? sprintf((($birthday_week_list) ? $lang['Birthday_week'].$birthday_week_list : $lang['Nobirthday_week']), $board_config['birthday_check_day']) : '',
'L_WHOSBIRTHDAY_TODAY' => ($board_config['birthday_check_day']) ? ($birthday_today_list) ? $lang['Birthday_today'].$birthday_today_list : $lang['Nobirthday_today'] : '',
// End add - Birthday MOD

#
#-----[ OPEN ]------------------------------------------------
#
viewtopic.php

#
#-----[ FIND ]------------------------------------------------
#
$sql = "SELECT u.username,

#
#-----[ IN-LINE FIND ]----------------------------------------
#
, u.user_allowsmile

#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
, u.user_birthday, u.user_next_birthday_greeting

#
#-----[ FIND ]------------------------------------------------
#
for($i = 0; $i < $total_posts; $i++)

#
#-----[ BEFORE, ADD ]-----------------------------------------
#

// Start add - Birthday MOD
$this_year = create_date('Y', time(), $board_config['board_timezone']);
$this_date = create_date('md', time(), $board_config['board_timezone']);
// End add - Birthday MOD

#
#-----[ FIND ]------------------------------------------------
#
$poster_id = $postrow[$i]['user_id'];
$poster = ( $poster_id == ANONYMOUS ) ? $lang['Guest'] : $postrow[$i]['username'];

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Birthday MOD
if ( $postrow[$i]['user_birthday'] != 999999 )
{
$poster_birthdate=realdate('md', $postrow[$i]['user_birthday']);
$poster_age = $this_year - realdate ('Y',$postrow[$i]['user_birthday']);
if ($this_date < $poster_birthdate) $poster_age--;
$poster_age = $lang['Age'] . ': ' . $poster_age;
} else
{
$poster_age = '';
}
// End add - Birthday MOD

#
#-----[ FIND ]------------------------------------------------
#
if ( $poster_id == ANONYMOUS && $postrow[$i]['post_username'] != '' )
{
$poster = $postrow[$i]['post_username'];
$poster_rank = $lang['Guest'];

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Birthday MOD
$poster_age = '';
// End add - Birthday MOD

#
#-----[ FIND ]------------------------------------------------
#
'POSTER_NAME' =>

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Birthday MOD
'POSTER_AGE' => $poster_age,
// End add - Birthday MOD

#
#-----[ OPEN ]------------------------------------------------
#
admin/admin_board.php

#
#-----[ FIND ]------------------------------------------------
#
$prune_no = ( !$new['prune_enable'] ) ? "checked=\"checked\"" : "";

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Birthday MOD
$birthday_greeting_yes = ( $new['birthday_greeting'] ) ? "checked=\"checked\"" : "";
$birthday_greeting_no = ( !$new['birthday_greeting'] ) ? "checked=\"checked\"" : "";
$birthday_required_yes = ( $new['birthday_required'] ) ? "checked=\"checked\"" : "";
$birthday_required_no = ( !$new['birthday_required'] ) ? "checked=\"checked\"" : "";
// End add - Birthday MOD

#
#-----[ FIND ]------------------------------------------------
#
"L_ENABLE_PRUNE" =>

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Birthday MOD
"L_ENABLE_BIRTHDAY_GREETING" => $lang['Enable_birthday_greeting'],
"L_BIRTHDAY_GREETING_EXPLAIN" => $lang['Birthday_greeting_expain'],
"L_BIRTHDAY_REQUIRED" => $lang['Birthday_required'],
"L_MAX_USER_AGE" => $lang['Max_user_age'],
"L_MIN_USER_AGE" => $lang['Min_user_age'],
"L_MIN_USER_AGE_EXPLAIN" => $lang['Min_user_age_explain'],
"L_BIRTHDAY_LOOKFORWARD" => $lang['Birthday_lookforward'],
"L_BIRTHDAY_LOOKFORWARD_EXPLAIN" => $lang['Birthday_lookforward_explain'],
// End add - Birthday MOD

#
#-----[ FIND ]------------------------------------------------
#
"PRUNE_NO" =>

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Birthday MOD
"BIRTHDAY_GREETING_YES" => $birthday_greeting_yes,
"BIRTHDAY_GREETING_NO" => $birthday_greeting_no,
"BIRTHDAY_REQUIRED_YES" => $birthday_required_yes,
"BIRTHDAY_REQUIRED_NO" => $birthday_required_no,
"MAX_USER_AGE" => $new['max_user_age'],
"MIN_USER_AGE" => $new['min_user_age'],
"BIRTHDAY_LOOKFORWARD" => $new['birthday_check_day'],
// End add - Birthday MOD

#
#-----[ OPEN ]------------------------------------------------
#
admin/admin_users.php

#
#-----[ FIND ]------------------------------------------------
#
$interests = ( !empty($HTTP_POST_VARS['interests']) ) ? trim(strip_tags( $HTTP_POST_VARS['interests'] ) ) : '';

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Birthday MOD
if (isset($HTTP_POST_VARS['birthday']) )
{
$birthday = intval ($HTTP_POST_VARS['birthday']);
$b_day = realdate('j',$birthday);
$b_md = realdate('n',$birthday);
$b_year = realdate('Y',$birthday);
} else
{
$b_day = ( isset($HTTP_POST_VARS['b_day']) ) ? intval ($HTTP_POST_VARS['b_day']) : 0;
$b_md = ( isset($HTTP_POST_VARS['b_md']) ) ? intval ($HTTP_POST_VARS['b_md']) : 0;
$b_year = ( isset($HTTP_POST_VARS['b_year']) ) ? intval ($HTTP_POST_VARS['b_year']) : 0;
$birthday = mkrealdate($b_day,$b_md,$b_year);
}
$next_birthday_greeting = ( !empty($HTTP_POST_VARS['next_birthday_greeting']) ) ? intval( $HTTP_POST_VARS['next_birthday_greeting'] ) : 0;
// End add - Birthday MOD

#
#-----[ FIND ]------------------------------------------------
#
//
// Update entry in DB

#
#-----[ BEFORE, ADD ]-----------------------------------------
#

// Start add - Birthday MOD
// find the birthday values, reflected by the $lang['Submit_date_format']
if ($b_day || $b_md || $b_year) //if a birthday is submited, then validate it
{
$user_age=(date('md')>=$b_md.(($b_day <= 9) ? '0':'').$b_day) ? date('Y') - $b_year : date('Y') - $b_year - 1 ;
// Check date, maximum / minimum user age
if (!checkdate($b_md,$b_day,$b_year))
{
$error = TRUE;
if( isset($error_msg) )$error_msg .= "<br />";
$error_msg .= $lang['Wrong_birthday_format'];
} else
if ($user_age>$board_config['max_user_age'])
{
$error = TRUE;
if( isset($error_msg) )$error_msg .= "<br />";
$error_msg .= sprintf($lang['Birthday_to_high'],$board_config['max_user_age']);
} else
if ($user_age<$board_config['min_user_age'])
{
$error = TRUE;
if( isset($error_msg) )$error_msg .= "<br />";
$error_msg .= sprintf($lang['Birthday_to_low'],$board_config['min_user_age']);
} else
{
$birthday = ($error) ? $birthday : mkrealdate($b_day,$b_md,$b_year);
}
} else $birthday = ($error) ? '' : 999999;
// End add - Birthday MOD

#
#-----[ FIND ]------------------------------------------------
#
$sql = "UPDATE " . USERS_TABLE . "
SET

#
#-----[ IN-LINE FIND ]----------------------------------------
#
str_replace("\'", "''", $interests) . "'

#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
, user_birthday='$birthday', user_next_birthday_greeting=$next_birthday_greeting

#
#-----[ FIND ]------------------------------------------------
#
$interests = htmlspecialchars($this_userdata['user_interests']);

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Birthday MOD
$next_birthday_greeting = $this_userdata['user_next_birthday_greeting'];
if ($this_userdata['user_birthday']!=999999)
{
$birthday = realdate($lang['Submit_date_format'],$this_userdata['user_birthday']);
$b_day = realdate('j',$this_userdata['user_birthday']);
$b_md = realdate('n',$this_userdata['user_birthday']);
$b_year = realdate('Y',$this_userdata['user_birthday']);
} else
{
$b_day = '';
$b_md = '';
$b_year = '';
$birthday = '';
}
// End add - Birthday MOD

#
#-----[ FIND ]------------------------------------------------
#
$s_hidden_fields .= '<input type="hidden" name="interests" value="' . str_replace("\"", "&quot;", $interests) . '" />';

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Birthday MOD
$s_hidden_fields .= '<input type="hidden" name="birthday" value="'.$birthday.'" />';
$s_hidden_fields .= '<input type="hidden" name="next_birthday_greeting" value="'.$next_birthday_greeting.'" />';
// End add - Birthday MOD

#
#-----[ FIND ]------------------------------------------------
#
"body" => "admin/user_edit_body.tpl")
);

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Birthday MOD
$s_b_day = '<span class="genmed">' . $lang['Day'] . '&nbsp;</span><select name="b_day" size="1" class="gensmall">
<option value="0">&nbsp;-&nbsp;</option>
<option value="1">&nbsp;1&nbsp;</option>
<option value="2">&nbsp;2&nbsp;</option>
<option value="3">&nbsp;3&nbsp;</option>
<option value="4">&nbsp;4&nbsp;</option>
<option value="5">&nbsp;5&nbsp;</option>
<option value="6">&nbsp;6&nbsp;</option>
<option value="7">&nbsp;7&nbsp;</option>
<option value="8">&nbsp;8&nbsp;</option>
<option value="9">&nbsp;9&nbsp;</option>
<option value="10">&nbsp;10&nbsp;</option>
<option value="11">&nbsp;11&nbsp;</option>
<option value="12">&nbsp;12&nbsp;</option>
<option value="13">&nbsp;13&nbsp;</option>
<option value="14">&nbsp;14&nbsp;</option>
<option value="15">&nbsp;15&nbsp;</option>
<option value="16">&nbsp;16&nbsp;</option>
<option value="17">&nbsp;17&nbsp;</option>
<option value="18">&nbsp;18&nbsp;</option>
<option value="19">&nbsp;19&nbsp;</option>
<option value="20">&nbsp;20&nbsp;</option>
<option value="21">&nbsp;21&nbsp;</option>
<option value="22">&nbsp;22&nbsp;</option>
<option value="23">&nbsp;23&nbsp;</option>
<option value="24">&nbsp;24&nbsp;</option>
<option value="25">&nbsp;25&nbsp;</option>
<option value="26">&nbsp;26&nbsp;</option>
<option value="27">&nbsp;27&nbsp;</option>
<option value="28">&nbsp;28&nbsp;</option>
<option value="29">&nbsp;29&nbsp;</option>
<option value="30">&nbsp;30&nbsp;</option>
<option value="31">&nbsp;31&nbsp;</option>
</select>&nbsp;&nbsp;';
$s_b_md = '<span class="genmed">' . $lang['Month'] . '&nbsp;</span><select name="b_md" size="1" class="gensmall">
<option value="0">&nbsp;-&nbsp;</option>
<option value="1">&nbsp;'.$lang['datetime']['January'].'&nbsp;</option>
<option value="2">&nbsp;'.$lang['datetime']['February'].'&nbsp;</option>
<option value="3">&nbsp;'.$lang['datetime']['March'].'&nbsp;</option>
<option value="4">&nbsp;'.$lang['datetime']['April'].'&nbsp;</option>
<option value="5">&nbsp;'.$lang['datetime']['May'].'&nbsp;</option>
<option value="6">&nbsp;'.$lang['datetime']['June'].'&nbsp;</option>
<option value="7">&nbsp;'.$lang['datetime']['July'].'&nbsp;</option>
<option value="8">&nbsp;'.$lang['datetime']['August'].'&nbsp;</option>
<option value="9">&nbsp;'.$lang['datetime']['September'].'&nbsp;</option>
<option value="10">&nbsp;'.$lang['datetime']['October'].'&nbsp;</option>
<option value="11">&nbsp;'.$lang['datetime']['November'].'&nbsp;</option>
<option value="12">&nbsp;'.$lang['datetime']['December'].'&nbsp;</option>
</select>&nbsp;&nbsp;';
$s_b_day= str_replace("value=\"".$b_day."\">", "value=\"".$b_day."\" SELECTED>" ,$s_b_day);
$s_b_md = str_replace("value=\"".$b_md."\">", "value=\"".$b_md."\" SELECTED>" ,$s_b_md);
$s_b_year = '<span class="genmed">' . $lang['Year'] . '&nbsp;</span><input type="text" class="post" style="width: 50px" name="b_year" size="4" maxlength="4" value="' . $b_year . '" />&nbsp;&nbsp;';
$i = 0;
$s_birthday = '';
for ($i=0;$i<=strlen($lang['Submit_date_format']);$i++)
{
switch ($lang['Submit_date_format'][$i])
{
case d: $s_birthday .=$s_b_day;break;
case m: $s_birthday .=$s_b_md;break;
case Y: $s_birthday .=$s_b_year;break;
}
}
// End add - Birthday MOD

#
#-----[ FIND ]------------------------------------------------
#
'INTERESTS' =>

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Birthday MOD
'NEXT_BIRTHDAY_GREETING' => $next_birthday_greeting,
'S_BIRTHDAY' => $s_birthday,
// End add - Birthday MOD

#
#-----[ FIND ]------------------------------------------------
#
'L_INTERESTS' =>

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Birthday MOD
'L_BIRTHDAY' => $lang['Birthday'],
'L_NEXT_BIRTHDAY_GREETING' => $lang['Next_birthday_greeting'],
'L_NEXT_BIRTHDAY_GREETING_EXPLAIN' => $lang['Next_birthday_greeting_expain'],
// End add - Birthday MOD

#
#-----[ OPEN ]------------------------------------------------
#
includes/functions.php

#
#-----[ FIND ]------------------------------------------------
#
?>

#
#-----[ BEFORE, ADD ]-----------------------------------------
#

// Add function mkrealdate for Birthday MOD
// the originate php "mktime()", does not work proberly on all OS, especially when going back in time
// before year 1970 (year 0), this function "mkrealtime()", has a mutch larger valid date range,
// from 1901 - 2099. it returns a "like" UNIX timestamp divided by 86400, so
// calculation from the originate php date and mktime is easy.
// mkrealdate, returns the number of day (with sign) from 1.1.1970.

function mkrealdate($day,$month,$birth_year)
{
// range check months
if ($month<1 || $month>12) return "error";
// range check days
switch ($month)
{
case 1: if ($day>31) return "error";break;
case 2: if ($day>29) return "error";
$epoch=$epoch+31;break;
case 3: if ($day>31) return "error";
$epoch=$epoch+59;break;
case 4: if ($day>30) return "error" ;
$epoch=$epoch+90;break;
case 5: if ($day>31) return "error";
$epoch=$epoch+120;break;
case 6: if ($day>30) return "error";
$epoch=$epoch+151;break;
case 7: if ($day>31) return "error";
$epoch=$epoch+181;break;
case 8: if ($day>31) return "error";
$epoch=$epoch+212;break;
case 9: if ($day>30) return "error";
$epoch=$epoch+243;break;
case 10: if ($day>31) return "error";
$epoch=$epoch+273;break;
case 11: if ($day>30) return "error";
$epoch=$epoch+304;break;
case 12: if ($day>31) return "error";
$epoch=$epoch+334;break;
}
$epoch=$epoch+$day;
$epoch_Y=sqrt(($birth_year-1970)*($birth_year-1970));
$leapyear=round((($epoch_Y+2) / 4)-.5);
if (($epoch_Y+2)%4==0)
{// curent year is leapyear
$leapyear--;
if ($birth_year >1970 && $month>=3) $epoch=$epoch+1;
if ($birth_year <1970 && $month<3) $epoch=$epoch-1;
} else if ($month==2 && $day>28) return "error";//only 28 days in feb.
//year
if ($birth_year>1970)
$epoch=$epoch+$epoch_Y*365-1+$leapyear;
else
$epoch=$epoch-$epoch_Y*365-1-$leapyear;
return $epoch;
}

// Add function realdate for Birthday MOD
// the originate php "date()", does not work proberly on all OS, especially when going back in time
// before year 1970 (year 0), this function "realdate()", has a mutch larger valid date range,
// from 1901 - 2099. it returns a "like" UNIX date format (only date, related letters may be used, due to the fact that
// the given date value should already be divided by 86400 - leaving no time information left)
// a input like a UNIX timestamp divided by 86400 is expected, so
// calculation from the originate php date and mktime is easy.
// e.g. realdate ("m d Y", 3) returns the string "1 3 1970"

// UNIX users should replace this function with the below code, since this should be faster
//
//function realdate($date_syntax="Ymd",$date=0)
//{ return create_date($date_syntax,$date*86400+1,0); }

function realdate($date_syntax="Ymd",$date=0)
{
global $lang;
$i=2;
if ($date>=0)
{
return create_date($date_syntax,$date*86400+1,0);
} else
{
$year= -(date%1461);
$days = $date + $year*1461;
while ($days<0)
{
$year--;
$days+=365;
if ($i++==3)
{
$i=0;
$days++;
}
}
}
$leap_year = ($i==0) ? TRUE : FALSE;
$months_array = ($i==0) ?
array (0,31,60,91,121,152,182,213,244,274,305,335,366) :
array (0,31,59,90,120,151,181,212,243,273,304,334,365);
for ($month=1;$month<12;$month++)
{
if ($days<$months_array[$month]) break;
}

$day=$days-$months_array[$month-1]+1;
//you may gain speed performance by remove som of the below entry's if they are not needed/used
return strtr ($date_syntax, array(
'a' => '',
'A' => '',
'\\d' => 'd',
'd' => ($day>9) ? $day : '0'.$day,
'\\D' => 'D',
'D' => $lang['day_short'][($date-3)%7],
'\\F' => 'F',
'F' => $lang['month_long'][$month-1],
'g' => '',
'G' => '',
'H' => '',
'h' => '',
'i' => '',
'I' => '',
'\\j' => 'j',
'j' => $day,
'\\l' => 'l',
'l' => $lang['day_long'][($date-3)%7],
'\\L' => 'L',
'L' => $leap_year,
'\\m' => 'm',
'm' => ($month>9) ? $month : '0'.$month,
'\\M' => 'M',
'M' => $lang['month_short'][$month-1],
'\\n' => 'n',
'n' => $month,
'O' => '',
's' => '',
'S' => '',
'\\t' => 't',
't' => $months_array[$month]-$months_array[$month-1],
'w' => '',
'\\y' => 'y',
'y' => ($year>29) ? $year-30 : $year+70,
'\\Y' => 'Y',
'Y' => $year+1970,
'\\z' => 'z',
'z' => $days,
'\\W' => '',
'W' => '') );
}
// End add - Birthday MOD

#
#-----[ OPEN ]------------------------------------------------
#
includes/page_header.php

#
#-----[ FIND ]------------------------------------------------
#
//
// Obtain number of new private messages
// if user is logged in
//
if ( ($userdata['session_logged_in']) && (empty($gen_simple_header)) )
{

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Birthday MOD
// see if user has or have had birthday, also see if greeting are enabled
if ( $userdata['user_birthday']!=999999 && $board_config['birthday_greeting'] && create_date('Ymd', time(), $board_config['default_timezone']) >= $userdata['user_next_birthday_greeting'].realdate ('md',$userdata['user_birthday'] ) )
{
$sql = "UPDATE " . USERS_TABLE . "
SET user_next_birthday_greeting = " . (create_date('Y', time(), $board_config['board_timezone'])+1) . "
WHERE user_id = " . $userdata['user_id'];
if( !$status = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Could not update next_birthday_greeting for user.", "", __LINE__, __FILE__, $sql);
}
$template->assign_var("GREETING_POPUP",
"<script language=\"Javascript\" type=\"text/javascript\"><!--
window.open('".append_sid('birthday_popup.'.$phpEx)."', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400');
//-->
</script>");
} //Sorry user shall not have a greeting this year
// End add - Birthday MOD

#
#-----[ OPEN ]------------------------------------------------
#
includes/usercp_avatar.php

#
#-----[ FIND ]------------------------------------------------
#
function display_avatar_gallery(

#
#-----[ IN-LINE FIND ]----------------------------------------
#
)

#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
, &$birthday

#
#-----[ FIND ]------------------------------------------------
#
$params = array(

#
#-----[ IN-LINE FIND ]----------------------------------------
#
);

#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
, 'birthday'

#
#-----[ OPEN ]------------------------------------------------
#
includes/usercp_register.php

#
#-----[ FIND ]------------------------------------------------
#
$signature = str_replace('<br />', "\n", $signature);

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Birthday MOD
if (isset($HTTP_POST_VARS['birthday']) )
{
$birthday = intval ($HTTP_POST_VARS['birthday']);
if ($birthday!=999999)
{
$b_day = realdate('j',$birthday);
$b_md = realdate('n',$birthday);
$b_year = realdate('Y',$birthday);
}
} else
{
$b_day = ( isset($HTTP_POST_VARS['b_day']) ) ? intval ($HTTP_POST_VARS['b_day']) : 0;
$b_md = ( isset($HTTP_POST_VARS['b_md']) ) ? intval ($HTTP_POST_VARS['b_md']) : 0;
$b_year = ( isset($HTTP_POST_VARS['b_year']) ) ? intval ($HTTP_POST_VARS['b_year']) : 0;
if ($b_day && $b_md && $b_year)
{
$birthday = mkrealdate($b_day,$b_md,$b_year);
} else
{
$birthday = 999999;
}
}
// End add - Birthday MOD

#
#-----[ FIND ]------------------------------------------------
#
$avatar_sql = user_avatar_gallery($mode, $error, $error_msg, $user_avatar_local);
}

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Birthday MOD
// find the birthday values, reflected by the $lang['Submit_date_format']
if ($b_day || $b_md || $b_year) //if a birthday is submited, then validate it
{
$user_age=(date('md')>=$b_md.(($b_day <= 9) ? '0':'').$b_day) ? date('Y') - $b_year : date('Y') - $b_year - 1 ;
// Check date, maximum / minimum user age
if (!checkdate($b_md,$b_day,$b_year))
{
$error = TRUE;
if( isset($error_msg) )$error_msg .= "<br />";
$error_msg .= $lang['Wrong_birthday_format'];
} else
if ($user_age>$board_config['max_user_age'])
{
$error = TRUE;
if( isset($error_msg) )$error_msg .= "<br />";
$error_msg .= sprintf($lang['Birthday_to_high'],$board_config['max_user_age']);
} else
if ($user_age<$board_config['min_user_age'])
{
$error = TRUE;
if( isset($error_msg) )$error_msg .= "<br />";
$error_msg .= sprintf($lang['Birthday_to_low'],$board_config['min_user_age']);
} else
{
$birthday = ($error) ? $birthday : mkrealdate($b_day,$b_md,$b_year);
$next_birthday_greeting = (date('md')<$b_md.(($b_day <= 9) ? '0':'').$b_day) ? date('Y'):date('Y')+1 ;
}
} else
{
if ($board_config['birthday_required'])
{
$error = TRUE;
if( isset($error_msg) )$error_msg .= "<br />";
$error_msg .= sprintf($lang['Birthday_require']);
}
$birthday = 999999;
}
// End add - Birthday MOD

#
#-----[ FIND ]------------------------------------------------
#
$sql = "UPDATE " . USERS_TABLE . "
SET

#
#-----[ IN-LINE FIND ]----------------------------------------
#
str_replace("\'", "''", $interests) . "'

#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
, user_birthday = '$birthday', user_next_birthday_greeting = '$next_birthday_greeting'

#
#-----[ FIND ]------------------------------------------------
#
# NOTICE - IMPORTENT SECURITY RISK
#
# If you some how do not preform the following VERY carefully you have the
# potential to compromise your forum SECURITY, your users may easyly get ADMIN access if you make mistake
# meny users do make mistake in the step, so please be very exact, if this fail, then do not run your code on live forum
#
$sql = "INSERT INTO " . USERS_TABLE . "

#
#-----[ IN-LINE FIND ]----------------------------------------
#
, user_active, user_actkey)

#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
, user_birthday, user_next_birthday_greeting

#
#-----[ FIND ]------------------------------------------------
#
VALUES ($user_id,

#
#-----[ IN-LINE FIND ]----------------------------------------
#
, ";

#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
, '$birthday', '$next_birthday_greeting'

#
#-----[ FIND ]------------------------------------------------
#
$interests = $userdata['user_interests'];

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Birthday MOD
$birthday = $userdata['user_birthday'];
// End add - Birthday MOD

#
#-----[ FIND ]------------------------------------------------
#
display_avatar_gallery($mode

#
#-----[ IN-LINE FIND ]----------------------------------------
#
);

#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
, $birthday

#
#-----[ FIND ]------------------------------------------------
#
if ( $error )
{
$template->set_filenames(array(

#
#-----[ BEFORE, ADD ]-----------------------------------------
#

// Start add - Birthday MOD
if ( $birthday!=999999 )
{
$b_day = realdate('j', $birthday);
$b_md = realdate('n', $birthday);
$b_year = realdate('Y', $birthday);
$birthday = realdate($lang['Submit_date_format'], $birthday);
} else
{
$b_day = '';
$b_md = '';
$b_year = '';
$birthday = '';
}
// End add - Birthday MOD

#
#-----[ FIND ]------------------------------------------------
#
//
// Let's do an overall check for settings/versions which would prevent

#
#-----[ BEFORE, ADD ]-----------------------------------------
#

// Start add - Birthday MOD
$s_b_day = '<span class="genmed">' . $lang['Day'] . '&nbsp;</span><select name="b_day" size="1" class="gensmall">
<option value="0">&nbsp;-&nbsp;</option>
<option value="1">&nbsp;1&nbsp;</option>
<option value="2">&nbsp;2&nbsp;</option>
<option value="3">&nbsp;3&nbsp;</option>
<option value="4">&nbsp;4&nbsp;</option>
<option value="5">&nbsp;5&nbsp;</option>
<option value="6">&nbsp;6&nbsp;</option>
<option value="7">&nbsp;7&nbsp;</option>
<option value="8">&nbsp;8&nbsp;</option>
<option value="9">&nbsp;9&nbsp;</option>
<option value="10">&nbsp;10&nbsp;</option>
<option value="11">&nbsp;11&nbsp;</option>
<option value="12">&nbsp;12&nbsp;</option>
<option value="13">&nbsp;13&nbsp;</option>
<option value="14">&nbsp;14&nbsp;</option>
<option value="15">&nbsp;15&nbsp;</option>
<option value="16">&nbsp;16&nbsp;</option>
<option value="17">&nbsp;17&nbsp;</option>
<option value="18">&nbsp;18&nbsp;</option>
<option value="19">&nbsp;19&nbsp;</option>
<option value="20">&nbsp;20&nbsp;</option>
<option value="21">&nbsp;21&nbsp;</option>
<option value="22">&nbsp;22&nbsp;</option>
<option value="23">&nbsp;23&nbsp;</option>
<option value="24">&nbsp;24&nbsp;</option>
<option value="25">&nbsp;25&nbsp;</option>
<option value="26">&nbsp;26&nbsp;</option>
<option value="27">&nbsp;27&nbsp;</option>
<option value="28">&nbsp;28&nbsp;</option>
<option value="29">&nbsp;29&nbsp;</option>
<option value="30">&nbsp;30&nbsp;</option>
<option value="31">&nbsp;31&nbsp;</option>
</select>&nbsp;&nbsp;';
$s_b_md = '<span class="genmed">' . $lang['Month'] . '&nbsp;</span><select name="b_md" size="1" class="gensmall">
<option value="0">&nbsp;-&nbsp;</option>
<option value="1">&nbsp;'.$lang['datetime']['January'].'&nbsp;</option>
<option value="2">&nbsp;'.$lang['datetime']['February'].'&nbsp;</option>
<option value="3">&nbsp;'.$lang['datetime']['March'].'&nbsp;</option>
<option value="4">&nbsp;'.$lang['datetime']['April'].'&nbsp;</option>
<option value="5">&nbsp;'.$lang['datetime']['May'].'&nbsp;</option>
<option value="6">&nbsp;'.$lang['datetime']['June'].'&nbsp;</option>
<option value="7">&nbsp;'.$lang['datetime']['July'].'&nbsp;</option>
<option value="8">&nbsp;'.$lang['datetime']['August'].'&nbsp;</option>
<option value="9">&nbsp;'.$lang['datetime']['September'].'&nbsp;</option>
<option value="10">&nbsp;'.$lang['datetime']['October'].'&nbsp;</option>
<option value="11">&nbsp;'.$lang['datetime']['November'].'&nbsp;</option>
<option value="12">&nbsp;'.$lang['datetime']['December'].'&nbsp;</option>
</select>&nbsp;&nbsp;';
$s_b_day= str_replace("value=\"".$b_day."\">", "value=\"".$b_day."\" SELECTED>" ,$s_b_day);
$s_b_md = str_replace("value=\"".$b_md."\">", "value=\"".$b_md."\" SELECTED>" ,$s_b_md);
$s_b_year = '<span class="genmed">' . $lang['Year'] . '&nbsp;</span><input type="text" class="post" style="width: 50px" name="b_year" size="4" maxlength="4" value="' . $b_year . '" />&nbsp;&nbsp;';
$i = 0;
$s_birthday = '';
for ($i=0; $i<=strlen($lang['Submit_date_format']); $i++)
{
switch ($lang['Submit_date_format'][$i])
{
case d: $s_birthday .= $s_b_day;break;
case m: $s_birthday .= $s_b_md;break;
case Y: $s_birthday .= $s_b_year;break;
}
}
// End add - Birthday MOD

#
#-----[ FIND ]------------------------------------------------
#
'OCCUPATION' =>
'INTERESTS' =>

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Birthday MOD
'S_BIRTHDAY' => $s_birthday,
'BIRTHDAY_REQUIRED' => ($board_config['birthday_required']) ? '*' : '',
// End add - Birthday MOD

#
#-----[ FIND ]------------------------------------------------
#
'L_INTERESTS' =>

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Birthday MOD
'L_BIRTHDAY' => $lang['Birthday'],
// End add - Birthday MOD

#
#-----[ OPEN ]------------------------------------------------
#
includes/usercp_viewprofile.php

#
#-----[ FIND ]------------------------------------------------
#
//
// Generate page

#
#-----[ BEFORE, ADD ]-----------------------------------------
#

// Start add - Birthday MOD
if ($profiledata['user_birthday']!=999999)
{
$user_birthday = realdate($lang['DATE_FORMAT'], $profiledata['user_birthday']);
} else
{
$user_birthday = $lang['No_birthday_specify'];
}
// End add - Birthday MOD

#
#-----[ FIND ]------------------------------------------------
#
'INTERESTS' =>

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Birthday MOD
'BIRTHDAY' => $user_birthday,
// End add - Birthday MOD

#
#-----[ FIND ]------------------------------------------------
#
'L_INTERESTS' =>

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Birthday MOD
'L_BIRTHDAY' => $lang['Birthday'],
// End add - Birthday MOD

#
#-----[ OPEN ]------------------------------------------------
#
language/lang_english/lang_admin.php

#
#-----[ FIND ]------------------------------------------------
#
?>

#
#-----[ BEFORE, ADD ]-----------------------------------------
#

// Start add - Birthday MOD
$lang['Birthday_required'] = 'Force users to submit a birthday';
$lang['Enable_birthday_greeting'] = 'Enable birthday greetings';
$lang['Birthday_greeting_expain'] = 'Users who have submitted a birthday can have a birthday greeting, when thy visit the board';
$lang['Next_birthday_greeting'] = 'Next birthday popup year';
$lang['Next_birthday_greeting_expain'] = 'This field keeps track of the next year the user shall have a birthday greeting';
$lang['Wrong_next_birthday_greeting'] = 'The supplied, next birthday popup year, was not valid, please try again';
$lang['Max_user_age'] = 'Maximum user age';
$lang['Min_user_age'] = 'Minimum user age';
$lang['Birthday_lookforward'] = 'Birthday look forward';
$lang['Birthday_lookforward_explain'] = 'Number of days the script shall look forward for users with a birthday';
// End add - Birthday MOD

#
#-----[ OPEN ]------------------------------------------------
#
language/lang_english/lang_main.php

#
#-----[ FIND ]------------------------------------------------
#
?>

#
#-----[ BEFORE, ADD ]-----------------------------------------
#

// Start add - Birthday MOD
$lang['Birthday'] = 'Birthday';
$lang['No_birthday_specify'] = 'None Specified';
$lang['Age'] = 'Age';
$lang['Wrong_birthday_format'] = 'The birthday format was entered incorrectly.';
$lang['Birthday_to_high'] = 'Sorry, this site, does not accept user older than %d years old';
$lang['Birthday_require'] = 'your Birthday are required on this site';
$lang['Birthday_to_low'] = 'Sorry, this site, does not accept user yonger than %d years old';
$lang['Submit_date_format'] = 'd-m-Y'; //php date() format - Note: ONLY d, m and Y may be used and SHALL ALL be used (different seperators are accepted)
$lang['Birthday_greeting_today'] = 'We would like to wish you congratulatons on reaching %s years old today.<br /><br /> The Management';//%s is substituted with the users age
$lang['Birthday_greeting_prev'] = 'We would like to give you a belated congratulatons for becoming %s years old on the %s.<br /><br /> The Management';//%s is substituted with the users age, and birthday
$lang['Greeting_Messaging'] = 'Congratulations';
$lang['Birthday_today'] = 'Users with a birthday today:';
$lang['Birthday_week'] = 'Users with a birthday within the next %d days:';
$lang['Nobirthday_week'] = 'No users are having a birthday in the upcoming %d days'; // %d is substitude with the number of days
$lang['Nobirthday_today'] = 'No users have a birthday today';
$lang['Year'] = 'Year';
$lang['Month'] = 'Month';
$lang['Day'] = 'Day';

// NOTE: Please do not translate the folowing 4 lines !
// They are automatically translated into your language
$lang['day_short'] = array ($lang['datetime']['Sun'],$lang['datetime']['Mon'],$lang['datetime']['Tue'],$lang['datetime']['Wed'],$lang['datetime']['Thu'],$lang['datetime']['Fri'],$lang['datetime']['Sat']);
$lang['day_long'] = array ($lang['datetime']['Sunday'],$lang['datetime']['Monday'],$lang['datetime']['Tuesday'],$lang['datetime']['Wednesday'],$lang['datetime']['Thursday'],$lang['datetime']['Friday'],$lang['datetime']['Saturday']);
$lang['month_short'] = array ($lang['datetime']['Jan'],$lang['datetime']['Feb'],$lang['datetime']['Mar'],$lang['datetime']['Apr'],$lang['datetime']['May'],$lang['datetime']['Jun'],$lang['datetime']['Jul'],$lang['datetime']['Aug'],$lang['datetime']['Sep'],$lang['datetime']['Oct'],$lang['datetime']['Nov'],$lang['datetime']['Dec']);
$lang['month_long'] = array ($lang['datetime']['January'],$lang['datetime']['February'],$lang['datetime']['March'],$lang['datetime']['April'],$lang['datetime']['May'],$lang['datetime']['June'],$lang['datetime']['July'],$lang['datetime']['August'],$lang['datetime']['September'],$lang['datetime']['October'],$lang['datetime']['November'],$lang['datetime']['December']);
// End add - Birthday MOD

#
#-----[ OPEN ]------------------------------------------------
#
# Make sure to edit this file for every theme you use!
#
templates/subSilver/index_body.tpl

#
#-----[ FIND ]------------------------------------------------
#
<td class="row1" align="center" valign="middle" rowspan

#
#-----[ IN-LINE FIND ]----------------------------------------
#
# This value can be different, if other mods, add +1 to the value
#
2

#
#-----[ IN-LINE REPLACE WITH ]--------------------------------
#
# The find value can be different, if other mods, add +1 to the value
#
3

#
#-----[ FIND ]------------------------------------------------
#
{LOGGED_IN_USER_LIST}</span></td>
</tr>

#
#-----[ AFTER, ADD ]------------------------------------------
#

<!-- Start add - Birthday MOD -->
<tr>
<td class="row1" align="left"><span class="gensmall">{L_WHOSBIRTHDAY_TODAY}<br />{L_WHOSBIRTHDAY_WEEK}</span></td>
</tr>
<!-- End add - Birthday MOD -->

#
#-----[ OPEN ]------------------------------------------------
#
# Make sure to edit this file for every theme you use!
#
templates/subSilver/overall_header.tpl

#
#-----[ FIND ]------------------------------------------------
#
<!-- END switch_enable_pm_popup -->

#
#-----[ AFTER, ADD ]------------------------------------------
#

<!-- Start add - Birthday MOD -->
{GREETING_POPUP}
<!-- End add - Birthday MOD -->

#
#-----[ OPEN ]------------------------------------------------
#
# Make sure to edit this file for every theme you use!
#
templates/subSilver/profile_add_body.tpl

#
#-----[ FIND ]------------------------------------------------
#
<input type="text" class="post"style="width: 200px" name="interests" size="35" maxlength="150" value="{INTERESTS}" />
</td>
</tr>

#
#-----[ AFTER, ADD ]------------------------------------------
#

<!-- Start add - Birthday MOD -->
<tr>
<td class="row1"><span class="gen">{L_BIRTHDAY}:{BIRTHDAY_REQUIRED}</span></td>
<td class="row2"><span class="gen">{S_BIRTHDAY}</span></td>
</tr>
<!-- End add - Birthday MOD -->

#
#-----[ OPEN ]------------------------------------------------
#
# Make sure to edit this file for every theme you use!
#
templates/subSilver/profile_view_body.tpl

#
#-----[ FIND ]------------------------------------------------
#
<td> <b><span class="gen">{INTERESTS}</span></b></td>
</tr>

#
#-----[ AFTER, ADD ]------------------------------------------
#

<!-- Start add - Birthday MOD -->
<tr>
<td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_BIRTHDAY}:</span></td>
<td><b><span class="gen">{BIRTHDAY}</span></b></td>
</tr>
<!-- End add - Birthday MOD -->

#
#-----[ OPEN ]------------------------------------------------
#
# Make sure to edit this file for every theme you use!
#
templates/subSilver/viewtopic_body.tpl

#
#-----[ FIND ]------------------------------------------------
#
{postrow.POSTER_AVATAR}<br /><br />

#
#-----[ IN-LINE FIND ]----------------------------------------
#
{postrow.POSTER_AVATAR}<br /><br />

#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
{postrow.POSTER_AGE}<br />

#
#-----[ OPEN ]------------------------------------------------
#
# Make sure to edit this file for every theme you use!
#
templates/subSilver/admin/board_config_body.tpl

#
#-----[ FIND ]------------------------------------------------
#
{PRUNE_NO} /> {L_NO}</td>
</tr>

#
#-----[ AFTER, ADD ]------------------------------------------
#

<!-- Start add - Birthday MOD -->
<tr>
<td class="row1">{L_BIRTHDAY_REQUIRED}<br /></td>
<td class="row2"><input type="radio" name="birthday_required" value="1" {BIRTHDAY_REQUIRED_YES} /> {L_YES}&nbsp;&nbsp;<input type="radio" name="birthday_required" value="0" {BIRTHDAY_REQUIRED_NO} /> {L_NO}</td>
</tr>
<tr>
<td class="row1">{L_ENABLE_BIRTHDAY_GREETING}<br /><span class="gensmall">{L_BIRTHDAY_GREETING_EXPLAIN}</span></td>
<td class="row2"><input type="radio" name="birthday_greeting" value="1" {BIRTHDAY_GREETING_YES} /> {L_YES}&nbsp;&nbsp;<input type="radio" name="birthday_greeting" value="0" {BIRTHDAY_GREETING_NO} /> {L_NO}</td>
</tr>
<tr>
<td class="row1">{L_MAX_USER_AGE}<br /></td>
<td class="row2"><input class="post" type="text" size="4" maxlength="4" name="max_user_age" value="{MAX_USER_AGE}" /></td>
</tr>
<tr>
<td class="row1">{L_MIN_USER_AGE}<br /><span class="gensmall">{L_MIN_USER_AGE_EXPLAIN}</span></td>
<td class="row2"><input class="post" type="text" size="4" maxlength="4" name="min_user_age" value="{MIN_USER_AGE}" /></td>
</tr>
<tr>
<td class="row1">{L_BIRTHDAY_LOOKFORWARD}<br /><span class="gensmall">{L_BIRTHDAY_LOOKFORWARD_EXPLAIN}</span></td>
<td class="row2"><input class="post" type="text" size="3" maxlength="3" name="birthday_check_day" value="{BIRTHDAY_LOOKFORWARD}" /></td>
</tr>
<!-- End add - Birthday MOD -->

#
#-----[ OPEN ]------------------------------------------------
#
# Make sure to edit this file for every theme you use!
#
templates/subSilver/admin/user_edit_body.tpl

#
#-----[ FIND ]------------------------------------------------
#
<input class="post" type="text" name="interests" size="35" maxlength="150" value="{INTERESTS}" />
</td>
</tr>

#
#-----[ AFTER, ADD ]------------------------------------------
#

<!-- Start add - Birthday MOD -->
<tr>
<td class="row1"><span class="gen">{L_BIRTHDAY}</span></td>
<td class="row2">{S_BIRTHDAY}</td>
</tr>
<tr>
<td class="row1"><span class="gen">{L_NEXT_BIRTHDAY_GREETING}:</span><br /><span class="gensmall">{L_NEXT_BIRTHDAY_GREETING_EXPLAIN}<br /></span></td>
<td class="row2"><input class="post" type="text" name="next_birthday_greeting" size="5" maxlength="4" value="{NEXT_BIRTHDAY_GREETING}" /></td>
</tr>
<!-- End add - Birthday MOD -->

#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
# EoM


Et oui, en plus c'est en Anglais !! LoL

Voil? j'esp?re que ?? vous aura ?clairer un peu, je tenais ? vous faire partager cet aspect technique, et si parmis vous y'en a certains qui veulent se lancer dans un forum PHP faites moi signe je vous aiderai volontier :wink:

Ciao 8)
Image
Fondateur

FondateurJP
Avatar de l’utilisateur
 
Messages: 5208
Age: 50
Inscription: Mar 5 AoĂ» 2003 17:50
Localisation: Var

1994 Nissan 100NX 1.6L 102cv
Hors ligne


Messagepar p0lux » Mer 4 FĂ©v 2004 07:20

ben je pense que quelques personnes te dirons merci pour ce petit tut's ;)
Image
http://www.adn357.net/ - Dessins, Mixs Persos, Complots (limite parano le type) et plein d'autres trucs.
CarAudio -> Em-phaser Ex15T3 15" 700w, 2x Beyma Lb 100w, 2x Kit eclatàƒÂ© Focal 100w - Amp: Sony Xplod 1000w, Beyma 2x100w ... - Enjoy :)
[Suprem NX-POWER]

[Suprem NX-POWER]p0lux
Avatar de l’utilisateur
 
Messages: 1779
Age: 43
Inscription: Mar 16 Sep 2003 10:11
Localisation: Perpignan / Toulouse
Hors ligne


Messagepar killer » Mer 4 FĂ©v 2004 11:16

Ha ouai, jpensais pas que c'?tait comme ca :!:
Moi osi je fais du PHP :wink: Dailleurs jsuis en stage en ce moment :!:
Mick
100 NX 1.6L Carbu de 91
[Suprem NX-POWER]

[Suprem NX-POWER]killer
Avatar de l’utilisateur
 
Messages: 1470
Age: 43
Inscription: Mer 6 AoĂ» 2003 13:18
Localisation: Chartres (28)
Hors ligne


Messagepar tof » Mer 4 FĂ©v 2004 11:32

J' COMPREND RIEN
1.6L - 102cv - '94
des jantes et c'est tout !!!
Membre donateur

Membre donateurtof
Avatar de l’utilisateur
 
Messages: 190
Inscription: Lun 20 Oct 2003 09:14
Localisation: 60 OISE
Hors ligne


Messagepar ben199 » Mer 4 FĂ©v 2004 14:10

tof a Ă©crit:J' COMPREND RIEN



Alors on est 2 :wink:
Image Firefox Image Thunderbird Image
[NX-POWER]

[NX-POWER]ben199
Avatar de l’utilisateur
 
Messages: 836
Age: 41
Inscription: Sam 10 Jan 2004 17:46
Localisation: BELGIQUE, Bruxelles, Anderlecht
Hors ligne


Messagepar JP » Mer 4 FĂ©v 2004 15:50

en fait c'est simple si on comprend l'anglais , vous allez voir :

exemple :

#-----[ OPEN ]------------------------------------------------
#
index.php

#
#-----[ FIND ]------------------------------------------------
#
//
// Start output of page

#
#-----[ BEFORE, ADD ]-----------------------------------------
#
// Birthday Mod, Show users with birthday
$sql = ($board_config['birthday_check_day']) ? "SELECT user_id, username, user_birthday,user_level FROM " . USERS_TABLE. " WHERE user_birthday!=999999 ORDER BY username" :"";
if($result = $db->sql_query($sql))
{
if (!empty($result))



Ca veut dire :

1) OPEN (ouvrir) le fichier "index.php" , un fichier qui est sur le forum, que je dos modifier comme suit :

2) dans ce fichier il faut rechercher le texte suivant : "//
// Start output of page "

3) ensuite on me demande "BEFORE, ADD" ce qui veut dire qu'avant le texte recherch?, je dois ajouter les codes suivants :

"// Birthday Mod, Show users with birthday
$sql = ($board_config['birthday_check_day']) ? "SELECT user_id, username, user_birthday,user_level FROM " . USERS_TABLE. " WHERE user_birthday!=999999 ORDER BY username" :"";
if($result = $db->sql_query($sql))
{
if (!empty($result)) [/size]"

Je fais copier-coller et c'est tout :wink:

Et ainsi de suite ... donc c'est pas si dur que ??, faut ouvrir un fichier, ajouter du code, ou en supprimer, enregistrer, ouvrir un autre fichier, etc etc etc ... c'est juste chiant car c'est long ! LoL

Voil?, j'espere que c'est plus clair 8)
Image
Fondateur

FondateurJP
Avatar de l’utilisateur
 
Messages: 5208
Age: 50
Inscription: Mar 5 AoĂ» 2003 17:50
Localisation: Var

1994 Nissan 100NX 1.6L 102cv
Hors ligne


Messagepar Franky » Mer 4 FĂ©v 2004 16:02

tres interressant tout ?a! :)
----------------------------------------------------------------------------
[Suprem NX-POWER+]

[Suprem NX-POWER+]Franky
Avatar de l’utilisateur
 
Messages: 2935
Age: 58
Inscription: Mar 16 Sep 2003 09:47
Localisation: Strasbourg
Hors ligne
Voiture: 100nx GTI BlackMagic


Messagepar p0lux » Mer 4 FĂ©v 2004 16:15

ca c'est un beau language.. le php :)
killer tu code ?
Image
http://www.adn357.net/ - Dessins, Mixs Persos, Complots (limite parano le type) et plein d'autres trucs.
CarAudio -> Em-phaser Ex15T3 15" 700w, 2x Beyma Lb 100w, 2x Kit eclatàƒÂ© Focal 100w - Amp: Sony Xplod 1000w, Beyma 2x100w ... - Enjoy :)
[Suprem NX-POWER]

[Suprem NX-POWER]p0lux
Avatar de l’utilisateur
 
Messages: 1779
Age: 43
Inscription: Mar 16 Sep 2003 10:11
Localisation: Perpignan / Toulouse
Hors ligne


Messagepar Mike » Mer 4 FĂ©v 2004 16:17

Moi ca va je comprend a peu pres jen ai deja fai mais je suis d'origine programmeur COBOL (et oui yen fau...)
C'àƒÂ©tait ma NX...
Image Image
STOP aux Jackys!!
mike@nx-power.com
[Dieu de la 100NX]

[Dieu de la 100NX]Mike
Avatar de l’utilisateur
 
Messages: 3701
Age: 42
Inscription: Sam 11 Oct 2003 10:44
Localisation: 60-02
Hors ligne


Messagepar tof » Mer 4 FĂ©v 2004 16:23

ALLEZ C'EST PARTI

MAINTENANT ON SE PARLE TOUS EN "PHP"

OK ???
NAN ???
Bon tant pis...
1.6L - 102cv - '94
des jantes et c'est tout !!!
Membre donateur

Membre donateurtof
Avatar de l’utilisateur
 
Messages: 190
Inscription: Lun 20 Oct 2003 09:14
Localisation: 60 OISE
Hors ligne


Messagepar killer » Mer 4 FĂ©v 2004 22:19

p0lux a Ă©crit:killer tu code ?


Oui je programme en php :wink:
La jsuis en train de faire un site Intranet pour une entreprise, mais je fais tout de A ? Z...c'est grave long
Mick
100 NX 1.6L Carbu de 91
[Suprem NX-POWER]

[Suprem NX-POWER]killer
Avatar de l’utilisateur
 
Messages: 1470
Age: 43
Inscription: Mer 6 AoĂ» 2003 13:18
Localisation: Chartres (28)
Hors ligne


Messagepar p0lux » Jeu 5 FĂ©v 2004 11:07

echo "lol.. si t'as besoin de quoi que ce soit n'hesite pas ;)";

moi mon dernier projet en date -> polux.adn357.net
c'est sur un p'tit serveur chez moi. un genre de browser a la ftp.. enfin pas facile a expliquer.. faut le voir pour piger :P
Image
http://www.adn357.net/ - Dessins, Mixs Persos, Complots (limite parano le type) et plein d'autres trucs.
CarAudio -> Em-phaser Ex15T3 15" 700w, 2x Beyma Lb 100w, 2x Kit eclatàƒÂ© Focal 100w - Amp: Sony Xplod 1000w, Beyma 2x100w ... - Enjoy :)
[Suprem NX-POWER]

[Suprem NX-POWER]p0lux
Avatar de l’utilisateur
 
Messages: 1779
Age: 43
Inscription: Mar 16 Sep 2003 10:11
Localisation: Perpignan / Toulouse
Hors ligne


Messagepar JP » Jeu 5 FĂ©v 2004 20:34

J'y suis pass? p0lux, j'ai pas tout compris mais c'est bien fait car tr?s interactif, chapeau :wink:
Image
Fondateur

FondateurJP
Avatar de l’utilisateur
 
Messages: 5208
Age: 50
Inscription: Mar 5 AoĂ» 2003 17:50
Localisation: Var

1994 Nissan 100NX 1.6L 102cv
Hors ligne


Messagepar p0lux » Jeu 5 FĂ©v 2004 20:37

merci, ya bcp de travail :)
Image
http://www.adn357.net/ - Dessins, Mixs Persos, Complots (limite parano le type) et plein d'autres trucs.
CarAudio -> Em-phaser Ex15T3 15" 700w, 2x Beyma Lb 100w, 2x Kit eclatàƒÂ© Focal 100w - Amp: Sony Xplod 1000w, Beyma 2x100w ... - Enjoy :)
[Suprem NX-POWER]

[Suprem NX-POWER]p0lux
Avatar de l’utilisateur
 
Messages: 1779
Age: 43
Inscription: Mar 16 Sep 2003 10:11
Localisation: Perpignan / Toulouse
Hors ligne



 

Retourner vers Mises Ă  jour du site & Informations

Qui est en ligne

Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 0 invités