Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

PANEL SNIPPIT:: Some Site Stats Panel

Asked Modified Viewed 10,242 times
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
  • Started this discussions
asked
Fusioneer

PANEL SNIPPIT:: Some Site Stats Panel


www.phpfusionmods.co.uk/images/some_site_stats_panel.png



Here is the code for the Some Site Stats Panel used on the homepage of this site.

Go to Admin >>> System >>> Panels >>> Add a new center panel.

Paste in this code and enable it.

if (iGUEST) {
$locale['stat001'] = "Member";
$locale['stat002'] = "Members";
$locale['stat003'] = "Some Site Stats";
$locale['stat004'] = "Stats";
$locale['stat005'] = "There has been ";
$locale['stat006'] = " and ";
$locale['stat007'] = " Registered Members  since";
$locale['stat008'] = " logged in today and ";
$locale['stat009'] = " new ";
$locale['stat010'] = " registered today. ";
$locale['stat011'] = "We have ";
$locale['stat012'] = " Downloads, ";
$locale['stat013'] = " forum threads and ";
$locale['stat014'] = " forum posts.";
$locale['stat015'] = "There are ";
$locale['stat016'] = " comments";
$locale['stat017'] = " shouts posted.";

$members_registered = dbcount("(user_id)", DB_USERS, "user_status<='1' OR user_status='3' OR user_status='5'");
$members_today = number_format(dbcount("(user_id)", DB_USERS, "user_status<='1' AND user_lastvisit > UNIX_TIMESTAMP(CURDATE())"));
$new_members_today = number_format(dbcount("(user_id)", DB_USERS, "user_status<='1' AND user_joined > UNIX_TIMESTAMP(CURDATE())"));
$downloads = dbcount("(download_id)", DB_DOWNLOADS);
$counter = number_format($settings['counter'])." ".($settings['counter'] == 1 ? $locale['global_170'] : $locale['global_171']."");
$threads = dbcount("(thread_id)", DB_THREADS);
$posts = dbcount("(post_id)", DB_POSTS);
$comments = dbcount("(comment_id)", DB_COMMENTS);
include_once INFUSIONS."shoutbox_panel/infusion_db.php";
$shouts = dbcount("(shout_id)", DB_SHOUTBOX);
$site_opened = dbarray(dbquery("SELECT user_id, user_joined FROM ".DB_USERS." WHERE user_id='1'"));

opentable($locale['stat003']);

echo"<div class='tbl-border center' style='margin-top:5px; margin-bottom: 5px;'>\n";
echo"<div style='float: left; margin-top: 27px; margin-bottom:0px; padding-left: 10px; '><img style='vertical-align:middle; border: 0px; text-align: center; ' src='".IMAGES."stats2.png' alt='".$locale['stat004']."' /></div>\n";
echo "<div class='tbl1' style='margin-top: 1px; margin-bottom: 0px; padding-left: 42px;'>".THEME_BULLET." <span class='small'>".$locale['stat005'].$counter.$locale['stat006'].$members_registered.$locale['stat007']." ".showdate("longdate", $site_opened['user_joined'])."</span>
<br />".THEME_BULLET."  <span class='small'>".$members_today." ".($members_today == 1 ? $locale['stat001'] : $locale['stat002']."").$locale['stat008'].$new_members_today.$locale['stat009'].($new_members_today == 1 ? $locale['stat001'] : $locale['stat002']."").$locale['stat010']."</span></div>\n";
echo"<div class='tbl2' style='margin-bottom: 1px; padding-left: 42px;'>\n";
echo THEME_BULLET." <span class='small'> ".$locale['stat011'].$downloads.$locale['stat012']." </span>\n";
echo"  <span class='small'>  ".$threads.$locale['stat013'].$posts.$locale['stat014']."</span><br />\n";
echo THEME_BULLET." <span class='small'>".$locale['stat015'].$comments.$locale['stat016']."</span>\n";
echo"  <span class='small'>".$locale['stat006'].$shouts.$locale['stat017']."</span>\n";
   echo"</div></div>\n";
   
   closetable();
}


NOTE: This panel is configured for GUESTS only, members will not see it, only guests will.
If you want everyone to see it just remove...


if (iGUEST) {


And at the bottom of the panel code remove the closing }

0 replies

34 posts

J
Jompsa
J
Jompsa 10
Visit my homepage - http://jomppaspace.net
  • Member, joined since
  • Contributed 96 posts on the community forums.
  • Started 18 threads in the forums
answered
Member

Simple and very nice! Well done!
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
  • Started this discussions
answered
Fusioneer

Thanks, it adds a few more queries, but who cares, it's not the end of the world. That's what modding and enhancing a site is all about. Adding and adding and adding. ;)

Enjoy!
0 replies
B
behrooz
B
  • Member, joined since
  • Contributed 122 posts on the community forums.
  • Started 29 threads in the forums
answered
Member

very nice ide, thanks fangree;)
0 replies
J
jikaka
J
jikaka 10
www.rusfusion.ru - russian nss
  • Veteran Member, joined since
  • Contributed 946 posts on the community forums.
  • Started 82 threads in the forums
answered
Veteran Member

:G
0 replies
— 1 month later —
O
outlaw16151
O
  • Member, joined since
  • Contributed 88 posts on the community forums.
  • Started 6 threads in the forums
answered
Member

id like to add a few more queries to this but wouldnt know where to began lol
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
  • Started this discussions
answered
Fusioneer

Hi there,

What do you want it to do?

Kind Regards
Craig
0 replies
O
outlaw16151
O
  • Member, joined since
  • Contributed 88 posts on the community forums.
  • Started 6 threads in the forums
answered
Member

number of media
number of custom pages
number of games in varcade

all on my site
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
  • Started this discussions
answered
Fusioneer

Hey,

It's just the same like emm....

$downloads = dbcount("(download_id)", DB_DOWNLOADS);


Except change the DB_NAME And the ID name.

That will count each id row from the specified DB table.

Change the download_id and DB_DOWNLOADS to the ones you require.
Edited by Craig on 23-02-2013 21:57,
0 replies
O
outlaw16151
O
  • Member, joined since
  • Contributed 88 posts on the community forums.
  • Started 6 threads in the forums
answered
Member

it throws errors craig........ look at that othe part of the code
Edited by outlaw16151 on 24-02-2013 03:08,
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
  • Started this discussions
answered
Fusioneer

Show me what you done?
0 replies
O
outlaw16151
O
  • Member, joined since
  • Contributed 88 posts on the community forums.
  • Started 6 threads in the forums
answered
Member

$locale['stat001'] = "Member";
$locale['stat002'] = "Members";
$locale['stat003'] = "Some Site Stats";
$locale['stat004'] = "Stats";
$locale['stat005'] = "There has been ";
$locale['stat006'] = " and ";
$locale['stat007'] = " Registered Members  since";
$locale['stat008'] = " logged in today and ";
$locale['stat009'] = " new ";
$locale['stat010'] = " registered today. ";
$locale['stat011'] = "We have ";
$locale['stat012'] = " Downloads, ";
$locale['stat013'] = " forum threads and ";
$locale['stat014'] = " forum posts.";
$locale['stat015'] = "There are ";
$locale['stat016'] = " comments";
$locale['stat017'] = " shouts posted.";
$locale['stat018'] = " media added.";
$locale['stat019'] = " with catagories.";

$members_registered = dbcount("(user_id)", DB_USERS, "user_status<='1' OR user_status='3' OR user_status='5'");
$members_today = number_format(dbcount("(user_id)", DB_USERS, "user_status<='1' AND user_lastvisit > UNIX_TIMESTAMP(CURDATE())"));
$new_members_today = number_format(dbcount("(user_id)", DB_USERS, "user_status<='1' AND user_joined > UNIX_TIMESTAMP(CURDATE())"));
$downloads = dbcount("(download_id)", DB_DOWNLOADS);
$counter = number_format($settings['counter'])." ".($settings['counter'] == 1 ? $locale['global_170'] : $locale['global_171']."");
$threads = dbcount("(thread_id)", DB_THREADS);
$posts = dbcount("(post_id)", DB_POSTS);
$comments = dbcount("(comment_id)", DB_COMMENTS);
include_once INFUSIONS."shoutbox_panel/infusion_db.php";
$shouts = dbcount("(shout_id)", DB_SHOUTBOX);
$site_opened = dbarray(dbquery("SELECT user_id, user_joined FROM ".DB_USERS." WHERE user_id='1'"));
$media = dbcount("(kroax_id)", fus_kroax);

opentable($locale['stat003']);

echo"<div class='tbl-border center' style='margin-top:5px; margin-bottom: 5px;'>\n";
echo"<div style='float: left; margin-top: 27px; margin-bottom:0px; padding-left: 10px; '><img style='vertical-align:middle; border: 0px; text-align: center; ' src='".IMAGES."stats2.png' alt='".$locale['stat004']."' /></div>\n";
echo "<div class='tbl1' style='margin-top: 1px; margin-bottom: 0px; padding-left: 42px;'>".THEME_BULLET." <span class='small'>".$locale['stat005'].$counter.$locale['stat006'].$members_registered.$locale['stat007']." ".showdate("longdate", $site_opened['user_joined'])."</span>
<br />".THEME_BULLET."  <span class='small'>".$members_today." ".($members_today == 1 ? $locale['stat001'] : $locale['stat002']."").$locale['stat008'].$new_members_today.$locale['stat009'].($new_members_today == 1 ? $locale['stat001'] : $locale['stat002']."").$locale['stat010']."</span></div>\n";
echo"<div class='tbl2' style='margin-bottom: 1px; padding-left: 42px;'>\n";
echo THEME_BULLET." <span class='small'> ".$locale['stat011'].$downloads.$locale['stat012']." </span>\n";
echo"  <span class='small'>  ".$threads.$locale['stat013'].$posts.$locale['stat014']."</span><br />\n";
echo THEME_BULLET." <span class='small'>".$locale['stat015'].$comments.$locale['stat016']."</span>\n";
echo"  <span class='small'>".$locale['stat006'].$shouts.$locale['stat017']."</span>\n";
echo"  <span class='small'>".$locale['stat018'].$media.$locale['stat019']."</span>\n";
   echo"</div></div>\n";
   
   closetable();
Edited by HobbyMan on 25-02-2013 14:22,
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
  • Started this discussions
answered
Fusioneer

Morning,

Please wrap the code bb code around that mate?

Thanks

KraoX maybe needs to be....

$media = dbcount("(kroax_id)", DB_KROAX);


You might also need to include the infusion_db.php for that as well.

Maybe kraox is video_id and DB_VIDEO? ? I'm not sure, not used the Kroax in years!!! (Domi?)

Kind Regards
Craig
Edited by Craig on 24-02-2013 12:47,
0 replies
R
razin
R
razin 10
  • Junior Member, joined since
  • Contributed 41 posts on the community forums.
  • Started 19 threads in the forums
answered
Junior Member

Is the panel will also be the infusion.
0 replies
O
outlaw16151
O
  • Member, joined since
  • Contributed 88 posts on the community forums.
  • Started 6 threads in the forums
answered
Member

its a good idea to make it a panel, it will keep count on everything on your site
number of media
number of games
number of custom pages

and lots of other things that you would want your visitors to know whats on your site
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
  • Started this discussions
answered
Fusioneer

Hi,

That ides is probably good for another panel or there might be panels available already that do that purpose. This panel snippit I have here is just a Some Stats Panel. Of course people can add to it and change it in any shape or form and I am here to help with that.

Did you achieve your goal of getting it to display total Kroax Media, custom Pages and Games?

Kind Regards
Craig
0 replies
O
outlaw16151
O
  • Member, joined since
  • Contributed 88 posts on the community forums.
  • Started 6 threads in the forums
answered
Member

no im still trying to get kroax media count, it is showing 34 which is the right amount bout, it shows an error at the bottom of the site, go to my site and look craig lower center panel
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
  • Started this discussions
answered
Fusioneer

Hi,

Did you add the...

infusion_db.php include for ye Kroax?

Kind Regards
Craig
0 replies
O
outlaw16151
O
  • Member, joined since
  • Contributed 88 posts on the community forums.
  • Started 6 threads in the forums
answered
Member

that didnt work pal, i used

$media = dbcount("(kroax_id)", fus_kroax);
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
  • Started this discussions
answered
Fusioneer

Hi,

Try...


global $db_prefix;
$media = dbcount("(kroax_id)", $db_prefix."kroax");


Or...

include INFUSIONS."the_kroax/infusion_db.php";
$media = dbcount("(kroax_id)", DB_KROAX);



Kind Regards
Craig
Edited by Craig on 24-02-2013 23:48,
0 replies
O
outlaw16151
O
  • Member, joined since
  • Contributed 88 posts on the community forums.
  • Started 6 threads in the forums
answered
Member

that shows number of media also, but still said:
WARNING: An error occurred while parsing the page. Please see PHPFusion's error log for more details.
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 34 posts
  • Votes 0 votes
  • Topic users 6 members

6 participants

C
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
  • Started this discussions
B
B
  • Member, joined since
  • Contributed 122 posts on the community forums.
  • Started 29 threads in the forums
J
J
jikaka 10
www.rusfusion.ru - russian nss
  • Veteran Member, joined since
  • Contributed 946 posts on the community forums.
  • Started 82 threads in the forums
R
R
razin 10
  • Junior Member, joined since
  • Contributed 41 posts on the community forums.
  • Started 19 threads in the forums
J
J
Jompsa 10
Visit my homepage - http://jomppaspace.net
  • Member, joined since
  • Contributed 96 posts on the community forums.
  • Started 18 threads in the forums
O
O
  • Member, joined since
  • Contributed 88 posts on the community forums.
  • Started 6 threads in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet