• Page 1 of 1
  • 1
Forum moderator: bigblog  
uCoz Community » For Webmasters » Design Customization » Any way of changing the content of module links?
Any way of changing the content of module links?
Skan
Posts: 43
Reputation: 0

Message # 1 | 1:39 PM
Hello,

Is there any way I could change how some module links display?
For example, using "$LAST_POST_DATE$" yields me the following:

https://gyazo.com/dd290ab244a4c656de1dffcdaccfda65

But I would like to change the format by making it shorter and only displaying the time elapsed from last forum post (IE "x" hours ago, "x" days ago, weeks/months/years.) unfortunately I wasn't able to find any relevant information on this so I'm asking here for help.

Thank you in advance!

Added (2019-04-11, 12:27 PM)
---------------------------------------------
Bump?!

Datecity
Posts: 40
Reputation: 0

Message # 2 | 8:55 AM
Code
<?if($DATE$='Today')?>
<span id="d$ID$"></span>
<script type="text/javascript">
function corrDate(t,n){return n!=0?" " + n + " " + t[n%10==1&&n%100!=11?0:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?1:2] + ", ":"";};
(function(time){var everySecond=true,ar=arguments,_=Math.ceil((time-($TIMESTAMP$*1000))/(1000)),day,hour,min,sec,text=[['day', 'of the day', 'days'], ['time', 'hours', 'hours'], ['a minute', 'minutes', 'minutes'], ['give me a sec', 'seconds', 'seconds']],res; day = Math.floor((_/86400)); _=_-(day*86400); hour = Math.floor((_/3600)); _=_-(hour*3600); min = Math.floor((_/60)); _=_-(min*60);
if(min>0) {if(min==1) {res='A minute ago'} else {if(hour>0) {if(hour=='1') {res='An hour ago'} else {res=corrDate(text[1],hour)}} else {res=corrDate(text[2],min)}}} else {res='Just now'}
document.getElementById("d$ID$").innerHTML=res.replace(/\,\s$/, " ago"); if (everySecond) {setTimeout(function(){ar.callee(new Date().getTime());},1000);}})(new Date().getTime());
</script>
<?else?>
$DATE$ at $TIME$
<?endif?>


Paste that code where you want to display the time of entry but works only for the current day
bigblog
JOE-vascript
Posts: 1694
Reputation: 74

Message # 3 | 12:33 PM
Datecity, or use a proper date/time library like date-fns or momentjs
hey i'm joe and i do not work for the company anymore, sorry for the late replies
icon by ch-chau

I'm still here for some godforsaken reason
nodyh1983
Posts: 1
Reputation: 0

Message # 4 | 7:18 PM
Hi there
Any chance of removing"SHOPPING CART" from the website?
uCoz Community » For Webmasters » Design Customization » Any way of changing the content of module links?
  • Page 1 of 1
  • 1
Search: