Advertise Here

Author Topic: [Code] Admin Notes in Admin Area  (Read 3783 times)

0 Members and 1 Guest are viewing this topic.

Offline webworldx

  • Code Master's
  • *
  • Posts: 31
    • View Profile
    • InvisionFusion

  • Total Badges: 15
    Badges: (View All)
    Windows User Topic Starter Combination Level 3 Level 2
[Code] Admin Notes in Admin Area
« on: June 26, 2006, 11:42:11 am »
This adds Admin Notes to your Admin Area so you can communicate with other admins.

Code: [Select]
<script type='text/javascript'>
/*
Admin Notes in Admin Area
Created by iFusion
*/
document.write("<div style='display: none;' id='my_admin_notes'>Some text here<br /><br />Some more text here</div>");
function saveAdminNotes(){
  var iTextArea = document.getElementsByTagName('TEXTAREA');
  for(a=0;a<iTextArea.length;a++){
   if(iTextArea[a].getAttribute('name') == 'txtfooters'){
     var myReg = new RegExp("(my_admin_notes'>(.*?)<\\/div)","i");
     my_test = myReg.exec(iTextArea[a].value);
     if(my_test){
       iTextArea[a].value = iTextArea[a].value.replace( RegExp.$1 , "my_admin_notes'>" + document.getElementById('new_admin_notes').value.replace(/(\r\n|\n)/g,'<br />') + "</div");
     }
     break;
}}
  var iInput = document.getElementsByTagName('INPUT');
  for(i=0;i<iInput.length;i++){
    if(iInput[i].getAttribute('name') == "cmdSubmit"){
      iInput[i].click();
  }}
}

if(location.href.match(/a=headers&set=admin_notes/i) != null){
  var iTD = document.getElementsByTagName('TD');
  for(i=iTD.length-1;i>0;i--){
    if(iTD[i].parentNode.className=="catbg" && iTD[i].innerHTML.match(/manage the headers/i) != null){
      iTD[i+1].style.display="none";
      iTD[i-2].innerHTML += " | <b>Admin Notes</b>";
      var iCell = iTD[i+1].parentNode.insertCell(0);
      iCell.setAttribute('colspan','2');
      iCell.className='windowbg';
      iCell.innerHTML="<text" + "area cols='150' rows='6' id='new_admin_notes'>" + document.getElementById('my_admin_notes').innerHTML.replace(/<br(.*?)>/gi ,"\r\n")  + "</text" + "area><br /><a href='#' onclick='saveAdminNotes();'>Save Admin Notes</a>";
      break;
}}}

if(location.href.match(/action=admin$/i) != null){
 var iTR = document.getElementsByTagName('TR');
 for(i=0;i<iTR.length;i++){
   if(iTR[i].className == "titlebg" && iTR[i].getElementsByTagName('TD')[0].innerHTML.toLowerCase() == "administration center"){
      var iRow = iTR[i].parentNode.insertRow(0);
      iRow.className="titlebg";
      var iCell = iRow.insertCell(0);
      iCell.setAttribute('colspan','2');
      iCell.innerHTML="Admin Notes";
      var iRow = iTR[i].parentNode.insertRow(1);
      iRow.className="windowbg2";
      var iCell = iRow.insertCell(0);
      iCell.setAttribute('colspan','2');
      iCell.innerHTML = "<textarea id='AdminNotes' cols='120' rows='5'>" + document.getElementById('my_admin_notes').innerHTML.replace(/<br(.*?)>/gi ,"\r\n") + "</text" + "area><br /><a href='index.php?action=style;sa=headers&set=admin_notes'>Click Here to Edit Admin Notes</a>";
      break;
}}}
</script>

Or if you don't want to fill up your wrappers, a hosted version (but slightly slower):

Code: [Select]
<script type='text/javascript' src='http://www.webworldx.com/javascript/my_admin_notes.smf'></script>
« Last Edit: August 27, 2007, 08:54:15 pm by simply sibyl »

Offline Crasy

  • Global Moderator
  • *
  • Posts: 3960
  • Semi-Retired ;)
    • View Profile

  • Total Badges: 29
    Badges: (View All)
    Poll Starter Poll Voter Seventh year Anniversary Arcade Highscore Windows User
Re: Admin Notes in Admin Area
« Reply #1 on: June 26, 2006, 11:53:03 am »
Yeah I have 3 Admins on my forum(that is unfortunatly very abandoned)
Did my answer help you? Want to help out hosting costs?


Every donation counts.

Offline SMF For Free

  • Administrator
  • *
  • Posts: 7306
    • View Profile
    • SMF For Free

  • Total Badges: 38
    Badges: (View All)
    Quick Poster Tenth year Anniversary Spammer 25 Posts in one day Nineth year Anniversary Eighth year Anniversary
Re: Admin Notes in Admin Area
« Reply #2 on: June 26, 2006, 12:42:31 pm »
I was thinking about adding this to admin control panel. If you actually use it I would do it.

SMF For Free
SMF For Free-Free Simple Machines Forum hosting.
Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline SMF For Free

  • Administrator
  • *
  • Posts: 7306
    • View Profile
    • SMF For Free

  • Total Badges: 38
    Badges: (View All)
    Quick Poster Tenth year Anniversary Spammer 25 Posts in one day Nineth year Anniversary Eighth year Anniversary
Re: Admin Notes in Admin Area
« Reply #3 on: June 26, 2006, 02:38:20 pm »
Ok finished.

SMF For Free
SMF For Free-Free Simple Machines Forum hosting.
Like What I do? Support me at https://www.patreon.com/vbgamer45/

 

Related Topics

  Subject / Started by Replies Last post
3 Replies
992 Views
Last post July 03, 2006, 08:21:12 am
by Laugh-nd-kid
12 Replies
2219 Views
Last post November 10, 2006, 12:01:29 pm
by Laugh-nd-kid
12 Replies
2666 Views
Last post September 24, 2007, 11:31:12 am
by Kimmie
3 Replies
1242 Views
Last post October 12, 2008, 08:17:20 am
by debshere2
3 Replies
872 Views
Last post October 31, 2009, 11:49:00 pm
by simply sibyl