MyBB Community Forums

Full Version: Modfd code, 2 omit 'short form login', now forum mgmt CntrlOptns buttons not work ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Made some code modifications for forum pages and now ACP/ForumMgmt>Controls>Options buttons not working (scrnshot attached).
Trying to remember what may have done to effect... and still searching.
Suggestion on where should be looking for the related code ?
./jscripts/admincp.js is missing.
(2012-02-14, 12:17 AM)Alan Shepperson Wrote: [ -> ]./jscripts/admincp.js is missing.

Thank you for the reply.

Found /forum/admin/jscripts/admincp.js.
Its there, but is that the file you are referring to ?

Only other thing found so far with 'DOM Source of Selection' is at the standard install MyBB ACP/Forum Management (have a fresh MyBB install forum to help check things when goof up, which is most of the time) shows...
new PopupMenu('forum_1');
...at the end of the 1st forum button code, but at the problem (modified) forum it shows...
new PopupMenu('forum_33');
...but there are not 33 forums.
Could that be part of the problem ?

<table xmlns="http://www.w3.org/1999/xhtml" cellspacing="0" class="general form_container ">
	<thead>
		<tr>
			<th class=" first">Forum</th>
			<th width="5%" class="align_center">Order</th>
			<th style="width: 200px;" class="align_center last">Controls</th>
		</tr>

	</thead>
	<tbody>
		<tr class="first">
			<td class="first"><div style="padding-left: 0px;"><a href="index.php?module=forum-management&amp;fid=1"><strong>My Category</strong></a></div></td>
			<td class="align_center alt_col"><input type="text" style="width: 80%; font-weight: bold;" class="text_input align_center" value="1" name="disporder[1]"/></td>
			<td class="align_center last"><div id="forum_1_popup" class="popup_menu" style="display: none; position: absolute; z-index: 100; top: 342px; left: 712px; visibility: visible;">
<div class="popup_item_container"><a class="popup_item" href="index.php?module=forum-management&amp;action=edit&amp;fid=1">Edit Forum</a></div>
<div class="popup_item_container"><a class="popup_item" href="index.php?module=forum-management&amp;fid=1">Sub Forums</a></div>

<div class="popup_item_container"><a class="popup_item" href="index.php?module=forum-management&amp;fid=1#tab_moderators">Moderators</a></div>
<div class="popup_item_container"><a class="popup_item" href="index.php?module=forum-management&amp;fid=1#tab_permissions">Permissions</a></div>
<div class="popup_item_container"><a class="popup_item" href="index.php?module=forum-management&amp;action=add&amp;pid=1">Add Child Forum</a></div>
<div class="popup_item_container"><a class="popup_item" href="index.php?module=forum-management&amp;action=copy&amp;fid=1">Copy Forum</a></div>
<div class="popup_item_container"><a class="popup_item" onclick="return AdminCP.deleteConfirmation(this, 'Are you sure you wish to delete this forum?')" href="index.php?module=forum-management&amp;action=delete&amp;fid=1&amp;my_post_key=92f90d9c1c8ae8ed5568733522107fb0">Delete Forum</a></div>
</div>
<a class="popup_button" id="forum_1" href="javascript:;">Options</a>
<script type="text/javascript">
new PopupMenu('forum_1');   < SHOWS 'FORUM_33' AT PROBLEM FORUM
</script></td>

Wild thought... maybe something would need to fix at database ?
Obviously a wild guess from a forum dabbler !

Ps: Ooops! Went to database and show number as 'fid'... assume thats fine ? Have done a lot of category and forum changes.
Am sure used buttons since 2/1, but all files edited since then are listed in attached scrnshot.
Would any of those effect the problem ?
Will start looking through.
Sorry, not sure what I was getting at with my last post, it doesn't even make any sense to me. Undecided

Can you run the file verification tool in the ACP and list any files that show in red?
(2012-02-14, 11:19 AM)Alan Shepperson Wrote: [ -> ]Sorry, not sure what I was getting at with my last post, it doesn't even make any sense to me. Undecided
Can you run the file verification tool in the ACP and list any files that show in red?

Thank you, good idea, and at least I finally thought of something.
Ran the file verification few minutes ago and was coming back to post (scrnshot attached).

Main thing modified was to comment out 'quickLogin: function()' at general.js per code below, to omit the short form login and go directly to the long form login.
Must have caused modifications in other files, dont remember making changes in all of the red files.
Guess can go back and compare all with orig MyBB files if need be.

/**		quickLogin: function()
	{		
		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&nbsp;" });

			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&nbsp;" });

			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;
	}
}; */

Tried undoing the comment out, but did not fix.

Ps:
So, went and ran ACP/Tool&Maint/Recount&Rebuild and button works, but still shows red files (did refresh etc).
Went back, re-did comment out, problem came back, ran R&R but didnt help.
Now, guess question is how to omit the 'short form login' without causing the problem, with general.js ?
(2012-02-14, 02:16 PM)akm Wrote: [ -> ]
(2012-02-14, 11:19 AM)Alan Shepperson Wrote: [ -> ]Sorry, not sure what I was getting at with my last post, it doesn't even make any sense to me. Undecided
Can you run the file verification tool in the ACP and list any files that show in red?

Thank you, good idea, and at least I finally thought of something.
Ran the file verification few minutes ago and was coming back to post (scrnshot attached).

Main thing modified was to comment out 'quickLogin: function()' at general.js per code below, to omit the short form login and go directly to the long form login.
Must have caused modifications in other files, dont remember making changes in all of the red files.
Guess can go back and compare all with orig MyBB files if need be.

/**		quickLogin: function()
	{		
		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&nbsp;" });

			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&nbsp;" });

			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;
	}
}; */

Tried undoing the comment out, but did not fix.

Ps:
So, went and ran ACP/Tool&Maint/Recount&Rebuild and button works, but still shows red files (did refresh etc).
Went back, re-did comment out, problem came back, ran R&R but didnt help.
Now, guess question is how to omit the 'short form login' without causing the problem, with general.js ?

Btw, question is followup from post at...
http://community.mybb.com/thread-113290-...#pid825324
...so that is somewhat solved also.

At this point (with general.js edit) longform login is default (main objective per previous thread), but need to go back to general.js and undo comment-out if want to use forum mgmt buttons... and then back to edit for default login form display.

Not best solution, but guess will have to do for now.
Will keep looking, but 'red files' do not seem to be causing any other problems... yet Smile

Please let know if any other thoughts ?