[BETA] MOD Logbook

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Greeger
Registered User
Posts: 14
Joined: Sat Jul 23, 2005 4:56 am

Post by Greeger »

Open the modcp.php file and go to line 39 and change

Code: Select all

include($phpbb_root_path . 'includes/functions_log.'.$phpEx);
to

Code: Select all

include($phpbb_root_path . 'includes/functions_logbook.'.$phpEx);
See if that clears up your problem. I doubt the mod will be incompatible with any certain template except that the problem you are having is in regards to style. The mod should work fine without that line but it might look a little strange. At least its on the admin that sees it though.

RedTrinity
Registered User
Posts: 1327
Joined: Sat May 06, 2006 3:32 am

Post by RedTrinity »

That did the trick Greeger, thank you very much!! Much appreciated :)

Cheers!

dan369
Registered User
Posts: 167
Joined: Mon Jul 05, 2004 11:03 am

Post by dan369 »

There seems to be boxes for marking actions, but no button to delete them one by one. Why is that?

Greeger
Registered User
Posts: 14
Joined: Sat Jul 23, 2005 4:56 am

Post by Greeger »

Greeger wrote: Next the delete button in the logbook page wasn't working for me. I found the problem looked like code may have been changed in the page header but not in the template. To fix this I looked in logbook.php and found:

Code: Select all

	//ADMIN: Can do the delete button etc. Done in page_header.php
And then I uncommented the lines below it.

This didn't work for me so I changed the code to the following, Unfortunately this only displays the delete button for the admin with user id 2.

Code: Select all

	//ADMIN: Can do the delete button etc. Done in page_header.php
	if ($userdata['user_id'] == 2)
	{
	  $template->assign_block_vars('switch_is_admin', array());
	}
you might be able to replace

Code: Select all

$userdata['user_id'] == 2
with

Code: Select all

($board_config['log_allow_all'] && $userdata['user_view_log']) || $userdata['user_id'] == 2

dan369
Registered User
Posts: 167
Joined: Mon Jul 05, 2004 11:03 am

Post by dan369 »

Doesn't work for me? Should it? Maybe I did it wrong.

00100100
Registered User
Posts: 16
Joined: Sat Dec 31, 2005 6:29 am

Post by 00100100 »

Hi there, thanx for this great hack, u are going to save me headaches .

I installed it manually today, and the functionality is perfect. There is a funny error though:
I does not log all the forums, the old forum pages that have been greated few months ago are logged perfectly, but the forums that i created few weeks ago are not being loged for anything.
I have no clue where to start looking for the error, any ideas?

I do have other modifications installed on the forums, but i have no idea if it is conflecting with any of them, because i dont know where to look for the error.

thanx

dan369
Registered User
Posts: 167
Joined: Mon Jul 05, 2004 11:03 am

Post by dan369 »

dan369 wrote: Doesn't work for me? Should it? Maybe I did it wrong.


Excuse me, it was I that misunderstood. Works great. And it's best that only admin can erase the logs.

lumian
Registered User
Posts: 3
Joined: Thu May 11, 2006 5:20 pm
Contact:

Post by lumian »

Well, i tried to install this today and everything seemed to go fine until I tried to run it =(

When i created the tables, I used this code:

Code: Select all

CREATE TABLE `phpbb_logbook` (
  `log_id` mediumint(10) NOT NULL auto_increment,
  `action` varchar(50) default NULL,
  `user_id` mediumint(8) default '0',
  `username` varchar(25) default NULL,
  `user_ip` varchar(8) default '0',
  `time` int(11) default '0',
  `old_forum_id` mediumint(9) default NULL,
  `old_topic_id` mediumint(9) default NULL,
  `old_topic_title` varchar(60) default NULL,
  `old_post_id` mediumint(9) default NULL,
  `old_post_time` int(11) default '0',
  `old_title` varchar(60) default NULL,
  `old_text` text,
  `new_forum_id` mediumint(9) default NULL,
  `new_topic_id` mediumint(9) default NULL,
  `new_topic_title` varchar(60) default NULL,
  `new_post_id` mediumint(9) default NULL,
  `new_title` varchar(60) default NULL,
  `new_text` text,
  PRIMARY KEY  (`log_id`)
) TYPE=MyISAM  ;	


ALTER TABLE `phpbb_users` ADD `user_view_log` TINYINT( 4 ) DEFAULT '0' NOT NULL; 
the same as in the file, and it worked!
heres a pic to prove it!! >>> http://www.macabreguild.com/images/logbookisthere.JPG
but when i try to access the logbook in my forums(logbook.php), I get this error: >> http://www.macabreguild.com/images/butitsnot.JPG

any ideas?
Thanks!

Greeger
Registered User
Posts: 14
Joined: Sat Jul 23, 2005 4:56 am

Post by Greeger »

make sure you put the line

Code: Select all

define('LOGBOOK_TABLE', $table_prefix.'logbook');
into constants.php

lumian
Registered User
Posts: 3
Joined: Thu May 11, 2006 5:20 pm
Contact:

Post by lumian »

ahh good call, i musta missed that. Thanks!

--heh now im getting
Warning: mysql_free_result(): 25 is not a valid MySQL result resource in /hsphere/local/home/jajones/forums.macabreguild.com/db/mysql4.php on line 318


commenting out those lines seems to fix it

00100100
Registered User
Posts: 16
Joined: Sat Dec 31, 2005 6:29 am

Post by 00100100 »

00100100 wrote: Hi there, thanx for this great hack, u are going to save me headaches .

I installed it manually today, and the functionality is perfect. There is a funny error though:
I does not log all the forums, the old forum pages that have been greated few months ago are logged perfectly, but the forums that i created few weeks ago are not being loged for anything.
I have no clue where to start looking for the error, any ideas?

I do have other modifications installed on the forums, but i have no idea if it is conflecting with any of them, because i dont know where to look for the error.

thanx


anyone ? :(

pt-sys
Registered User
Posts: 13
Joined: Sun Jul 09, 2006 5:03 pm

Post by pt-sys »

Hi,

I´ve instaled this mod i can see the changes of admin, but if any moderator, edit, delete or move a post i can´t see it in logbook.

Any ideas?

Thx

hornybookworm
Registered User
Posts: 25
Joined: Fri Aug 11, 2006 11:43 am
Contact:

Post by hornybookworm »

When I click on the logbook link in the admin page I get this error:


SQL Error : 1146 Table 'greengo_lfriends.LOGBOOK_TABLE' doesn't exist

SELECT l.log_id, action, ELT(FIELD(action, 'move','merge','split','delete','lock','unlock','move_post','edit_title','edit_post','delete_post','delete_poll'), '','','','','','','','','','','') as xlat_action, l.user_id, l.username, l.user_ip, l.time, l.old_forum_id, l.old_topic_id, l.old_topic_title, l.old_post_id, l.old_post_time, l.old_title, l.old_text, l.new_forum_id, l.new_topic_id, l.new_topic_title, l.new_post_id, l.new_title, l.new_text, f1.forum_name as old_forum_name, f2.forum_name as new_forum_name FROM LOGBOOK_TABLE l, phpbb_forums f1, phpbb_forums f2 WHERE l.old_forum_id = f1.forum_id AND l.new_forum_id = f2.forum_id AND l.old_forum_id IN (0,1,2,3,4,5,6,7,9,10,11,12,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28) AND l.new_forum_id IN (0,1,2,3,4,5,6,7,9,10,11,12,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28) ORDER BY time DESC, new_topic_title ASC LIMIT 0, 50

Line : 312
File : logbook.php


Any ideas

clawed
Registered User
Posts: 32
Joined: Tue Jun 14, 2005 3:04 am

Post by clawed »

hornybookworm wrote: When I click on the logbook link in the admin page I get this error:


SQL Error : 1146 Table 'greengo_lfriends.LOGBOOK_TABLE' doesn't exist


You missed part if the installation in constants.php that changes LOGBOOK_TABLE to phpbb_logbook (or whatever your table prefix is)

Code: Select all

#

#-----[ OPEN ]-------------------------------------------------

#

includes/constants.php

#

#-----[ FIND ]-------------------------------------------------

#

?>

#

#-----[ BEFORE, ADD ]-------------------------------------------------

#	

//MOD Logbook

define('LOGBOOK_TABLE', $table_prefix.'logbook');

clawed
Registered User
Posts: 32
Joined: Tue Jun 14, 2005 3:04 am

Post by clawed »

lumian wrote: ahh good call, i musta missed that. Thanks!

--heh now im getting
Warning: mysql_free_result(): 25 is not a valid MySQL result resource in /hsphere/local/home/jajones/forums.macabreguild.com/db/mysql4.php on line 318


commenting out those lines seems to fix it


I get that error after a reasonably default install, so you probably installed everything correctly and it is a error with the mod. It is not a major error (a warning actually) and is only there for cleanup purposes, so it can be safely ignored.

Post Reply

Return to “[2.0.x] MODs in Development”