Welcome, Guest. Please Login or Register.
May 08, 2025, 04:31:15 PM
Home Help Search Log in Register
News: SMF is the next generation in forum software, almost completely re-written from the ground up, make sure you don't fall for cheap imitations that suffer from feature bloat!

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  [REQUEST] Small Error Log Mod « previous next »
Pages: [1] Reply Ignore Print
Author Topic: [REQUEST] Small Error Log Mod  (Read 333 times)
Joseph Fung
Global Moderator
YaBB God
*****
Posts: 4512


Keep smiling: it makes others nervous.

WWW
[REQUEST] Small Error Log Mod
« on: September 02, 2002, 08:12:37 AM »
Reply with quote

Could someone slap this together for me?

I need to have a mod to split the error log into multiple pages (only 30 to 50 entries per page).

I did this for the SE2 code I put together, but I don't have the time to really put it together for a 1.4 board, and I really want it here :P  I just had to wait over a minute to load yabb.info's error log.
Logged

Chris Cromer
The Strange One
Mod Team
YaBB God
*****
Posts: 3152


I am just a figment of your imagination.

WWW
Re:[REQUEST] Small Error Log Mod
« Reply #1 on: September 02, 2002, 10:16:10 AM »
Reply with quote

Open Errors.php and search for:

   global $db_prefix,$cgi,$txt,$imagesdir,$color,$yytitle;
and replace it with:

   global $db_prefix,$cgi,$txt,$imagesdir,$color,$yytitle,$page;
Then look for:

   $request = mysql_query("SELECT ID_ERROR,IP,url,memberName,logTime,message FROM {$db_prefix}log_errors ORDER BY logTime");
   print<<<EOT

The replace it with this:

       $page = ($page == '0' || $page == '')?'1':$page;
        $ammount = ($page*30)-30;

        $request = mysql_query("SELECT COUNT(*) as error_count FROM {$db_prefix}log_errors");
        $error_count = mysql_fetch_array($request);
        $errors = ceil($error_count[error_count]/30);
        $counter = '1';
        while ($errors != '0') {
                if ($page == $counter) {
                        $pages .= " [$page]";
                }
                else {
                        $pages .= " <a href=\"$scripturl?action=viewErrorLog;page=$counter\">$counter</a>";
                }
                $errors--;
                $counter++;
        }

   $request = mysql_query("SELECT ID_ERROR,IP,url,memberName,logTime,message FROM {$db_prefix}log_errors ORDER BY logTime LIMIT $ammount,30");
   print<<<EOT
<b>Pages:</b> $pages

I used 30 as the number of how many errors on each page.
« Last Edit: September 02, 2002, 07:25:37 PM by Chris Cromer » Logged

Chris Cromer

I am not suffering from insanity, I am enjoying every minute of it.
Nemesis
What's an Admin?
Global Moderator
YaBB God
*****
Posts: 2199


WWW
Re:[REQUEST] Small Error Log Mod
« Reply #2 on: September 02, 2002, 06:45:52 PM »
Reply with quote

Chris I tested this on my board, it stop at 30 and wouldnt give me an next page... FYI
Logged


Want to say thanks?
*************************************
DONATE or check out my WishList
*********************************
Chris Cromer
The Strange One
Mod Team
YaBB God
*****
Posts: 3152


I am just a figment of your imagination.

WWW
Re:[REQUEST] Small Error Log Mod
« Reply #3 on: September 02, 2002, 07:28:54 PM »
Reply with quote

Found the problem it was with the mysql_num_rows part, I changed the code above and it works now.

I attached a picture so you can see it.
Logged

Chris Cromer

I am not suffering from insanity, I am enjoying every minute of it.
Gobalopper
Mod Team
YaBB God
*****
Posts: 993


Cookie Monster

WWW
Re:[REQUEST] Small Error Log Mod
« Reply #4 on: September 02, 2002, 07:49:47 PM »
Reply with quote

How about a way to sort by error type? :P
Logged
Chris Cromer
The Strange One
Mod Team
YaBB God
*****
Posts: 3152


I am just a figment of your imagination.

WWW
Re:[REQUEST] Small Error Log Mod
« Reply #5 on: September 02, 2002, 08:07:34 PM »
Reply with quote

As Joseph said:

Quoteslap this together

I am not making a full mod out of this, just some quick code to make pages.
Logged

Chris Cromer

I am not suffering from insanity, I am enjoying every minute of it.
Nemesis
What's an Admin?
Global Moderator
YaBB God
*****
Posts: 2199


WWW
Re:[REQUEST] Small Error Log Mod
« Reply #6 on: September 02, 2002, 10:11:24 PM »
Reply with quote

Okay I tested it, works great, good job Chris.

Joseph I already did changes for you here at YaBB.info

I backup Error.php to Error.old, Since I don't have access to admin to test it. Then upload the changed Error.php to Chris code.  ;D
Logged


Want to say thanks?
*************************************
DONATE or check out my WishList
*********************************
Joseph Fung
Global Moderator
YaBB God
*****
Posts: 4512


Keep smiling: it makes others nervous.

WWW
Re:[REQUEST] Small Error Log Mod
« Reply #7 on: December 07, 2002, 07:59:02 AM »
Reply with quote

test
Logged

Joseph Fung
Global Moderator
YaBB God
*****
Posts: 4512


Keep smiling: it makes others nervous.

WWW
Re:[REQUEST] Small Error Log Mod
« Reply #8 on: December 07, 2002, 08:04:28 AM »
Reply with quote

test
Logged

Nemesis
What's an Admin?
Global Moderator
YaBB God
*****
Posts: 2199


WWW
Re:[REQUEST] Small Error Log Mod
« Reply #9 on: December 07, 2002, 08:19:19 AM »
Reply with quote

Nice mod you added Joseph.  ;D
Logged


Want to say thanks?
*************************************
DONATE or check out my WishList
*********************************
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  [REQUEST] Small Error Log Mod « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.158 seconds with 20 queries.