MyBB Hacks

Full Version: [ SOLVED] Omit quickform login & make longform login default ???
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Did some mods (to general.js in order to get rid of quickform login) some time ago, for the thread display/s, and now coming back and finding the Edit and Report buttons (going to omit the 'quote' button hopefully) are not working (scrnshot attached).

They show as a link when the cursor goes over, but do not make the jump.

Have checked what think are all related templates, and they seem to be ok.

Suggestion/s on where else should be looking ?

Kinda at wits end... whats left of it.  Smile
Your Javascript is broken.
So it is very likely a template problem.

Debug with Firebug console.  Revert templates.  That sorda thing.
(02-19-2012 10:34 PM)ZiNgA BuRgA Wrote: [ -> ]Your Javascript is broken.
So it is very likely a template problem.
Debug with Firebug console.  Revert templates.  That sorda thing.

Thank you for the direction.
Have definitely been messing around with templates a lot.
Before get into into the 'repair' learning curve, and T&E, too much, couple questions...
1. Could just replace all the *.js files with original versions... or is the source of the problem more in the *.js 'links' in the templates themselves ?
2. Still not had time to get into Firebug, so not sure how long of a L-curve that one is.  Assume the 'revert' is part of Firebug ?
Followup...
Tried Firebug and seems took right to problem... showed something wrong in 'general.js' !
Had commented out section of 'general.js' (code below) to make only 'longform login' display be the default login display, for various reasons (scnshot attached).
Thought it only effected ACP buttons, but no such luck, guess it also effected thread reply display buttons.

Code:
quickLogin: function()
	{	
		// omit quickLogin code below for make longform login standard at forum, but need to un-omit to make ACP forum management buttons and other forum display buttons work
		if($("quick_login"))
		{
			var form = new Element("form", { method: "post", action: "member.php" });
			form.insert({ bottom: new Element("input",
				{
					name: "action",
					type: "hidden",
					value: "do_login"
				})
			});

			if(document.location.href)
			{
				form.insert({ bottom: new Element("input",
					{
						name: "url",
						type: "hidden",
						value: this.HTMLchars(document.location.href)
					})
				});
			}

			form.insert({ bottom: new Element ("input",
				{
					name: "quick_login",
					type: "hidden",
					value: "1"
				})
			});

			form.insert({ bottom: new Element("input",
				{
					name: "quick_username",
					id: "quick_login_username",
					type: "text",
					value: lang.username,
					"class": "textbox",
					onfocus: "if(this.value == '"+lang.username+"') { this.value=''; }",
					onblur: "if(this.value == '') { this.value='"+lang.username+"'; }"
				})
			}).insert({ bottom: "Username " });

			form.insert({ bottom: new Element("input",
				{
					name: "quick_password",
					id: "quick_login_password",
					type: "password",
					value: lang.password,
					"class": "textbox",
					onfocus: "if(this.value == '"+lang.password+"') { this.value=''; }",
					onblur: "if(this.value == '') { this.value='"+lang.password+"'; }"
				})
			}).insert({ bottom: "Password " });

			form.insert({ bottom: new Element("input",
				{
					name: "submit",
					type: "submit",
					value: lang.login,
					"class": "button"
				})
			});

			var span = new Element("span", { "class": "remember_me" }).insert({ bottom: new Element("input",
				{
					name: "quick_remember",
					id: "quick_login_remember",
					type: "checkbox",
					value: "yes",
					"class": "checkbox"
				})
			});

			span.innerHTML += "<label for=\"quick_login_remember\"> "+lang.remember_me+"</label>";
			form.insert({ bottom: span });

			form.innerHTML += lang.lost_password+lang.register_url;
	
			$("quick_login").innerHTML = "";
			$("quick_login").insert({ before: form });

			$("quick_login_remember").setAttribute("checked", "checked");
			$('quick_login_username').focus();
		}
		return false;  
		// put comment out here for above code to display only longform login, but get button problems at ACP and thread reply display
	} 
};


Ps:  Just decided to look again at templates... after hundreds of other looks.
Commented out Edit Template: loginbox, and bingo, shortform login display went away !
Must be learning something from this forum !  Oops

Ps: Still have red files list at ACP ยป File Verification/Checking...
File Verification: Found Problems (including 'general.js', but maybe will eventually figure out if keep messing with ?   Smile

The file verification tool just tells you whether a file has been modified or not.  So if your mod affects general.js, it'll show up in red.
(02-20-2012 07:02 PM)ZiNgA BuRgA Wrote: [ -> ]The file verification tool just tells you whether a file has been modified or not.  So if your mod affects general.js, it'll show up in red.

Thank you for the clarification.
Does 'red' not necessarily mean there is a problem with the file, just a change in it or another related file ?

Also, Ooops !
Spoke too soon on login form display question.
Commented out Edit Template: loginbox, and 'shortform' login display did seem to go away.
Came back later, opened forum, and shortform was back... yuck !
Obviously not sure whats going on.
Guess need to sleep on it... again !   Oops

Ps:
Slept on it and still not much to go on.
Only template code that seems to be more directly involved, Edit Template: header_welcomeblock_guest, and the 'script' part...

Code:
<script type="text/javascript">
<!--
	lang.login = "{$lang->login}";
	lang.lost_password = " &mdash; <a href=\"{$mybb->settings['bburl']}/member.php?action=lostpw\">{$lang->lost_password}</a>";
	lang.register_url = " &mdash; <a href=\"{$mybb->settings['bburl']}/member.php?action=register\">{$lang->welcome_register}</a>";
	lang.remember_me = "{$lang->remember_me}"
// -->
</script>

...but dont know enough about that stuff to do much.
Tried deleting it and got all kinds of goofy looking display.
Guess need a bit more work on jscript.

(02-20-2012 07:17 PM)akm Wrote: [ -> ]Also, Ooops !
Spoke too soon on login form display question.
Commented out Edit Template: loginbox, and 'shortform' login display did seem to go away.
Came back later, opened forum, and shortform was back... yuck !
Obviously not sure whats going on.
Guess need to sleep on it... again !   Oops

Finally seems like found the longform would like to use...
error_nopermission

Code:
{$lang->error_nopermission_guest_1}
<ol>
<li>{$lang->error_nopermission_guest_2}</li>
<li>{$lang->error_nopermission_guest_3}</li>
<li>{$lang->error_nopermission_guest_4}</li>
<li>{$lang->error_nopermission_guest_5}</li>
</ol>
<form action="member.php" method="post">
<input type="hidden" name="action" value="do_login" />
<input type="hidden" name="url" value="{$redirect_url}" />
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead" colspan="2">
<span class="smalltext"><strong>{$lang->login}</strong></span></td>
</tr>
<tr>
<td class="trow1"><strong>{$lang->username}</strong></td>
<td class="trow1">
<input type="text" class="textbox" name="username" tabindex="1" />
</td></tr>
<tr>
<td class="trow2"><strong>{$lang->password}</strong></td>
<td class="trow2">
<input type="password" class="textbox" name="password" tabindex="2"
<td>
</tr>
<tr>
<td class="trow2" colspan="2"><span class="smalltext" style="float:right; padding-top:3px;"><a href="member.php?action=register">{$lang->need_reg}</a> | <a href="member.php?action=lostpw">{$lang->forgot_password}</a>&nbsp;</span>&nbsp;<input type="submit" class="button" value="{$lang->login}" tabindex="3" /></td>
</tr>
</table>
</form>
<br />

... now how to get it to replace the quickform link at the homepage (scrnshot attached) ?

Seems like should be somewhere in here...

Code:
<script type="text/javascript">
<!--
	lang.login = "{$lang->login}";
	lang.lost_password = " &mdash; <a href=\"{$mybb->settings['bburl']}/member.php?action=lostpw\">{$lang->lost_password}</a>";
	lang.register_url = " &mdash; <a href=\"{$mybb->settings['bburl']}/member.php?action=register\">{$lang->welcome_register}</a>";
	lang.remember_me = "{$lang->remember_me}"
// -->
</script>
<span id="quick_login"><font size= 6>
<strong>To ask a Question...
<a href="{$mybb->settings['bburl']}/member.php?action=login" onclick="MyBB.quickLogin(); return false;">{$lang->welcome_login}</a>
<font size= 5>, or... 
<a href="{$mybb->settings['bburl']}/member.php?action=register">{$lang->welcome_register}</a></strong>
<br>
<font size= 5>or click category buttons below & browse as 'Guest'</font></span>

Feel like getting over head here, but this mod is really needed to make login simpler for non-forum user folks (already had some strong feedback in that direction) !
Suggestion/s on where to look for how to do this one ?

Think may have found the answer with header_welcomeblock_guest...

Code:
<div>
<span><font size= 6>
<strong>To ask a Question...
<a href="{$mybb->settings['bburl']}/member.php?action=login">
{$lang->welcome_login}</a>
<font size= 5>, or... 
<a href="{$mybb->settings['bburl']}/member.php?action=register">
{$lang->welcome_register}</a>
</strong>
<br>
<font size= 5>or click category buttons below & browse as 'Guest'</font></span>
</div>

...it works, so far no anomalies to speak of, but not holding breath.
Anything look too crazy ?

Ps:
Seems like there should be a related template, per member.php, 'login'...

$templatelist .= ",redirect_loggedout,login,redirect_loggedin,error_invalidusername,error_invalidpassword,member_profile_email,member_profile_o​ffline,member_profile_reputation,member_profile_warn,member_profile_warninglevel,member_profile_cust​omfields_field,member_profile_customfields,member_profile_adminoptions,member_profile,member_login,m​ember_profile_online,member_profile_modoptions,member_profile_signature,member_profile_groupimage,me​mber_profile_referrals";

Would like to mod, but not finding it at Default/s or Global/s.
Where else to look ?

Pss:
Found at 'member_login'.
Think that does it 4 what need right now... as long as it doesnt cause some other screwup that havent run across yet.

Thank you very much for all the help on this forum !

Reference URL's