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

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

0 Members and 2 Guests are viewing this topic.

Offline chull

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: [MOD] Birthday Mod v1.0
« Reply #90 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
« Last Edit: August 10, 2006, 07:11:26 PM by chull »

Offline IcEcReaM

  • Hero Member
  • *****
  • Posts: 714
    • View Profile
    • My little Testboard
Re: [MOD] Birthday Mod v1.0
« Reply #91 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
« Last Edit: August 11, 2006, 09:10:04 PM by IcEcReaM »
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 chull

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: [MOD] Birthday Mod v1.0
« Reply #92 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
« Last Edit: August 11, 2006, 02:32:55 PM by chull »

Offline IcEcReaM

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

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: [MOD] Birthday Mod v1.0
« Reply #94 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

Offline IcEcReaM

  • Hero Member
  • *****
  • Posts: 714
    • View Profile
    • My little Testboard
Re: [MOD] Birthday Mod v1.0
« Reply #95 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'] ."\">" : "";
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 chull

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: [MOD] Birthday Mod v1.0
« Reply #96 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

Offline Michael_Muntau

  • Newbie
  • *
  • Posts: 20
    • View Profile
    • ...anders, verrückt, genial
Re: [MOD] Birthday Mod v1.0
« Reply #97 on: October 10, 2006, 04:49:11 PM »
Also nach dem ich kleine Schwierigkeiten hatte, läuft nun alles einwandfrei!

Danke dafür!

Offline F2F

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

Offline F2F

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

Offline TubeTopia

  • Newbie
  • *
  • Posts: 21
    • View Profile
    • TubeTopia
Re: [MOD] Birthday Mod v1.0
« Reply #100 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
"Don't worry about the world coming to an end today. It's already tomorrow in Australia." Charles Schultz

Offline chull

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: [MOD] Birthday Mod v1.0
« Reply #101 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

Offline drastx

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

Offline chull

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: [MOD] Birthday Mod v1.0
« Reply #103 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

Offline CeJay

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