[3.3][RC] Group Template Variables

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Scam Warning
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
User avatar
mrgoldy
Former Team Member
Posts: 1394
Joined: Tue Oct 06, 2009 7:34 pm
Location: The Netherlands
Name: Gijs
Contact:

Re: [RC] Group Template Variables

Post by mrgoldy »

Yeah it disappears, so I suppose it does get picked up.
I double checked myself, just to make sure, I am not in the Guest group somehow..
I double checked all group id's, they are standard (1 guests, 2 registered, 3 coppa, 4 mods, 5 admins, 6 bots)
I tried putting something in between
<!-- IF S_GROUP_2 -->Registered Members Only<!-- ENDIF -->
Just to make sure that some setting was adding everyone into the guests group and the members group, so we can view it the other way around. However, as a guest, it still shows up.

Disabled, re-uploaded, enabled. No change.
phpBB Studio / Member of the Studio

Contributing: You can do it too! Including testing Pull Requests (PR).
phpBB Development and Testing made easy.
User avatar
RMcGirr83
Former Team Member
Posts: 22016
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: [RC] Group Template Variables

Post by RMcGirr83 »

Is the anonymous user with in the registered users group?
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then buy me a beer Image
User avatar
mrgoldy
Former Team Member
Posts: 1394
Joined: Tue Oct 06, 2009 7:34 pm
Location: The Netherlands
Name: Gijs
Contact:

Re: [RC] Group Template Variables

Post by mrgoldy »

Yes he is, the only 'user' in there.
phpBB Studio / Member of the Studio

Contributing: You can do it too! Including testing Pull Requests (PR).
phpBB Development and Testing made easy.
User avatar
RMcGirr83
Former Team Member
Posts: 22016
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: [RC] Group Template Variables

Post by RMcGirr83 »

That makes no sense. The anonymous user should be in the guest group, all other users should be (at the least) in the registered users group.
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then buy me a beer Image
User avatar
martti
Registered User
Posts: 911
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [RC] Group Template Variables

Post by martti »

I tried it myself now and it doesn't seem the template variables are available or get parsed in the Pages extension. <!-- IF S_GROUP_1 --> is seen as nothing more than a html comment.
User avatar
mrgoldy
Former Team Member
Posts: 1394
Joined: Tue Oct 06, 2009 7:34 pm
Location: The Netherlands
Name: Gijs
Contact:

Re: [RC] Group Template Variables

Post by mrgoldy »

RMcGirr83 wrote:That makes no sense. The anonymous user should be in the guest group, all other users should be (at the least) in the registered users group.
Sorry, misread, thought you asked if he is in the Guest group. Hes alone in the guest group, he is not in teh registered users group.

And okay, thanks for confirming martti. Do you also happen to know a work around? :mrgreen: :roll:
phpBB Studio / Member of the Studio

Contributing: You can do it too! Including testing Pull Requests (PR).
phpBB Development and Testing made easy.
User avatar
martti
Registered User
Posts: 911
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [RC] Group Template Variables

Post by martti »

posey wrote:And okay, thanks for confirming martti. Do you also happen to know a work around? :mrgreen: :roll:
Issue a feature request at the Pages extension?
User avatar
mrgoldy
Former Team Member
Posts: 1394
Joined: Tue Oct 06, 2009 7:34 pm
Location: The Netherlands
Name: Gijs
Contact:

Re: [RC] Group Template Variables

Post by mrgoldy »

I did some more digging and found this post.

Turns out you can use <!-- IF S_REGISTERED_USER -->but not in the page content itself, so you'll have to create a custom template. But this solves my issue.

Sorry for the inconvenience.
phpBB Studio / Member of the Studio

Contributing: You can do it too! Including testing Pull Requests (PR).
phpBB Development and Testing made easy.
User avatar
mrgoldy
Former Team Member
Posts: 1394
Joined: Tue Oct 06, 2009 7:34 pm
Location: The Netherlands
Name: Gijs
Contact:

Re: [RC] Group Template Variables

Post by mrgoldy »

Hello,

Sorry but I'm back, unfortunately :(.

I've got this extension enabled. I created a custom page onsale.php with onsale_body.html, and tried to use this extension to make it so only a few groups can see certain area's. See HTML page below:

Code: Select all

	<div class="panel bg1">
	<div class="inner">
		<div id='currently'>
		<!-- BEGIN sale_block -->
			<div class="panel <!-- IF sale_block.S_ROW_COUNT is odd -->bg2<!-- ELSE -->bg3<!-- ENDIF -->"><div class="inner">
				<table>
					<tbody>
						<tr><td colspan="3"><h2><img src="/images/sale.png" width="38px" height="15px"/> {sale_block.ITEM_NAME}</h2></td></tr>
						<tr>
							<td rowspan="5"><img src="{sale_block.ITEM_IMAGE}" /></td>
							<td style="text-align: right;"><span style="text-decoration: underline;"><strong>Sale Starts:</strong></span></td>
							<td>&nbsp;{sale_block.SALE_START_DATE} <em>at</em> {sale_block.SALE_START_TIME} <em>(EST)</em></td>
						</tr>
						<tr>
							<td style="text-align: right;"><span style="text-decoration: underline;"><strong>Sale Ends:</strong></span></td>
							<td>&nbsp;{sale_block.SALE_ENDS_DATE} <em>at</em> {sale_block.SALE_ENDS_TIME} <em>(EST)</em></td>
						</tr>
						<tr>
							<td style="text-align: right;"><strong><span style="text-decoration: underline;">Original Price</span>:</strong></td>
							<td>&nbsp;<span style="color: #ff0000; text-decoration: line-through;">{sale_block.ORIGINAL_PRICE}</span> <img src="/images/dime.png" width="10px" height="10px" /></td>
						</tr>
						<tr>
							<td style="text-align: right;"><span style="text-decoration: underline;"><strong>Sale Price:</strong></span></td>
							<td><span style="color: #008000;">&nbsp;{sale_block.SALE_PRICE} <img src="/images/dime.png" width="10px" height="10px" /></span></td>
						</tr>
						<tr>
							<td style="text-align: right;">&nbsp;<strong><span style="text-decoration: underline;">Crew Purchase:</span></strong></td>
							<td>&nbsp;{sale_block.CREW_SALE}</td>
						</tr>
					</tbody>
				</table>
			</div></div>
		<!-- END sale_block -->
		</div>
		<div id='latertoday'>
		<!-- IF not S_GROUP_11 -->
			<div class="rules">Unfortunately you're not allowed to view the up coming sales!</div>
		<!-- ELSE -->
		<!-- BEGIN sale_block_later -->
			<div class="panel <!-- IF sale_block_later.S_ROW_COUNT is odd -->bg2<!-- ELSE -->bg3<!-- ENDIF -->"><div class="inner">
				<table>
					<tbody>
						<tr><td colspan="3"><h2><img src="/images/sale.png" width="38px" height="15px"/> {sale_block_later.ITEM_NAME}</h2></td></tr>
						<tr>
							<td rowspan="5"><img src="{sale_block_later.ITEM_IMAGE}" /></td>
							<td style="text-align: right;"><span style="text-decoration: underline;"><strong>Sale Starts:</strong></span></td>
							<td>&nbsp;{sale_block_later.SALE_START_DATE} <em>at</em> {sale_block_later.SALE_START_TIME} <em>(EST)</em></td>
						</tr>
						<tr>
							<td style="text-align: right;"><span style="text-decoration: underline;"><strong>Sale Ends:</strong></span></td>
							<td>&nbsp;{sale_block_later.SALE_ENDS_DATE} <em>at</em> {sale_block_later.SALE_ENDS_TIME} <em>(EST)</em></td>
						</tr>
						<tr>
							<td style="text-align: right;"><strong><span style="text-decoration: underline;">Original Price</span>:</strong></td>
							<td>&nbsp;<span style="color: #ff0000; text-decoration: line-through;">{sale_block_later.ORIGINAL_PRICE}</span> <img src="/images/dime.png" width="10px" height="10px" /></td>
						</tr>
						<tr>
							<td style="text-align: right;"><span style="text-decoration: underline;"><strong>Sale Price:</strong></span></td>
							<td><span style="color: #008000;">&nbsp;{sale_block_later.SALE_PRICE} <img src="/images/dime.png" width="10px" height="10px" /></span></td>
						</tr>
						<tr>
							<td style="text-align: right;">&nbsp;<strong><span style="text-decoration: underline;">Crew Purchase:</span></strong></td>
							<td>&nbsp;{sale_block_later.CREW_SALE}</td>
						</tr>
					</tbody>
				</table>
			</div></div>
		<!-- END sale_block_later -->
		<!-- ENDIF -->
		</div>
However, no matter how I try to code it, it does not work. If I add <!-- IF S_GROUP_5 --> nobody can see it, not even I myself, eventhough I am in the Administrators group. if I set it up differently and make it so <!-- IF not S_GROUP_1 -->, guests can still see it.

So the question is, is there any specific thing I need to load in the php-file or something, as this is clearly not working as it should.

Cheers,
phpBB Studio / Member of the Studio

Contributing: You can do it too! Including testing Pull Requests (PR).
phpBB Development and Testing made easy.
User avatar
stefd75
Registered User
Posts: 10
Joined: Sat Feb 20, 2016 1:39 pm

Re: [RC] Group Template Variables

Post by stefd75 »

Hello !

i've this ext on 3.1.7 pl1
all is ok, but i don't understand why, it works everywhere but not in attachment.html !
do u you why ?

i test it in viewtopic_body it's ok, but not in attachment.hmtl
User avatar
martti
Registered User
Posts: 911
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [RC] Group Template Variables

Post by martti »

stefd75 wrote:Hello !

i've this ext on 3.1.7 pl1
all is ok, but i don't understand why, it works everywhere but not in attachment.html !
do u you why ?

i test it in viewtopic_body it's ok, but not in attachment.hmtl
I've updated the extension and it should work now. Thanks for reporting.
User avatar
stefd75
Registered User
Posts: 10
Joined: Sat Feb 20, 2016 1:39 pm

Re: [RC] Group Template Variables

Post by stefd75 »

Perfect Martti ! it works
<3
Josvdwoude
Registered User
Posts: 2
Joined: Wed Dec 09, 2015 12:05 am
Location: Netherlands
Name: Jos van der Woude
Contact:

Re: [RC] Group Template Variables

Post by Josvdwoude »

Thank you for this add-on!

Was looking for something to only show new registered people, looks like you done it. Cheers!
User avatar
gianluigi.zanettini
Registered User
Posts: 113
Joined: Fri Sep 07, 2007 9:09 pm
Location: Ferrara, Italy
Contact:

Re: [RC] Group Template Variables

Post by gianluigi.zanettini »

This extensions was a godsend for me, thanks!!

This is to report that it works great on phpBB 3.2 too ;)
User avatar
WelshPaul
Registered User
Posts: 420
Joined: Tue Aug 19, 2014 2:09 pm

Re: [RC] Group Template Variables

Post by WelshPaul »

gianluigi.zanettini wrote: Sat Jan 07, 2017 11:00 pm This extensions was a godsend for me, thanks!!
Same! :)

I just tested this on 3.2 and it appears to work just fine. Was going to work on updating it for phpBB 3.2 otherwise. This is a must extension for my forum. :mrgreen:
Post Reply

Return to “Extensions in Development”