4images Forum & Community
Welcome, Guest. Please login or register.
Did you miss your activation email?
August 15, 2018, 10:35:08 PM

Login with username, password and session length
Search:     Advanced search
Togle to toolbar
Translate this page with =>
Translate this page >
* Home Help Search Login Register
 
+  4images Forum & Community
|-+  4images Modifications / Modifikationen
| |-+  Mods & Plugins (Releases & Support)
| | |-+  Plugins (Moderators: mawenzi, Rembrandt)
| | | |-+  [ACP - PLUGIN] - Cat hits all in 1
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] 2 » »» Print
Current Topic Rating: ***
Author Topic: [ACP - PLUGIN] - Cat hits all in 1  (Read 38816 times)
thunderstrike
4images Guru
*******
Offline Offline

Posts: 2327

Thank You
-Given: 0
-Receive: 10


View Profile
« 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:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<?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 == && 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 == && 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 == && 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 == && defined('CAT_HITS_SET_PERPAGE') && CAT_HITS_SET_PERPAGE 0) {
        
$paging_split_valid true;        
    }
        
    if (
defined('CAT_HITS_PERPAGE_ACTIVATION') && CAT_HITS_PERPAGE_ACTIVATION == && 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" />&nbsp;</td>
    </tr>
    </table>
    <table border="0" width="100%" cellpadding="0" cellspacing="0">
    <tr>
    <td width="100%" align="center" class="tableheader" />&nbsp;</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" />&nbsp;</td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    <?php              


show_admin_footer(); 
?>


// Step 2

In lang/english/admin.php file,

find:

Quote  [Expand]
$lang['resizing_image_error'] = "Error converting image file!";

add after:

1
2
3
4
5
6
7
8
//-----------------------------------------------------
//--- 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 ?>:

1
2
3
// 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.
« Last Edit: February 29, 2008, 05:23:45 AM by thunderstrike » Logged

8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?
mawenzi
Moderator
4images Guru
*****
Offline Offline

Posts: 4500

Thank You
-Given: 36
-Receive: 121


View Profile
« Reply #1 on: September 10, 2007, 11:09:54 AM »

... nice plugin ...
... but please change the file name of this plugin in the code ... Wink
... and the file name : cat_visits.php ...
Logged

Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...
thunderstrike
4images Guru
*******
Offline Offline

Posts: 2327

Thank You
-Given: 0
-Receive: 10


View Profile
« Reply #2 on: September 10, 2007, 12:26:13 PM »

Quote  [Expand]
... and the file name : cat_visits.php ...

Done. Wink

Quote  [Expand]
... but please change the file name of this plugin in the code ...

Is good like this ... why change ?  Neutral
Logged

8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?
Mr_LovaLove
Full Member
***
Offline Offline

Posts: 233

Thank You
-Given: 1
-Receive: 0

Unkown


View Profile
« Reply #3 on: September 10, 2007, 01:19:06 PM »

Nice Very Happy

it works fine with 1.7.4

can see all cats with number of hits

thanks for this Plugin
Logged

English Please :@
mawenzi
Moderator
4images Guru
*****
Offline Offline

Posts: 4500

Thank You
-Given: 36
-Receive: 121


View Profile
« Reply #4 on: September 10, 2007, 02:11:21 PM »

... but please change the file name of this plugin in the code ...
... ok, you change it ...
Logged

Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...
egyptsons
Newbie
*
Offline Offline

Posts: 47

Thank You
-Given: 1
-Receive: 0


View Profile WWW
« Reply #5 on: October 15, 2007, 04:47:23 AM »

Thanks works fine Smile
Logged

Thanx God
XFuzon
Pre-Newbie

Offline Offline

Posts: 9

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #6 on: February 28, 2008, 06:57:08 PM »

Thanks!  Very Happy
Logged
thunderstrike
4images Guru
*******
Offline Offline

Posts: 2327

Thank You
-Given: 0
-Receive: 10


View Profile
« Reply #7 on: February 29, 2008, 05:18:02 AM »

For good reply in topic, I create v2.0 . Read update date and do again step 1, 2 and I add step 3. Wink
Logged

8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?
Jan-Lukas
Addicted member
******
Offline Offline

Posts: 1280

Thank You
-Given: 153
-Receive: 51


View Profile WWW
« Reply #8 on: July 02, 2008, 08:10:00 PM »

Klappt SUPER in der 1.7.6  Cool

 Deutsch Hier die Deutsche Sprachdatei (Danke an Nobby)

1
2
3
4
5
6
7
8
//-----------------------------------------------------
//--- 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";
« Last Edit: July 02, 2008, 08:49:24 PM by Jan-Lukas » Logged

Danke Harald



AntiNSA2
Hero Member
*****
Offline Offline

Posts: 774

Thank You
-Given: 0
-Receive: 2

As long as I can finish my site before I die.


View Profile WWW
« Reply #9 on: March 01, 2009, 12:28:55 PM »

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

As long as I can finish my site before I die.
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 577

mmm PHP...


View Profile WWW
« Reply #10 on: March 02, 2009, 03:41:28 PM »

Logged

Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)
thorstenp
Full Member
***
Offline Offline

Posts: 105

Thank You
-Given: 3
-Receive: 0


View Profile
« Reply #11 on: March 02, 2009, 07:05:05 PM »

Hallo zusammen

gibt es davon eine Demo ?

Gruss Thorsten
Logged
mawenzi
Moderator
4images Guru
*****
Offline Offline

Posts: 4500

Thank You
-Given: 36
-Receive: 121


View Profile
« Reply #12 on: March 02, 2009, 07:17:28 PM »

@ 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 ...
Logged

Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...
AntiNSA2
Hero Member
*****
Offline Offline

Posts: 774

Thank You
-Given: 0
-Receive: 2

As long as I can finish my site before I die.


View Profile WWW
« Reply #13 on: March 03, 2009, 05:26:19 AM »

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?
Logged

As long as I can finish my site before I die.
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 577

mmm PHP...


View Profile WWW
« Reply #14 on: March 03, 2009, 07:38:55 AM »

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 Wink
Logged

Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)
Pages: [1] 2 » »» Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.07 seconds with 21 queries.
Post your comments here