]> git.mxchange.org Git - friendica.git/commitdiff
Merge branch 'develop' into lang
authorFabrixxm <fabrix.xm@gmail.com>
Tue, 30 Jun 2015 06:43:02 +0000 (08:43 +0200)
committerFabrixxm <fabrix.xm@gmail.com>
Tue, 30 Jun 2015 06:43:02 +0000 (08:43 +0200)
15 files changed:
boot.php
include/acl_selectors.php
include/conversation.php
include/identity.php
include/items.php
include/ostatus.php
include/poller.php
mod/content.php
mod/photos.php
mod/videos.php
object/Item.php
view/theme/duepuntozero/style.php
view/theme/quattro/style.php
view/theme/vier/style.php [new file with mode: 0644]
view/theme/vier/theme.php

index 2767709b81567decb290fd910fac1b6a073f774b..6e1951bffdaed607090a7b5988bfcb1f95f47cb2 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -358,6 +358,7 @@ if(! class_exists('App')) {
                public  $config;
                public  $page;
                public  $profile;
+               public  $profile_uid;
                public  $user;
                public  $cid;
                public  $contact;
@@ -1446,10 +1447,33 @@ if(! function_exists('current_theme')) {
 
                $a = get_app();
 
+               $page_theme = null;
+               
+               // Find the theme that belongs to the user whose stuff we are looking at
+
+               if($a->profile_uid && ($a->profile_uid != local_user())) {
+                       $r = q("select theme from user where uid = %d limit 1",
+                               intval($a->profile_uid)
+                       );
+                       if($r)
+                               $page_theme = $r[0]['theme'];
+               }
+
+               // Allow folks to over-rule user themes and always use their own on their own site.
+               // This works only if the user is on the same server
+
+               if($page_theme && local_user() && (local_user() != $a->profile_uid)) {
+                       if(get_pconfig(local_user(),'system','always_my_theme'))
+                               $page_theme = null;
+               }
+
 //             $mobile_detect = new Mobile_Detect();
 //             $is_mobile = $mobile_detect->isMobile() || $mobile_detect->isTablet();
                $is_mobile = $a->is_mobile || $a->is_tablet;
 
+               $standard_system_theme = ((isset($a->config['system']['theme'])) ? $a->config['system']['theme'] : '');
+               $standard_theme_name = ((isset($_SESSION) && x($_SESSION,'theme')) ? $_SESSION['theme'] : $standard_system_theme);
+
                if($is_mobile) {
                        if(isset($_SESSION['show-mobile']) && !$_SESSION['show-mobile']) {
                                $system_theme = '';
@@ -1466,9 +1490,12 @@ if(! function_exists('current_theme')) {
                                }
                        }
                }
-               if(!$is_mobile || ($system_theme === '' && $theme_name === '')) {
-                       $system_theme = ((isset($a->config['system']['theme'])) ? $a->config['system']['theme'] : '');
-                       $theme_name = ((isset($_SESSION) && x($_SESSION,'theme')) ? $_SESSION['theme'] : $system_theme);
+               else {
+                       $system_theme = $standard_system_theme;
+                       $theme_name = $standard_theme_name;
+
+                       if($page_theme)
+                               $theme_name = $page_theme;
                }
 
                if($theme_name &&
@@ -1496,9 +1523,13 @@ if(! function_exists('current_theme')) {
 if(! function_exists('current_theme_url')) {
        function current_theme_url() {
                global $a;
+
                $t = current_theme();
+
+               $opts = (($a->profile_uid) ? '?f=&puid=' . $a->profile_uid : '');
                if (file_exists('view/theme/' . $t . '/style.php'))
-                       return($a->get_baseurl() . '/view/theme/' . $t . '/style.pcss');
+                       return($a->get_baseurl() . '/view/theme/' . $t . '/style.pcss' . $opts);
+               
                return($a->get_baseurl() . '/view/theme/' . $t . '/style.css');
        }
 }
index 8b03a1312cd2b5aa0307cbde49bd3c6a1b2b8bc5..f628b97309bf0b0742d3fa84d610aa9d3bfbd58f 100644 (file)
@@ -190,8 +190,14 @@ function contact_select($selname, $selclass, $preselected = false, $size = 4, $p
 
        $tabindex = ($tabindex > 0 ? "tabindex=\"$tabindex\"" : "");
 
+       if ($privmail AND $preselected) {
+               $sql_extra .= " AND `id` IN (".implode(",", $preselected).")";
+               $hidepreselected = ' style="display: none;"';
+       } else
+               $hidepreselected = "";
+
        if($privmail)
-               $o .= "<select name=\"$selname\" id=\"$selclass\" class=\"$selclass\" size=\"$size\" $tabindex >\r\n";
+               $o .= "<select name=\"$selname\" id=\"$selclass\" class=\"$selclass\" size=\"$size\" $tabindex $hidepreselected>\r\n";
        else
                $o .= "<select name=\"{$selname}[]\" id=\"$selclass\" class=\"$selclass\" multiple=\"multiple\" size=\"$size\" $tabindex >\r\n";
 
@@ -209,6 +215,8 @@ function contact_select($selname, $selclass, $preselected = false, $size = 4, $p
 
        call_hooks($a->module . '_pre_' . $selname, $arr);
 
+       $receiverlist = array();
+
        if(count($r)) {
                foreach($r as $rr) {
                        if((is_array($preselected)) && in_array($rr['id'], $preselected))
@@ -221,6 +229,8 @@ function contact_select($selname, $selclass, $preselected = false, $size = 4, $p
                        else
                                $trimmed = mb_substr($rr['name'],0,20);
 
+                       $receiverlist[] = $trimmed;
+
                        $o .= "<option value=\"{$rr['id']}\" $selected title=\"{$rr['name']}|{$rr['url']}\" >$trimmed</option>\r\n";
                }
 
@@ -228,6 +238,9 @@ function contact_select($selname, $selclass, $preselected = false, $size = 4, $p
 
        $o .= "</select>\r\n";
 
+       if ($privmail AND $preselected)
+               $o .= implode(", ", $receiverlist);
+
        call_hooks($a->module . '_post_' . $selname, $o);
 
        return $o;
index cdd3118ce0bf226af917566b8216383c619020db..4aae611804cb7f0ebdf99856554293fc3f934c05 100644 (file)
@@ -597,7 +597,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
                                $locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => '');
                                call_hooks('render_location',$locate);
 
-                               $location = ((strlen($locate['html'])) ? $locate['html'] : render_location_google($locate));
+                               $location = ((strlen($locate['html'])) ? $locate['html'] : render_location_dummy($locate));
 
                                localize_item($item);
                                if($mode === 'network-new')
@@ -1229,14 +1229,10 @@ function find_thread_parent_index($arr,$x) {
        return false;
 }
 
-function render_location_google($item) {
-       $location = (($item['location']) ? '<a target="map" title="' . $item['location'] . '" href="http://maps.google.com/?q=' . urlencode($item['location']) . '">' . $item['location'] . '</a>' : '');
-       $coord = (($item['coord']) ? '<a target="map" title="' . $item['coord'] . '" href="http://maps.google.com/?q=' . urlencode($item['coord']) . '">' . $item['coord'] . '</a>' : '');
-       if($coord) {
-               if($location)
-                       $location .= '<br /><span class="smalltext">(' . $coord . ')</span>';
-               else
-                       $location = '<span class="smalltext">' . $coord . '</span>';
-       }
-       return $location;
+function render_location_dummy($item) {
+       if ($item['location'] != "")
+               return $item['location'];
+
+       if ($item['coord'] != "")
+               return $item['coord'];
 }
index bc930a3c6f4d72836f96a247bf7afc4a69eba38f..bf5d9692746af48091ce2b584be3f06b5cf2203e 100644 (file)
@@ -90,14 +90,15 @@ if(! function_exists('profile_load')) {
                }
 
                $a->profile = $r[0];
+               $a->profile_uid = $r[0]['profile_uid'];
 
                $a->profile['mobile-theme'] = get_pconfig($a->profile['profile_uid'], 'system', 'mobile_theme');
                $a->profile['network'] = NETWORK_DFRN;
 
                $a->page['title'] = $a->profile['name'] . " @ " . $a->config['sitename'];
 
-               if (!$profiledata)
-                       $_SESSION['theme'] = $a->profile['theme'];
+//             if (!$profiledata)
+//                     $_SESSION['theme'] = $a->profile['theme'];
 
                $_SESSION['mobile-theme'] = $a->profile['mobile-theme'];
 
@@ -726,3 +727,19 @@ function zrl($s,$force = false) {
                return $s . $achar . 'zrl=' . urlencode($mine);
        return $s;
 }
+
+// Used from within PCSS themes to set theme parameters. If there's a
+// puid request variable, that is the "page owner" and normally their theme
+// settings take precedence; unless a local user sets the "always_my_theme" 
+// system pconfig, which means they don't want to see anybody else's theme 
+// settings except their own while on this site.
+
+function get_theme_uid() {
+       $uid = (($_REQUEST['puid']) ? intval($_REQUEST['puid']) : 0);
+       if(local_user()) {
+               if((get_pconfig(local_user(),'system','always_my_theme')) || (! $uid))
+                       return local_user();
+       }
+
+       return $uid;
+}
index 475980d2dc972584aaef409cbf64134566b53c1a..45d25e379f84713931de7ba41653b6a2c826a681 100644 (file)
@@ -4403,8 +4403,9 @@ function atom_entry($item,$type,$author,$owner,$comment = false,$cid = 0) {
                $o .= atom_author('dfrn:owner',$item['owner-name'],$item['owner-link'],80,80,$item['owner-avatar']);
 
        if(($item['parent'] != $item['id']) || ($item['parent-uri'] !== $item['uri']) || (($item['thr-parent'] !== '') && ($item['thr-parent'] !== $item['uri']))) {
+               $parent = q("SELECT `guid` FROM `item` WHERE `id` = %d", intval($item["parent"]));
                $parent_item = (($item['thr-parent']) ? $item['thr-parent'] : $item['parent-uri']);
-               $o .= '<thr:in-reply-to ref="' . xmlify($parent_item) . '" type="text/html" href="' .  xmlify($a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['parent']) . '" />' . "\r\n";
+               $o .= '<thr:in-reply-to ref="'.xmlify($parent_item).'" type="text/html" href="'.xmlify($a->get_baseurl().'/display/'.$parent[0]['guid']).'" />'."\r\n";
        }
 
        $htmlbody = $body;
@@ -4412,7 +4413,6 @@ function atom_entry($item,$type,$author,$owner,$comment = false,$cid = 0) {
        if ($item['title'] != "")
                $htmlbody = "[b]".$item['title']."[/b]\n\n".$htmlbody;
 
-       //$htmlbody = bbcode(bb_remove_share_information($htmlbody), false, false, 7);
        $htmlbody = bbcode($htmlbody, false, false, 7);
 
        $o .= '<id>' . xmlify($item['uri']) . '</id>' . "\r\n";
@@ -4421,8 +4421,7 @@ function atom_entry($item,$type,$author,$owner,$comment = false,$cid = 0) {
        $o .= '<updated>' . xmlify(datetime_convert('UTC','UTC',$item['edited'] . '+00:00',ATOM_TIME)) . '</updated>' . "\r\n";
        $o .= '<dfrn:env>' . base64url_encode($body, true) . '</dfrn:env>' . "\r\n";
        $o .= '<content type="' . $type . '" >' . xmlify((($type === 'html') ? $htmlbody : $body)) . '</content>' . "\r\n";
-       $o .= '<link rel="alternate" type="text/html" href="' . xmlify($a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id']) . '" />' . "\r\n";
-
+       $o .= '<link rel="alternate" type="text/html" href="'.xmlify($a->get_baseurl().'/display/'.$item['guid']).'" />'."\r\n";
 
        $o .= '<status_net notice_id="'.$item['id'].'"></status_net>'."\r\n";
 
index 10361e87c8c0c71edc616ee048aa61e435b41d43..7825418474cc5385ec959443ba45b4c43960a644 100644 (file)
@@ -10,6 +10,7 @@ require_once("include/Photo.php");
 
 define('OSTATUS_DEFAULT_POLL_INTERVAL', 30); // given in minutes
 define('OSTATUS_DEFAULT_POLL_TIMEFRAME', 1440); // given in minutes
+define('OSTATUS_DEFAULT_POLL_TIMEFRAME_MENTIONS', 14400); // given in minutes
 
 function ostatus_fetchauthor($xpath, $context, $importer, &$contact) {
 
@@ -200,6 +201,13 @@ function ostatus_import($xml,$importer,&$contact, &$hub) {
                $item["object"] = $xml;
                $item["verb"] = $xpath->query('activity:verb/text()', $entry)->item(0)->nodeValue;
 
+               // To-Do:
+               // Delete a message
+               if ($item["verb"] == "qvitter-delete-notice") {
+                       // ignore "Delete" messages (by now)
+                       continue;
+               }
+
                if ($item["verb"] == ACTIVITY_JOIN) {
                        // ignore "Join" messages
                        continue;
@@ -468,7 +476,7 @@ function ostatus_convert_href($href) {
        return $href;
 }
 
-function check_conversations($override = false) {
+function check_conversations($mentions = false, $override = false) {
        $last = get_config('system','ostatus_last_poll');
 
        $poll_interval = intval(get_config('system','ostatus_poll_interval'));
@@ -479,9 +487,16 @@ function check_conversations($override = false) {
        if (($poll_interval < 0) AND !$override)
                return;
 
-       $poll_timeframe = intval(get_config('system','ostatus_poll_timeframe'));
-       if (!$poll_timeframe)
-               $poll_timeframe = OSTATUS_DEFAULT_POLL_TIMEFRAME;
+       if (!$mentions) {
+               $poll_timeframe = intval(get_config('system','ostatus_poll_timeframe'));
+               if (!$poll_timeframe)
+                       $poll_timeframe = OSTATUS_DEFAULT_POLL_TIMEFRAME;
+       } else {
+               $poll_timeframe = intval(get_config('system','ostatus_poll_timeframe'));
+               if (!$poll_timeframe)
+                       $poll_timeframe = OSTATUS_DEFAULT_POLL_TIMEFRAME_MENTIONS;
+       }
+
 
        if ($last AND !$override) {
                $next = $last + ($poll_interval * 60);
@@ -494,8 +509,16 @@ function check_conversations($override = false) {
        logger('cron_start');
 
        $start = date("Y-m-d H:i:s", time() - ($poll_timeframe * 60));
-       $conversations = q("SELECT `oid`, `url`, `uid` FROM `term` WHERE `type` = 7 AND `term` > '%s' GROUP BY `url`, `uid` ORDER BY `term` DESC",
-                               dbesc($start));
+
+       if ($mentions)
+               $conversations = q("SELECT `term`.`oid`, `term`.`url`, `term`.`uid` FROM `term`
+                                       STRAIGHT_JOIN `thread` ON `thread`.`iid` = `term`.`oid` AND `thread`.`uid` = `term`.`uid`
+                                       WHERE `term`.`type` = 7 AND `term`.`term` > '%s' AND `thread`.`mention`
+                                       GROUP BY `term`.`url`, `term`.`uid` ORDER BY `term`.`term` DESC", dbesc($start));
+       else
+               $conversations = q("SELECT `oid`, `url`, `uid` FROM `term`
+                                       WHERE `type` = 7 AND `term` > '%s'
+                                       GROUP BY `url`, `uid` ORDER BY `term` DESC", dbesc($start));
 
        foreach ($conversations AS $conversation) {
                ostatus_completion($conversation['url'], $conversation['uid']);
index 933624ecb57ef0621e3cfc4e6adac52c8b71cc8e..d971d4f00410a76cb77acac4364516c327052884 100644 (file)
@@ -103,7 +103,11 @@ function poller_run(&$argv, &$argc){
                $abandon_days = 0;
 
        // Check OStatus conversations
-       check_conversations();
+       // Check only conversations with mentions (for a longer time)
+       check_conversations(true);
+
+       // Check every conversation
+       check_conversations(false);
 
        // To-Do: Regenerate usage statistics
        // q("ANALYZE TABLE `item`");
index e20345307d9b9b74644485e7bc5d5df3dbcbef8f..cec23a91421ad4a23eaea3e78b896581878fb86e 100644 (file)
@@ -425,7 +425,7 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
                                $locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => '');
                                call_hooks('render_location',$locate);
 
-                               $location = ((strlen($locate['html'])) ? $locate['html'] : render_location_google($locate));
+                               $location = ((strlen($locate['html'])) ? $locate['html'] : render_location_dummy($locate));
 
                                localize_item($item);
                                if($mode === 'network-new')
@@ -799,7 +799,7 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
                                $locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => '');
                                call_hooks('render_location',$locate);
 
-                               $location = ((strlen($locate['html'])) ? $locate['html'] : render_location_google($locate));
+                               $location = ((strlen($locate['html'])) ? $locate['html'] : render_location_dummy($locate));
 
                                $indent = (($toplevelpost) ? '' : ' comment');
 
index b16c4c021018460e89ec2a9427a444127d6ccef7..3d3b92a46d9a8b7861c54f5a3e44c3b78434e5f0 100644 (file)
@@ -29,71 +29,72 @@ function photos_init(&$a) {
                        return;
 
                $a->data['user'] = $r[0];
+               $a->profile_uid = $r[0]['uid'];
 
-                $profilephoto = $a->get_cached_avatar_image($a->get_baseurl() . '/photo/profile/' . $a->data['user']['uid'] . '.jpg');
+               $profilephoto = $a->get_cached_avatar_image($a->get_baseurl() . '/photo/profile/' . $a->data['user']['uid'] . '.jpg');
 
-                $tpl = get_markup_template("vcard-widget.tpl");
+               $tpl = get_markup_template("vcard-widget.tpl");
 
                $vcard_widget .= replace_macros($tpl, array(
-                        '$name' => $a->data['user']['username'],
-                        '$photo' => $profilephoto
-                ));
+                       '$name' => $a->data['user']['username'],
+                       '$photo' => $profilephoto
+               ));
 
 
                $sql_extra = permissions_sql($a->data['user']['uid']);
 
                $albums = q("SELECT count(distinct `resource-id`) AS `total`, `album` FROM `photo` WHERE `uid` = %d  AND `album` != '%s' AND `album` != '%s'
-                        $sql_extra group by album order by created desc",
+                       $sql_extra group by album order by created desc",
                        intval($a->data['user']['uid']),
-                        dbesc('Contact Photos'),
-                        dbesc( t('Contact Photos'))
+                       dbesc('Contact Photos'),
+                       dbesc( t('Contact Photos'))
                );
 
-                $albums_visible = ((intval($a->data['user']['hidewall']) && (! local_user()) && (! remote_user())) ? false : true);
-
-                // add various encodings to the array so we can just loop through and pick them out in a template
-                $ret = array('success' => false);
-
-                if($albums) {
-                        $a->data['albums'] = $albums;
-                        if ($albums_visible)
-                                $ret['success'] = true;
-
-                        $ret['albums'] = array();
-                        foreach($albums as $k => $album) {
-                                $entry = array(
-                                        'text'      => $album['album'],
-                                        'total'     => $album['total'],
-                                        'url'       => z_root() . '/photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album['album']),
-                                        'urlencode' => urlencode($album['album']),
-                                        'bin2hex'   => bin2hex($album['album'])
-                                );
-                                $ret['albums'][] = $entry;
-                        }
-                }
-
-                $albums = $ret;
-
-                if(local_user() && $a->data['user']['uid'] == local_user())
-                        $can_post = true;
-
-                if($albums['success']) {
-                        $photo_albums_widget = replace_macros(get_markup_template('photo_albums.tpl'),array(
-                                '$nick'     => $a->data['user']['nickname'],
-                                '$title'    => t('Photo Albums'),
-                                'recent'    => t('Recent Photos'),
-                                '$albums'   => $albums['albums'],
-                                '$baseurl'  => z_root(),
-                                '$upload'   => array( t('Upload New Photos'), $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/upload'),
-                                '$can_post' => $can_post
-                        ));
-                }
+               $albums_visible = ((intval($a->data['user']['hidewall']) && (! local_user()) && (! remote_user())) ? false : true);
+
+               // add various encodings to the array so we can just loop through and pick them out in a template
+               $ret = array('success' => false);
+
+               if($albums) {
+                       $a->data['albums'] = $albums;
+                       if ($albums_visible)
+                               $ret['success'] = true;
+
+                       $ret['albums'] = array();
+                       foreach($albums as $k => $album) {
+                               $entry = array(
+                                       'text'      => $album['album'],
+                                       'total'     => $album['total'],
+                                       'url'       => z_root() . '/photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album['album']),
+                                       'urlencode' => urlencode($album['album']),
+                                       'bin2hex'   => bin2hex($album['album'])
+                               );
+                               $ret['albums'][] = $entry;
+                       }
+               }
+
+               $albums = $ret;
+
+               if(local_user() && $a->data['user']['uid'] == local_user())
+                       $can_post = true;
+
+               if($albums['success']) {
+                       $photo_albums_widget = replace_macros(get_markup_template('photo_albums.tpl'),array(
+                               '$nick'     => $a->data['user']['nickname'],
+                               '$title'    => t('Photo Albums'),
+                               'recent'    => t('Recent Photos'),
+                               '$albums'   => $albums['albums'],
+                               '$baseurl'  => z_root(),
+                               '$upload'   => array( t('Upload New Photos'), $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/upload'),
+                               '$can_post' => $can_post
+                       ));
+               }
 
 
                if(! x($a->page,'aside'))
                        $a->page['aside'] = '';
-                $a->page['aside'] .= $vcard_widget;
-                $a->page['aside'] .= $photo_albums_widget;
+               $a->page['aside'] .= $vcard_widget;
+               $a->page['aside'] .= $photo_albums_widget;
 
 
                $tpl = get_markup_template("photos_head.tpl");
index 943a9d09f2bf7ca07cc935022d5e2c329b6706cc..df47262f1de1db34a2a436dca19ed8c39ae0cf5f 100644 (file)
@@ -27,15 +27,16 @@ function videos_init(&$a) {
                        return;
 
                $a->data['user'] = $r[0];
+               $a->profile_uid = $r[0]['uid'];
 
-                $profilephoto = $a->get_cached_avatar_image($a->get_baseurl() . '/photo/profile/' . $a->data['user']['uid'] . '.jpg');
+               $profilephoto = $a->get_cached_avatar_image($a->get_baseurl() . '/photo/profile/' . $a->data['user']['uid'] . '.jpg');
 
-                $tpl = get_markup_template("vcard-widget.tpl");
+               $tpl = get_markup_template("vcard-widget.tpl");
 
                $vcard_widget = replace_macros($tpl, array(
-                        '$name' => $a->data['user']['username'],
-                        '$photo' => $profilephoto
-                ));
+                       '$name' => $a->data['user']['username'],
+                       '$photo' => $profilephoto
+               ));
 
 
                /*$sql_extra = permissions_sql($a->data['user']['uid']);
index aa9792b159875fbbb78691a979f29a78c7eb249e..3211048cef6745a124fb6987912fcfcfdb4ebb8a 100644 (file)
@@ -155,7 +155,7 @@ class Item extends BaseObject {
 
                $locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => '');
                call_hooks('render_location',$locate);
-               $location = ((strlen($locate['html'])) ? $locate['html'] : render_location_google($locate));
+               $location = ((strlen($locate['html'])) ? $locate['html'] : render_location_dummy($locate));
 
                $searchpath = $a->get_baseurl()."/search?tag=";
                $tags=array();
index d5f8696a793b525586d731fd1789a5122e37d66b..89f44d9c0454b3e6c7e05d6b5c86bb4c9c44f705 100644 (file)
@@ -2,10 +2,28 @@
 if (file_exists("$THEMEPATH/style.css")){
     echo file_get_contents("$THEMEPATH/style.css");
 }
+$uid = get_theme_uid();
+
 $s_colorset = get_config('duepuntozero','colorset');
-$uid = local_user();
 $colorset = get_pconfig( $uid, 'duepuntozero', 'colorset');
 if (!x($colorset)) 
     $colorset = $s_colorset;
 
+if ($colorset) {
+    if ($colorset == 'greenzero')
+       $setcss = file_get_contents('view/theme/duepuntozero/deriv/greenzero.css');
+    if ($colorset == 'purplezero')
+       $setcss = file_get_contents('view/theme/duepuntozero/deriv/purplezero.css');
+    if ($colorset == 'easterbunny')
+       $setcss = file_get_contents('view/theme/duepuntozero/deriv/easterbunny.css');
+    if ($colorset == 'darkzero')
+       $setcss = file_get_contents('view/theme/duepuntozero/deriv/darkzero.css');
+    if ($colorset == 'comix')
+       $setcss = file_get_contents('view/theme/duepuntozero/deriv/comix.css');
+    if ($colorset == 'slackr')
+       $setcss = file_get_contents('view/theme/duepuntozero/deriv/slackr.css');
+}
+
+echo $setcss;
+
 ?>
index c75091eb5b00f8c4894e871fa2517919767d877f..bf0b1e0428a2961fe8d3720541ba5ae432a82daa 100644 (file)
@@ -1,12 +1,14 @@
 <?php
+       $uid = get_theme_uid();
+
        $color=false;
        $quattro_align=false;
        $site_color = get_config("quattro","color");
        $site_quattro_align = get_config("quattro", "align" );
        
-       if (local_user()) {
-               $color = get_pconfig(local_user(), "quattro","color");
-               $quattro_align = get_pconfig(local_user(), 'quattro', 'align' );
+       if ($uid) {
+               $color = get_pconfig( $uid, "quattro","color");
+               $quattro_align = get_pconfig( $uid, 'quattro', 'align' );
        }
        
        if ($color===false) $color=$site_color;
@@ -39,9 +41,9 @@
     if ($site_textarea_font_size===false) $site_textarea_font_size="20";
     if ($site_post_font_size===false) $site_post_font_size="12";
     
-       if (local_user()) {
-        $textarea_font_size = get_pconfig(local_user(), "quattro","tfs");
-        $post_font_size = get_pconfig(local_user(), "quattro","pfs");    
+       if ($uid) {
+        $textarea_font_size = get_pconfig( $uid, "quattro","tfs");
+        $post_font_size = get_pconfig( $uid, "quattro","pfs");    
        } 
     
     if ($textarea_font_size===false) $textarea_font_size = $site_textarea_font_size;
diff --git a/view/theme/vier/style.php b/view/theme/vier/style.php
new file mode 100644 (file)
index 0000000..e118d1e
--- /dev/null
@@ -0,0 +1,30 @@
+<?php
+
+if (file_exists("$THEMEPATH//style.css")){
+       echo file_get_contents("$THEMEPATH//style.css");
+}
+
+$uid = get_theme_uid();
+
+$style = get_pconfig( $uid, 'vier', 'style');
+
+if ($style == "")
+       $style = get_config('vier', 'style');
+
+if ($style == "")
+       $style = "plus";
+
+if ($style == "flat")
+       $stylecss = file_get_contents('view/theme/vier/flat.css');
+else if ($style == "netcolour")
+       $stylecss = file_get_contents('view/theme/vier/netcolour.css');
+else if ($style == "breathe")
+       $stylecss = file_get_contents('view/theme/vier/breathe.css');
+else if ($style == "plus")
+       $stylecss = file_get_contents('view/theme/vier/plus.css');
+else if ($style == "dark")
+       $stylecss = file_get_contents('view/theme/vier/dark.css');
+
+echo $stylecss;
+
+
index a7ba561b23cea53f5d4f4c176a127e7a5bec3421..7c94f001aa2ac9570980b027a3daa7915647baa2 100644 (file)
@@ -16,25 +16,6 @@ $baseurl = $a->get_baseurl();
 
 $a->theme_info = array();
 
-$style = get_pconfig(local_user(), 'vier', 'style');
-
-if ($style == "")
-       $style = get_config('vier', 'style');
-
-if ($style == "")
-       $style = "plus";
-
-if ($style == "flat")
-       $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/vier/flat.css" type="text/css" media="screen"/>'."\n";
-else if ($style == "netcolour")
-       $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/vier/netcolour.css" type="text/css" media="screen"/>'."\n";
-else if ($style == "breathe")
-       $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/vier/breathe.css" type="text/css" media="screen"/>'."\n";
-else if ($style == "plus")
-       $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/vier/plus.css" type="text/css" media="screen"/>'."\n";
-else if ($style == "dark")
-       $a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/vier/dark.css" type="text/css" media="screen"/>'."\n";
-
 $a->page['htmlhead'] .= <<< EOT
 <script type="text/javascript">