列出文章
|
頁: 1 [2] 3 4
|
19
|
支援 / 使用與操作 / 為plog加上隨機時鐘
|
於: 六月 17, 2005, 06:09:09 下午
|
人總是貪新忘舊, 如果你也是這樣的話, 請參看下文, 其實以javascript來製作, 是很容易的。 1) 將不同的flash時鐘, 以clockn.swf命名, 存到 http://yrlink.com/flashclock1.swf, clock2.swf, clock3.swf, clock4.swf, clock5.swf, ... 2) 將以下存到 /plog/js/clock.js : var max=5; // The maximum number of groups
function Rand() // Pick a random group { num=Math.floor(max*Math.random()+1); return num; }
function getClock() { Rndno=Rand(); WhichClock='<EMBED src="http://yrlink.com/flash/clock"' + Rndno + '.swf")}" quality=high bgcolor=#FFFFFF WIDTH="160" HEIGHT="160" wmode="transparent" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" menu="false"></EMBED>';
return WhichClock;
} 3) 將以下加到 header.template: <script type="text/javascript" src="{$url->getBaseUrl()}/js/clock.js"> </script> 4) 在適當地方加上 : <script language="JavaScript"> document.write(getClock()); </script> 聰明的你立刻想到其他用途, 如gallery的隨機相片之類, 總之自由發揮好了。 若你需要同時gen多於一個隨機数,請參考我的六合彩程式(view source in IE)- http://cwchin.no-ip.com/marksix.htmlploglink: http://cwchin.no-ip.com/plog/post/1/96
|
|
|
22
|
支援 / 安裝與設定 / [QN]change calender header to show SUN
|
於: 五月 28, 2005, 10:19:59 上午
|
感謝vauthrin熱心的協助(日曆轉為由週日起始的問題): The code which sets the start date for the calendar is found in class/locale/locale.class.php. In that file look for the following function:
function firstDayOfWeek() { switch($this->getCountryId()) { case "US": case "AU": case "IE": case "UK": $day = 0; break; default: $day = 1; break; }
return $day; }
This sets the start day to sunday for "US", "AU", "IE", "UK". Everyone else gets monday. So if you were using the Chinese locale, you would change the code like this:
function firstDayOfWeek() { switch($this->getCountryId()) { case "US": case "AU": case "IE": case "CN": case "TW": case "UK": $day = 0; break; default: $day = 1; break; }
return $day; }
Hope that answers your question. Work ... thanks.
|
|
|
23
|
支援 / 使用與操作 / 迴響 Cookie 的 plugin
|
於: 五月 25, 2005, 10:22:06 下午
|
pls also refer: http://forums.lifetype.net/viewtopic.php?t=649&highlight=cookiehttp://wiki.lifetype.net/index.php/PLog_1.0/Tips_and_tricks#How_to_make_the_comment_form_remember_the_posterBY sganjam----------------------------------------------------------------------------------- 0) modify cookie.js HOST = 'yrhost.com' //You will need to set the following to work with your site var HOST = 'yrhost.com';
function setCookie (name, value, expires, path, domain, secure) { var curCookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); document.cookie = curCookie; }
function getCookie (name) { var prefix = name + '='; var c = document.cookie; var nullstring = ''; var cookieStartIndex = c.indexOf(prefix); if (cookieStartIndex == -1) return nullstring; var cookieEndIndex = c.indexOf(";", cookieStartIndex + prefix.length); if (cookieEndIndex == -1) cookieEndIndex = c.length; return unescape(c.substring(cookieStartIndex + prefix.length, cookieEndIndex)); }
function deleteCookie (name, path, domain) { if (getCookie(name)) document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT"; }
function fixDate (date) { var base = new Date(0); var skew = base.getTime(); if (skew > 0) date.setTime(date.getTime() - skew); }
function rememberMe (f) { var now = new Date(); fixDate(now); now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000); if (f.userName != undefined) setCookie('plogcmtuserName', f.userName.value, now, '/', '', ''); if (f.userEmail != undefined) setCookie('plogcmtuserEmail', f.userEmail.value, now, '/', '', ''); if (f.userUrl != undefined) setCookie('plogcmtuserUrl', f.userUrl.value, now, '/', '', ''); } 1) put cookie.js to /plog/js 2) modify header.template as <head> <script type="text/javascript" src="{$url->getBaseUrl()}/js/cookie.js"></script> 3) modify commentform.template as <form id="NewComment" name="NewComment" action="{$url->getBaseUrl()}/index.php" method="post" onsubmit="rememberMe(this)">
: :
</form> {literal} <script type="text/javascript" language="javascript"> window.document.NewComment.userEmail.value = getCookie("plogcmtuserEmail"); window.document.NewComment.userName.value = getCookie("plogcmtuserName"); window.document.NewComment.userUrl.value = getCookie("plogcmtuserUrl");
</script> {/literal}
|
|
|
25
|
開發 / 模版設計 / 怎麼移動在圖片的flash啊
|
於: 五月 07, 2005, 12:19:58 上午
|
試試 align=right in EMBED :
< EMBED style="LEFT: 0px; POSITION: absolute; TOP: 0px; POSITION: absolute; " align=right src="xxx.swf" width=100 height=20 type=application/x-shockwave-flash wmode="transparent" menu="false" quality="high" bgcolor=#000000 >< /EMBED >
|
|
|
|
|
|