[ Новые сообщения · Участники · Правила форума · Поиск · RSS ]
  • Страница 1 из 1
  • 1
Личный блокнот
defaultNickДата: Четверг, 31.12.2009, 20:17 | Сообщение # 1






Ставим между <head>...</head> (на страницу там где есть Меню сайта "$SITE_MENU$)
Code
<SCRIPT LANGUAGE="JavaScript">          
            <!--          
            function addCookie(szName,szValue,dtDaysExpires)            
            {          
            var dtExpires = new Date();          
            var dtExpiryDate = "";          

            dtExpires.setTime(dtExpires.getTime() + dtDaysExpires * 24 * 60 * 60 * 1000);          
            dtExpiryDate = dtExpires.toGMTString();          

            document.cookie = szName + "=" + escape(szValue) + "; expires=" + dtExpiryDate;          
            }          

            function findCookie(szName)            
            {          
            var i = 0;          
            var nStartPosition = 0;          
            var nEndPosition = 0;            
            var szCookieString = document.cookie;            
            var szTemp = "";          

            while (i <= szCookieString.length)            
            {          
            nStartPosition = i;          
            nEndPosition = nStartPosition + szName.length;          

            if(szCookieString.substring(nStartPosition,nEndPosition) == szName)            
            {          
            nStartPosition = nEndPosition + 1;          
            nEndPosition = document.cookie.indexOf(";",nStartPosition);          

            if(nEndPosition < nStartPosition)          
            nEndPosition = document.cookie.length;          

            szTemp = document.cookie.substring(nStartPosition,nEndPosition);            
            return unescape(szTemp);          
            break;            
            }          
            i++;            
            }          
            return "";          
            }          

            function removeCookie(szName)            
            {          
            var dtExpires = new Date();          
            dtExpires.setTime(dtExpires.getTime() - 1);          
            var szValue = findCookie(szName);          
            document.cookie = szName + "=" + szValue +          
            "; expires=" + dtExpires.toGMTString();          
            }          

            function btnClick()          
            {          
            addCookie("MyText",TestForm.Comment.value,10);          
            }          

            // -->          
            </SCRIPT>          

          <script type="text/javascript" src="http://src.ucoz.net/src/ucoz.js"></script>  

Дальше идем в управление дизайном >> Меню сайта
И где нужно ставим вот это:

Code
<div class="pmm"><div class="mmsi" style="float:left;">          
          <img src="http://img.mail.ru/r/torg-all.gif"> <a class="m" onclick="show_menu('msite');return false;" href="#" title="Открыть/Закрыть"><b>Личный блокнот</b></a></div><div style="float:right;padding-right:10px;"><a href="javascript://" class="noun" onclick="show_menu('msite');return false;"></a><div id="msite" style="white-space:nowrap;position:absolute;z-index:51;visibility:hidden;display:none;padding:3px 0 0 3px;background:#FFFFFF;border:1px solid #CCCCCC;">          
          <center>          
          <div class="sbm">          

            <FORM NAME="TestForm">          
            <P><TEXTAREA NAME="Comment"          
            ROWS="10" COLS="70" WRAP="physical">          
            </TEXTAREA>          

            <P><INPUT TYPE="button" VALUE="Сохранить запись"          
            onClick="btnClick();">          

            <INPUT TYPE="button" VALUE="Очистить"          
            onClick="removeCookie('MyText');TestForm.Comment.value=''">          
            </FORM>            

            <SCRIPT LANGUAGE="JavaScript">          
            <!--          
            var szMyText="";          
            szMyText = findCookie("MyText");          

            if(szMyText != "")          
            {          
            TestForm.Comment.value = szMyText;          
            }          
            // -->          
            </SCRIPT>          
          </div></div></div></center>   
 
  • Страница 1 из 1
  • 1
Поиск: