Сделали подфорумы и использовали скрипт новых сообщений, так вот у админов скрипт работает нормально, а обычным пользователям не видно ни появление новых сообщений в подфоруме, ни общее количество тем. Что делать?
Вот скрипты:
html-верх
<script language="JavaScript">
str=document.URL
if(str.substring(str.lastIndexOf('/')+1)=="" || str.substring(str.lastIndexOf('/')+1)=="index.php")
document.write("<style>#forum_f27, #forum_f28, #forum_f26, #forum_f31, #forum_f29, #forum_f30, #forum_f32, #forum_f41, #forum_f43, #forum_f44, #forum_f45, #forum_f40{display:none}</style>")
</script>
html-низ
<script type="text/javascript">
if (!document.URL.indexOf(".php")!=-1 || document.URL.indexOf("index.php")!=-1)
{
makeSubforum('forum_f18', 'forum_f26')
makeSubforum('forum_f18', 'forum_f27')
makeSubforum('forum_f18', 'forum_f28')
makeSubforum('forum_f17', 'forum_f29')
makeSubforum('forum_f17', 'forum_f30')
makeSubforum('forum_f17', 'forum_f31')
makeSubforum('forum_f17', 'forum_f32')
makeSubforum('forum_f23', 'forum_f41')
makeSubforum('forum_f2', 'forum_f43')
makeSubforum('forum_f2', 'forum_f44')
makeSubforum('forum_f2', 'forum_f45')
makeSubforum('forum_f20', 'forum_f40')}
function makeSubforum(ff, sf)
{
{document.getElementById(ff).getElementsByTagName("td")[1].innerHTML=(document.getElementById(ff).getElementsByTagName("td")[1].innerHTML*1)+(document.getElementById(sf).getElementsByTagName("td")[1].innerHTML*1)
document.getElementById(ff).getElementsByTagName("td")[2].innerHTML=(document.getElementById(ff).getElementsByTagName("td")[2].innerHTML*1)+(document.getElementById(sf).getElementsByTagName("td")[2].innerHTML*1)
if ((document.getElementById(ff).className.indexOf("inew")==-1)&&(document.getElementById(sf).className.indexOf("inew")!=-1))
{document.getElementById(ff).className=document.getElementById(ff).className+" inew"}
var date1=document.getElementById(ff).innerHTML.substr(document.getElementById(ff).innerHTML.toLowerCase().lastIndexOf("</a>")+8)
var date2=document.getElementById(sf).innerHTML.substr(document.getElementById(sf).innerHTML.toLowerCase().lastIndexOf("</a>")+8)
if (transtoDate(date2)>transtoDate(date1))
{document.getElementById(ff).getElementsByTagName("td")[3].innerHTML=document.getElementById(sf).getElementsByTagName("td")[3].innerHTML}}
}
function transtoDate(oi)
{var d1=new Date()
d1.setHours(oi.substr(oi.indexOf(" ")+1, 2), oi.substr(oi.indexOf(":")+1, 2), oi.substr (oi.lastIndexOf(":")+1, 2))
if (oi.substr(0, 5)=="Сегод")
{var resd=d1.getTime()}
else if (oi.substr(0, 5)=="Вчера")
{var resd=(d1.getTime()-(1000*60*60*24))}
else
{d1.setFullYear(oi.substr(0, 4), (oi.substr(oi.indexOf("-")+1, 2))-1, oi.substr(oi.indexOf("-")+3, 2))
var resd=d1.getTime()}
return resd}
</script>