Revision [20606]

This is an old revision of SigAction made by PezHore on 2009-05-11 09:57:27.

 

Sig Action


Temporary holding place for a potential action...

Description: Action that displays signature based on either the logged in username (default), or a specified user ($user)

Features


Displays signature as "- UserName, mm/dd/yyy"

Code


  1. <?php
  2. /**
  3.  * Sig Action
  4.  *
  5.  * Usage:
  6.  *      {{sig}} - Displays signature with default username
  7.  *      {{age user="name goes here"}} - Displays signature with specified username
  8.  *
  9.  * Version 0.1
  10.  * @input   string $user    Optional: username
  11.  * @uses    Wakka::ReturnSafeHTML()
  12.  * @todo    Add more featuers?      
  13.  *
  14.  * Changelog
  15.  *  0.1     Initial revision  
  16.  */
  17.  
  18. // Get user from parameter
  19. $user = (string)trim($this->htmlspecialchars_ent($vars['user']));
  20.  
  21. if (!$user) {
  22.   $username = $this->FormatUser($this->reg_username); // Defaults to username  
  23. } else {
  24.   $username = $user;                                  // Use passed user variable for username
  25. }
  26.  
  27. // Get current year, month, and day.
  28. list($this_year, $this_month, $this_day) = explode(' ',date('Y n j'));
  29.  
  30. // Set signature
  31. $sig = "- ".$username.", ".$this_month."/".$this_day."/".$this_year;
  32.  
  33. echo $this->ReturnSafeHTML($sig);
  34.  
  35. ?>
There are 2 comments on this page. [Show comments]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki