Page 2 of 2

How to change this?

Posted: 01 Jul 2013, 01:33
by Rhyno
Current Edits in common.php :

Code: Select all

// BEGIN MOD more stats on index
$lang = array_merge($lang, array(
   'START_DATE'            => 'We have been online since',
   'POSTS_PER_DAY_OTHER'   => 'Posts per day <strong>%.2f</strong>',
   'POSTS_PER_DAY_ZERO'   => 'Posts per day <strong>None</strong>',
   'POSTS_PER_TOPIC_OTHER'   => 'Posts per topic <strong>%.2f</strong>',
   'POSTS_PER_YEAR_OTHER'   => 'Posts per year <strong>%s</strong>',
   'POSTS_PER_YEAR_ZERO'   => 'Posts per year <strong>None</strong>',
   'POSTS_PER_TOPIC_ZERO'   => 'Posts per topic <strong>None</strong>',
   'POSTS_PER_USER_OTHER'   => 'Posts per member <strong>%.2f</strong>',
   'POSTS_PER_USER_ZERO'   => 'Posts per member <strong>None</strong>',
   'TOPICS_PER_DAY_OTHER'   => 'Topics per day <strong>%.2f</strong>',
   'TOPICS_PER_DAY_ZERO'   => 'Topics per day <strong>None</strong>',
   'TOPICS_PER_YEAR_OTHER'   => 'Topics per year <strong>%s</strong>',
   'TOPICS_PER_YEAR_ZERO'   => 'Topics per year <strong>None</strong>',
   'TOPICS_PER_USER_OTHER'   => 'Topics per member <strong>%.2f</strong>',
   'TOPICS_PER_USER_ZERO'   => 'Topics per member <strong>None</strong>',
   'USERS_PER_DAY_OTHER'   => 'Members per day <strong>%.2f</strong>',
   'USERS_PER_DAY_ZERO'   => 'Members per day <strong>None</strong>',
   'USERS_PER_YEAR_OTHER'   => 'Members per year <strong>%s</strong>',
   'USERS_PER_YEAR_ZERO'   => 'Members per year <strong>None</strong>',
   'TOTAL_POSTS_OTHER'   => 'Total posts <strong>%s</strong>',
   'TOTAL_POSTS_ZERO'   => 'Total posts <strong>0</strong>',
   'TOTAL_TOPICS_OTHER'=> 'Total topics <strong>%s</strong>',
   'TOTAL_TOPICS_ZERO'   => 'Total topics <strong>0</strong>',
   'TOTAL_USERS_OTHER'   => 'Total members <strong>%s</strong>',
   'TOTAL_USERS_ZERO'   => 'Total members <strong>0</strong>',
   'TOTAL_FILES_OTHER'   => 'Total attachments <strong>%s</strong>',
   'TOTAL_FILES_ZERO'   => 'Total attachments <strong>0</strong>',
   'FILES_PER_DAY_OTHER'   => 'Attachments per day <strong>%.2f</strong>',
   'FILES_PER_DAY_ZERO'   => 'Attachments per day <strong>None</strong>',
   'FILES_PER_YEAR_OTHER'   => 'Attachments per year <strong>%s</strong>',
   'FILES_PER_YEAR_ZERO'   => 'Attachments per year <strong>None</strong>',
   'FILES_PER_USER_OTHER'   => 'Attachments per member <strong>%.2f</strong>',
   'FILES_PER_USER_ZERO'   => 'Attachments per member <strong>None</strong>',
));
Update needed according to XML :

Code: Select all

// Statistics on index
$lang = array_merge($lang, array(	
	'START_DATE'			=> 'We have been online since',
	'POSTS_PER_DAY_OTHER'	=> 'Posts per day <strong>%.2f</strong>',
	'POSTS_PER_DAY_ZERO'	=> 'Posts per day <strong>None</strong>',
	'POSTS_PER_TOPIC_OTHER'	=> 'Posts per topic <strong>%.2f</strong>',
	'POSTS_PER_YEAR_OTHER'	=> 'Posts per year <strong>%d</strong>',
	'POSTS_PER_YEAR_ZERO'	=> 'Posts per year <strong>None</strong>',
	'POSTS_PER_TOPIC_ZERO'	=> 'Posts per topic <strong>None</strong>',
	'POSTS_PER_USER_OTHER'	=> 'Posts per member <strong>%.2f</strong>',
	'POSTS_PER_USER_ZERO'	=> 'Posts per member <strong>None</strong>',
	'TOPICS_PER_DAY_OTHER'	=> 'Topics per day <strong>%.2f</strong>',
	'TOPICS_PER_DAY_ZERO'	=> 'Topics per day <strong>None</strong>',
	'TOPICS_PER_YEAR_OTHER'	=> 'Topics per year <strong>%d</strong>',
	'TOPICS_PER_YEAR_ZERO'	=> 'Topics per year <strong>None</strong>',
	'TOPICS_PER_USER_OTHER'	=> 'Topics per member <strong>%.2f</strong>',
	'TOPICS_PER_USER_ZERO'	=> 'Topics per member <strong>None</strong>',
	'USERS_PER_DAY_OTHER'	=> 'Members per day <strong>%.2f</strong>',
	'USERS_PER_DAY_ZERO'	=> 'Members per day <strong>None</strong>',
	'USERS_PER_YEAR_OTHER'	=> 'Members per year <strong>%d</strong>',
	'USERS_PER_YEAR_ZERO'	=> 'Members per year <strong>None</strong>',
	'TOTAL_FILES_OTHER'		=> 'Total attachments <strong>%d</strong>',
	'TOTAL_FILES_ZERO'		=> 'Total attachments <strong>0</strong>',
	'FILES_PER_DAY_OTHER'	=> 'Attachments per day <strong>%.2f</strong>',
	'FILES_PER_DAY_ZERO'	=> 'Attachments per day <strong>None</strong>',
	'FILES_PER_YEAR_OTHER'	=> 'Attachments per year <strong>%d</strong>',
	'FILES_PER_YEAR_ZERO'	=> 'Attachments per year <strong>None</strong>',
	'FILES_PER_USER_OTHER'	=> 'Attachments per member <strong>%.2f</strong>',
	'FILES_PER_USER_ZERO'	=> 'Attachments per member <strong>None</strong>',
));

Current index.php edit :

Code: Select all

$l_total_user_s = ($total_users == 0) ? 'TOTAL_USERS_ZERO' : 'TOTAL_USERS_OTHER';
$l_total_post_s = ($total_posts == 0) ? 'TOTAL_POSTS_ZERO' : 'TOTAL_POSTS_OTHER';
$l_total_topic_s = ($total_topics == 0) ? 'TOTAL_TOPICS_ZERO' : 'TOTAL_TOPICS_OTHER';
$l_total_file_s = ($total_files == 0) ? 'TOTAL_FILES_ZERO' : 'TOTAL_FILES_OTHER';
$posts_per_day = $total_posts / $boarddays;
$l_posts_per_day_s = ($posts_per_day == 0) ? 'POSTS_PER_DAY_ZERO' : 'POSTS_PER_DAY_OTHER';
$posts_per_year = $posts_per_day * 365;
$l_posts_per_year_s = ($posts_per_year == 0) ? 'POSTS_PER_YEAR_ZERO' : 'POSTS_PER_YEAR_OTHER';
$posts_per_user = $total_posts / $total_users;
$l_posts_per_user_s = ($posts_per_user == 0) ? 'POSTS_PER_USER_ZERO' : 'POSTS_PER_USER_OTHER';
$posts_per_topic = $total_posts / $total_topics;
$l_posts_per_topic_s = ($posts_per_topic == 0) ? 'POSTS_PER_TOPIC_ZERO' : 'POSTS_PER_TOPIC_OTHER';
$topics_per_day = $total_topics / $boarddays;
$l_topics_per_day_s = ($topics_per_day == 0) ? 'TOPICS_PER_DAY_ZERO' : 'TOPICS_PER_DAY_OTHER';
$topics_per_year = $topics_per_day * 365;
$l_topics_per_year_s = ($topics_per_year == 0) ? 'TOPICS_PER_YEAR_ZERO' : 'TOPICS_PER_YEAR_OTHER';
$topics_per_user = $total_topics / $total_users;
$l_topics_per_user_s = ($topics_per_user == 0) ? 'TOPICS_PER_USER_ZERO' : 'TOPICS_PER_USER_OTHER';
$files_per_day = $total_files / $boarddays;
$l_files_per_day_s = ($files_per_day == 0) ? 'FILES_PER_DAY_ZERO' : 'FILES_PER_DAY_OTHER';
$files_per_year = $files_per_day * 365;
$l_files_per_year_s = ($files_per_year == 0) ? 'FILES_PER_YEAR_ZERO' : 'FILES_PER_YEAR_OTHER';
$files_per_user = $total_files / $total_users;
$l_files_per_user_s = ($files_per_day == 0) ? 'FILES_PER_USER_ZERO' : 'FILES_PER_USER_OTHER';
$users_per_day = $total_users / $boarddays;
$l_users_per_day_s = ($users_per_day == 0) ? 'USERS_PER_DAY_ZERO' : 'USERS_PER_DAY_OTHER';
$users_per_year = $users_per_day * 365;
$l_users_per_year_s = ($users_per_year == 0) ? 'USERS_PER_YEAR_ZERO' : 'USERS_PER_YEAR_OTHER';

Code: Select all

'TOTAL_POSTS'    => sprintf($user->lang[$l_total_post_s], number_format($total_posts, 0, ',', ',')),
    'POSTS_PER_DAY'   => str_replace('.', '.', sprintf($user->lang[$l_posts_per_day_s], $posts_per_day)),
    'POSTS_PER_YEAR'    => sprintf($user->lang[$l_posts_per_year_s], number_format($posts_per_year, 0, ',', ',')),
    'POSTS_PER_TOPIC'   => str_replace('.', '.', sprintf($user->lang[$l_posts_per_topic_s], $posts_per_topic)),
    'POSTS_PER_USER'   => str_replace('.', '.', sprintf($user->lang[$l_posts_per_user_s], $posts_per_user)),
    'TOTAL_TOPICS'    => sprintf($user->lang[$l_total_topic_s], number_format($total_topics, 0, ',', '.')),
    'TOPICS_PER_DAY'   => str_replace('.', '.', sprintf($user->lang[$l_topics_per_day_s], $topics_per_day)),
    'TOPICS_PER_YEAR'   => sprintf($user->lang[$l_topics_per_year_s], number_format($topics_per_year, 0, ',', '.')),
    'TOPICS_PER_USER'   => str_replace('.', '.', sprintf($user->lang[$l_topics_per_user_s], $topics_per_user)),
    'TOTAL_FILES'    => sprintf($user->lang[$l_total_file_s], number_format($total_files, 0, ',', '.')),
    'FILES_PER_DAY'   => str_replace('.', ',', sprintf($user->lang[$l_files_per_day_s], $files_per_day)),
    'FILES_PER_YEAR'    => sprintf($user->lang[$l_files_per_year_s], number_format($files_per_year, 0, ',', '.')),
    'FILES_PER_USER'   => str_replace('.', ',', sprintf($user->lang[$l_files_per_user_s], $files_per_user)),
    'TOTAL_USERS'    => sprintf($user->lang[$l_total_user_s], number_format($total_users, 0, ',', '.')),
    'USERS_PER_DAY'   => str_replace('.', '.', sprintf($user->lang[$l_users_per_day_s], $users_per_day)),
    'USERS_PER_YEAR'    => sprintf($user->lang[$l_users_per_year_s], number_format($users_per_year, 0, ',', '.')),
    'NEWEST_USER'   => sprintf($user->lang['NEWEST_USER'], get_username_string('full', $config['newest_user_id'], $config['newest_username'], $config['newest_user_colour'])),
    'START_DATE'         => $start_date,
Update Needed from XML

Code: Select all

$l_total_user_s = ($total_users == 0) ? 'TOTAL_USERS_ZERO' : 'TOTAL_USERS_OTHER';
$l_total_post_s = ($total_posts == 0) ? 'TOTAL_POSTS_ZERO' : 'TOTAL_POSTS_OTHER';
$l_total_topic_s = ($total_topics == 0) ? 'TOTAL_TOPICS_ZERO' : 'TOTAL_TOPICS_OTHER';
$l_total_file_s = ($total_files == 0) ? 'TOTAL_FILES_ZERO' : 'TOTAL_FILES_OTHER';
$posts_per_day = $total_posts / $boarddays;
$l_posts_per_day_s = ($posts_per_day == 0) ? 'POSTS_PER_DAY_ZERO' : 'POSTS_PER_DAY_OTHER';
$posts_per_year = $posts_per_day * 364.25;
$l_posts_per_year_s = ($posts_per_year == 0) ? 'POSTS_PER_YEAR_ZERO' : 'POSTS_PER_YEAR_OTHER';
$posts_per_user = $total_posts / $total_users;
$l_posts_per_user_s = ($posts_per_user == 0) ? 'POSTS_PER_USER_ZERO' : 'POSTS_PER_USER_OTHER';
$posts_per_topic = $total_posts / $total_topics;
$l_posts_per_topic_s = ($posts_per_topic == 0) ? 'POSTS_PER_TOPIC_ZERO' : 'POSTS_PER_TOPIC_OTHER';
$topics_per_day = $total_topics / $boarddays;
$l_topics_per_day_s = ($topics_per_day == 0) ? 'TOPICS_PER_DAY_ZERO' : 'TOPICS_PER_DAY_OTHER';
$topics_per_year = $topics_per_day * 364.25;
$l_topics_per_year_s = ($topics_per_year == 0) ? 'TOPICS_PER_YEAR_ZERO' : 'TOPICS_PER_YEAR_OTHER';
$topics_per_user = $total_topics / $total_users;
$l_topics_per_user_s = ($topics_per_user == 0) ? 'TOPICS_PER_USER_ZERO' : 'TOPICS_PER_USER_OTHER';
$files_per_day = $total_files / $boarddays;
$l_files_per_day_s = ($files_per_day == 0) ? 'FILES_PER_DAY_ZERO' : 'FILES_PER_DAY_OTHER';
$files_per_year = $files_per_day * 364.25;
$l_files_per_year_s = ($files_per_year == 0) ? 'FILES_PER_YEAR_ZERO' : 'FILES_PER_YEAR_OTHER';
$files_per_user = $total_files / $total_users;
$l_files_per_user_s = ($files_per_day == 0) ? 'FILES_PER_USER_ZERO' : 'FILES_PER_USER_OTHER';
$users_per_day = $total_users / $boarddays;
$l_users_per_day_s = ($users_per_day == 0) ? 'USERS_PER_DAY_ZERO' : 'USERS_PER_DAY_OTHER';
$users_per_year = $users_per_day * 364.25;
$l_users_per_year_s = ($users_per_year == 0) ? 'USERS_PER_YEAR_ZERO' : 'USERS_PER_YEAR_OTHER';

Code: Select all

	'TOTAL_POSTS'		=> sprintf($user->lang[$l_total_post_s], $total_posts),
	'TOTAL_TOPICS'		=> sprintf($user->lang[$l_total_topic_s], $total_topics),
	'TOTAL_USERS'		=> sprintf($user->lang[$l_total_user_s], $total_users),
	'POSTS_PER_DAY'   	=> sprintf($user->lang[$l_posts_per_day_s], $posts_per_day),
    'POSTS_PER_YEAR'    => sprintf($user->lang[$l_posts_per_year_s], $posts_per_year),
    'POSTS_PER_TOPIC'   => sprintf($user->lang[$l_posts_per_topic_s], $posts_per_topic),
    'POSTS_PER_USER'   	=> sprintf($user->lang[$l_posts_per_user_s], $posts_per_user),
    'TOPICS_PER_DAY'   	=> sprintf($user->lang[$l_topics_per_day_s], $topics_per_day),
    'TOPICS_PER_YEAR'   => sprintf($user->lang[$l_topics_per_year_s], $topics_per_year),
    'TOPICS_PER_USER'   => sprintf($user->lang[$l_topics_per_user_s], $topics_per_user),
    'TOTAL_FILES'    	=> sprintf($user->lang[$l_total_file_s], $total_files),
    'FILES_PER_DAY'   	=> sprintf($user->lang[$l_files_per_day_s], $files_per_day),
    'FILES_PER_YEAR'    => sprintf($user->lang[$l_files_per_year_s], $files_per_year),
    'FILES_PER_USER'   	=> sprintf($user->lang[$l_files_per_user_s], $files_per_user),
    'USERS_PER_DAY'   	=> sprintf($user->lang[$l_users_per_day_s], $users_per_day),
    'USERS_PER_YEAR'    => sprintf($user->lang[$l_users_per_year_s], $users_per_year),
	'START_DATE'        => $start_date,

How to change this?

Posted: 12 Jul 2013, 04:10
by Rhyno
No one spot the difference? or problem?

How to change this?

Posted: 12 Jul 2013, 07:22
by Stoker
Im not gonna compare your files.
I have faith in you to do as I told you earlier:
Make sure you have latest code in your files.
Thats easy done by replacing code with code from latest version!

How to change this?

Posted: 18 Jul 2013, 08:43
by Rhyno
Worked it out it finally PHEW ! :)

Thanks for the help and apologies for being so annoying... It was one line in the index.php that was custom line that i kept deleting and it threw everything out.

Code: Select all

'NEWEST_USER'   => sprintf($user->lang['NEWEST_USER'], get_username_string('full', $config['newest_user_id'], $config['newest_username'], $config['newest_user_colour'])),
Once I kept that in, all was well !

How to change this?

Posted: 18 Jul 2013, 08:52
by Stoker
:thumb: