[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.
Post Reply
Merlin Sythove
Registered User
Posts: 2339
Joined: Tue Mar 16, 2004 7:42 am

Post by Merlin Sythove »

Offhand I'd say one specific logbook record contains code that makes the rest of the page go blank. What I would do in such a case, is work the logbook.php to exclude a particular logbook ID from rendering, until I found the one that caused the error, and then start figuring out what is in the record to cause it.
shakey_1
Registered User
Posts: 58
Joined: Mon Jan 23, 2006 12:08 am

Post by shakey_1 »

I noticed earlier in the thread that someone was having the same error when entering the logbook that I have been getting - mysql_free_result(): 38 is not a valid MySQL result resource in C:\phpBB2\db\mysql4.php on line 318. I managed to get rid of this by commenting out the $db->sql_freeresult($result); reference in logbook.php near this area:

Code: Select all

$sql = "SELECT * FROM " . TOPICS_TABLE . " WHERE topic_id IN($topic_list)";
		if(!$result = $db->sql_query($sql)) message_die(CRITICAL_ERROR, "Could not query topic informations", "", __LINE__, __FILE__, $sql); 
		$temp_rowset = $db->sql_fetchrowset($result); 
		//$db->sql_freeresult($result);	
Just thought I would throw that out in case anyone else came looking for some help.
Merlin Sythove
Registered User
Posts: 2339
Joined: Tue Mar 16, 2004 7:42 am

Post by Merlin Sythove »

Hmmm, commenting out that line is OK, the memory taken by that query will not be excessive. However, there is no reason why that line should fail to work.
eno123
Registered User
Posts: 78
Joined: Tue Sep 20, 2005 9:07 pm

Post by eno123 »

You mentioned in the log actions MOD thread that you didn't have time to submit it, but you are looking for more extensive testing on a vanilla board. What things would you say need testing most? I'm not saying I'm an expert but I'm leaning towards using it on a production rather than a test board so aside of the fact that the MOD would get some heavy duty testing done there it would be nice to have a heads up on the bigger potential problems..
Merlin Sythove
Registered User
Posts: 2339
Joined: Tue Mar 16, 2004 7:42 am

Post by Merlin Sythove »

You're welcome to test it too! It is being tested on my board, I have about 2000 logbook records a month (altered posts mainly), and the mod works fine there.

The main thing that needs looking at, is the text comparison function, because if a board has different types of text (like more paragraphs or more code etc.) the comparison routine may turn out to have peculiarities. But I don't expect any more real bugs in the main code.

As for cooperation: making a mod is a two step process. First, creating and testing the code, which in my case is done on a heavily modded board. And then presenting the code in such a way that it can be installed in a vanilla phpBB board and will work correctly, test that, present it for validation here etc. This is just as hard work, but different than designing the mod. Sometimes people are not far enough yet to design mods but are interested in helping out in this way, so that is why I'm looking for partnerships. It also helps if two people share the support work between them. I've done it in the past with Throckmorton and asinshesq, and created co-authorship that way.

So if you're interested in doing a bit extra work and get this mod ready for final submission etc., feel free. But if you only want to test drive it and report back here, that is fine too and I'm sure that will help others just as much.
w_33_d
Registered User
Posts: 19
Joined: Wed Dec 10, 2003 5:39 pm

Post by w_33_d »

I have a quick question / suggestion. All of the edits with this MOD have been fairly painless but I have a request. For the second templates/subSilver/overall_header.tpl edit:

Code: Select all

#
#-----[ OPEN ]-------------------------------------------------
# Note: Do same for templates/subRed/overall_header.tpl
templates/subSilver/overall_header.tpl


#
#-----[ FIND ]-------------------------------------------------
#
th	{
	color: {T_FONTCOLOR3}; font-size: {T_FONTSIZE2}px; font-weight : bold; 
	background-color: {T_BODY_LINK}; height: 25px;
	background-image: url(templates/subSilver/images/{T_TH_CLASS2});
}

#
#-----[ REPLACE WITH ]-------------------------------------------------
#	
th, a.th	{
	color: {T_FONTCOLOR3}; font-size: {T_FONTSIZE2}px; font-weight : bold; 
	background-color: {T_BODY_LINK}; height: 25px;
	background-image: url(templates/subSilver/images/{T_TH_CLASS2});
	text-decoration:none;
}
a.th:hover{ text-decoration: underline; color : {Tv_BODY_HLINK}; }
Could you provide the alternative if people use their css file versus the css in the overall_header.tpl file? I use the subSilver.css file and am having a little bit of difficulty replacing the {Tv_BODY_HLINK} and {T_BODY_LINK} variables with real values. This same quandary applies for other templates that don't use css through the overall_header.tpl file.
w_33_d
Registered User
Posts: 19
Joined: Wed Dec 10, 2003 5:39 pm

Post by w_33_d »

Also can you provide the actual sql query edits in posting.php? I have a heavily modified board and its not like I can just replace it, it has been modified many many times. I would rather not plow through it column by column to find the changes thx. I can't wait to actually try this out, the last log actions mod i tried caused a big conflict with another mod, so this is the only alternative and it looks much better coded.
Merlin Sythove
Registered User
Posts: 2339
Joined: Tue Mar 16, 2004 7:42 am

Post by Merlin Sythove »

w_33_d wrote: Could you provide the alternative if people use their css file versus the css in the overall_header.tpl file?


If you use a CSS file, you will know that all styles are hard-coded in there, no variables, so no {....} to look for.

Look for this
th {
and then start adding the necessary bits.
By the way, I do not recognise {Tv_BODY_HLINK} as a variable, it is {T_BODY_HLINK}, you have an error in the mod file somehow.
Merlin Sythove
Registered User
Posts: 2339
Joined: Tue Mar 16, 2004 7:42 am

Post by Merlin Sythove »

w_33_d wrote: Also can you provide the actual sql query edits in posting.php? I have a heavily modified board and its not like I can just replace it, it has been modified many many times. I would rather not plow through it column by column to find the changes thx. I can't wait to actually try this out, the last log actions mod i tried caused a big conflict with another mod, so this is the only alternative and it looks much better coded.


This is the best I can do: I've rewritten that block into the three partial statements for select, from and where, and left the rest as the original phpBB 2.0.19 code. However, please realise that if you alter an SQL statement that has already been modified by another mod, you MUST always check field by field to make sure the fields you need are there, and not twice etc.

Please note that I've broken the lines so you can actually see what you are doing, but this does not affect the code itself.

Code: Select all

## If you want to stay closer to the original or want to compare code because other mods
## have already changed this bit, this is alternative code for that whole block:
##
## 		//START MOD Logbook
## 		$select_sql = (!$submit) 
## 			? ', t.topic_title, p.enable_bbcode, p.enable_html, p.enable_smilies, 
## 				p.enable_sig, p.post_username, p.post_time, pt.post_subject, pt.post_text, 
## 				pt.bbcode_uid, u.username, u.user_id, u.user_sig, u.user_sig_bbcode_uid' 
## 			: ', p.post_time, pt.post_subject, pt.post_text, pt.bbcode_uid';
## 		
## 		$from_sql = ( !$submit ) 
## 			? ", " . POSTS_TEXT_TABLE . " pt, " . USERS_TABLE . " u" 
## 			: ", " . POSTS_TEXT_TABLE . " pt ";
## 		
## 		$where_sql = ( !$submit ) 
## 			? " AND pt.post_id = p.post_id AND u.user_id = p.poster_id" 
## 			: " AND pt.post_id = p.post_id ";
## 		//END MOD Logbook
## 
## 	  //This statement is the original from 2.0.19 unmodded, all changes are above.		
## 		$sql = "SELECT f.*, t.topic_id, t.topic_status, t.topic_type, t.topic_first_post_id, t.topic_last_post_id, 
## 			t.topic_vote, p.post_id, p.poster_id" . $select_sql . " 
## 			FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f" . $from_sql . " 
## 			WHERE p.post_id = $post_id 
## 				AND t.topic_id = p.topic_id 
## 				AND f.forum_id = p.forum_id
## 				$where_sql";
## 		break;
Merlin Sythove
Registered User
Posts: 2339
Joined: Tue Mar 16, 2004 7:42 am

Post by Merlin Sythove »

If you want to go beyond this, and do the 'inline find' and 'inline add after' and so on, this is it. I personally don't like it, I'd rather see what the whole is supposed to be than blindly inserting bits, but maybe this works for you.

Code: Select all

#
#-----[ FIND ]-------------------------------------------------
#	
  $select_sql = ( !$submit )
#
#-----[ INLINE FIND ]-------------------------------------------------
#	  
  
  p.post_username,
	
#
#-----[ AFTER, ADD ]-------------------------------------------------
#	  
	
	p.post_time, 

#
#-----[ INLINE FIND ]-------------------------------------------------
#	  
	
	: '';

#
#-----[ REPLACE WITH ]-------------------------------------------------
#	  

	: ', p.post_time, pt.post_subject, pt.post_text, pt.bbcode_uid';

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

	$from_sql = ( !$submit ) 
#
#-----[ INLINE FIND ]-------------------------------------------------
#	  
	
	: '';
#
#-----[ REPLACE WITH ]-------------------------------------------------
#	  
	: ", " . POSTS_TEXT_TABLE . " pt ";


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

	$where_sql = ( !$submit )
#
#-----[ INLINE FIND ]-------------------------------------------------
#	  	
	: '';
#
#-----[ REPLACE WITH ]-------------------------------------------------
#	  
	: " AND pt.post_id = p.post_id ";
	
Merlin Sythove
Registered User
Posts: 2339
Joined: Tue Mar 16, 2004 7:42 am

Post by Merlin Sythove »

Right, I've updated all files where necessary and re-done the SQL section in the mod file as I've done it above. Version 1.0.1 now. New zip file to download in post 1 of this topic.
w_33_d
Registered User
Posts: 19
Joined: Wed Dec 10, 2003 5:39 pm

Post by w_33_d »

tyvm i appreciate the quick reply. The Tv vs T think would have been my own error, perhaps a ctrl + v without the ctrl when i was copying or something.
indiebandradio
Registered User
Posts: 60
Joined: Fri Jun 24, 2005 5:15 am

Post by indiebandradio »

Is this mod suitable for 2.0.19? The log actions mod doesn't seem to work completely correctly :(
`checho`
Registered User
Posts: 63
Joined: Fri Nov 12, 2004 7:08 pm
Contact:

Post by `checho` »

That is when trying to delete messages.

Please help...

Code: Select all

Could not insert data into logbook 

DEBUG MODE 

SQL Error : 1054 Unknown column 'permanent' in 'field list' 

INSERT INTO phpbb_logbook (action, user_id, username, user_ip, time, old_forum_id, old_topic_id, old_topic_title, old_post_id, old_post_time, old_title, old_text, new_forum_id, new_topic_id, new_topic_title, new_post_id, new_title, new_text, permanent ) VALUES ('delete_post', 2142, 'Luxuria', '0a042407', 1140517491, '14', '50230', 'Допиши изреченията и опиши себе си и живота си', '573373', '', 'Допиши изреченията и опиши себе си и живота си', '[quote=\"LETHAL\"][quote=\"Krasen\"]Бих написал всичко това, но се съмнявам, че някой чете всички тея писания.[/quote]Аз неам нерви да ги прочета. :D[/quote] Аз чета на всички ,защото ми е интересно... :D', '14', '50230', 'Допиши изреченията и опиши себе си и живота си', '', '', '', '0' ) 
Line : 58 
File : functions_logbook.php
Another question: How can we enable this mod to be accessible by the other admin(s), but not the main admin only? The board I am installing it in is administered by me, but previously installed by a person that is now gone and left me administer it by myself. I have shell access to the machine and I can do mysql queries if necessary. What is the query to enable the access to Logbook for admin w/ user ID=3 ?
indiebandradio
Registered User
Posts: 60
Joined: Fri Jun 24, 2005 5:15 am

Post by indiebandradio »

Is it possible to allow multiple admins access to the logbook?
Post Reply

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