4images Forum & Community
Welcome, Guest. Please login or register.
Did you miss your activation email?
February 25, 2018, 04:25:16 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] - Image hits all in 1
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Current Topic Rating: ****
Author Topic: [ACP - PLUGIN] - Image hits all in 1  (Read 21427 times)
thunderstrike
4images Guru
*******
Offline Offline

Posts: 2327

Thank You
-Given: 0
-Receive: 10


View Profile
« on: September 10, 2007, 01:27:21 AM »

Detail: This show image hits in one page in ACP - > plugins.

// Step 1

In admin/plugins, create file: image_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
<?php // PLUGIN_TITLE: Image visits
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: image_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_image_visits";
}

if (
$action == "show_image_visits") {
    
    
$additional_sql "";    
    if (isset(
$additional_image_fields) && is_array($additional_image_fields) && !empty($additional_image_fields)) {
        foreach (
$additional_image_fields as $key => $val) {
            
$additional_sql .= ", " $key;            
        }
    }
    
    
$sql "
    
    SELECT image_id, image_name, image_date, image_hits" 
$additional_sql "
    FROM " 
IMAGES_TABLE "
    WHERE image_active = 1 AND (cat_id NOT IN ("
.get_auth_cat_sql("auth_viewimage""NOTIN").", ".get_auth_cat_sql("auth_viewcat""NOTIN")."))
    ORDER BY image_date, image_hits DESC
    
    "
;
    
    
$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['image_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['image_hits_no_content']; ?></td>
        </tr>
        </table>
        <?php          
    
} elseif (isset($num_rows) && $num_rows 0) {
        
        
$sql1 "SELECT COUNT(image_id) AS total_hits FROM " IMAGES_TABLE " WHERE image_active = 1 AND (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;
        
?>

        <table border="0" width="100%" cellpadding="1" cellspacing="1" class="tablebottom" />   
        <tr>
        <td width="100%" align="center" class="tablerow" /><br /><?php echo $lang['image_hits_description']; ?> (Total: <b><?php echo $total_hits?></b>).<br /><br /></td>
        </tr>
        </table>
        <table border="0" width="100%" cellpadding="1" cellspacing="1" class="tablebottom" />   
        <tr>
        <td width="33%" align="center" class="tableheader" /><?php echo $lang['image_hits_image_name']; ?></td>
        <td width="33%" align="center" class="tableheader" /><?php echo $lang['image_hits_added_on']; ?></td>
        <td width="33%" align="center" class="tableheader" /><?php echo $lang['image_hits_title']; ?></td>
        </tr>
        <?php
        
while ($stats_row $site_db->fetch_array($result)) {
            
$image_id $stats_row['image_id'];
            
$image_name format_text(stripslashes($stats_row['image_name']), 2);
            
$image_date format_date($config['date_format'] . " " $config['format_time'], $stats_row['image_date']);
            
$image_hits $stats_row['image_hits'];
        
?>

        <tr>
        <td width="33%" align="center" class="tablerow" /><a href="<?php echo $site_sess->url(ROOT_PATH "details.php?image_id=" $image_id); ?>" class="link" target="_blank" /><?php echo $image_name?></a>
        <td width="33%" align="center" class="tablerow" /><?php echo $image_date?></td>
        <td width="33%" align="center" class="tablerow" /><?php echo $image_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=18685" 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
9
//-----------------------------------------------------
//--- Images hits stats -------------------------------
//-----------------------------------------------------
$lang['image_hits_stats'] = "Image hits stats";
$lang['image_hits_description'] = "Check for image hits for each images";
$lang['image_hits_no_content'] = "No content";
$lang['image_hits_image_name'] = "Image name";
$lang['image_hits_added_on'] = "Added on";
$lang['image_hits_title'] = "Image hits";
« Last Edit: September 10, 2007, 01:57:16 PM 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:20:48 AM »

... nice plugin ... and a very long list ... Wink
... but the the image date / added on works not correctly ...
... and please change the file name in the code ...
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:24:06 PM »

Quote  [Expand]
... but the the image date / added on works not correctly ...

Is this line, I know. Sad

Quote  [Expand]
$image_date = format_date($config['date_format'], $config['format_time'], $stats_row['image_date']);

Quote  [Expand]
... and please change the file name in the code ...

Image visits is good.
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 ?
thunderstrike
4images Guru
*******
Offline Offline

Posts: 2327

Thank You
-Given: 0
-Receive: 10


View Profile
« Reply #3 on: September 10, 2007, 01:25:50 PM »

I think I find for image_date ... I edit 1st post ...
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 #4 on: September 10, 2007, 01:26:24 PM »

well, its order by what ??

its works Razz need to make it order by number of hits
Logged

English Please :@
thunderstrike
4images Guru
*******
Offline Offline

Posts: 2327

Thank You
-Given: 0
-Receive: 10


View Profile
« Reply #5 on: September 10, 2007, 01:30:32 PM »

Is there ...

Quote  [Expand]
ORDER BY image_date, image_hits DESC
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 #6 on: September 10, 2007, 01:43:41 PM »

yes find it Razz

now works better for me Razz

Quote  [Expand]
ORDER BY  image_hits ,image_date DESC
Logged

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

Posts: 4500

Thank You
-Given: 36
-Receive: 121


View Profile
« Reply #7 on: September 10, 2007, 01:54:42 PM »

... and please change the file name in the code ...

... it is not File: batch_import.php ...
... it is File: image_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 #8 on: September 10, 2007, 01:57:30 PM »

Ohhh ! ok - thank - post edit. 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 ?
Hagen-Roderich
Full Member
***
Offline Offline

Posts: 127

Thank You
-Given: 18
-Receive: 10


View Profile WWW
« Reply #9 on: July 22, 2009, 09:31:55 AM »

Hello,

it is possible to add like on "[ACP - PLUGIN] - Cat hits all in 1" Step 3 a "IMAGE_HITS_PERPAGE_ACTIVATION"?
If so, but how?

Thanks

btw: great plugin
Logged

Pages: [1] 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.075 seconds with 21 queries.
Post your comments here