[MODDB] Invisible replies until replied

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.
Lord Le Brand
Registered User
Posts: 306
Joined: Fri May 26, 2006 8:28 pm
Location: The Netherlands (GMT+1)

[MODDB] Invisible replies until replied

Post by Lord Le Brand »

MOD Title: Invisible replies until replied
MOD Description: This MOD makes replies invisible to a user until the user makes a reply in topics which have set 'Replies invisible'. Who can set replies invisible, is set per forum with the permissions page in the Admin Control Panel.
MOD Version: 1.2.2

MOD Download: http://mods.lordlebrand.ugboards.com/in ... _1.2.2.mod (use this while the official file isn't working)
Release topic: http://www.phpbb.com/community/viewtopic.php?t=560377

Demo board: n/a

Author notes:
The MOD is based on the request made by ScienceTeacher in this thread:
http://www.phpbb.com/phpBB/viewtopic.php?t=396216

Before installing his MOD you should make a backup of all files and the database


MOD History:

Code: Select all

##   2007-02-04 - Version 1.2.2
##      - Topic review fixed
##      - Pagination fixed
##
##   2006-11-11 - Version 1.2.1
##      - Typos...
##
##   2006-10-19 - Version 1.2.0
##      - Fixed post editing
##      - Fixed reply seeing auths
##
##   2006-09-16 - Version 1.1.1
##      - Fixed function
##      - Fixed so it supports editpost
##
##   2006-09-10 - Version 1.1.0
##      - Fixed after getting denied
##      - Changed the way it saves user in db
##      - Added function to verify user can see replies [ can_seereplies($user_id, $topic_id) ]
##
##   2006-09-10 - Version 1.0.0
##      - Fixed minor MOD template flaws
##      - Submitted to database
##
##   2006-09-09 - Version 0.5.2
##      - Forgot explode() and one $is_auth
##      - Cleaned code for queries in viewtopic.php and includes/topic_review.php
##
##   2006-09-08 - Version 0.5.1
##      - Fixed MOD code to do what it should do
##
##   2006-09-08 - Version 0.5.0
##      - Added auth setting for who can set Invisible replies (default moderator)
##      - Fixed bug that allowed viewing (individual) replies by adding &start=x to the url
##      - Beta release
##   2006-09-05 - Version 0.4.0
##      - Changed to per topic specification
##      - Changed auth info to topic-side information
##      - Deletion now supported (because of topic-side info)
##      - Database tables changed
##
##   2006-06-11 - Version 0.3.0
##      - Rewrote comparing 0.1.1 and 0.2.0
##      - Alpha-release
##
##   2006-06-11 - Version 0.2.0
##      - Deleted useless codechanges
##      - Fixed wrong OPEN command
##      - Fixed side-effects
##
##   2006-06-08 - Version 0.1.1
##      - No more changing simple auths
##      - Replaced TINYINT by SMALLINT
##
##   2006-06-07 - Version 0.1.0
##      - look up changes in files
##      - Pre-Alpha release
Last edited by Lord Le Brand on Sun Jul 01, 2007 12:04 pm, edited 35 times in total.
Image

Lord Le Brand
Registered User
Posts: 306
Joined: Fri May 26, 2006 8:28 pm
Location: The Netherlands (GMT+1)

Post by Lord Le Brand »

[update to 0.1.1]
Image

User avatar
Ramon Fincken
Registered User
Posts: 4835
Joined: Thu Oct 14, 2004 1:04 am
Location: NL, The Netherlands Amsterdam area @GMT +1
Contact:

Post by Ramon Fincken »

will test this one..

I miss the code to remove topics/posts from the $userdata['auth_seereplies'] when a topic/post is deleted.

Will this mod allow a reply >> delete / edit >> reply again ?

Rfn
Dutch quality fully managed WordPress hosting - ManagedWPHosting.nl

Before changing a file, some code or installing a MOD >> Make a backup first!

Do you like my mods? paypal me $1 :) forumsoftware[AT}creativepulses[DOT}nl [/size]
PhpBBantispam.com || Instant find your mod here

Lord Le Brand
Registered User
Posts: 306
Joined: Fri May 26, 2006 8:28 pm
Location: The Netherlands (GMT+1)

Post by Lord Le Brand »

That's a good idea!
I'll work on this
Image

Lord Le Brand
Registered User
Posts: 306
Joined: Fri May 26, 2006 8:28 pm
Location: The Netherlands (GMT+1)

Post by Lord Le Brand »

[Update to 0.2.0] , Useless codechanges deleted, Fixed wrong OPEN command, Fixed a few side-effects
Image

Kster
Registered User
Posts: 36
Joined: Sun May 07, 2006 7:31 am

Post by Kster »

Parse error: parse error, unexpected T_IS_EQUAL in /home/forums/public_html/forum/viewtopic.php on line 1498

got this error...

deny
Registered User
Posts: 565
Joined: Wed May 14, 2003 9:14 am
Location: Find-Ip-Address.org
Contact:

Post by deny »

I hope that you gonna to integrate this with attachment mod also.Invisible attach and text until someone reply.
Geolocation of any IP address including detection of hostname,
browser, country and country code with ip address range web tool.

IP Address Locator | Email Tracking | IP Address | Check Email

Kster
Registered User
Posts: 36
Joined: Sun May 07, 2006 7:31 am

Post by Kster »

deny does yours work?
i've installed tons of mods but this is the only 1 that i can't seem to install properly

deny
Registered User
Posts: 565
Joined: Wed May 14, 2003 9:14 am
Location: Find-Ip-Address.org
Contact:

Post by deny »

Kster wrote: deny does yours work?
i've installed tons of mods but this is the only 1 that i can't seem to install properly


I'm gonna to try this mod only if author confirm that it works with attachment mods.
Geolocation of any IP address including detection of hostname,
browser, country and country code with ip address range web tool.

IP Address Locator | Email Tracking | IP Address | Check Email

go.ozeni
Registered User
Posts: 2
Joined: Tue Aug 01, 2006 7:47 pm

error in viewtopic.php

Post by go.ozeni »

I love the MOD that you set up, however I am having a problem with the viewtopic.php file.

After I add this new code:

Code: Select all

// Begin MOD: Invisible replies until replied
	$join_sql_table = (!$post_id) ? '' : ", " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2 ";
	$join_sql = (!$post_id) ? "t.topic_id = $topic_id" : "p.post_id = $post_id AND t.topic_id = p.topic_id AND p2.topic_id = p.topic_id AND p2.post_id <= $post_id";
	$count_sql = (!$post_id) ? '' : ", COUNT(p2.post_id) AS prev_posts";
	
	$order_sql = (!$post_id) ? '' : "GROUP BY p.post_id, t.topic_id, f.forum_id, f.auth_seereply, u.auth_seereplies ORDER BY p.post_id ASC";
	
	$sql = "SELECT t.topic_id, f.forum_id, f.auth_seereply, u.auth_seereplies" . $count_sql . "
		FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . FORUMS_TABLE . " f" . $join_sql_table . "
		WHERE $join_sql
			AND f.forum_id = t.forum_id
			$order_sql";
	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, "Could not obtain topic information", '', __LINE__, __FILE__, $sql);
	}
	
	if ( !($forum_topic_data = $db->sql_fetchrow($result)) )
	{
		message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');
	}

	if ( intval($forum_topic_data['auth_seereply']) == 0 )
	{
		message_die(GENERAL_ERROR, 'No Seereply set');
	}
	
	if ( $forum_topic_data['auth_seereply']) == 150 )
	{
		if ( !$userdata['auth_seereplies'] && $userdata['user_level'] != ADMIN )
		{
			$i = $total_posts;
		}
		else
		{
			$see_replies = explode(",",$userdata['auth_seereplies']);
	
			if ( ( !$userdata['session_logged_in'] || !in_array($topic_id, $see_replies ) ) && $userdata['user_level'] != ADMIN )
			{
				// Cannot see replies
	
				$i = $total_posts;
			}
		}
	}
	// End MOD: Invisible replies until replied	
and then when I go to look at any topics in my forums, I get this error:

Code: Select all

Parse error: syntax error, unexpected T_IS_EQUAL in /mywebsite/public_html/phpBB2/viewtopic.php on line 1009
I have tried and retried pasting it in and have also put it inside and outside the "}"

Has anyone else had this issue.

User avatar
ScienceTeacher
Registered User
Posts: 22
Joined: Sat Jun 03, 2006 5:25 pm
Location: San Diego, CA USA

Post by ScienceTeacher »

Thank you for filling the request!!! I tried out the MOD on your demo site and it works exactly as I hoped. After installation, there is a major problem with viewtopic.php. In fact, I am unable to view any topics on the board.

User avatar
ScienceTeacher
Registered User
Posts: 22
Joined: Sat Jun 03, 2006 5:25 pm
Location: San Diego, CA USA

Post by ScienceTeacher »

I went back to your 0.1.1 version. Viewing other forums after installation yields an Information box that states, "no seereply set." Playing around with the permissions allows configurations that allow you to view all topics or set to "Posted" on Reply Visibility which allows you to see only the first post (this is exactly what I need!).
The problem lies when a reply is made (or even starting a new topic), waiting to view your message or selecting "view my message," an information box states, "No posts exist for this topic" This happens when a reply is made no matter the permissions, always. Viewing the topic can happen, but you have to go back to the forum index, choose the forum, and select the topic.

Lord Le Brand
Registered User
Posts: 306
Joined: Fri May 26, 2006 8:28 pm
Location: The Netherlands (GMT+1)

Post by Lord Le Brand »

Very very sorry for the late reply

I have fixed the MOD, now it should work

@deny:
This MOD makes replies invisible for a user until he/she replies: the first post is visible with all attachements, all other posts are completely invisible.

Anyway:

[Update to 0.3.0]
[Release as Alpha]
Image

User avatar
ScienceTeacher
Registered User
Posts: 22
Joined: Sat Jun 03, 2006 5:25 pm
Location: San Diego, CA USA

Thanks Lord

Post by ScienceTeacher »

Great! School starts on Tuesday. I am swamped momentarily but will try it out as soon as I can. Thought you fell off the face of the Earth.

You rock!

swimjap
Registered User
Posts: 2
Joined: Sun Sep 03, 2006 2:51 am

great mod

Post by swimjap »

Thank you for fixing the mod. I am a good friend and colleague of the science teacher you have been working with. I just finished downloading the mod and works great. I was curious however. I was wondering if there is anyway you can make it so that the invisible reply can be switched on and off by topics instead of turning off the whole forum? Thanks.

Locked

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