Page 1 of 1

Adding Menu Item Issue

Posted: Sun Aug 25, 2019 12:28 pm
by fbonani
I'm trying to add a link to the menu but it only works when the Admin is logged in. When a player is logged in, clicking on the menu item takes me back to the login page even though it shows I am logged in as a player. Can anyone tell me what I am doing wrong?

Re: Adding Menu Item Issue

Posted: Mon Aug 26, 2019 7:24 pm
by Russaholic
So in the code, the link must be added before this tag:

<%if IsAdmin() then %>

Anything after that is set to only show for the Admin.

See larger snippet:
______________________________________________
</li>
<li class="dropdown"> <a href="javascript:void(0)" class="dropbtn">History <span class="style3">&#9660;</span></a>
<div class="dropdown-content"> <a href="historyRecords.asp">Record Book</a> <a href="historyWinners.asp">Yearly Winners</a> <a href="historyweeks.asp">Weekly Winners</a> </div>
</li>
<li><a href="/messageBoard.asp">Chat</a></li>
<li class="dropdown"> <a href="javascript:void(0)" class="dropbtn">Account <span class="style3">&#9660;</span></a>
<div class="dropdown-content"> <a href="changePassword.asp">Change Password</a> <a href="editProfile.asp">Edit Profile</a> <a href="makePayment.asp">Make Payment</a> </div>
</li>
<li><a href="helpRules.asp">Rules</a></li>
<% if IsAdmin() then %>
<li class="dropdown"> <a href="javascript:void(0)" class="dropbtn">Admin <span class="style3">&#9660;</span></a>
<div class="dropdown-content"> <a href="updateScores.asp">Update Scores</a> <a href="updateSchedule.asp">Update Schedules</a> <a href="manageUsers.asp">Manage Users</a> <a href="manageAccounts.asp">Manage Accounts</a> <a href="accountBalances.asp">Account Balances</a> <a href="playerContacts.asp">Player Contacts</a> </div>
</li>
______________________________________________

I hope this helps. Let me know if you have any more problems.

Re: Adding Menu Item Issue

Posted: Mon Aug 26, 2019 9:40 pm
by fbonani
Thanks for your response Russaholic. I was trying to add it after this code

Code: Select all

<%	if ENABLE_MESSAGE_BOARD then %>
				<td>
					<a href="messageBoard.asp">Message Board</a>
				</td>
				
<%	end if %>
which in my menu.asp starts at line 10 right after the Home link. This is way above the <% if IsAdmin() then %> code you refer to. In looking at the code you provided, you have links that I don't seem to have although that shouldn't have anything to do with my problem. Any other suggestions?

Re: Adding Menu Item Issue

Posted: Tue Aug 27, 2019 11:44 am
by Russaholic
Let me take a look at the original menu coding. I've altered mine so much over the years that it's probably completely different.

Re: Adding Menu Item Issue

Posted: Tue Aug 27, 2019 9:02 pm
by Russaholic
See the attached screenshot to see how I added my own menu dropdown on an early version of my site. It's pretty straight forward, but if you keep having issues, just copy over your entire code and I will make it work for you.

Re: Adding Menu Item Issue

Posted: Thu Aug 29, 2019 5:27 pm
by Stutgrtguy
File = /includes/menu.asp
This will add another menu item, if I am understanding u correctly

Code: Select all

<%	if ENABLE_MESSAGE_BOARD then %>
				<td>
					<a href="messageBoard.asp">Message Board</a>
					<a href="YOURPAGE.asp">YOURLABEL</a>
				</td>
<%	end if %>

Re: Adding Menu Item Issue

Posted: Thu Aug 29, 2019 5:30 pm
by Stutgrtguy
always make backups before changing anything =)

Re: Adding Menu Item Issue

Posted: Thu Aug 29, 2019 6:23 pm
by fbonani
Thanks for your response Stutgrtguy and I added my link exactly where you suggest I should add it. Unfortunately it did not work until I removed the code in the file that said it required a login to view it. The problem is that even if a player was logged in, clicking that link would take him back to the login page. I have it working now without having to log in.

Re: Adding Menu Item Issue

Posted: Thu Aug 29, 2019 6:34 pm
by Stutgrtguy
would you like to add anothe menu item somewhere else othere than the message board, whats the end goal hereSorry my keyboard is messin up

Re: Adding Menu Item Issue

Posted: Thu Aug 29, 2019 6:37 pm
by Stutgrtguy
Problem being that the message board menu is an "add on" so editing that menu is a little more complicated. you can add more menus and more menu items elsewhere easier

Re: Adding Menu Item Issue

Posted: Thu Aug 29, 2019 6:42 pm
by fbonani
It doesn't matter where I add the link, unless I remove the requires login to view code in the file, it keeps sending the player to the login module.

Re: Adding Menu Item Issue

Posted: Thu Aug 29, 2019 6:46 pm
by Stutgrtguy
gimme a sec havin keyboard issues, then ill get ya an example code

Re: Adding Menu Item Issue

Posted: Thu Aug 29, 2019 6:53 pm
by Stutgrtguy
here's a copy of a menu I did long ago, just look for the "if SERVER_EMAIL_ENABLED then " in your /includes/menu.asp
adds a new menu and items with links
cut n paste, make backups!

Code: Select all

<%  if SERVER_EMAIL_ENABLED then %>  
      <a href="contact.asp">Email Players</a>
<%  end if %>

					</div>
				</td>
<%	end if %>
				<td>


<a href="#" onclick="return false;">NFL Resource's <span class="arrow">&#9660;</span></a>
					<div class="subMenu">
						
						<a href="http://nfl.com" target="_blank">NFL.COM</a>

<a href="http://espn.go.com/nfl/" target="_blank">ESPN.COM</a>



<a href="http://espn.go.com/nfl/injuries" target="_blank">ESPN Injury Report</a>



<a href="http://games.espn.go.com/nfl-pigskin-pickem/en/" target="_blank">ESPN Pigskin Pickem</a>

<a href="http://msn.foxsports.com/nfl" target="_blank">Fox Sports.COM</a>

<a href="http://sportsillustrated.cnn.com/football/nfl/" target="_blank">SI.COM</a>



			</div>
				</td>

				<td>

Re: Adding Menu Item Issue

Posted: Thu Aug 29, 2019 6:54 pm
by Stutgrtguy
change or delete as ya see fit