Welcome, Guest. Please login or register.
Did you miss your activation email?
04 Jul 2009, 17:40

Login with username, password and session length
Home Chat Help Search Calendar Login Register
Pages: [1]
Print
Author Topic: Custom Content Module for newbies (my way)  (Read 10694 times)
0 Members and 1 Guest are viewing this topic.
ivancar
Guest
« on: 30 May 2006, 12:52 »

Hello all

I've recently got some problems to understand how the Custom Content Module works, so here's detailed thread, at my way

Our goal: Create a Team Area with some pages for team group members only.
The members of the team group will be added manually from the administrator or will can register by themselves
(in any case they will have to be activated by the administrator)

Modules to install: CMSMailer, Frontend users, Self Registration, Custom Content.

To install the modules you need just to decompress the files and put the related folders inside the Modules folder of your CMSMS,
then install them from the admin control panel/modules. If you'll be warned right after installation to grant the permissions for the module, activate it under Users&Groups/Group permissions, choosing Admin group and click on the corresponding checkbox.
press Submit to save changes

CMS Mailer module: it's needed to install the Frontend users, so we'll install it first.
Go to the preferences of the module. (exstensions/CMS Mailer) Here follow the instructions in according of your host provider.
You can choose as method to send the emails : mail, sendmail, SMTP. Follow the instructions, and try if all works with the test option in the bottom. (under linux, my best choice has been sendmail )
press Submit

Frontend users: That's the module that gives you new controls on users of your site. It's used by Custom Content to the authentication of logging people in the private area. Install it and give the Admin group the requested permissions.
The Module allows you to create new groups assigning them, activating, deleteting new users.
(NOTE: the groups and the users are'nt the same as those created with the original group/user interface of the CMSMS.)

1) Go in Users&Groups/Frontend users Managements

2) we add a new property that will be used to build 2 groups: pending and team
The new (selfregistered) users will added automatically to the pending group (with no access to the private Team Area)
let's call it email, prompt Email address, type Email Address - press Submit

3) In Groups we Add new group: pending  check required for the email adress property - press Submit
                               Add new group: team (allowed access) check every choice you want for email - press Submit

4) Preferences: PageID/Alias to jump to after logout: home (or whatever page you want)

5) Logout Template: replace the code with the following

<!-- Logout form template -->
 {$startform}
<p><b>{$prompt_loggedin}&nbsp;{$username}</b>&nbsp;&nbsp;&nbsp;{$link_logout}
&nbsp;&nbsp;&nbsp;{$link_changesettings}</p>
{$endform}
<!-- Logout form template -->

press Submit
_______________________________

Self Registration: Preferences: check the box Send an email notification when someone registers
                                                   check the box Require the user to confirm registration via email
                                                   enter your email address were the notification will be sent and check the box
press Submit     

Now :

go to Content and create 2 pages:

Registration, parent: Home, in Options deactivate Show in Menu:
put as content the code: {cms_module module=SelfRegistration group=pending}
Submit

Team Area


Under Layout/Templates copy the template you want to apply to the protected pages:(2nd icon after CSS) Bulletmenuvert 1col
give it a name: i.e. Access_BullVert1col

open the new template, find the code:
<!-- Start Content Area -->
      <div id="main">

after add:
{cms_module module=CustomContent}
      <!--customContent: startif group=team -->

below find:
<p>{cms_selflink dir="previous"} <br />
            {cms_selflink dir="next"}</p>

after add:
                {cms_module module=FrontEndUsers}

        <!--customContent: else -->
       <span style="font-weight: bold;">Team members</span> or <span style="font-weight: bold;">invited </span>guests only, <span style="font-weight: bold;">login</span> or <a href="index.php?page=31"><span style="font-weight: bold;">register</span></a><br /><br />{cms_module module=FrontEndUsers}
        <!--customContent: endif -->

note: the <a href="index.php?page=31"> part it's only the link of the word register to the Registration page, read the CMSMS documentation on how create a link using the text editor...

press Submit

open the Team Area page and assign it the template Access_BullVert1col, modified

press Submit

At this point the self registered users will be found in the Frontend users Management, you can then move who you want allow to access, from the pending group to the team group. Of course you can do that manually simply adding a new user and assign him/her to the team group. All accounts have a expiring time. I noticed that if i choose the max expiring data, in my system dont works.
But i think that a expiring time for the, let's say, 2030 should be more than acceptable ;o)

That's all, i hope that could help (my apologizes, Calguy 1000, for any mystake)

follows some screenshoots of the result



[attachment deleted by admin]
« Last Edit: 30 May 2006, 13:24 by ivancar » Logged
Elijah Lofgren
I follow Jesus Christ, enjoy reading, writing, helping people, and making websites.
Power Poster
***

Karma: 81
Offline Offline

Posts: 835

Location: Deatsville, AL



WWW
« Reply #1 on: 30 May 2006, 13:14 »

Wow, nice tutorial.  Smiley

It'd be cool if you'd post it in the wiki so it'll be easy for people to find it: http://wiki.cmsmadesimple.org/index.php/User_Handbook
Logged

Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. Smiley
My CMSMS site: http://www.elijahlofgren.com/
mark
Administrator
Power Poster
*****

Karma: 131
Offline Offline

Posts: 6566

Location: Arizona



WWW
« Reply #2 on: 30 May 2006, 18:16 »

real nice!...  Cheesy
Logged

Go to Extensions Modules/Tags click the name of the module/tag or the word Help to the right to get the parameters it takes...
Right click and view source is a great way to see what you have to work with...
Not sure what ver. CMSMS, PHP, server OS, etc. look at the System Information page...
OK if you removed the default content read it here... http://multiintech.com/defaultcontent/
People are Wonderful... Business is Great... Life is Terrific
mustis
Forum Members
**

Karma: 0
Offline Offline

Posts: 67

Location: Norway



« Reply #3 on: 01 Aug 2006, 05:10 »

Hmm
It seems that everyone can see the protected (Team Area) even after I followed this tutorial.

any sugestion?
Logged
newclear
Forum Members
**

Karma: 2
Offline Offline

Posts: 81

Location: Bulgaria


« Reply #4 on: 15 Aug 2006, 05:19 »

Hmm
It seems that everyone can see the protected (Team Area) even after I followed this tutorial.

any sugestion?


You can add different custom content when login pending user. this should be more than enough for your imagine. I check the way of login. if you not a member yet you still login in pending team. just dont use {cms_module module=FrontEndUsers} because it will output that you can sign out and change settings. That makes the user still pending so message can be "sorry man, please wait the admin to approve you here Smiley"

I want to know how can I add login in frontend users with email for identification not username. Some users prefer to remember only their mail . I saw a option in FE users that disallow multiple accounts.

Svilen
« Last Edit: 15 Aug 2006, 05:55 by newclear » Logged

CMSMS ADDICTED
djkirstyjay
Forum Members
**

Karma: 0
Offline Offline

Posts: 149

Location: Tenerife, Spain


WWW
« Reply #5 on: 17 Aug 2006, 16:16 »

I've just installed this, following the instructions to the letter, everything worked fine. I registered, moved myself from pending to team (or members as I called it)... however when I went to login, it took me to the members area but I also got the following messeage on the page :

Fatal error: Call to a member function GetContent() on a non-object in /home2/shb3_150/armadasur.com/public_html/content/lib/classes/class.module.inc.php on line 2531

I would also like to know how I can put a logout link on the page...?
« Last Edit: 17 Aug 2006, 16:49 by djkirstyjay » Logged
dellington
Guest
« Reply #6 on: 24 Aug 2006, 13:20 »

Great tutorial! I followed all the steps and my restricted content page works exactly as it should.

I have one area of concern, however. I currently have 60 separate groups I want to create unique, restricted pages for, and I want to be able to scale to several hundred. Following the system outlined in the tutorial above, I would need to create an individual template for each group. Or I suppose there may be some sort of looping script that could be written to allow the same template to be used on every restricted-content page, but I'm not sure how this script would be written. Anyway I had assumed that the Custom Content module would have this kind of functionality right out of the box, so to speak.

This is the code in the template that concerns me:

Code:
<!--customContent: startif group=team -->

Any suggestions on how to proceed?
Logged
paragulka
Guest
« Reply #7 on: 07 Sep 2006, 11:57 »

hello, im following the logic you used, but im stuck here.

whenever someone from the pending group logs in, the page design is mixed up and i get an eror message at the top of the page:
DEBUG: this user(6) is not a member of group team

so it seems that whenever someone is not from the team group, this error occures, just as the customcontent would NEED to have the suer from the team group.

here's my piece of code:
<!--customContent: startif group=team -->
aaa
<!--customContent: else -->
bbb
<!--customContent: endif -->

any thoughts how i could fix this?

BTW: Running 1.0beta6 with CustomContent 1.41
« Last Edit: 07 Sep 2006, 12:11 by paragulka » Logged
paragulka
Guest
« Reply #8 on: 07 Sep 2006, 12:15 »

PROBLEM SOLVED

I simply replaced the line

echo "DEBUG: this user($uid) is not a member of group $g<br/>";

with

break;

in CustomContent.php

and now it works
Logged
Pages: [1]
Print
Jump to: