• [ACP - PLUGIN] - Cat hits all in 1 2 0 5 1
Currently:  

Author Topic: [ACP - PLUGIN] - Cat hits all in 1  (Read 52092 times)

0 Members and 3 Guests are viewing this topic.

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
[ACP - PLUGIN] - Cat hits all in 1
« 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:

Code: [Select]
<?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
$lang['resizing_image_error'] = "Error converting image file!";

add after:

Code: [Select]
//-----------------------------------------------------
//--- 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 ?>:

Code: [Select]
// 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 »
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 ?

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [ACP - PLUGIN] - Cat hits all in 1
« Reply #1 on: September 10, 2007, 11:09:54 AM »
... nice plugin ...
... but please change the file name of this plugin in the code ... ;)
... and the file name : cat_visits.php ...
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) ...

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [ACP - PLUGIN] - Cat hits all in 1
« Reply #2 on: September 10, 2007, 12:26:13 PM »
Quote
... and the file name : cat_visits.php ...

Done. ;)

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

Is good like this ... why change ?  :|
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 ?

Offline Mr_LovaLove

  • Full Member
  • ***
  • Posts: 233
  • Unkown
    • View Profile
Re: [ACP - PLUGIN] - Cat hits all in 1
« Reply #3 on: September 10, 2007, 01:19:06 PM »
Nice :D

it works fine with 1.7.4

can see all cats with number of hits

thanks for this Plugin
English Please :@

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [ACP - PLUGIN] - Cat hits all in 1
« 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 ...
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) ...

Offline egyptsons

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Egypt Sons
Re: [ACP - PLUGIN] - Cat hits all in 1
« Reply #5 on: October 15, 2007, 04:47:23 AM »
Thanks works fine :)
Thanx God

Offline XFuzon

  • Pre-Newbie
  • Posts: 9
    • View Profile
Re: [ACP - PLUGIN] - Cat hits all in 1
« Reply #6 on: February 28, 2008, 06:57:08 PM »
Thanks!  :D

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [ACP - PLUGIN] - Cat hits all in 1
« 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. ;)
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 ?

Offline Jan-Lukas

  • Addicted member
  • ******
  • Posts: 1.289
    • View Profile
    • Discover the New World of Kindersurprise
Re: [ACP - PLUGIN] - Cat hits all in 1
« Reply #8 on: July 02, 2008, 08:10:00 PM »
Klappt SUPER in der 1.7.6  8)

 :flag-de: Hier die Deutsche Sprachdatei (Danke an Nobby)

Code: [Select]
//-----------------------------------------------------
//--- 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 »
Danke Harald




Offline AntiNSA2

  • Hero Member
  • *****
  • Posts: 774
  • As long as I can finish my site before I die.
    • View Profile
    • http://www.thelifephotography.com
Re: [ACP - PLUGIN] - Cat hits all in 1
« 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-
As long as I can finish my site before I die.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [ACP - PLUGIN] - Cat hits all in 1
« Reply #10 on: March 02, 2009, 03:41:28 PM »
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)

Offline thorstenp

  • Full Member
  • ***
  • Posts: 105
    • View Profile
Re: [ACP - PLUGIN] - Cat hits all in 1
« Reply #11 on: March 02, 2009, 07:05:05 PM »
Hallo zusammen

gibt es davon eine Demo ?

Gruss Thorsten

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [ACP - PLUGIN] - Cat hits all in 1
« 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 ...
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) ...

Offline AntiNSA2

  • Hero Member
  • *****
  • Posts: 774
  • As long as I can finish my site before I die.
    • View Profile
    • http://www.thelifephotography.com
Re: [ACP - PLUGIN] - Cat hits all in 1
« 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?
As long as I can finish my site before I die.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [ACP - PLUGIN] - Cat hits all in 1
« 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 ;)
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)