Custom page, login

Discussion forum for MOD Writers regarding MOD Development.
Korkel
Registered User
Posts: 391
Joined: Mon Jun 02, 2014 7:09 am
Location: ~/home/Liz/Desktop
Name: Liz Aalderink
Contact:

Re: Custom page, login

Post by Korkel »

irdem wrote:hi,
recheck your group id if it is correct and try this:

Code: Select all

    <!-- IF not S_GROUP_15 -->Here comes the text.<!-- ENDIF -->
Must I add it in the .html or .php?
"If you lose your left arm, your right arm will be left."
“The most important property of a program is whether it accomplishes the intention of its user.”
Image

Korkel
Registered User
Posts: 391
Joined: Mon Jun 02, 2014 7:09 am
Location: ~/home/Liz/Desktop
Name: Liz Aalderink
Contact:

Re: Custom page, login

Post by Korkel »

Merge this post pleas.

Added in .html file, but as guest I can access also the downloads then, and I see the text also and I'm in that group.
"If you lose your left arm, your right arm will be left."
“The most important property of a program is whether it accomplishes the intention of its user.”
Image

User avatar
irdem
Registered User
Posts: 172
Joined: Sat Oct 13, 2007 10:31 pm
Contact:

Re: Custom page, login

Post by irdem »

yes because:

Code: Select all

        <!-- IF not S_GROUP_15 -->Only the members of this group can not access to this content.<!-- ENDIF -->
you use this statement in html page.

Korkel
Registered User
Posts: 391
Joined: Mon Jun 02, 2014 7:09 am
Location: ~/home/Liz/Desktop
Name: Liz Aalderink
Contact:

Re: Custom page, login

Post by Korkel »

Yes, but how must I get it working 100%?! :S
"If you lose your left arm, your right arm will be left."
“The most important property of a program is whether it accomplishes the intention of its user.”
Image

User avatar
irdem
Registered User
Posts: 172
Joined: Sat Oct 13, 2007 10:31 pm
Contact:

Re: Custom page, login

Post by irdem »

it depends what you want to do:
for exemple:

Code: Select all

    <!-- IF S_GROUP_N or S_GROUP_X -->The group id: N and group id: X can access to this content<!-- ENDIF -->
if you made this change before:
Creating group template switches

Korkel
Registered User
Posts: 391
Joined: Mon Jun 02, 2014 7:09 am
Location: ~/home/Liz/Desktop
Name: Liz Aalderink
Contact:

Re: Custom page, login

Post by Korkel »

irdem wrote:it depends what you want to do:
for exemple:

Code: Select all

    <!-- IF S_GROUP_N or S_GROUP_X -->The group id: N and group id: X can access to this content<!-- ENDIF -->
I want hide the content for EVERYONE who is not a member of group ID 15.
"If you lose your left arm, your right arm will be left."
“The most important property of a program is whether it accomplishes the intention of its user.”
Image

User avatar
bonelifer
Community Team Member
Community Team Member
Posts: 3492
Joined: Wed Oct 27, 2004 11:35 pm
Name: William
Contact:

Re: Custom page, login

Post by bonelifer »

Look at this post viewtopic.php?p=8675775#p8675775

Where the number "2" in S_GROUP_2 is the group number.

so S_GROUP_15 and it will only show the content in between the tags to that group.
Knowledge Base | phpBB Board Rules | Search Customisation Database
Image
Please don't contact me via PM or email for phpBB support .

Korkel
Registered User
Posts: 391
Joined: Mon Jun 02, 2014 7:09 am
Location: ~/home/Liz/Desktop
Name: Liz Aalderink
Contact:

Re: Custom page, login

Post by Korkel »

That doesn't work for me, no idea where I must add that code to make it work fully. ;(
"If you lose your left arm, your right arm will be left."
“The most important property of a program is whether it accomplishes the intention of its user.”
Image

User avatar
bonelifer
Community Team Member
Community Team Member
Posts: 3492
Joined: Wed Oct 27, 2004 11:35 pm
Name: William
Contact:

Re: Custom page, login

Post by bonelifer »

That post clearly states what file and where:

OPEN this file: includes/functions.php

FIND this in that FILE.

Code: Select all

   // The following assigns all _common_ variables that may be used at any point in a template.
BEFORE, ADD (Add this code BEFORE that code you just found)

Code: Select all

    if ( !function_exists('group_memberships') )
    {
        include($phpbb_root_path . 'includes/functions_user.'.$phpEx);
    }
    $groups = group_memberships(false,$user->data['user_id']);
    foreach ($groups as $grouprec)
    {
        $template->assign_vars(array(
        'S_GROUP_' . $grouprec['group_id'] => true
        ));
    }
then use the switch like so
Where it says "some stuff here". The tags before, go before the code you want to hide. the ENDIF goes at the end of the code you want to hide.

Code: Select all

<!-- IF S_GROUP_2 -->some stuff here<!-- ENDIF -->
Credit = RMcGirr83

It really can't get any clearer than that.
Knowledge Base | phpBB Board Rules | Search Customisation Database
Image
Please don't contact me via PM or email for phpBB support .

Korkel
Registered User
Posts: 391
Joined: Mon Jun 02, 2014 7:09 am
Location: ~/home/Liz/Desktop
Name: Liz Aalderink
Contact:

Re: Custom page, login

Post by Korkel »

That is what I did, but I can see the downloads even if I'm not in GROUP 15.
"If you lose your left arm, your right arm will be left."
“The most important property of a program is whether it accomplishes the intention of its user.”
Image

User avatar
irdem
Registered User
Posts: 172
Joined: Sat Oct 13, 2007 10:31 pm
Contact:

Re: Custom page, login

Post by irdem »

Korkel wrote:I want hide the content for EVERYONE who is not a member of group ID 15.

Code: Select all

    <!-- IF S_GROUP_15 -->you can hide this content for everyone except for the members of group id 15<!-- ENDIF -->

Korkel
Registered User
Posts: 391
Joined: Mon Jun 02, 2014 7:09 am
Location: ~/home/Liz/Desktop
Name: Liz Aalderink
Contact:

Re: Custom page, login

Post by Korkel »

irdem wrote:
Korkel wrote:I want hide the content for EVERYONE who is not a member of group ID 15.

Code: Select all

    <!-- IF S_GROUP_15 -->you can hide this content for everyone except for the members of group id 15<!-- ENDIF -->
So the code must look like this?

Code: Select all

<!-- INCLUDE overall_header.html -->

<h2>CorelX Beginnerslessen</h2>

<div class="panel">
   <div class="inner"><span class="corners-top"><span></span></span>
   <!-- IF S_GROUP_15 -->
   <div class="content">
      <p>
 <ul>
 <li><a href=/forum/begles/Bles01.rar>Beginnersles 1</a></li><br>
 <li><a href=/forum/begles/Bles02.zip>Beginnersles 2</a></li><br>
 <li><a href=/forum/begles/Bles03.zip>Beginnersles 3</a></li><br>
 <li><a href=/forum/begles/Bles04.zip>Beginnersles 4</a></li><br>
 <li><a href=/forum/begles/Bles05.zip>Beginnersles 5</a></li><br>
 <li><a href=/forum/begles/Bles06.zip>Beginnersles 6</a></li><br>
 <li><a href=/forum/begles/Bles07.zip>Beginnersles 7</a></li><br>
 <li><a href=/forum/begles/Bles08.zip>Beginnersles 8</a></li><br>
 <li><a href=/forum/begles/Bles09.zip>Beginnersles 9</a></li><br>
 <li><a href=/forum/begles/Bles10.zip>Beginnersles 10</a></li><br>
 </ul>
      </p>
   </div>
  <!-- ENDIF -->
   <span class="corners-bottom"><span></span></span></div>
</div>
<!-- INCLUDE jumpbox.html -->
<!-- INCLUDE overall_footer.html -->
Got it working, but If I add myself to group 15 I don't see the content.

It only shows an other text what I added.
Last edited by marian0810 on Fri Jun 27, 2014 9:10 am, edited 1 time in total.
Reason: posts merged as per https://www.phpbb.com/rules/#bumping
"If you lose your left arm, your right arm will be left."
“The most important property of a program is whether it accomplishes the intention of its user.”
Image

Korkel
Registered User
Posts: 391
Joined: Mon Jun 02, 2014 7:09 am
Location: ~/home/Liz/Desktop
Name: Liz Aalderink
Contact:

Re: Custom page, login

Post by Korkel »

Someone? :mrgreen:
"If you lose your left arm, your right arm will be left."
“The most important property of a program is whether it accomplishes the intention of its user.”
Image

User avatar
tbackoff
Former Team Member
Posts: 7029
Joined: Thu Jun 04, 2009 1:41 am
Location: cheerleading practice
Name: Tabitha Backoff

Re: Custom page, login

Post by tbackoff »

That code looks correct. Do you have a test account?
Flying is the second best thrill to cheerleaders; being caught is the first.

Korkel
Registered User
Posts: 391
Joined: Mon Jun 02, 2014 7:09 am
Location: ~/home/Liz/Desktop
Name: Liz Aalderink
Contact:

Re: Custom page, login

Post by Korkel »

tmbackoff wrote:That code looks correct. Do you have a test account?
Sure.

Code: Select all

http://www.cilia1.nl/forum
test
tester123
"If you lose your left arm, your right arm will be left."
“The most important property of a program is whether it accomplishes the intention of its user.”
Image

Locked

Return to “[3.0.x] MOD Writers Discussion”