4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Plugins => Topic started by: thunderstrike on September 10, 2007, 02:28:29 AM
-
Detail: This show cat hits in one page in ACP - > plugins - v2.0.
[02-28-2008] - Update
- Admin paging add.
- Add this: http://www.4homepages.de/forum/index.php?topic=6926.msg112721#msg112721
- Add define constant (step 3).
[02-28-2008] - End Update
// Step 1
In admin/plugins, create file: cat_visits.php .
Add:
<?php // PLUGIN_TITLE: Category visits
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: cat_visits.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.7.4 *
* *
* Never released without support from: Nicky (http://www.nicky.net) *
* *
**************************************************************************
* *
* Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz- *
* bedingungen (Lizenz.txt) fweitere Informationen. *
* --------------------------------------------------------------- *
* This script is NOT freeware! Please read the Copyright Notice *
* (Licence.txt) for further information. *
* *
*************************************************************************/
$nozip = 1;
define('IN_CP', 1);
define('ROOT_PATH', "./../../");
require(ROOT_PATH.'admin/admin_global.php');
show_admin_header();
if ($action == "") {
$action = "show_cat_visits";
}
if ($action == "show_cat_visits") {
$sql1 = "
SELECT COUNT(cat_id) AS total_hits
FROM " . CATEGORIES_TABLE . "
WHERE (cat_id NOT IN (".get_auth_cat_sql("auth_viewimage", "NOTIN").", ".get_auth_cat_sql("auth_viewcat", "NOTIN")."))
";
$row = $site_db->query_firstrow($sql1);
$total_hits = (isset($row['total_hits'])) ? $row['total_hits'] : 0;
$condition = "";
if (defined('CAT_HITS_PERPAGE_ACTIVATION') && CAT_HITS_PERPAGE_ACTIVATION == 1 && defined('CAT_HITS_SET_PERPAGE') && CAT_HITS_SET_PERPAGE > 0) {
include(ROOT_PATH.'admin/includes/admin_paging.php');
$cat_hits_perpage = (defined('CAT_HITS_PERPAGE_ACTIVATION') && CAT_HITS_PERPAGE_ACTIVATION == 1 && defined('CAT_HITS_SET_PERPAGE') && CAT_HITS_SET_PERPAGE > 0) ? intval(trim(CAT_HITS_SET_PERPAGE)) : 0;
$link_arg = $site_sess->url("cat_visits.php?action=show_cat_visits");
$text = str_replace(array("{total_cat_images}"), array($total_hits), $lang['cat_hits_description']);
$getpaging = new Paging($page, $cat_hits_perpage, $total_hits, $link_arg, $text, '', '', '', '', false);
$offset = (defined('CAT_HITS_PERPAGE_ACTIVATION') && CAT_HITS_PERPAGE_ACTIVATION == 1 && defined('CAT_HITS_SET_PERPAGE') && CAT_HITS_SET_PERPAGE > 0) ? $getpaging->get_offset() : "";
$paging_split_valid = false;
$paging_stats_valid = false;
if (defined('CAT_HITS_PERPAGE_ACTIVATION') && CAT_HITS_PERPAGE_ACTIVATION == 1 && defined('CAT_HITS_SET_PERPAGE') && CAT_HITS_SET_PERPAGE > 0) {
$paging_split_valid = true;
}
if (defined('CAT_HITS_PERPAGE_ACTIVATION') && CAT_HITS_PERPAGE_ACTIVATION == 1 && defined('CAT_HITS_SET_PERPAGE') && CAT_HITS_SET_PERPAGE > 0) {
$paging_stats_valid = true;
}
$condition = "LIMIT ".$offset.", ".$cat_hits_perpage;
}
$sql = "
SELECT cat_id, cat_name, cat_hits
FROM " . CATEGORIES_TABLE . "
WHERE (cat_id NOT IN (".get_auth_cat_sql("auth_viewimage", "NOTIN").", ".get_auth_cat_sql("auth_viewcat", "NOTIN")."))
ORDER BY cat_hits DESC
" . $condition;
unset ($condition);
$result = $site_db->query($sql);
$num_rows = $site_db->get_numrows($result);
?>
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%">
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" align="center" class="tableheader" /><?php echo $lang['cat_hits_stats']; ?></td>
</tr>
</table>
<table border="0" width="100%" cellpadding="0" cellspacing="0">
</table>
<?php
if (isset($num_rows) && $num_rows <= 0) {
?>
<table border="0" width="100%" cellpadding="0" cellspacing="0" class="tablebottom" />
<tr>
<td width="100%" align="center" class="tablerow" /><br /><?php echo $lang['cat_hits_no_content']; ?></td>
</tr>
</table>
<?php
} elseif (isset($num_rows) && $num_rows > 0) {
?>
<table border="0" width="100%" cellpadding="1" cellspacing="1" class="tablebottom" />
<tr>
<td width="100%" align="center" class="tablerow" /><br /><?php echo (($paging_stats_valid) ? $getpaging->get_paging_stats() : (($total_hits > 0) ? str_replace(array("{total_cat_images}"), array($total_hits), $lang['cat_hits_description']) : $lang['cat_hits_no_content'])); ?><br /><br /></td>
</tr>
</table>
<table border="0" width="100%" cellpadding="1" cellspacing="1" class="tablebottom" />
<tr>
<td width="100%" align="right" class="tablerow" /><br /><?php echo (($paging_split_valid) ? $getpaging->get_paging() : ""); ?><br /></td>
</tr>
</table>
<table border="0" width="100%" cellpadding="1" cellspacing="1" class="tablebottom" />
<tr>
<td width="50%" align="center" class="tableheader" /><?php echo $lang['cat_hits_cat_name']; ?></td>
<td width="50%" align="center" class="tableheader" /><?php echo $lang['cat_hits_title']; ?></td>
</tr>
<?php
while ($stats_row = $site_db->fetch_array($result)) {
$cat_id = $stats_row['cat_id'];
$cat_name = format_text(trim($stats_row['cat_name']), 2);
$cat_hits = $stats_row['cat_hits'];
?>
<tr>
<td width="50%" align="center" class="tablerow" /><a href="<?php echo $site_sess->url(ROOT_PATH . "categories.php?cat_id=" . $cat_id); ?>" class="link" target="_blank" /><?php echo $cat_name; ?></a>
<td width="50%" align="center" class="tablerow" /><?php echo $cat_hits; ?></td>
</tr>
<?php
}
}
?>
</table>
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" align="center" class="tablerow" /> </td>
</tr>
</table>
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" align="center" class="tableheader" /> </td>
</tr>
</table>
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" align="center" class="tablerow" /><br /><span class="smalltext">Created by <a href="http://www.4homepages.de/forum/index.php?action=profile;u=20285" class="link" target="_blank" />Thunderstrike</a> . 2007-2008</span><br />
<span class="smalltext"><a href="http://www.4homepages.de/forum/index.php?topic=18686" class="link" target="_blank" />Support topic</a> .</span><br />
<br /></td>
</tr>
</table>
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" align="center" class="tableheader" /> </td>
</tr>
</table>
</td>
</tr>
</table>
<?php
}
show_admin_footer();
?>
// Step 2
In lang/english/admin.php file,
find:
$lang['resizing_image_error'] = "Error converting image file!";
add after:
//-----------------------------------------------------
//--- Categories hits stats ---------------------------
//-----------------------------------------------------
$lang['cat_hits_stats'] = "Category hits stats";
$lang['cat_hits_description'] = "Check for cat hits for each categories: {total_cat_images} cats.";
$lang['cat_hits_no_content'] = "No content";
$lang['cat_hits_cat_name'] = "Category name";
$lang['cat_hits_title'] = "Category hits";
// Step 3
In includes/constants.php file,
add in top ?>:
// Cat hits plugin.
define('CAT_HITS_PERPAGE_ACTIVATION', 1); // 1 for active. 0 for disable.
define('CAT_HITS_SET_PERPAGE', 10); // Add result per page.
-
... nice plugin ...
... but please change the file name of this plugin in the code ... ;)
... and the file name : cat_visits.php ...
-
... and the file name : cat_visits.php ...
Done. ;)
... but please change the file name of this plugin in the code ...
Is good like this ... why change ? :|
-
Nice :D
it works fine with 1.7.4
can see all cats with number of hits
thanks for this Plugin
-
... but please change the file name of this plugin in the code ...
... ok, you change it ...
-
Thanks works fine :)
-
Thanks! :D
-
For good reply in topic, I create v2.0 . Read update date and do again step 1, 2 and I add step 3. ;)
-
Klappt SUPER in der 1.7.6 8)
:flag-de: Hier die Deutsche Sprachdatei (Danke an Nobby)
//-----------------------------------------------------
//--- Categories hits stats ---------------------------
//-----------------------------------------------------
$lang['cat_hits_stats'] = "Kategorie Zugriffsstatistik";
$lang['cat_hits_description'] = "Zeige Anzahl der Zugriff pro Kategorie: {total_cat_images} Kategorien.";
$lang['cat_hits_no_content'] = "kein Inhalt";
$lang['cat_hits_cat_name'] = "Kategorie Name";
$lang['cat_hits_title'] = "Kategorie Zugriffe";
-
Hi!
I have installed the paging mod, and I recieve this error with 1.7.6
Warning: include(./../../admin/includes/admin_paging.php) [function.include]: failed to open stream: No such file or directory in /home/lifephotography/htdocs/admin/plugins/cat_visits.php on line 53
Warning: include() [function.include]: Failed opening './../../admin/includes/admin_paging.php' for inclusion (include_path='.:/usr/local/share/pear') in /home/lifephotography/htdocs/admin/plugins/cat_visits.php on line 53
Fatal error: Class 'Paging' not found in /home/lifephotography/htdocs/admin/plugins/cat_visits.php on line 59
??
Thanks for your help-
-
[02-28-2008] - Update
- Admin paging add.
- Add this: http://www.4homepages.de/forum/index.php?topic=6926.msg112721#msg112721
- Add define constant (step 3).
-
Hallo zusammen
gibt es davon eine Demo ?
Gruss Thorsten
-
@ thorstenp
... Installationsaufwand ca. 5min ...
... dann hast du eine Demo in deinem ACP ...
... bei Nichtgefallen die cat_visits.php einfach wieder löschen und alles ist Geschichte ...
-
V@no... is this the same problem as the other two mods with the path? Why am i the only 4images guy having this problem, is it because I am using 1.7.6?
-
If you are referring to the plugins you had problem with recently, then no, this is not the same, this case is your fault not following the instructions precisely ;)
-
yes... you are absolutely correct... I will bang head against wall now.
-
Hallo,
ich habe den MOD installiert, läuft soweit. Leider wird mir im ACP oberhalb der Auswertung folgende Fehlermeldung angezeigt:

Warning: Cannot modify header information - headers already sent by (output started at /is/htdocs/47852/"domain"/media/admin/plugins/cat_visits.php:1) in /is/htdocs/47852/"domain"/media/admin/admin_functions.php on line 168
Warning: Cannot modify header information - headers already sent by (output started at /is/htdocs/47852/"domain"/media/admin/plugins/cat_visits.php:1) in /is/htdocs/47852/"domain"/media/admin/admin_functions.php on line 169
Warning: Cannot modify header information - headers already sent by (output started at /is/htdocs/47852/"domain"/media/admin/plugins/cat_visits.php:1) in /is/htdocs/47852/"domain"/media/admin/admin_functions.php on line 170
Warning: Cannot modify header information - headers already sent by (output started at /is/htdocs/47852/"domain"/media/admin/plugins/cat_visits.php:1) in /is/htdocs/47852/"domain"/media/admin/admin_functions.php on line 171
Warning: Cannot modify header information - headers already sent by (output started at /is/htdocs/47852/"domain"/media/admin/plugins/cat_visits.php:1) in /is/htdocs/47852/"domain"/media/admin/admin_functions.php on line 172

Ich habe die Lösung 1 aus http://www.4homepages.de/forum/index.php?topic=3378.0 probiert - hat nix gebracht.
8 steps need when ask question -
- PHP version (ACP - > phpinfo()) - 4.4.7
- mySQL version (ACP - > phpinfo()) - Client API version 5.0.32
- 4images version - 1.7.6
- Post screenshot / URL - nein
- Post code in BB Code (no need full file for code) or post attach file - nein
- It doesn't work. What is say - what is do for no work - MOD funktioniert, Fehlermeldung stört die Ansicht
- Install MOD ? If so - please say (troubleshooting) - http://www.4homepages.de/forum/index.php?topic=3303.0 / http://www.4homepages.de/forum/index.php?topic=6760.0
- Read FAQ ? Install Bug fixes ? - nur ein Teil der FAQ gelesen :oops:
Was kann ich noch tun (außer PHP zulernen)?
-
Hello and welcome to 4images forum.
This might be helpful: UNICODE / UTF8 / UTF16 related (http://www.4homepages.de/forum/index.php?topic=25252.0)
-
Hello and welcome to 4images forum.
This might be helpful: UNICODE / UTF8 / UTF16 related (http://www.4homepages.de/forum/index.php?topic=25252.0)
Thank you.
I have safed the "cat_visits.php" with Notepad++ (before i was useing AlphaCode Studio http://www.mirage228.net/load.php?get=project.php&pid=1) and the error has gone.
Only " " stand still in the first line. (It´s not a bug it´s feature)
Btw:
It is possible to exclude some named categories?
-
Ich habe dasselbe Problem wie AntiNSA2.
Ich habe erst [MOD] Universal Paging Class v1.1.2 installiert und dann die Schritte wie hier beschrieben ausgeführt.
Liegt es daran, dass ich nichts mit dem ersten Punkt "Admin paging add." anfangen kann? Was soll das heißen?
Danke und Gruß
-
....Liegt es daran, dass ich nichts mit dem ersten Punkt "Admin paging add." anfangen kann? Was soll das heißen?
..
du mußt den anderen mod auch noch installieren.
-
habs gefunden. super, funktioniert gut.
a) wie müsste man das für cat_downolads machen, also für kategorien geordnet nach downloads?
b)eigentlich habe ich genau das gesucht, nur eben nicht für den admin-bereich sondern frei zugänglich für alle User.
kann man cat_visits.php ändern, so dass es nicht für den admin bereich ist?
-
hat keiner eine Idee?
habs gefunden. super, funktioniert gut.
a) wie müsste man das für cat_downolads machen, also für kategorien geordnet nach downloads?
b)eigentlich habe ich genau das gesucht, nur eben nicht für den admin-bereich sondern frei zugänglich für alle User.
kann man cat_visits.php ändern, so dass es nicht für den admin bereich ist?