Solved: 7 Years, 3 Months, 3 Weeks ago Display stats in footer?
#1
Solved: 7 Years, 3 Months, 3 Weeks ago
Any ideas how I can display {$stats ['numposts']}, {$stats ['numusers']}, {$stats ['numthreads']}, and {$newestmember} in the footer please?

I've tried adding them manually but it doesn't work.. I've seen most forums have this feature I'm wondering is it a plugin or..?

Bump anybody?
Do NOT PM me for support unless I ask you on your support thread.
Reply
#2
Solved: 7 Years, 3 Months, 3 Weeks ago
Try this:

Open ./global.php and find:

$plugins->run_hooks("global_start");

and add the following code just Below that..

$stats = $cache->read("stats");
$stats['newest_user'] = build_profile_link($stats['lastusername'], $stats['lastuid']);
$total_posts = my_number_format($stats['numposts']);
$total_users = my_number_format($stats['numusers']);

Stats vars will work globally now..

You are welcome.
Hey man, what's up?
Reply
#3
Solved: 7 Years, 3 Months, 3 Weeks ago
(2017-09-10, 10:29 PM)Michael2014 Wrote: Try this:

Open ./global.php and find:

$plugins->run_hooks("global_start");

and add the following code just Below that..

$stats = $cache->read("stats");
$stats['newest_user'] = build_profile_link($stats['lastusername'], $stats['lastuid']);
$total_posts = my_number_format($stats['numposts']);
$total_users = my_number_format($stats['numusers']);

Stats vars will work globally now..

You are welcome.

Tried that and I got an error..
A potential security issue was found in the template. Please review your changes or contact the MyBB Group for support.
Do NOT PM me for support unless I ask you on your support thread.
Reply
#4
Solved: 7 Years, 3 Months, 3 Weeks ago
That is nothing, that just has to do with your vars, if you are using the vars above then you NEED to remove the spacing within them,
a mis-written var triggers the above error, try these vars below with the spacing removed.

{$stats['numposts']} {$stats['numusers']} {$stats['numthreads']} and {$newestmember}
Hey man, what's up?
Reply
#5
Solved: 7 Years, 3 Months, 3 Weeks ago
(2017-09-11, 12:53 AM)Michael2014 Wrote: That is nothing, that just has to do with your vars, if you are using the vars above then you NEED to remove the spacing within them,
a mis-written var triggers the above error, try these vars below with the spacing removed.

{$stats['numposts']} {$stats['numusers']} {$stats['numthreads']} and {$newestmember}

{$newestmember} not display.

[Image: Screenshot_2017_09_11_09_51_14.png]
Reply
#6
Solved: 7 Years, 3 Months, 3 Weeks ago
(2017-09-11, 02:52 AM)Pulseeey Wrote:
(2017-09-11, 12:53 AM)Michael2014 Wrote: That is nothing, that just has to do with your vars, if you are using the vars above then you NEED to remove the spacing within them,
a mis-written var triggers the above error, try these vars below with the spacing removed.

{$stats['numposts']} {$stats['numusers']} {$stats['numthreads']} and {$newestmember}

{$newestmember} not display.

[Image: Screenshot_2017_09_11_09_51_14.png]

Yeah newest member not working..
Do NOT PM me for support unless I ask you on your support thread.
Reply
#7
Solved: 7 Years, 3 Months, 3 Weeks ago
Cool ---> {$stats['newest_user']}
Hey man, what's up?
Reply
#8
Solved: 7 Years, 3 Months, 3 Weeks ago
(2017-09-12, 12:24 AM)Michael2014 Wrote: Cool  ---> {$stats['newest_user']}

this work, thank you +1 rep for you.
Reply
#9
Solved: 7 Years, 3 Months, 3 Weeks ago
Thank you finally it works! Smile
Do NOT PM me for support unless I ask you on your support thread.
Reply
#10
Solved: 7 Years, 3 Months, 3 Weeks ago
(2017-09-10, 10:29 PM)Michael2014 Wrote: Try this:

Open ./global.php and find:

$plugins->run_hooks("global_start");

and add the following code just Below that..

$stats = $cache->read("stats");
$stats['newest_user'] = build_profile_link($stats['lastusername'], $stats['lastuid']);
$total_posts = my_number_format($stats['numposts']);
$total_users = my_number_format($stats['numusers']);

Stats vars will work globally now..

You are welcome.

what should I do if I don't want to touch global.php ? actually I don't wanna touch Official Template files.
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)