tips:prettyrecentfix
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tips:prettyrecentfix [2010-02-20 23:36] – 164.67.235.79 | tips:prettyrecentfix [2012-11-24 10:47] (current) – deprecated: only for 2005 version of dw flam | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Introduction ====== | ||
- | This tips gives you a " | ||
- | |||
- | This is an updated and enhanced version of the orginal work of [[http:// | ||
- | |||
- | ====== HowTo ====== | ||
- | |||
- | ===== for 2005-09-19 version ===== | ||
- | |||
- | To obtain pretty recents pages, in your **./ | ||
- | |||
- | <code php> | ||
- | |||
- | function html_recent($first=0){ | ||
- | global $conf; | ||
- | global $lang; | ||
- | global $ID; | ||
- | |||
- | $recents = getRecents($first, | ||
- | print p_locale_xhtml(' | ||
- | // counter initialization | ||
- | $cdate = ' | ||
- | echo $recents[$id][' | ||
- | foreach($recents as $id => $val){ | ||
- | if(date(" | ||
- | |||
- | echo '< | ||
- | |||
- | $cdate = date(" | ||
- | |||
- | } | ||
- | | ||
- | $date = date($conf[' | ||
- | |||
- | print '< | ||
- | |||
- | print $date.' | ||
- | |||
- | print '<a href="' | ||
- | $p = array(); | ||
- | $p[' | ||
- | $p[' | ||
- | $p[' | ||
- | $p[' | ||
- | $p[' | ||
- | $p[' | ||
- | $att = buildAttributes($p); | ||
- | print "< | ||
- | print '</ | ||
- | |||
- | print '<a href="' | ||
- | $p = array(); | ||
- | $p[' | ||
- | $p[' | ||
- | $p[' | ||
- | $p[' | ||
- | $p[' | ||
- | $p[' | ||
- | $att = buildAttributes($p); | ||
- | print "< | ||
- | print '</ | ||
- | |||
- | print html_wikilink(':' | ||
- | print ' ' | ||
- | print ' <span class=" | ||
- | if($val[' | ||
- | print $val[' | ||
- | // if you prefer display the real name instead of the username | ||
- | // comment the previous line "print $val[' | ||
- | // and decomment the 2 following lines | ||
- | // $userdata = auth_getUserData($val[' | ||
- | // print $userdata[' | ||
- | }else{ | ||
- | print $val[' | ||
- | } | ||
- | print '</ | ||
- | print '</ | ||
- | print " | ||
- | } | ||
- | |||
- | print '< | ||
- | $last = $first + $conf[' | ||
- | if ($first > 0) { | ||
- | $first -= $conf[' | ||
- | if ($first < 0) $first = 0; | ||
- | print '< | ||
- | print html_btn(' | ||
- | print '</ | ||
- | } | ||
- | if ($conf[' | ||
- | print '< | ||
- | print html_btn(' | ||
- | print '</ | ||
- | } | ||
- | print '</ | ||
- | } | ||
- | </ | ||
- | |||
- | ===== Old version ===== | ||
- | |||
- | I updated this script to work with the July 1st Revision. | ||
- | <code php> | ||
- | function html_recent($first=0){ | ||
- | global $conf; | ||
- | global $lang; | ||
- | |||
- | /* we need to get one additionally log entry to be able to | ||
- | * decide if this is the last page or is there another one. | ||
- | * This is the cheapest solution to get this information. | ||
- | */ | ||
- | $recents = getRecents($first, | ||
- | if(count($recents) == 0 && $first != 0){ | ||
- | $first=0; | ||
- | $recents = getRecents(0, | ||
- | } | ||
- | $cnt = count($recents) <= $conf[' | ||
- | | ||
- | print p_locale_xhtml(' | ||
- | | ||
- | $cdate = ' | ||
- | foreach($recents as $id => $val){ | ||
- | if(date(" | ||
- | |||
- | echo '< | ||
- | $cdate = date(" | ||
- | } | ||
- | | ||
- | $date = date(' | ||
- | |||
- | print '< | ||
- | print $date.' | ||
- | print ' ' | ||
- | print ' <span class=" | ||
- | print $val[' | ||
- | if($val[' | ||
- | print ' | ||
- | print '</ | ||
- | print " | ||
- | } | ||
- | } | ||
- | </ | ||
- | |||
- | ====== Discussion ====== | ||
- | |||
- | * Could it be included in the main source (perhaps as an option) ? | ||
- | |||
- | > If you want the real name instead of the username on each line, change the following: | ||
- | |||
- | <code php> | ||
- | if($val[' | ||
- | print $val[' | ||
- | </ | ||
- | |||
- | > to: | ||
- | |||
- | <code php> | ||
- | if($val[' | ||
- | $userdata = auth_getUserData($val[' | ||
- | print $userdata[' | ||
- | </ | ||
- | |||
- | --- // | ||
- | >> Thanks, I added your tip as an " |
tips/prettyrecentfix.1266705397.txt.gz · Last modified: 2010-02-20 23:36 by 164.67.235.79