First Post On Every Page

problem with Show First Post Only To Guest (sfpo) - First Post On Every Page

problem with Show First Post Only To Guest (sfpo)

by Theriddler1 » Wed Aug 24, 2016 8:23 am

when enabling your extension and with show first post only to guest allready enabled

i get this:
http://peppersrusforum.nl/viewtopic.php ... 243#p45243

normally the first post would only been shown to guests.
when disabling your extension the sfpo extension works again.

Hope it can be resolved.

Thanks.
Theriddler - Former Moderator @ phpBB.nl | phpBBservice.nl Team-member
Image My Extensions | buy me a beer Image
User avatar
Theriddler1
Registered User
Posts: 451
Joined: Sat Aug 27, 2011 11:00 pm
Location: NL
Name: Theriddler❶

Re: problem with Show First Post Only To Guest (sfpo)

by rxu » Wed Aug 24, 2016 2:41 pm

There're 2 ways to try fixing the issue. F.e. by editing rmcgirr83\sfpo\event\listener.php in the following manner:

Code: Select all

OPEN
rmcgirr83\sfpo\event\listener.php

FIND
'core.viewtopic_get_post_data'         => 'viewtopic_get_post_data',

REPLACE WITH
'core.viewtopic_get_post_data'         => array('viewtopic_get_post_data', -10),
rxu
Extensions Development Team
Posts: 4016
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation

Re: problem with Show First Post Only To Guest (sfpo)

by RMcGirr83 » Wed Aug 24, 2016 3:23 pm

What does the -10 represent?
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then you can support me by buying a beer 🍺
User avatar
RMcGirr83
Former Team Member
Posts: 22099
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: problem with Show First Post Only To Guest (sfpo)

by rxu » Wed Aug 24, 2016 3:29 pm

That is for passing the priority when registering several listener methods for the same event. The higher the priority, the earlier the method is called: http://symfony.com/doc/current/componen ... ubscribers

For the OP issue, the SFPO ext listener method should be called later than the same event listener of the First Post On Every Page ext to cut the final posts list.
rxu
Extensions Development Team
Posts: 4016
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation

Re: problem with Show First Post Only To Guest (sfpo)

by RMcGirr83 » Wed Aug 24, 2016 4:04 pm

rxu wrote:That is for passing the priority when registering several listener methods for the same event. The higher the priority, the earlier the method is called: http://symfony.com/doc/current/componen ... ubscribers


Thanks rxu :)
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then you can support me by buying a beer 🍺
User avatar
RMcGirr83
Former Team Member
Posts: 22099
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: problem with Show First Post Only To Guest (sfpo)

by Theriddler1 » Thu Aug 25, 2016 6:55 am

rxu wrote:There're 2 ways to try fixing the issue. F.e. by editing rmcgirr83\sfpo\event\listener.php in the following manner:

Code: Select all

OPEN
rmcgirr83\sfpo\event\listener.php

FIND
'core.viewtopic_get_post_data'         => 'viewtopic_get_post_data',

REPLACE WITH
'core.viewtopic_get_post_data'         => array('viewtopic_get_post_data', -10),



Thanks rxu for your quick response, the problem has been solved.
Theriddler - Former Moderator @ phpBB.nl | phpBBservice.nl Team-member
Image My Extensions | buy me a beer Image
User avatar
Theriddler1
Registered User
Posts: 451
Joined: Sat Aug 27, 2011 11:00 pm
Location: NL
Name: Theriddler❶