Birthdays

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
151
66%
Very Good
39
17%
Good
21
9%
Fair
5
2%
Poor
12
5%
 
Total votes: 228

TerraFrost
Former Team Member
Posts: 5957
Joined: Sun Dec 26, 2004 3:40 am
Location: Austin, TX

Re: Birthdays

Post by TerraFrost »

Off hand, I don't see any problems with that code. The most likely culprit, I suspect, isn't that, but rather, the way it was added. Do you still have the original admin_users.php file? If not, try redoing it and see if you get the problem, again?

The FIND before that code segment is this:

Code: Select all

#
#-----[ FIND ]------------------------------------------
#
			'S_PROFILE_ACTION' => append_sid("admin_users.$phpEx"))
		);
Maybe you added the code after the 'S_PROFILE_ACTION', but before the );?

Also, if there's an error_log file, that might yield some useful information.
BF_Jake
Registered User
Posts: 4
Joined: Thu Oct 23, 2008 12:52 am

Re: Birthdays

Post by BF_Jake »

Did that a bunch of times same results. I redid all just to make sure. what is this funtion doing what wont work with out it?
TerraFrost
Former Team Member
Posts: 5957
Joined: Sun Dec 26, 2004 3:40 am
Location: Austin, TX

Re: Birthdays

Post by TerraFrost »

BF_Jake wrote:Did that a bunch of times same results. I redid all just to make sure. what is this funtion doing what wont work with out it?
I'd like to be able to judge for myself and having an admin_users.php file that manifests the problem would enable me to do that...

As for what it does... well, without it, you won't be able to change or view peoples birthday settings from the ACP.
BF_Jake
Registered User
Posts: 4
Joined: Thu Oct 23, 2008 12:52 am

Re: Birthdays

Post by BF_Jake »

Here is the admin.php


Love this mod btw
Last edited by BF_Jake on Fri Oct 24, 2008 6:56 pm, edited 1 time in total.
TerraFrost
Former Team Member
Posts: 5957
Joined: Sun Dec 26, 2004 3:40 am
Location: Austin, TX

Re: Birthdays

Post by TerraFrost »

After commenting out all the MOD specific code, I didn't encounter any problems.

That said, one thing I'm wondering is... maybe you haven't copied the birthday_interface.tpl file over for the template you're using? I see profile_add_body for RedXBB and birthday_interface.tpl should be in that same directory, but... it isn't.
BF_Jake
Registered User
Posts: 4
Joined: Thu Oct 23, 2008 12:52 am

Re: Birthdays

Post by BF_Jake »

OMG Im such a noob :oops: you nailed bro thanks you rock. Its for a new site Im working on to replace the one with the RedXBB but you still were correct :) Thanks alot great mod
andy zetec
Registered User
Posts: 1
Joined: Mon Nov 24, 2008 4:48 pm

Re: Birthdays

Post by andy zetec »

is there any way of accessing the birthdays for up to a month in advanced
im on a site and run the site news letter and would like to post the sites members birthdays up for the month in the news letter
User avatar
quahappy
Former Team Member
Posts: 1416
Joined: Tue Dec 12, 2006 8:19 pm
Location: South Yorkshire
Name: Andy Green

Re: Birthdays

Post by quahappy »

andy zetec wrote:is there any way of accessing the birthdays for up to a month in advanced
im on a site and run the site news letter and would like to post the sites members birthdays up for the month in the news letter
Easiest way is to change Number of Days to Look Ahead in Admin ACP >> Configuration >> Birthdays. Then on your forum index page, check the Birthday box and note all members birthdays upcoming.
If you don't ask.....
Wasrana
Registered User
Posts: 20
Joined: Tue Nov 28, 2006 6:08 am
Location: Pakistan

Re: Birthdays

Post by Wasrana »

I'm trying to Install this mod on phpbb 2.0.21 through easymod

I get this error

Code: Select all

Critical Error

FIND FAILED: In file [includes/usercp_viewprofile.php] could not find:

'LOCATION' => ( $profiledata['user_from'] ) ? $profiledata['user_from'] : ' ',

MOD script line #1038 ::

I have some other mods installed which might have modified usercp_viewprofile.php file, most likely flag mod.


Any solution?
User avatar
quahappy
Former Team Member
Posts: 1416
Joined: Tue Dec 12, 2006 8:19 pm
Location: South Yorkshire
Name: Andy Green

Re: Birthdays

Post by quahappy »

Wasrana wrote:I'm trying to Install this mod on phpbb 2.0.21 through easymod

I get this error

Code: Select all

Critical Error

FIND FAILED: In file [includes/usercp_viewprofile.php] could not find:

'LOCATION' => ( $profiledata['user_from'] ) ? $profiledata['user_from'] : ' ',

MOD script line #1038 ::

I have some other mods installed which might have modified usercp_viewprofile.php file, most likely flag mod.

Any solution?
While EasyMOD simplifies installation of MOD's, the problem starts when a forum has one or more MOD's already installed which can sometimes cause install errors as EasyMOD is looking for unmodified code.

The best solution is to apply the required edits manually to includes/usercp_viewprofile.php file (please make backup first!):

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_viewprofile.php
#
#-----[ FIND ]------------------------------------------
#
if ( !empty($profiledata['user_icq']) )
#
#-----[ BEFORE, ADD ]-----------------------------------
#
$birthday = ' ';
if ( !empty($profiledata['user_birthday']) && $profiledata['birthday_display'] != BIRTHDAY_AGE && $profiledata['birthday_display'] != BIRTHDAY_NONE )
{
	preg_match('/(..)(..)(....)/', sprintf('%08d',$profiledata['user_birthday']), $bday_parts);
	$bday_month = $bday_parts[1];
	$bday_day = $bday_parts[2];
	$bday_year = ( $profiledata['birthday_display'] != BIRTHDAY_DATE ) ? $bday_parts[3] : 0;
	// the next line converts $lang['DATE_FORMAT'] to something that'll work with years, as this MOD encodes them.  the preg_replace replaces things like ', Y' with '' when the year isn't
	// specified, to account for date formats that would result in strings like 'October 31, 2005'
	$birthday_format = ($bday_year != 0) ? str_replace(array('y','Y'),array($bday_year % 100,$bday_year),$lang['DATE_FORMAT']) : preg_replace('#[^djFmMnYy]*[Yy]#','',$lang['DATE_FORMAT']);
	$birthday = create_date($birthday_format, gmmktime(12,0,0,$bday_month,$bday_day,2000), 0);
}

#
#-----[ FIND ]------------------------------------------
#
	'LOCATION' => ( $profiledata['user_from'] ) ? $profiledata['user_from'] : ' ',
#
#-----[ BEFORE, ADD ]-----------------------------------
#
	'BIRTHDAY' => $birthday,
#
#-----[ FIND ]------------------------------------------
#
	'L_LOCATION' => $lang['Location'],
#
#-----[ BEFORE, ADD ]-----------------------------------
#
	'L_BIRTHDAY' => $lang['Birthday'],
#
Hope that helps. :D
If you don't ask.....
Wasrana
Registered User
Posts: 20
Joined: Tue Nov 28, 2006 6:08 am
Location: Pakistan

Re: Birthdays

Post by Wasrana »

here is the usercp_viewprofile.php

Code: Select all

<?php
/***************************************************************************
 *                           usercp_viewprofile.php
 *                            -------------------
 *   begin                : Saturday, Feb 13, 2001
 *   copyright            : (C) 2001 The phpBB Group
 *   email                : support@phpbb.com
 *
 *   $Id: usercp_viewprofile.php,v 1.5.2.6 2005/09/14 18:14:30 acydburn Exp $
 *
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *
 ***************************************************************************/

if ( !defined('IN_PHPBB') )
{
	die("Hacking attempt");
	exit;
}

if ( empty($HTTP_GET_VARS[POST_USERS_URL]) || $HTTP_GET_VARS[POST_USERS_URL] == ANONYMOUS )
{
	message_die(GENERAL_MESSAGE, $lang['No_user_id_specified']);
}
$profiledata = get_userdata($HTTP_GET_VARS[POST_USERS_URL]);

if (!$profiledata)
{
	message_die(GENERAL_MESSAGE, $lang['No_user_id_specified']);
}

$sql = "SELECT *
	FROM " . RANKS_TABLE . "
	ORDER BY rank_special, rank_min";
if ( !($result = $db->sql_query($sql)) )
{
	message_die(GENERAL_ERROR, 'Could not obtain ranks information', '', __LINE__, __FILE__, $sql);
}

$ranksrow = array();
while ( $row = $db->sql_fetchrow($result) )
{
	$ranksrow[] = $row;
}
$db->sql_freeresult($result);

//
// Output page header and profile_view template
//
$template->set_filenames(array(
	'body' => 'profile_view_body.tpl')
);
make_jumpbox('viewforum.'.$phpEx);

//
// Calculate the number of days this user has been a member ($memberdays)
// Then calculate their posts per day
//
$regdate = $profiledata['user_regdate'];
$memberdays = max(1, round( ( time() - $regdate ) / 86400 ));
$posts_per_day = $profiledata['user_posts'] / $memberdays;

// Get the users percentage of total posts
if ( $profiledata['user_posts'] != 0  )
{
	$total_posts = get_db_stat('postcount');
	$percentage = ( $total_posts ) ? min(100, ($profiledata['user_posts'] / $total_posts) * 100) : 0;
}
else
{
	$percentage = 0;
}

$avatar_img = '';
if ( $profiledata['user_avatar_type'] && $profiledata['user_allowavatar'] )
{
	switch( $profiledata['user_avatar_type'] )
	{
		case USER_AVATAR_UPLOAD:
			$avatar_img = ( $board_config['allow_avatar_upload'] ) ? '<img src="' . $board_config['avatar_path'] . '/' . $profiledata['user_avatar'] . '" alt="" border="0" />' : '';
			break;
		case USER_AVATAR_REMOTE:
			$avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $profiledata['user_avatar'] . '" alt="" border="0" />' : '';
			break;
		case USER_AVATAR_GALLERY:
			$avatar_img = ( $board_config['allow_avatar_local'] ) ? '<img src="' . $board_config['avatar_gallery_path'] . '/' . $profiledata['user_avatar'] . '" alt="" border="0" />' : '';
			break;
	}
}

$poster_rank = '';
$rank_image = '';
if ( $profiledata['user_rank'] )
{
	for($i = 0; $i < count($ranksrow); $i++)
	{
		if ( $profiledata['user_rank'] == $ranksrow[$i]['rank_id'] && $ranksrow[$i]['rank_special'] )
		{
			$poster_rank = $ranksrow[$i]['rank_title'];
			$rank_image = ( $ranksrow[$i]['rank_image'] ) ? '<img src="' . $ranksrow[$i]['rank_image'] . '" alt="' . $poster_rank . '" title="' . $poster_rank . '" border="0" /><br />' : '';
		}
	}
}
else
{
	for($i = 0; $i < count($ranksrow); $i++)
	{
		if ( $profiledata['user_posts'] >= $ranksrow[$i]['rank_min'] && !$ranksrow[$i]['rank_special'] )
		{
			$poster_rank = $ranksrow[$i]['rank_title'];
			$rank_image = ( $ranksrow[$i]['rank_image'] ) ? '<img src="' . $ranksrow[$i]['rank_image'] . '" alt="' . $poster_rank . '" title="' . $poster_rank . '" border="0" /><br />' : '';
		}
	}
}

$temp_url = append_sid("privmsg.$phpEx?mode=post&" . POST_USERS_URL . "=" . $profiledata['user_id']);
$pm_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_pm'] . '" alt="' . $lang['Send_private_message'] . '" title="' . $lang['Send_private_message'] . '" border="0" /></a>';
$pm = '<a href="' . $temp_url . '">' . $lang['Send_private_message'] . '</a>';
// Country/Location Flags
	'BIRTHDAY' => $birthday,
$location = ( $profiledata['user_from'] ) ? $profiledata['user_from'] : '&nbsp;';
$flag = ( !empty($profiledata['user_from_flag']) ) ? '&nbsp;<img src="images/flags/' . $profiledata['user_from_flag'] . '" alt="' . $profiledata['user_from_flag'] . '" title="' . $profiledata['user_from_flag'] . '" border="1" />' : '';
$location .= $flag;

if ( !empty($profiledata['user_viewemail']) || $userdata['user_level'] == ADMIN )
{
	$email_uri = ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL .'=' . $profiledata['user_id']) : 'mailto:' . $profiledata['user_email'];

	$email_img = '<a href="' . $email_uri . '"><img src="' . $images['icon_email'] . '" alt="' . $lang['Send_email'] . '" title="' . $lang['Send_email'] . '" border="0" /></a>';
	$email = '<a href="' . $email_uri . '">' . $lang['Send_email'] . '</a>';
}
else
{
	$email_img = '&nbsp;';
	$email = '&nbsp;';
}

$www_img = ( $profiledata['user_website'] ) ? '<a href="' . $profiledata['user_website'] . '" target="_userwww"><img src="' . $images['icon_www'] . '" alt="' . $lang['Visit_website'] . '" title="' . $lang['Visit_website'] . '" border="0" /></a>' : '&nbsp;';
$www = ( $profiledata['user_website'] ) ? '<a href="' . $profiledata['user_website'] . '" target="_userwww">' . $profiledata['user_website'] . '</a>' : '&nbsp;';
$birthday = '&nbsp;';
if ( !empty($profiledata['user_birthday']) && $profiledata['birthday_display'] != BIRTHDAY_AGE && $profiledata['birthday_display'] != BIRTHDAY_NONE )
{
	preg_match('/(..)(..)(....)/', sprintf('%08d',$profiledata['user_birthday']), $bday_parts);
	$bday_month = $bday_parts[1];
	$bday_day = $bday_parts[2];
	$bday_year = ( $profiledata['birthday_display'] != BIRTHDAY_DATE ) ? $bday_parts[3] : 0;
	// the next line converts $lang['DATE_FORMAT'] to something that'll work with years, as this MOD encodes them.  the preg_replace replaces things like ', Y' with '' when the year isn't
	// specified, to account for date formats that would result in strings like 'October 31, 2005'
	$birthday_format = ($bday_year != 0) ? str_replace(array('y','Y'),array($bday_year % 100,$bday_year),$lang['DATE_FORMAT']) : preg_replace('#[^djFmMnYy]*[Yy]#','',$lang['DATE_FORMAT']);
	$birthday = create_date($birthday_format, gmmktime(12,0,0,$bday_month,$bday_day,2000), 0);
}
if ( !empty($profiledata['user_icq']) )
{
	$icq_status_img = '<a href="http://wwp.icq.com/' . $profiledata['user_icq'] . '#pager"><img src="http://web.icq.com/whitepages/online?icq=' . $profiledata['user_icq'] . '&img=5" width="18" height="18" border="0" /></a>';
	$icq_img = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $profiledata['user_icq'] . '"><img src="' . $images['icon_icq'] . '" alt="' . $lang['ICQ'] . '" title="' . $lang['ICQ'] . '" border="0" /></a>';
	$icq =  '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $profiledata['user_icq'] . '">' . $lang['ICQ'] . '</a>';
}
else
{
	$icq_status_img = '&nbsp;';
	$icq_img = '&nbsp;';
	$icq = '&nbsp;';
}

$aim_img = ( $profiledata['user_aim'] ) ? '<a href="aim:goim?screenname=' . $profiledata['user_aim'] . '&message=Hello+Are+you+there?"><img src="' . $images['icon_aim'] . '" alt="' . $lang['AIM'] . '" title="' . $lang['AIM'] . '" border="0" /></a>' : '&nbsp;';
$aim = ( $profiledata['user_aim'] ) ? '<a href="aim:goim?screenname=' . $profiledata['user_aim'] . '&message=Hello+Are+you+there?">' . $lang['AIM'] . '</a>' : '&nbsp;';

$msn_img = ( $profiledata['user_msnm'] ) ? $profiledata['user_msnm'] : '&nbsp;';
$msn = $msn_img;

$yim_img = ( $profiledata['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $profiledata['user_yim'] . '&.src=pg"><img src="' . $images['icon_yim'] . '" alt="' . $lang['YIM'] . '" title="' . $lang['YIM'] . '" border="0" /></a>' : '';
$yim = ( $profiledata['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $profiledata['user_yim'] . '&.src=pg">' . $lang['YIM'] . '</a>' : '';

$temp_url = append_sid("search.$phpEx?search_author=" . urlencode($profiledata['username']) . "&showresults=posts");
$search_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_search'] . '" alt="' . sprintf($lang['Search_user_posts'], $profiledata['username']) . '" title="' . sprintf($lang['Search_user_posts'], $profiledata['username']) . '" border="0" /></a>';
$search = '<a href="' . $temp_url . '">' . sprintf($lang['Search_user_posts'], $profiledata['username']) . '</a>';

//
// Generate page
//
$page_title = $lang['Viewing_profile'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);

if (function_exists('get_html_translation_table'))
{
	$u_search_author = urlencode(strtr($profiledata['username'], array_flip(get_html_translation_table(HTML_ENTITIES))));
}
else
{
	$u_search_author = urlencode(str_replace(array('&', ''', '"', '<', '>'), array('&', "'", '"', '<', '>'), $profiledata['username']));
}

$template->assign_vars(array(
	'USERNAME' => $profiledata['username'],
	'JOINED' => create_date($lang['DATE_FORMAT'], $profiledata['user_regdate'], $board_config['board_timezone']),
	'POSTER_RANK' => $poster_rank,
	'RANK_IMAGE' => $rank_image,
	'POSTS_PER_DAY' => $posts_per_day,
	'POSTS' => $profiledata['user_posts'],
	'PERCENTAGE' => $percentage . '%', 
	'POST_DAY_STATS' => sprintf($lang['User_post_day_stats'], $posts_per_day), 
	'POST_PERCENT_STATS' => sprintf($lang['User_post_pct_stats'], $percentage), 

	'SEARCH_IMG' => $search_img,
	'SEARCH' => $search,
	'PM_IMG' => $pm_img,
	'PM' => $pm,
	'EMAIL_IMG' => $email_img,
	'EMAIL' => $email,
	'WWW_IMG' => $www_img,
	'WWW' => $www,
	'ICQ_STATUS_IMG' => $icq_status_img,
	'ICQ_IMG' => $icq_img, 
	'ICQ' => $icq, 
	'AIM_IMG' => $aim_img,
	'AIM' => $aim,
	'MSN_IMG' => $msn_img,
	'MSN' => $msn,
	'YIM_IMG' => $yim_img,
	'YIM' => $yim,

	'LOCATION' => $location,	// Country/Location Flags
	'OCCUPATION' => ( $profiledata['user_occ'] ) ? $profiledata['user_occ'] : '&nbsp;',
	'INTERESTS' => ( $profiledata['user_interests'] ) ? $profiledata['user_interests'] : '&nbsp;',
	'AVATAR_IMG' => $avatar_img,

	'L_VIEWING_PROFILE' => sprintf($lang['Viewing_user_profile'], $profiledata['username']), 
	'L_ABOUT_USER' => sprintf($lang['About_user'], $profiledata['username']), 
	'L_AVATAR' => $lang['Avatar'], 
	'L_POSTER_RANK' => $lang['Poster_rank'], 
	'L_JOINED' => $lang['Joined'], 
	'L_TOTAL_POSTS' => $lang['Total_posts'], 
	'L_SEARCH_USER_POSTS' => sprintf($lang['Search_user_posts'], $profiledata['username']), 
	'L_CONTACT' => $lang['Contact'],
	'L_EMAIL_ADDRESS' => $lang['Email_address'],
	'L_EMAIL' => $lang['Email'],
	'L_PM' => $lang['Private_Message'],
	'L_ICQ_NUMBER' => $lang['ICQ'],
	'L_YAHOO' => $lang['YIM'],
	'L_AIM' => $lang['AIM'],
	'L_MESSENGER' => $lang['MSNM'],
	'L_WEBSITE' => $lang['Website'],
	'L_BIRTHDAY' => $lang['Birthday'],
	'L_LOCATION' => $lang['Location'],
	'L_OCCUPATION' => $lang['Occupation'],
	'L_INTERESTS' => $lang['Interests'],

	'U_SEARCH_USER' => append_sid("search.$phpEx?search_author=" . $u_search_author),

	'S_PROFILE_ACTION' => append_sid("profile.$phpEx"))
);

$template->pparse('body');

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

?>

I installed the mod by easy mod but edited this file manually and removed the code from install.txt to edit this file. Now i can't open the profiles of the users and secondly there is nothing in Admin CP??
User avatar
RMcGirr83
Former Team Member
Posts: 21472
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: Birthdays

Post by RMcGirr83 »

this

Code: Select all

'BIRTHDAY' => $birthday,
goes after this (as in, on a new blank line)

Code: Select all

'LOCATION' => $location,
not where you have it. Other than that your file looks okay at quick glance. ;)

ACP has nothing to do with this file.
Appreciate the extensions/mods/support then buy me a beerImage
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Wasrana
Registered User
Posts: 20
Joined: Tue Nov 28, 2006 6:08 am
Location: Pakistan

Re: Birthdays

Post by Wasrana »

Fixed it but still the same problem


Can't view anyone's profile
Nothing in ACP for configration
TerraFrost
Former Team Member
Posts: 5957
Joined: Sun Dec 26, 2004 3:40 am
Location: Austin, TX

Re: Birthdays

Post by TerraFrost »

Can you post your updated usercp_viewprofile.php? Correcting the issue RMcGirr83 found and replacing my usercp_viewprofile.php with yours didn't yield any problems for me. I was able to view profiles just fine after having done that. As such, it occurs to me that maybe you didn't correct the problem correctly.
Wasrana
Registered User
Posts: 20
Joined: Tue Nov 28, 2006 6:08 am
Location: Pakistan

Re: Birthdays

Post by Wasrana »

Ok my bad :p

I updated the file but uploaded the backed up one. profiles working ok now.



But where to configure things? nothing in ACP
Post Reply

Return to “[2.0.x] MOD Database Releases”