Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
Date of Birth at Registration
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2 Only Mods Complete

Unknown User
2009-10-20 19:23:01
excuse me for my bad english...

these codes not written by me, i'm just picking up them, and integrating to v2.05 (working to me...)

ALTER TABLE `users` ADD dob DATE NOT NULL default '0000-00-00';
open account-signup.php

Find:

//make first member admin

if ($numsitemembers == '0')
$signupclass = '7';
else
$signupclass = '1';


Add after:
   $dob = $year."-".$month."-".$day;
  $updateset[] = "dob = '$dob'";

Find:

   $ret = mysql_query("INSERT INTO users (username, password, secret, email, status, added, age, country, gender, client, stylesheet, language, class) VALUES (" .

 implode(",", array_map("sqlesc", array($wantusername, $wantpassword, $secret, $email, $status, get_date_time(), $age, $country, $gender, $client, $site_config["default_theme"], $site_config["default_language"], $signupclass))).")");

Replace with this:

   $ret = mysql_query("INSERT INTO users (username, password, secret, email, status, added, dob, country, gender, client, stylesheet, language, class) VALUES (" .

 implode(",", array_map("sqlesc", array($wantusername, $wantpassword, $secret, $email, $status, get_date_time(), $dob, $country, $gender, $client, $site_config["default_theme"], $site_config["default_language"], $signupclass))).")");

Find:

<tr>
<td>Age:</td>
<td><input type="text" size="40" name="age" maxlength="3" /></td>
</tr>

Add after (or replace with this...)


<tr>
<?php
echo "<tr><td><b><font color=FF0000>Date of birth: </font></b></td><td valign=\"top\" align=left>";
list($year,$month,$day) = explode('-',$CURUSER['dob']);

echo "<select name='year'>\n";
echo "<option value='0'>--</option>\n";
for ($y=1909;$y<=date('Y');$y++) {
$s = $y == $year ? 'selected' : '';

echo "<option value='$y' $s>$y</option>\n";

}
echo "</select>\n";
echo "<select name='month'>\n";
echo "<option value='0'>--</option>\n";

for ($m=1;$m<=12;$m++) {
$s = ($m == $month ? 'selected' : '');

printf("<option value='$m' $s>%s</option>\n",date("F", mktime(0,0,0,$m,1,1970)));
}
echo "</select>\n";
echo "<select name='day'>\n";
echo "<option value='0'>--</option>\n";

for ($d=1;$d<=31;$d++) {
$s = $d == $day ? 'selected' : '';
echo "<option value='$d' $s>$d</option>\n";
}
echo "</select></td></tr>";
?>

save & upload

open account.php

Find:

<?php print("<B>".AGE.""); ?>:</b> <? print("" . $CURUSER["age"] . "\n"); ?><br>


Add after (or replace with this...)

	<?php print("<B>Date of birth: </b>"); 

list($year,$month,$day) = explode('-',$CURUSER["dob"]);

print(" ".$year."-".$month."-".$day); ?><br>

save & upload


open account-details.php



Find:

		<td align="left">
Age: <?php=htmlspecialchars($user["age"])?><br>

Add after (or replace with this...)

	Date of birth: <?list($year,$month,$day) = explode('-',$user['dob']);
print("".$year."-".$month."-".$day."");?><br>
save & upload

Many thanks all of you guys! For this code parts, and all of mods & hacks...

This work based on Phoenix_UK's code

[url="http://www.torrenttrader.pw/index.php?showtopic=4591&hl=birthday"]http://www.torrenttrader.pw/index.php?sho...amp;hl=birthday[/url]
Unknown User
2009-11-20 18:03:56
Thanks

how to create a block of anniversaries ?
Unknown User
2009-11-24 17:49:01
Look at the mod for classic.
Unknown User
2011-08-23 08:14:09
thank you.
Unknown User
2014-05-21 12:12:52
if you want this code,but pb


<?php
   echo "<tr><td><b><font color=FF0000>" .T_("DATE_OF_BIRTHDAY"). ": </font><font color='red' class="required">*</font></b></td><td valign="top" align=left>";
                       
   list($day,$month,$year) = explode('-',$CURUSER['dob']);
                   
   echo "<select name='day'>n";
   echo "<option value='0'>--</option>n";
                       
for ($d=1;$d<=31;$d++) {
   $s = $d == $day ? 'selected' : '';
   
   echo "<option value='$d' $s>$d</option>n";
}
   echo "</select>n";
   echo "<select name='month'>n";
   echo "<option value='0'>--</option>n";
                       
for ($m=1;$m<=12;$m++) {
   $s = ($m == $month ? 'selected' : '');
   printf("<option value='$m' $s>%s</option>n",date("F", mktime(0,0,0,$m,1,1970)));
}
   echo "</select>n";
   echo "<select name='year'>n";
   echo "<option value='0'>--</option>n";
                       
for ($y=1930;$y<=date('Y');$y++) {
   $s = $y == $year ? 'selected' : '';
                           
   echo "<option value='$y' $s>$y</option>n";
}
   echo "</select></td></tr>";
   
?>



I have not resolded this code,it's possible help?


echo "<tr><td><b><font color=FF0000>" .T_("DATE_OF_BIRTHDAY"). ": </font><font color='red' class="required">*</font></b></td><td valign="top" align=left>";

Unknown User
2014-05-21 15:45:41
prob is $CURUSER is not defined in account-signup lol cause they dont have an current username..

This one seems to work fine on my site.


<?php
echo "<td align=left>Date of Birth <font color=#FF0000 class=small>(Req)</font>:</td><td align=left>";
echo "<select name='day'>n";
echo "<option value='0'>--</option>n";
for ($d = 1; $d <= 31; $d++) {
   $s = $d == $day ? 'selected' : '';
   echo "<option value='$d' $s>$d</option>n";
} //$d = 1; $d <= 31; $d++
echo "</select>n";
echo "<select name='month'>n";
echo "<option value='0'>--</option>n";
for ($m = 1; $m <= 12; $m++) {
   $s = $m == $month ? 'selected' : '';
   printf("<option value='$m' $s>%s</option>n", date("F", mktime(0, 0, 0, $m, 1, 1970)));
} //$m = 1; $m <= 12; $m++
echo "</select>n";
echo "<select name='year'>n";
echo "<option value='0'>--</option>n";
for ($y = 1909; $y <= date('Y'); $y++) {
   $s = $y == $year ? 'selected' : '';
   echo "<option value='$y' $s>$y</option>n";
} //$y = 1909; $y <= date('Y'); $y++
echo "</select></td>";
?>
Unknown User
2014-05-21 18:57:54
ArticWolf why in this code "age" delete?

account-signup.php


$ret = mysql_query("INSERT INTO users (username, password, secret, email, status, added, dob, country, gender, client, stylesheet, language, class) VALUES (" .
    implode(",", array_map("sqlesc", array($wantusername, $wantpassword, $secret, $email, $status, get_date_time(), $dob, $country, $gender, $client, $site_config["default_theme"], $site_config["default_language"], $signupclass))).")");

Unknown User
2014-05-21 19:21:21
farther up or something dob defined in the takesignup.

$year = (int) $_POST["year"];
   $month = (int) $_POST["month"];
   $day = (int) $_POST["day"];
   if (!$year || !$month || !$day)
       $message = "Do not leave any required Birthday Fields blank.";
   $dob = "$year-$month-$day";
not sure what you mean about "age"?? its prob an older then sin old mod or something someone made to display the age without doing math.. age field would be wrong every year anyway unless some kind of script to update it.you could change this

echo "<td align=left>Date of Birth <font color=#FF0000 class=small>(Req)</font>:</td><td align=left>";

to
echo "<td><b><font color=FF0000>" .T_("DATE_OF_BIRTHDAY"). ": </font><font color='red' class="required">*</font></b></td><td valign="top" align=left>";

i personally like using (Req) instead of * lol less confusing to members.
Unknown User
2014-05-21 21:21:56
not work lol


echo "<td><b><font color=FF0000>" .T_("DATE_OF_BIRTHDAY"). ": </font><font color='red' class="required">*</font></b></td><td valign="top" align=left>";


probality class=required  B)

take your code ArticWolf #6

thank you
Unknown User
2014-05-22 02:50:14
to display the age in account-details.php

replace

		<?php echo T_("AGE"); ?>: <?php echo htmlspecialchars($user["age"])?><br />

with
<?php
if ($user[dob] != "0000-00-00") {
   $current = gmdate("Y-m-d", time() + $CURUSER['tzoffset'] * 60);
   $birthday = $user["dob"];
   list($year2, $month2, $day2) = preg_split('/[-]/', $current);
   list($year1, $month1, $day1) = preg_split('/[-]/', $birthday);
   if ($month2 < $month1) {
       $age = $year2 - $year1 - 1;
   }
   if ($month2 == $month1) {
       if ($day2 < $day1) {
           $age = $year2 - $year1 - 1;
       } else {
           $age = $year2 - $year1;
       }
   }
   if ($month2 > $month1) {
       $age = $year2 - $year1;
   }
   print(T_("AGE").": $agen");
   if ($user["id"] == $CURUSER["id"] || $CURUSER["control_panel"] == "yes") {
       print("Birth Date: $birthdayn<br />");
   } else {
       print("n<br />");
   }
}
///////////////// BIRTHDAY MOD /////////////////////
?>        

as you can prob tell its for 2.08 lol, i dont touch any versions below 2.08
Unknown User
2014-05-22 07:37:03
lolll "as you can prob tell its for 2.08 lol, i dont touche any version below 2.08"  :lol:

ArticWolf in account.php


<b><?php echo T_("DATE_OF_BIRTHDAY"); ?>:</b> <?php echo $CURUSER["BIRTHDAY"];
    list($year,$month,$day) = explode('-',$CURUSER["dob"]);
    print(" ".$year."-".$month."-".$day); ?><br>


good also ?  :P

good good day ArticWolf  B)
Unknown User
2014-05-22 10:48:24
[url="http://devscorner.xyz/index.php?/topic/18044-date-of-birth-addon-for-208/#entry92477"]http://devscorner.xyz/index.php?/topic/18044-date-of-birth-addon-for-208/#entry92477[/url]
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 8
  • Members: 0
  • Guests online: 8
  • Comments: 3
  • Messages: 1,728