Jump to content

[Фича]Смена лого при обновлении (Как в ВК)


Recommended Posts

Думаю интересный скрипт, к тому же полезный)
Нужно только под себя настроить!

1.В main.tpl найти:

[logged]<a href="/news">[/logged]<div class="logo"></div>[logged]</a>[/logged]

Заменить на:

[logged]<a href="/news" onClick="Page.Go(this.href); return false">[/logged]
<script language="JavaScript">
function setcookie(a,b,c) {if(c){var d = new Date();d.setTime(d.getTime()+c);}if(a && B) document.cookie = a+'='+b+(c ? '; expires='+d.toUTCString() : '');else return false;}
function getcookie(a) {var b = new RegExp(a+'=([^;]){1,}');var c = b.exec(document.cookie);if(c) c = c[0].split('=');else return false;return c[1] ? c[1] : false;}
    
image = new Array();
image[0]="{theme}/images/logo-christmas/1.png"
image[1]="{theme}/images/logo-christmas/2.png"
image[2]="{theme}/images/logo-christmas/3.png"
image[3]="{theme}/images/logo-christmas/4.png"
image[4]="{theme}/images/logo-christmas/5.png"
image[5]="{theme}/images/logo-christmas/6.png"
image[6]="{theme}/images/logo-christmas/7.png"
image[7]="{theme}/images/logo-christmas/8.png"
image[8]="{theme}/images/logo-christmas/9.png"
    
var NUM=getcookie('imgNUM');
if(NUM){NUM = (+NUM)%image.length;}
else NUM =0;
setcookie('imgNUM',NUM+1);
document.write ("<img class='logo-christmas' src="+image[NUM]+">");
</script>
[logged]</a>[/logged]

Автор: Shaman

Edited by Иосиф Сталин
  • Upvote 2
Link to comment
Share on other sites

  • 1 year later...
  • 1 month later...

Думаю интересный скрипт, к тому же полезный)

Нужно только под себя настроить!

 

1.В main.tpl найти:

[logged]<a href="/news">[/logged]<div class="logo"></div>[logged]</a>[/logged]
Заменить на:
[logged]<a href="/news" onClick="Page.Go(this.href); return false">[/logged]
<script language="JavaScript">
function setcookie(a,b,c) {if(c){var d = new Date();d.setTime(d.getTime()+c);}if(a &&  document.cookie = a+'='+b+(c ? '; expires='+d.toUTCString() : '');else return false;}
function getcookie(a) {var b = new RegExp(a+'=([^;]){1,}');var c = b.exec(document.cookie);if(c) c = c[0].split('=');else return false;return c[1] ? c[1] : false;}
	
image = new Array();
image[0]="{theme}/images/logo-christmas/1.png"
image[1]="{theme}/images/logo-christmas/2.png"
image[2]="{theme}/images/logo-christmas/3.png"
image[3]="{theme}/images/logo-christmas/4.png"
image[4]="{theme}/images/logo-christmas/5.png"
image[5]="{theme}/images/logo-christmas/6.png"
image[6]="{theme}/images/logo-christmas/7.png"
image[7]="{theme}/images/logo-christmas/8.png"
image[8]="{theme}/images/logo-christmas/9.png"
	
var NUM=getcookie('imgNUM');
if(NUM){NUM = (+NUM)%image.length;}
else NUM =0;
setcookie('imgNUM',NUM+1);
document.write ("<img class='logo-christmas' src="+image[NUM]+">");
</script>
[logged]</a>[/logged]
Автор: Shaman
Генерации случайного лого?
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...