Jump to content


Sign In

block

  • Please log in to reply
9 replies to this topic

#1 emoney emoney

emoney

    Administrator

  • Administrators
  • 1,091 posts

Posted 15 February 2012 - 10:18 PM

Here is a block that provides a login form. It is recommended to turn on permissions and only show to Guests (for obvious reasons).

Then create a new Custom Sidebar Block with the following data:

Name: Sign In
Enabled : Yes
Hide From Main Custom Block: Depends on where you want it
Full Image Name: key.png (or whatever you wish as long as it is in the proper directory and use reference it)
Enable RAW HTML/JS mode: No
Enable PHP Mode: Yes
Use Table/Border/Title/Image?: Yes
Remove Ability for User to Collapse Block? Up to you


$loginBox  = "";
$loginBox .= "<form id='login' method='post' action='{$this->settings['base_url']}app=core&amp;module=global&amp;section=login&amp;do=process'>
<input type='hidden' value='{$this->member->form_hash}' name='auth_key'>
<div class='ipsForm'>
<fieldset>
<ul>
<li class='ipsField ipsField_primary'>
<label class='ipsField_title' for='ips_username'>User name</label>
<div class='ipsField_content'>
<input type='text' size='10' name='ips_username' class='input_text' id='ips_username'>
</div>
</li>
<li class='ipsField ipsField_primary'>
<label class='ipsField_title' for='ips_password'>Password</label>
<div class='ipsField_content'>
<input type='password' size='10' name='ips_password' class='input_text' id='ips_password'><br />
<a title='Retrieve password' href='{$this->settings['base_url']}app=core&amp;module=global&amp;section=lostpass'>I've forgotten my password</a>
</div>
</li>
<li class='ipsField ipsField_checkbox'>
<input type='checkbox' class='input_check' value='1' name='rememberMe' checked='checked' id='inline_remember'>
<div class='ipsField_content'>
<label for='inline_remember'>
<strong>Remember me</strong>
<span class='desc lighter'>This is not recommended for shared computers</span>
</label>
</div>
</li>
<li class='ipsField ipsField_checkbox'>
<input type='checkbox' class='input_check' value='1' name='anonymous' id='inline_invisible'>
<div class='ipsField_content'>
<label for='inline_invisible'>
<strong>Sign in anonymously</strong>
<span class='desc lighter'>Don't add me to the active users list</span>
</label>
</div>
</li>
</ul>
</fieldset>
<div class='ipsForm_submit ipsForm_center'>
<input type='submit' value='Sign In' class='ipsButton'>
</div>
</div>
</form>";
return $loginBox;

DogPatch Was Here :D

#2 pamamolf

pamamolf

    Member

  • Members
  • PipPip
  • 12 posts

Posted 19 February 2012 - 04:49 PM

Hello

I have disable on ACP the option for users to sign in anonymous and i want to remove also this option from this sidebar sign in block.

How can i do this?

Also i want please to add the I've forgotten my password under the password field (where i have the green box) so it will look better and all text in one line.

How can i do this also?

Posted Image

Thank you

#3 emoney emoney

emoney

    Administrator

  • Administrators
  • 1,091 posts

Posted 19 February 2012 - 05:54 PM

Remove this from the content to remove the anonymously part:

<li class='ipsField ipsField_checkbox'>
<input type='checkbox' class='input_check' value='1' name='anonymous' id='inline_invisible'>
<div class='ipsField_content'>
<label for='inline_invisible'>
<strong>Sign in anonymously</strong>
<span class='desc lighter'>Don't add me to the active users list</span>
</label>
</div>
</li>

And I guess put another <br /> before

<a title='Retrieve password' href='{$this->settings['base_url']}app=core&amp;module=global&amp;section=lostpass'>I've forgotten my password</a>

DogPatch Was Here :D

#4 pamamolf

pamamolf

    Member

  • Members
  • PipPip
  • 12 posts

Posted 19 February 2012 - 06:43 PM

Great thanks :)

#5 nolimits

nolimits

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 16 March 2012 - 06:43 AM

Man

why it does not work when logging just a little bit to edit?

i want like that:

$loginBox  = "";
$loginBox .= "<form id='login' method='post' action='{$this->settings['base_url']}app=core&module=global§ion=login&do=process'>
<input type='hidden' value='{$this->member->form_hash}' name='auth_key'>
<div class='ipsForm'>
<fieldset>
<ul>
<li class='ipsField ipsField_primary'>
<label class='ipsField_title' for='ips_username'>Login</label>
<input type='text' size='10' name='ips_username' class='input_text' id='ips_username'>
</li>
<li class='ipsField ipsField_primary'>
<label class='ipsField_title' for='ips_password'>Hasło</label>
<input type='password' size='10' name='ips_password' class='input_text' id='ips_password'>
</li>
<li class='ipsField ipsField_checkbox'>
<input type='checkbox' class='input_check' value='1' name='rememberMe' checked='checked' id='inline_remember'>
<div class='ipsField_content'>
<label for='inline_remember'>
<strong>Zapamiętaj</strong>
</label>
</div>
</li>
</ul>
</fieldset>
<input type='submit' value='Zaloguj' class='ipsButton'>
</div>
</form>";
return $loginBox;


#6 emoney emoney

emoney

    Administrator

  • Administrators
  • 1,091 posts

Posted 16 March 2012 - 08:38 AM

Its because the form action url is messed up, because of a bug in how CSB parses the block contents after a save. See how it says: "global§ion"? I went ahead and pushed the changes to the CSB 2.0 download here. I donated you some points so you can buy it, so go download it and upload the files, and that should take care of it. You'll need to manually fix that error in the url to the one in the first post of this thread, then save again and it should stay proper now. :)
DogPatch Was Here :D

#7 nolimits

nolimits

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 19 March 2012 - 01:22 PM

"You'll need to manually fix that error in the url to the one in the first post of this thread"

i dont understand ?

#8 nolimits

nolimits

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 19 March 2012 - 01:46 PM

I must install this again ? http://emoneycodes.c...sidebar-blocks/

#9 emoney emoney

emoney

    Administrator

  • Administrators
  • 1,091 posts

Posted 19 March 2012 - 06:05 PM

Yeah, I fixed something in it, so redownload it and upload the new files.

Then start over with this tutorial and your changes. Pay attention the URL line: $loginBox .= "<form id='login' method='post' action='{$this->settings['base_url']}app=core&amp;module=global&amp;section=login&amp;do=process'>.

Make sure you use that one, and not the one messed up in your post above.
DogPatch Was Here :D

#10 BogdanWDK

BogdanWDK

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 21 March 2012 - 12:21 PM

i was in same problem and i fixed it now!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users