YaWK  24.1
Yet another WebKit
YAWK\PLUGINS\USERPAGE\stats Class Reference

Userpage Profile Class. More...

Public Member Functions

 __construct ($db)
 stats constructor. load properties for username More...
 
 init ()
 draw account stats. More...
 

Protected Attributes

 $html
 
 $user
 

Detailed Description

Userpage Profile Class.

Stats class for userpage

STATS TAB shows the user his account stats.

Class covers frontend functionality. See Methods Summary for Details!

Author
Daniel Retzl danie.nosp@m.lret.nosp@m.zl@gm.nosp@m.ail..nosp@m.com
Version
1.0.0

Definition at line 15 of file stats.php.

Constructor & Destructor Documentation

◆ __construct()

YAWK\PLUGINS\USERPAGE\stats::__construct (   $db)

stats constructor. load properties for username

Parameters
object$dbdatabase

Definition at line 26 of file stats.php.

26  {
27  global $user;
28  $this->username = $_SESSION['username'];
29  $user = new \YAWK\user($db);
30  $user->loadProperties($db, $this->username);
31  }

References $db, and YAWK\PLUGINS\USERPAGE\stats\$user.

Member Function Documentation

◆ init()

YAWK\PLUGINS\USERPAGE\stats::init ( )

draw account stats.

Returns
string account stats

Definition at line 37 of file stats.php.

37  {
38  global $user;
39  if($user->blocked === '0') { $blocked = "Alles ok. Dein Account ist in Ordnung."; $blockedHtml = "text-success"; }
40  else { $blocked = "Dein Account wurde geblockt. Irgendetwas ist nicht in Ordnung."; $blockedHtml = "text-danger";
41  }
42 
43  if($user->privacy === '0') { $privacy = "visible"; $privacyHtml = "text-success"; }
44  else { $privacy = "hidden"; $privacyHtml="text-danger";
45  }
46 
47  if($user->public_email === '0') { $public_email = "visible"; $emailHtml = "text-success"; }
48  else { $public_email = "hidden"; $emailHtml = "text-danger";
49  }
50 
51  if($user->date_expired === NULL) {
52  $expiredHtml = "text-success";
53  $expired = "never - lifetime account";
54  }
55  else {
56  $expiredHtml = "text-warning";
57  $expired = "$user->date_expired";
58  }
59 
60  $this->html = "<br><legend><i class=\"fa fa-line-chart\"></i> &nbsp;Account Statistics <small> show details about your account</small></legend>
61  <dl class=\"dl-horizontal\">
62  <dt>Account Status:</dt>
63  <dd><small class=\"$blockedHtml\">$blocked</small></dd>
64  <dt>Active until:</dt>
65  <dd><small class=\"$expiredHtml\">$expired</small></dd>
66  <dt>Account created:</dt>
67  <dd><small>$user->date_created</small></dd>
68  <dt>Account changed:</dt>
69  <dd><small>$user->date_changed</small></dd>
70  <dt>&nbsp;</dt>
71  <dd>&nbsp;</dd>
72  <dt>Your last login:</dt>
73  <dd><small>$user->date_lastlogin</small></dd>
74  <dt>Logins:</dt>
75  <dd><small>$user->login_count</small></dd>
76  <dt>&nbsp;</dt>
77  <dd>&nbsp;</dd>
78  <dt>Online Status:</dt>
79  <dd><small class=\"$privacyHtml\">$privacy</small></dd>
80  <dt>Email adress:</dt>
81  <dd><small class=\"$emailHtml\">$public_email</small></dd>
82  </dl>";
83  return $this->html;
84  }

References YAWK\PLUGINS\USERPAGE\stats\$html, and YAWK\PLUGINS\USERPAGE\stats\$user.

Member Data Documentation

◆ $html

YAWK\PLUGINS\USERPAGE\stats::$html
protected
  • Parameters
    stringhtml output

Definition at line 18 of file stats.php.

Referenced by YAWK\PLUGINS\USERPAGE\stats\init().

◆ $user

YAWK\PLUGINS\USERPAGE\stats::$user
protected
  • Parameters
    objectuser object

Definition at line 20 of file stats.php.

Referenced by YAWK\PLUGINS\USERPAGE\stats\__construct(), and YAWK\PLUGINS\USERPAGE\stats\init().


The documentation for this class was generated from the following file: