]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge commit 'br3nda/0.8.x-hashtags' into 0.8.x
authorCraig Andrews <candrews@integralblue.com>
Wed, 22 Jul 2009 14:23:17 +0000 (10:23 -0400)
committerCraig Andrews <candrews@integralblue.com>
Wed, 22 Jul 2009 14:23:17 +0000 (10:23 -0400)
18 files changed:
README
actions/recoverpassword.php [changed mode: 0644->0755]
classes/Session.php
db/sms_carrier.sql
htaccess.sample
install.php
lib/dbqueuemanager.php
lib/language.php
lib/mail.php
lib/rssaction.php
lib/twitterapi.php
lib/util.php
scripts/getvaliddaemons.php
scripts/maildaemon.php
scripts/xmppdaemon.php
theme/base/css/ie6.css
theme/pigeonthoughts/css/base.css
theme/pigeonthoughts/css/display.css

diff --git a/README b/README
index b65a08d425089728dd3d6236c3c8b3472a141cc4..0bf1319c6d4d4b1b0c0345b3f5168d566323ef2a 100644 (file)
--- a/README
+++ b/README
@@ -262,13 +262,16 @@ especially if you've previously installed PHP/MySQL packages.
    that user's default group instead. As a last resort, you can create
    a new group like "mublog" and add the Web server's user to the group.
 
-4. You should also take this moment to make your avatar subdirectory
-   writeable by the Web server. An insecure way to do this is:
+4. You should also take this moment to make your avatar, background, and
+   file subdirectories writeable by the Web server. An insecure way to do
+   this is:
 
          chmod a+w /var/www/mublog/avatar
+         chmod a+w /var/www/mublog/background
+         chmod a+w /var/www/mublog/file
 
-   You can also make the avatar directory writeable by the Web server
-   group, as noted above.
+   You can also make the avatar, background, and file directories
+   writeable by the Web server group, as noted above.
 
 5. Create a database to hold your microblog data. Something like this
    should work:
old mode 100644 (file)
new mode 100755 (executable)
index 2afd052..721edea
@@ -194,6 +194,9 @@ class RecoverpasswordAction extends Action
                         'or your registered email address.'));
         $this->elementEnd('li');
         $this->elementEnd('ul');
+        $this->element('input', array('name' => 'recover',
+                                      'type' => 'hidden',
+                                      'value' => _('Recover')));
         $this->submit('recover', _('Recover'));
         $this->elementEnd('fieldset');
         $this->elementEnd('form');
index 93fd99baa817ee2a6ddd75c7e16b95094917f746..ac80279c5e300aab9429ffb4e367a00910d434f2 100644 (file)
@@ -106,14 +106,11 @@ class Session extends Memcached_DataObject
     {
         self::logdeb("garbage collection (maxlifetime = $maxlifetime)");
 
-        $epoch = time() - $maxlifetime;
-
-        $qry = 'DELETE FROM session ' .
-          'WHERE modified < "'.$epoch.'"';
+        $epoch = common_sql_date(time() - $maxlifetime);
 
         $session = new Session();
-
-        $result = $session->query($qry);
+        $session->whereAdd('modified < "'.$epoch.'"');
+        $result = $session->delete(DB_DATAOBJECT_WHEREADD_ONLY);
 
         self::logdeb("garbage collection result = $result");
     }
index 6879f208907bfbd33bc773b1290da58e8ac51b92..055606f58213b59ef71aad70c727c142651102be 100644 (file)
@@ -60,4 +60,5 @@ VALUES
     (100112, 'Cincinnati Bell Wireless', '%s@gocbw.com', now()),
     (100113, 'T-Mobile Germany', '%s@t-mobile-sms.de', now()),
     (100114, 'Vodafone Germany', '%s@vodafone-sms.de', now()),
-    (100115, 'E-Plus', '%s@smsmail.eplus.de', now());
+    (100115, 'E-Plus', '%s@smsmail.eplus.de', now()),
+    (100116, 'Cellular South', '%s@csouth1.com', now());
index 634900dbf6a642f24923970de29ba029fe2d56da..942e98334a0dd4f50ddd284b29a209c9b70afc78 100644 (file)
@@ -1,12 +1,14 @@
-RewriteEngine On
+<IfModule mod_rewrite.c>
+  RewriteEngine On
 
-# NOTE: change this to your actual Laconica path; may be "/".
+  # NOTE: change this to your actual Laconica path; may be "/".
 
-RewriteBase /mublog/
+  RewriteBase /mublog/
 
-RewriteCond %{REQUEST_FILENAME} !-f
-RewriteCond %{REQUEST_FILENAME} !-d
-RewriteRule (.*) index.php?p=$1 [L,QSA]
+  RewriteCond %{REQUEST_FILENAME} !-f
+  RewriteCond %{REQUEST_FILENAME} !-d
+  RewriteRule (.*) index.php?p=$1 [L,QSA]
+</IfModule>
 
 <FilesMatch "\.(ini)">
   Order allow,deny
index bae296a350ab5925284b2a2cd1f20f64d5cefef5..1d3a531c5ac8c5ef984c3e71b26b1df85efbd8a1 100644 (file)
@@ -70,17 +70,16 @@ function checkPrereqs()
             $pass = false;
        }
 
-       if (!is_writable(INSTALLDIR.'/avatar/')) {
-         ?><p class="error">Cannot write avatar directory: <code><?php echo INSTALLDIR; ?>/avatar/</code></p>
-              <p>On your server, try this command: <code>chmod a+w <?php echo INSTALLDIR; ?>/avatar/</code></p>
-         <?
-            $pass = false;
-       }
-       if (!is_writable(INSTALLDIR.'/background/')) {
-         ?><p class="error">Cannot write background directory: <code><?php echo INSTALLDIR; ?>/background/</code></p>
-              <p>On your server, try this command: <code>chmod a+w <?php echo INSTALLDIR; ?>/background/</code></p>
-         <?
-            $pass = false;
+       // Check the subdirs used for file uploads
+       $fileSubdirs = array('avatar', 'background', 'file');
+       foreach ($fileSubdirs as $fileSubdir) {
+               $fileFullPath = INSTALLDIR."/$fileSubdir/";
+               if (!is_writable($fileFullPath)) {
+            ?><p class="error">Cannot write <?php echo $fileSubdir; ?> directory: <code><?php echo $fileFullPath; ?></code></p>
+                      <p>On your server, try this command: <code>chmod a+w <?php echo $fileFullPath; ?></code></p>
+            <?
+                    $pass = false;
+               }
        }
 
        return $pass;
index 6e7172de005ee7df94096e459122f936c424c3b4..1df5af6c1157d72641117382d3f0705bf975bddb 100644 (file)
@@ -55,7 +55,8 @@ class DBQueueManager extends QueueManager
     {
         while (true) {
             $this->_log(LOG_DEBUG, 'Checking for notices...');
-            $notice = $this->_nextItem($queue, null);
+            $timeout = $handler->timeout();
+            $notice = $this->_nextItem($queue, $timeout);
             if (empty($notice)) {
                 $this->_log(LOG_DEBUG, 'No notices waiting; idling.');
                 // Nothing in the queue. Do you
@@ -87,7 +88,9 @@ class DBQueueManager extends QueueManager
 
         do {
             $qi = Queue_item::top($queue);
-            if (!empty($qi)) {
+            if (empty($qi)) {
+               sleep(1);
+            } else {
                 $notice = Notice::staticGet('id', $qi->notice_id);
                 if (!empty($notice)) {
                     $result = $notice;
index 3ea3dd2aa0a5237412a980fb1266fce75d10e9e9..9ad2d31bd4b7cd21e75076cb102e9d97807ea2b3 100644 (file)
@@ -53,7 +53,7 @@ function client_prefered_language($httplang)
         if (!empty($httplang[2][$i])) {
             // if no q default to 1.0
             $client_langs[$httplang[2][$i]] =
-              ($httplang[6][$i]? (float) $httplang[6][$i] : 1.0);
+              ($httplang[6][$i]? (float) $httplang[6][$i] : 1.0 - ($i*0.01));
         }
         if (!empty($httplang[3][$i]) && empty($client_langs[$httplang[3][$i]])) {
             // if a catchall default 0.01 lower
index 90ee3c992855e06fba3e981779124335f69fec40..262f788ee5f3ce387ab096c8d477695fd6ca9017 100644 (file)
@@ -121,7 +121,7 @@ function mail_notify_from()
 
         $domain = mail_domain();
 
-        $notifyfrom = common_config('site', 'name') .' <noreply@'.$domain.'>';
+        $notifyfrom = '"'.common_config('site', 'name') .'" <noreply@'.$domain.'>';
     }
 
     return $notifyfrom;
index 9015589439ed4f59f0383cd2b47be8574bda8f48..9898894edd678e8fafd6a09c7d829cb2073672d2 100644 (file)
@@ -193,24 +193,6 @@ class Rss10Action extends Action
         }
     }
 
-    // XXX: Surely there should be a common function to do this?
-    function extract_tags ($string)
-    {
-        $count = preg_match_all('/(?:^|\s)#([A-Za-z0-9_\-\.]{1,64})/', strtolower($string), $match);
-        if (!count)
-        {
-            return array();
-        }
-
-        $rv = array();
-        foreach ($match[1] as $tag)
-        {
-            $rv[] = common_canonical_tag($tag);
-        } 
-
-        return array_unique($rv);
-    }
-        
     function showItem($notice)
     {
         $profile = Profile::staticGet($notice->profile_id);
@@ -269,26 +251,28 @@ class Rss10Action extends Action
                 $this->element('sioc:links_to', array('rdf:resource'=>$attachment->url));
             }
         }
-        $tags = $this->extract_tags($notice->content);
-        if (!empty($tags)) {
-            foreach ($tags as $tag)
-            {
-                $tagpage = common_local_url('tag', array('tag' => $tag));
+
+        $tag = new Notice_tag();
+        $tag->notice_id = $notice->id;
+        if ($tag->find()) {
+            $entry['tags']=array();
+            while ($tag->fetch()) {
+                $tagpage = common_local_url('tag', array('tag' => $tag->tag));
 
                 if ( in_array($tag, $this->tags_already_output) ) {
                     $this->element('ctag:tagged', array('rdf:resource'=>$tagpage.'#concept'));
                     continue;
                 }
 
-                $tagrss  = common_local_url('tagrss', array('tag' => $tag));
+                $tagrss  = common_local_url('tagrss', array('tag' => $tag->tag));
                 $this->elementStart('ctag:tagged');
-                $this->elementStart('ctag:Tag', array('rdf:about'=>$tagpage.'#concept', 'ctag:label'=>$tag));
+                $this->elementStart('ctag:Tag', array('rdf:about'=>$tagpage.'#concept', 'ctag:label'=>$tag->tag));
                 $this->element('foaf:page', array('rdf:resource'=>$tagpage));
                 $this->element('rdfs:seeAlso', array('rdf:resource'=>$tagrss));
                 $this->elementEnd('ctag:Tag');
                 $this->elementEnd('ctag:tagged');
 
-                $this->tags_already_output[] = $tag;
+                $this->tags_already_output[] = $tag->tag;
             }
         }
         $this->elementEnd('item');
index 79da82a19408ea44a195087faf31dbc6d9ae389e..b2602e77ca996418b87e628df83281b08c6a2e44 100644 (file)
@@ -265,6 +265,18 @@ class TwitterapiAction extends Action
             }
         }
 */
+
+        // Tags/Categories
+        $tag = new Notice_tag();
+        $tag->notice_id = $notice->id;
+        if ($tag->find()) {
+            $entry['tags']=array();
+            while ($tag->fetch()) {
+                $entry['tags'][]=$tag->tag;
+            }
+        }
+        $tag->free();
+
         // RSS Item specific
         $entry['description'] = $entry['content'];
         $entry['pubDate'] = common_date_rfc2822($notice->created);
@@ -442,6 +454,12 @@ class TwitterapiAction extends Action
             $enclosure = $entry['enclosures'][0];
             $this->element('enclosure', array('url'=>$enclosure['url'],'type'=>$enclosure['mimetype'],'length'=>$enclosure['size']), null);
         }
+        
+        if($entry['tags']){
+            foreach($entry['tags'] as $tag){
+                $this->element('category', null,$tag);
+            }
+        }
 
         $this->elementEnd('item');
     }
index edc396cc0217f650207a7e0e6bf3686efc076c1f..c7c82dba29fd7197e68397c8124e1420c54218dc 100644 (file)
@@ -414,9 +414,9 @@ function common_replace_urls_callback($text, $callback, $notice_id = null) {
     $regex = '#'.
     '(?:'.
         '(?:'.
-            '(?:https?|ftps?|mms|rtsp|gopher|news|nntp|telnet|wais|file|prospero|webcal|xmpp|irc)://'.
+            '(?:https?|ftps?|mms|rtsp|gopher|news|nntp|telnet|wais|file|prospero|webcal|irc)://'.
             '|'.
-            '(?:mailto|aim|tel):'.
+            '(?:mailto|aim|tel|xmpp):'.
         ')'.
         '[^.\s]+\.[^\s]+'.
         '|'.
index 97c230784f73e5be9897bfc536583a6cdd97c900..1e4546dff1261704f3afc35fe864c473b1ce2ddb 100755 (executable)
@@ -28,7 +28,8 @@
 define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
 
 $helptext = <<<ENDOFHELP
-getvaliddaemons.php - print out the currently configured PID directory
+getvaliddaemons.php - print out a list of valid daemons that should be started
+by the startdaemons script
 
 ENDOFHELP;
 
index 11ddf06b7502734b3c3b239433e764fc31aca78a..a4003b6b26b5018748b51eab4ea8310410516114 100755 (executable)
@@ -299,25 +299,40 @@ class MailerDaemon
 
         $attachments = array();
 
+        $this->extract_part($parsed,$msg,$attachments);
+
+        return array($from, $to, $msg, $attachments);
+    }
+
+    function extract_part($parsed,&$msg,&$attachments){
         if ($parsed->ctype_primary == 'multipart') {
-            foreach ($parsed->parts as $part) {
-                if ($part->ctype_primary == 'text' &&
-                    $part->ctype_secondary == 'plain') {
-                    $msg = $part->body;
-                }else{
-                    if ($part->body) {
-                       $attachment = tmpfile();
-                       fwrite($attachment, $part->body);
-                        $attachments[] = $attachment;
-                    }
+            if($parsed->ctype_secondary == 'alternative'){
+                $altmsg = $this->extract_msg_from_multipart_alternative_part($parsed);
+                if(!empty($altmsg)) $msg = $altmsg;
+            }else{
+                foreach($parsed->parts as $part){
+                    $this->extract_part($part,$msg,$attachments);
                 }
             }
-        } else if ($type == 'text/plain') {
+        } else if ($parsed->ctype_primary == 'text'
+            && $parsed->ctype_secondary=='plain') {
             $msg = $parsed->body;
-        } else {
-            $this->unsupported_type($type);
+        }else if(!empty($parsed->body)){
+            if(common_config('attachments', 'uploads')){
+                //only save attachments if uploads are enabled
+                $attachment = tmpfile();
+                fwrite($attachment, $parsed->body);
+                $attachments[] = $attachment;
+            }
         }
-        return array($from, $to, $msg, $attachments);
+    }
+
+    function extract_msg_from_multipart_alternative_part($parsed){
+        foreach ($parsed->parts as $part) {
+            $this->extract_part($part,$msg,$attachments);
+        }
+        //we don't want any attachments that are a result of this parsing
+        return $msg;
     }
 
     function unsupported_type($type)
index 488b4b514c46a8e997e5f14250380a49ad0fec42..69512f243895e6d6d2a9c023a5408638f141e1a1 100755 (executable)
@@ -175,6 +175,10 @@ class XMPPDaemon extends Daemon
 
         $user = $this->get_user($from);
 
+        // For common_current_user to work
+        global $_cur;
+        $_cur = $user;
+
         if (!$user) {
             $this->from_site($from, 'Unknown user; go to ' .
                              common_local_url('imsettings') .
@@ -211,6 +215,7 @@ class XMPPDaemon extends Daemon
 
         $user->free();
         unset($user);
+        unset($_cur);
 
         unset($pl['xml']);
         $pl['xml'] = null;
index dde4d6fc77081906566f6f7ec0cebea44c30dacc..eca240faae0a3c2c3667e148d6ed7fd70e44e669 100644 (file)
@@ -12,7 +12,7 @@ margin:0 auto;
 }
 
 #content {
-width:70%;
+width:69%;
 }
 #aside_primary {
 padding:5%;
index 9866e2d2cca4ae5b9e78cf01ba4ab4f5d838fbf2..5d5eb9896cae9d16db895e4021580e6cf30e82ea 100644 (file)
@@ -383,7 +383,7 @@ margin-bottom:1em;
 }
 
 #content {
-width:49.009%;
+width:50%;
 min-height:259px;
 float:left;
 padding:0 18px;
@@ -402,7 +402,7 @@ float:left;
 width:45.917%;
 min-height:259px;
 float:left;
-margin-left:1.385%;
+margin-left:0.25%;
 padding-bottom:47px;
 }
 
@@ -736,11 +736,10 @@ margin-right:11px;
 .notice,
 .profile {
 position:relative;
-padding-top:11px;
-padding-bottom:11px;
+padding:11px 2%;
 clear:both;
 float:left;
-width:96.41%;
+width:95.7%;
 border-width:1px;
 border-style:solid;
 margin-bottom:11px;
@@ -993,13 +992,36 @@ font-weight:bold;
 padding:0;
 }
 #jOverlayContent h1 {
-max-width:475px;
+max-width:425px;
 }
 #jOverlayContent #content {
 border-radius:7px;
 -moz-border-radius:7px;
 -webkit-border-radius:7px;
 }
+#jOverlayLoading {
+top:5%;
+left:40%;
+}
+#attachment_view img {
+max-width:480px;
+max-height:480px;
+}
+#attachment_view #oembed_info {
+margin-top:11px;
+}
+#attachment_view #oembed_info dt,
+#attachment_view #oembed_info dd {
+float:left;
+}
+#attachment_view #oembed_info dt {
+clear:left;
+margin-right:11px;
+font-weight:bold;
+}
+#attachment_view #oembed_info dt:after {
+content: ":";
+}
 
 #usergroups #new_group {
 float: left;
@@ -1058,8 +1080,6 @@ top:3px;
 left:3px;
 }
 
-
-
 .pagination {
 float:left;
 clear:both;
@@ -1105,7 +1125,6 @@ padding-right:30px;
 }
 /* END: NOTICE */
 
-
 .hentry .entry-content p {
 margin-bottom:18px;
 }
@@ -1122,7 +1141,6 @@ margin-bottom:18px;
 margin-left:18px;
 }
 
-
 /* TOP_POSTERS */
 .section tbody td {
 padding-right:11px;
@@ -1150,7 +1168,6 @@ margin-right:0;
 display:none;
 }
 
-
 /* tagcloud */
 .tag-cloud {
 list-style-type:none;
@@ -1233,6 +1250,11 @@ clear:both;
 margin-bottom:0;
 }
 
+#form_settings_design #settings_design_background-image img {
+max-width:480px;
+max-height:480px;
+}
+
 #form_settings_design #settings_design_color .form_data,
 #form_settings_design #color-picker {
 float:left;
index 01af500bfcb3c693bd234d5346a0dc89fc1546bd..f113225fbf193612dc06e14cdbaf85065b5269f0 100644 (file)
@@ -14,7 +14,8 @@ background:url(../images/illustrations/illu_pigeons-01.png) no-repeat 0 100%;
 }
 
 body,
-a:active {
+a:active,
+#content {
 background-color:#AEA187;
 }
 body {