• [MOD] Birthday Mod v1.0 5 0 5 1
Currently:  

Author Topic: [MOD] Birthday Mod v1.0  (Read 193932 times)

0 Members and 1 Guest are viewing this topic.

Offline Sebas Bonito

  • Sr. Member
  • ****
  • Posts: 271
  • Sebas Bonito
    • View Profile
Re: [MOD] Birthday Mod v1.0
« Reply #135 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.

Offline winzie

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: [MOD] Birthday Mod v1.0
« Reply #136 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 !!


Offline juewei

  • Full Member
  • ***
  • Posts: 162
    • View Profile
Re: [MOD] Birthday Mod v1.0
« Reply #137 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?

Offline hummel

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: [MOD] Birthday Mod v1.0
« Reply #138 on: February 06, 2011, 02:26:34 PM »
English

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


DB ErrorBad SQL QuerySELECT user_iduser_namebirthday 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 ErrorBad SQL QuerySELECT user_iduser_namebirthday 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.

« Last Edit: February 06, 2011, 03:08:43 PM by hummel »

Offline Greven-Freunde

  • Pre-Newbie
  • Posts: 7
    • View Profile
    • Hohnerklänge 1953 e.V. - Fotogalerie
Re: [MOD] Birthday Mod v1.0
« Reply #139 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
Vielen Dank und Gruß
vom Teddy

Offline FairyCosmo

  • Pre-Newbie
  • Posts: 9
  • ...for the lulz
    • View Profile
Re: [MOD] Birthday Mod v1.0
« Reply #140 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

Offline Aleksey

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: [MOD] Birthday Mod v1.0
« Reply #141 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.

Offline Aleksey

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: [MOD] Birthday Mod v1.0
« Reply #142 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)
« Last Edit: May 10, 2020, 04:07:57 PM by Aleksey »