4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: IcEcReaM on February 10, 2006, 08:20:12 AM

Title: [MOD] Birthday Mod v1.0
Post by: IcEcReaM on February 10, 2006, 08:20:12 AM
[ Introduction ]
With this Mod Users are able to input their birthday when registering or when updating their profile.
Fully configurable if
- birthday age also shown in profile next to birthday
- countdown to be shown in profile till next birthday
- if the birthday must be entered or is optional on registration/updating profile
- that todays birthdays are shown on index
- it's also possible to enter only day & month, then for year 0000 must be entered
- Birthday message can set when a user enters the site and has birthday (can be set on/off)

German:
Mit diesem Mod können User bei der Registrierung oder in ihren Einstellungen ihr Geburtstagsdatum eingeben.
Dieser Mod bietet verschiedene Einstellungsmöglichkeiten:
- einstellbar ob Alter im Profil auch angezeigt wird.
- einstellbarer Countdown bis zum nächsten Geburtstag im Profil
- einstellbar ob der Geburtstag eingegeben werden muss oder nur optional eingegeben werden kann.
- einstellbar ob die jeweilg heutigen Geburtstag auf der Indexseite erscheinen
- möglich nur Monat & Tag als Geburtstag einzugeben, dann muss für die Jahreseingabe "0000" eingegeben werden.
- wenn ein Geburtstagskind die Seite betritt kann eine Geburtstagsnachricht gesetzt werden.

Demo Link (http://icecreamtest.ic.funpic.de/gallery/index.php)

[ Changed Files ]
includes/functions.php
includes/db_field_definitions.php
includes/session.php
register.php
index.php
member.php
templates/register_form.html
templates/member_profile.html
templates/member_editprofile.html
templates/home.html
admin/settings.php
lang/<your language>/admin.php
lang/<your language>/main.php

[ Installation ]

First Backup your Files

Step 1
Open  register.php

Find
Code: [Select]
$user_icq = (isset($HTTP_POST_VARS['user_icq'])) ? ((intval(trim($HTTP_POST_VARS['user_icq']))) ? intval(trim($HTTP_POST_VARS['user_icq'])) : "") : "";
below insert
Code: [Select]
  $user_birthday_day = (isset($HTTP_POST_VARS['user_birthday_day'])) ? un_htmlspecialchars(trim($HTTP_POST_VARS['user_birthday_day'])) : "";
  $user_birthday_month = (isset($HTTP_POST_VARS['user_birthday_month'])) ? un_htmlspecialchars(trim($HTTP_POST_VARS['user_birthday_month'])) : "";
  $user_birthday_year = (isset($HTTP_POST_VARS['user_birthday_year'])) ? un_htmlspecialchars(trim($HTTP_POST_VARS['user_birthday_year'])) : "";
 

Find
Code: [Select]
if ($user_password == "") {above insert
Code: [Select]
    //Birthday Mod
    if (!$user_birthday = check_birthday($user_birthday_day,$user_birthday_month,$user_birthday_year,$config['birthday_required'])) {
      $msg .= (($msg != "") ?  "<br />" : "").$field_error = preg_replace("/".$site_template->start."field_name".$site_template->end."/siU", str_replace(":", "", $lang['birthday']), $lang['field_required']);
      $error = 1;
    }

Find
Code: [Select]
$activationkey = get_random_key(USERS_TABLE, get_user_table_field("", $user_table_fields['user_activationkey']));above insert

Code: [Select]
    // Birthday Mod
    $additional_field_sql .= ", ".get_user_table_field("", "birthday");
    $additional_value_sql .= ", '$user_birthday'";

Find
Code: [Select]
$site_template->register_vars(array(
      "user_name" => htmlspecialchars(stripslashes($user_name)),
above insert
Code: [Select]
  $birthday_day_options = "<option value=\"\">--</option>\n";
  $birthday_month_options = "<option value=\"\">--</option>\n";

  for ($i=1;$i<=31;$i++){
    $birthday_day_options .= "<option value=\"".sprintf("%02d",$i)."\"".(($i == $user_birthday_day) ? "selected" : "").">".$i."</option>\n";

  }
  for ($i=1;$i<=12;$i++){                                                                                                                        //getmonth($i)
    $birthday_month_options .= "<option value=\"".sprintf("%02d",$i)."\"".(($i == $user_birthday_month) ? "selected" : "").">".$lang['months'][sprintf("%02d",$i)]."</option>\n";
  }

Find
Code: [Select]
"user_icq" => $user_icq,below insert
Code: [Select]
      "birthday_day_options" => $birthday_day_options,
      "birthday_month_options" => $birthday_month_options,
      "user_birthday_year" => $user_birthday_year,
      "lang_day" => $lang['day'],
      "lang_month" => $lang['month'],
      "lang_year" => $lang['year'],

Step 2
Open templates/register_form.html

Find
Code: [Select]
          <tr>
            <td class="row1"><b>{lang_email}</b></td>
            <td class="row1"><input type="text" name="user_email" size="30" class="input" value="{user_email}" /></td>
          </tr>
below insert
Code: [Select]
<!--  Birthday Mod     -->
          <tr>
             <td class="row1"><b>{lang_birthday}</b></td>
             <td class="row1"><table>
                      <tr>
                          <td>{lang_day}</td>
                          <td>{lang_month}</td>
                          <td>{lang_year}</td>
                      </tr>

                      <tr>
                           <td><select name="user_birthday_day">{birthday_day_options} </select></td>
                           <td><select name="user_birthday_month">{birthday_month_options}</select></td>
                           <td><input class="input" name="user_birthday_year" value="{user_birthday_year}" maxlength="4" size="5" type="text">
                           </td>
                      </tr>

            </table></td>
           </tr>
<!--  Birthday Mod     -->

Step 3

Open includes/db_field_definitions.php

Find
Code: [Select]
?>above insert
Code: [Select]
$additional_user_fields['birthday'] = array($lang['birthday'], "text", 0);
Step 4

Open includes/session.php
Find

Code: [Select]
"user_icq" => "user_icq"above insert
Code: [Select]
"birthday" => "birthday",

Step 5

Open member.php

Find

Code: [Select]
      $user_email_button = REPLACE_EMPTY;
    }
and replace with
Code: [Select]
      $user_email_button = REPLACE_EMPTY;
    }
   
    // Birthday Mod
    $user_birthday = (isset($user_row[$user_table_fields['birthday']])) ? $user_row[$user_table_fields['birthday']] : REPLACE_EMPTY;
    if (!empty($user_birthday) && $user_birthday != REPLACE_EMPTY  && $user_row[$user_table_fields['birthday']] != "0000-00-00") {

           $birthday = explode("-",$user_row[$user_table_fields['birthday']]);
           $user_birthday = $birthday[2].".".$lang['months'][sprintf("%02d",$birthday[1])];
           $user_birthday .= ($birthday[0]!="0000") ? " ".$birthday[0]."" : "";
           
           // Show Age in Profile
           if (($config['birthday_show_profile_age'] == 1) && ($age = calc_age ($user_row[$user_table_fields['birthday']]))) {
                $user_birthday .= " ($age)";
           }
           
           // Show Birthdaycountdown in Profile
           if ($config['birthday_profile_countdown'] == 1 && $b_cdown = calc_countdown ($user_row[$user_table_fields['birthday']]))  {

                $site_template->register_vars(array(
                     "lang_birthday_cdown" => $lang['birthday_cdown'],
                     "cdown_days" => $b_cdown['days'],
                     "cdown_hours" => $b_cdown['hours'],
                     "cdown_minutes" => $b_cdown['minutes'],
                     "lang_days" => $lang['days'],
                     "lang_hours" => $lang['hours'],
                     "lang_minutes" => $lang['minutes']
                ));
           }
          // End Show Birthdaycountdown in Profile

    }
    else {
      $user_birthday = REPLACE_EMPTY;
    }
    // Birthday Mod

Find

Code: [Select]
"user_name" => (isset($user_row['user_name'])) ? htmlspecialchars($user_row['user_name']) : REPLACE_EMPTY,insert below
Code: [Select]
"user_birthday" => $user_birthday,
Find

Code: [Select]
$user_invisible = (isset($HTTP_POST_VARS['user_invisible'])) ? intval($HTTP_POST_VARS['user_invisible']) : 0;insert below
Code: [Select]
  $user_birthday_day = (isset($HTTP_POST_VARS['user_birthday_day'])) ? un_htmlspecialchars(trim($HTTP_POST_VARS['user_birthday_day'])) : "";
  $user_birthday_month = (isset($HTTP_POST_VARS['user_birthday_month'])) ? un_htmlspecialchars(trim($HTTP_POST_VARS['user_birthday_month'])) : "";
  $user_birthday_year = (isset($HTTP_POST_VARS['user_birthday_year'])) ? un_htmlspecialchars(trim($HTTP_POST_VARS['user_birthday_year'])) : "";

directly at the same place after

Code: [Select]
$error = 0;insert below
Code: [Select]
  if (!$user_birthday = check_birthday($user_birthday_day,$user_birthday_month,$user_birthday_year,$config['birthday_required'])) {
     $msg .= (($msg != "") ? "<br />" : "").$lang['birthday_error'];
     $error = 1;
  }

Find
Code: [Select]
      $table_fields = $site_db->get_table_fields(USERS_TABLE);
      foreach ($additional_user_fields as $key => $val) {
        if (isset($HTTP_POST_VARS[$key]) && isset($table_fields[$key])) {
          $additional_sql .= ", $key = '".un_htmlspecialchars(trim($HTTP_POST_VARS[$key]))."'";
        }
      }
    }
below insert
Code: [Select]
    // Birthday Mod
    $additional_sql .= ", ".get_user_table_field("", "birthday")." = '$user_birthday'";

Find
Code: [Select]
    $user_icq = $user_info['user_icq'];
  }
and replace with
Code: [Select]
    $user_icq = $user_info['user_icq'];
      $birthday = explode("-",$user_info['birthday']);
    $user_birthday_day = $birthday[2];
    $user_birthday_month = $birthday[1];
    $user_birthday_year = $birthday[0];
  }

  $birthday_day_options = "<option value=\"\">--</option>\n";
  $birthday_month_options = "<option value=\"\">--</option>\n";

  for ($i=1;$i<=31;$i++){
    $birthday_day_options .= "<option value=\"".sprintf("%02d",$i)."\"".(($i == $user_birthday_day) ? "selected" : "").">".$i."</option>\n";

  }
  for ($i=1;$i<=12;$i++){                                                                                                                        //getmonth($i)
    $birthday_month_options .= "<option value=\"".sprintf("%02d",$i)."\"".(($i == $user_birthday_month) ? "selected" : "").">".$lang['months'][sprintf("%02d",$i)]."</option>\n";
  }

Find
Code: [Select]
"user_homepage" => htmlspecialchars(stripslashes($user_homepage)),below insert
Code: [Select]
    "birthday_day_options" => $birthday_day_options,
    "birthday_month_options" => $birthday_month_options,
    "user_birthday_year" => $user_birthday_year,
    "lang_day" => $lang['day'],
    "lang_month" => $lang['month'],
    "lang_year" => $lang['year'],

Step 6

Open templates/member_profile.html

Find
Code: [Select]
        <tr>
          <td class="row2"><b>{lang_icq}</b></td>
          <td class="row2">{if user_icq}<a href="http://wwp.icq.com/scripts/search.dll?to={user_icq}">{user_icq}</a> (<b>{user_icq_status}</b>){endif user_icq}</td>
        </tr>
below insert
Code: [Select]
        <tr>
          <td class="row1"><b>{lang_birthday}</b></td>
          <td class="row1">{if user_birthday}{user_birthday}{endif user_birthday}</td></td>
        </tr>
        {if cdown_days}
        <tr>
          <td class="row2"><b>{lang_birthday_cdown}</b></td>
          <td class="row2">{cdown_days} {lang_days} {cdown_hours} {lang_hours} {cdown_minutes} {lang_minutes} </td></td>
        </tr>
        {endif cdown_days}


Step 7

Open templates/member_editprofile.html

Find
Code: [Select]
           <tr>
            <td class="row2"><b>{lang_icq}</b></td>
            <td class="row2"><input type="text" name="user_icq"  size="30" value="{user_icq}" class="input" /></td>
          </tr>
insert below

Code: [Select]
          <tr>
             <td class="row1"><b>{lang_birthday}</b></td>
             <td class="row1"><table>
                      <tr>
                          <td>{lang_day}</td>
                          <td>{lang_month}</td>
                          <td>{lang_year}</td>
                      </tr>

                      <tr>
                           <td><select name="user_birthday_day">{birthday_day_options}</select></td>
                           <td><select name="user_birthday_month">{birthday_month_options}</select></td>
                           <td><input class="input" name="user_birthday_year" value="{user_birthday_year}" maxlength="4" size="5" type="text"></td>
                      </tr>

            </table></td>
           </tr>

Step 8

Open includes/functions.php

Search at the bottom
Code: [Select]
?>and above insert
Code: [Select]
function check_birthday($birthday_day = "", $birthday_month = "", $birthday_year = "", $valid = 0) {
  $error = 0;
  if($birthday_day && $birthday_month && $birthday_year) {
      switch(strlen($birthday_year)) {
      case 2:
          $birthday_year = "19$birthday_year";
          break;
      case 4:
          break;
      default:
        $birthday_year = "0000";
        if ($valid) $error = 1;
        break;
      }
   $birthday = "$birthday_year-$birthday_month-$birthday_day";
   }
   else {
       $birthday = "0000-00-00";
       $error = 1;
   }
   if ($valid == 1 && ($error || (!ereg("([0-9]{4})-([0-9]{2})-([0-9]{2})", $birthday)))) return false;
   else return $birthday;
}

function calc_age ($birthday = "") {
    $user_birthday = explode("-",$birthday);
    if ($user_birthday[0]!= "0000" && $user_birthday) {
      $today = getdate (time());
      $age = ($today['year'] - $user_birthday[0]);
      if ($age > 0 )  {
      $birthday_thisyear_var = mktime(0,0,0,$user_birthday[1],$user_birthday[2],$today['year']);
      $birthday_thisyear = getdate ($birthday_thisyear_var);
      if ($birthday_thisyear['yday']>$today['yday']) $age--;
      return $age;
      }
      else return false;
    }
}

function calc_countdown ($birthday = "") {
    $user_birthday = explode("-",$birthday);
    if ($user_birthday[1] != "00" && $user_birthday[2] != "00") {
      $today = getdate (time());
      $birthday_thisyear_var = mktime(0,0,0,$user_birthday[1],$user_birthday[2],$today['year']);
      $birthday_thisyear = getdate ($birthday_thisyear_var);
      if ($birthday_thisyear['yday']<=$today['yday']) $birthday_thisyear_var = mktime(0,0,0,$user_birthday[1],$user_birthday[2],$today['year']+1);
      $difference = $birthday_thisyear_var - time();
      if ($difference < 0) $difference = 0;
      $dleft = floor($difference/60/60/24);
      $hleft = floor(($difference - $dleft*60*60*24)/60/60);
      $mleft = floor(($difference - $dleft*60*60*24 - $hleft*60*60)/60);
$return = array(
'days'=>$dleft,
'hours'=>$hleft,
'minutes'=>$mleft,
);
return $return;
    }
    else return false;
}


Step 9

Open admin/settings.php

Find the last line that is like
show_table_separator($setting_group[9], 2, "#setting_group_9");
and notice the number, and then add  1
e.g. if the highest number you can find is $setting_group[9] then the next number will be 10
You need that number to replace it for the XX in the next 2 instructions.

Find
Code: [Select]
show_form_footer($lang['save_changes'], "", 2);above insert
Code: [Select]
  //Birthday Mod
  show_table_separator($setting_group[XX], 2, "#setting_group_XX");
  show_setting_row("birthday_required", "radio");
  show_setting_row("birthday_show_profile_age", "radio");
  show_setting_row("birthday_index", "radio");
  show_setting_row("birthday_profile_countdown", "radio");
  show_setting_row("birthday_message", "radio");
  //Birthday Mod

Don't forget to replace the XX with the number mentioned above.

Step 10

Open lang/<your language>/admin.php
Find
Code: [Select]
?>insert above
Code: [Select]
/*-- Setting-Group XX --*/   // Birthday Mod
$setting_group[XX]="Birthday Config";
$setting['birthday_required'] = "Must be entered a birthday?";
$setting['birthday_show_profile_age'] = "Show also Age in Profile?";
$setting['birthday_index'] = "Show on Index Users have birthday today";
$setting['birthday_profile_countdown'] = "Show Time till next birthday in profile";
$setting['birthday_message'] = "Show Birthday Message on Index (when user has B-Day)";

or in German
Code: [Select]
/*-- Setting-Group XX --*/   // Birthday Mod
$setting_group[XX]="Geburtstags Mod Einstellung";
$setting['birthday_required'] = "Ist der Geburtstag eine Pflichtangabe?";
$setting['birthday_show_profile_age'] = "Alter im Profil anzeigen?";
$setting['birthday_index'] = "Zeige auf der Index die heutigen Geburtstage an";
$setting['birthday_profile_countdown'] = "Geburtstagscountdown im Profil";
$setting['birthday_message'] = "Geburtstagsgruss auf der Index zeigen (für User die Geb. haben)";

Don't forget to replace the XX with the number mentioned above.


Step 11

Open index.php

Find
Code: [Select]
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
above insert:
Code: [Select]
// Birthday Mod  Start Events
if($config['birthday_message'] == 1)  {
    $user_birthday = explode("-",$user_info[$user_table_fields['birthday']]);
    if (($user_birthday[1] == date ("m", time())) && ($user_birthday[2] == date ("d", time()))) {
         $birthday_message = $site_template->parse_template("birthday_message");
         $site_template->register_vars(array(
                      "birthday_message" => $birthday_message
              ));
    }
}
if($config['birthday_index'] == 1)  {
 $currentdate = date("m-d", time());
 
$sql = "SELECT ".get_user_table_field("", "user_id").", ".get_user_table_field("", "user_name").", ".get_user_table_field("", "birthday")."
          FROM ".USERS_TABLE."
          WHERE ".get_user_table_field("", "birthday")." LIKE '%-$currentdate'
          ORDER BY ".get_user_table_field("", "user_name");
$result = $site_db->query($sql);

$birthday_list = "";
   while($row = $site_db->fetch_array($result)) {
        $age = calc_age($row[$user_table_fields['birthday']]);
        $birthday_list .= ($birthday_list) ? ", " : "";
        $birthday_list .= "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row[$user_table_fields['user_id']])."\">".$row[$user_table_fields['user_name']]."</a> (".$age.")";
    }
 
$site_template->register_vars(array(
  "lang_events" => $lang['events'],
  "birthday_list" => $birthday_list,
  "lang_congratulate" => $lang['congratulate']
   ));
}

Step 12

Open templates/home.html

Find
Code: [Select]
{if categories}

insert above
Code: [Select]
                   {if birthday_message}{birthday_message}{endif birthday_message}


Find
Code: [Select]
  {whos_online}
  <br />
insert below
Code: [Select]
<!--  Start Events   -->
{if birthday_list}
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td >
      <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#000000">
        <tr>
          <td valign="top" class="head1">
            <table width="100%" border="0" cellpadding="4" cellspacing="2">
              <tr>
                <td class="head1" valign="top">{lang_events}</td>
              </tr>
            </table></td>
        </tr>

        <tr>
          <td valign="top" >
              <table  width="100%" border="0" cellpadding="4" cellspacing="1" width="98%">
              <tr>
                <td width="40" class="catbgcolor"><img src="{template_url}/images/birthday_baloon.gif" alt=""></td>
                <td class="catbgcolor"><b>{lang_congratulate}</b><br>{birthday_list}</td>
              </tr>
            </table></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<br />
{endif birthday_list}
<!--  End Events   -->

Step 12

Open lang/<your language>/main.php
Find
Code: [Select]
?>insert above
Code: [Select]
//-----------------------------------------------------
//--- Birthday Mod ---------------------------------------
//-----------------------------------------------------

$lang['days'] = "day(s)";
$lang['hours'] = "hour(s)";
$lang['minutes'] = "minute(s)";
$lang['day'] = "day";
$lang['month'] = "month";
$lang['year'] = "year";
$lang['birthday'] = "Birthday:";
$lang['birthday_cdown'] = "Time till next Birthday:";
$lang['birthday_error'] = "Please enter correct birthday";
$lang['months'] = array(
"01" => "January",
"02" => "February",
"03" => "March",
"04" => "April",
"05" => "May",
"06" => "June",
"07" => "July",
"08" => "August",
"09" => "September",
"10" => "October",
"11" => "November",
"12" => "December",
);
$lang['events'] = "Actual Events:";
$lang['congratulate'] = "Congratulations to Birthday:";


or in German /Deutsch:
Code: [Select]
//-----------------------------------------------------
//--- Birthday Mod ---------------------------------------
//-----------------------------------------------------

$lang['days'] = "Tag(e)";
$lang['hours'] = "Stunde(n)";
$lang['minutes'] = "Minute(n)";
$lang['day'] = "Tag";
$lang['month'] = "Monat";
$lang['year'] = "Jahr";
$lang['birthday'] = "Geburtstag:";
$lang['birthday_cdown'] = "Zeit bis zum nchsten Geburtstag:";
$lang['birthday_error'] = "Korrektes Geburtstagsdatum eintragen";
$lang['months'] = array(
"01" => "Januar",
"02" => "Februar",
"03" => "M&auml;rz",
"04" => "April",
"05" => "Mai",
"06" => "Juni",
"07" => "Juli",
"08" => "August",
"09" => "September",
"10" => "Oktober",
"11" => "November",
"12" => "Dezember",
);
$lang['events'] = "Actual Events:";
$lang['congratulate'] = "Congratulations to Birthday:";


an dutch langauge file can be found here:
dutch translation (http://www.4homepages.de/forum/index.php?topic=11558.msg64589#msg64589)

Step 12

Execute the install_birthday.php on your root directory and then delete it.

Step 13
the birthday_baloon.gif must be placed in your templates/<your template folder>/images

Step 14
Upload birthday_message.html in your templates/<your templates/

You can modify your Birthday Message in that template to customize it.

Finished!



For Users that using other mods like these and wont delete the old entries of their user's birthday can use the old database entries if
the entries are given in the format like xxxx-xx-xx  (year-month-day).
That means if in USERS TABLE the field for the birthday entries are saved in DATE Format can use their entries with this mod,
by making some changes.

Here the instructions:
Just replace the value "birthday" with your db field name.

In Step 3
Code: [Select]
$additional_user_fields['birthday'] Instead of birthday use your db filed name

In Step 4
Code: [Select]
"birthday" => "birthday",Instead of => "birthday"  use your db filed name

Edit the birthday_install.php
delete the line
Code: [Select]
"ALTER TABLE `".USERS_TABLE."` ADD `birthday` DATE DEFAULT '0000-00-00' NOT NULL"
Thats all.

I've tested the mod on a fresh & clean 4images installation.



Additional Options / show asterisk (Sternzeichen):
If you want that the asterisk (german: Sternzeichen) should be displayed next to birthday in profile,
follow these steps.

Open includes/functions.php
Search for
Code: [Select]
?>insert above
Code: [Select]
function sternzeichen($tag, $monat) {
    $sternzeichen = array(
        array(mktime(0, 0, 0, 1, 1, date('Y')), mktime(0, 0, 0, 1, 20, date('Y')), 1),
        array(mktime(0, 0, 0, 1, 21, date('Y')), mktime(0, 0, 0, 2, 19, date('Y')), 2),
        array(mktime(0, 0, 0, 2, 20, date('Y')), mktime(0, 0, 0, 3, 20, date('Y')), 3),
        array(mktime(0, 0, 0, 3, 21, date('Y')), mktime(0, 0, 0, 4, 20, date('Y')), 4),
        array(mktime(0, 0, 0, 4, 21, date('Y')), mktime(0, 0, 0, 5, 21, date('Y')), 5),
        array(mktime(0, 0, 0, 5, 22, date('Y')), mktime(0, 0, 0, 6, 21, date('Y')), 6),
        array(mktime(0, 0, 0, 6, 22, date('Y')), mktime(0, 0, 0, 7, 22, date('Y')), 7),
        array(mktime(0, 0, 0, 7, 23, date('Y')), mktime(0, 0, 0, 8, 23, date('Y')), 8),
        array(mktime(0, 0, 0, 8, 24, date('Y')), mktime(0, 0, 0, 9, 23, date('Y')), 9),
        array(mktime(0, 0, 0, 9, 24, date('Y')), mktime(0, 0, 0, 10, 23, date('Y')), 10),
        array(mktime(0, 0, 0, 10, 24, date('Y')), mktime(0, 0, 0, 11, 22, date('Y')), 11),
        array(mktime(0, 0, 0, 11, 23, date('Y')), mktime(0, 0, 0, 12, 21, date('Y')), 12),
        array(mktime(0, 0, 0, 12, 22, date('Y')), mktime(0, 0, 0, 12, 31, date('Y')), 1)
    );

    foreach ($sternzeichen as $value) {
        if ((mktime(0, 0, 0, intval($monat), intval($tag), date('Y')) >= $value[0]) && (mktime(0, 0, 0, $monat, $tag, date('Y')) <= $value[1])) {
            return $value[2];
        }
    }
    return false;
}

Open lang/<your language>/main.php
Search for
Code: [Select]
?>insert above
Code: [Select]
$lang['asterisk'] = "Sternzeichen";
$lang['asterisks'] = array(
  1 => "Steinbock",
       "Wassermann",
       "Fische",
       "Widder",
       "Stier",
       "Zwillinge",
       "Krebs",
       "Löwe",
       "Jungfrau",
       "Waage",
       "Skorpion",
       "Schütze",
       "Steinbock"
);

Open templates/member_profile.html
Search for
Code: [Select]
{user_birthday}
replace it with
Code: [Select]
{user_birthday} {sternzeichen}Note: you can insert {sternzeichen} anywhere you want in that template wherever it should be displayed

Open member.php
Search for
Code: [Select]
// End Show Birthdaycountdown in Profilereplace it with
Code: [Select]
          // End Show Birthdaycountdown in Profile
          $sternzeichen = sternzeichen($birthday[2], $birthday[1]);

search for
Code: [Select]
      "user_birthday" => $user_birthday,and replace it with
Code: [Select]
      "user_birthday" => $user_birthday,
      "sternzeichen" => ($sternzeichen) ? " &nbsp;&nbsp;".$lang['asterisk']." : ".$lang['asterisks'][$sternzeichen]." "  : "",

If you want, that also the asteriks images are displayes next to birthday.
Create in your templates/<your templates>/images/ folder an new folder named sternzeichen
--> templates/<your templates>/images/sternzeichen
There you should place 12 images named from 1.jpg to 12.jpg,
which are the corresponding images like the asterisk.
you can find some images attached. thx to trez for these images.
Here (http://www.4homepages.de/forum/index.php?topic=11558.msg61794#msg61794) you can find also some from Loda



you should use following code instead
Code: [Select]
      "user_birthday" => $user_birthday,
      "sternzeichen" => ($sternzeichen) ? " &nbsp;&nbsp;".$lang['asterisk']." : ".$lang['asterisks'][$sternzeichen]." "  : "",
user following
Code: [Select]
      "sternzeichen" => ($sternzeichen) ? " &nbsp;&nbsp;".$lang['asterisk']." : ".$lang['asterisks'][$sternzeichen]." <img src=\"".TEMPLATE_PATH."/images/sternzeichen/".$sternzeichen.".jpg\" alt=\"".$lang['asterisks'][$sternzeichen]."\">"  : "",
finished!

P.S.: Maybe someone can translate the asteriks language into english.


17.02. Added additonal option

@German Users: check your language/<your language>/main.php
I did a correction above, cause "03" => "M&auml;", should be like this "03" => "M&auml;rz",
Otherwise only Mä is displayed instead of März.
Corrected above.


Installer and needed files are attached.
You can also download it from here: Link (http://icecreamtest.ic.funpic.de/gallery/index.php)
Just log in as 4images/4images.
Of course you can also create your own account (no email verification is needed, cause its an testboard).
Demo can be also seen there.
Title: Re: Birthday Mod v1.0
Post by: mawenzi on February 10, 2006, 10:53:26 AM
... very nice MOD ... especially the birthday countdown ... and the birthday_baloon ...  :wink:
... a very good and clear presentation ...
... thanks for it ...

mawenzi
Title: Re: Birthday Mod v1.0
Post by: Loda on February 10, 2006, 01:59:06 PM
WOW!
thank you very much for this great mod! works perfekt!
only the installation file don't work for me and so i made it manuell.
Title: Re: Birthday Mod v1.0
Post by: insane on February 10, 2006, 02:59:48 PM
whats the db field name?
where can i find it?
do i have to do all again? (i already executed the birthday_install.php)
Title: Re: Birthday Mod v1.0
Post by: TheOracle on February 10, 2006, 04:28:18 PM
Quote

// Birthday Mod
    $additional_sql .= ", ".get_user_table_field("", "birthday")." = '$user_birthday'";


I have been told recently that the get_user_table_field function only complys with the core fields within the USERS_TABLE and not on additional user fields. ;)

Meaning, the above should be changed to :

Code: [Select]

// Birthday Mod
    $additional_sql .= ", birthday" = ".$user_birthday;


;)

In the mean time, could we see a screenshot of this presentation ? ;)
Title: Re: Birthday Mod v1.0
Post by: Stoleti on February 10, 2006, 05:10:21 PM
So this show "Today Birthday's " ?? on Home ?  :roll:
Title: Re: Birthday Mod v1.0
Post by: TheOracle on February 10, 2006, 05:20:23 PM
So this show "Today Birthday's " ?? on Home ?  :roll:

Please read the changed files from the first post. It mentions index.php file. In the mean time, read step 11. ;)
Title: Re: Birthday Mod v1.0
Post by: TheOracle on February 10, 2006, 05:22:59 PM
@icecream:

By the way, since you added this :

Quote

$birthday_list = "";


find :

Quote

$site_template->register_vars(array(
  "lang_events" => $lang['events'],
  "birthday_list" => $birthday_list,
  "lang_congratulate" => $lang['congratulate']
   ));
}


replace with :

Code: [Select]

$site_template->register_vars(array(
  "lang_events" => $lang['events'],
  "birthday_list" => $birthday_list,
  "lang_congratulate" => $lang['congratulate']
   ));

unset ($birthday_list);
}


Then :

Quote

$sql = "SELECT ".get_user_table_field("", "user_id").", ".get_user_table_field("", "user_name").", ".get_user_table_field("", "birthday")."
          FROM ".USERS_TABLE."
          WHERE ".get_user_table_field("", "birthday")." LIKE '%-$currentdate'
          ORDER BY ".get_user_table_field("", "user_name");


to read :

Code: [Select]

$sql = "SELECT ".get_user_table_field("", "user_id").", ".get_user_table_field("", "user_name").", "birthday"
          FROM ".USERS_TABLE."
          WHERE birthday LIKE '%-$currentdate'
          ORDER BY ".get_user_table_field("", "user_name");


;)
Title: Re: Birthday Mod v1.0
Post by: Stoleti on February 10, 2006, 05:37:54 PM
But another question , for who have used the User Age V.1  ?  :oops:

we need uninstall all your make some modifications ? or we can install it without any problem ? :|
Title: Re: Birthday Mod v1.0
Post by: Stoleti on February 10, 2006, 05:54:48 PM
on birthday MOD installer :

Quote
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/blacktra/public_html/test-gallery/birthday_install.php on line 14

 :|
Title: Re: Birthday Mod v1.0
Post by: TheOracle on February 10, 2006, 06:28:46 PM
I could be wrong but

change :

Quote

NOT NULL"


to :

Code: [Select]

NOT NULL",


Then, try the installation file again.
Title: Re: Birthday Mod v1.0
Post by: Stoleti on February 10, 2006, 07:06:34 PM
this have work  :D

So Let's see it working  8)
Title: Re: Birthday Mod v1.0
Post by: Stoleti on February 10, 2006, 07:12:32 PM
Another question its how make it show 1 username by line :

user1 (xx)
user 2 (xx)



 :?:
Title: Re: Birthday Mod v1.0
Post by: TheOracle on February 10, 2006, 07:16:58 PM
In index.php file,

find :

Quote

$birthday_list .= "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row[$user_table_fields['user_id']])."\">".$row[$user_table_fields['user_name']]."</a> (".$age.")";


replace with :

Code: [Select]

$birthday_list .= "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row[$user_table_fields['user_id']])."\">".$row[$user_table_fields['user_name']]."</a> (".$age.")<br />";

Title: Re: Birthday Mod v1.0
Post by: IcEcReaM on February 10, 2006, 10:18:09 PM
... a very good and clear presentation ...

yep, i learned from the others, how it should be,
although it takes a lot of time just for the documention and testing on a fresh 4images install.
Thats why i didn't like to publish such mods.. :mrgreen:

only the installation file don't work for me and so i made it manuell.

Fixed the installation file,
i uploaded the wrong file from the wrong folder.. :oops:




I have been told recently that the get_user_table_field function only complys with the core fields within the USERS_TABLE and not on additional user fields. ;)

In the mean time, could we see a screenshot of this presentation ? ;)

Then look at step 4, then you can use it also.
I had to do it like this way,
so users don't need to delete their old entries if using an another mod,
and what was much important to me i had to do this for me to work because of some other reasons.
So this mod is more flexible and 4images conform.

The code i posted in my first post works the way i did,
also with the get_user_table_fields... don't need to make that changes you posted.


But another question , for who have used the User Age V.1  ?  :oops:

we need uninstall all your make some modifications ? or we can install it without any problem ? :|

You has to do deinstall the other mod, but NOT delete the DB Field,
cause you can use the old entries with this mod again,
just follow the last instructions for users have other mods.

Quote
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/blacktra/public_html/test-gallery/birthday_install.php on line 14

Fixed


Title: Re: Birthday Mod v1.0
Post by: Stoleti on February 10, 2006, 11:24:39 PM
well i've just changed that two steps 3 and 4 and still work perfect !!

 :mrgreen:
Title: Re: Birthday Mod v1.0
Post by: TheOracle on February 10, 2006, 11:39:21 PM
@icecream:

Quote

and what was much important to me i had to do this for me to work because of some other reasons.


Yes, of course. I respect your publishings. ;)

Quote

also with the get_user_table_fields... don't need to make that changes you posted.


Then, perhaps you'd like to read this part of the topic (last line from V@no).

Quote

No, get_user_table_field() function can be used only for "default" fields. For custom fields it not only will not work, but it just not needed Wink
get_user_table_field() function needed only for compability with other software integration, which uses same database.


Source: http://www.4homepages.de/forum/index.php?topic=11208.msg57748#msg57748

;)
Title: Re: Birthday Mod v1.0
Post by: V@no on February 11, 2006, 12:23:07 AM
Then look at step 4, then you can use it also.
I had to do it like this way,
so users don't need to delete their old entries if using an another mod,
and what was much important to me i had to do this for me to work because of some other reasons.
So this mod is more flexible and 4images conform.

The code i posted in my first post works the way i did,
also with the get_user_table_fields... don't need to make that changes you posted.
I also agree with TheOracle. I dont see a reason of doing step 4...
If one has already birthday mod and has different name of the field in the database, and want to use that field instead of adding another, then its easier to rename the field itself (plus there is a chance that the field parameters needed to be changed as well) via phpmyadmin reather then download the php file, change it and reupload...
Well, maybe you have another reason of doing this...I dont know...
Title: Re: Birthday Mod v1.0
Post by: insane on February 11, 2006, 12:31:56 AM
Quote
DB Error: Bad SQL Query: SELECT user_id, user_name, paddygree FROM 4images_users WHERE paddygree LIKE '%-02-11' ORDER BY user_name
Unknown column 'paddygree' in 'field list'

How can i fix this problem?
i changed the "birthday" part from the author already but wrong. don't know where to find the "db field name" or that shit.
Title: Re: Birthday Mod v1.0
Post by: IcEcReaM on February 11, 2006, 12:44:48 AM
ok, then i have to explain it a little bit more detailed.

I had to register field birthday in session.php to make it an "default" field cause of the following reason:

Usually you are right vano,
cause in db_field_definiton.php, when i register a field,
the additonal_sql functions is used and the changes are in effect.

But for this mod i can't use the aditional_field as it usually was made for,
cause from member.php/register.php there aren't submit just the birthday field.
There are submitted 3 values (day/month/year) to use in dropdown options when entering the user's birthday.

So i needed to update the additional_sql manually,
after the additional fields are checked if they are filled or not.
cause no direct HTTP POST VAR for birthday is submitted.

And thats the reason why i did it like this way,
so there is no need to change the whole code, if changing the db field name.

Second reason was the integration in my board, and hold the field name flexibile for future modifications,
if i had to use a other board software and change the field name again.

Of course, you are right vano,
the second possibilty would have been just to change per phpmyadmin the db fieldname,
but i couldn't do that, because of the board integration.
(Otherwise i had to change the board code for db field name modification again)

So i think that was the best way to do it.
I know it's almost very unique to do it like this.

P.S: the additional_field registration is only needed to display users birthday value in admin control,
and register the vars automatically.
Title: Re: Birthday Mod v1.0
Post by: IcEcReaM on February 11, 2006, 12:46:24 AM
Quote
DB Error: Bad SQL Query: SELECT user_id, user_name, paddygree FROM 4images_users WHERE paddygree LIKE '%-02-11' ORDER BY user_name
Unknown column 'paddygree' in 'field list'

How can i fix this problem?
i changed the "birthday" part from the author already but wrong. don't know where to find the "db field name" or that shit.

what is paddygree?
are in this field your birthday datas are stored?



@German Users: check your language/<your language>/main.php
I did a correction above, cause "03" => "M&auml;", should be like this "03" => "M&auml;rz",
Otherwise only Mä is displayed instead of März.
Corrected above.


Title: Re: Birthday Mod v1.0
Post by: Alex_Ok on February 11, 2006, 12:50:38 AM
DB Error: Bad SQL Query: SELECT user_id, user_name, birthday FROM 4images_users WHERE birthday LIKE '%-02-11' ORDER BY user_name
Unknown column 'birthday' in 'field list'

У меня таже проблема :?:
Title: Re: Birthday Mod v1.0
Post by: IcEcReaM on February 11, 2006, 12:52:25 AM
Did you exectued the birthday_install.php?
Title: Re: Birthday Mod v1.0
Post by: V@no on February 11, 2006, 01:20:20 AM
But for this mod i can't use the aditional_field as it usually was made for,
cause from member.php/register.php there aren't submit just the birthday field.
There are submitted 3 values (day/month/year) to use in dropdown options when entering the user's birthday.

So i needed to update the additional_sql manually,
after the additional fields are checked if they are filled or not.
cause no direct HTTP POST VAR for birthday is submitted.

And thats the reason why i did it like this way,
so there is no need to change the whole code, if changing the db field name.
If that would be the only reason, then you could simply modify $HTTP_POST_VARS['birthday'] variable with modifyed value before the additional fields processed in member.php and register.php ;)

Anyways, the mod works - that's all metter ;)
Title: Re: Birthday Mod v1.0
Post by: IcEcReaM on February 11, 2006, 01:39:45 AM
But for this mod i can't use the aditional_field as it usually was made for,
cause from member.php/register.php there aren't submit just the birthday field.
There are submitted 3 values (day/month/year) to use in dropdown options when entering the user's birthday.

So i needed to update the additional_sql manually,
after the additional fields are checked if they are filled or not.
cause no direct HTTP POST VAR for birthday is submitted.

And thats the reason why i did it like this way,
so there is no need to change the whole code, if changing the db field name.
If that would be the only reason, then you could simply modify $HTTP_POST_VARS['birthday'] variable with modifyed value before the additional fields processed in member.php and register.php ;)

Anyways, the mod works - that's all metter ;)

That was the first way i also did,
but for intergration reasons of my board i did it like i posted the mod here,
also i didn't know if it allowed or a "good" way to overwrite a superglobal in this way.
Title: Re: Birthday Mod v1.0
Post by: insane on February 11, 2006, 11:38:00 AM
Quote
DB Error: Bad SQL Query: SELECT user_id, user_name, birthday FROM 4images_users WHERE birthday LIKE '%-02-11' ORDER BY user_name
Unknown column 'birthday' in 'field list'
This is my problem. www.p4ddy-online.de.vu/4images acc: test pw: test
how can i fix it?
Title: Re: Birthday Mod v1.0
Post by: Loda on February 11, 2006, 01:10:03 PM
hi,
in step 5 you insert the step with this code:
Quote
// Birthday Mod
    $additional_sql .= ", ".get_user_table_field("", "birthday")." = '$user_birthday'";
in the first code with the entry:
Quote
$table_fields = $site_db->get_table_fields(USERS_TABLE);
      foreach ($additional_user_fields as $key => $val) {
        if (isset($HTTP_POST_VARS[$key]) && isset($table_fields[$key])) {
          $additional_sql .= ", $key = '".un_htmlspecialchars(trim($HTTP_POST_VARS[$key]))."'";
        }
      }
    }
i have four lines with the code and i take the first one. than you can save the birthday in your profil.

if you had install the old user_age mod in the session.php you change this:
Quote
"birthday" => "birthday",
to this:
Code: [Select]
"birthday" => "user_age_birthday",
Title: Re: Birthday Mod v1.0
Post by: Michael on February 11, 2006, 03:52:05 PM
Funktioniert super  :)

vielen Dank !!!
Title: Re: Birthday Mod v1.0
Post by: timerex on February 12, 2006, 11:31:51 AM
Quote
DB Error: Bad SQL Query: SELECT user_id, user_name, birthday FROM 4images_users WHERE birthday LIKE '%-02-11' ORDER BY user_name
Unknown column 'birthday' in 'field list'
This is my problem. www.p4ddy-online.de.vu/4images acc: test pw: test
how can i fix it?

hab leider das selbe problem
Title: Re: Birthday Mod v1.0
Post by: IcEcReaM on February 13, 2006, 08:29:20 AM
Hast du die birthday_install.php ausgeführt?
Deine Fehlermeldung lässt darauf schliessen, dass die Felder in der DB fehlen.
Ansonsten wäre es noch hilfreich zu wissen,
wie du den Mod installiert hast,
ob neuinstallation oder ob du die Daten aus nem anderen Mod übernommen hast.
Title: Re: Birthday Mod v1.0
Post by: Flatermann on February 13, 2006, 11:34:26 AM
HI everybody.

first of all  i havto explain wy i need this LOL.   We are playing a game Runescape. and i would like to let my users add there real life b-day and the date if there runscape start.  then use this mode that it shows  when a real person hat b-day and show when a runscape figure has birthday :)..  is there a way to use this mod for 22 dates in profil ??
Title: Re: Birthday Mod v1.0
Post by: IcEcReaM on February 13, 2006, 11:59:39 AM
i don't know, if i understand you correctly,
do you mean, that one user can add 2 birthdays, one for real and one for his virtual?
Title: Re: Birthday Mod v1.0
Post by: Flatermann on February 13, 2006, 12:33:00 PM
Umm yes exactly LOL .
Title: Re: Birthday Mod v1.0
Post by: IcEcReaM on February 13, 2006, 01:36:37 PM
Hmm, this isn't very easy, when you don't know much about php,
cause you have to install this mod a second time,
but change soms values and field name for the second installation.

Title: Re: Birthday Mod v1.0
Post by: trez on February 15, 2006, 11:37:07 AM
I've installed it, but i have the following problem: When the user edits his birthday, its not be saved (from the control panel)
But if a new user registers, its saved. How to fix that?
Title: Re: Birthday Mod v1.0
Post by: Loda on February 15, 2006, 11:39:59 AM
I've installed it, but i have the following problem: When the user edits his birthday, its not be saved (from the control panel)
But if a new user registers, its saved. How to fix that?
please read this!:
http://www.4homepages.de/forum/index.php?topic=11558.msg60732#msg60732
Title: Re: Birthday Mod v1.0
Post by: trez on February 15, 2006, 11:50:41 AM
thanks for your help, but i dont understand what i have to change, the line you are talking about looks like this:

code removed

edit: figured it out myself, thank you :)
Title: Re: Birthday Mod v1.0
Post by: trez on February 15, 2006, 04:40:09 PM
just an idea, how about add "astrological sign" *dont know if this is correct on english, so in german: Sternzeichen, based on the user date to the mod?

displayed in the profile, with plain text or gif image? It would be nice.
Title: Re: Birthday Mod v1.0
Post by: trez on February 16, 2006, 07:07:55 AM
Nochmal auf deutsch, kann man irgendwie ein Sternzeichen-MOD mit diesem MOD einbinden? Sodass im Profil das Sternzeichen als text oder bild angezeigt wird ?
Title: Re: Birthday Mod v1.0
Post by: IcEcReaM on February 16, 2006, 08:13:52 AM
Wenn du mir paar hübsche kleine Sternzeichen Bilder raussuchst,
kann ich das bei Gelegenheit in Angriff nehmen.
Bin derzeit gerade noch an was anderem dran.
Title: Re: Birthday Mod v1.0
Post by: trez on February 16, 2006, 10:11:46 AM
natuerlich, du kannst z.B. diese hier benutzen, hab ich fuer ne andere seite erstellt. Man muss die halt nur noch editiren, sprich die bulgarische sprache wegmachen, aber falls du den MOD machen willst kan ich das wenigstens fuer dich uebernehmen :)

(http://213.130.70.51/images/zodii/1.jpg) (http://213.130.70.51/images/zodii/2.jpg) (http://213.130.70.51/images/zodii/3.jpg)
(http://213.130.70.51/images/zodii/4.jpg) (http://213.130.70.51/images/zodii/5.jpg) (http://213.130.70.51/images/zodii/6.jpg)
(http://213.130.70.51/images/zodii/7.jpg) (http://213.130.70.51/images/zodii/8.jpg) (http://213.130.70.51/images/zodii/9.jpg)
(http://213.130.70.51/images/zodii/10.jpg) (http://213.130.70.51/images/zodii/11.jpg) (http://213.130.70.51/images/zodii/12.jpg)
Title: Re: Birthday Mod v1.0
Post by: IcEcReaM on February 17, 2006, 06:33:34 PM
Kannst du mir die Bilder noch bearbeiten,
damit ich sie mit in den ersten Post nehmen kann?

Ansonsten findest du alle nötigen Anleitungsschrite im ersten Post.

Viel Spass.

P.S.: Was ist den aus deiner erweiterten User online Anzeige geworden.
Keine Lust alle 8 Seiten da nochmal durchzulesen,
kannst mich ja per PN anschreiben.
Title: Re: Birthday Mod v1.0
Post by: trez on February 18, 2006, 02:50:15 AM
hier neue bilder fuer dieses super addon (benutze diese bilder auf meiner seite)
(http://www.ggrec.com/zapomnime2/templates/default/images/sternzeichen/1.jpg)(http://www.ggrec.com/zapomnime2/templates/default/images/sternzeichen/2.jpg)(http://www.ggrec.com/zapomnime2/templates/default/images/sternzeichen/3.jpg)
(http://www.ggrec.com/zapomnime2/templates/default/images/sternzeichen/4.jpg)(http://www.ggrec.com/zapomnime2/templates/default/images/sternzeichen/5.jpg)(http://www.ggrec.com/zapomnime2/templates/default/images/sternzeichen/6.jpg)
(http://www.ggrec.com/zapomnime2/templates/default/images/sternzeichen/7.jpg)(http://www.ggrec.com/zapomnime2/templates/default/images/sternzeichen/8.jpg)(http://www.ggrec.com/zapomnime2/templates/default/images/sternzeichen/9.jpg)
(http://www.ggrec.com/zapomnime2/templates/default/images/sternzeichen/10.jpg)(http://www.ggrec.com/zapomnime2/templates/default/images/sternzeichen/11.jpg)(http://www.ggrec.com/zapomnime2/templates/default/images/sternzeichen/12.jpg)

Icecream, was den useronline-mod angeht - bin grad dabei ihn fertigzustellen, stelle ihn online sobald er fertig ist
Title: Re: Birthday Mod v1.0
Post by: Loda on February 18, 2006, 10:48:39 AM
hallo!
ich habe auch mal ein paar sternzeichen gebastelt (griechische).  sie sind im gif format, damit ich einen transparenten hintergrund behalte.
man muss nur dieses in der member.php
Quote
"sternzeichen" => ($sternzeichen) ? " &nbsp;&nbsp;".$lang['asterisk']." : ".$lang['asterisks'][$sternzeichen]." <img src=\"".TEMPLATE_PATH."/images/sternzeichen/".$sternzeichen.".jpg\" alt=\"".$lang['asterisks'][$sternzeichen]."\">"  : "",
durch dieses ersetzen:
Code: [Select]
"sternzeichen" => ($sternzeichen) ? " &nbsp;&nbsp;".$lang['asterisk']." : ".$lang['asterisks'][$sternzeichen]." <img src=\"".TEMPLATE_PATH."/images/sternzeichen/".$sternzeichen.".gif\" alt=\"".$lang['asterisks'][$sternzeichen]."\">"  : "",
Title: Re: Birthday Mod v1.0
Post by: IcEcReaM on February 18, 2006, 05:38:48 PM
Danke euch beiden.
Title: Re: Birthday Mod v1.0
Post by: Michael on February 18, 2006, 06:01:23 PM
Sauberer Zusatz-Mod  :mrgreen:

großes Dankeschön  :D
Title: Re: Birthday Mod v1.0
Post by: V@no on February 18, 2006, 07:59:44 PM
If you want to display zodiac signs:
In global.php place anywhere (or if you are not planning using it anywere else, but on profile page, then place it in member.php, lets say below <?php ):
Code: [Select]
$zodiac_array = array(
  1 => array(19, "capricorn", "aquarius"),
  2 => array(18, "aquarius", "pisces"),
  3 => array(19, "pisces", "aries"),
  4 => array(20, "aries", "taurus"),
  5 => array(21, "taurus", "gemini"),
  6 => array(21, "gemini", "cancer"),
  7 => array(22, "cancer", "leo"),
  8 => array(23, "leo", "virgo"),
  9 => array(23, "virgo", "libra"),
  10 => array(23, "libra", "scorpio"),
  11 => array(22, "scorpio", "sagittarius"),
  12 => array(21, "sagittarius", "capricorn"),
);
in Step 5 (in member.php) find:
Code: [Select]
      $birthday = explode("-",$user_row[$user_table_fields['birthday']]);Insert below:
Code: [Select]
      $zodiac = "";
      $month = intval($birthday[1]);
      if ($month)
      {
        $day = intval($birthday[2]);
        $day = ($day) ? $day : 1;
        $zodiac = $zodiac_array[$month][(($day <= $zodiac_array[$month][0] ) ? 1 : 2)];
      }
      $site_template->register_vars(array(
        "lang_zodiac" => $lang['zodiac'],
        "zodiac" => $zodiac,
        "zodiac_img" => get_gallery_image("zodiac/".$zodiac.".gif"),
        "zodiac_name" => $lang['zodiac_names'][$zodiac],
      ));

Then in lang/<your language>/main.php insert:
Code: [Select]
$lang['zodiac'] = "Zodiac sign";
$lang['zodiac_names'] = array(
  "" => "N/A",
  "aquarius" => "Aquarius",
  "pisces" => "Pisces",
  "aries" => "Aries",
  "taurus" => "Taurus",
  "gemini" => "Gemini",
  "cancer" => "Cancer",
  "leo" => "Leo",
  "virgo" => "Virgo",
  "libra" => "Libra",
  "scorpio" => "Scorpio",
  "sagittarius" => "Sagittarius",
  "capricorn" => "Capricorn",
);

And finaly in member_profile.html template you can use the following tags:
{if zodiac}{endif zodiac} - use these to ensure that it wont show "broken" image if no month was specifyed
{lang_zodiac} - will display "Zodiac sign" from language file
{zodiac_img} - will show address to the image. Use it as <img src="{zodiac_img}">
{zodiac_name} - will show name of the zodiac sign (from language file) you can place it as title="{zodiac_name}" inside <img> tag.

Oh, almost forgot, the images must be placed in templates/<your template>/images/zodiac/ folder, they must be in GIF format (its easy to change though in the first step), filenames must be the following:
aquarius.gif
pisces.gif
aries.gif
taurus.gif
gemini.gif
cancer.gif
leo.gif
virgo.gif
libra.gif
scorpio.gif
sagittarius.gif
capricorn.gif
Title: Re: Birthday Mod v1.0
Post by: glitzer on February 19, 2006, 02:46:15 PM
*heul*
bei mir funzt das nicht:(

ich hab zwar eine alte version drauf gehabt hab das auf user_age_birthday geändert, aber es kommt zwar keine Fehlermeldung aber es wird nix gezeigt.
Bitte um HILFEEEEEE
(http://www.e-cardss.com/birthday.gif)

 ich denke es liegt entweder an meiner Db_definiations oder an meiner sessions.php:
Meine db_field_definitions sieht so aus:
Code: [Select]
// Example for additional image fields:
//$additional_image_fields['image_photographer'] = array($lang['image_photographer'], "text", 1);

// Example for additional user fields
//$additional_user_fields['user_adress'] = array($lang['user_adress'], "text", 1);
$additional_user_fields['user_avatar'] = array($lang['avatar'], "avatar", 0);
$additional_user_fields['user_birth_day'] = array($lang['user_birth_day'], "text", 1);
$additional_user_fields['user_birth_month'] = array($lang['user_birth_month'], "text", 1);
$additional_user_fields['user_birth_year'] = array($lang['user_birth_year'], "value", 1);
$additional_user_fields['user_posts'] = array($lang['user_posts'], "text", 0);
$additional_user_fields['profile_hits'] = array($lang['profile_hits'], "text", 0);
$additional_user_fields['user_hobby'] = array($lang['hobby'], "text", 0);
$var = array("------------",
"---Europe---",
bla bla
die länder..eh klar brauchen wir nicht aufzählen weil soviele sind..hab ich rausgenommen..
""Other"
);
$additional_user_fields['user_country'] = array($lang['user_country'], "dropdown", 0, $var, 0, 0, 0, 1);
$additional_user_fields['user_gender'] = array($lang['user_gender'], "dropdown", 0, array("b" => "keine Angabe", "m" => "männlich", "w" => "weiblich"), 1, 0, 0, 0);
$additional_user_fields['user_leitsatz'] = array($lang['leitsatz'], "text", 0);
$additional_user_fields['user_age_birthday'] = array($lang['birthday'], "text", 0);

und meine sessions.php
Code: [Select]
if (!defined('ROOT_PATH')) {
  die("Security violation");
}
/*
  MOD VISITORS COUNTRY FLAGS
  START INSERT
*/
    if (!class_exists("GeoIP"))
    {
      include(ROOT_PATH."includes/geoip.inc");
    }
   
    $gi = geoip_open(ROOT_PATH."includes/GeoIP.dat",GEOIP_STANDARD);
    $countries = array();
/*
  MOD VISITORS COUNTRY FLAGS
  END INSERT
*/
//-----------------------------------------------------
//--- Start Configuration -----------------------------
//-----------------------------------------------------

define('SESSION_NAME', 'sessionid');

$user_table_fields = array(
  "user_id" => "user_id",
  "user_level" => "user_level",
  "user_name" => "user_name",
  "user_password" => "user_password",
  "user_email" => "user_email",
  "user_showemail" => "user_showemail",
  "user_allowemails" => "user_allowemails",
  "user_invisible" => "user_invisible",
  "user_joindate" => "user_joindate",
  "user_activationkey" => "user_activationkey",
  "user_lastaction" => "user_lastaction",
  "user_location" => "user_location",
  "user_lastvisit" => "user_lastvisit",
  "user_comments" => "user_comments",
  "user_homepage" => "user_homepage",
"birthday" => "user_age_birthday",
  "user_icq" => "user_icq"
);

//-----------------------------------------------------
//--- End Configuration -------------------------------
//-----------------------------------------------------

function get_user_table_field($add, $user_field) {
  global $user_table_fields;
  return (!empty($user_table_fields[$user_field])) ? $add.$user_table_fields[$user_field] : "";
}

class Session {

  var $session_id;
  var $user_ip;
  var $user_location;
  var $current_time;
  var $session_timeout;
  var $mode = "get";
  var $session_info = array();
  var $user_info = array();

  function Session() {
    global $config;
    $this->session_timeout = $config['session_timeout'] * 60;
    $this->user_ip = $this->get_user_ip();
    $this->user_location = $this->get_user_location();
    $this->current_time = time();

    // Stop adding SID to URLs
    @ini_set('session.use_trans_sid', 0);

    session_name(urlencode(SESSION_NAME));
    session_start();

    $this->demand_session();
  }

  function set_cookie_data($name, $value, $permanent = 1) {
    $cookie_expire = ($permanent) ? $this->current_time + 60 * 60 * 24 * 365 : 0;
    $cookie_name = COOKIE_NAME.$name;
    setcookie($cookie_name, $value, $cookie_expire, COOKIE_PATH, COOKIE_DOMAIN, COOKIE_SECURE);
  }

  function read_cookie_data($name) {
    global $HTTP_COOKIE_VARS;
    $cookie_name = COOKIE_NAME.$name;
    return (isset($HTTP_COOKIE_VARS[$cookie_name])) ? $HTTP_COOKIE_VARS[$cookie_name] : false;
  }

  function get_session_id() {
    if (SID == '') {
      $this->mode = "cookie";
    }

    $this->session_id = session_id();
  }

  function demand_session() {
    $this->get_session_id();
    if (!$this->load_session_info()) {
      $this->delete_old_sessions();
      $user_id = ($this->read_cookie_data("userid")) ? intval($this->read_cookie_data("userid")) : GUEST;
      $this->start_session($user_id);
    }
    else {
      $this->user_info = $this->load_user_info($this->session_info['session_user_id']);
      $update_cutoff = ($this->user_info['user_id'] != GUEST) ? $this->current_time - $this->user_info['user_lastaction'] : $this->current_time - $this->session_info['session_lastaction'];
      if ($update_cutoff > 60) {
        $this->update_session();
        $this->delete_old_sessions();
      }
    }
  }

  function start_session($user_id = GUEST, $login_process = 0) {
    global $site_db;

    $this->user_info = $this->load_user_info($user_id);
    if ($this->user_info['user_id'] != GUEST && !$login_process) {
      if ($this->read_cookie_data("userpass") == $this->user_info['user_password'] && $this->user_info['user_level'] > USER_AWAITING) {
        $this->set_cookie_data("userpass", $this->user_info['user_password']);
      }
      else {
        $this->set_cookie_data("userpass", "", 0);
        $this->user_info = $this->load_user_info(GUEST);
      }
    }

    //if (!$login_process) {
      $sql = "REPLACE INTO ".SESSIONS_TABLE."
              (session_id, session_user_id, session_lastaction, session_location, session_ip)
              VALUES
              ('$this->session_id', ".$this->user_info['user_id'].", $this->current_time, '$this->user_location', '$this->user_ip')";
      $site_db->query($sql);
    //}

    $this->session_info['session_user_id'] = $this->user_info['user_id'];
    $this->session_info['session_lastaction'] = $this->current_time;
    $this->session_info['session_location'] = $this->user_location;
    $this->session_info['session_ip'] = $this->user_ip;

    if ($this->user_info['user_id'] != GUEST) {
      $this->user_info['user_lastvisit'] = (!empty($this->user_info['user_lastaction'])) ? $this->user_info['user_lastaction'] : $this->current_time;
      $sql = "UPDATE ".USERS_TABLE."
              SET ".get_user_table_field("", "user_lastaction")." = $this->current_time, ".get_user_table_field("", "user_location")." = '$this->user_location', ".get_user_table_field("", "user_lastvisit")." = ".$this->user_info['user_lastvisit']."
              WHERE ".get_user_table_field("", "user_id")." = ".$this->user_info['user_id'];
      $site_db->query($sql);
    }
    $this->set_cookie_data("lastvisit", $this->user_info['user_lastvisit']);
    $this->set_cookie_data("userid", $this->user_info['user_id']);
    return true;
  }

  function login($user_name = "", $user_password = "", $auto_login = 0, $set_auto_login = 1) {
    global $site_db, $user_table_fields;

    if (empty($user_name) || empty($user_password)) {
      return false;
    }
    $sql = "SELECT ".get_user_table_field("", "user_id").get_user_table_field(", ", "user_password")."
            FROM ".USERS_TABLE."
            WHERE ".get_user_table_field("", "user_name")." = '$user_name' AND ".get_user_table_field("", "user_level")." <> ".USER_AWAITING;
    $row = $site_db->query_firstrow($sql);

    $user_id = (isset($row[$user_table_fields['user_id']])) ? $row[$user_table_fields['user_id']] : GUEST;
    $user_password = md5($user_password);
    if ($user_id != GUEST) {
      if ($row[$user_table_fields['user_password']] == $user_password) {
        $sql = "UPDATE ".SESSIONS_TABLE."
                SET session_user_id = $user_id
                WHERE session_id = '$this->session_id'";
        $site_db->query($sql);
        if ($set_auto_login) {
          $this->set_cookie_data("userpass", ($auto_login) ? $user_password : "");
        }
        $this->start_session($user_id, 1);
        return true;
      }
    }
    return false;
  }

  function logout($user_id) {
    global $site_db;
    $sql = "DELETE FROM ".SESSIONS_TABLE."
            WHERE session_id = '$this->session_id' OR session_user_id = $user_id";
    $site_db->query($sql);
    $this->set_cookie_data("userpass", "", 0);
    $this->set_cookie_data("userid", GUEST);

    $this->session_info = array();

    return true;
  }

  function delete_old_sessions() {
    global $site_db;
    $expiry_time = $this->current_time - $this->session_timeout;
    $sql = "DELETE FROM ".SESSIONS_TABLE."
            WHERE session_lastaction < $expiry_time";
    $site_db->query($sql);

    return true;
  }

  function update_session() {
    global $site_db;

    $sql = "UPDATE ".SESSIONS_TABLE."
            SET session_lastaction = $this->current_time, session_location = '$this->user_location'
            WHERE session_id = '$this->session_id'";
    $site_db->query($sql);

    $this->session_info['session_lastaction'] = $this->current_time;
    $this->session_info['session_location'] = $this->user_location;
    $this->session_info['session_ip'] = $this->user_ip;

    if ($this->user_info['user_id'] != GUEST) {
      $sql = "UPDATE ".USERS_TABLE."
              SET ".get_user_table_field("", "user_lastaction")." = $this->current_time, ".get_user_table_field("", "user_location")." = '$this->user_location'
              WHERE ".get_user_table_field("", "user_id")." = ".$this->user_info['user_id'];
      $site_db->query($sql);
    }
    return;
  }

  function generate_session_id() {
    return session_id();
  }

  function return_session_info() {
    return $this->session_info;
  }

  function return_user_info() {
    return $this->user_info;
  }

  function freeze() {
    return;
  }

  function load_session_info() {
    if (@ini_get('register_globals')) {
      session_register('__session');

      if (!isset($GLOBALS['__session'])) {
        $GLOBALS['__session'] = array();
      }

      $this->session_info = &$GLOBALS['__session'];

    } else {
      if (isset($_SESSION)) {
        if (!isset($_SESSION['__session'])) {
          $_SESSION['__session'] = array();
        }

        $this->session_info = &$_SESSION['__session'];

      } else {
        if (!isset($GLOBALS['HTTP_SESSION_VARS']['__session'])) {
          $GLOBALS['HTTP_SESSION_VARS']['__session'] = array();
        }

        $this->session_info = &$GLOBALS['HTTP_SESSION_VARS']['__session'];
      }
    }

    if (!isset($this->session_info['session_user_id'])) {
        return false;
    }

    return $this->session_info;
  }

  function load_user_info($user_id = GUEST) {
    global $site_db, $user_table_fields;

    if ($user_id != GUEST) {
      $sql = "SELECT u.*, l.*
              FROM ".USERS_TABLE." u, ".LIGHTBOXES_TABLE." l
              WHERE ".get_user_table_field("u.", "user_id")." = $user_id AND l.user_id = ".get_user_table_field("u.", "user_id");
      $user_info = $site_db->query_firstrow($sql);
      if (!$user_info) {
        $sql = "SELECT *
                FROM ".USERS_TABLE."
                WHERE ".get_user_table_field("", "user_id")." = $user_id";
        $user_info = $site_db->query_firstrow($sql);
        if ($user_info) {
          $lightbox_id = get_random_key(LIGHTBOXES_TABLE, "lightbox_id");
          $sql = "INSERT INTO ".LIGHTBOXES_TABLE."
                  (lightbox_id, user_id, lightbox_lastaction, lightbox_image_ids)
                  VALUES
                  ('$lightbox_id', ".$user_info[$user_table_fields['user_id']].", $this->current_time, '')";
          $site_db->query($sql);
          $user_info['lightbox_lastaction'] = $this->current_time;
          $user_info['lightbox_image_ids'] = "";
        }
      }
    }
    if (empty($user_info[$user_table_fields['user_id']])) {
      $user_info = array();
      $user_info['user_id'] = GUEST;
      $user_info['user_level'] = GUEST;
      $user_info['user_lastaction'] = $this->current_time;
      $user_info['user_lastvisit'] = ($this->read_cookie_data("lastvisit")) ? $this->read_cookie_data("lastvisit") : $this->current_time;
    }
    foreach ($user_table_fields as $key => $val) {
      if (isset($user_info[$val])) {
        $user_info[$key] = $user_info[$val];
      }
      elseif (!isset($user_info[$key])) {
        $user_info[$key] = "";
      }
    }
    return $user_info;
  }

  function set_session_var($var_name, $value) {
    $this->session_info[$var_name] = $value;
    return true;
  }

  function get_session_var($var_name) {
    if (isset($this->session_info[$var_name])) {
      return $this->session_info[$var_name];
    }

    return '';
  }

  function drop_session_var($var_name) {
    unset($this->session_info[$var_name]);
  }

  function get_user_ip() {
    global $HTTP_SERVER_VARS, $HTTP_ENV_VARS;
    $ip = (!empty($HTTP_SERVER_VARS['REMOTE_ADDR'])) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ((!empty($HTTP_ENV_VARS['REMOTE_ADDR'])) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : getenv("REMOTE_ADDR"));
    $ip = preg_replace("/[^\.0-9]+/", "", $ip);
    return substr($ip, 0, 50);
  }

  function get_user_location() {
    global $self_url;
    return (defined("IN_CP")) ? "Control Panel" : preg_replace(array("/([?|&])action=[^?|&]*/", "/([?|&])mode=[^?|&]*/", "/([?|&])phpinfo=[^?|&]*/", "/([?|&])printstats=[^?|&]*/", "/[?|&]".URL_ID."=[^?|&]*/", "/[?|&]l=[^?|&]*/", "/[&?]+$/"), array("", "", "", "", "", "", ""), addslashes($self_url));
  }

  function url($url, $amp = "&amp;") {
    global $l;
    $dummy_array = explode("#", $url);
    $url = $dummy_array[0];

    if ($this->mode == "get" && strpos($url, $this->session_id) === false) {
      $url .= strpos($url, '?') !== false ? $amp : "?";
      $url .= SESSION_NAME."=".$this->session_id;
    }

    if (!empty($l)) {
      $url .= strpos($url, '?') !== false ? $amp : "?";
      $url .= "l=".$l;
    }

    $url .= (isset($dummy_array[1])) ? "#".$dummy_array[1] : "";
    return $url;
  }
} //end of class

//-----------------------------------------------------
//--- Start Session -----------------------------------
//-----------------------------------------------------
define('COOKIE_NAME', '4images_');
define('COOKIE_PATH', '/');
define('COOKIE_DOMAIN', '');
define('COOKIE_SECURE', '0');

$site_sess = new Session();

// Get Userinfo
$session_info = $site_sess->return_session_info();
$user_info = $site_sess->return_user_info();

//-----------------------------------------------------
//--- Get User Caches ---------------------------------
//-----------------------------------------------------
$num_total_online = 0;
$num_visible_online = 0;
$num_invisible_online = 0;
$num_registered_online = 0;
$num_guests_online = 0;
$user_online_list = "";
$prev_user_ids = array();
$prev_session_ips = array();

if (defined("GET_USER_ONLINE") && ($config['display_whosonline'] == 1 || $user_info['user_level'] == ADMIN)) {
  $time_out = time() - 300;
  $sql = "SELECT s.session_user_id, s.session_lastaction, s.session_ip".get_user_table_field(", u.", "user_id").get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_invisible")."
  FROM ".SESSIONS_TABLE." s
  LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = s.session_user_id)
  WHERE s.session_lastaction >= $time_out
  ORDER BY ".get_user_table_field("u.", "user_id")." ASC, s.session_ip ASC";
  $result = $site_db->query($sql);
  while ($row = $site_db->fetch_array($result)) {
    if ($row['session_user_id'] != GUEST && (isset($row['user_id']) && $row['user_id'] != GUEST)) {
      if (!isset($prev_user_ids[$row['session_user_id']])) {
        $is_invisible = (isset($row[$user_table_fields['user_invisible']]) && $row[$user_table_fields['user_invisible']] == 1) ? 1 : 0;
        $invisibleuser = ($is_invisible) ? "*" : "";
        $username = (isset($row[$user_table_fields['user_level']]) && $row[$user_table_fields['user_level']] == ADMIN && $config['highlight_admin'] == 1) ? sprintf("<b>%s</b>", $row[$user_table_fields['user_name']]) : $row[$user_table_fields['user_name']];
        if (!$is_invisible || $user_info['user_level'] == ADMIN) {
          $user_online_list .= ($user_online_list != "") ? ", " : "";
          $user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $row['session_user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$row['session_user_id'];
  /*
  MOD VISITORS COUNTRY FLAGS
  START INSERT
*/
        $cid = geoip_country_code_by_addr($gi, $row['session_ip']);
        if (empty($cid)) $cid = "lan";
        $countries[$cid] = isset($countries[$cid]) ? $countries[$cid]+1 : 1;
        $username = "<img src=\"".ROOT_PATH."flags/".strtolower($cid).".gif"."\" alt=\"".(($cid != "lan") ? $gi->GEOIP_COUNTRY_NAMES[$gi->GEOIP_COUNTRY_CODE_TO_NUMBER[$cid]] : "Unknown or LAN")."\" border=0> ".$username;
/*
  MOD VISITORS COUNTRY FLAGS
  END INSERT
*/   
          $user_online_list .= "<a href=\"".$site_sess->url($user_profile_link)."\">".$username."</a>".$invisibleuser;
        }
        (!$is_invisible) ? $num_visible_online++ : $num_invisible_online++;
        $num_registered_online++;
      }
      $prev_user_ids[$row['session_user_id']] = 1;
    }
    else {
      if (!isset($prev_session_ips[$row['session_ip']])) {
        $num_guests_online++;
/*
  MOD VISITORS COUNTRY FLAGS
  START INSERT
*/
        $cid = geoip_country_code_by_addr($gi, $row['session_ip']);
        if (empty($cid)) $cid = "lan";
        $countries[$cid] = isset($countries[$cid]) ? $countries[$cid]+1 : 1;
       
/*
  MOD VISITORS COUNTRY FLAGS
  END INSERT
*/

      }
    }
    $prev_session_ips[$row['session_ip']] = 1;
  }
  /*
  MOD VISITORS COUNTRY FLAGS
  START INSERT
*/
  $invitado_online_list = array();
  if (!empty($countries))
  {
    asort($countries);
    foreach ($countries as $key => $val)
    {
      $invitado_online_list[] = "<font color=\"#000000\">".$val."</font><img src=\"".ROOT_PATH."/flags/".strtolower($key).".gif\" align=\"middle\" alt=\"".(($key != "lan") ? $gi->GEOIP_COUNTRY_NAMES[$gi->GEOIP_COUNTRY_CODE_TO_NUMBER[$key]] : "Unknown or LAN")."\" border=0>";
    }
  }
  $invitado_online_list = implode(" , ", $invitado_online_list);
/*
  MOD VISITORS COUNTRY FLAGS
  END INSERT
*/
  $num_total_online = $num_registered_online + $num_guests_online;
  //$num_invisible_online = $num_registered_online - $num_visible_online;

  $site_template->register_vars(array(
    "num_total_online" => $num_total_online,
    "num_invisible_online" => $num_invisible_online,
    "num_registered_online" => $num_registered_online,
    "num_guests_online" => $num_guests_online,
"invitado_online_list" => $invitado_online_list,
    "user_online_list" => $user_online_list,
    "lang_user_online" => str_replace('{num_total_online}', $num_total_online, $lang['user_online']),
    "lang_user_online_detail" => str_replace(array('{num_registered_online}','{num_invisible_online}','{num_guests_online}'), array($num_registered_online,$num_invisible_online,$num_guests_online), $lang['user_online_detail']),
  ));
  //-----------------------------
//---Most ever users online----
//-----------------------------
  $most = explode("|", $config['most_users']);
  $most_total = explode(",", $most[0]);
  $most_registered = explode(",", $most[1]);
  $most_guests = explode(",", $most[2]);
  $update = 0;
  if ($num_total_online > $most_total[0])
  {
    $most_total[0] = $num_total_online;
    $most_total[1] = time();
    $most[0] = $most_total[0].",".$most_total[1];
    $update = 1;
  }
  if ($num_registered_online > $most_registered[0])
  {
    $most_registered[0] = $num_registered_online;
    $most_registered[1] = time();
    $most[1] = $most_registered[0].",".$most_registered[1];
    $update = 1;
  }
  if ($num_guests_online > $most_guests[0])
  {
    $most_guests[0] = $num_guests_online;
    $most_guests[1] = time();
    $most[2] = $most_guests[0].",".$most_guests[1];
    $update = 1;
  }
  if ($update) {
    $config['most_users'] = implode("|", $most);
    $sql = "UPDATE ".SETTINGS_TABLE."
            SET setting_value = '".$config['most_users']."'
            WHERE setting_name = 'most_users'";
    $site_db->query($sql);
  }
  $site_template->register_vars(array(
    "mueo" => $most_total[0],
    "mueo_date" => format_date($config['date_format'].", ".$config['time_format'], $most_total[1]),
    "mueo_registered" => $most_registered[0],
    "mueo_registered_date" => format_date($config['date_format'].", ".$config['time_format'], $most_registered[1]),
    "mueo_guests" => $most_guests[0],
    "mueo_guests_date" => format_date($config['date_format'].", ".$config['time_format'], $most_guests[1]),
    "lang_mueo" => $lang['mueo'],
    "lang_mueo_total" => $lang['mueo_total'],
    "lang_mueo_date" => $lang['mueo_date'],
    "lang_mueo_registered" => $lang['mueo_registered'],
    "lang_mueo_guests" => $lang['mueo_guests'],
  ));
//End Most Ever Online
  $whos_online = $site_template->parse_template("whos_online");
  $site_template->register_vars("whos_online", $whos_online);
  unset($whos_online);
  unset($prev_user_ids);
  unset($prev_session_ips);
}
?>
Title: Re: Birthday Mod v1.0
Post by: IcEcReaM on February 19, 2006, 09:18:09 PM
Ich bin mir jetzt nicht mehr 100% sicher,
aber bei dir lagen doch die Geburtstage in nem anderen Format als in diesem Mod hier vor?
Oder hast du den alten Mod ausgebaut,
und diesen komplett neu eingebaut.
Am Besten wäre es,
wenn man mal nen Überblick bekommen könnte,
in welchem Format die DB Einträge bei dir vorliegen.

Werden auch im Profil keine Geb Einträge angezeigt,
oder fehlt nur die Geburtstagsmeldung in der Index Seite.

Es scheint so, dass beim home.html template sich paar if anweisungen überschneiden.
Title: Re: Birthday Mod v1.0
Post by: glitzer on February 19, 2006, 09:21:33 PM
ich kenne mich auch nicht mehr aus.
Ich habe in meiner datenbank auch die user_age_birthday drinnen wo auch die ganzen daten der user gespeichert sind sowie die tabellen einträge 'user_birth_year','user_birth_month','user_birth_day'

ich würde so gerne diesen mod nützen..weiß aber total nicht was ich machen kann damit die bisherigen einträge genützt werden können.
;.-(
Title: Re: Birthday Mod v1.0
Post by: IcEcReaM on February 19, 2006, 10:14:31 PM
Werden denn im Profil die richtigen Geb Eintrge aus dem Feld user_age_birthday angezeigt?
Title: Re: Birthday Mod v1.0
Post by: JensF on February 26, 2006, 03:55:00 PM
Hi,

hab den Mod auch gerade eingebaut und er funzt super. Ich habe aber eine Frage dazu.

Kann ich in der birthday_message.html auch den Usernamen mit anzeigen lassen??

Wenn ich {user_name} benutze dann wird mir irgendein Name angezeigt aber nicht der vom Geburtstagskind....
Title: Re: Birthday Mod v1.0
Post by: IcEcReaM on February 26, 2006, 05:48:51 PM
ersetze das hier:
Code: [Select]
         $site_template->register_vars(array(
                      "birthday_message" => $birthday_message
              ));

durch das:

Code: [Select]
         $site_template->register_vars(array(
                      "birthday_message" => $birthday_message,
                      "birthday_message_name" => $user_info['user_name']
              ));

in der index.php

Dann kannst du {birthday_message_name} für den Namen nutzen.
Title: Re: Birthday Mod v1.0
Post by: JensF on February 26, 2006, 06:57:35 PM
Danke!!!
Title: Re: Birthday Mod v1.0
Post by: Stoleti on February 27, 2006, 02:10:52 AM
How make show a image (gif) on user profile , on B.Day ?
Title: Re: Birthday Mod v1.0
Post by: JensF on March 01, 2006, 05:01:13 PM
Hi IcEcReaM,

gibt es die Möglichkeit eine Fehlermeldung auszugeben wenn jemand ein Alter angibt was über 100 ist???

Ich beziehe mich da auf den Statistic Mod.....wenn jemand dort ein Alter über 100 angegeben hat dann spinnt die Top Age Anzeige...
Title: Re: Birthday Mod v1.0
Post by: IcEcReaM on March 01, 2006, 07:20:32 PM
To check if an proper birthday is entered,
and the entered age is not higher than 100:

in includes/functions.php find:
Code: [Select]
   if ($valid == 1 && ($error || (!ereg("([0-9]{4})-([0-9]{2})-([0-9]{2})", $birthday)))) return false;
and insert above:
Code: [Select]
   //check if age is bigger than 100
      $today = getdate (time());
      if (($today['year'] > (intval($birthday_year)+100)) && $birthday_year != "0000") return false;

Not tested, but should work i think.
Title: Re: Birthday Mod v1.0
Post by: JensF on March 01, 2006, 08:41:43 PM
Yes, it works....Thanks-...
Title: Re: Birthday Mod v1.0
Post by: klechoo on March 03, 2006, 10:38:56 PM
where do I download birthday_install.php  :oops:
Title: Re: Birthday Mod v1.0
Post by: IcEcReaM on March 07, 2006, 04:58:09 PM
where do I download birthday_install.php :oops:


i attached it in the first post again.
Don't know why it were removed,
maybe an error when i updated my post with additional steps.
Title: Re: Birthday Mod v1.0
Post by: Fastian on March 11, 2006, 03:40:05 PM
I just replaced the previous User Age mode with one. 
It works Perfect.  :D

I would like to change one thing (if possible easily).
Instead of showing Year filed like "0000" I want to show a drop down just like for the Day Ranging from 1900 – 2006 .
Title: Re: Birthday Mod v1.0
Post by: Fastian on March 13, 2006, 08:11:10 AM
I just replaced the previous User Age mode with one. 
It works Perfect.  :D

I would like to change one thing (if possible easily).
Instead of showing Year filed like "0000" I want to show a drop down just like for the Day Ranging from 1900 – 2006 .


Is that difficult to implement ?
Title: Re: Birthday Mod v1.0
Post by: IcEcReaM on March 13, 2006, 01:16:00 PM
no, it almost similar how the code for the "days" were generated,
maybe you take a look at it first.
If i have time i can show you how to.

Title: Re: Birthday Mod v1.0
Post by: wallpapers on March 14, 2006, 08:45:55 PM
This is the tanslation in the dutch language  :D

Code: [Select]
$lang['asterisk'] = "Sterrenbeeld";
$lang['asterisks'] = array(
  1 => "Steenbock",
       "Waterman",
       "Vissen",
       "Ram",
       "Stier",
       "Tweelingen",
       "Kreeft",
       "Leeuw",
       "Maagd",
       "Weegschaal",
       "Schorpioen",
       "Boogschutter",
       "Steenbock"
);
Title: Re: Birthday Mod v1.0
Post by: IcEcReaM on March 14, 2006, 10:06:04 PM
thanks, added to the first post.
Title: Re: Birthday Mod v1.0
Post by: Stoleti on March 14, 2006, 10:13:50 PM
can we make the year date as drop down like days/months ?  :?:
Title: Re: Birthday Mod v1.0
Post by: V@no on March 15, 2006, 02:30:32 AM
missed the very fist reply on this page?

[EDIT]
in member.php and register.php below:
Code: [Select]
  $birthday_month_options = "<option value=\"\">--</option>\n";Insert:
Code: [Select]
  $birthday_year_options = "<option value=\"\">--</option>\n";
  $end = date("Y");
  $start = $end-100;
  for ($i=$start;$i<=$end;$i++)
  {
    $birthday_year_options .= "<option value=\"".$i."\"".(($i == $user_birthday_year) ? "selected" : "").">".$i."</option>\n";
  }
  $user_birthday_year = $birthday_year_options;
If you want to show it in reverse order then use this line instead:
Code: [Select]
  for ($i=$end;$i>=$start;$i--)(you'll figure it out where to use it ;))
Title: Re: Birthday Mod v1.0
Post by: Fastian on March 18, 2006, 06:31:59 PM
Can some one look at Step 12

Code: [Select]
<!--  Start Events   -->
{if birthday_list}
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td >
      <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#000000">
        <tr>
          <td valign="top" class="head1">
            <table width="100%" border="0" cellpadding="4" cellspacing="2">
              <tr>
                <td class="head1" valign="top">{lang_events}</td>
              </tr>
            </table></td>
        </tr>

        <tr>
          <td valign="top" >
              <table  width="100%" border="0" cellpadding="4" cellspacing="1" width="98%">
              <tr>
                <td width="40" class="catbgcolor"><img src="{template_url}/images/birthday_baloon.gif" alt=""></td>
                <td class="catbgcolor"><b>{lang_congratulate}</b><br>{birthday_list}</td>
              </tr>
            </table></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<br />
{endif birthday_list}
<!--  End Events   -->

This code is making my theme spread wider.  The whole look got disturbed. I think there are few extra lines in this code. I think one <table> filed is causing problem. 
But i cant get what minimum statements could be used to get this part working ?
Title: Re: Birthday Mod v1.0
Post by: Fastian on March 19, 2006, 01:16:31 AM
Got it working fine.

I just removed
 <table  width="100%" border="0" cellpadding="4" cellspacing="1" width="98%">
and corresponding </table> and everything is working just fine now  :)

Thanks IcEcReaM for such a nice mod.
Title: Re: [MOD] Birthday Mod v1.0
Post by: TIMT on March 25, 2006, 03:53:59 PM
Super MOD!

How is it possible to show "Actual Events" at the end of the memberlist (memberlist.html) or on other pages?
Now the "Events" are shown only on the home-page.

And how can I put a space between day and month on the member-page? Now there is no space between the day and the month --> 31.März instead of 31. März

And DropDownList for the year (like day and month) would be nice.

TIMT
Title: Re: [MOD] Birthday Mod v1.0
Post by: IcEcReaM on March 25, 2006, 04:26:35 PM
How to make dropdownlist,
was described by vano some post above.

I didn't made the year as dropdownlist, cause it's to much scrolling i think.

To appear actual events on every site,
copy the listed code below to the page header.
to make it appear only on certain sites,
copy the code only to the specific php files:
Code: [Select]
if($config['birthday_index'] == 1)  {
$currentdate = date("m-d", time());

$sql = "SELECT ".get_user_table_field("", "user_id").", ".get_user_table_field("", "user_name").", ".get_user_table_field("", "birthday")."
          FROM ".USERS_TABLE."
          WHERE ".get_user_table_field("", "birthday")." LIKE '%-$currentdate'
          ORDER BY ".get_user_table_field("", "user_name");
$result = $site_db->query($sql);

$birthday_list = "";
   while($row = $site_db->fetch_array($result)) {
        $age = calc_age($row[$user_table_fields['birthday']]);
        $birthday_list .= ($birthday_list) ? ", " : "";
        $birthday_list .= "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row[$user_table_fields['user_id']])."\">".$row[$user_table_fields['user_name']]."</a> (".$age.")";
    }

$site_template->register_vars(array(
  "lang_events" => $lang['events'],
  "birthday_list" => $birthday_list,
  "lang_congratulate" => $lang['congratulate']
   ));
}


this code comes then in the template file, where it should appear:
Code: [Select]
<!--  Start Events   -->
{if birthday_list}
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td >
      <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#000000">
        <tr>
          <td valign="top" class="head1">
            <table width="100%" border="0" cellpadding="4" cellspacing="2">
              <tr>
                <td class="head1" valign="top">{lang_events}</td>
              </tr>
            </table></td>
        </tr>

        <tr>
          <td valign="top" >
              <table  width="100%" border="0" cellpadding="4" cellspacing="1" width="98%">
              <tr>
                <td width="40" class="catbgcolor"><img src="{template_url}/images/birthday_baloon.gif" alt=""></td>
                <td class="catbgcolor"><b>{lang_congratulate}</b><br>{birthday_list}</td>
              </tr>
            </table></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<br />
{endif birthday_list}
<!--  End Events   -->

Quote
And how can I put a space between day and month on the member-page? Now there is no space between the day and the month --> 31.März instead of 31. März

change this line:
Code: [Select]
$user_birthday = $birthday[2].".".$lang['months'][sprintf("%02d",$birthday[1])];into
Code: [Select]
$user_birthday = $birthday[2].". ".$lang['months'][sprintf("%02d",$birthday[1])];
Title: Re: [MOD] Birthday Mod v1.0
Post by: Stoleti on March 25, 2006, 04:57:46 PM
Would be nice if we've a "calendar" page with months/days and with who born ... well its better look at this screenshot below !

(http://img470.imageshack.us/img470/3007/bd28ws.jpg)


(http://img157.imageshack.us/img157/4742/bd34xo.png)
Title: Re: [MOD] Birthday Mod v1.0
Post by: TIMT on March 25, 2006, 05:16:38 PM
Hi IcEcReaM

Thanks! It works perfect... good service!   :D
Title: Re: [MOD] Birthday Mod v1.0
Post by: TIMT on March 25, 2006, 05:39:58 PM
Obwohl ich in ACP definiert habe, dass das Geburtsdatum nicht zwingend erfasst werden muss, wird bei der Registrierung folgende Meldung angezeigt:
Das Feld Geburtstag muss ausgefüllt werden!
Title: Re: [MOD] Birthday Mod v1.0
Post by: IcEcReaM on March 25, 2006, 07:05:56 PM
nur bei der registrierung oder auch wenn man das profil updated?

was passiert, wenn du mal testweise in deiner register.php
folgende Zeile
Code: [Select]
if (!$user_birthday = check_birthday($user_birthday_day,$user_birthday_month,$user_birthday_year,$config['birthday_required'])) {änderst in
Code: [Select]
if (!$user_birthday = check_birthday($user_birthday_day,$user_birthday_month,$user_birthday_year,0)) {
klappt das dann?
Title: Re: [MOD] Birthday Mod v1.0
Post by: TIMT on March 25, 2006, 08:03:44 PM
Das updaten des Profils funktioniert einwandfrei.
Ich bekomme die Meldung nur beim Registrieren.

Die Mutation hat nichts gebracht.
Title: Re: [MOD] Birthday Mod v1.0
Post by: IcEcReaM on March 25, 2006, 10:13:36 PM
dann zip mir mal bitte deiner register.php, member.php und functions.php.

kannst mir ja dann ne pm schreiben, wo ich die beiden dateien finde.
Title: Re: [MOD] Birthday Mod v1.0
Post by: IcEcReaM on March 25, 2006, 11:23:47 PM
ok, hab den fehler denke ich gefunden.
Das liegt daran, dass du die kleine Erweiterung drin hast,
zur Überprüfung des Geburtsjahres,
wobei ich da was vergessen hatte.

Ersetze in deiner functions.php
folgende Zeile:
Code: [Select]
if (($today['year'] > (intval($birthday_year)+100)) && $birthday_year != "0000") return false;durch das hier:
Code: [Select]
if (($today['year'] > (intval($birthday_year)+100)) && ($birthday_year != "0000" || $birthday_year != "")) return false;
Title: Re: [MOD] Birthday Mod v1.0
Post by: TIMT on March 26, 2006, 09:28:57 AM
Funktioniert noch nicht. Weiter habe ich bemerkt, dass auch ein 0000 im Feld Jahr nicht ausreicht. Ich muss Tag Monat und Jahr erfassen, damit das Registrieren abgeschlossen werden kann.
Title: Re: [MOD] Birthday Mod v1.0
Post by: IcEcReaM on March 26, 2006, 04:26:02 PM
ok, lösch mal diese zeile:
Code: [Select]
if (($today['year'] > (intval($birthday_year)+100)) && ($birthday_year != "0000" || $birthday_year != "")) return false;
und füge mal nach
Code: [Select]
$birthday = "$birthday_year-$birthday_month-$birthday_day";folgendes ein:
Code: [Select]
      $today = getdate (time());
      $b_year = intval($birthday_year);
      if (($today['year'] > ($b_year+100)) || ($today['year'] < $b_year)) return false;
Title: Re: [MOD] Birthday Mod v1.0
Post by: JensF on March 26, 2006, 05:00:58 PM
ok, lösch mal diese zeile:
Code: [Select]
if (($today['year'] > (intval($birthday_year)+100)) && ($birthday_year != "0000" || $birthday_year != "")) return false;
und füge mal nach
Code: [Select]
$birthday = "$birthday_year-$birthday_month-$birthday_day";folgendes ein:
Code: [Select]
      $today = getdate (time());
      $b_year = intval($birthday_year);
      if (($today['year'] > ($b_year+100)) || ($today['year'] < $b_year)) return false;

Habe festgestellt das ich dieses Problem auch hatte :) Hab mich immer gewundert das jeder neue User sein Geburtsdatum einträgt :)

Mit dieser Änderung funktioniert alles. Man ist nun nicht verpflichtet sein Datum einzugeben. Danke!!!
Title: Re: [MOD] Birthday Mod v1.0
Post by: b.o.fan on June 05, 2006, 01:13:48 PM
hallo!

der Mod ist voll klasse. hab nur een Problem...

wenn der USer sich registriert... dann trägt er das in die Datenbank ein.

wenn der User aba änderungen vornimmt, dann nich :(

warum?
Title: Re: [MOD] Birthday Mod v1.0
Post by: b.o.fan on June 07, 2006, 12:31:56 PM
hallo!

der Mod ist voll klasse. hab nur een Problem...

wenn der USer sich registriert... dann trägt er das in die Datenbank ein.

wenn der User aba änderungen vornimmt, dann nich :(

warum?

nobody can't help?
Title: Re: [MOD] Birthday Mod v1.0
Post by: b.o.fan on June 08, 2006, 09:28:25 PM
hello IcEcReaM?!?

can you look @ the entrys above??

bofan
Title: Re: [MOD] Birthday Mod v1.0
Post by: knuffi on June 15, 2006, 11:56:55 AM
Hallo
Ich habe die Version 1.7.2
Funktioniert dieser Mod auch hier wenn man die Anpassungen wie ober erwähnt macht?
Oder muss ich ev. noch spezielle sachen beachten?
Danke für die infos.

Hans-Ruedi
www.webandart.ch/4images
Title: Re: [MOD] Birthday Mod v1.0
Post by: knuffi on June 15, 2006, 06:57:42 PM
Hallo nochmals.....

So nun habe ich alles geändert, hat prima geklapt.
Doch beim Ausführen installdatei kommt diese Fehlermeldung:

Parse error: parse error, unexpected '}' in /home/webandar/public_html/4images/includes/functions.php on line 1419

Was ist hier falsch gelaufen.....

Gruss Hans-Ruedi
Title: Re: [MOD] Birthday Mod v1.0
Post by: knuffi on June 15, 2006, 07:21:41 PM
Und nochamls ich......

Ich bin wohl selber ein Dödel.... Habe es gefunden. und juhee es läuft. .. bis jetzt smile.

Ein Frage aber noch.

Zeigt es auf der Startseite die Leiste mit denjenigen welche Geburtstage haben nur an wenn jemand auch wirklich Geburtstag hat?

Oder muss ich da noch was machen?

Gruss
Hans-Ruedi
www.webandart.ch
Title: Re: [MOD] Birthday Mod v1.0
Post by: knuffi on June 16, 2006, 09:22:29 AM
Sali Ivan

Danke für die Info....
Ich habe einfach mal bei meinem Testuser das Geburtdatum eingegeben und es funktioniert.... Ist wirklich nicht schlecht wow.

Ich hoffe irgendwann auch etwas genauer hinter diese verschiednen Codes zu blicken.

Gibt es zu diesem Mod noch die Möglichkeit Geburtstagskarten zu versenden?
Wäre noch eine coole Möglichkeit.

Versuche laufend neue Mods auf meiner Seite einzubauen, finde die Möglichkeiten einfach genial.

Danke nochmals den Programmieren dieser Seite und der vielen Mods.

Gruss Hans-Ruedi
www.webandart.ch/4images
Title: Re: [MOD] Birthday Mod v1.0
Post by: Fryz on July 18, 2006, 12:01:57 PM
hab da anscheinend was falsch gemacht :( nur... was??

bei der registrierung kann der user sein geburtsdatum eingeben. wenn er dann jedoch in seinem kontrollzentrum ist, steht da kein datum mehr, sondern: 
tag: -  monat: -  jahr: 127

bei den usern, die ihr profil nachträglich ändern wollen, steht in der "jahresangabe" eine "0". änderungen werden nicht angenommen...
hat vielleicht jemand einen tip, woran das liegen könnte?

danke
Title: Re: [MOD] Birthday Mod v1.0
Post by: Stoleti on July 29, 2006, 02:18:31 AM
who can i make show the age of user at dreamboard ??? :?:
Title: Re: [MOD] Birthday Mod v1.0
Post by: chull on August 10, 2006, 06:46:13 PM
Hello.

how can I show the Photo of the User beside the Username in the column which is shown the photo of the ballons. I have installed the personal Photo mod(http://www.4homepages.de/forum/index.php?topic=6797.0)

Thanks and Greetz

Chull
Title: Re: [MOD] Birthday Mod v1.0
Post by: IcEcReaM on August 10, 2006, 11:20:36 PM
Change this part in your index.php:

search for:
Code: [Select]
$sql = "SELECT ".get_user_table_field("", "user_id").", ".get_user_table_field("", "user_name").", ".get_user_table_field("", "birthday")."
          FROM ".USERS_TABLE."
          WHERE ".get_user_table_field("", "birthday")." LIKE '%-$currentdate'
          ORDER BY ".get_user_table_field("", "user_name");
$result = $site_db->query($sql);

$birthday_list = "";
   while($row = $site_db->fetch_array($result)) {
        $age = calc_age($row[$user_table_fields['birthday']]);
        $birthday_list .= ($birthday_list) ? ", " : "";
        $birthday_list .= "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row[$user_table_fields['user_id']])."\">".$row[$user_table_fields['user_name']]."</a> (".$age.")";
    }
and replace with

Code: [Select]

$sql = "SELECT ".get_user_table_field("", "user_id").", ".get_user_table_field("", "user_name").", ".get_user_table_field("", "birthday").", userpic
          FROM ".USERS_TABLE."
          WHERE ".get_user_table_field("", "birthday")." LIKE '%-$currentdate'
          ORDER BY ".get_user_table_field("", "user_name");
$result = $site_db->query($sql);

$birthday_list = "";
   while($row = $site_db->fetch_array($result)) {
        $age = calc_age($row[$user_table_fields['birthday']]);
        $birthday_list .= ($birthday_list) ? ", " : "";
        $userpic_img = ($config['userpic'] && $row['userpic']) ? "<img src=\"".ROOT_PATH."data/userpic/".$row['userpic'] ."\">" : "";
        $birthday_list .= "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row[$user_table_fields['user_id']])."\">$userpic_img".$row[$user_table_fields['user_name']]."</a> (".$age.")";
    }

Not tested, but should work
Title: Re: [MOD] Birthday Mod v1.0
Post by: chull on August 11, 2006, 01:25:42 AM
Hello,

thanks for teh fast answer. But it don't work. I get this error message:

Parse error: syntax error, unexpected '"' in /home/admn1741/public_html/bilder/index.php on line 271

In my Index.php file is ist that line:

Code: [Select]
$userpic_img = ($config['userpic'] && $row['userpic']) ? "<img src=\"".ROOT_PATH."data/userpic/".$user_row['userpic'] ."\"> : "";
Thanks and Greetz

Chull
Title: Re: [MOD] Birthday Mod v1.0
Post by: IcEcReaM on August 11, 2006, 04:08:56 PM
upps ii missed one ".

change this line:
Code: [Select]
$userpic_img = ($config['userpic'] && $row['userpic']) ? "<img src=\"".ROOT_PATH."data/userpic/".$user_row['userpic'] ."\"> : "";
to

Code: [Select]
$userpic_img = ($config['userpic'] && $row['userpic']) ? "<img src=\"".ROOT_PATH."data/userpic/".$user_row['userpic'] ."\">" : "";
corrected also the post above
Title: Re: [MOD] Birthday Mod v1.0
Post by: chull on August 11, 2006, 06:22:21 PM
Hello,

now I don't get the error message. But it try's to open alle avatar images which are in my userpic folder. Of cause of that he show me only the symbol for no images.

Thanks and Greetz

Chull
Title: Re: [MOD] Birthday Mod v1.0
Post by: IcEcReaM on August 11, 2006, 09:09:47 PM
damn.

missed also another line:

this should work now.

Code: [Select]
$userpic_img = ($config['userpic'] && $row['userpic']) ? "<img src=\"".ROOT_PATH."data/userpic/".$row['userpic'] ."\">" : "";
Title: Re: [MOD] Birthday Mod v1.0
Post by: chull on September 09, 2006, 02:16:53 PM
Now it works. Thanks!!! :D

How can I resize the Picture? And how can I show the Username under the Photo, not at the right.

Thanks a lot and Greetz

Chull
Title: Re: [MOD] Birthday Mod v1.0
Post by: Michael_Muntau on October 10, 2006, 04:49:11 PM
Also nach dem ich kleine Schwierigkeiten hatte, läuft nun alles einwandfrei!

Danke dafür!
Title: Re: [MOD] Birthday Mod v1.0
Post by: F2F on October 13, 2006, 08:23:37 PM
Just installed this MOD and it works, thank you so for the hard work!

But I have a question...

when NOT logged in I can see this warning on home:

Code: [Select]
Warning: Undefined offset: 1 in index.php on line 163
This is the line 163 in my index.php file:

Code: [Select]
      if (($user_birthday[1] == date ("m", time())) && ($user_birthday[2] == date ("d", time()))) {
And it can be found here:

Code: [Select]
if($config['birthday_message'] == 1)  {
    $user_birthday = explode("-",$user_info[$user_table_fields['birthday']]);
      if (($user_birthday[1] == date ("m", time())) && ($user_birthday[2] == date ("d", time()))) {
         $birthday_message = $site_template->parse_template("birthday_message");
         $site_template->register_vars(array(
                      "birthday_message" => $birthday_message
              ));
    }
}

Does anyone know what this warning means? As I said, the MOD works, and I know that a warning won't prevent the site to work either, but is there a way to solve this?

Thanks in advance!
Title: Re: [MOD] Birthday Mod v1.0
Post by: F2F on October 13, 2006, 08:38:01 PM
Well, 5 minutes later I just found a way to solve this..

Since it only happens when you are not logged in and the code that gives the error seemed to be related to the congratulations message that only registered users will see I 'hided' the code with this:

Code: [Select]
if ($user_info['user_level'] != GUEST) {
So now the code will be only executed when logged in and that's exactly when there is no warning... Everything is fine now...
Title: Re: [MOD] Birthday Mod v1.0
Post by: TubeTopia on October 24, 2006, 06:16:01 AM
[qcode]$site_template->register_vars(array(
      "user_name" => htmlspecialchars(stripslashes($user_name)),[/qcode]

Can not be found in register.php 1.7.4
Title: Re: [MOD] Birthday Mod v1.0
Post by: chull on February 12, 2007, 12:14:23 PM
Hello,

I want to show the Birthady Event on each template. But wehn I put the code into the template and I upload all this. It isn't shown the Birthday Event. It is only shown on the home site. What must I where add to show it.

Thanks and Greetz

Chull
Title: Re: [MOD] Birthday Mod v1.0
Post by: drastx on February 13, 2007, 05:07:54 PM
Hello,

I want to show the Birthady Event on each template. But wehn I put the code into the template and I upload all this. It isn't shown the Birthday Event. It is only shown on the home site. What must I where add to show it.

Thanks and Greetz

Chull

Change ALL template files :)

----------------------------------

Does this work with 1.7.2 version ?
Title: Re: [MOD] Birthday Mod v1.0
Post by: chull on February 14, 2007, 06:11:56 PM
Hello,

I'allready changed all template files. But I think I must change something in ab .php file. But I don't know what.

Please Help!!!

Thanks

Chull
Title: Re: [MOD] Birthday Mod v1.0
Post by: CeJay on February 14, 2007, 10:48:36 PM
I'allready changed all template files. But I think I must change something in ab .php file. But I don't know what.

The ones you only changed was the template files when it lists all these files to be edited?
Re-read first post for each change.

Quote
[ Changed Files ]
includes/functions.php
includes/db_field_definitions.php
includes/session.php
register.php
index.php
member.php
templates/register_form.html
templates/member_profile.html
templates/member_editprofile.html
templates/home.html
admin/settings.php
lang/<your language>/admin.php
lang/<your language>/main.php

Title: Re: [MOD] Birthday Mod v1.0
Post by: drastx on February 28, 2007, 07:40:29 AM
Can anybody remake this mod for 1.7.2 ?
Title: Re: [MOD] Birthday Mod v1.0
Post by: Isucks on April 02, 2007, 12:42:42 AM
Hi, echt super Mod. Habe aber leider ein kleines Problem. Wenn man sich neu registriert kann man alles einstellen, so wie es sein soll. Aber nach dem Login kann man unter dem Kontrollzentrum sein Geburtstagsdatum nicht ändern. Er zeigt zwar die 2 Pfeile an wo man den Monat und den Tag auswählt, jedoch sind diese Felder komplett weiß. Es ist auch nciht möglich andere Details im eigenen Profil zu verändern. dak ommt immer die fehlermeldung "Korrektes Geburtstagsdatum eintragen". Was könnte das sein?! Habe die installation schon 3mal überprüft :(
Title: Re: [MOD] Birthday Mod v1.0
Post by: jimpike on July 26, 2007, 08:31:20 PM
Great MOD! Works great, and even put in the Zodiacs. :-)

I do have a question that I hope someone can answer.
I live in the USA, and we read our dates differently. 
On the profile page, you have it set as Day.Month Year.

 I would like to set it as Month Day, Year  (Example: January 01, 2000)

I tried changing this code:
Code: [Select]
$user_birthday = $birthday[2].".".$lang['months'][sprintf("%02d",$birthday[1])];
To

Code: [Select]
$user_birthday = $lang['months']."%020".$birthday[2].", "[sprintf("%02d",$birthday[1])];
But that just gave me a parse error.  Any ideas? Thanks.
Title: Re: [MOD] Birthday Mod v1.0
Post by: masterred on July 30, 2007, 07:06:25 AM
hello as I can add the MOD birthday to the user profile, can i use tags of home.html, but like me to be able to use when the user turns years, a special dedication, like when they envian a birthday postcard

Cuando es dia del cumpleaños sale la felicitacion en el index.php, entonces me gustaria saber si se puede poner en el perfil de ese mismo usuario lo mismo, una felicitacion en su perfil, pero con una imagen con dedicatoria especial. algo como esto en su perfil


 
Title: Re: [MOD] Birthday Mod v1.0
Post by: thunderstrike on July 30, 2007, 01:17:06 PM
Quote
$user_birthday = $lang['months']."%020".$birthday[2].", "[sprintf("%02d",$birthday[1])];

change to:

Quote
$user_birthday = $lang['months'] . REPLACE_EMPTY . $birthday[2].", "[sprintf(REPLACE_EMPTY, $birthday[1])];

Should work. ;)
Title: Re: [MOD] Birthday Mod v1.0
Post by: jimpike on July 30, 2007, 05:47:27 PM
Quote
$user_birthday = $lang['months']."%020".$birthday[2].", "[sprintf("%02d",$birthday[1])];

change to:

Quote
$user_birthday = $lang['months'] . REPLACE_EMPTY . $birthday[2].", "[sprintf(REPLACE_EMPTY, $birthday[1])];

Should work. ;)

Thanks, but it gave me an parse error. Guess I'll just deal with the date being reversed. LOL. Oh well.
Title: Re: [MOD] Birthday Mod v1.0
Post by: thunderstrike on July 30, 2007, 07:13:20 PM
My bad.

Quote
$user_birthday = $lang['months'] . REPLACE_EMPTY . $birthday[2].", "[sprintf(REPLACE_EMPTY, $birthday[1])];

Change to:

Quote
$user_birthday = $lang['months'] . REPLACE_EMPTY . $birthday[2].", [" . sprintf(REPLACE_EMPTY, $birthday[1]) . "]";

Should work now. 8)
Title: Re: [MOD] Birthday Mod v1.0
Post by: thunderstrike on July 31, 2007, 07:45:30 PM
What you wish with birthday and memberlist ? Check birthday, calculate age or calculate countdown from memberlist ?

<< Just found - post on wrong topic. Sorry. >>
Title: Re: [MOD] Birthday Mod v1.0
Post by: rinaldos on November 05, 2007, 09:54:47 AM
Hello,
I have insert this mod for a long time. Now i want to change the input fields. I want change the dropdown fields into text fields. Is this possible, and what i have to change?

Thanks in advance.

Ingo
Title: Re: [MOD] Birthday Mod v1.0
Post by: thunderstrike on November 05, 2007, 12:29:59 PM
Yes ... you need edit includes/db_field_definitions.php file and install Dropdown for custom database field from V@no. ;)
Title: Re: [MOD] Birthday Mod v1.0
Post by: rinaldos on November 05, 2007, 02:49:54 PM
Hi Thunderstrike,
thanks for the hint.

Ingo
Title: Re: [MOD] Birthday Mod v1.0
Post by: UFOSWORLD on January 03, 2008, 02:42:00 AM
Cooler Mod.

Aber ich hab da wieder ein paar Fragen, bzw Probleme.

Erstes: Betrifft das Jahresfeld bei der Registrierung.
Hierzu hab ich eine Graphik von meiner Registrierung angehängt.  kann es sein das die Textfeldgrösse irgendwo zentral gespeichert ist.

weil im Code steht ja 
Code: [Select]
<td><input class="input" name="user_birthday_year" value="{user_birthday_year}" maxlength="4" size="5" type="text">Also Grösse 5  aber das is genauso lang wie die Felder darüber und da steht bei size="30" 

Zweitens: Hat jemand einen fertigen Umbau, so das ich das Textfeld durch ein Dropdownfeld ersetzen kann. Muss ja eigentlich nur z.b. von 1950 - zum aktuellen Jahr gehn)   (auch soll dadurch die Eingabe von Buchstaben verhindert werden, um mögliche Fehlerquellen auszuschliessen... )  (Hab da nämlich ein kleines Anzeigeproblem wenn die Mail Adresse schon vergeben is... aber das wann anders...)


Drittens:  Ist es möglich die Anzeige wer Geburtstag hat dauernd anzuzeigen, auch wenn keiner hat.
Und zwar deshalb weil ich z.b zusätzlich anzeigen lassen möchte.
Mitglied  XY hat in 20 Tagen den 25 Geburtstag  (wobei schöner wäre wenn man schreiben könnte "Mitglied XY hat in 20 Tagen seinen 25 Geburtstag" , bzw "...ihren 25 Geburtstag" ...  abhängig vom user_sex aus dem Mod ???  der mit user_sex 

Merci und wieder ein toller Mod

gruss UFO


Title: Re: [MOD] Birthday Mod v1.0
Post by: Jasi on January 28, 2008, 09:42:50 PM

@ IcEcReaM
@ Thunderstrike


Hallo Thunderstrike,

vielen Dank für diesem tollen MOD ;)

Frage:

Ich möchte nicht das ganze Geburtsdatum im Profil anzeigen lassen sondern nur das Alter des Mitglieds, was muss ich ändern, bzw. wie geht das?

Danke dir schon mal und viele liebe Grüße

Jasi
Title: Re: [MOD] Birthday Mod v1.0
Post by: Jasi on January 28, 2008, 10:49:38 PM
Code: [Select]
[quote author=UFOSWORLD link=topic=11558.msg108441#msg108441 date=1199324520]
Cooler Mod.

Aber ich hab da wieder ein paar Fragen, bzw Probleme.

Erstes: Betrifft das Jahresfeld bei der Registrierung.
Hierzu hab ich eine Graphik von meiner Registrierung angehängt.  kann es sein das die Textfeldgrösse irgendwo zentral gespeichert ist.

weil im Code steht ja  [code]<td><input class="input" name="user_birthday_year" value="{user_birthday_year}" maxlength="4" size="5" type="text">
Also Grösse 5  aber das is genauso lang wie die Felder darüber und da steht bei size="30"  

Zweitens: Hat jemand einen fertigen Umbau, so das ich das Textfeld durch ein Dropdownfeld ersetzen kann. Muss ja eigentlich nur z.b. von 1950 - zum aktuellen Jahr gehn)   (auch soll dadurch die Eingabe von Buchstaben verhindert werden, um mögliche Fehlerquellen auszuschliessen... )  (Hab da nämlich ein kleines Anzeigeproblem wenn die Mail Adresse schon vergeben is... aber das wann anders...)


Merci und wieder ein toller Mod

gruss UFO

[/quote]

@ UFOSWORLD

schau mal auf den diesen Post im Thread von V@no:


Code: [Select]
[EDIT]
in member.php and register.php below:

Code: [Select]
$birthday_year_options = "<option value=\"\">--</option>\n";
  $end = date("Y");
  $start = $end-100;
  for ($i=$start;$i<=$end;$i++)
  {
    $birthday_year_options .= "<option value=\"".$i."\"".(($i == $user_birthday_year) ? "selected" : "").">".$i."</option>\n";
  }
  $user_birthday_year = $birthday_year_options;


und führe die Schritte durch... !!!

Ich habe es als Dropdownfeld dann bei mir in der register_form.html und member_editprofil.html dann so umgesetzt und funktioniert 1A

Code: [Select]
<select name="user_birthday_year" value="{user_birthday_year}">{user_birthday_year_options}</select>[/code]
Title: Re: [MOD] Birthday Mod v1.0
Post by: ClickyMouse on January 29, 2008, 06:07:17 PM
What's wrong?
Code: [Select]
Parse error: syntax error, unexpected T_ELSE in /www/110mb.com/g/r/u/p/o/s/c/o/gruposcout508/htdocs/fotos/member.php on line 1067
Here you got my member.php, from line 1055 to line 1074
Code: [Select]
    if (!empty($additional_user_fields)) {
      $additional_field_array = array();
      foreach ($additional_user_fields as $key => $val) {
        $additional_field_array[$key] = (!empty($user_row[$key])) ? format_text($user_row[$key], 1) : REPLACE_EMPTY;
        $additional_field_array['lang_'.$key] = $val[0];
      }
      if (!empty($additional_field_array)) {
        $site_template->register_vars($additional_field_array);
      }
    }
    $content = $site_template->parse_template("member_profile");
  }
  else {
    $content = $lang['invalid_user_id'];
  }
}

//-----------------------------------------------------
//--- Send Password -----------------------------------
//-----------------------------------------------------

Hope you can give me some advice

Thanks!
Title: Re: [MOD] Birthday Mod v1.0
Post by: Jasi on January 30, 2008, 01:11:50 AM
What's wrong?
Code: [Select]
Parse error: syntax error, unexpected T_ELSE in /www/110mb.com/g/r/u/p/o/s/c/o/gruposcout508/htdocs/fotos/member.php on line 1067
Here you got my member.php, from line 1055 to line 1074
Code: [Select]
    if (!empty($additional_user_fields)) {
      $additional_field_array = array();
      foreach ($additional_user_fields as $key => $val) {
        $additional_field_array[$key] = (!empty($user_row[$key])) ? format_text($user_row[$key], 1) : REPLACE_EMPTY;
        $additional_field_array['lang_'.$key] = $val[0];
      }
      if (!empty($additional_field_array)) {
        $site_template->register_vars($additional_field_array);
      }
    }
    $content = $site_template->parse_template("member_profile");
  }
  else {
    $content = $lang['invalid_user_id'];
  }
}

//-----------------------------------------------------
//--- Send Password -----------------------------------
//-----------------------------------------------------

Hope you can give me some advice

Thanks!


@ ClickyMouse

Hi,

i hope you unterstand my bad english...



This is my part and it works fine:

Code: [Select]
if (!empty($additional_user_fields)) {
      $additional_field_array = array();
      foreach ($additional_user_fields as $key => $val) {
        $additional_field_array[$key] = (!empty($user_row[$key])) ? format_text($user_row[$key], 1) : REPLACE_EMPTY;
        $additional_field_array['lang_'.$key] = $val[0];
      }
      if (!empty($additional_field_array)) {
        $site_template->register_vars($additional_field_array);
      }
    }
    $content = $site_template->parse_template("member_profile");
  }
  else {
    $content = $lang['invalid_user_id'];
  }
}

//-----------------------------------------------------
//--- Send Password -----------------------------------
//-----------------------------------------------------
Title: Re: [MOD] Birthday Mod v1.0
Post by: qBass17 on April 10, 2008, 01:15:59 AM
Mit der 1.7.6 funktioniert das ncht oder? Habe es nun 3mal eingebaut und ausgebaut, dennoch klappt nichts!
Wird es eine neue Version geben?
Title: Re: [MOD] Birthday Mod v1.0
Post by: Jan-Lukas on May 01, 2008, 08:23:23 PM
dann versuche es noch einmal :wink:
ich hab es gerade eingebaut, und läuft
test läuft noch bis heute 23:59:59
http://ue-ei-portal-sammlerkatalog.de/katupdate/

Hat wohl noch einer die Sternzeichen als zip :roll:

Harald
Title: Re: [MOD] Birthday Mod v1.0
Post by: nobby on May 01, 2008, 09:19:45 PM
Hallo Jan-Lukas,

habe ich mal zusammen gepackt.
Alle 12 Sternzeichen als Free-Gif.

Vielleicht genügt es Dir ja.

nobby
Title: Re: [MOD] Birthday Mod v1.0
Post by: Jan-Lukas on May 02, 2008, 08:32:57 PM
Hi nobby,
Klasse, sehe Sie mir mal an, hab mir zwar schon einige gebastelt aber vielleicht sind deine ja schöner  :wink:
sonst lege ich meine gleich auch mal als zip hier rein

Danke Harald
Title: Re: [MOD] Birthday Mod v1.0
Post by: nobby on May 02, 2008, 08:42:50 PM
Jau, die sind freeware und sehen als SW nicht schlecht aus.
Title: Re: [MOD] Birthday Mod v1.0
Post by: tonyf on June 18, 2008, 02:36:40 AM
Thanks! Works great. Good instructions.   :D  :D  :D  :D
Title: Re: [MOD] Birthday Mod v1.0
Post by: Deskcom on July 26, 2008, 06:08:54 AM
Sorry I didn't check the settings in admin, is there a way when you turn off the age it turns off the year on it as well. I don't want people to see or get the ages of my members on the gallery. Sorry about the prior post
Title: Re: [MOD] Birthday Mod v1.0
Post by: qBass17 on July 29, 2008, 09:35:33 PM
Was ist denn damit gemeint das ich birthday in mein db feld ändern soll. Welches db Feld? muss davor User_ oder wie ist das gemeint?
Title: Re: [MOD] Birthday Mod v1.0
Post by: Pontos on July 29, 2008, 10:30:25 PM
Was ist denn damit gemeint das ich birthday in mein db feld ändern soll. Welches db Feld? muss davor User_ oder wie ist das gemeint?

Hi Phisker B,
wenn du das ALTER TABLE so gemacht hast wie im ersten Post dann musst nichts ändern.

Was funzt den genau bei dir nich?
Ich hab den mod vor paar tagen eingebaut und der geht gut...
Title: Re: [MOD] Birthday Mod v1.0
Post by: qBass17 on July 29, 2008, 10:47:16 PM
Ja , danke es läuft :D
Ich kann es dir nicht sagen was der Fehler war, aber nun läuft es super.

Ich habe gerade das sterix (Sternzeichen) eingebaut. Habe dieses aber mit der Variante (Bilder) genommen. Habe ein Loewe.gif erstellt. Allerdings wird im profil dennoch nur "Loewe Loewe" angezeigt. Sdheinbar das er es nicht findet trotz das es im "images/sterinzeichen/Loewe.gif" liegt.
Title: Re: [MOD] Birthday Mod v1.0
Post by: Pontos on July 29, 2008, 11:04:46 PM
Ja , danke es läuft :D
Ich kann es dir nicht sagen was der Fehler war, aber nun läuft es super.

Ich habe gerade das sterix (Sternzeichen) eingebaut. Habe dieses aber mit der Variante (Bilder) genommen. Habe ein Loewe.gif erstellt. Allerdings wird im profil dennoch nur "Loewe Loewe" angezeigt. Sdheinbar das er es nicht findet trotz das es im "images/sterinzeichen/Loewe.gif" liegt.

Ok die Erweiterung hab ich nicht eingebaut weil sie mir nicht gefallen hat.
Wie ich gesehen habe gibt es zwei varianten die im ersten post und dann die V@no (Seite4)

Ist das das einzige gif was er dir nicht anzeigen tut, oder alle?

Welche Variant hast den genommen?
Weil wie ich das gesehen habe musst ja die gif’s nummerieren 1-12 (seite1),
      "sternzeichen" => ($sternzeichen) ? " &nbsp;&nbsp;".$lang['asterisk']." : ".$lang['asterisks'][$sternzeichen]." <img src=\"".TEMPLATE_PATH."/images/sternzeichen/".$sternzeichen.".jpg\" alt=\"".$lang['asterisks'][$sternzeichen]."\">"  : "",

Title: Re: [MOD] Birthday Mod v1.0
Post by: qBass17 on July 29, 2008, 11:25:24 PM
das jpg habe ich in gif umbenannt!

Nummerrieren.. mal schauen!....

Edit:
Tatsächlich, es lag an den Nummern :D
Auch nicht schlecht! Danke! Nun geht es!
Title: Re: [MOD] Birthday Mod v1.0
Post by: partymunich.de on December 10, 2008, 08:30:14 PM
Very good, but at Step 12

Open templates/home.html where it says:

Quote
Find
Code:  [Select]  [Expand]
  {whos_online}
  <br />

I can't find the {whos_online} part in my home.html

please help, thx!
Title: Re: [MOD] Birthday Mod v1.0
Post by: partymunich.de on December 10, 2008, 09:35:10 PM
ok ;)
nvm, just found it!!! thx tho!
Title: Re: [MOD] Birthday Mod v1.0
Post by: Sebas Bonito on July 16, 2009, 01:04:35 AM
[ENG]
Fantastic mod, thx for the work!!!

Is it possible to make the "year"-field optional? I guess, they're a few people don't like to publish their age, but have no problem to show their birthday. Thx!



[DEU]
Fantastische MOD, danke für die klasse Arbeit!!!

Ist es möglich, das Jahres-Feld optional anzubieten? Ich denke, es gibt immer einige Leute, die ihr Alter nicht veröffentlichen möchten, aber keine Probleme damit hätten, ihr Geburtstag zu sagen.
Title: Re: [MOD] Birthday Mod v1.0
Post by: winzie on May 29, 2010, 12:33:10 PM

V 1.7.7 - the 2 steps  below do not appear in either of the php's anyone  know how l can make this mod work without these 2 changes?  :?

Step 1 . 4  [ register.php ]
Find

 $site_template->register_vars(array(
      "user_name" => htmlspecialchars(stripslashes($user_name)),



Step 5 - last step  [ members.php ]
Find

 "user_homepage" => htmlspecialchars(stripslashes($user_homepage)),

Thanks in advance !!

Title: Re: [MOD] Birthday Mod v1.0
Post by: juewei on November 29, 2010, 04:10:21 PM
hallo,
ich habe ein Problem,
ich kann die birthday_install nicht ausführen und möchte jetzt manuell per phpmyadmin
die Tabellen anlegen.

muss ich hier noch was ändern? oder kann ich das so anlegen?
INSERT INTO `SETTINGS_TABLE` ( `setting_name` , `setting_value` ) VALUES ('birthday_required', '1') INSERT INTO `SETTINGS_TABLE` ( `setting_name` , `setting_value` ) VALUES ('birthday_show_profile_age', '1') INSERT INTO `SETTINGS_TABLE` ( `setting_name` , `setting_value` ) VALUES ('birthday_index', '1') INSERT INTO `SETTINGS_TABLE` ( `setting_name` , `setting_value` ) VALUES ('birthday_message', '1') ALTER TABLE `USERS_TABLE` ADD `birthday` DATE DEFAULT '0000-00-00' NOT NULL INSERT INTO `SETTINGS_TABLE` ( `setting_name` , `setting_value` ) VALUES ('birthday_profile_countdown', '1')

oder wie muss es dann richtig heißen?
Title: Re: [MOD] Birthday Mod v1.0
Post by: hummel on February 06, 2011, 02:26:34 PM
English

Hello
I have birthday mods installed, but it seems ....


DB Error: Bad SQL Query: SELECT user_id, user_name, birthday FROM 4images_users WHERE birthday LIKE '%-02-06' ORDER BY user_name
Unknown column 'birthday' in 'field list'

what is wrong?

German

Hallo
habe das Geburtstags-mods, installiert aber jetzt  erscheint

DB Error: Bad SQL Query: SELECT user_id, user_name, birthday FROM 4images_users WHERE birthday LIKE '%-02-06' ORDER BY user_name
Unknown column 'birthday' in 'field list'

wo liegt der Fehler?



Auf der Index seite erscheint folgender Fehler
An unexpected error occured. Please try again later.

Title: Re: [MOD] Birthday Mod v1.0
Post by: Greven-Freunde on July 30, 2013, 03:33:15 PM
Hallo,

netter MOD...vielen Dank!

Eine kleine Frage:
Sowohl im Kontrollzentrum als auch auf der Registerseite wird das Feld "Jahr" (Screenshot im Anhang) viel zu lang dargestellt, obwohl in den htmls jeweils size=5 definiert ist:
Änderung der size-Werte bringt keine Veränderung.
Wo kann ich die Feldgröße "Jahr" so korrigieren, dass das Feld in etwa mit "ICQ" abschliesst?

register_form.html
<!--  Birthday Mod     -->
          <tr>
             <td class="row1"><b>{lang_birthday}</b></td>
             <td class="row1"><table>
                      <tr>
                          <td>{lang_day}</td>
                          <td>{lang_month}</td>
                          <td>{lang_year}</td>
                      </tr>

                      <tr>
                           <td><select name="user_birthday_day">{birthday_day_options} </select></td>
                           <td><select name="user_birthday_month">{birthday_month_options}</select></td>
                           <td><input class="input" name="user_birthday_year" value="{user_birthday_year}" maxlength="4" size="5" type="text">
                           </td>
                      </tr>

            </table></td>
           </tr>
<!--  Birthday Mod     -->

member_editprofil.html
          <tr>
             <td class="row1"><b>{lang_birthday}</b></td>
             <td class="row1"><table>
                      <tr>
                          <td>{lang_day}</td>
                          <td>{lang_month}</td>
                          <td>{lang_year}</td>
                      </tr>

                      <tr>
                           <td><select name="user_birthday_day">{birthday_day_options}</select></td>
                           <td><select name="user_birthday_month">{birthday_month_options}</select></td>
                           <td><input type="text" name="user_birthday_year" value="{user_birthday_year}" size="5" maxlength="4" class="input"></td>
                      </tr>


Danke für die Hilfe vorab!

Gruß
Teddy
Title: Re: [MOD] Birthday Mod v1.0
Post by: FairyCosmo on October 08, 2015, 01:02:27 PM
My bad.

Quote
$user_birthday = $lang['months'] . REPLACE_EMPTY . $birthday[2].", "[sprintf(REPLACE_EMPTY, $birthday[1])];

Change to:

Quote
$user_birthday = $lang['months'] . REPLACE_EMPTY . $birthday[2].", [" . sprintf(REPLACE_EMPTY, $birthday[1]) . "]";

Should work now. 8)

Doesnt work. Gives out:

Quote
Array 25, [ ] 1987
Title: Re: [MOD] Birthday Mod v1.0
Post by: Aleksey on May 06, 2020, 12:13:33 PM
Fixes for the [MOD] Birthday Mod v1.0 to work in gallery 1.8 on php 7

Open includes/functions.php
find:
Code: [Select]
if ($valid == 1 && ($error || (!ereg("([0-9]{4})-([0-9]{2})-([0-9]{2})", $birthday)))) return false;and replace with:
Code: [Select]
if ($valid == 1 && ($error || (!preg_match("/([0-9]{4})-([0-9]{2})-([0-9]{2})/", $birthday)))) return false;
The (ereg) function was removed from php 7, and we use (preg_match) instead.
Title: Re: [MOD] Birthday Mod v1.0
Post by: Aleksey on May 09, 2020, 12:55:04 PM
Improving the [MOD] Birthday Mod v1.0

If the user doesn't want to show the year of birth, they no longer need to enter the year 0000.
Just leave this field empty and the system will automatically enter the year 0000.

Open includes/functions.php

find:
Code: [Select]
function check_birthday($birthday_day = "", $birthday_month = "", $birthday_year = "", $valid = 0) {
  $error = 0;

below insert:
Code: [Select]
  if (empty($birthday_year)) {
  $birthday_year = "0000";
  }

The user must not enter a date of birth more than 100 years old.
The user must not enter a date of birth greater than the current year.
The check must take into account 0000 when the user hides their year of birth.

find:
Code: [Select]
   else {
       $birthday = "0000-00-00";
       $error = 1;
   }

below insert:
Code: [Select]
//check if age is bigger than 100 or bigger current year
$today = getdate (time());
if ($birthday_year == "0000") { }
elseif (($today['year'] > (intval($birthday_year)+100)) || (intval($birthday_year) > $today['year'])) return false;

By default, if the user enters the last two digits of the year, the function automatically inserts the year 19XX at the beginning.
This is wrong because there are people born in 2001.

find:
Code: [Select]
      case 2:
          $birthday_year = "19$birthday_year";
          break;

and replace:
Code: [Select]
\\      case 2:
\\          $birthday_year = "19$birthday_year";
\\          break;

Or delete it is not the correct solution.

You can make it intuitive for the user that the year can be left empty.

Open lang/<your language>/main.php
Find
Code: [Select]
$lang['year'] = "year";Replace:
Code: [Select]
$lang['year'] = "year (optional)";
This will be displayed when registering and editing the user (control panel)