Page 1 of 1

[Solved]Page load times

PostPosted: Thu Jul 06, 2006 5:28 am
Author: Scissors
I've seen a few fixes but they are for database issues. My high load times are coming from the php itself:

[Page generation time: 8.168s (PHP: 99% | SQL: 1%) | SQL queries: 45 | GZIP disabled | Debug on]

Any ideas on how to pick up the speed? The only fixes i've seen reference the old intergamod boards which are inaccessable.

FYI I did a lot of searching before posting <img>

PostPosted: Thu Jul 06, 2006 5:31 am
Author: Simon N
Okay old IM site is here: http://integrmod.com/home/index.php

Its a read only version but is fully searchable.

Also do you have a link to the site in question? Then others can test this for themselves.

PostPosted: Thu Jul 06, 2006 5:38 am
Author: Scissors
Ahh excellent this page has a bunch of fixes <img>

http://www.integramod.com/forum/viewtopic.php?t=311

PostPosted: Thu Jul 06, 2006 7:57 am
Author: Scissors
Prillian was the culprit i'm now under 1s

Heres the how to

In phpMyAdmin remove the following from the database

[phpbb_im_prefs]
[phpbb_contact_list]
[phpbb_im_sites]
[phpbb_im_sessions]

Next find and remove the following files from your server space ...

root/
contact.php
imclient.php
sitetosite.php

admin/
admin_im_config.php
admin_im_log.php
admin_im_network.php
admin_im_users.php

includes/
constants_contact.php
constants_prillian.php

language/lang_english/
lang_contact.php
lang_contact_faq.php
lang_prillian.php
lang_prillian_faq.php

mods/contact/ (Remove this directory completley)

mods/prillian (Remove this directory completley)

templates/your theme
autoclose.tpl

templates/admin/
imclient_admin_config.tpl
imclient_admin_log_body.tpl
imclient_admin_read.tpl
imclient_lookup_body.tpl
imclient_select_body.tpl
imclient_user_body.tpl
network_detect_body.tpl
network_edit_body.tpl
network_list_body.tpl

templates/images (you can remove the prillian associated images in this folder, I can't be botherd to list then though)

templates/prillian/(Remove this directory completley)


Then remove the following code ...

includes/constants.php

Quote:
//--------------------------------------------------------------------------------
// Prillian - Begin Code Addition
//

include_once($phpbb_root_path . 'includes/constants_prillian.'.$phpEx);
include_once($phpbb_root_path . 'includes/constants_contact.'.$phpEx);

//
// Prillian - End Code Addition
//--------------------------------------------------------------------------------


faq.php

Quote:
//--------------------------------------------------------------------------------
// Prillian - Begin Code Addition
//

include_once(PRILL_PATH . 'prill_common.' . $phpEx);

//
// Prillian - End Code Addition
//--------------------------------------------------------------------------------/


and

Quote:
//--------------------------------------------------------------------------------
// Prillian - Begin Code Addition
//

case 'prill':
$lang_file = 'lang_prillian_faq';
$l_title = $lang['Prillian_FAQ'];
break;
case 'contact':
$lang_file = 'lang_contact_faq';
$l_title = $lang['Contact_List_FAQ'];
break;

//
// Prillian - End Code Addition
//--------------------------------------------------------------------------------


login.php

Quote:
//--------------------------------------------------------------------------------
// Prillian - Begin Code Addition
//

if (!file_exists('prill_install'))
{
include_once(PRILL_PATH . 'prill_common.' . $phpEx);
}

//
// Prillian - End Code Addition
//--------------------------------------------------------------------------------


and

Quote:
//--------------------------------------------------------------------------------
// Prillian - Begin Code Addition
//
if ( !empty($_REQUEST['in_prill']) )
{
im_session_update(true, true);
}
//
// Prillian - End Code Addition
//--------------------------------------------------------------------------------


and

Quote:
//--------------------------------------------------------------------------------
// Prillian - Begin Code Addition
//
$body_tpl = '';
if( $gen_simple_header )
{
$body_tpl = 'prillian/';
}
//
// Prillian - End Code Addition
//--------------------------------------------------------------------------------


Inline find and 'login_body.tpl' remove $body_tpl . which appears just before it.

viewonline.php
Quote:
//--------------------------------------------------------------------------------
// Prillian - Begin Code Addition
//

include_once(PRILL_PATH . 'prill_common.' . $phpEx);
if ( empty($im_userdata) )
{
$im_userdata = init_imprefs($userdata['user_id'], false, true);
}

//
// Prillian - End Code Addition
//--------------------------------------------------------------------------------

and
Quote:
//--------------------------------------------------------------------------------
// Prillian - Begin Code Addition
//
case PAGE_PRILLIAN:
$location = $lang['Prillian'];
$location_url = PRILL_URL . $im_userdata['mode_string'];
break;
case PAGE_CONTACT:
$location = $lang['Contact_Management'];
$location_url = CONTACT_URL;
break;
//
// Prillian - End Code Addition
//--------------------------------------------------------------------------------


includes/functions.php

Quote:
//--------------------------------------------------------------------------------
// Prillian - Begin Code Addition
//
if ( $gen_simple_header )
{
$template->assign_vars(array('U_INDEX' => '', 'L_INDEX' => ''));
}
//
// Prillian - End Code Addition
//--------------------------------------------------------------------------------


You may also find you need to do remove following ...

includes/page_header.php

Quote:
//--------------------------------------------------------------------------------
// Prillian - Begin Code Addition
//

if (!file_exists('prill_install'))
{
include_once(PRILL_PATH . 'prill_common.' . $phpEx);
}
else
{
$im_auto_popup = 0;
}

//
// Prillian - End Code Addition
//--------------------------------------------------------------------------------


and

Quote:
//--------------------------------------------------------------------------------
// Prillian - Begin Code Addition
//
$online_array[] = $row['user_id'];
//
// Prillian - End Code Addition
//--------------------------------------------------------------------------------


and

Quote:
//--------------------------------------------------------------------------------
// Prillian - Begin Code Addition
//

if( ($userdata['user_id'] != ANONYMOUS) && (!file_exists('prill_install')) && $userdata['user_id'] != NULL )
{
if( defined('IN_CONTACT_LIST') && defined('SHOW_ONLINE') )
{
$contact_list->alert_check();
}
if ( empty($im_userdata) )
{
$im_userdata = init_imprefs($userdata['user_id'], false, true);
}
$im_auto_popup = auto_prill_check();
if ( $im_userdata['new_ims'] )
{
$l_prillian_msg = ( $im_userdata['new_ims'] > 1 ) ? $lang['New_ims']: $lang['New_im'];
$l_prillian_text = sprintf($l_prillian_msg, $im_userdata['new_ims']);
}
elseif ( $im_userdata['unread_ims'] )
{
$l_prillian_msg = ( $im_userdata['unread_ims'] > 1 ) ? $lang['Unread_ims']: $lang['Unread_im'];
$l_prillian_text = sprintf($l_prillian_msg, $im_userdata['unread_ims']);
}
}

$template->assign_vars(array(
'IM_AUTO_POPUP' => $im_auto_popup,
'IM_HEIGHT' => $im_userdata['mode_height'],
'IM_WIDTH' => $im_userdata['mode_width'],
'U_IM_LAUNCH' => append_sid(PRILL_URL . $im_userdata['mode_string']),
'L_IM_LAUNCH' => $l_prillian_text,
'L_CONTACT_MAN' => $lang['Contact_Management'],
'U_CONTACT_MAN' => append_sid(CONTACT_URL)
));

//
// Prillian - End Code Addition
//--------------------------------------------------------------------------------


profilcp/profilcp_register.php

Quote:
//--------------------------------------------------------------------------------
// Prillian - Begin Code Addition
//
$sql = 'INSERT INTO ' . IM_PREFS_TABLE . ' (user_id, themes_id)
VALUES (' . $user_id . ', ' . $board_config['default_style'] . ')';
if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not insert data into im_prefs table', '', __LINE__, __FILE__, $sql);
}
//
// Prillian - End Code Addition
//--------------------------------------------------------------------------------


and

Admin/index.php

Quote:
//--------------------------------------------------------------------------------
// Prillian - Begin Code Addition
//
case PAGE_PRILLIAN:
include_once($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_prillian.' . $phpEx);
$location = $lang['Prillian'];
$location_url = "index.$phpEx?pane=right";
break;
case PAGE_CONTACT:
include_once($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_contact.' . $phpEx);
$location = $lang['Contact_Management'];
$location_url = "index.$phpEx?pane=right";
break;
//
// Prillian - End Code Addition
//--------------------------------------------------------------------------------


and

Quote:
//--------------------------------------------------------------------------------
// Prillian - Begin Code Addition
//
case PAGE_PRILLIAN:
include_once($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_prillian.' . $phpEx);
$location = $lang['Prillian'];
$location_url = "index.$phpEx?pane=right";
break;
case PAGE_CONTACT:
include_once($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_contact.' . $phpEx);
$location = $lang['Contact_Management'];
$location_url = "index.$phpEx?pane=right";
break;
//
// Prillian - End Code Addition
//--------------------------------------------------------------------------------


admin/admin_users.php

Quote:
//--------------------------------------------------------------------------------
// Prillian - Begin Code Addition
//
$sql = 'INSERT INTO ' . IM_PREFS_TABLE . ' (user_id, themes_id)
VALUES (' . $user_id . ', ' . $board_config['default_style'] . ')';
if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not insert data into im_prefs table', '', __LINE__, __FILE__, $sql);
}
//
// Prillian - End Code Addition
//--------------------------------------------------------------------------------


and

Quote:
//--------------------------------------------------------------------------------
// Prillian - Begin Code Addition
//
$sql = 'DELETE FROM ' . IM_PREFS_TABLE . '
WHERE user_id = ' . $user_id;
if( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not delete user IM prefs', '', __LINE__, __FILE__, $sql);
}

$sql = 'DELETE FROM ' . CONTACT_TABLE . '
WHERE user_id = ' . $user_id . '
OR contact_id = ' . $user_id;
if( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not delete user Contact List entries', '', __LINE__, __FILE__, $sql);
}
//
// Prillian - End Code Addition
//--------------------------------------------------------------------------------


and

Quote:
//--------------------------------------------------------------------------------
// Prillian - Begin Code Addition
//
$sql = 'DELETE FROM ' . IM_PREFS_TABLE . '
WHERE user_id = ' . $user_id;
if( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not delete user IM prefs', '', __LINE__, __FILE__, $sql);
}

$sql = 'DELETE FROM ' . CONTACT_TABLE . '
WHERE user_id = ' . $user_id . '
OR contact_id = ' . $user_id;
if( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not delete user Contact List entries', '', __LINE__, __FILE__, $sql);
}
//
// Prillian - End Code Addition
//--------------------------------------------------------------------------------


remove from

templates/your theme

Overall_header.tpl

Quote:
<Prillian>
<BEGIN>
<script>
<function>
</script>
<END>
<BEGIN>
<script>
if ( {buddy_alert.BUDDY_ALERT} )
{
window.open('{buddy_alert.U_BUDDY_ALERT}', '_buddyalert', 'HEIGHT=225,resizable=yes,WIDTH=400');
}
</script>
<END>
<Prillian>


and thanks to Teelk
To remove both the "Launch Prillian" and the "Contacts" link(since this is for Prillian contact) in that block do the following.

Open /templates/yourtheme/blocks/online_users_block.tpl
Quote:

<BEGIN>
<br>
[ <a>{L_IM_LAUNCH}</a> ]
<br>
[ <a>{L_CONTACT_MAN}</a> ]
<END>

PostPosted: Wed Aug 23, 2006 8:43 pm
Author: Master Dwarf
Yeah, I think I went through and took care of most of the code, but I think it got replaced when I updated my files/patches/fixes. Went through again and hopefully this will help with load times.