Page 3 of 4

custom page

Posted: 15 Sep 2011, 00:04
by Terr0r
if I set the 2 codes in that file the I get a error I must put 1 of the codes on a ohter place in aboutus.php

custom page

Posted: 15 Sep 2011, 07:39
by Stoker

Code: Select all

<?php
        define('IN_PHPBB', true);
        $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
        $phpEx = substr(strrchr(__FILE__, '.'), 1);
        include($phpbb_root_path . 'common.' . $phpEx);

        // Start session management
        $user->session_begin();
        $auth->acl($user->data);
        $user->setup();       

        if ($user->data['user_id'] == ANONYMOUS)
        {
            login_box('', $user->lang['LOGIN']);
        }  

		// BEGIN Welcome Mod
//--Welcome_Mod--get the hour number-->
$date = $user->format_date(time(), 'H');

if ($user->data['is_registered'])
{
    $u_user_name = get_username_string('full', $user->data['user_id'], $user->data['username'], $user->data['user_colour']);
}
else
{
    $u_user_name = $user->lang['WELCOME_GUEST'];
}   

switch (true)
{
        case ($date < 1):
            // if the hour is 11am-12am (18-23)
            $s_welcome = sprintf($user->lang['GOOD_NIGHT'], $u_user_name);;
        break;
     
         case ($date < 4):
            // if the hour is 1-3 am
            $s_welcome = sprintf($user->lang['UP_LATE'], $u_user_name);
        break;
       
        case ($date < 8):
            // if the hour is 4-7 am
            $s_welcome = sprintf($user->lang['UP_EARLY'], $u_user_name);
        break;
       
        case ($date < 12):
            // if the hour is 8-11 am
            $s_welcome = sprintf($user->lang['GOOD_MORNING'], $u_user_name);
        break;
       
        case ($date < 18):
            // if the hour is 12-5pm
            $s_welcome = sprintf($user->lang['GOOD_AFTERNOON'], $u_user_name);
        break;
       
        case ($date < 24):
            // if the hour is 6pm-11pm
            $s_welcome = sprintf($user->lang['GOOD_EVENING'], $u_user_name);;
        break;
}

// how long a member for
$member_for = '';
if ($user->data['is_registered'] && !$user->data['is_bot'])
{
    $member_length = time() - $user->data['user_regdate'];
    $years = $months = $days = 0;
    $member_for = '';
    if ($member_length)
    {   
        if ($member_length >= 31536000)
        {
            $years = floor($member_length / 31536000);
            $member_length = $member_length - ($years * 31536000);
            $member_for .= $years > 1 ? ($years . '&nbsp;' . $user->lang['WELCOME_YEARS'] . ', ') : ($years . '&nbsp;' . $user->lang['WELCOME_YEAR'] . ', ');
        }
        $months = floor($member_length / 2628000);
        if ($months)
        {
            $months = $months > 1 ? ($months . '&nbsp;' . $user->lang['WELCOME_MONTHS'] . ', ') : ($months . '&nbsp;' . $user->lang['WELCOME_MONTHS'] . ', ');
            $member_length = $member_length - ($months * 2628000);
            $member_for .= $months;
        }
        $days = floor($member_length / 86400);
        if ($days)
        {
            $days = $days > 1 ? ($days . '&nbsp;' . $user->lang['WELCOME_DAYS']) : ($days . '&nbsp;' . $user->lang['WELCOME_DAY']);
            $member_for .= $days;
        }       
    }
}

$template->assign_vars(array( 
    'S_WELCOME'                   => $s_welcome,
    'S_JOINED_DATE'               => $user->lang['JOINED'] . ':&nbsp;' . $user->format_date($user->data['user_regdate']),
    'USER_AVATAR'               => get_user_avatar($user->data['user_avatar'], $user->data['user_avatar_type'], $user->data['user_avatar_width'], $user->data['user_avatar_height']),
    'MEMBER_FOR'               => (!empty($member_for)) ? $user->lang['MEMBER_FOR'] . '&nbsp;' . $member_for : '',
);
      // END Welcome Mod 
       
        page_header('Title Here');

        $template->set_filenames(array(
            'body' => 'aboutus_body.html',
        ));

        make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
        page_footer();
    ?>

custom page

Posted: 15 Sep 2011, 09:28
by Terr0r
if I set this in aboutus.php then I get this error

Code: Select all

Parse error: syntax error, unexpected ';' in /home/phpbb/domains/phpbbpoints.com/public_html/home.php on line 96

custom page

Posted: 15 Sep 2011, 09:53
by Stoker
This is the last time I do your stuff for you.

custom page

Posted: 15 Sep 2011, 10:16
by Terr0r
and now I get this error

Code: Select all

Fatal error: Call to undefined function get_user_avatar() in /home/phpbb/domains/phpbbpoints.com/public_html/home.php on line 114
something whit the avatar

I think it is not possible to get it working good

this is the php file that I have and that is working

Code: Select all

<?php
    define('IN_PHPBB', true);
    $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
    $phpEx = substr(strrchr(__FILE__, '.'), 1);
    include($phpbb_root_path . 'common.' . $phpEx);

    // Start session management
    $user->session_begin();
    $auth->acl($user->data);
    $user->setup();
	
	

    page_header('home');

    $template->set_filenames(array(
        'body' => 'home_body.html',
    ));

//-- mod: Top Stats ---------------------------------------------------------//
	include($phpbb_root_path . 'includes/functions_top_stats.' . $phpEx);
//-- end: Top Stats ---------------------------------------------------------//	

    // BEGIN mChat Mod
    $mchat_installed = (!empty($config['mchat_version']) && !empty($config['mchat_enable'])) ? true : false;
    if ($mchat_installed && $auth->acl_get('u_mchat_view'))
    {
       if(!defined('MCHAT_INCLUDE') && $config['mchat_on_index'] && !empty($user->data['user_mchat_index']))
       {
          define('MCHAT_INCLUDE', true);
          $mchat_include_index = true;
          include($phpbb_root_path . 'mchat.' . $phpEx);
       }   

       if (!empty($config['mchat_stats_index']) && !empty($user->data['user_mchat_stats_index']))
       {
          if (!function_exists('mchat_users'))
          {
             include($phpbb_root_path . 'includes/functions_mchat.' . $phpEx);
          }
          // Add lang file
          $user->add_lang('mods/mchat_lang');
          // stats display
          $mchat_session_time = !empty($config_mchat['timeout']) ? $config_mchat['timeout'] : 3600;// you can change this number to a greater number for longer chat sessions
          $mchat_stats = mchat_users($mchat_session_time);
          $template->assign_vars(array(
             'MCHAT_INDEX_STATS'   => true,
             'MCHAT_INDEX_USERS_COUNT'   => $mchat_stats['mchat_users_count'],
             'MCHAT_INDEX_USERS_LIST'   => $mchat_stats['online_userlist'],
             'L_MCHAT_ONLINE_EXPLAIN'   => $mchat_stats['refresh_message'],   
          ));
       }
    }   
    // END mChat Mod


	
    make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
    page_footer();
?>
and this code must in there

Code: Select all

<?php
/**
*
* @package phpBB3
* @version $Id: aboutus.php,v 1.0b 2011/09/15 09:50:21 Stoker Exp $
* @copyright (c) 2008 Stoker (www.phpbb3bbcodes.com) 
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
*/

/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('');       

if ($user->data['user_id'] == ANONYMOUS)
{
	login_box('', $user->lang['LOGIN']);
}

// BEGIN Welcome Mod
//--Welcome_Mod--get the hour number-->
$date = $user->format_date(time(), 'H');

if ($user->data['is_registered'])
{
    $u_user_name = get_username_string('full', $user->data['user_id'], $user->data['username'], $user->data['user_colour']);
}
else
{
    $u_user_name = $user->lang['WELCOME_GUEST'];
}   

switch (true)
{
        case ($date < 1):
            // if the hour is 11am-12am (18-23)
            $s_welcome = sprintf($user->lang['GOOD_NIGHT'], $u_user_name);;
        break;
      
      	case ($date < 4):
            // if the hour is 1-3 am
            $s_welcome = sprintf($user->lang['UP_LATE'], $u_user_name);
        break;
       
        case ($date < 8):
            // if the hour is 4-7 am
            $s_welcome = sprintf($user->lang['UP_EARLY'], $u_user_name);
        break;
       
        case ($date < 12):
            // if the hour is 8-11 am
            $s_welcome = sprintf($user->lang['GOOD_MORNING'], $u_user_name);
        break;
       
        case ($date < 18):
            // if the hour is 12-5pm
            $s_welcome = sprintf($user->lang['GOOD_AFTERNOON'], $u_user_name);
        break;
       
        case ($date < 24):
            // if the hour is 6pm-11pm
            $s_welcome = sprintf($user->lang['GOOD_EVENING'], $u_user_name);;
        break;
} 

// how long a member for
$member_for = '';
if ($user->data['is_registered'] && !$user->data['is_bot'])
{
    $member_length = time() - $user->data['user_regdate'];
    $years = $months = $days = 0;
    $member_for = '';
    if ($member_length)
    {   
        if ($member_length >= 31536000)
        {
            $years = floor($member_length / 31536000);
            $member_length = $member_length - ($years * 31536000);
            $member_for .= $years > 1 ? ($years . '&nbsp;' . $user->lang['WELCOME_YEARS'] . ', ') : ($years . '&nbsp;' . $user->lang['WELCOME_YEAR'] . ', ');
        }
        $months = floor($member_length / 2628000);
        if ($months)
        {
            $months = $months > 1 ? ($months . '&nbsp;' . $user->lang['WELCOME_MONTHS'] . ', ') : ($months . '&nbsp;' . $user->lang['WELCOME_MONTHS'] . ', ');
            $member_length = $member_length - ($months * 2628000);
            $member_for .= $months;
        }
        $days = floor($member_length / 86400);
        if ($days)
        {
            $days = $days > 1 ? ($days . '&nbsp;' . $user->lang['WELCOME_DAYS']) : ($days . '&nbsp;' . $user->lang['WELCOME_DAY']);
            $member_for .= $days;
        }       
    }
}
//END Welcome Mod

 // BEGIN Welcome Mod 
$template->assign_vars(array(  
    'S_WELCOME'                   => $s_welcome,
    'S_JOINED_DATE'               => $user->lang['JOINED'] . ':&nbsp;' . $user->format_date($user->data['user_regdate']),
    'USER_AVATAR'               => get_user_avatar($user->data['user_avatar'], $user->data['user_avatar_type'], $user->data['user_avatar_width'], $user->data['user_avatar_height']),
    'MEMBER_FOR'               => (!empty($member_for)) ? $user->lang['MEMBER_FOR'] . '&nbsp;' . $member_for : '',
    ));
// END Welcome Mod

page_header('Title Here');

$template->set_filenames(array(
	'body' => 'home_body.html',
));

page_footer();

?><?php
/**
*
* @package phpBB3
* @version $Id: aboutus.php,v 1.0b 2011/09/15 09:50:21 Stoker Exp $
* @copyright (c) 2008 Stoker (www.phpbb3bbcodes.com) 
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
*/

/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('');       

if ($user->data['user_id'] == ANONYMOUS)
{
	login_box('', $user->lang['LOGIN']);
}

// BEGIN Welcome Mod
//--Welcome_Mod--get the hour number-->
$date = $user->format_date(time(), 'H');

if ($user->data['is_registered'])
{
    $u_user_name = get_username_string('full', $user->data['user_id'], $user->data['username'], $user->data['user_colour']);
}
else
{
    $u_user_name = $user->lang['WELCOME_GUEST'];
}   

switch (true)
{
        case ($date < 1):
            // if the hour is 11am-12am (18-23)
            $s_welcome = sprintf($user->lang['GOOD_NIGHT'], $u_user_name);;
        break;
      
      	case ($date < 4):
            // if the hour is 1-3 am
            $s_welcome = sprintf($user->lang['UP_LATE'], $u_user_name);
        break;
       
        case ($date < 8):
            // if the hour is 4-7 am
            $s_welcome = sprintf($user->lang['UP_EARLY'], $u_user_name);
        break;
       
        case ($date < 12):
            // if the hour is 8-11 am
            $s_welcome = sprintf($user->lang['GOOD_MORNING'], $u_user_name);
        break;
       
        case ($date < 18):
            // if the hour is 12-5pm
            $s_welcome = sprintf($user->lang['GOOD_AFTERNOON'], $u_user_name);
        break;
       
        case ($date < 24):
            // if the hour is 6pm-11pm
            $s_welcome = sprintf($user->lang['GOOD_EVENING'], $u_user_name);;
        break;
} 

// how long a member for
$member_for = '';
if ($user->data['is_registered'] && !$user->data['is_bot'])
{
    $member_length = time() - $user->data['user_regdate'];
    $years = $months = $days = 0;
    $member_for = '';
    if ($member_length)
    {   
        if ($member_length >= 31536000)
        {
            $years = floor($member_length / 31536000);
            $member_length = $member_length - ($years * 31536000);
            $member_for .= $years > 1 ? ($years . '&nbsp;' . $user->lang['WELCOME_YEARS'] . ', ') : ($years . '&nbsp;' . $user->lang['WELCOME_YEAR'] . ', ');
        }
        $months = floor($member_length / 2628000);
        if ($months)
        {
            $months = $months > 1 ? ($months . '&nbsp;' . $user->lang['WELCOME_MONTHS'] . ', ') : ($months . '&nbsp;' . $user->lang['WELCOME_MONTHS'] . ', ');
            $member_length = $member_length - ($months * 2628000);
            $member_for .= $months;
        }
        $days = floor($member_length / 86400);
        if ($days)
        {
            $days = $days > 1 ? ($days . '&nbsp;' . $user->lang['WELCOME_DAYS']) : ($days . '&nbsp;' . $user->lang['WELCOME_DAY']);
            $member_for .= $days;
        }       
    }
}
//END Welcome Mod

 // BEGIN Welcome Mod 
$template->assign_vars(array(  
    'S_WELCOME'                   => $s_welcome,
    'S_JOINED_DATE'               => $user->lang['JOINED'] . ':&nbsp;' . $user->format_date($user->data['user_regdate']),
    'USER_AVATAR'               => get_user_avatar($user->data['user_avatar'], $user->data['user_avatar_type'], $user->data['user_avatar_width'], $user->data['user_avatar_height']),
    'MEMBER_FOR'               => (!empty($member_for)) ? $user->lang['MEMBER_FOR'] . '&nbsp;' . $member_for : '',
    ));
// END Welcome Mod

page_header('Title Here');

$template->set_filenames(array(
	'body' => 'home_body.html',
));

page_footer();

?>
I don't now what I must do to fix it

custom page

Posted: 15 Sep 2011, 10:21
by Stoker
index.zip
(1.43 KiB) Downloaded 125 times

custom page

Posted: 15 Sep 2011, 10:31
by Terr0r
the avatar is now working thanks Stoker for that

but I see no stats take a look on my forum phpBB Points.com

custom page

Posted: 15 Sep 2011, 10:42
by Stoker
Feel free to hire me for a custom job.

custom page

Posted: 15 Sep 2011, 10:57
by Terr0r
I understand what you mean but I think I do that not but I know why you say that your time to help people out is free but if you must help people su much as me then you wil asking money for that work

custom page

Posted: 15 Sep 2011, 11:03
by Stoker
I gladly help people out Terr0r.
But some people (you) have so little knowledge that it is impossible for me to help without doing it for them (you)

There is a big difference between helping people and doing their job for them.