• Page 1 of 1
  • 1
uCause Community » Trash & Archives » Other » Entry last edited on
Entry last edited on
CheburatorDate: Thursday, 2011-06-30, 10:57 PM | Message # 1
Member
Group: Senior Members
Messages: 43
Awards: 2
Reputation: 3
Status: :-(


Description:
This script display the date and the time when an entry was last modified.

Installation:
1. Add the following code into your CSS:
Code
.news_edit {
    background: url(http://uscripts.de/images/news_edit.png) no-repeat left 5px;
    padding: 0px 0px 0px 40px;
    margin: 4px 0px 0px 0px;
    min-height: 52px;
}
.copy { font-size: 8pt }
.quote {
    color: #757575;
    background-color: #FFE2D5;
    border: 1px dotted #F93;
    text-align: justify;
    padding: 5px;
}

2. Add the following code after <body> (or just at the top in the global block "Top part of the website")
Code
<script type="text/javascript">
       function convertLD(lastmod){
           var months = ['Jan','Feb','March','April','May','June','July','Aug','Sep','Oct','Nov','Dec'];
           var lmd=[];var d=new Date();if (typeof lastmod=='string' && lastmod.length>5){lastmod=parseInt(lastmod);}if (typeof lastmod=='number' && !isNaN(lastmod)){d.setTime(lastmod*1000);}var cday=d.getDate();if(cday<=9){cday='0'+cday};var cmin=d.getMinutes();if(cmin<=9){cmin='0'+cmin};var csec=d.getSeconds();if(csec<=9){csec='0'+csec};var chour=d.getHours();if(chour<=9){chour='0'+chour};var mon=d.getMonth()+1;if(mon<=9){mon='0'+mon};var month=months[d.getMonth()];var year=d.getFullYear();
                      lmd['month'] = month;
                      lmd['year'] = year;
                      lmd['mon'] = mon;
                      lmd['day'] = cday;
                      lmd['hour'] = chour;
                      lmd['min'] = cmin;
                      lmd['sec'] = csec
                      lmd['time'] = chour+':'+cmin+':'+csec;
                      return (lmd);
                      }
</script>

3. Now at the following code at the top of the "Appearance of entries" of any module the following code:
Code
<script type="text/javascript">var lmd=convertLD('$LASTMOD$');</script>

4. Now at the same template at the following code after $MESSAGE$.
Code
<?if($LASTMOD$ != $TIMESTAMP$)?>
<div class="news_edit"><br />
       <span class="copy"><i>Last edited on</i></span>
       <div class="quote"><script type="text/javascript">document.write(lmd['day']+'.'+lmd['mon']+'.'+lmd['year'])</script> at <script type="text/javascript">document.write(lmd['time'])</script></div>
</div>
<?endif?>

5. Now go to Page with entry full text and its comments and add the following code after $MESSAGE$:
Code
<?if($LASTMOD$ != $TIMESTAMP$)?>
<script type="text/javascript">var lmd=convertLD('$LASTMOD$');</script>
<div class="news_edit"><br />
       <span class="copy"><i>Last edited on</i></span>
       <div class="quote"><script type="text/javascript">document.write(lmd['day']+'.'+lmd['mon']+'.'+lmd['year'])</script> at <script type="text/javascript">document.write(lmd['time'])</script></div>
</div>
<?endif?>

6. Now the script installation is finished. If you have problems with the installation or have question about this script just feel free to ask wink

tags-zB11Entry,last,edited,on,
Attachments: 4723359.png(7.7 Kb)


Message edited by Cheburator - Thursday, 2011-06-30, 10:59 PM
 
0 Thanked you For This Useful Post:
BlazerDate: Thursday, 2011-06-30, 11:23 PM | Message # 2
Member
Group: Senior Members
Messages: 471
Awards: 2
Reputation: 4
Status: :-(
Cheburator, nice work!
 
0 Thanked you For This Useful Post:
CheburatorDate: Thursday, 2011-06-30, 11:26 PM | Message # 3
Member
Group: Senior Members
Messages: 43
Awards: 2
Reputation: 3
Status: :-(
Blazer, thank you wink
 
0 Thanked you For This Useful Post:
Maczo12310Date: Thursday, 2011-06-30, 11:27 PM | Message # 4
Member
Group: Senior Members
Messages: 987
Awards: 12
Reputation: 11
Status: :-(
Yes, that's good. The script looks so simple it self, but the coding is so advanced biggrin


Visit my Graphic forum board on uCause !!!
 
0 Thanked you For This Useful Post:
CheburatorDate: Thursday, 2011-06-30, 11:34 PM | Message # 5
Member
Group: Senior Members
Messages: 43
Awards: 2
Reputation: 3
Status: :-(
Donught, thanks i did my best ;D
 
0 Thanked you For This Useful Post:
BlazerDate: Thursday, 2011-06-30, 11:50 PM | Message # 6
Member
Group: Senior Members
Messages: 471
Awards: 2
Reputation: 4
Status: :-(
Cheburator, cant you put the edited on and edited by in the same code ?
 
0 Thanked you For This Useful Post:
CheburatorDate: Friday, 2011-07-01, 0:15 AM | Message # 7
Member
Group: Senior Members
Messages: 43
Awards: 2
Reputation: 3
Status: :-(
Blazer, sorry no because there isnt a code for who has edited the entry.
Only for the date and time..
 
0 Thanked you For This Useful Post:
HermesDate: Friday, 2011-07-01, 0:49 AM | Message # 8
Member
Group: Senior Members
Messages: 455
Awards: 7
Reputation: 8
Status: :-(
Cheburator, Good job smile
 
0 Thanked you For This Useful Post:
SirDarknight(Tonmoy)Date: Friday, 2011-07-01, 6:06 AM | Message # 9
Member
Group: Senior Members
Messages: 894
Awards: 10
Reputation: 15
Status: :-(
great

Please Give Me A Award or + Rep If My Post Helps You

Please Give Me A Award or + Rep If You Like my Scripts
 
0 Thanked you For This Useful Post:
AnimorphDate: Friday, 2011-07-01, 1:59 PM | Message # 10
uCause forum Admin
Group: Developer
Messages: 2835
Awards: 73
Status: :-(
Ooh nice
 
0 Thanked you For This Useful Post:
uCause Community » Trash & Archives » Other » Entry last edited on
  • Page 1 of 1
  • 1
Search:


"Making uCoz web designs simple and easy to use"
- uCause Developers