Show First Post Only to Guest

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in the Customisations Database.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTICE: This forum is only for the announcement of new releases and/or updates of MODs. Any MOD support should be obtained through the Customisations Database in the support area designated for each MOD.

A direct link to support for each MOD is in the first post of the respective topic.
Extensions Robot
Extensions Robot
Extensions Robot
Posts: 28074
Joined: Sat Aug 16, 2003 7:36 am

Show First Post Only to Guest

Post by Extensions Robot »

Modification name: Show First Post Only to Guest
Author: Primy
Modification description: Allow to set a option thanks to which unregistered users / guests are able to view only the first post of any thread. The rest of the posts in the thread will ask them to login or register.
Modification version: 1.0.3
Tested on phpBB version: 3.0.7-pl1

Download file: SFPO_1.0.3.zip
File size: 67.85 KiB

Modification overview page: View

The phpBB Team is not responsible nor required to provide support for this modification. By installing this MOD, you acknowledge that the phpBB Support Team or phpBB Extensions Team may not be able to provide support.

-->Modification support<--
Last edited by Extensions Robot on Mon Mar 27, 2017 3:09 pm, edited 9 times in total.
(this is a non-active account manager for the phpBB Extension Customisations Team)

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 17114
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Show First Post Only to Guest

Post by DavidIQ »

Modification validated/released

Notes:
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.

Primy
Registered User
Posts: 109
Joined: Sat Dec 01, 2007 5:11 pm

Show First Post Only to Guest

Post by Primy »

Thanks to phpBB team for this validation :)
Last edited by Primy on Sun Jul 19, 2009 11:30 am, edited 1 time in total.

Primy
Registered User
Posts: 109
Joined: Sat Dec 01, 2007 5:11 pm

Re: Show First Post Only to Guest

Post by Primy »

Screenshot:

Prosilver
Image


Subsilver2
Image

User avatar
onehundredandtwo
Registered User
Posts: 1228
Joined: Fri Nov 14, 2008 8:07 am

Re: Show First Post Only to Guest

Post by onehundredandtwo »

Quick question, how does it treat bots? Are they treated as registered users or as guests?
Need help preventing spam? Read Preventing spam in phpBB 3.0.6 and above

Primy
Registered User
Posts: 109
Joined: Sat Dec 01, 2007 5:11 pm

Re: Show First Post Only to Guest

Post by Primy »

Like registered users ;)

mykee
Registered User
Posts: 271
Joined: Thu Jun 07, 2007 9:46 pm

Re: Show First Post Only to Guest

Post by mykee »

How can I set this mod to first 5 posts? :roll:
I need first 5 posts from a topic...

Code: Select all

if ($s_sfpo) {
		$post_list[$i] = (int) $topic_data['topic_first_post_id'];
	}
	else
	{
		$post_list[$i] = (int) $row['post_id'];
	}

c1nco
Registered User
Posts: 11
Joined: Tue Nov 25, 2008 2:45 am

Re: Show First Post Only to Guest

Post by c1nco »

mykee wrote:How can I set this mod to first 5 posts? :roll:
I need first 5 posts from a topic...

Code: Select all

if ($s_sfpo) {
		$post_list[$i] = (int) $topic_data['topic_first_post_id'];
	}
	else
	{
		$post_list[$i] = (int) $row['post_id'];
	}
I would also like to know how to change this.

mykee
Registered User
Posts: 271
Joined: Thu Jun 07, 2007 9:46 pm

Re: Show First Post Only to Guest

Post by mykee »

Here is solution for first 5 posts (thanks for a hungarian poster /pstvfan/ from phpbb.hu)

Open Viewtopic.php, and

Search this:

Code: Select all

$i = ($store_reverse) ? $sql_limit - 1 : 0;
while ($row = $db->sql_fetchrow($result))
Replace with:

Code: Select all

$i = ($store_reverse) ? $sql_limit - 1 : 0;
$limit = 0;
while ($row = $db->sql_fetchrow($result))
Search this:

Code: Select all

        if ($s_sfpo) {
		$post_list[$i] = (int) $topic_data['topic_first_post_id'];
	}
	else
	{
		$post_list[$i] = (int) $row['post_id'];
	}
Replace with:

Code: Select all

if ($s_sfpo) 
   { 
      if ($limit < 5) 
      { 
         $post_list[$i] = (int) $row['post_id']; 
         $limit++; 
      } 
      else 
      { 
         $post_list[$i] = (int) $topic_data['topic_first_post_id']; 
      } 
   } 
   else 
   { 
       $post_list[$i] = (int) $row['post_id']; 
   }


Open Viewtopic_body.html (subsilver2 based template):

Search this:

Code: Select all

<!-- END postrow -->
Add after this:

Code: Select all

<!-- IF S_SFPO -->
<table class="tablebg" width="100%" cellspacing="1">
 <tr class="row2">
  <td>
   <center>
    <h5>{L_SFPO_WARNING}</h5>		 
    <div class="postbody">
     <br /> {SFPO_MESSAGE} <br /><br /> {L_SFPO_MSG_REGISTER} <br /> <a style="vertical-align:middle" href="{U_REGISTER}">{SFPO_R_IMG}</a> {L_SFPO_OR} <a style="vertical-align:middle" href="{U_LOGIN_LOGOUT}">{SFPO_L_IMG}</a>
    </div>
   </center>	
  </td>
 </tr>
 <tr class="row2">
  <td class="profile"><strong><a href="#wrapheader">{L_BACK_TO_TOP}</a></strong></td>
 </tr>
 <tr>
  <td class="spacer" colspan="2" height="1"><img src="images/spacer.gif" alt="" width="1" height="1" /></td>
 </tr>
</table>
<!-- ENDIF -->
Search ALL this code entire file:

Code: Select all

<!-- IF TOTAL_POSTS -->
Replace with:

Code: Select all

<!-- IF TOTAL_POSTS && not S_SFPO -->

c1nco
Registered User
Posts: 11
Joined: Tue Nov 25, 2008 2:45 am

Re: Show First Post Only to Guest

Post by c1nco »

Thanks mykee,

Any chance you would know how to apply this to a prosilver based theme?

mykee
Registered User
Posts: 271
Joined: Thu Jun 07, 2007 9:46 pm

Re: Show First Post Only to Guest

Post by mykee »

I don't know, I just copy this code from modx, but place is different. With this mod I have login addon on two places: after first post and last post. :roll:

User avatar
PinoyEngine™
Registered User
Posts: 244
Joined: Fri Apr 24, 2009 7:12 am

Re: Show First Post Only to Guest

Post by PinoyEngine™ »

wow! I am looking for so long for this MOD. thanks. :D

asdfasdf
Registered User
Posts: 74
Joined: Fri Sep 05, 2008 10:18 am

Re: Show First Post Only to Guest

Post by asdfasdf »

Can it be set up for each forum or is it applied to the hole board?

User avatar
parasolx
Registered User
Posts: 146
Joined: Wed Apr 23, 2008 8:52 am
Location: Malaysia
Name: Hadafi

Re: Show First Post Only to Guest

Post by parasolx »

asdfasdf wrote:Can it be set up for each forum or is it applied to the hole board?
yea, i also want to ask about this.

User avatar
ijhtio
Registered User
Posts: 150
Joined: Sat Feb 28, 2009 10:09 pm
Contact:

Re: Show First Post Only to Guest

Post by ijhtio »

i am using it on my board...works perfectly...

but yeah as asdfasdf and parasolx have said....there may be some guest sections/forums where we would like the guest to view everything (well it doesn't apply in my forum...but speaking generally)...
regards,
ijhtio

Locked

Return to “[3.0.x] MOD Database Releases”

cron