Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - callimero

Pages: [1]
1
Mods & Plugins (Releases & Support) / [Mod] Another Statistics Mod
« on: May 12, 2005, 04:49:56 PM »
hallo,

ich habe alles so gemacht wie es hier beschrieben ist (glaub ich), die statistiken isnd aber nicht zu sehen.
woran kann das liegen www.netzpfosten.de

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!!!

2
Installation, Update & Configuration / statistiken einfügen
« on: May 11, 2005, 07:08:35 PM »
hallo,

ich habe mal gesehen, dass man unter den thumbnails auch die anzahl der hits anzeigen lassen kann.
kann mir jemand sagen wie man das macht ?!  :) wäre sehr nett !  :mrgreen:

kann man auch irgendwie mehr statistiken auf der seite anzeigen lassen wie z.b.:
top bwertungen
top hits
top downloads
anzahl der registrierten user
usw....

vielleicht kann mir ja jemand helfen
danke

3
Discussion & Troubleshooting / Template Problem
« on: April 29, 2005, 07:09:02 PM »
Hallo,

ich habe mir ein template hochgeladen und es funktioniert auch alles, bis auf die kommentare.
wenn man kommentare schreiben will sieht man das geschriebene nicht !!!
woran kann das liegen ?
wäre nett wenn mir jemand helfen könnte www.netzpfosten.de/4_images/index.php

DANKE

4
Installation, Update & Configuration / 4images in die hp integrieren
« on: April 28, 2005, 12:15:22 PM »
hallo,

BITTE UM HILFE

kann mir jemand helfen 4images in meine hp zu integrieren ?!?!

bekomme das irgendwie nicht hin  :(

wäre sehr dankbar für lösungen  :mrgreen:


5
Installation, Update & Configuration / Template
« on: April 27, 2005, 09:33:18 PM »
Ich habe neue templates geladen, es verändert sich aber nichts  :(
Woran kann das liegen ?

6
Installation, Update & Configuration / Template Problem
« on: April 27, 2005, 03:10:19 PM »
wenn ich mein template-pack laden will erscheint diese meldung...


Warning: opendir(./../templates/4greyblue/media): failed to open dir: No such file or directory in /home/virtual/site249/fst/var/www/html/4_images/admin/templates.php on line 62

Warning: closedir(): supplied argument is not a valid Directory resource in /home/virtual/site249/fst/var/www/html/4_images/admin/templates.php on line 68


was habe ich falsch gemacht ? und wie funktioniert es richtig ?

7
Discussion & Troubleshooting / Bilder hochladen
« on: April 27, 2005, 01:59:35 PM »
Kann ich mehrere Bilder auf einmal hochladen ?

8
Installation, Update & Configuration / Adminbereich Problem
« on: April 27, 2005, 01:11:30 PM »
Wie komme ich in den Adminbereich ???

Pages: [1]