2011-08-18, 10:26 PM
2011-08-18, 10:30 PM
Try reverting member_login to orginal.
Admin CP -> Templates & Style -> Templates -> Your Theme -> Member Templates -> member_login -> Options -> Revert to Original.
Admin CP -> Templates & Style -> Templates -> Your Theme -> Member Templates -> member_login -> Options -> Revert to Original.
2011-08-18, 10:32 PM
didn't work
2011-08-18, 10:34 PM
Which theme are you using? I will try it out on my localhost and tell you what I find.
2011-08-18, 10:42 PM
ok i found the problem but dunno how to fix it
its because of Theme's header_welcomeblock_guest template
in default we have
Which use j-script i think
and in my header_welcomeblock_guest
its because of Theme's header_welcomeblock_guest template
in default we have
<script type="text/javascript">
<!--
lang.username = "{$lang->login_username}";
lang.password = "{$lang->login_password}";
lang.login = "{$lang->login}";
lang.lost_password = " — <a href=\"{$mybb->settings['bburl']}/member.php?action=lostpw\">{$lang->lost_password}<\/a>";
lang.register_url = " — <a href=\"{$mybb->settings['bburl']}/member.php?action=register\">{$lang->welcome_register}<\/a>";
lang.remember_me = "{$lang->remember_me}";
// -->
</script>
<span style="float: right;">{$lang->welcome_current_time}</span>
<span id="quick_login">{$lang->welcome_guest} (<a href="{$mybb->settings['bburl']}/member.php?action=login" onclick="MyBB.quickLogin(); return false;">{$lang->welcome_login}</a> — <a href="{$mybb->settings['bburl']}/member.php?action=register">{$lang->welcome_register}</a>)</span>
Which use j-script i think
and in my header_welcomeblock_guest
<div id="memberbar">
<span style="float: left; margin-left: 10px; margin-top: -1px;">
<form action="member.php" method="post">
<input type="text" class="textbox" name="username" value="Username" size="20" onfocus="if(this.value == 'Username') { this.value = ''; }" onblur="if(this.value=='') { this.value='Username'; }" />
<input type="password" class="textbox" name="password" value="password" onfocus="if(this.value == 'password') { this.value = ''; }" onblur="if(this.value=='') { this.value='password'; }" size="20"/>
<label title="{$lang->remember_me_desc}"><input type="checkbox" class="checkbox" name="remember" checked="checked" value="yes" style="vertical-align: middle; margin-top: -1px;" /> {$lang->remember_me}</label>
<span style="margin-left: 8px;">
<input type="submit" class="button" name="submit" value="{$lang->login}" />
<input type="hidden" name="action" value="do_login" />
<input type="hidden" name="url" value="{$redirect_url}" />
</span>
</form>
</span>
<span style="float: right; font-weight: bold; margin-top: 2px; margin-right: 10px;">
<img class="icon" src="{$theme['imgdir']}/key.png" alt="" /><a href="{$mybb->settings['bburl']}/member.php?action=lostpw">{$lang->lost_password}</a>
-
<img class="icon" src="{$theme['imgdir']}/register.png" alt="" /><a href="{$mybb->settings['bburl']}/member.php?action=register">{$lang->welcome_register}</a>
</span>
</div>
2011-08-18, 10:48 PM
Try replacing it with this:
<div id="memberbar">
<span style="float: left; margin-left: 10px; margin-top: -1px;">
<form action="member.php" method="post">
<input type="text" class="textbox" name="username" value="Username" size="20" onfocus="if(this.value == 'Username') { this.value = ''; }" onblur="if(this.value=='') { this.value='Username'; }" />
<input type="password" class="textbox" name="password" value="password" onfocus="if(this.value == 'password') { this.value = ''; }" onblur="if(this.value=='') { this.value='password'; }" size="20"/>
<input type="hidden" name="action" value="do_login" />
<input type="hidden" name="url" value="{$redirect_url}" />
<label title="{$lang->remember_me_desc}"><input type="checkbox" class="checkbox" name="remember" checked="checked" value="yes" style="vertical-align: middle; margin-top: -1px;" /> {$lang->remember_me}</label>
<span style="margin-left: 8px;">
<input type="submit" class="button" name="submit" value="{$lang->login}" />
<input type="hidden" name="action" value="do_login" />
<input type="hidden" name="url" value="{$redirect_url}" />
</span>
</form>
</span>
<span style="float: right; font-weight: bold; margin-top: 2px; margin-right: 10px;">
<img class="icon" src="{$theme['imgdir']}/key.png" alt="" /><a href="{$mybb->settings['bburl']}/member.php?action=lostpw">{$lang->lost_password}</a>
-
<img class="icon" src="{$theme['imgdir']}/register.png" alt="" /><a href="{$mybb->settings['bburl']}/member.php?action=register">{$lang->welcome_register}</a>
</span>
</div>
2011-08-18, 10:52 PM
your code is same as mine
for making sure i replaced but didn't help
so i looked at the general.js and found how with default theme we can logging normally
it does with this j-script code :
anyone knows how can i make a html code which works like this j-script code?
after wasting 3 and half hours i replaced the default header_welcomeblock_guest template in my theme's header_welcomeblock_guest template template, i found that even default template doesn't work properly with my portal.php (after clicking on "login" , boxes doesn't appear.instead it redirects me to login page)
probably because of using some jQuery in portal.php
so i replaced the old one and users will have some fun with logging in
i hate wasting my time for nothing
for making sure i replaced but didn't help
so i looked at the general.js and found how with default theme we can logging normally
it does with this j-script code :
if(document.location.href)
{
form.insert({ bottom: new Element("input",
{
name: "url",
type: "hidden",
value: this.HTMLchars(document.location.href)
})
});
}
anyone knows how can i make a html code which works like this j-script code?
after wasting 3 and half hours i replaced the default header_welcomeblock_guest template in my theme's header_welcomeblock_guest template template, i found that even default template doesn't work properly with my portal.php (after clicking on "login" , boxes doesn't appear.instead it redirects me to login page)
probably because of using some jQuery in portal.php
so i replaced the old one and users will have some fun with logging in
i hate wasting my time for nothing
2011-08-21, 08:20 AM
I had the same problem. After several hours searching for a solution, I finally wrote this short code and works fine
You have to replace this code:
<input type="hidden" name="url" value="{$redirect_url}" />
with this both in welcomeblock guest and error nopermisson:
<script type="text/javascript" language="JavaScript"><!--
document.write ("<input type='hidden' name='url' value='"+location.href+"' />")
//--></script>
You have to replace this code:
<input type="hidden" name="url" value="{$redirect_url}" />
with this both in welcomeblock guest and error nopermisson:
<script type="text/javascript" language="JavaScript"><!--
document.write ("<input type='hidden' name='url' value='"+location.href+"' />")
//--></script>
2011-08-21, 09:49 AM
OMG worked where have you been before
thank you so much
before i tried this code: <input type='hidden' name='url' value='"<script type="text/javascript" language="JavaScript">+location.href+"' /></script> and didnt worked,im not good in java script
but your worked perfectly thanks again
thank you so much
before i tried this code: <input type='hidden' name='url' value='"<script type="text/javascript" language="JavaScript">+location.href+"' /></script> and didnt worked,im not good in java script
but your worked perfectly thanks again
2011-08-21, 12:21 PM
happy to see it worked for you,
Extra: I finally found the way to redirect users to where they were after registering. I use a plugin to hide urls from guests and encouraging them to register. And people need to register to download attachments on the forum. This feature will be very useful this way. Without this, they were being redirected to index.php. But now, directly to the thread page or attachment.
Im still on 1.2.14 and doing partial upgrades myself. So I'm gonna write the changes but the codes maybe differ from 1.2 to 1.6
member.php
After this code
add:
Find:
Replace with:
Now we will update templates
member_register
Add:
member_register_agreement
Add:
If this is useful you can share it (and the login one) on the forums with a new thread so more people can use it. I dont have enough time
my forum has over 475K+ users now. thats why these are important for me
Extra: I finally found the way to redirect users to where they were after registering. I use a plugin to hide urls from guests and encouraging them to register. And people need to register to download attachments on the forum. This feature will be very useful this way. Without this, they were being redirected to index.php. But now, directly to the thread page or attachment.
Im still on 1.2.14 and doing partial upgrades myself. So I'm gonna write the changes but the codes maybe differ from 1.2 to 1.6
member.php
if($mybb->input['action'] == "register")
{
if((!isset($mybb->input['agree']) && !isset($mybb->input['regsubmit'])) || $mybb->request_method != "post")
{
$plugins->run_hooks("member_register_agreement");
eval("\$agreement = \"".$templates->get("member_register_agreement")."\";");
output_page($agreement);
}
else
{
$plugins->run_hooks("member_register_start");
After this code
add:
$redir = htmlentities($mybb->input['redir']);
Find:
redirect("index.php", $lang->redirect_registered);
Replace with:
redirect($mybb->input['redir'], $lang->redirect_registered);
Now we will update templates
member_register
<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
After thisAdd:
<input type="hidden" name="redir" value="{$redir}" />
member_register_agreement
<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
After thisAdd:
<script type="text/javascript" language="JavaScript"><!--
document.write ("<input type='hidden' name='redir' value='"+document.referrer+"' />")
//--></script>
If this is useful you can share it (and the login one) on the forums with a new thread so more people can use it. I dont have enough time
my forum has over 475K+ users now. thats why these are important for me