News:

Create A Forum Installed

Author Topic: [Code] Add links to Admin Dropdown  (Read 2474 times)

0 Members and 4 Guests are viewing this topic.

Offline Agent Moose

  • Newbie
  • *
  • Posts: 37
  • Karma: 12
  • Gender: Male
  • Miss me?
  • Location: South Carolina, United States
    • View Profile

Badges: (View All)
Linux User Mobile User Level 5
[Code] Add links to Admin Dropdown
« on: August 02, 2010, 03:11:17 pm »
Footers: (Admin > Style Manager > Headers and Footers > Footers)
Code: [Select]
<script type="text/javascript">
function AdminLinks(Name, URL){
//Created by Agent Moose
if(document.getElementById("button_admin") !== null) document.getElementById("button_admin").getElementsByTagName("ul")[0].innerHTML += "<li><a href='" + URL + "'><span>" + Name + "</span></a></li>";
};
AdminLinks("Style Manager","/?action=admin;area=style;sa=headers");
AdminLinks("NAME","URL");
</script>

NAME = The Name of the link
URL = The URL of the link.

This code lets you add links to the Admin drop down menu :)
The link that is already added is just an example, you may remove it if you wish.

To add more links, add more of these lines:
Code: [Select]
AdminLinks("NAME","URL");
Enjoy :)
Code: [Select]
//Hint hint :)
if(/action=profile;u=(.*);sa=UserPage/i.test(location.href)){
var number = RegExp.$1;
var username = (smf_id_member !== "0") ? document.getElementById("upper_section").getElementsByTagName("li")[0].getElementsByTagName("span")[0].innerHTML : void(0);

Share on Facebook Share on Twitter


Offline Fate

  • Newbie
  • *
  • Posts: 36
  • Karma: -1
  • Gender: Male
  • US Navy Seal - Commander Fate
    • View Profile
    • CIA

Badges: (View All)
Level 3 Topic Starter Combination
Re: [Code] Add links to Admin Dropdown
« Reply #1 on: August 02, 2010, 03:35:22 pm »
Very nice.  ;)

Offline mickjav

  • Full Member
  • ***
  • Posts: 249
  • Karma: 4
  • Gender: Male
  • Database designer
  • Location: Margate, Kent
    • View Profile
    • Database Dreams

Badges: (View All)
Second year Anniversary Level 5 100 Posts
Re: [Code] Add links to Admin Dropdown
« Reply #2 on: July 09, 2020, 07:22:49 am »
Thanks Works A treat.
I've edited the function so I can add items to the profile list but have one problem the member ID I know I can use this in the newletter section {$member.id} but think it would mess with the function but not sure as haven't played with this stuff for 15 years.
regards mick
« Last Edit: July 09, 2020, 08:01:58 am by mickjav »

 

Related Topics

  Subject / Started by Replies Last post
0 Replies
2006 Views
Last post February 09, 2011, 08:43:06 am
by Arekay
Pop-Up Links

Started by CB « 1 2 » General Support

15 Replies
1660 Views
Last post December 11, 2011, 05:55:07 pm
by aIURbliS
1 Replies
579 Views
Last post March 29, 2012, 03:29:03 pm
by CreateAForum
1 Replies
487 Views
Last post February 16, 2018, 03:33:04 pm
by CreateAForum
14 Replies
1344 Views
Last post March 23, 2019, 11:12:32 pm
by CreateAForum