Example #1
0
 function uri_store($data)
 {
     $query = so_uri::make($data)->query;
     $this->name = $query['article'];
     $author = hyoo_author::makeInstance()->name($query['author'])->primary();
     $this->author = $author;
 }
Example #2
0
 function name_make()
 {
     $cookie = so_cookie::make('hyoo_author_name');
     $userKey = so_user::make()->key;
     if ($cookie->value) {
         $author = hyoo_author::makeInstance()->name($cookie->value);
         if (!$author->key) {
             return $author->name;
         }
         if ($author->key == so_crypt::hash((string) $author->uri, $userKey)) {
             return $author->name;
         }
     }
     return substr(md5($userKey), 0, 8);
 }