[ABD] Limit for guests

Any abandoned Extensions will be moved to this forum.

WARNING: Extensions in this forum are not currently being supported or maintained by the original Extension author. Proceed at your own risk.
Forum rules
IMPORTANT: Extension Development Forum rules

WARNING: Extensions in this forum are not currently being supported nor updated by the original Extension author. Proceed at your own risk.
Bruninoit
Registered User
Posts: 499
Joined: Thu Jun 13, 2013 2:34 pm
Location: Florence (Italy)
Name: Bruno Andrew

Re: [RC] Limit for guests

Post by Bruninoit »

noth wrote:I hope that would be selectable in ACP, I for one am quite happy with it as it is :P
There are some settings in ACP->Extensions
Bruninoit
Registered User
Posts: 499
Joined: Thu Jun 13, 2013 2:34 pm
Location: Florence (Italy)
Name: Bruno Andrew

Re: [RC] Limit for guests

Post by Bruninoit »

Compatibility with Board 3 Portal Extension -> module "last news".

Open file ext/board3/portal/modules/news.php

Find

Code: Select all

	public function get_template_center($module_id)
	{
Add after in new line

Code: Select all

//limit for guest start
    $user_id = $this->user->data['user_id'];
    $max = $this->config['lfg_maxtopics'];
    $read = $cookie=$this->request->variable($this->config['cookie_name'] . '_cookie_lfg', '', true, \phpbb\request\request_interface::COOKIE);
$cookie = $this->config['lfg_cookie'];
$error_limit_for_guest = $guest = false;
if($cookie==1)
{
$time = strtotime('+1 year');
$guest = $this->user->lang['MAX_GUEST_YEAR'];
}
if($cookie==0)
{
$time = strtotime('+1 day');
$guest = $this->user->lang['MAX_GUEST_DAY'];
}
if($user_id==1)
   {
if($read>=$max and $max!=0) //topic finiti
     {
$error_limit_for_guest = $guest;
}
}
//limit for guest end


Search

Code: Select all

$folder_alt = ($unread_topic) ? 'NEW_POSTS' : (($fetch_news[$i]['topic_status'] == ITEM_LOCKED) ? 'TOPIC_LOCKED' : 'NO_NEW_POSTS');
Add after in new line

Code: Select all

//limit for guest
if($error_limit_for_guest)
{
$fetch_news[$i]['post_text'] = $error_limit_for_guest;
}
User avatar
bennybernaer
Registered User
Posts: 729
Joined: Tue Mar 22, 2011 9:53 pm

Re: [RC] Limit for guests

Post by bennybernaer »

The extension works as far as I have tested so far.

But you have so the option: only the first post in a topic that customers can't read. But actually wants it just the other way around.
Guests may only read the first post in a topic. And the other posts in a topic have to be shielded. But apparently this is not possible? Or am I overlooking something?

Also called too bad you can bypass it easily with your cookies.
Bruninoit
Registered User
Posts: 499
Joined: Thu Jun 13, 2013 2:34 pm
Location: Florence (Italy)
Name: Bruno Andrew

Re: [RC] Limit for guests

Post by Bruninoit »

bennybernaer wrote: But you have so the option: only the first post in a topic that customers can't read. But actually wants it just the other way around.
Guests may only read the first post in a topic. And the other posts in a topic have to be shielded. But apparently this is not possible? Or am I overlooking something?
I don't understand :mrgreen: You can choose if hide only the first post or all posts.
bennybernaer wrote: Also called too bad you can bypass it easily with your cookies.
Yes, but, in my opinion, 80% of web users don't know the mean of cookie and I don't think that they know how to cancel them.
User avatar
Volksdevil
Registered User
Posts: 2415
Joined: Sun Oct 03, 2010 2:03 pm
Location: Lancashire, UK
Name: Neil

Re: [RC] Limit for guests

Post by Volksdevil »

I think he means (And it does seem to make more sense to me) that the option should be to 'Only show the first post, and hide the rest'. :)
My phpBB Extensions
Finally found great Website Hosting from :arrow: KUALO!
Do NOT use 123-reg.co.uk - Incapable of running phpBB!
:ugeek: TekNeil - Streamer on Twitch | My Volkswagen Corrado G60
User avatar
bennybernaer
Registered User
Posts: 729
Joined: Tue Mar 22, 2011 9:53 pm

Re: [RC] Limit for guests

Post by bennybernaer »

Volksdevil wrote:I think he means (And it does seem to make more sense to me) that the option should be to 'Only show the first post, and hide the rest'. :)

Exactly!
If this is not possible?
Something like this: https://www.phpbb.com/customise/db/mod/ ... _to_guest/
Bruninoit
Registered User
Posts: 499
Joined: Thu Jun 13, 2013 2:34 pm
Location: Florence (Italy)
Name: Bruno Andrew

Re: [RC] Limit for guests

Post by Bruninoit »

Ah yes, good idea. I'll add it in next version.
User avatar
bennybernaer
Registered User
Posts: 729
Joined: Tue Mar 22, 2011 9:53 pm

Re: [RC] Limit for guests

Post by bennybernaer »

Bruninoit wrote:Ah yes, good idea. I'll add it in next version.
you're my hero now :mrgreen:
User avatar
Scanialady
Registered User
Posts: 433
Joined: Thu Jan 17, 2013 7:09 pm
Location: Germany
Name: Annette

Re: [RC] Limit for guests

Post by Scanialady »

Bruninoit wrote:Compatibility with Board 3 Portal Extension -> module "last news".

Open file ext/board3/portal/modules/news.php

Find

Code: Select all

	public function get_template_center($module_id)
	{
Add after in new line

Code: Select all

//limit for guest start
    $user_id = $this->user->data['user_id'];
    $max = $this->config['lfg_maxtopics'];
    $read = $cookie=$this->request->variable($this->config['cookie_name'] . '_cookie_lfg', '', true, \phpbb\request\request_interface::COOKIE);
$cookie = $this->config['lfg_cookie'];
$error_limit_for_guest = $guest = false;
if($cookie==1)
{
$time = strtotime('+1 year');
$guest = $this->user->lang['MAX_GUEST_YEAR'];
}
if($cookie==0)
{
$time = strtotime('+1 day');
$guest = $this->user->lang['MAX_GUEST_DAY'];
}
if($user_id==1)
   {
if($read>=$max and $max!=0) //topic finiti
     {
$error_limit_for_guest = $guest;
}
}
//limit for guest end


Search

Code: Select all

$folder_alt = ($unread_topic) ? 'NEW_POSTS' : (($fetch_news[$i]['topic_status'] == ITEM_LOCKED) ? 'TOPIC_LOCKED' : 'NO_NEW_POSTS');
Add after in new line

Code: Select all

//limit for guest
if($error_limit_for_guest)
{
$fetch_news[$i]['post_text'] = $error_limit_for_guest;
}
Can you put it into an extra file for the next releases, please? Because it will be overwritten with every coming update of Board3 portal, if you screw on base code (or you have to do this changes again and again).
My 2 cents: Whether an extension is in the CDB says nothing about its quality. It is more important to read the support topics for it. Better to avoid authors who do not answer support questions themselves, who do not update their stuff, and who do not fix bugs for years.
Bruninoit
Registered User
Posts: 499
Joined: Thu Jun 13, 2013 2:34 pm
Location: Florence (Italy)
Name: Bruno Andrew

Re: [RC] Limit for guests

Post by Bruninoit »

However, also if I put it in a new file, when you update the portal you must edit that file... The only modality to solve this problem is to add an event on the portal ext.
User avatar
KhurramMunawar
Registered User
Posts: 534
Joined: Tue Mar 25, 2014 2:20 am
Location: Islamabad, Pakistan
Name: Khurram Munawar

Re: [RC] Limit for guests

Post by KhurramMunawar »

cant wait. ;)
Get Free Traffic To Your Website
Trafficonic.com - Free Traffic To Your Website
Bruninoit
Registered User
Posts: 499
Joined: Thu Jun 13, 2013 2:34 pm
Location: Florence (Italy)
Name: Bruno Andrew

Re: [RC] Limit for guests

Post by Bruninoit »

Actually this is one of 3 ext I'm updating... In this week it will arrive.
User avatar
KhurramMunawar
Registered User
Posts: 534
Joined: Tue Mar 25, 2014 2:20 am
Location: Islamabad, Pakistan
Name: Khurram Munawar

Re: [RC] Limit for guests

Post by KhurramMunawar »

how long it will take BOSS
Get Free Traffic To Your Website
Trafficonic.com - Free Traffic To Your Website
Bruninoit
Registered User
Posts: 499
Joined: Thu Jun 13, 2013 2:34 pm
Location: Florence (Italy)
Name: Bruno Andrew

Re: [RC] Limit for guests

Post by Bruninoit »

I hope max 3 February.
Bruninoit
Registered User
Posts: 499
Joined: Thu Jun 13, 2013 2:34 pm
Location: Florence (Italy)
Name: Bruno Andrew

Re: [RC] Limit for guests

Post by Bruninoit »

bennybernaer wrote:
Volksdevil wrote:I think he means (And it does seem to make more sense to me) that the option should be to 'Only show the first post, and hide the rest'. :)

Exactly!
If this is not possible?
Something like this: https://www.phpbb.com/customise/db/mod/ ... _to_guest/
New version RC3 with this feature.

Return to “Abandoned Extensions”