Home N-13 News Forums Help Search
RegisterForgot password?
How to add image to post necklacesdiscou
Known bugs - 4.0.3 necklacesdiscou

Latest N-13 News 4.0.3

What is N-13 News?
Where can I get help?
Known bugs

Forums Help & Support Memberstats
Gerrit
Posted on 30 Aug 2009, 20:33:47

Access: Member
Total Posts: 15
Joined: 2009-08-23

Hi Chris and everyone

Is it possible to have member stats with N-13 news
just like here on the forum?

Greetings Gerrit.
#816
Chris
Posted on 31 Aug 2009, 01:16:59

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

If you edit the index.php file, around line 50~ you'll see this code

Code:
#show news stats
if($showstats){
$totalnews = getresult("SELECT COUNT(id) FROM $newstable");
$totalcomments = getresult("SELECT COUNT(id) FROM $newscomments");
$totalusers = getresult("SELECT COUNT(uid) FROM $newsusers");
$totalcategories = getresult("SELECT COUNT(id) FROM $newscats");
$totalaccesslevels = getresult("SELECT COUNT(uid) FROM $newsaccess");


//simply echo the above variables,
//example
//echo $totalnews;
//will show the total amount of posts

die();
}


so just change that to something like

Code:
#show news stats
if($showstats){
$totalnews = getresult("SELECT COUNT(id) FROM $newstable");
$totalcomments = getresult("SELECT COUNT(id) FROM $newscomments");
$totalusers = getresult("SELECT COUNT(uid) FROM $newsusers");
$totalcategories = getresult("SELECT COUNT(id) FROM $newscats");
$totalaccesslevels = getresult("SELECT COUNT(uid) FROM $newsaccess");


echo "Total users: $totalusers <br />";
echo "Total newsposts: $totalnews ";

die();
}

Then wherever you want the news stats to show simply include the index.php file with the $showstats variable set to true

Code:
<?php
$showstats 
= true;
include 
'news/index.php';
$showstats = false;
?>
#817
Last edited by Chris at 2009-08-31 03:03:26 Reason:
Gerrit
Posted on 31 Aug 2009, 11:43:05

Access: Member
Total Posts: 15
Joined: 2009-08-23

Thank Chris
I'll try that
Gerrit.
#821
Gerrit
Posted on 31 Aug 2009, 13:01:15

Access: Member
Total Posts: 15
Joined: 2009-08-23

Hi Chris, and how do i show the names of the online members?
I don't know PHP, is it possible to color the txt with p.e. STYLE?

Regards Gerrit.
#823
Last edited by Gerrit at 2009-08-31 13:03:56 Reason:
Chris
Posted on 01 Sep 2009, 16:28:55

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

You can indeed style the stats however you want, you could do it mulitple ways

Code:
<span style="font-color: #0000AA">
<php
$showstats = true;
include 'news/index.php';
$showstats = false;
?>
</span>


Or you could edit the index.php file and put the styles directly in there

Code:
echo '<span style="font-color: #0000AA">$totalnews</span>';


Unforunately the system wasn't designed to show who currently is online so you won't be able to do that.
#830
Jkyr
Posted on 13 Jul 2010, 15:34:04

Access: Member
Total Posts: 5
Joined: 2010-07-13

Quote:
If you edit the index.php file, around line 50~ you'll see this code

Code:
#show news stats
if($showstats){
$totalnews = getresult("SELECT COUNT(id) FROM $newstable");
$totalcomments = getresult("SELECT COUNT(id) FROM $newscomments");
$totalusers = getresult("SELECT COUNT(uid) FROM $newsusers");
$totalcategories = getresult("SELECT COUNT(id) FROM $newscats");
$totalaccesslevels = getresult("SELECT COUNT(uid) FROM $newsaccess");


//simply echo the above variables,
//example
//echo $totalnews;
//will show the total amount of posts

die();
}


so just change that to something like

Code:
#show news stats
if($showstats){
$totalnews = getresult("SELECT COUNT(id) FROM $newstable");
$totalcomments = getresult("SELECT COUNT(id) FROM $newscomments");
$totalusers = getresult("SELECT COUNT(uid) FROM $newsusers");
$totalcategories = getresult("SELECT COUNT(id) FROM $newscats");
$totalaccesslevels = getresult("SELECT COUNT(uid) FROM $newsaccess");


echo "Total users: $totalusers <br />";
echo "Total newsposts: $totalnews ";

die();
}

Then wherever you want the news stats to show simply include the index.php file with the $showstats variable set to true

Code:
<?php
$showstats 
= true;
include 
'news/index.php';
$showstats = false;
?>


In version 3.7 the file index.php there is no more. Is there a way to see the statistics of its members; Sorry for my english I hope you understand ..
#2688
Chris
Posted on 13 Jul 2010, 15:58:59

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

Jkyr, things have changed slightly in 3.7. You can either do this

Code:
<?php
$showstats 
= true;
include 
'news/index.php';
?>


Then edit functions.php, line 369~ and edit the showstats() function.

Or alternatively you can use your own code, have a look here

http://code.google.com/p/n-13news/wiki/CodeSamples#Show_news_stats
#2689
Jkyr
Posted on 13 Jul 2010, 16:42:02

Access: Member
Total Posts: 5
Joined: 2010-07-13

Quote:
Jkyr, things have changed slightly in 3.7. You can either do this

Code:
<?php
$showstats 
= true;
include 
'news/index.php';
?>


Then edit functions.php, line 369~ and edit the showstats() function.

Or alternatively you can use your own code, have a look here

http://code.google.com/p/n-13news/wiki/CodeSamples#Show_news_stats


Thanks. I want to also ask if I can show you online users and visitors.
#2690
Chris
Posted on 13 Jul 2010, 17:02:49

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

Not possible with the news system I'm afraid.
#2691
Jkyr
Posted on 13 Jul 2010, 17:16:02

Access: Member
Total Posts: 5
Joined: 2010-07-13

Thanks ...
#2692
Network-13.com © 2013