]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Add 'mainpage' to User_group
authorEvan Prodromou <evan@status.net>
Thu, 25 Feb 2010 14:24:29 +0000 (09:24 -0500)
committerEvan Prodromou <evan@status.net>
Thu, 25 Feb 2010 14:24:29 +0000 (09:24 -0500)
Add the mainpage attribute to user_group objects.

classes/User_group.php
classes/statusnet.ini
db/statusnet.sql

index 5877ce2022893a20802ba594b1fa7a1694fb6d11..a81eb8ce0608f10dae71b0f0873cee1565dc44f5 100644 (file)
@@ -23,6 +23,7 @@ class User_group extends Memcached_DataObject
     public $created;                         // datetime   not_null default_0000-00-00%2000%3A00%3A00
     public $modified;                        // timestamp   not_null default_CURRENT_TIMESTAMP
     public $uri;                             // varchar(255)  unique_key
+    public $mainpage;                        // varchar(255)
 
     /* Static get */
     function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('User_group',$k,$v); }
@@ -42,8 +43,13 @@ class User_group extends Memcached_DataObject
     {
         $url = null;
         if (Event::handle('StartUserGroupHomeUrl', array($this, &$url))) {
-            $url = common_local_url('showgroup',
-                                    array('nickname' => $this->nickname));
+            // normally stored in mainpage, but older ones may be null
+            if (!empty($this->mainpage)) {
+                $url = $this->mainpage;
+            } else {
+                $url = common_local_url('showgroup',
+                                        array('nickname' => $this->nickname));
+            }
         }
         Event::handle('EndUserGroupHomeUrl', array($this, &$url));
         return $url;
index 7444306f0074c89c819fb913f70723d3d2f886ed..719dbedf57cedbe7d3231d90b2ba51258e90b47a 100644 (file)
@@ -601,6 +601,7 @@ design_id = 1
 created = 142
 modified = 384
 uri = 2
+mainpage = 2
 
 [user_group__keys]
 id = N
index 75d060e28291654c09b0ef931be1b31fd3300a68..4158f0167db2a9f9def64f29ac8fff1fef574382 100644 (file)
@@ -422,6 +422,7 @@ create table user_group (
     modified timestamp comment 'date this record was modified',
 
     uri varchar(255) unique key comment 'universal identifier',
+    mainpage varchar(255) comment 'page for group info to link to',
 
     index user_group_nickname_idx (nickname)