PHPee.com PHP development forum
Search

 
Post new topic   Reply to topic    phpee.com Forum Index -> PPhlogger bug reports
View previous topic :: View next topic  
Author Message
steve



Joined: 16 Nov 2003
Posts: 15

PostPosted: Tue Jan 13, 2004 9:04 pm    Post subject: Search Reply with quote
If you do a search of the logs and the result runs into thousands of entries then Internet Explorer gets upset as it can't cope with displaying such a big table.
A workaround is to only show the latest 50 (or 20 or 100 or ... depending on how many entries you have set to show on a page).
This is achieved in
dspLogs.php
On line approx 158 after the line
Code:
$sql.= "ORDER BY logid DESC ";
Change
Code:
if ($sql_sear == '' && $loglim) {
to
Code:
if ($loglim) {

It would be even better to show all the results 50 to a page but I haven't cracked that one.
Back to top
View user's profile Send private message
sdjl
Moderator


Joined: 17 Nov 2003
Posts: 1020
Location: London, UK

PostPosted: Wed Jan 14, 2004 11:58 am    Post subject: Reply with quote
mmm, it's a strange one this.
From that code it looks like it only limits the search output when the search is blank. So in effect, when the search isn't run...

Maybe a better option would be to use the following code. Slightly longer, i know. But if the original code is supposed to affect the output of the logs when not searching, it might be better:

PHP:
// Output for non-searches?
if ($sql_sear == '' && $loglim) {
    
$sql .= (isset($offset)) ? "LIMIT ".$offset.",".$loglim : "LIMIT ".$loglim;
// Output for searches
} elseif ($loglim) {
    
$sql .= (isset($offset)) ? "LIMIT ".$offset.",".$loglim : "LIMIT ".$loglim;
}


David
_________________
-----
Free Logger Accounts | PPHlogger Manual | PM Me
Back to top
View user's profile Send private message Visit poster's website
steve



Joined: 16 Nov 2003
Posts: 15

PostPosted: Wed Jan 14, 2004 7:04 pm    Post subject: Reply with quote
I think I'm missing something here. Did you mean to use the same query in the 2 cases? Assuming I've not misread it, it says roughly speaking, that if $sql_search is blank do one thing but if not do the same. Does it not make the extra code superfluous?

OK, tell me I can't see the obvious Very Happy
Back to top
View user's profile Send private message
sdjl
Moderator


Joined: 17 Nov 2003
Posts: 1020
Location: London, UK

PostPosted: Wed Jan 14, 2004 7:30 pm    Post subject: Reply with quote
Ok, the way i read the code is as follows:

PHP:
if ($sql_sear == '' && $loglim) {
    
$sql .= (isset($offset)) ? "LIMIT ".$offset.",".$loglim : "LIMIT ".$loglim;
}

The above, to me, says:

if $sql_sear is empty and $loglim has a value, assign the string $sql with a LIMIT clause.

This is why i'm thinking it has something to do with the way the normal viewing of logs happens.
The code i produced simply looks for just $loglim on its own.

The elseif part of the clause won't get executed if the original if clause matches as true.

Come to think of it now, both parts that i produced will match up, just the if part of the statement will get matched first.
mmm, maybe i am wrong afterall.

David
_________________
-----
Free Logger Accounts | PPHlogger Manual | PM Me
Back to top
View user's profile Send private message Visit poster's website
steve



Joined: 16 Nov 2003
Posts: 15

PostPosted: Wed Jan 14, 2004 7:52 pm    Post subject: Reply with quote
Earlier on it says:
PHP:
if (!isset($sql_sear)) $sql_sear = '';

so $sql_sear is always set. I was looking for a limit of entries on the page whether or not a search is being done (assuming $loglim has a value, that is).

What would be even better is being able to see all the search entries over a series of pages. The 'next' list of pages is disabled for searches in include/loglist.inc.php for good reason - they don't work because the xsear variable is not preserved between pages. How to do that easily isn't obvious to me.
Back to top
View user's profile Send private message
V@no



Joined: 15 Nov 2003
Posts: 157

PostPosted: Wed Jan 14, 2004 11:12 pm    Post subject: Reply with quote
:
code
Code:
// Output for non-searches?
if ($sql_sear == '' && $loglim) {
    $sql .= (isset($offset)) ? "LIMIT ".$offset.",".$loglim : "LIMIT ".$loglim;
// Output for searches
} elseif ($loglim) {
    $sql .= (isset($offset)) ? "LIMIT ".$offset.",".$loglim : "LIMIT ".$loglim;
}
and
Code:
if ($loglim) {
    $sql .= (isset($offset)) ? "LIMIT ".$offset.",".$loglim : "LIMIT ".$loglim;
}
are identical in the process, it would make no difference Wink
_________________
Back to top
View user's profile Send private message Visit poster's website
Post new topic   Reply to topic    phpee.com Forum Index -> PPhlogger bug reports All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB
Theme design based on Team 101 Designs, modified by Philip Iezzi