Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: [ Page generation: 0.1925s ][ DB Queries: 13 (0.1393s) ]  (Read 22848 times)

0 Members and 1 Guest are viewing this topic.

luchtzak

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 36
    • Luchtzak Aviation
[ Page generation: 0.1925s ][ DB Queries: 13 (0.1393s) ]
« on: July 18, 2006, 10:18:48 am »

Does this exist for the coppermine gallery?

 [ Page generation: 0.1925s ][ DB Queries: 13 (0.1393s) ]

or

 Script Execution Time: 0.20084 | SQL Queries: 10

many of the popular softwares have this, perhaps it can be programmed for coppermine too?

any suggestion where to find?
« Last Edit: July 27, 2006, 12:30:05 am by Nibbler »
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: [ Page generation: 0.1925s ][ DB Queries: 13 (0.1393s) ]
« Reply #1 on: July 18, 2006, 11:57:18 am »

Logged
Chief Geek at Ranium Systems

Nibbler

  • Guest
Re: [ Page generation: 0.1925s ][ DB Queries: 13 (0.1393s) ]
« Reply #2 on: July 18, 2006, 12:14:59 pm »

It's not visible to regular users, is that what you are requesting ?
Logged

luchtzak

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 36
    • Luchtzak Aviation
Re: [ Page generation: 0.1925s ][ DB Queries: 13 (0.1393s) ]
« Reply #3 on: July 26, 2006, 12:19:23 pm »

it's not that what I am looking for.

I would like to see on the bottom of every page a message saying:

this page has been generated in xxx seconds with xx db queries made. e.g. on the bottom of my website: www.luchtzak.be or http://top-100.luchtzak.be/

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: [ Page generation: 0.1925s ][ DB Queries: 13 (0.1393s) ]
« Reply #4 on: July 26, 2006, 01:26:39 pm »

If you are using cpg1.4.x then you can do the following ...

Create a new script called 'customFooter.php' with code given below and place it in your coppermine folder.

Code: [Select]
<?php
    
global $cpg_time_start$query_stats;

    
$time_end cpgGetMicroTime();
    
$time round($time_end $cpg_time_start3);
    
$query_count count($query_stats);
    
$total_query_time array_sum($query_stats);
    echo 
'<p align="center">[ Page generation: '.$time.'s ][ DB Queries: '.$query_count.' ('.$total_query_time.'s)]</p>';
?>


then log in to the gallery, go to config page and change the value of Path to custom footer include to customFooter.php

This should show the stats at the bottom of every page to every user.
« Last Edit: July 26, 2006, 01:40:26 pm by Abbas Ali »
Logged
Chief Geek at Ranium Systems

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: [ Page generation: 0.1925s ][ DB Queries: 13 (0.1393s) ]
« Reply #5 on: July 26, 2006, 01:30:21 pm »

nice work abbas ;)
Logged
‍I don't answer to PM with support question
Please post your issue to related board

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1609
  • Paul V.
Re: [ Page generation: 0.1925s ][ DB Queries: 13 (0.1393s) ]
« Reply #6 on: July 26, 2006, 02:16:35 pm »

From the first post, this sounded like a support request rather than a feature request.

And now with Abbas' code contribution, maybe this thread belongs on the Mods/Add-ons board under Stats.
Logged

luchtzak

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 36
    • Luchtzak Aviation
Re: [ Page generation: 0.1925s ][ DB Queries: 13 (0.1393s) ]
« Reply #7 on: July 27, 2006, 12:14:54 am »

Nice programming abbas!

1 item though is the database queries are not shown: http://coppermine.luchtzak.be/displayimage.php?pos=-9043

running 1.4.8 stable

Nibbler

  • Guest
Re: [ Page generation: 0.1925s ][ DB Queries: 13 (0.1393s) ]
« Reply #8 on: July 27, 2006, 12:28:04 am »

functions.inc.php, change

Code: [Select]
        if (isset($CONFIG['debug_mode']) && (($CONFIG['debug_mode']==1) || ($CONFIG['debug_mode']==2) )) {
                $duration = round($query_end - $query_start, 3);
                $query_stats[] = $duration;
                $queries[] = "$query ({$duration}s)";
        }

to

Code: [Select]
        //if (isset($CONFIG['debug_mode']) && (($CONFIG['debug_mode']==1) || ($CONFIG['debug_mode']==2) )) {
                $duration = round($query_end - $query_start, 3);
                $query_stats[] = $duration;
                $queries[] = "$query ({$duration}s)";
        //}

Shame about that, would have been an easy plugin otherwise. Moving to mods board.
Logged

filmman

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
Re: [ Page generation: 0.1925s ][ DB Queries: 13 (0.1393s) ]
« Reply #9 on: August 05, 2007, 01:18:46 pm »

nice one that worked for me, been looking for something like that
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: [ Page generation: 0.1925s ][ DB Queries: 13 (0.1393s) ]
« Reply #10 on: August 06, 2007, 06:56:34 am »

@Nibbler: maybe we should add another plugin hook for cpg1.5.x to allow a full pluginized version?
Logged

Nibbler

  • Guest
Re: [ Page generation: 0.1925s ][ DB Queries: 13 (0.1393s) ]
« Reply #11 on: August 06, 2007, 02:04:48 pm »

Yes, would be useful to have a hook in cpg_db_query.
Logged
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 19 queries.