Joomla! Discussion Forums



It is currently Wed Nov 25, 2009 5:15 pm (All times are UTC )

 


Forum rules

Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.



Post new topic Reply to topic  [ 47 posts ]  Go to page Previous  1, 2
Author Message
Posted: Sun Jan 28, 2007 8:59 am 
Joomla! Intern
Joomla! Intern
Offline

Joined: Thu Oct 12, 2006 8:18 am
Posts: 81
I've had some fun with this :)

I have created the module, inserted the code and pretty much have a basic 'welcome' message running with the log-in... so far so good!

The only problem I have so far is the welcome message is still appearing on the 'logged-in' pages.  Would really appreciate it if someone could guide me how to hide the new module I created from registered and logged-in users.


Top
  E-mail  
 
Posted: Tue Feb 20, 2007 7:36 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Tue Mar 14, 2006 10:09 pm
Posts: 6
Toubkal,

Many thanks for this solution. I have spent a couple of days trying different things to get it to work the way I would like, but I have run into problems. In the quote below, you mention using two stylesheets.

toubkal wrote:
thedude wrote:
Thanks so much for the reply toubkal.

Here is another question and I am trying to make it very simple for myself. Would this chunck of code work putting two templates on one page?

Code:
<?php if ( $my->id) {?>
code for one template
<?php }
else {?>
code for the second template
<?php } ?>


Is it missing anything?

Thanks


Yes, you can do that. You may be able to use just 1 css stylesheet for both but if you wanted to use 2 diferent ones you can just place more (or all) of the template code within the IF / ELSE statement so that a different stylesheet is referenced for each situation.


I understood your directions to mean that I should put all the code for my second template in the appropriate area. I did so, and I get a combination of the two templates. The main header graphic from the first template remains while only some of the text of the second template shows.

I want to do what Wolfcreek describe in the following post:

wolfcreek wrote:
keliix06 wrote:
Couldn't you make the first page in the main menu the login component then just assign a minimal template to that menu item? Then just set all of your content to only be accessable by registered users?


That's usually how it's done, but this hack allows you to verify memberships/registered users by assigning a specific template to certain areas.  It's also another way to force registration instead of just displaying "You have to be a registered user to access this page" or "You are not authorized to view this".  Instead of a DENIED, you give them the alternative to register.  I find it keeps surfers in house and empowers them to get to the information. It's allowed my site to increase in size, instead of deterring the visitor to just close the window or decide it's not worth it.

It's all a matter of how you want to approach things, and whether or not you feel it's necessary.  For those of using Community Builder and some sort of Account payment system, it helps to drive sales, and/or develop mailing lists for future info and releases.

Just my opinion.

Wolf.


Part of my problem is that I don't know how to invoke the registration component. Your original solution invoked it because the user had requested it. I don't want to do that. When the page loads, if the user is already logged in because they set their logged in status to "forever", they go to the registered user's template (template 1), other wise they go to the much simpler template with the registration component invoked (template 2) and the login at the bottom of the page in case a registered user logged out they can log back in..

Does this description make sense? I would greatly appreciate some help with this if you can find the time. FYI, the two templates I am using are js_nova from JoomlaShack (the most simple template I could fined.)  and rhuk_solarflare_ii which comes with the Joomla installation package.

Hope to hear from you.

Jerry Nielsen


Last edited by jnnielsen on Tue Feb 20, 2007 7:38 pm, edited 1 time in total.

Top
   
 
Posted: Wed Feb 21, 2007 10:14 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Tue Feb 20, 2007 10:29 am
Posts: 19
OMG THANK YOU!!!! toubkal


Top
   
 
Posted: Wed Mar 28, 2007 10:37 am 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Tue Mar 27, 2007 11:24 pm
Posts: 3
Hi everyone...

Okay - I'm very new into Joomla, CSS, HTML and everything regarding coding at all... So I was wondering if there was a nice lad, who wanted to help me out?

I just want a frontpage with a simple login - like you explained in this thread, and then an expanded profile, where you have to answer some of the fields, which is user predefined by me... Eventually com builder...

But I would like it to be integrated with the site - as well as a members list - I know it's easy for some... And maybe it will take some approx 10 minutes... So if anyone would be so kind?

Please mail me at mark at juzt dot org, or msn: thejuzt at gmail dot com...

It would save my day! :-)


Top
   
 
Posted: Mon Apr 02, 2007 9:37 am 
Joomla! Enthusiast
Joomla! Enthusiast
Offline

Joined: Fri Nov 25, 2005 1:13 pm
Posts: 166
Just wondering has anyone got any beautified examples of this working,

toubkal's verion as he states is a minimal template for the login form, would like to see somebpdy's spiced up version if possible.

Great Hack!

_________________
http://www.phuketdesign.com


Top
  E-mail  
 
Posted: Sat Aug 18, 2007 3:45 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Fri Aug 10, 2007 8:17 am
Posts: 21
This is a great workaround and perfect for me as I am building a site which I want to restrict to only staff members.

I have implemented the workaround with a nice logo - I have done the logo through creating a user defined module and assigning it to user 5

I have one minor issue which is that I would like the login boxes to be central - is there any way that I can do this?

see the web site for details....  http://www.roebuck.uk.com


Top
   
 
Posted: Mon Aug 20, 2007 12:54 am 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Mon Aug 20, 2007 12:41 am
Posts: 1
The administrator login page is a really cool and simple layout which is easily customised.
An elegant solution to the login issue would to be to somehow clone the administrator login page and use this for access to the main site.
I think this would be useful for many people wishing to create totally private sites, like myself.
Can anyone advise on how this may be achieved?
Many thanks!


Top
  E-mail  
 
Posted: Thu Aug 23, 2007 8:06 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Thu Aug 09, 2007 7:36 pm
Posts: 17
rob840 wrote:
The administrator login page is a really cool and simple layout which is easily customised.

An elegant solution to the login issue would to be to somehow clone the administrator login page and use this for access to the main site.

Can anyone advise on how this may be achieved?



Umm.. here's a question for you.

Why don't create a custom php file copying the HTML, then customizing, and store it in the main directory, and submit the new login form to the right user processing script..?

Sounds pretty simple to me.

_________________
Stealth Data Solutions, LLC
Professional Risk Management Service Provider
1-877-71-STEALTH (78325)
Website - http://stealthdatasolutions.com


Top
  E-mail  
 
Posted: Sun Feb 03, 2008 6:23 am 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Wed Oct 31, 2007 3:44 pm
Posts: 8
I try not to clog up the forums with anything needless but I just had to say -- this is such a clean, simple, genius solution! Thanks so much for posting it, and keeping it current. Much, much appreciated. Thanks,

Brian


Top
  E-mail  
 
Posted: Tue Feb 19, 2008 6:22 am 
Joomla! Enthusiast
Joomla! Enthusiast
Offline

Joined: Thu Aug 23, 2007 2:15 pm
Posts: 170
hmmm...but a question:

this interesting hack requires you putting your login module in the module position user5. good so far. for those of us who want to implement this in a members-only site, we'll probably also choose to center user5 on the page.

however, once the user is logged into the site, the login module is still assigned to user5, which won't look good in the middle of the page anymore. so we hide it...but how does the user then click logout??

is there a way to, once the user is logged in, present the login module elsewhere? in a different module position? or any way to directly link to a logout functionality?


Top
  E-mail  
 
Posted: Tue Feb 19, 2008 10:12 am 
User avatar
Joomla! Hero
Joomla! Hero
Offline

Joined: Thu Aug 18, 2005 4:35 pm
Posts: 2838
Location: Cheshire, England
the basic feature of this is

if NOT logged in >
do NOT_LOGGED_IN_CODE

else >
do IS_LOGGED_IN_CODE

so you are free to have e.g. user5 in the "NOT_LOGGED_IN_CODE" template but you do not need to have user5 in the same place in the "IS_LOGGED_IN_CODE" template output.

you can have user5 in a different place in the IS_LOGGED_IN_CODE template output (or do not have user5 there at all)

there are other alternatives too. If you want the login module to be instead at position left in the main IS_LOGGED_IN_CODE output, you can use the COPY function in the module manager to make a copy of the login module and assign it to e.g. position left

you could also choose to create a menu item of type component and choose login component. This will give you the logout main page to allow users to logout.

_________________
Look at the page source... Lots of useful info...


Top
   
 
Posted: Tue Mar 25, 2008 10:25 pm 
Joomla! Intern
Joomla! Intern
Offline

Joined: Fri Mar 14, 2008 2:20 am
Posts: 60
this is great!!

but it seems like it needs to be changed for 1.5. Can anyone help me out with this. I have my page so it bypasses the first template and only displays the login module, but it does not seem to notice that I am logged in...what I mean is that after logging in it takes me back to the same basic login template and not my original template.

Thanks for any help on this.


Top
  E-mail  
 
Posted: Thu Mar 27, 2008 9:50 pm 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Tue Mar 25, 2008 10:40 pm
Posts: 4
I hate to bump an old thread, but I'm trying to use this and am having some problems with it. :(

It's displaying the community builder login as it should (yes, I changed the code to com_profiler) and it seems to have worked properly once... and, though I've made no changes since the one time it worked, now when I attempt to log in it says "You are not authorised to view this resource." I know I'm using a valid username and pass... so I can't figure out why it won't let me log in.

Additionally... If I go to the "Register" link, it's as if I'm half logged in... It says "You are not authorised to view this resource. " where the main content would be, but it also says "Hi, admin" and has a logout button... So, like, it thinks I'm logged in.. and it gives me access to everything once I actually click on something. (Like, if I click on Home, the "You are not authorised..." message goes away and the content shows up.


Ok, actually, this thing is just inconsistent and buggy as hell, lol... I can't figure it out for the life of me.

I tried again, logged in, said I wasn't authorised, blah blah blah, then when I clicked "Register" it took me right back to the login screen. :(


Top
  E-mail  
 
Posted: Fri Jun 13, 2008 10:59 pm 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Fri Jun 13, 2008 10:51 pm
Posts: 1
It is odd that such work arounds have to be done for what should be a simple web setup. This feature needs to be in the core of Joomla and not requiring such hacking to make this work. The frontpage concept should have two parts: one for public and one for Registered, probably shouldn't forget Special. Maybe some one will come up with a mod or the developers will add this in the next release. The amout of wasted hours spent on trying to make this work is amazing if not ridicules.

Steve Overton
http://www.overtonmedia.com


Top
  E-mail  
 
Posted: Mon Jul 07, 2008 8:40 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Sun Jan 20, 2008 9:30 am
Posts: 19
Fantastic job!!! I was searching for some module or something to get this effect... found one, but it was wasn't working as expected... your solution was like a... I don't know - it is fantastic... thanx :)


Top
   
 
Posted: Fri Jan 30, 2009 12:53 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Tue Jan 29, 2008 5:32 pm
Posts: 6
Anyone needing an updated solution for Joomla 1.5 can look here:

http://forum.joomla.org/viewtopic.php?f=431&t=270163

To save time, here's the basic code for Joomla 1.5 courtesy of lleo:

Code:
<body>
<?php $user =& JFactory::getUser();?>
<?php if ($user->id > 1) : ?>

<!-- user IS logged in so deliver normal template
     Your normal template HTML here -->

<?php else : ?>
<!--  Visitor is NOT logged in so deliver the login page -->

<jdoc:include type="modules" name="<call-module-that-holds-your-login-form-here>" />

    <?php if ($option == 'com_user') : ?>
         <jdoc:include type="component" />
    <?php endif; ?>
<?php endif; ?>

</body>


Top
   
 
Posted: Wed Apr 22, 2009 7:00 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Sat Feb 21, 2009 6:02 pm
Posts: 18
Hi, Thanks for such a neat solution.

I am using Joomla 1.5.8.
I used the same solution and it works but there is a problem.
I am facing a problem that when ever I click on some link "Create Account","Forget Password"
or "Forget User name", it is showing me the blank page without any module on it. I am stuck at this point.

One Thing more I want to display error message on the same page in case wrong user name or password.

Any idea and help please.


Thanks.


Top
  E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 47 posts ]  Go to page Previous  1, 2

Quick reply

 



Who is online

Users browsing this forum: No registered users and 43 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group