4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: Vraxor on December 29, 2002, 01:02:55 PM

Title: [Mod] More Statistics for your visitors
Post by: Vraxor on December 29, 2002, 01:02:55 PM
Hi all,

I did already forgot about this little modification I did. I was in fact the first little mod I did ever in PHP.

The idea is to show more statistics then the number of images and categories (which are shown by default).
This MOD will show:
- Number of Members
- Number of Image Votes
- Number of Image Hits
- Number of Image Comments
- Number of Image Downloads

All these are shown on totals, so it shows the total number of image hits over all images. You can see an example of it here: http://haunter.student.utwente.nl/Terrarevolution/galleries/index.php

// Ok, now lets get started

Creating the stats.php file
Make a new file called: stats.php
Save this empty file in the includes folder of 4images
Open stats.php with any code editor you like.

and copy past the following to your stats.php:
Code: [Select]
<?PHP

//-----------------------------------------------------
//--- Show number of Users ----------------------------
//-----------------------------------------------------
   $sql = "SELECT COUNT(*) as users
          FROM ".USERS_TABLE."
          WHERE user_id <> ".GUEST;
  $row = $site_db->query_firstrow($sql);

  $total_users = "".$lang['users']."<B> ".$row['users']."</B>\n";
 
  $site_template->register_vars("total_users", $total_users);
unset($total_users);

//-----------------------------------------------------
//--- Hits --------------------------------------------
//-----------------------------------------------------
$sql = "SELECT SUM(image_hits) AS sum
          FROM ".IMAGES_TABLE;
  $row = $site_db->query_firstrow($sql);

  $sum = (isset($row['sum'])) ? $row['sum'] : 0;
  $total_hits = "".$lang['total_hits']."<B> ".$row['sum']."</B>\n";
 
  $site_template->register_vars("total_hits", $total_hits);
unset($total_hits);

//-----------------------------------------------------
//--- Votes -------------------------------------------
//-----------------------------------------------------
$sql = "SELECT SUM(image_votes) AS sum
          FROM ".IMAGES_TABLE;
  $row = $site_db->query_firstrow($sql);

  $sum = (isset($row['sum'])) ? $row['sum'] : 0;
  $total_votes = "".$lang['total_votes']."<B> ".$row['sum']."</B>\n";
 
  $site_template->register_vars("total_votes", $total_votes);
unset($total_votes);

//-----------------------------------------------------
//--- Downloads ---------------------------------------
//-----------------------------------------------------
$sql = "SELECT SUM(image_downloads) AS sum
          FROM ".IMAGES_TABLE;
  $row = $site_db->query_firstrow($sql);

  $sum = (isset($row['sum'])) ? $row['sum'] : 0;
  $total_downloads = "".$lang['total_downloads']."<B> ".$row['sum']."</B>\n";
 
  $site_template->register_vars("total_downloads", $total_downloads);
unset($total_downloads);

//-----------------------------------------------------
//--- Comments ----------------------------------------
//-----------------------------------------------------
$sql = "SELECT SUM(image_comments) AS sum
          FROM ".IMAGES_TABLE;
  $row = $site_db->query_firstrow($sql);

  $sum = (isset($row['sum'])) ? $row['sum'] : 0;
  $total_comments = "".$lang['total_comments']."<B> ".$row['sum']."</B>\n";
 
  $site_template->register_vars("total_comments", $total_comments);
unset($total_comments);
?>


Now save the stats.php file.

ALWAYS BACKUP: any file you start editing as you might not be able to restore it when the mod doesn't work

Adding the statistics to the language files:

*NOTE* I only edited this in English, but you will have to copy this to any language you use and maybe translate the english.

Open the main.php file from the lang/[your language] folder of 4images.

Go all the way to the bottom of the file.

Find:
Code: [Select]
//-----------------------------------------------------
//--- Admin Links -------------------------------------
//-----------------------------------------------------
$lang['edit'] = "[Edit]";
$lang['delete'] = "[Delete]";


Add Before:
Code: [Select]
//-----------------------------------------------------
//--- Statistics --------------------------------------
//-----------------------------------------------------
$lang['users'] = "Total Members:";
$lang['total_hits'] = "Total Image Hits:";
$lang['total_votes'] = "Total Image Votes:";
$lang['total_downloads'] = "Total Image Downloads:";
$lang['total_comments'] = "Total Image Comments:";


Including the statistics in Index.php:

Open index.php in the root folder of 4images with any code editor you like.

Find:
Code: [Select]
require(ROOT_PATH.'includes/sessions.php');

Add after:
Code: [Select]
include(ROOT_PATH.'includes/stats.php');

Do the same for catergories.php, lightbox.php, top.php
(it might also work in memberlist.php, search.php, register.php etc. but I did not test them yet)

Now edit the template files that correspond with the php files you added the include to.

index.php = home.html
categories.php = categories.html
lightbox.php = lightbox.html
top.php = top.html

you can find the templates inside the templates/default folder of 4images.

In the templates you can now use the following tags:

{total_users} - This will show the total number of members
{total_votes} - This will show the total number of image votes
{total_comments} - This will show the total number of image comments
{total_hits} - This will show the total number of image hits
{total_downloads} - This will show the total number of image downloads

Uploading all the edited files:

Now upload all files you editted to the right folder at your webserver.

This is a list of files you need to upload:
./index.php
./categories.php
./lightbox.php
./top.php
./includes/stats.php
./lang/ (any language you editted) /main.php
./templates/ (any templates you editted) /home.html
./templates/ (any templates you editted) /categories.html
./templates/ (any templates you editted) /lightbox.html
./templates/ (any templates you editted) /top.html

of course if you editted any more files then the once I mentioned above, you will need to upload them too.

I think this is it. Please note that it could be that I made an error somewhere in the directions above. As soon as you notice any error, please let me know and I will correct it as soon as possible.

Enjoy this little mod!!!

Cheers,
Vraxor
Title: [Mod] More Statistics for your visitors
Post by: V@no on December 29, 2002, 07:58:12 PM
Wow! works great, very nice!
just one little misspell I found
it supposed to be
Quote
{total_users}
not
Quote
{total_user}

and another thing, I think some host wont accept " <? " then need full tag " <?php "

P.S. do u have something else cool hided from us?  :D  :wink:
Title: [Mod] More Statistics for your visitors
Post by: Vraxor on December 29, 2002, 08:36:37 PM
ok, fixed.

Good to hear you like it.
Title: [Mod] More Statistics for your visitors
Post by: X-Fan on December 31, 2002, 03:28:09 AM
Cool mod Vraxor, thanks!

Just a quick note for those using the vBulletin integration mod, in stats.php find:

Code: [Select]

          WHERE user_id <> ".GUEST;


and change to:

Code: [Select]

          WHERE userid <> ".GUEST;


For it to work with vBulletin's users table rather than 4images.
Title: [Mod] More Statistics for your visitors
Post by: deviator on January 04, 2003, 03:27:53 PM
This is real cool, and it works, no errors!

test here:

[link removed]

Greets.
Title: Parse error in stats.php -> need help !
Post by: intuitiv on January 04, 2003, 05:58:04 PM
Hallo !

Habe alle hier beschriebenen Schritte durchgeführt und erhalte nun folgende Fehlermeldung in home.html:

-------------------
Parse error: parse error in
/home/intuitiv/public_html/vision/includes/stats.php on line 5
-------------------

kann da jemand helfen ?
Die Site ist:

http://www.intuitivmedia.net/vision/index.php

thank you !
Title: [Mod] More Statistics for your visitors
Post by: Vraxor on January 04, 2003, 09:54:53 PM
Hi intuitiv,

did you fix the error already as I do not see one?

Cheers,
Vraxor
Title: parse error fixed
Post by: intuitiv on January 04, 2003, 10:29:50 PM
Thank you, it was a problem related to my editor BBEdit 6.5. Everything is working fine.
Title: thanks!
Post by: wrestlingwiredotnet on January 11, 2003, 02:51:23 PM
Love the stats mod, great mod, thanks!!!!
Title: [Mod] More Statistics for your visitors
Post by: jdk on January 11, 2003, 07:44:55 PM
i need help please here is link http://www.jtimberlake.net/gallery/index.php you can see  whats problem :/
Title: Re: [MOD] More Statistics for your visitors
Post by: V@no on January 11, 2003, 08:26:22 PM
Quote from: Vraxor

Creating the stats.php file
Make a new file called: stats.php
Save this empty file in the includes folder of 4images
Open stats.php with any code editor you like.

and copy past the following to your stats.php:

did u do exactly this part?
Title: [Mod] More Statistics for your visitors
Post by: jdk on January 11, 2003, 08:35:52 PM
thank you soo much i forget to put stats.php in includes folder  again thank you  :oops:
Title: same thing happened to me!
Post by: wrestlingwiredotnet on January 11, 2003, 11:57:43 PM
haha! same thing happened to me jdk, lol
Title: Add new text section
Post by: criola on January 12, 2003, 01:12:36 PM
Quote from: Vraxor


http://haunter.student.utwente.nl/Terrarevolution/galleries/index.php

I saw this image gallery! can u tell me how ca I add the section "Gallery News /Webmaster Comment" ?

thanksssssssssss
Title: [Mod] More Statistics for your visitors
Post by: Chris on January 13, 2003, 04:39:57 AM
Just edit the home.html template
Title: thanks
Post by: criola on January 14, 2003, 12:43:18 AM
Thanks !!!!   :D

Cristina
Title: [Mod] More Statistics for your visitors
Post by: Biggi on January 25, 2003, 01:40:52 PM
Hi @ all,

I just tried to implement this mod and I followed each and every step, but it does not work. Nothing is shown at all  :cry:

Could it be possible, that the mod does not work with the script-version 1.7?

Has anybody managed it with this version?

I'm at a loss at this moment  :!:  :?:

Regards,

Biggi
Title: [Mod] More Statistics for your visitors
Post by: Biggi on January 25, 2003, 01:46:49 PM
Ha  :D

forget it. Just written, then checked and changed the index.php again and it works.

Thanks to Vraxor for this excellent mod!

Biggi
Title: [Mod] More Statistics for your visitors
Post by: sorestar on January 31, 2003, 03:53:43 PM
this is an excellent MOD but however it would be great if the stats would be able to intergrate with the forum, in which users able to use tags such as {new_post} as well as {total_users} ; etc.

anyway would this MOD able to use while the intergration of database of phpbb and 4images are mixed?

Thanks
 :roll:
Title: [Mod] More Statistics for your visitors
Post by: Vraxor on January 31, 2003, 09:15:30 PM
Hi Sorestar,

I have intergrated my site with PHPBB and it works fine.

Cheers,
Vraxor
Title: [Mod] More Statistics for your visitors
Post by: matthew on February 24, 2003, 11:40:37 PM
I like this mod, thanks for the hard work Vraxor!

Question though, is it me or does do the stats not get updated when an admin clicks, downloads, etc?

Meaning that the counters are updated fine when regular users click but when an admin to the site clicks they don't update.
Title: [Mod] More Statistics for your visitors
Post by: V@no on February 24, 2003, 11:52:11 PM
Quote from: matthew
I like this mod, thanks for the hard work Vraxor!

Question though, is it me or does do the stats not get updated when an admin clicks, downloads, etc?

Meaning that the counters are updated fine when regular users click but when an admin to the site clicks they don't update.

this is nothing to do with the mod. That how 4images works. Since admin probably spend alot of time on the site, why whould u like count him?
it's like to buy bread for dinner from your own bakery.... 8O  :wink:
Title: [Mod] More Statistics for your visitors
Post by: matthew on February 25, 2003, 12:20:00 AM
Thanks V@no.
Title: [Mod] More Statistics for your visitors
Post by: KleinerDrache on March 03, 2003, 08:07:10 PM
Hi,

kann man den Mod auch noch so erweitern das angezeigt wird wieviele Besucher heute da waren??
Title: [Mod] More Statistics for your visitors
Post by: Maweryk on March 06, 2003, 02:00:45 AM
Kann man auch die Anzahl Neuer Bilder in die Statistik mit aufnehmen???!!!
Was müsste man dafür ergänzen???
Habe das bei V@no auf seiner Seite gesehen.

Gruß

Markus
Title: [Mod] More Statistics for your visitors
Post by: V@no on March 06, 2003, 02:25:28 AM
Quote from: KleinerDrache
Hi,

kann man den Mod auch noch so erweitern das angezeigt wird wieviele Besucher heute da waren??

there is something simular:
http://4homepages.de/forum/viewtopic.php?t=4043
Title: stats on individual pictures in category view
Post by: ndj5 on March 13, 2003, 10:39:36 PM
vraxor,

I suck at codeing so i'm not sure where to put {total_users} {total_votes}{total_comments}{total_hits}{total_downloads} in my code to have individual stats come up for the pictures.  I'm not concearned about stats for the catagory as a whole, just the individual pictues in the category view (where 9 or 16 display at once).  Can you help me out?

ndj5
Title: stats on individual pictures in category view
Post by: ndj5 on March 13, 2003, 10:41:14 PM
vraxor,

I suck at codeing so i'm not sure where to put {total_users} {total_votes}{total_comments}{total_hits}{total_downloads} in my code to have individual stats come up for the pictures.  I'm not concearned about stats for the catagory as a whole, just the individual pictues in the category view (where 9 or 16 display at once).  Can you help me out?

ndj5
Title: [Mod] More Statistics for your visitors
Post by: rustynet on March 14, 2003, 12:03:55 PM
is it possible to showing this statistics at any page, not inside 4images?
Title: [Mod] More Statistics for your visitors
Post by: V@no on March 15, 2003, 12:15:16 AM
Quote from: boti
is it possible to showing this statistics at any page, not inside 4images?
Easiest way to do so is create new stats.php with this code:
Code: [Select]
<?php
//-----------------------------------------------------
//--- Show number of Users ----------------------------
//-----------------------------------------------------
   
$sql "SELECT COUNT(*) as users
          FROM "
.USERS_TABLE."
          WHERE user_id <> "
.GUEST;
  
$row $site_db->query_firstrow($sql);

  
$total_users "".$lang['users']."<B> ".$row['users']."</B>\n";

//-----------------------------------------------------
//--- Hits --------------------------------------------
//-----------------------------------------------------
   
$sql "SELECT SUM(image_hits) AS sum
          FROM "
.IMAGES_TABLE;
  
$row $site_db->query_firstrow($sql);

  
$sum = (isset($row['sum'])) ? $row['sum'] : 0;
  
$total_hits "".$lang['total_hits']."<B> ".$row['sum']."</B>\n";

//-----------------------------------------------------
//--- Votes -------------------------------------------
//-----------------------------------------------------
   
$sql "SELECT SUM(image_votes) AS sum
          FROM "
.IMAGES_TABLE;
  
$row $site_db->query_firstrow($sql);

  
$sum = (isset($row['sum'])) ? $row['sum'] : 0;
  
$total_votes "".$lang['total_votes']."<B> ".$row['sum']."</B>\n";

//-----------------------------------------------------
//--- Downloads ---------------------------------------
//-----------------------------------------------------
   
$sql "SELECT SUM(image_downloads) AS sum
          FROM "
.IMAGES_TABLE;
  
$row $site_db->query_firstrow($sql);

  
$sum = (isset($row['sum'])) ? $row['sum'] : 0;
  
$total_downloads "".$lang['total_downloads']."<B> ".$row['sum']."</B>\n";

//-----------------------------------------------------
//--- Comments ----------------------------------------
//-----------------------------------------------------
   
$sql "SELECT SUM(image_comments) AS sum
          FROM "
.IMAGES_TABLE;
  
$row $site_db->query_firstrow($sql);

  
$sum = (isset($row['sum'])) ? $row['sum'] : 0;
  
$total_comments "".$lang['total_comments']."<B> ".$row['sum']."</B>\n";
?>
upload it anywhere on your server, then insert this in the .php file u want it be displayed:
Code: [Select]
<?php
define
('ROOT_PATH''./4images/');
include(
ROOT_PATH.'global.php');
include(
'PATH_TO_NEW_STATS/stats.php');
?>
change PATH_TO_NEW_STATS to .... path to the new stats.php file  :?
after that, u have 5 variables that content the stats:
Code: [Select]
echo $total_users;or this:
Code: [Select]
<?=$total_users?>to print them on screen.
Title: [Mod] More Statistics for your visitors
Post by: rustynet on March 15, 2003, 08:49:07 AM
Thanks V@no  :D



boti
Title: [Mod] More Statistics for your visitors
Post by: jengwen on March 15, 2003, 04:51:36 PM
To see total images rated, add this to stats.php
Code: [Select]
//-----------------------------------------------------
//--- Ratings------------------------------------------
//-----------------------------------------------------
   $sql = "SELECT COUNT(image_rating) AS sum
          FROM ".IMAGES_TABLE.
          " WHERE image_rating > 0";
  $row = $site_db->query_firstrow($sql);

  $sum = (isset($row['sum'])) ? $row['sum'] : 0;
  $total_rating = "".$lang['total_rating']."<B> ".$row['sum']."</B>\n";
 
  $site_template->register_vars("total_rating", $total_rating);
unset($total_rating);


You will also have to add to main.php
Code: [Select]
$lang['total_rating'] = "Total Images Rated:";

You can now use {total_rating} in your templates.  Here is an example of mine:
Code: [Select]

<table width="450" border="0" cellspacing="0" cellpadding="1">
                    <tr>
                      <td class="head1">
                        <table width="100%" border="0" cellspacing="0" cellpadding="3">
                          <tr>
                            <td valign="top" class="head1">Gallery Statistics</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row2"> {total_users}<br>
                              {total_votes} <br>
                              {total_comments}<br>
                              {total_hits}<br>
                              {total_downloads}<br>
                              {total_rating} </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                    </table>


I tried to make this a template of its own, like whos_online, but couldn't get it to work.  I created it as a separate template called stats.html and added it to the templates used in index.php.  Nothing showed up, so I just hard-coded the html into my home and top templates.  This works, but isn't as nice, so if anyone has it working a cleaner way, could you please let me know what to do.
Title: [Mod] More Statistics for your visitors
Post by: rustynet on March 15, 2003, 06:45:49 PM
hey thats coll, thanks jengwen  :D


boti
Title: [Mod] More Statistics for your visitors
Post by: Maweryk on April 05, 2003, 03:35:02 PM
@v@no: Can U explain me how to extend the gallery stats to

- New Images
- Sent postcards
- ...

like on your website.

Thanks a lot and cheers,

Markus
Title: [Mod] More Statistics for your visitors
Post by: V@no on April 05, 2003, 07:01:45 PM
Quote from: Maweryk
@v@no: Can U explain me how to extend the gallery stats

I did it in a "dirty" way, messing up the USERS_TABLE...but then, Jan suggested me this:
Quote
Create a new table like this:
Code:
CREATE TABLE 4images_cat_stats (
  user_id mediumint(8) unsigned NOT NULL default '0',
  cat_id mediumint(8) unsigned NOT NULL default '0',
  cat_hits int(10) unsigned NOT NULL default '0',
  image_hits int(10) unsigned NOT NULL default '0',
  downloads int(10) unsigned NOT NULL default '0',
  postcards int(10) unsigned NOT NULL default '0',
  KEY user_id (user_id),
  KEY cat_id (cat_id)
) TYPE=MyISAM;

The fields user_id and cat_id are reference fields, the other fields contains the hit counts.

You can now store entries for each user_id depending on categories. User with ID 1 visits category with ID 1 the first time: The entry will be created and will be referenced on the user_id and cat_id. If the user visits category with ID 1 again, the entry will be updated depending on his user_id and the cat_id. If he visits category with ID 2, a new entry will be created with user_id = 1 and cat_id = 2. And so on...



You can pull infos about what you want. Relating on user_id's or cat_id's.

Examples:

Fetch 10 users most visited category with ID <cat_id>:
Code:
$sql = "SELECT u.user_id, u.user_name, cs.cat_hits, c.cat_name [...]
        FROM ".USERS_TABLE." u, ".CATEGORIES_TABLE." c, 4images_cat_stats cs
        WHERE cs.cat_id = <cat_id> AND u.user_id = c.user_id AND c.cat_id = cs.cat_id
        ORDER BY cs.cat_hits DESC
        LIMIT 10";

$site_db->query($sql);  


Fetch 10 categories who are most visited by user with ID <user_id>:
Code:
$sql = "SELECT u.user_id, u.user_name, cs.cat_hits, c.cat_name [...]
        FROM ".USERS_TABLE." u, ".CATEGORIES_TABLE." c, 4images_cat_stats cs
        WHERE cs.user_id = <user_id> AND c.cat_id = cs.cat_id AND u.user_id = cs.user_id
        ORDER BY cs.cat_hits DESC
        LIMIT 10";

$site_db->query($sql);  

Jan


I will try do this way somethimes soon, if I successed, I might post it as MOD here ;)
Title: [Mod] More Statistics for your visitors
Post by: Maweryk on April 24, 2003, 04:07:49 PM
Quote from: V@no
Quote from: Maweryk
@v@no: Can U explain me how to extend the gallery stats

I did it in a "dirty" way, messing up the USERS_TABLE...but then, Jan suggested me this:
Quote
Create a new table like this:
Code:
CREATE TABLE 4images_cat_stats (
  user_id mediumint(8) unsigned NOT NULL default '0',
  cat_id mediumint(8) unsigned NOT NULL default '0',
  cat_hits int(10) unsigned NOT NULL default '0',
  image_hits int(10) unsigned NOT NULL default '0',
  downloads int(10) unsigned NOT NULL default '0',
  postcards int(10) unsigned NOT NULL default '0',
  KEY user_id (user_id),
  KEY cat_id (cat_id)
) TYPE=MyISAM;

The fields user_id and cat_id are reference fields, the other fields contains the hit counts.

You can now store entries for each user_id depending on categories. User with ID 1 visits category with ID 1 the first time: The entry will be created and will be referenced on the user_id and cat_id. If the user visits category with ID 1 again, the entry will be updated depending on his user_id and the cat_id. If he visits category with ID 2, a new entry will be created with user_id = 1 and cat_id = 2. And so on...



You can pull infos about what you want. Relating on user_id's or cat_id's.

Examples:

Fetch 10 users most visited category with ID <cat_id>:
Code:
$sql = "SELECT u.user_id, u.user_name, cs.cat_hits, c.cat_name [...]
        FROM ".USERS_TABLE." u, ".CATEGORIES_TABLE." c, 4images_cat_stats cs
        WHERE cs.cat_id = <cat_id> AND u.user_id = c.user_id AND c.cat_id = cs.cat_id
        ORDER BY cs.cat_hits DESC
        LIMIT 10";

$site_db->query($sql);  


Fetch 10 categories who are most visited by user with ID <user_id>:
Code:
$sql = "SELECT u.user_id, u.user_name, cs.cat_hits, c.cat_name [...]
        FROM ".USERS_TABLE." u, ".CATEGORIES_TABLE." c, 4images_cat_stats cs
        WHERE cs.user_id = <user_id> AND c.cat_id = cs.cat_id AND u.user_id = cs.user_id
        ORDER BY cs.cat_hits DESC
        LIMIT 10";

$site_db->query($sql);  

Jan


I will try do this way somethimes soon, if I successed, I might post it as MOD here ;)


Short question! Do U have finished the mod???

Thanks!!!

Cheers,

Markus
Title: [Mod] More Statistics for your visitors
Post by: V@no on April 24, 2003, 04:17:37 PM
Quote from: Maweryk

Short question! Do U have finished the mod???

Sorry, no. After all I did to my database and 4images code itself I dont know what is what anymore. Maybe after major cleaning up or starting everything over, I will try finish with this one.
Title: [Mod] More Statistics for your visitors
Post by: Bomba on May 02, 2003, 11:41:26 PM
how can i have stats like this?

http://www.newman.d2g.com/index.php?template=sitestats
they look great!
Title: [Mod] More Statistics for your visitors
Post by: Chris on May 03, 2003, 12:04:44 AM
Yes and no.  Those stats are a combination of this mod and from a logging tool called pphlogger from www.phpee.com
Title: help please
Post by: tmacisnbr1 on May 17, 2003, 12:17:05 AM
hello

ive done everything correct i think, but im not sure where to add the tags or how to add them in the html files. When i add the tags, i guess i add them to the wrong place, because when i go to the site, it just gives some weird number, like "total downloads: 5738" or something. Can anyone please help?
Title: [Mod] More Statistics for your visitors
Post by: www.girls-on-bikes.com on June 01, 2003, 01:21:59 AM
Hello All,
This looks like a great mod, but I wanna include it on every page on my nav bar (click on link below, you will see the "Site Statistics" section where I want them).

Problem is the templating I'm using uses a file called 4gmenu.php, which is included on all pages and I am able to add things to that file and have them show up on every page (the "Navigation" and "Sponsors" sections are stored in this file).

Is there any way I can have the stats in this file too?
When I try to include stats.php in 4gmenu.php, I get this error:
Quote
Fatal error: Call to a member function on a non-object in /home/gob/public_html/new/gallery/includes/stats.php on line 9

Line 9 contains:
Code: [Select]
$row = $site_db->query_firstrow($sql);

Anybody have any ideas what the problem is?
Thanks!
Title: [Mod] More Statistics for your visitors
Post by: V@no on June 01, 2003, 01:49:20 AM
try add this before your stats.php include:
Code: [Select]
define('ROOT_PATH', './');
@include(ROOT_PATH.'config.php');
include(ROOT_PATH.'includes/constants.php');
include(ROOT_PATH.'includes/db_'.strtolower($db_servertype).'.php');
$site_db = new Db($db_host, $db_user, $db_password, $db_name);
Title: [Mod] More Statistics for your visitors
Post by: www.girls-on-bikes.com on June 01, 2003, 01:52:37 AM
New Error:
Quote
Fatal error: Cannot redeclare class db in /home/gob/public_html/new/gallery/includes/db_mysql.php on line 28
Title: [Mod] More Statistics for your visitors
Post by: V@no on June 01, 2003, 01:59:04 AM
I ment inside 4gmenu.php ....?
Title: [Mod] More Statistics for your visitors
Post by: www.girls-on-bikes.com on June 01, 2003, 02:11:36 AM
Yep, that's inside 4gmenu.php
Title: [Mod] More Statistics for your visitors
Post by: V@no on June 01, 2003, 02:52:19 AM
ah, yes...sorry, my bad...

are u sure line 9 is $row = $site_db->query_firstrow($sql); ?
Title: [Mod] More Statistics for your visitors
Post by: www.girls-on-bikes.com on June 01, 2003, 03:38:45 AM
Yes, I am positive the error is occuring from that line.
Title: [Mod] More Statistics for your visitors
Post by: www.girls-on-bikes.com on June 03, 2003, 05:41:43 AM
Just to follow up, here's what I had to do to get site stats on every page (you can check them out by clicking on my link in my sig):

First I had to drop the stats.php include statement into every php files.

Then in all .html template files, I had to do:
Code: [Select]
<?php 
    $total_users2 
"&#123;total_users&#125;";
    
$total_votes2 "&#123;total_votes&#125;"
    
$total_comments2 "&#123;total_comments&#125;";
    
$total_hits2 "&#123;total_hits&#125;"
    
$total_downloads2 "&#123;total_downloads&#125;";
    include&
#40;"4gmenu.php"&#41;;
?>



Then in my 4gmenu.php, I had:

Code: [Select]
<?php
    
print $total_users2."<br>";
    print 
$total_votes2."<br>";
    print 
$total_hits2."<br>";
    print 
$total_comments2."<br>";
    print 
$total_downloads2."<br>";
?>



I know, it's sort of an ugly hack, but since the template I have includes a php file for the menu system, I had to do this.
Just wanted to let ya'll know in case anybody else ran into a similar problem.[/code]
Title: [Mod] More Statistics for your visitors
Post by: V@no on June 03, 2003, 05:46:18 AM
Quote from: www.girls-on-bikes.com
Then in all .html template files, I had to do:
if u already do that way, why dont u just use those tags and insert your stats directly into EACH template? why do u need include them into 4gmenu.php ??? it's just waste of time and perfomance.
Title: [Mod] More Statistics for your visitors
Post by: www.girls-on-bikes.com on June 03, 2003, 05:49:09 AM
<rant>Because I don't like how we have to edit XX files just to get something to appear in the menu bar.  I am a fan of editing one file and having the changes appear on every page.</rant>

And the only way I could pass those {...} variables into my 4gmenu.php include file was to do the above.
Title: [Mod] More Statistics for your visitors
Post by: V@no on June 03, 2003, 05:53:03 AM
yes, but u already have to edit all files....that's my point ;)
and still if in the feature u want to change something in those stats, u'll need edit all files again...
Title: [Mod] More Statistics for your visitors
Post by: www.girls-on-bikes.com on June 03, 2003, 06:05:00 AM
Yes, but I have set it up for minimal editing.
All I did was set some variables, so the only time I would need to go back through and change something is if I change a variable name, or add a new one.

If I want to change the look and feel of how they are displayed, I edit 1 file ;)
Title: [Mod] More Statistics for your visitors
Post by: Apollo13 on June 22, 2003, 10:00:00 PM
OK 4 all who want 2 display the last 5 resgisterd members.

Code: [Select]

//-----------------------------------------------------
//--- New Member --------------------------------------
//-----------------------------------------------------
   $sql = "SELECT user_id, user_name FROM ".USERS_TABLE."
          WHERE user_id > ".USER_AWAITING."
          ORDER by user_joindate DESC
          LIMIT 5";
  $result = $site_db->query($sql);

    while ($row = $site_db->fetch_array($result)) {
    $user_new_member_list .= '<img border="0" src="templates/1/images/arrow_icon.gif"> <a href ="'.ROOT_PATH.'member.php?action=showprofile&user_id='.$row['user_id'].'"><b>'.$row['user_name'].'</b></a><br>';
    }

$user_new_member_box = $site_template->parse_template("user_new_member_box");
$site_template->register_vars(array(
  "user_new_member_box" => $user_new_member_box,
  "user_new_member_list" => $user_new_member_list
));
  unset($user_new_member_box);
  unset($user_new_member_list);


create a new template called user_new_member_box.html and put {user_new_member_list} somewhere in.
Title: [Mod] More Statistics for your visitors
Post by: effemmess on June 28, 2003, 03:50:27 AM
Hi,

I´ve rewrote the stats.php for various reasons,in particular due to the non-standard db-tables. Plz look in this thread:http://www.4homepages.de/forum/viewtopic.php?t=6484 But there is my text in german, because i had not the time to translate it. Plz use google-tools! :wink: possibly I do later the translation...
Plz say me your opinion about the mod!
bye
Title: Re: [Mod] More Statistics for your visitors
Post by: bentleykf on May 02, 2005, 01:35:21 PM
ummm, was the variable $sum intended to be used in any instance?

for example;
Code: [Select]
$sum = (isset($row['sum'])) ? $row['sum'] : 0;
 $total_hits = "".$lang['total_hits']."<B> ".$row['sum']."</B>\n";

should it not be;
Code: [Select]
$sum = (isset($row['sum'])) ? $row['sum'] : 0;
 $total_hits = "".$lang['total_hits']."<B> ". $sum."</B>\n";
Title: Re: [Mod] More Statistics for your visitors
Post by: artpics on May 03, 2005, 03:09:34 AM
upload it anywhere on your server, then insert this in the .php file u want it be displayed:

Code: [Select]
<?php
define
&#40;'ROOT_PATH', './4images/'&#41;;
include&#40;ROOT_PATH.'global.php'&#41;;
include&#40;'PATH_TO_NEW_STATS/newstats.php'&#41;;
?>



change PATH_TO_NEW_STATS to .... path to the new stats.php file   
after that, u have 5 variables that content the stats:

$total_users
$total_hits
$total_votes
$total_downloads
$total_comments[/list:u]
u can use this:
Code:
echo $total_users;
or this:
Code:
<?=$total_users?>
to print them on screen.
Code:

have done the first part but haveing trouble printing the stats  it says
"upload it anywhere on your server, then insert this in the .php file u want it be displayed:"

 i want it to display on a html file but does not work
Title: Re: [Mod] More Statistics for your visitors
Post by: V@no on May 03, 2005, 03:11:09 AM
please use bbcode if u post a code and check the syntax of the code u've posted,
Code: [Select]
define&#40;'ROOT_PATH', './gallery/'&#41;;
doesnt looks right.
Title: Re: [Mod] More Statistics for your visitors
Post by: artpics on May 03, 2005, 04:08:14 AM
my 4 images is inside a folder called gallery

so i insert this into my html file outside 4images

Code: [Select]
<?php
define
&#40;'ROOT_PATH', './4images/'&#41;;
include&#40;ROOT_PATH.'global.php'&#41;;
include&#40;'PATH_TO_NEW_STATS/newstats.php'&#41;;
?>

then on the html page i want to show the stats i insert this

tag
<?=$total_users?>

is this correct thanks  :D
Title: Re: [Mod] More Statistics for your visitors
Post by: V@no on May 03, 2005, 04:20:09 AM
no, the syntax is not correct, try it yourself ;) u'll get parse error.
Title: Re: [Mod] More Statistics for your visitors
Post by: artpics on May 03, 2005, 04:53:59 AM
sorry veno do not understand syntax , will try tomorrow after some sleep
Title: Re: [Mod] More Statistics for your visitors
Post by: callimero on May 12, 2005, 02:45:37 PM
hallo,
habe glaube ich alles so gemacht wie beschrieben, bekomme aber auf meiner seite fehlermeldungen www.netzpfosten.de und dann auf fotos.

was habe ich falsch gemacht ?
Title: Re: [Mod] More Statistics for your visitors
Post by: callimero on May 12, 2005, 03:09:10 PM
hmmm......habe es jetzt nochmal gemacht. jetzt sind die fehlermeldungen weg, aber man sieht die statistiken auch nicht ?!
Title: Re: [Mod] More Statistics for your visitors
Post by: bikoo on May 29, 2005, 09:07:07 AM
thnx alooot its work wiz me 100%  :D
Title: Re: [Mod] More Statistics for your visitors
Post by: jamstave on June 10, 2005, 06:49:26 AM
Hi..I want to add some more statistics in my statistics details, please help me to do like this.

Total Votes: 2411
Total Members: 957
Total Hits: 2065645
Total Images: 16487
Total Categories:  246
Total Downloads: 111766

my code like this

{total_votes}<br>
{total_users}<br>
{total_hits}<br>
{total_images}br>
{total_categories}<br>
{total_downloads}

My statistics show's like this

Total Votes: 281
Total Members: 97
Total Hits: 10645
887
26
Total Downloads: 1856

Please help me to add Total Images and Total Categories.

Jamstave.
Title: Re: [Mod] More Statistics for your visitors
Post by: V@no on June 10, 2005, 06:56:24 AM
a good start would be if u showed us what is the code u use for {total_images} and {total_categories} tags
Title: Re: [Mod] More Statistics for your visitors
Post by: jamstave on June 10, 2005, 07:25:29 AM
Hi..V@no thanks for the reply and i didn't edit any php code i just put this tag({total_images},{total_categories) in the home.html
I got that tag from main.php
$lang['site_stats'] = "<b>{total_images}</b> images in <b>{total_categories}</b> categories.";

Jamstave.
Title: Re: [Mod] More Statistics for your visitors
Post by: DreamStatic on June 28, 2005, 05:56:02 AM
Okay, been trying to get this to work properly. And I am not having much luck. Does this mod work with 1.7.1? I have followed the instructions again and again. Thought maybe it was the 1.7.1 version that was causing the trouble. Thanks so much.
Title: Re: [Mod] More Statistics for your visitors
Post by: Mixi on August 10, 2005, 02:46:51 AM
Does this work with 1.71 ? or do I have to change a different file?
Title: Re: [Mod] More Statistics for your visitors
Post by: artpics on August 10, 2005, 03:16:37 AM
Does this work with 1.71 ? or do I have to change a different file?

yes it does work with V1.71
Title: Re: [Mod] More Statistics for your visitors
Post by: Mixi on August 10, 2005, 09:36:52 AM
This worked perfect for what I wanted. thanks
Title: Re: [Mod] More Statistics for your visitors
Post by: Mixi on August 11, 2005, 02:18:53 AM
Everything seemed to work fine until I noticed the total image hits, it only gives me the hits for the top 5 categories not the entire site.

Heres my line if it will help.
http://www.757lab.com/Wallpapers
Title: Re: [Mod] More Statistics for your visitors
Post by: Mixi on August 12, 2005, 01:53:04 AM
Plz can somebody help, cuz its only the total hits for the 5 top images and not all of the images. Plz help
Title: Re: [Mod] More Statistics for your visitors
Post by: TheOracle on August 15, 2005, 11:33:20 PM
Since the category votes is now developped :

http://www.4homepages.de/forum/index.php?topic=9297.0

and can be customized with this one - this is what you have to do for those who did installed it :

// Installation step :

In your stats.php file,

find :

Quote

//-----------------------------------------------------
//--- Votes -------------------------------------------
//-----------------------------------------------------
$sql = "SELECT SUM(image_votes) AS sum
         FROM ".IMAGES_TABLE;
 $row = $site_db->query_firstrow($sql);

 $sum = (isset($row['sum'])) ? $row['sum'] : 0;
 $total_votes = "".$lang['total_votes']."<B> ".$row['sum']."</B>\n";
 
 $site_template->register_vars("total_votes", $total_votes);
unset($total_votes);


replace with :

Code: [Select]

//-----------------------------------------------------
//--- Image Votes -------------------------------------------
//-----------------------------------------------------
$sql = "SELECT SUM(image_votes) AS sum
         FROM ".IMAGES_TABLE;
 $row = $site_db->query_firstrow($sql);

 $sum = (isset($row['sum'])) ? $row['sum'] : 0;
 $total_votes = "".$lang['total_votes']."<B> ".$row['sum']."</B>\n";
 
 $site_template->register_vars("total_votes", $total_votes);
unset($total_votes);

//-----------------------------------------------------
//--- Category Votes -------------------------------------------
//-----------------------------------------------------
$sql = "SELECT SUM(cat_votes) AS sum
         FROM ".CATEGORIES_TABLE;
 $row = $site_db->query_firstrow($sql);

 $sum = (isset($row['sum'])) ? $row['sum'] : 0;
 $total_cat_votes = "".$lang['total_votes']."<B> ".$row['sum']."</B>\n";
 
 $site_template->register_vars("total_cat_votes", $total_cat_votes);
unset($total_cat_votes);


Then, in your template, simply add : {total_cat_votes} and you'll be able to see your total cat votes results. ;)
Title: Re: [Mod] More Statistics for your visitors
Post by: TheOracle on September 03, 2005, 10:49:43 PM
For users who installed this MOD :

http://www.4homepages.de/forum/index.php?topic=9567.0

Follow the steps below if you wish to combine it with the More Stats MOD.

In your includes/stats.php file,

find :

Quote

//-----------------------------------------------------
//--- Hits --------------------------------------------
//-----------------------------------------------------
$sql = "SELECT SUM(image_hits) AS sum
         FROM ".IMAGES_TABLE;
 $row = $site_db->query_firstrow($sql);

 $sum = (isset($row['sum'])) ? $row['sum'] : 0;
 $total_hits = "".$lang['total_hits']."<B> ".$row['sum']."</B>\n";

 $site_template->register_vars("total_hits", $total_hits);
unset($total_hits);


add below :

Code: [Select]

//-----------------------------------------------------
//--- Profile Hits ------------------------------------
//-----------------------------------------------------
$sql = "SELECT SUM(profile_hits) AS sum
         FROM ".USERS_TABLE;
 $row = $site_db->query_firstrow($sql);

 $sum = (isset($row['sum'])) ? $row['sum'] : 0;
 $profile_hits = "".$lang['profile_hits']."<B> ".$row['sum']."</B>\n";

 $site_template->register_vars("profile_hits1", $profile_hits);
unset($profile_hits);


Then, in your current template,

add this tag :

Code: [Select]

{profile_hits1}


as part of the others.

It should work. ;)
Title: Re: [Mod] More Statistics for your visitors
Post by: TomYork on September 15, 2005, 06:52:43 AM
:arrow: How can I view the number of images and categories in this stats system :?:  :oops: :mrgreen:
Title: Re: [Mod] More Statistics for your visitors
Post by: TheOracle on September 15, 2005, 11:14:46 AM
I posted this two threads above.  :?
Title: Re: [Mod] More Statistics for your visitors
Post by: TomYork on September 16, 2005, 03:48:05 AM
I posted this two postd above.  :?

???
Title: Re: [Mod] More Statistics for your visitors
Post by: TheOracle on September 16, 2005, 11:28:32 AM
http://www.4homepages.de/forum/index.php?topic=3303.msg44129#msg44129
Title: Re: [Mod] More Statistics for your visitors
Post by: TomYork on September 16, 2005, 06:42:20 PM
http://www.4homepages.de/forum/index.php?topic=3303.msg44129#msg44129

But in your post u put Category and Images Votes, I need the total of images and categories of my gallery
Title: Re: [Mod] More Statistics for your visitors
Post by: TheOracle on September 16, 2005, 09:19:36 PM
I thought this was already integrated in the MOD. I guess this is something I will have to look at. ;)
Title: Re: [Mod] More Statistics for your visitors
Post by: TomYork on September 16, 2005, 10:57:07 PM
I thought this was already integrated in the MOD. I guess this is something I will have to look at. ;)

jejeje..  can u help me with the code but without votes?
Title: Re: [Mod] More Statistics for your visitors
Post by: TheOracle on September 16, 2005, 11:00:45 PM
I believe I already answered that question.  :?
Title: Re: [Mod] More Statistics for your visitors
Post by: IWS_steffen on September 25, 2005, 04:41:02 AM
Hi

This Mod works perfect ... great !!! 

Many thanks   

coooool

Steffen
Title: Re: [Mod] More Statistics for your visitors
Post by: Nasser on October 27, 2005, 11:39:25 AM
nice MOD .. working ..thanks
Title: How to change number of pics in the statistics? / Wie Anzahl der Bilder ändern?
Post by: berlinfotos on January 05, 2006, 01:43:33 PM
Hello.

I would like to change the number of images, my statistic display. Now it shows the "top 10" of each image/kategory/download whatsoever.

I would like to increase the number to 20 or so, but I cannot finde this 10 that i - suppose - need to change.

Thanks a lot in advance. Here my stats.php, but I think the number might be hidden elsewhere?
Title: Re: [Mod] More Statistics for your visitors
Post by: mawenzi on January 05, 2006, 02:37:04 PM
@ berlinfotos

... der Code deiner admin/stats.php hat absolut nichts mit diesem MOD zu tun ... :!:
... bitte entferne die Codezeilen aus deinem Post, um anderen Usern Irritationen zu ersparen ... :!:

Wenn du in deinem ACP auf der Startseite die Anzeige der Statistik von 5 (oder 10) auf 20 erhöhen willst, dann finde in admin/home.php folgende Codezeile gleich am Anfang :
Code: [Select]
$stats_limit = 5;
und ersetze sie durch :
Code: [Select]
$stats_limit = 20;

mawenzi
Title: Re: [Mod] More Statistics for your visitors
Post by: berlinfotos on January 10, 2006, 03:56:48 PM
@ berlinfotos

... der Code deiner admin/stats.php hat absolut nichts mit diesem MOD zu tun ...  :!:
... bitte entferne die Codezeilen aus deinem Post, um anderen Usern Irritationen zu ersparen ...   :evil: :!:

Sorry, mawenzi,
wollte hier keinen ärgern, ich nahm als Laie nur an, dass ich für die Statistik was in der stats.php ändere.
Mit deinem Tipp hat das ganz einfach geklappt, danke.

Robert
Title: Re: [Mod] More Statistics for your visitors
Post by: mawenzi on January 10, 2006, 05:41:28 PM
... Mit deinem Tipp hat das ganz einfach geklappt, danke. ...

... na dann ist ja alles bestens ...  :wink:
mawenzi
Title: Re: [Mod] More Statistics for your visitors
Post by: maninblue on January 29, 2006, 02:03:05 PM
This is perfectly right mod that i want thanks alot:)
Title: Re: [Mod] More Statistics for your visitors
Post by: Stoleti on January 30, 2006, 09:46:30 PM
I'm using a MOD (Files List 1.3) by V@no , and i want know how can i added the number of files on STATS !?

Total Files : XX

 :?:
Title: Re: [Mod] More Statistics for your visitors
Post by: Stoleti on January 31, 2006, 02:11:29 AM
I'm using a MOD (Files List 1.3) by V@no , and i want know how can i added the number of files on STATS !?

Total Files : XX

 :?:

And make it only for Admin / Reg. Members  :?
Title: Re: [Mod] More Statistics for your visitors
Post by: lemccoy on February 10, 2006, 08:06:22 PM
I have the guestbook mod and i have made a counter for the number of guestbook entries:

Code: [Select]
//-----------------------------------------------------
//--- Guestbook Signatures-----------------------------
//-----------------------------------------------------
$sql = "SELECT SUM(comment_id) AS sum
         FROM ".GUESTBOOK_TABLE;
 $row = $site_db->query_firstrow($sql);

 $sum = (isset($row['sum'])) ? $row['sum'] : 0;
 $total_signatures = "".$lang['total_signatures']."<B> ".$row['sum']."</B>\n";
 
 $site_template->register_vars("total_signatures", $total_signatures);
unset($total_signatures);

With the corresponding language and calls etc.  However, when it counts it counts deleted posts as there.  I know because I made an entry, deleted it, made another entry.  It now says there are 2 instead of 1.  Is there a better variable to count than the "comment_id"?
Title: Re: [Mod] More Statistics for your visitors
Post by: IcEcReaM on February 10, 2006, 09:39:47 PM
Code: [Select]
//-----------------------------------------------------
//--- Guestbook Signatures-----------------------------
//-----------------------------------------------------
$sql = "SELECT COUNT(comment_id) AS sum
         FROM ".GUESTBOOK_TABLE;
$row = $site_db->query_firstrow($sql);

$sum = (isset($row['sum'])) ? $row['sum'] : 0;
$total_signatures = "".$lang['total_signatures']."<B> ".$row['sum']."</B>\n";

$site_template->register_vars("total_signatures", $total_signatures);
unset($total_signatures);

you should use COUNT instead of SUM,
so the number of entries is outputed and not the sum of the comment_id.
Title: Re: [Mod] More Statistics for your visitors
Post by: lemccoy on February 10, 2006, 09:57:17 PM
Great, that works.  Thanks.
Title: Re: [Mod] More Statistics for your visitors
Post by: fish4carp on April 14, 2006, 08:42:37 PM
Hi

Where abouts do I place the following below in the home.html, categories.html, lightbox.html & top.html, Thanks.  :D

Gallery Statistics
{total_users}
{total_votes}
{total_comments}
{total_hits}
{total_downloads}
{total_rating}
Title: Re: [Mod] More Statistics for your visitors
Post by: IWS_steffen on April 17, 2006, 10:31:21 AM
toller MOD

klappt alles super. Danke

Gruüsse aus Hamburg

Steffen
Title: Re: [Mod] More Statistics for your visitors
Post by: fish4carp on April 17, 2006, 11:25:48 AM
To Vraxor

Please can you tell me how you edited your home.html etc so it shows the Site Statistics
 like you have them.

Thanks
Title: Re: [Mod] More Statistics for your visitors
Post by: Zyga on May 19, 2006, 09:44:08 PM
meybe someone could help me show number of registered users only for admin ?
Title: total images?
Post by: mstgokcen on July 21, 2006, 10:14:25 AM
is anyone put this code to show total images...I get the code total categories but still there is no code for total images...
Title: Re: [Mod] More Statistics for your visitors
Post by: CharlieF. on July 26, 2006, 05:37:34 PM
Hi,
the mod works great.

The only thing is that the stats won't show up on the details, member and search sites.

Here's how i tried to implement it:
Code: [Select]
<table width="100%" border="0" cellspacing="0" cellpadding="0">
   <tr>
   <td class="head1">
   <table width="100%" border="0" cellspacing="0" cellpadding="3">
    <tr>
    <td class="head1" valign="top" background="{template_url}/images/top_bg.gif">Statistik</td>
    </tr>
    <tr>
    <td class="row2" valign="top">
{total_users} <br />
{total_votes} <br />
{total_comments} <br />
{total_hits} <br />
{total_downloads} <br /></td>
    </tr>
   </table>
   </td>
   </tr>
  </table>

The strange thing is that "Statistik" is displayed on every page just the stats themselves do not.
I'd appreciate any help.

regards
Charlie
Title: Re: [Mod] More Statistics for your visitors
Post by: mawenzi on July 26, 2006, 06:13:23 PM
@ CharlieF.
... you must insert the following in your details.php, member.php a.s.o ...
Code: [Select]
include(ROOT_PATH.'includes/stats.php');
Title: Re: [Mod] More Statistics for your visitors
Post by: CharlieF. on July 26, 2006, 06:33:15 PM
Thanks mawenzi.
For some reason i just forgot that in these files.
Again, thanks alot :D
Title: Re: total images?
Post by: mstgokcen on July 27, 2006, 12:15:41 PM
is anyone put this code to show total images...I get the code total categories but still there is no code for total images...


how can we see total images?
Title: Re: [Mod] More Statistics for your visitors
Post by: mawenzi on July 27, 2006, 02:06:15 PM
@ mstgokcen

... all total images on index ...  :wink:
... in stats.php use this ...
Code: [Select]
//-----------------------------------------------------
// --- All total images -----
//-----------------------------------------------------
  $sql = "SELECT COUNT(*) AS all_total_images
          FROM ".IMAGES_TABLE."
          WHERE image_active = 1";
  $row = $site_db->query_firstrow($sql);
  $all_total_images = $row['all_total_images'];
  $lang_all_total_images = $lang['all_total_images'];
  $site_template->register_vars("all_total_images", $all_total_images);
  $site_template->register_vars("lang_all_total_images", $lang_all_total_images);
  unset($all_total_images);
  unset($lang_all_total_images);
//-----------------------------------------------------

... in /lang/<your_lang>/main.php use this ...
Code: [Select]
$lang['all_total_images'] = "Total Images :";

... now you can use in home.html this tags ...
Code: [Select]
{lang_all_total_images} {all_total_images}
Title: Re: [Mod] More Statistics for your visitors
Post by: mstgokcen on July 27, 2006, 03:22:22 PM
tnx a lot it is ok
Title: Re: [Mod] More Statistics for your visitors
Post by: ccsakuweb on August 12, 2006, 11:53:38 AM
the demo doesn´t run.. where could i see a demo plz?
Title: Re: [Mod] More Statistics for your visitors
Post by: mawenzi on August 12, 2006, 05:27:47 PM
... e.g. here (http://klick.kl.funpic.de/index.php) ...  :wink:
Title: Re: [Mod] More Statistics for your visitors
Post by: ccsakuweb on August 12, 2006, 05:59:53 PM
ok!thanks a lot

your gallery is too nice ^^
Title: Re: [Mod] More Statistics for your visitors
Post by: tansamalaja on August 24, 2006, 07:47:26 PM
And how can we see total categories?
Title: Re: [Mod] More Statistics for your visitors
Post by: mawenzi on August 24, 2006, 07:58:15 PM
@ tansamalaja

... all total categories on index ...  :wink:
... in stats.php use this ...
Code: [Select]
//-----------------------------------------------------
// --- All total categories -----
//----------------------------------------------------- 
  $sql = "SELECT COUNT(*) AS all_total_categories
          FROM ".CATEGORIES_TABLE;
  $row = $site_db->query_firstrow($sql);

  $all_total_categories = $row['all_total_categories'];
  $lang_all_total_categories = $lang['all_total_categories'];
 
  $site_template->register_vars("all_total_categories", $all_total_categories);
  $site_template->register_vars("lang_all_total_categories", $lang_all_total_categories);
  unset($all_total_categories);
  unset($lang_all_total_categories);

... in /lang/<your_lang>/main.php use this ...
Code: [Select]
$lang['all_total_categories'] = "All Categories :";

... now you can use in home.html this tags ...
Code: [Select]
{lang_all_total_categories} {all_total_categories}
Title: Re: [Mod] More Statistics for your visitors
Post by: tansamalaja on August 24, 2006, 09:17:14 PM
@mawenzi(http://www.brianpeschke.de/pics/smilies/anbeten rechts.gif)
Title: Re: [Mod] More Statistics for your visitors
Post by: tansamalaja on August 24, 2006, 10:25:44 PM
Ich hätte gerne die Anzahl in Fettdruck, ich bekomme das nicht so recht hin (Stichwort Fehlermeldung)
Title: Re: [Mod] More Statistics for your visitors
Post by: mawenzi on August 24, 2006, 10:34:15 PM
... try this simple solution ...  :wink:
Code: [Select]
{lang_all_total_categories} <b>{all_total_categories}</b>
Title: Re: [Mod] More Statistics for your visitors
Post by: tansamalaja on August 24, 2006, 10:40:16 PM
That's a way too..

I've tried it in the stats.php and had no success...  :cry:
Title: Re: [Mod] More Statistics for your visitors
Post by: macmaster_it on August 25, 2006, 08:14:14 PM
It's a nice MOD and work's fine.
Now I want to show how many times mi site is visited.
But I don't know how make it....
Help me please.

Thank's ron.
Title: Re: [Mod] More Statistics for your visitors
Post by: HorrorCrafT on September 21, 2006, 09:58:01 AM
nice stats info. thx! :D last question: how can i display "media directory: xxx MB" and "thumbnail directory: xxx MB" in home.html? thanks for help!!
Title: Re: [Mod] More Statistics for your visitors
Post by: colorssky on September 21, 2006, 04:29:40 PM
is it working on Version: 1.7.3 ?
Title: Re: [Mod] More Statistics for your visitors
Post by: haythamghareeb on October 22, 2006, 02:18:29 AM
People keep asking how and where to put the code into the HTML pages but NO one answers...How come? Why can't someone just say where to put the code?? :evil:
Title: Re: [Mod] More Statistics for your visitors
Post by: haythamghareeb on October 22, 2006, 02:43:55 AM
Worked for me...after a while because I am no coder
Title: Re: [Mod] More Statistics for your visitors
Post by: vuong184 on January 28, 2007, 09:43:07 AM
Parse error: parse error, unexpected T_STRING in /home2/vuong184/public_html/gallery/includes/stats.php on line 2
http://emtoi.org/gallery/
Help me
Title: Re: [Mod] More Statistics for your visitors
Post by: tansamalaja on January 29, 2007, 01:38:54 PM
Poste doch mal die Zeilen 1-5 aus deiner stats.php, aber sow ie ich das sehe, hast du ein "/" zuviel in Zeile 2, vielleicht ist es ja aus Zeile 3 dort hinein gerutscht...

Send us lines 1-5 of your stats.php. I think you have an "/" too much in line 2, perhaps it belongs in line 3...
Title: Re: [Mod] More Statistics for your visitors
Post by: Foto-Portal on February 06, 2007, 12:14:44 PM
works fine.. thanks!!!!  :wink: :wink: :wink: :wink: :wink: :wink: :P :P :P :P

Hi all,

I did already forgot about this little modification I did. I was in fact the first little mod I did ever in PHP.

The idea is to show more statistics then the number of images and categories (which are shown by default).
This MOD will show:
- Number of Members
- Number of Image Votes
- Number of Image Hits
- Number of Image Comments
- Number of Image Downloads

All these are shown on totals, so it shows the total number of image hits over all images. You can see an example of it here: http://haunter.student.utwente.nl/Terrarevolution/galleries/index.php

// Ok, now lets get started

Creating the stats.php file
Make a new file called: stats.php
Save this empty file in the includes folder of 4images
Open stats.php with any code editor you like.

and copy past the following to your stats.php:
Code: [Select]
<?PHP

//-----------------------------------------------------
//--- Show number of Users ----------------------------
//-----------------------------------------------------
   $sql = "SELECT COUNT(*) as users
          FROM ".USERS_TABLE."
          WHERE user_id <> ".GUEST;
  $row = $site_db->query_firstrow($sql);

  $total_users = "".$lang['users']."<B> ".$row['users']."</B>\n";
 
  $site_template->register_vars("total_users", $total_users);
unset($total_users);

//-----------------------------------------------------
//--- Hits --------------------------------------------
//-----------------------------------------------------
$sql = "SELECT SUM(image_hits) AS sum
          FROM ".IMAGES_TABLE;
  $row = $site_db->query_firstrow($sql);

  $sum = (isset($row['sum'])) ? $row['sum'] : 0;
  $total_hits = "".$lang['total_hits']."<B> ".$row['sum']."</B>\n";
 
  $site_template->register_vars("total_hits", $total_hits);
unset($total_hits);

//-----------------------------------------------------
//--- Votes -------------------------------------------
//-----------------------------------------------------
$sql = "SELECT SUM(image_votes) AS sum
          FROM ".IMAGES_TABLE;
  $row = $site_db->query_firstrow($sql);

  $sum = (isset($row['sum'])) ? $row['sum'] : 0;
  $total_votes = "".$lang['total_votes']."<B> ".$row['sum']."</B>\n";
 
  $site_template->register_vars("total_votes", $total_votes);
unset($total_votes);

//-----------------------------------------------------
//--- Downloads ---------------------------------------
//-----------------------------------------------------
$sql = "SELECT SUM(image_downloads) AS sum
          FROM ".IMAGES_TABLE;
  $row = $site_db->query_firstrow($sql);

  $sum = (isset($row['sum'])) ? $row['sum'] : 0;
  $total_downloads = "".$lang['total_downloads']."<B> ".$row['sum']."</B>\n";
 
  $site_template->register_vars("total_downloads", $total_downloads);
unset($total_downloads);

//-----------------------------------------------------
//--- Comments ----------------------------------------
//-----------------------------------------------------
$sql = "SELECT SUM(image_comments) AS sum
          FROM ".IMAGES_TABLE;
  $row = $site_db->query_firstrow($sql);

  $sum = (isset($row['sum'])) ? $row['sum'] : 0;
  $total_comments = "".$lang['total_comments']."<B> ".$row['sum']."</B>\n";
 
  $site_template->register_vars("total_comments", $total_comments);
unset($total_comments);
?>

Now save the stats.php file.

ALWAYS BACKUP: any file you start editing as you might not be able to restore it when the mod doesn't work

Adding the statistics to the language files:

*NOTE* I only edited this in English, but you will have to copy this to any language you use and maybe translate the english.

Open the main.php file from the lang/[your language] folder of 4images.

Go all the way to the bottom of the file.

Find:
Code: [Select]
//-----------------------------------------------------
//--- Admin Links -------------------------------------
//-----------------------------------------------------
$lang['edit'] = "[Edit]";
$lang['delete'] = "[Delete]";

Add Before:
Code: [Select]
//-----------------------------------------------------
//--- Statistics --------------------------------------
//-----------------------------------------------------
$lang['users'] = "Total Members:";
$lang['total_hits'] = "Total Image Hits:";
$lang['total_votes'] = "Total Image Votes:";
$lang['total_downloads'] = "Total Image Downloads:";
$lang['total_comments'] = "Total Image Comments:";

Including the statistics in Index.php:

Open index.php in the root folder of 4images with any code editor you like.

Find:
Code: [Select]
require(ROOT_PATH.'includes/sessions.php');
Add after:
Code: [Select]
include(ROOT_PATH.'includes/stats.php');
Do the same for catergories.php, lightbox.php, top.php
(it might also work in memberlist.php, search.php, register.php etc. but I did not test them yet)

Now edit the template files that correspond with the php files you added the include to.

index.php = home.html
categories.php = categories.html
lightbox.php = lightbox.html
top.php = top.html

you can find the templates inside the templates/default folder of 4images.

In the templates you can now use the following tags:

{total_users} - This will show the total number of members
{total_votes} - This will show the total number of image votes
{total_comments} - This will show the total number of image comments
{total_hits} - This will show the total number of image hits
{total_downloads} - This will show the total number of image downloads

Uploading all the edited files:

Now upload all files you editted to the right folder at your webserver.

This is a list of files you need to upload:
./index.php
./categories.php
./lightbox.php
./top.php
./includes/stats.php
./lang/ (any language you editted) /main.php
./templates/ (any templates you editted) /home.html
./templates/ (any templates you editted) /categories.html
./templates/ (any templates you editted) /lightbox.html
./templates/ (any templates you editted) /top.html

of course if you editted any more files then the once I mentioned above, you will need to upload them too.

I think this is it. Please note that it could be that I made an error somewhere in the directions above. As soon as you notice any error, please let me know and I will correct it as soon as possible.

Enjoy this little mod!!!

Cheers,
Vraxor
Title: Re: [Mod] More Statistics for your visitors
Post by: __G__ on February 23, 2007, 01:19:09 AM
how do i show this on whos_online.html
Title: Re: [Mod] More Statistics for your visitors
Post by: CeJay on February 23, 2007, 07:36:04 AM
how do i show this on whos_online.html

I myself have not done this mod, but what you are asking seems pretty easy to do.
Edit that template to your liking or just add the tags to the bottom of the template (under {user_online_list}).
Then you can use these tags to show what you want:
Quote
In the templates you can now use the following tags:

{total_users} - This will show the total number of members
{total_votes} - This will show the total number of image votes
{total_comments} - This will show the total number of image comments
{total_hits} - This will show the total number of image hits
{total_downloads} - This will show the total number of image downloads
Title: Re: [Mod] More Statistics for your visitors
Post by: __G__ on February 23, 2007, 07:54:38 AM
But CeJAy bro

Now edit the template files that correspond with the php files you added the include to.

index.php = home.html
categories.php = categories.html
lightbox.php = lightbox.html
top.php = top.html


Just like this do u know which is the .php file for whos_online.html
Title: Re: [Mod] More Statistics for your visitors
Post by: CeJay on February 23, 2007, 08:43:23 AM
But CeJAy bro

Now edit the template files that correspond with the php files you added the include to.
Sorry I did not read close enough and missed that  :oops:


Quote
Just like this do u know which is the .php file for whos_online.html
I think it is the sessions.php in the includes directory.
Not sure if you can just add the include(ROOT_PATH.'includes/stats.php'); or not on that, or if it has to be added differently.
Title: Re: [Mod] More Statistics for your visitors
Post by: dgandy on March 01, 2007, 10:26:35 PM
I love this mod, Vraxor. I only wanted to see members and downloads. It was easy to add to the bottom of my page, and works fanastically! Thank you!  :thumbup:

http://www.simsfashionbarn.net/downloads/
Title: Re: [Mod] More Statistics for your visitors
Post by: Markus/TSC on May 24, 2007, 10:02:42 AM
Hallo!

Ich verstehe zwar Englisch soweit, dass ich den Mod einigermaßen installieren konnte, nur begreife ich nicht wie und womit ich diesen Schritt erledigen soll:

Quote
Now edit the template files that correspond with the php files you added the include to.

index.php = home.html
categories.php = categories.html
lightbox.php = lightbox.html
top.php = top.html

you can find the templates inside the templates/default folder of 4images.

In the templates you can now use the following tags:

{total_users} - This will show the total number of members
{total_votes} - This will show the total number of image votes
{total_comments} - This will show the total number of image comments
{total_hits} - This will show the total number of image hits
{total_downloads} - This will show the total number of image downloads
Title: More Statistics
Post by: meujovem2004 on May 28, 2007, 03:35:27 PM
I am needing a Mod of equal statistics to this of the attached image. I am twirling version 1.7.4

Thank you
meujovem
Brazil
Title: Banner weg?
Post by: Markus/TSC on June 20, 2007, 10:09:43 AM
Hallo!

Ich habe das Mod installiert, doch tritt nach Hochladen der geänderten html/php - Datein folgender Fehler auf: Der Banner im Header ist nicht mehr da, ebenso erscheinen 2 Kreuze für ein nicht vorhandenes Bild über dem Rahmen der Kategorieübersicht.

Was muss ich da verändern, dass dieses Problem behoben ist?

Gruß

Markus
Title: Re: [Mod] More Statistics for your visitors
Post by: Markus/TSC on June 28, 2007, 11:34:34 AM
Kann denn keiner helfen? (siehe mein obiges Posting)
Title: Re: [Mod] More Statistics for your visitors
Post by: mawenzi on June 28, 2007, 11:39:40 AM
@Markus/TSC
... dann überprüfe die url des Banners / der Bilder und berichtige sie in den entsprechenden html- / php-Dateien ...
... mehr lässt sich ohne Link nicht sagen ...
Title: Re: [Mod] More Statistics for your visitors
Post by: Markus/TSC on July 06, 2007, 10:59:04 PM
@mawenzi: Ich habe es zwar inzwischen geschafft, die Statistik einzufügen, aber das angesprochene Problem mit den fehlenden Banner sowie 2 Rahmen o.Ä. ist nach wie vor da: http://www.storm-chasing.de/4images (http://www.storm-chasing.de/4images)
Title: Re: [Mod] More Statistics for your visitors
Post by: mawenzi on July 07, 2007, 12:09:39 AM
... wie sollen die Bilddateien auch angezeigt werden, wenn sie nicht da sind ...
... das z.B. ist die URL von deinem Banner entspr. deinem Websitecode ...
... http://www.storm-chasing.de/templates/default/images/header_logo.gif ...
... aber wenn du diesen Link aufrufst ... ist er nicht vorhanden ...
... also sorge dafür das deine Grafik-Bilder im Ordner "http://www.storm-chasing.de/templates/default/images/" liegen ...
Title: Re: [Mod] More Statistics for your visitors
Post by: Markus/TSC on July 10, 2007, 08:03:19 AM
Danke für den Hinweis, hab ich übersehen  :roll: Kannst du mir eventuell noch hierbei helfen: http://www.4homepages.de/forum/index.php?topic=17193.new#new (http://www.4homepages.de/forum/index.php?topic=17193.new#new) Die Seite dazu findest du unter http://www.storm-chasing.de/galeriet.htm (http://www.storm-chasing.de/galeriet.htm)
Title: Re: [Mod] More Statistics for your visitors
Post by: vipersgarden on September 19, 2007, 09:04:16 PM
Hello,

may you help me with a small problem (I think so).
I´m no PHP Guru !!!

Within the stats.php
I´ve tried to include a mathematic function.
Dividing {total_votes by {total_hits}.
So I would get the percentage of votes from visited images!

I´ve tried the following, but get parse errors:

Code: [Select]
//------------------------------------------------------
//----- Berechnung ---------------------------------
//--------------------------------------------------

bcdiv($total_votes, $total_hits, 3)
 $bcdiv = "".$lang['bcdiv']."<B> ".$bcdiv."</B>\n";
 
 $site_template->register_vars("bcdiv", $bcdiv);
unset($bcdiv);

I´m really no Guru, so someone may help please

regardes
Mario
Title: Re: [Mod] More Statistics for your visitors
Post by: thunderstrike on September 19, 2007, 09:08:47 PM
Ok so where bcdiv come from ?
Title: Re: [Mod] More Statistics for your visitors
Post by: vipersgarden on September 19, 2007, 09:14:33 PM
bcdiv I´ve found in a php manual:
it is the math function to divide two numbers

Code: [Select]
string bcdiv ( string left_operand, string right_operand [, int scale] )
Code: [Select]
<?php

echo bcdiv('105''6.55957'3);  // 16.007

?>

that´s all I found

thanks mario
Title: Re: [Mod] More Statistics for your visitors
Post by: thunderstrike on September 19, 2007, 09:37:14 PM
Better - use two SQL query for SELECT SUM . See example from admin/home.php file for see what is. ;)
Title: Re: [Mod] More Statistics for your visitors
Post by: vipersgarden on September 19, 2007, 09:57:34 PM
Dear thunderstrike,

1) please may you tell me a bit more exact, what you mean?

2) I´ve got it (a bit)

Code: [Select]
//------------------------------------------------------
//----- Berechnung ---------------------------------
//--------------------------------------------------

echo bcdiv('total_votes', 'total_hits', 3);

but got the following (site is working anyway):
Code: [Select]
Warning: bcdiv(): Division by zero in /home/www/web386/html/4images/includes/stats.php on line 72

Why ???


thx
Mario
Title: Re: [Mod] More Statistics for your visitors
Post by: thunderstrike on September 19, 2007, 10:12:35 PM
Change:

Quote
bcdiv($total_votes, $total_hits, 3);
$bcdiv = "".$lang['bcdiv']."<B> ".$bcdiv."</B>\n";

for:

Code: [Select]
$get_totals = $total_votes / $total_hits;
if ($get_totals > 0) {
$bcdiv = $lang['bcdiv']."<B> ".$get_totals."</B>\n";
} else {
$bcdiv = $lang['bcdiv']."<B> 0 </B>\n";
}
Title: Re: [Mod] More Statistics for your visitors
Post by: vipersgarden on September 19, 2007, 10:24:08 PM
Dear Thunderstrike,

the same: division by zero!

Code: [Select]
//------------------------------------------------------
//----- Berechnung ---------------------------------
//--------------------------------------------------
$get_totals = $total_votes / $total_hits;
if ($get_totals > 0) {
$bcdiv = $lang['bcdiv']."<B> ".$get_totals."</B>\n";
} else {
$bcdiv = $lang['bcdiv']."<B> 0 </B>\n";
}

Maybe (I don´t know) because of this:

Code: [Select]
//-----------------------------------------------------
//--- Votes -------------------------------------------
//-----------------------------------------------------
$sql = "SELECT SUM(image_votes) AS sum
          FROM ".IMAGES_TABLE;
  $row = $site_db->query_firstrow($sql);

  $sum = (isset($row['sum'])) ? $row['sum'] : 0;
  $total_votes = "".$lang['total_votes']."<B> ".$row['sum']."</B>\n";
 
  $site_template->register_vars("total_votes", $total_votes);
unset($total_votes);
last line!

Code: [Select]
//-----------------------------------------------------
//--- Hits --------------------------------------------
//-----------------------------------------------------
$sql = "SELECT SUM(image_hits) AS sum
          FROM ".IMAGES_TABLE;
  $row = $site_db->query_firstrow($sql);

  $sum = (isset($row['sum'])) ? $row['sum'] : 0;
  $total_hits = "".$lang['total_hits']."<B> ".$row['sum']."</B>\n";
 
  $site_template->register_vars("total_hits", $total_hits);
unset($total_hits);
last line too
Title: Re: [Mod] More Statistics for your visitors
Post by: thunderstrike on September 19, 2007, 10:37:16 PM
Ah ! ok so

find:

Quote
unset($total_votes);

move after this:

Quote
unset($total_hits);

(Keep same change of my post before)
Title: Re: [Mod] More Statistics for your visitors
Post by: vipersgarden on September 19, 2007, 11:00:39 PM
just the same: division by zero!

Only an idea:
how to get "new" variables out of "total_hits" and "total_votes" - inside the functions?

mario
Title: Re: [Mod] More Statistics for your visitors
Post by: thunderstrike on September 19, 2007, 11:39:52 PM
Why no use this MOD:

http://www.4homepages.de/forum/index.php?topic=12008.0

;)
Title: Re: [Mod] More Statistics for your visitors
Post by: vipersgarden on September 20, 2007, 03:35:53 PM
I´ve got it to compute !

Code: [Select]
//-----------------------------------------------------
//--- Votes -------------------------------------------
//-----------------------------------------------------
$sql = "SELECT SUM(image_votes) AS sum
          FROM ".IMAGES_TABLE;
  $row = $site_db->query_firstrow($sql);

 [b]$bewert = [/b]$sum = (isset($row['sum'])) ? $row['sum'] : 0;
  $total_votes = "".$lang['total_votes']."<B> ".$row['sum']."</B>\n";

 
  $site_template->register_vars("total_votes", $total_votes);
unset($total_votes);

and
Code: [Select]
$sql = "SELECT SUM(image_hits) AS sum
          FROM ".IMAGES_TABLE;
  $row = $site_db->query_firstrow($sql);

  $treffer = $sum = (isset($row['sum'])) ? $row['sum'] : 0;
   $total_hits = "".$lang['total_hits']."<B> ".$row['sum']."</B>\n";
 
 
  $site_template->register_vars("total_hits", $total_hits);
unset($total_hits);

and
Code: [Select]
echo bcdiv ($bewert, $treffer, 4);
I can see the correct result on top of the screen.

But when I use this (thunderstrike) code, nothing happens!
Code: [Select]
$get_totals = bcdiv ($bewert, $treffer, 4);
if ($get_totals > 0) {
$bcdiv = $lang['bcdiv']."<B> ".$get_totals."</B>\n";
} else {
$bcdiv = $lang['bcdiv']."<B> 0 </B>\n";
}
$site_template->register_vars("get_totals", $get_totals);

I also have my "bcdiv" in the lang/main.php file
Code: [Select]
$lang['bcdiv'] = "Entspricht Prozent:";
What´s wrong in the last part of the script?

thx Mario
Title: Re: [Mod] More Statistics for your visitors
Post by: vipersgarden on September 20, 2007, 04:50:17 PM
I´ve got it !

This was learning by doing!

And it is sooooo easy!- when you know it!

Code: [Select]
//------------------------------------------------------
//----- Berechnung ---------------------------------
//--------------------------------------------------

$get_totals = bcdiv ($bewert, $treffer, 4);
$ergebnis = $get_totals*100;
$site_template->register_vars("ergebnis", $ergebnis);

Result:

(http://vipersgarden.at/4images/test/Statistik_end.gif)

But anyway,
thanks for all help!!

Mario
Title: More Registered Users
Post by: son_gokou on November 18, 2008, 04:15:03 PM
Hello.

I've started a gallery. It is possible to increment registered users (of course not regiistering one, and another, and another...)? In others words, I don't want to appear 0 registered users. How can I make it appear 100 registered user per example?

Best regards
Title: Re: More Registered Users
Post by: Nicky on November 18, 2008, 06:10:12 PM
hmmm...

i didn't got this....

where should this be visible?

this one:
Quote
There are currently 2 registered user(s) (1 among them invisible) and 0 guest(s) online.
?
Title: Re: More Registered Users
Post by: son_gokou on November 18, 2008, 06:17:37 PM
That was my fault... hard to explain.

No... here:
Registered Members: 0
Title: Re: More Registered Users
Post by: Nicky on November 18, 2008, 06:35:19 PM
where you see this?
Title: Re: More Registered Users
Post by: son_gokou on November 18, 2008, 07:36:51 PM
On home page.

I've installed this MOD http://www.4homepages.de/forum/index.php?topic=3303.0
Title: Re: More Registered Users
Post by: V@nо on November 18, 2008, 08:59:59 PM
in that case you should ask this question as a reply to the mod's topic. You'll have more chances get the answer from people who know that mod.
Title: Re: More Registered Users
Post by: Nicky on November 18, 2008, 09:00:47 PM
instead of {total_users} in template, write down...

i do have 100 users..

it's simple  :mrgreen:
Title: Re: More Registered Users
Post by: son_gokou on November 19, 2008, 02:38:49 PM
Right...  :lol:
Title: Re: [Mod] More Statistics for your visitors
Post by: Nicky on November 19, 2008, 03:04:38 PM
merged :P
Title: Re: [Mod] More Statistics for your visitors
Post by: Sun Zaza on December 26, 2008, 08:09:40 PM
I have a tip:

Put this line in your includes/page_header.php, so you don't have to put it in each page :wink:

Code: [Select]
include(ROOT_PATH.'includes/stats.php');
Title: Re: [Mod] More Statistics for your visitors
Post by: mongozero on January 14, 2009, 06:24:26 AM
I have a tip:

Put this line in your includes/page_header.php, so you don't have to put it in each page :wink:

Code: [Select]
include(ROOT_PATH.'includes/stats.php');


Sorry the question... but...

how can I put the {whos_online} on all the sections?
Title: Re: [Mod] More Statistics for your visitors
Post by: stdio on March 06, 2010, 12:06:15 PM
Hi!

I've read all pages but no one really wrote how to display total image votes. Can someone help?

Thank you! This mod is awesome! :)
Title: Re: [Mod] More Statistics for your visitors
Post by: nagmat on July 13, 2010, 02:39:04 PM
thanks and i have another Problem When go to search page  :oops:

http://nagmat.com/search.php  :?


show codes  8O

Notice: Undefined index: perm_images in /home/nagmat/public_html/includes/stats.php  on line 80

Notice: Undefined index: awaiting_validation in /home/nagmat/public_html/includes/stats.php on line 82

Notice: Undefined index: new_member_welcome in /home/nagmat/public_html/includes/stats.php on line 84

Notice: Undefined index: users in /home/nagmat/public_html/includes/stats.php on line 86

Notice: Undefined index: total_hits in /home/nagmat/public_html/includes/stats.php on line 88

Notice: Undefined index: total_votes in /home/nagmat/public_html/includes/stats.php on line 90

Notice: Undefined index: total_downloads in /home/nagmat/public_html/includes/stats.php on line 92

Notice: Undefined index: total_comments in /home/nagmat/public_html/includes/stats.php on line 94

Notice: Undefined index: total_postcards in /home/nagmat/public_html/includes/stats.php on line 96

Notice: Undefined variable: total_postcards in /home/nagmat/public_html/includes/stats.php on line 97

this is stats.php

http://www.mediafire.com/?zmmynmvj3on
Title: Re: [Mod] More Statistics for your visitors
Post by: V@no on July 13, 2010, 03:09:45 PM
The original stats.php files has only 60 lines of code, all these warning you showed started from line 80. The conclusion - the mistake is in your own modifications. Without seeing the code, nobody could possible help you.

Did you add all these $lang['blah'] variables in your main.php language file?

[EDIT]ok, I must be blind...just found your stats.php :D[/EDIT]
Title: Re: [Mod] More Statistics for your visitors
Post by: nagmat on July 13, 2010, 03:55:01 PM
The original stats.php files has only 60 lines of code, all these warning you showed started from line 80. The conclusion - the mistake is in your own modifications. Without seeing the code, nobody could possible help you.

Did you add all these $lang['blah'] variables in your main.php language file?

[EDIT]ok, I must be blind...just found your stats.php :D[/EDIT]

What files are you need ?  :?

to solve the proplem
Title: Re: [Mod] More Statistics for your visitors
Post by: V@no on July 15, 2010, 06:02:15 AM
[1.7.4 - 1.7.7] search.php sets it's own error reporting (http://www.4homepages.de/forum/index.php?topic=26952.0)

This should do it.
Title: Re: [Mod] More Statistics for your visitors
Post by: zakaria666 on August 13, 2010, 08:53:38 PM
@ VANO

Hello sir, god bless u

I just had query because i dont udnerstand something, i have done this MOD and it works perfect, so instead what i did is made it display for me on the left of the screen, i made a table and placed in inside userlogininfo.html,

Which the information is only displayed on the index page, as soon as i click on image for example, the statistics are not displayed, if click for example lightbox link , it is not displayed, but if i go back to my index.html the statistics are displayed, at first i thought it had something to do with include so i included  - - -include(ROOT_PATH.'includes/stats.php'); into lightbox.php and details.php but it still did not work, so why is statistics viewable inside index but as soon as i navigate to another page the statistics are not viewable.

Thank u sir,
Title: Re: [Mod] More Statistics for your visitors
Post by: nagmat on March 02, 2011, 03:14:37 AM
http://nagmat.com/rss.php?action=images

I have rss porplem

PLEASE REPLY ME About massege