diff options
-rw-r--r-- | README | 9 | ||||
-rw-r--r-- | lib/action.php | 2 | ||||
-rw-r--r-- | lib/common.php | 32 | ||||
-rw-r--r-- | lib/util.php | 5 | ||||
-rw-r--r-- | theme/base/css/display.css | 52 | ||||
-rw-r--r-- | theme/base/css/ie.css | 5 | ||||
-rw-r--r-- | theme/base/css/ie6.css | 5 | ||||
-rw-r--r-- | theme/base/css/ie7.css | 5 | ||||
-rw-r--r-- | theme/identica/css/display.css | 23 | ||||
-rw-r--r-- | theme/identica/css/ie.css | 9 | ||||
-rw-r--r-- | theme/identica/logo.png | bin | 2215 -> 4988 bytes |
11 files changed, 89 insertions, 58 deletions
@@ -745,6 +745,15 @@ edit any other file in the directory, like lib/common.php (where most of the defaults are defined), you will lose your configuration options in any upgrade, and you will wish that you had been more careful. +Starting with version 0.7.1, you can put config files in the +/etc/laconica/ directory on your server, if it exists. Config files +will be included in this order: + +* /etc/laconica/laconica.php - server-wide config +* /etc/laconica/<servername>.php - for a virtual host +* /etc/laconica/<servername>_<pathname>.php - for a path +* INSTALLDIR/config.php - for a particular implementation + Almost all configuration options are made through a two-dimensional associative array, cleverly named $config. A typical configuration line will be: diff --git a/lib/action.php b/lib/action.php index 8f02b36bf..4d4c3d4c9 100644 --- a/lib/action.php +++ b/lib/action.php @@ -162,6 +162,8 @@ class Action extends HTMLOutputter // lawsuit 'media' => 'screen, projection, tv')); $this->comment('[if IE]><link rel="stylesheet" type="text/css" '. 'href="'.theme_path('css/ie.css', 'base').'?version='.LACONICA_VERSION.'" /><![endif]'); + $this->comment('[if IE]><link rel="stylesheet" type="text/css" '. + 'href="'.theme_path('css/ie.css', null).'?version='.LACONICA_VERSION.'" /><![endif]'); foreach (array(6,7) as $ver) { if (file_exists(theme_file('ie'.$ver.'.css'))) { // Yes, IE people should be put in jail. diff --git a/lib/common.php b/lib/common.php index a2f9b9bfe..825ba0ff7 100644 --- a/lib/common.php +++ b/lib/common.php @@ -50,14 +50,23 @@ require_once('DB/DataObject/Cast.php'); # for dates require_once(INSTALLDIR.'/lib/language.php'); +// try to figure out where we are + +$_server = array_key_exists('SERVER_NAME', $_SERVER) ? + strtolower($_SERVER['SERVER_NAME']) : + null; +$_path = array_key_exists('SCRIPT_NAME', $_SERVER) ? + substr($_SERVER['SCRIPT_NAME'], 1, strrpos($_SERVER['SCRIPT_NAME'], '/') - 1) : + null; + // default configuration, overwritten in config.php $config = array('site' => array('name' => 'Just another Laconica microblog', - 'server' => 'localhost', + 'server' => $_server, 'theme' => 'default', - 'path' => '/', + 'path' => $_path, 'logfile' => null, 'fancy' => false, 'locale_path' => INSTALLDIR.'/locale', @@ -150,7 +159,24 @@ if (function_exists('date_default_timezone_set')) { date_default_timezone_set('UTC'); } -require_once(INSTALLDIR.'/config.php'); +// From most general to most specific: +// server-wide, then vhost-wide, then for a path, +// finally for a dir (usually only need one of the last two). + +$_config_files = array('/etc/laconica/laconica.php', + '/etc/laconica/'.$_server.'.php'); + +if (strlen($_path) > 0) { + $_config_files[] = '/etc/laconica/'.$_server.'_'.$_path.'.php'; +} + +$_config_files[] = INSTALLDIR.'/config.php'; + +foreach ($_config_files as $_config_file) { + if (file_exists($_config_file)) { + include_once($_config_file); + } +} require_once('Validate.php'); require_once('markdown.php'); diff --git a/lib/util.php b/lib/util.php index 3690f0ad5..d7af3f204 100644 --- a/lib/util.php +++ b/lib/util.php @@ -370,8 +370,6 @@ function common_canonical_email($email) return $email; } -define('URL_REGEX', '^|[ \t\r\n])((ftp|http|https|gopher|mailto|news|nntp|telnet|wais|file|prospero|aim|webcal):(([A-Za-z0-9$_.+!*(),;/?:@&~=-])|%[A-Fa-f0-9]{2}){2,}(#([a-zA-Z0-9][a-zA-Z0-9$_.+!*(),;/?:@&~=%-]*))?([A-Za-z0-9$_+!*();/?:~-]))'); - function common_render_content($text, $notice) { $r = common_render_text($text); @@ -388,7 +386,8 @@ function common_render_text($text) $r = htmlspecialchars($text); $r = preg_replace('/[\x{0}-\x{8}\x{b}-\x{c}\x{e}-\x{19}]/', '', $r); - $r = preg_replace_callback('@https?://[^\]>\s]+@', 'common_render_uri_thingy', $r); + $r = preg_replace_callback('@(ftp|http|https|mms|rtsp|gopher|news|nntp|telnet|wais|file|prospero|webcal|xmpp|irc)://[^\]>\s]+@', 'common_render_uri_thingy', $r); + $r = preg_replace_callback('@(mailto|aim|tel):[^\]>\s]+@', 'common_render_uri_thingy', $r); // Pseudo-protocols don't require '//' after ':'. $r = preg_replace('/(^|\s+)#([A-Za-z0-9_\-\.]{1,64})/e', "'\\1#'.common_tag_link('\\2')", $r); // XXX: machine tags return $r; diff --git a/theme/base/css/display.css b/theme/base/css/display.css index 166044c71..809c1ba6f 100644 --- a/theme/base/css/display.css +++ b/theme/base/css/display.css @@ -507,50 +507,43 @@ position:relative; width:475px; min-height:123px; float:left; -margin-bottom:17px; +margin-bottom:18px; margin-left:0; } .entity_profile dt, #entity_statistics dt { font-weight:bold; } +.entity_profile dd { +display:inline; +} + .entity_profile .entity_depiction { float:left; -position:absolute; -top:0; -left:0; width:96px; +margin-right:18px; +margin-bottom:18px; } + .entity_profile .entity_fn, .entity_profile .entity_nickname, .entity_profile .entity_location, .entity_profile .entity_url, .entity_profile .entity_note, .entity_profile .entity_tags { -float:left; -clear:left; margin-left:113px; -width:322px; margin-bottom:4px; +width:322px; } .entity_profile .entity_fn, .entity_profile .entity_nickname { -width:auto; -clear:none; -} - -.entity_profile .entity_fn { margin-left:11px; -margin-right:4px; -} -.entity_profile .entity_fn .fn { +display:inline; font-weight:bold; -font-style:normal; } -.entity_profile .nickname { -font-style:italic; -font-weight:bold; +.entity_profile .entity_nickname { +margin-left:0; } .entity_profile .entity_fn dd:before { @@ -568,13 +561,14 @@ display:none; .entity_profile h2 { display:none; } + /* entity_profile */ /*entity_actions*/ .entity_actions { float:right; - +margin-left:28px; } .entity_actions h2 { display:none; @@ -796,6 +790,7 @@ text-decoration:underline; .notice .entry-title { float:left; width:100%; +overflow:auto; } #shownotice .notice .entry-title { font-size:2.2em; @@ -1024,21 +1019,18 @@ display:block; text-decoration:none; font-weight:bold; padding:7px; -border:1px dotted #D1D9E4; -border-bottom:0; +border-width:1px; +border-style:solid; +-moz-border-radius:7px; +-webkit-border-radius:7px; +border-radius:7px; } .pagination .nav_prev a { --moz-border-radius-topright:7px; --webkit-border-top-right-radius:7px; -padding-left:20px; -border-left:0; +padding-left:30px; } .pagination .nav_next a { --moz-border-radius-topleft:7px; --webkit-border-top-left-radius:7px; -padding-right:20px; -border-right:0; +padding-right:30px; } /* END: NOTICE */ diff --git a/theme/base/css/ie.css b/theme/base/css/ie.css index 08b027b59..45176a201 100644 --- a/theme/base/css/ie.css +++ b/theme/base/css/ie.css @@ -9,7 +9,6 @@ margin-top:3px; height:16px; text-align:right; text-indent:0; -color:#fff; width:24px; } @@ -24,7 +23,3 @@ margin-left:-7px; .notice div.entry-content .timestamp a { margin-right:4px; } - -.entity_profile .entity_nickname { -padding-right:3px; -} diff --git a/theme/base/css/ie6.css b/theme/base/css/ie6.css index 4a2316903..10b31cbcb 100644 --- a/theme/base/css/ie6.css +++ b/theme/base/css/ie6.css @@ -4,5 +4,8 @@ .entity_profile .entity_url, .entity_profile .entity_note, .entity_profile .entity_tags { -margin-left:55px; +margin-left:0; +} +.entity_profile .entity_depiction { +margin-bottom:123px; } diff --git a/theme/base/css/ie7.css b/theme/base/css/ie7.css deleted file mode 100644 index a6ee001e2..000000000 --- a/theme/base/css/ie7.css +++ /dev/null @@ -1,5 +0,0 @@ -/* IE7 specific styles */ - -#form_notice textarea { -width:370px; -} diff --git a/theme/identica/css/display.css b/theme/identica/css/display.css index 15c22148d..beb5a2c13 100644 --- a/theme/identica/css/display.css +++ b/theme/identica/css/display.css @@ -40,12 +40,12 @@ input.submit, #nav_register a, .form_settings .form_note, .entity_remote_subscribe { -background-color:#A9BF4F; +background-color:#9BB43E; } input:focus, textarea:focus, select:focus, #form_notice.warning #notice_data-text { -border-color:#A9BF4F; +border-color:#9BB43E; } input.submit, #nav_register a, @@ -65,11 +65,11 @@ color:#002E6E; .notice, .profile { -border-top-color:#D1D9E4; +border-top-color:#CEE1E9; } .section .notice, .section .profile { -border-top-color:#97BFD1; +border-top-color:#87B4C8; } @@ -116,7 +116,7 @@ background-color:#fff; } #site_nav_local_views a { -background-color:rgba(151, 191, 209, 0.3); +background-color:rgba(135, 180, 200, 0.3); } #site_nav_local_views a:hover { background-color:rgba(255, 255, 255, 0.7); @@ -134,13 +134,13 @@ background-color:#EFF3DC; #anon_notice { -background-color:#97BFD1; +background-color:#87B4C8; color:#fff; border-color:#fff; } #showstream #anon_notice { -background-color:#A9BF4F; +background-color:#9BB43E; } @@ -177,12 +177,12 @@ background-color:transparent; .form_group_leave input.submit .form_user_subscribe input.submit, .form_user_unsubscribe input.submit { -background-color:#A9BF4F; +background-color:#9BB43E; color:#fff; } .form_user_unsubscribe input.submit, .form_group_leave input.submit { -background-color:#97BFD1; +background-color:#87B4C8; } .entity_send-a-message a { @@ -274,12 +274,13 @@ background:transparent url(../images/icons/twotone/green/news.gif) no-repeat 0 4 .pagination .nav_prev a, .pagination .nav_next a { background-repeat:no-repeat; +border-color:#CEE1E9; } .pagination .nav_prev a { background-image:url(../images/icons/twotone/green/arrow-left.gif); -background-position:0 45%; +background-position:10% 45%; } .pagination .nav_next a { background-image:url(../images/icons/twotone/green/arrow-right.gif); -background-position:100% 45%; +background-position:90% 45%; } diff --git a/theme/identica/css/ie.css b/theme/identica/css/ie.css new file mode 100644 index 000000000..2f463bb44 --- /dev/null +++ b/theme/identica/css/ie.css @@ -0,0 +1,9 @@ +/* IE specific styles */ + +.notice-options input.submit { +color:#fff; +} + +#site_nav_local_views a { +background-color:#D0DFE7; +} diff --git a/theme/identica/logo.png b/theme/identica/logo.png Binary files differindex cee36799e..7c68b34f6 100644 --- a/theme/identica/logo.png +++ b/theme/identica/logo.png |