[2.0.6] Log Actions MOD

The cleanup is complete. This forum is now read only.

Rating:

Excellent!
128
50%
Very Good
47
18%
Good
35
14%
Fair
9
3%
Poor
39
15%
 
Total votes: 258

AbelaJohnB
Former Team Member
Posts: 5674
Joined: Fri Jul 06, 2001 11:56 pm

[2.0.6] Log Actions MOD

Post by AbelaJohnB »

MOD Name: Log Actions MOD
Author: morpheus2matrix
MOD Description: This MOD will allow administrators to log actions done by moderators and others administrators.

MOD Version: 1.1.6 (Updated: 10/30/03)


Download File: log_actions_mod116e.zip
mods overview page: View
File Size: 80327 Bytes
Last edited by Paul on Mon Apr 30, 2007 12:31 am, edited 7 times in total.
netclectic
Former Team Member
Posts: 4439
Joined: Wed Mar 13, 2002 3:08 pm
Location: Omnipresent
Contact:

Post by netclectic »

Two small things...
  1. in admin/admin_logs.php

    Code: Select all

    $start = ( isset($HTTP_GET_VARS['start']) ) ? $HTTP_GET_VARS['start'] : 0;
    should be

    Code: Select all

    $start = ( isset($HTTP_GET_VARS['start']) ) ? intval($HTTP_GET_VARS['start']) : 0;
    It's in an admin function so not so important.
  2. Q. in includes/functions_log.php, why is there a big select case statement where the action for each case is exactly the same? :?
Defend the game:
Image
AbelaJohnB
Former Team Member
Posts: 5674
Joined: Fri Jul 06, 2001 11:56 pm

Post by AbelaJohnB »

MOD Validated/Released :mrgreen:
User avatar
morpheus2matrix
Former Team Member
Posts: 9171
Joined: Wed Apr 10, 2002 7:31 pm
Location: France
Contact:

Post by morpheus2matrix »

AbelaJohnB wrote: MOD Validated/Released :mrgreen:


Cool :D
netclectic wrote: in includes/functions_log.php, why is there a big select case statement where the action for each case is exactly the same


what do you want to say ? :?[/quote]
Former phpBB MOD-Team Member -

Forgive my bad English :(

No support by PM/Email - Thanks - You can thanks me here :) - Pay me for installing MOD's :lol:
FX
Registered User
Posts: 254
Joined: Thu Aug 01, 2002 9:29 pm
Location: France
Contact:

Post by FX »

Add-on if the user have installed the netclectic mod

Modcp Extension 1.1.1



Code: Select all

Open includes/function_log.php

Find

case 'edit' :

			$time = time();

			$sql =  "INSERT INTO " . LOGS_TABLE . " (mode, topic_id, user_id, username, user_ip, time)
				VALUES ('$action', '$topic_id', '$user_id', '$username', '$user_ip', '$time')";
			
			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Could not insert data into logs table', '', __LINE__, __FILE__, $sql);
			}
			break;

After add

		case 'announcement' :

			$time = time();

			$sql =  "INSERT INTO " . LOGS_TABLE . " (mode, topic_id, user_id, username, user_ip, time)
				VALUES ('$action', '$topic_id', '$user_id', '$username', '$user_ip', '$time')";
			
			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Could not insert data into logs table', '', __LINE__, __FILE__, $sql);
			}
			break;

		case 'sticky' :

			$time = time();

			$sql =  "INSERT INTO " . LOGS_TABLE . " (mode, topic_id, user_id, username, user_ip, time)
				VALUES ('$action', '$topic_id', '$user_id', '$username', '$user_ip', '$time')";
			
			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Could not insert data into logs table', '', __LINE__, __FILE__, $sql);
			}
			break;
		
		case 'normal' :

			$time = time();

			$sql =  "INSERT INTO " . LOGS_TABLE . " (mode, topic_id, user_id, username, user_ip, time)
				VALUES ('$action', '$topic_id', '$user_id', '$username', '$user_ip', '$time')";
			
			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Could not insert data into logs table', '', __LINE__, __FILE__, $sql);
			}
			break;

Open modcp.php

Find

 $topic_type = ($mode == 'sticky') ? POST_STICKY : (($mode == 'announce') ? POST_ANNOUNCE : POST_NORMAL);
		$sql = "UPDATE " . TOPICS_TABLE . "
			SET topic_type = " . $topic_type . " 
			WHERE topic_id IN ($topic_id_sql) 
				AND topic_moved_id = 0";
		if ( !($result = $db->sql_query($sql)) )
		{
			message_die(GENERAL_ERROR, 'Could not update topics table', '', __LINE__, __FILE__, $sql);
		}

After add

		if ($mode == 'announcement')
		{
			log_action('announcement', $topic_id_sql, $userdata['user_id'], $userdata['username']);
		}
		if ($mode == 'sticky')
		{
			log_action('sticky', $topic_id_sql, $userdata['user_id'], $userdata['username']);
		}


Actually I don't have modified to save if the moderator or admin change the type of subject sticky to normal or annoucement to normal because I don't have an idee to save this. :wink:
User avatar
morpheus2matrix
Former Team Member
Posts: 9171
Joined: Wed Apr 10, 2002 7:31 pm
Location: France
Contact:

Post by morpheus2matrix »

thanks for this add-on FX :wink:
Former phpBB MOD-Team Member -

Forgive my bad English :(

No support by PM/Email - Thanks - You can thanks me here :) - Pay me for installing MOD's :lol:
User avatar
Jamer
Registered User
Posts: 316
Joined: Fri Apr 05, 2002 2:11 pm
Location: UK
Contact:

Post by Jamer »

When I click on the action tab, all i get is a small pop up, whith a white background, with my forum index, that's it? should there not be an explanation or something in here?
netclectic
Former Team Member
Posts: 4439
Joined: Wed Mar 13, 2002 3:08 pm
Location: Omnipresent
Contact:

Post by netclectic »

morpheus2matrix wrote:
netclectic wrote: in includes/functions_log.php, why is there a big select case statement where the action for each case is exactly the same


what do you want to say ? :?

It just seemed a bit strange. If all the cases are the same then you could do away with the select statement and reduce it to one command.
Defend the game:
Image
FX
Registered User
Posts: 254
Joined: Thu Aug 01, 2002 9:29 pm
Location: France
Contact:

Post by FX »

Hey morhpeus i have take amo diifaction to save in the log the normal action in modcp.

Code: Select all

Open modcp.php

Find

 $topic_type = ($mode == 'sticky') ? POST_STICKY : (($mode == 'announce') ? POST_ANNOUNCE : POST_NORMAL);
		$sql = "UPDATE " . TOPICS_TABLE . "
			SET topic_type = " . $topic_type . " 
			WHERE topic_id IN ($topic_id_sql) 
				AND topic_moved_id = 0";
		if ( !($result = $db->sql_query($sql)) )
		{
			message_die(GENERAL_ERROR, 'Could not update topics table', '', __LINE__, __FILE__, $sql);
		}

After add

		if ($mode == 'announcement')
		{
			log_action('announcement', $topic_id_sql, $userdata['user_id'], $userdata['username']);
		}
		if ($mode == 'sticky')
		{
			log_action('sticky', $topic_id_sql, $userdata['user_id'], $userdata['username']);
		}
		if ($normalise)
		{
			log_action('normal', $topic_id_sql, $userdata['user_id'], $userdata['username']);
		}
This add on save the action (annoucement, sticky or normal) the the nectcletic mods.
User avatar
Jamer
Registered User
Posts: 316
Joined: Fri Apr 05, 2002 2:11 pm
Location: UK
Contact:

Post by Jamer »

Jamer wrote: When I click on the action tab, all i get is a small pop up, whith a white background, with my forum index, that's it? should there not be an explanation or something in here?
Anyone?
User avatar
morpheus2matrix
Former Team Member
Posts: 9171
Joined: Wed Apr 10, 2002 7:31 pm
Location: France
Contact:

Post by morpheus2matrix »

@ Jamer : this is strange :? if you clic on an action, you should see an explanation of this action :?

have you correctly upload all the files of the MOD (rules.php, ...) :?:

@ netclectic : ok, i understand what you are saying. But like i've in project to continue the development of theis MOD, i think i will re-wrie some parts :wink:

@ FX : Thanks again :wink:
Former phpBB MOD-Team Member -

Forgive my bad English :(

No support by PM/Email - Thanks - You can thanks me here :) - Pay me for installing MOD's :lol:
User avatar
Jamer
Registered User
Posts: 316
Joined: Fri Apr 05, 2002 2:11 pm
Location: UK
Contact:

Post by Jamer »

Yes i have, the only think I have done is renamed the rules_body.tpl to rules_body2.tpl & I have also changed the corresponding link from within rules.php
$template->set_filenames(array(
'body' => 'rules_body2.tpl')
The reason for this change is because I already have the rules Mod from phpbhacks installed which uses the same name tpl. Could this be casuing my problem?

User avatar
morpheus2matrix
Former Team Member
Posts: 9171
Joined: Wed Apr 10, 2002 7:31 pm
Location: France
Contact:

Post by morpheus2matrix »

yes, this could be the reason :?

can you describe me what you see if you clic on an action ?
Former phpBB MOD-Team Member -

Forgive my bad English :(

No support by PM/Email - Thanks - You can thanks me here :) - Pay me for installing MOD's :lol:
User avatar
Jamer
Registered User
Posts: 316
Joined: Fri Apr 05, 2002 2:11 pm
Location: UK
Contact:

Post by Jamer »

A small box appears, with my forum name in the top left & looks like 2 boxes underneath, but they are blank? also when you give an explanation of your actions, where do you type this? I notice we had to make some changes in the posting .php file.....also you have the same instructions for posting .php twice in the install readme file, just letting you know.
User avatar
Jamer
Registered User
Posts: 316
Joined: Fri Apr 05, 2002 2:11 pm
Location: UK
Contact:

Post by Jamer »

I have re uploaded all the files, same thing???????????no explanation or a place to put an explanation?
Post Reply

Return to “[2.0.x] MOD Database Cleanup”