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

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

0 Members and 1 Guest are viewing this topic.

Offline Stoleti

  • Hero Member
  • *****
  • Posts: 574
    • View Profile
Re: Birthday Mod v1.0
« Reply #15 on: February 10, 2006, 11:24:39 PM »
well i've just changed that two steps 3 and 4 and still work perfect !!

 :mrgreen:

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: Birthday Mod v1.0
« Reply #16 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

;)

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 #17 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...
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 insane

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Gallery
Re: Birthday Mod v1.0
« Reply #18 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.

Offline IcEcReaM

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

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


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 Alex_Ok

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Re: Birthday Mod v1.0
« Reply #21 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'

У меня таже проблема :?:

Offline IcEcReaM

  • Hero Member
  • *****
  • Posts: 714
    • View Profile
    • My little Testboard
Re: Birthday Mod v1.0
« Reply #22 on: February 11, 2006, 12:52:25 AM »
Did you exectued the birthday_install.php?
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 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 #23 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 ;)
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 IcEcReaM

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

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Gallery
Re: Birthday Mod v1.0
« Reply #25 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?
« Last Edit: February 11, 2006, 11:59:28 AM by insane »

Offline Loda

  • Sr. Member
  • ****
  • Posts: 353
    • View Profile
    • Fotosucht Schweiz
Re: Birthday Mod v1.0
« Reply #26 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",

Michael

  • Guest
Re: Birthday Mod v1.0
« Reply #27 on: February 11, 2006, 03:52:05 PM »
Funktioniert super  :)

vielen Dank !!!

Offline timerex

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Birthday Mod v1.0
« Reply #28 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

Offline IcEcReaM

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