[DISC] Foki - The Forum Wiki

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.
User avatar
Freitag
Registered User
Posts: 142
Joined: Mon Jul 11, 2005 10:17 pm

Post by Freitag » Tue Mar 21, 2006 2:37 am

Well, I may have fixed it....

In the file

Code: Select all

posting.php
Find the line

Code: Select all

if ( ($post_info['poster_id'] != $userdata['user_id']) && !$is_auth['auth_mod'] && $post_info['post_foki'] )
And replace it with

Code: Select all

if ( ($post_info['poster_id'] != $userdata['user_id']) && !$is_auth['auth_mod'] )
This removes the refernce to that undefined variable.

The logic now reads "the post author is NOT the current editor" and we are not in auth mode (whatever that means)

I need to make sure this doesn't allow you to edit everyones posting, but it might be the fix we were looking for.

User avatar
Freitag
Registered User
Posts: 142
Joined: Mon Jul 11, 2005 10:17 pm

Post by Freitag » Tue Mar 21, 2006 2:43 am

Well, it half way works.

Any user can now edit foki posts by others and it appears to be secure.

However, there is no modification history being attributed to the edits.

I'll see if I can find where that happens....

EDIT: OK, I think I found the place where the foki edit is not being detected...
The file is functions_post.php in the includes directory.
The code is:

Code: Select all

	// BEGIN Foki
	$foki_post = false;
	if ( $mode == 'editpost' )
	{
		$rev_data = get_post_rev($post_id, -1);
		$new_rev_data = array('post_subject' => $post_subject, 'post_text' => $post_message, 'enable_html' => $html_on, 'enable_bbcode' => $bbcode_on, 'enable_smilies' => $smilies_on);
		if (( !empty($post_data['post_foki']) ) && ( check_posts_changed($new_rev_data, $rev_data) ))
		{
			$sql = "INSERT INTO " . POSTS_REV_TABLE . " (post_edit_time, post_edit_user_id, post_edit_username, post_id, enable_bbcode, enable_html, enable_smilies, enable_sig, bbcode_uid, post_subject, post_text, post_edit_comment)
				SELECT IF(p.post_edit_count = 0, p.post_time, p.post_edit_time), IF(p.post_edit_count = 0, p.poster_id, p.post_edit_user_id), IF(p.post_edit_count = 0, p.post_username, p.post_edit_username), p.post_id, p.enable_bbcode, p.enable_html, p.enable_smilies, p.enable_sig, pt.bbcode_uid, pt.post_subject, pt.post_text, p.post_edit_comment
				FROM " . POSTS_TABLE . " p, " . POSTS_TEXT_TABLE . " pt
				WHERE p.post_id = $post_id AND pt.post_id = p.post_id";
			if ( !($db->sql_query($sql, BEGIN_TRANSACTION)) )
			{
				message_die(GENERAL_ERROR, 'Error in post backup', '', __LINE__, __FILE__, $sql);
			}
			$foki_post = true;
			$edited_sql = ", post_edit_time = $current_time, post_edit_count = post_edit_count + 1, post_edit_user_id = '" . $userdata['user_id'] . "',  post_edit_username = '" . $post_username . "', post_foki = 1, post_edit_comment = '" . htmlspecialchars(trim($post_data['foki_comment'])) . "'";
		}
		else if ( !empty($edited_sql) )
		{
			$edited_sql .= ", post_edit_user_id = '" . $userdata['user_id'] . "'";
			$edited_sql .= ", post_edit_username = '" . $post_username . "'";
		}
	}
	// END Foki
and for some reason this test ( $mode == 'editpost' ) is not reporting as true.

User avatar
Quezza
Registered User
Posts: 212
Joined: Sat Oct 23, 2004 7:17 pm
Location: Hertfordshire, UK
Contact:

Post by Quezza » Sun Mar 26, 2006 9:33 pm

Hi naderman,

Thanks for creating this wicked mod :) I realise that you do not have time to continue it, so I am requesting permission to create my own wiki mod that works in the same basic was as yours and is based on your code. I think the community could really benefit from a mod like this and it is unfortunate that you cannot do it, so I would like to take it over from you.

Hope to get your permission soon,
Luke :D

QO
Registered User
Posts: 34
Joined: Sun Mar 05, 2006 7:22 pm

Post by QO » Thu Mar 30, 2006 6:28 pm

That sound brilliant, then all the betaprobs could finaly get solved

User avatar
MHobbit
Former Team Member
Posts: 4761
Joined: Thu Mar 18, 2004 5:32 pm
Location: There and Back Again

Post by MHobbit » Thu Mar 30, 2006 9:34 pm

Since naderman doesn't have time to manage/develop this MOD anymore, I'm locking this thread.
Former phpBB MOD Team member
No private support is offered.
"There’s too many things to get done, and I’m running out of days..."

Locked

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