]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/util.php
unique key on a boolean value is not scalable
[quix0rs-gnu-social.git] / lib / util.php
index 1d661fb4e86c5c7928cb847b3324a020b9aac4e1..97a36296cffc548d111556b364767d54e3fe4f8e 100644 (file)
@@ -234,11 +234,7 @@ function common_show_footer() {
        } else {
                $instr = _('**%%site.name%%** is a microblogging service. ');
        }
-       $instr .= sprintf(_('It runs the [Laconica](http://laconi.ca/) ' .
-                        'microblogging software, version %s, ' .
-                        'available under the ' .
-                        '[GNU Affero General Public License]' .
-                        '(http://www.fsf.org/licensing/licenses/agpl-3.0.html).'), LACONICA_VERSION);
+       $instr .= sprintf(_('It runs the [Laconica](http://laconi.ca/) microblogging software, version %s, available under the [GNU Affero General Public License](http://www.fsf.org/licensing/licenses/agpl-3.0.html).'), LACONICA_VERSION);
     $output = common_markup_to_html($instr);
     common_raw($output);
        common_element_end('div');
@@ -728,6 +724,8 @@ function common_fancy_url($action, $args=NULL) {
                return common_path('settings/'.$action);
         case 'profilesettings':
                return common_path('settings/profile');
+        case 'emailsettings':
+               return common_path('settings/email');
         case 'openidsettings':
                return common_path('settings/openid');
         case 'newnotice':
@@ -862,6 +860,7 @@ function common_redirect($url, $code=307) {
                                         'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd');
        common_element('a', array('href' => $url), $url);
        common_end_xml();
+    exit;
 }
 
 function common_save_replies($notice) {
@@ -893,7 +892,7 @@ function common_save_replies($notice) {
                if (!$id) {
                        $last_error = &PEAR::getStaticProperty('DB_DataObject','lastError');
                        common_log(LOG_ERROR, 'DB error inserting reply: ' . $last_error->message);
-                       common_server_error(_('DB error inserting reply: %s', $last_error->message));
+                       common_server_error(sprintf(_('DB error inserting reply: %s'), $last_error->message));
                        return;
                }
        }
@@ -1061,7 +1060,7 @@ function common_log($priority, $msg, $filename=NULL) {
        if ($logfile) {
                $log = fopen($logfile, "a");
                if ($log) {
-                       static $syslog_priorities = array('LOG_EMERG', 'LOG_ALERT', 'LOG_CRIT', 'LOG_ERR', 
+                       static $syslog_priorities = array('LOG_EMERG', 'LOG_ALERT', 'LOG_CRIT', 'LOG_ERR',
                                                                                          'LOG_WARNING', 'LOG_NOTICE', 'LOG_INFO', 'LOG_DEBUG');
                        $output = date('Y-m-d H:i:s') . ' ' . $syslog_priorities[$priority] . ': ' . $msg . "\n";
                        fwrite($log, $output);
@@ -1272,3 +1271,13 @@ function common_markup_to_html($c) {
        $c = preg_replace('/%%(\w+).(\w+)%%/e', 'common_config(\'\\1\', \'\\2\')', $c);
        return Markdown($c);
 }
+
+function common_profile_avatar_url($profile, $size=AVATAR_PROFILE_SIZE) {
+       $avatar = $profile->getAvatar($size);
+       if ($avatar) {
+               return common_avatar_display_url($avatar);
+       } else {
+               return common_default_avatar($size);
+       }
+}
+       
\ No newline at end of file