Search

Report bugs of current version 2.2.5 here!

Moderators: Moderator Team, Development Team

Search

Postby steve on Tue Jan 13, 2004 10:04 pm

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: Select all
$sql.= "ORDER BY logid DESC ";
Change
Code: Select all
if ($sql_sear == '' && $loglim) {
to
Code: Select all
if ($loglim) {

It would be even better to show all the results 50 to a page but I haven't cracked that one.
steve
 
Posts: 15
Joined: Sun Nov 16, 2003 6:07 pm

Postby sdjl on Wed Jan 14, 2004 12:58 pm

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;
}
[/php]

David
User avatar
sdjl
Moderator
 
Posts: 1282
Joined: Mon Nov 17, 2003 1:13 am
Location: London, UK

Postby steve on Wed Jan 14, 2004 8:04 pm

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 :D
steve
 
Posts: 15
Joined: Sun Nov 16, 2003 6:07 pm

Postby sdjl on Wed Jan 14, 2004 8:30 pm

Ok, the way i read the code is as follows:

[php]
if ($sql_sear == '' && $loglim) {
$sql .= (isset($offset)) ? "LIMIT ".$offset.",".$loglim : "LIMIT ".$loglim;
}
[/php]
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
User avatar
sdjl
Moderator
 
Posts: 1282
Joined: Mon Nov 17, 2003 1:13 am
Location: London, UK

Postby steve on Wed Jan 14, 2004 8:52 pm

Earlier on it says:
[php] if (!isset($sql_sear)) $sql_sear = '';[/php]
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.
steve
 
Posts: 15
Joined: Sun Nov 16, 2003 6:07 pm

Postby V@no on Thu Jan 15, 2004 12:12 am

@sdjl:
code
Code: Select all
// 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: Select all
if ($loglim) {
    $sql .= (isset($offset)) ? "LIMIT ".$offset.",".$loglim : "LIMIT ".$loglim;
}
are identical in the process, it would make no difference ;)
Image
User avatar
V@no
 
Posts: 161
Joined: Sat Nov 15, 2003 2:57 pm


Return to PPhlogger bug reports

Who is online

Users browsing this forum: No registered users and 1 guest

cron