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

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

0 Members and 1 Guest are viewing this topic.

Offline Fastian

  • Full Member
  • ***
  • Posts: 199
    • View Profile
Re: Birthday Mod v1.0
« Reply #60 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 .
I m not a  Programmer.
          But
I m a Good Learner.

Offline Fastian

  • Full Member
  • ***
  • Posts: 199
    • View Profile
Re: Birthday Mod v1.0
« Reply #61 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 ?
I m not a  Programmer.
          But
I m a Good Learner.

Offline IcEcReaM

  • Hero Member
  • *****
  • Posts: 714
    • View Profile
    • My little Testboard
Re: Birthday Mod v1.0
« Reply #62 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.

Coding is a everlasting competition between programmers who tries to write larger, better and idiot-safe programs and the universe producing larger and stupider idiots...
...so far the universe won
bump

Offline wallpapers

  • Full Member
  • ***
  • Posts: 107
    • View Profile
    • Tuned-Cars.Net
Re: Birthday Mod v1.0
« Reply #63 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"
);



Offline IcEcReaM

  • Hero Member
  • *****
  • Posts: 714
    • View Profile
    • My little Testboard
Re: Birthday Mod v1.0
« Reply #64 on: March 14, 2006, 10:06:04 PM »
thanks, added to the first post.
Coding is a everlasting competition between programmers who tries to write larger, better and idiot-safe programs and the universe producing larger and stupider idiots...
...so far the universe won
bump

Offline Stoleti

  • Hero Member
  • *****
  • Posts: 574
    • View Profile
Re: Birthday Mod v1.0
« Reply #65 on: March 14, 2006, 10:13:50 PM »
can we make the year date as drop down like days/months ?  :?:

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Birthday Mod v1.0
« Reply #66 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 ;))
« Last Edit: March 15, 2006, 02:41:38 AM by V@no »
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Fastian

  • Full Member
  • ***
  • Posts: 199
    • View Profile
Re: Birthday Mod v1.0
« Reply #67 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 ?
I m not a  Programmer.
          But
I m a Good Learner.

Offline Fastian

  • Full Member
  • ***
  • Posts: 199
    • View Profile
Re: Birthday Mod v1.0
« Reply #68 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.
I m not a  Programmer.
          But
I m a Good Learner.

Offline TIMT

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
Re: [MOD] Birthday Mod v1.0
« Reply #69 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
« Last Edit: March 25, 2006, 04:16:40 PM by TIMT »

Offline IcEcReaM

  • Hero Member
  • *****
  • Posts: 714
    • View Profile
    • My little Testboard
Re: [MOD] Birthday Mod v1.0
« Reply #70 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])];
Coding is a everlasting competition between programmers who tries to write larger, better and idiot-safe programs and the universe producing larger and stupider idiots...
...so far the universe won
bump

Offline Stoleti

  • Hero Member
  • *****
  • Posts: 574
    • View Profile
Re: [MOD] Birthday Mod v1.0
« Reply #71 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 !





Offline TIMT

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
Re: [MOD] Birthday Mod v1.0
« Reply #72 on: March 25, 2006, 05:16:38 PM »
Hi IcEcReaM

Thanks! It works perfect... good service!   :D

Offline TIMT

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
Re: [MOD] Birthday Mod v1.0
« Reply #73 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!

Offline IcEcReaM

  • Hero Member
  • *****
  • Posts: 714
    • View Profile
    • My little Testboard
Re: [MOD] Birthday Mod v1.0
« Reply #74 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?
Coding is a everlasting competition between programmers who tries to write larger, better and idiot-safe programs and the universe producing larger and stupider idiots...
...so far the universe won
bump