diff --git a/actions/newnotice.php b/actions/newnotice.php index b2c513733d..b65edf4c30 100644 --- a/actions/newnotice.php +++ b/actions/newnotice.php @@ -43,7 +43,7 @@ class NewnoticeAction extends Action { $notice->profile_id = $user->id; # user id *is* profile id $notice->created = DB_DataObject_Cast::dateTime(); # Default theme uses 'content' for something else - $notice->content = $this->trimmed('noticecontent'); + $notice->content = $this->trimmed('status_textarea'); if (!$notice->content) { $this->show_form(_t('No content!')); diff --git a/lib/common.php b/lib/common.php index f910b36135..198c8feaff 100644 --- a/lib/common.php +++ b/lib/common.php @@ -36,6 +36,7 @@ $config = array('site' => array('name' => 'Just another Laconica microblog', 'server' => 'localhost', + 'theme' => 'default', 'path' => '/', 'fancy' => false), 'syslog' => @@ -69,6 +70,7 @@ $config['db'] = require_once(INSTALLDIR.'/config.php'); require_once(INSTALLDIR.'/lib/util.php'); require_once(INSTALLDIR.'/lib/action.php'); +require_once(INSTALLDIR.'/lib/theme.php'); require_once(INSTALLDIR.'/classes/Avatar.php'); require_once(INSTALLDIR.'/classes/Notice.php'); diff --git a/lib/theme.php b/lib/theme.php new file mode 100644 index 0000000000..d1e82596ed --- /dev/null +++ b/lib/theme.php @@ -0,0 +1,30 @@ +. + */ + +if (!defined('LACONICA')) { exit(1); } + +function theme_file($relative) { + global $config; + return INSTALLDIR.'/theme/'.$config['site']['theme'].'/'.$relative; +} + +function theme_path($relative) { + global $config; + return common_path('theme/'.$config['site']['theme'].'/'.$relative); +} \ No newline at end of file diff --git a/lib/util.php b/lib/util.php index 7d27c10905..fe225e8984 100644 --- a/lib/util.php +++ b/lib/util.php @@ -123,7 +123,7 @@ function common_end_xml() { $xw->flush(); } -function common_show_header($pagetitle, $callable=NULL, $data=NULL) { +function common_show_header($pagetitle, $callable=NULL, $data=NULL, $notice=NULL) { global $config, $xw; header('Content-Type: application/xhtml+xml'); @@ -143,16 +143,15 @@ function common_show_header($pagetitle, $callable=NULL, $data=NULL) { $pagetitle . " - " . $config['site']['name']); common_element('link', array('rel' => 'stylesheet', 'type' => 'text/css', - 'href' => common_path('theme/default/style/html.css'), + 'href' => theme_path('display.css'), 'media' => 'screen, projection, tv')); - common_element('link', array('rel' => 'stylesheet', - 'type' => 'text/css', - 'href' => common_path('theme/default/style/layout.css'), - 'media' => 'screen, projection, tv')); - common_element('link', array('rel' => 'stylesheet', - 'type' => 'text/css', - 'href' => common_path('theme/default/style/print.css'), - 'media' => 'print')); + foreach (array(6,7) as $ver) { + if (file_exists(theme_file('ie'.$ver.'.css'))) { + # Yes, IE people should be put in jail. + $xw->writeComment('[if lte IE '.$ver.']>