diff --git a/.gitignore b/.gitignore index b300f579e..77151060d 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,16 @@ nbproject #ignore local folder /local/ + +#other stuff +.directory +.gitignore + +/view/theme/Friendiboot +/view/theme/Viereinhalb +/view/theme/blog +/view/theme/boheme +/view/theme/clean +/view/theme/suckerberg + +/addon/frio_hovercard diff --git a/include/Contact.php b/include/Contact.php index cbce6cf54..86ef4a30f 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -207,35 +207,34 @@ function get_contact_details_by_url($url, $uid = -1, $default = array()) { if ($uid == -1) $uid = local_user(); - // Fetch contact data from the contact table for the user and given network - $r = q("SELECT `id`, `id` AS `cid`, 0 AS `gid`, `uid`, `url`, `nurl`, `alias`, `network`, `name`, `nick`, `addr`, `location`, `about`, + // Fetch contact data from the contact table for the given user + $r = q("SELECT `id`, `id` AS `cid`, 0 AS `gid`, 0 AS `zid`, `uid`, `url`, `nurl`, `alias`, `network`, `name`, `nick`, `addr`, `location`, `about`, `keywords`, `gender`, `photo`, `thumb`, `forum`, `prv`, (`forum` | `prv`) AS `community`, `bd` AS `birthday`, `self` - FROM `contact` WHERE `nurl` = '%s' AND `uid` = %d AND `network` IN ('%s', '')", - dbesc(normalise_link($url)), intval($uid), dbesc($profile["network"])); - - // Is the contact present for the user in a different network? (Can happen with OStatus and the "Statusnet" addon) - if (!$r) - $r = q("SELECT `id`, `id` AS `cid`, 0 AS `gid`, `uid`, `url`, `nurl`, `alias`, `network`, `name`, `nick`, `addr`, `location`, `about`, - `keywords`, `gender`, `photo`, `thumb`, `forum`, `prv`, (`forum` | `prv`) AS `community`, `bd` AS `birthday`, `self` - FROM `contact` WHERE `nurl` = '%s' AND `uid` = %d", - dbesc(normalise_link($url)), intval($uid)); + FROM `contact` WHERE `nurl` = '%s' AND `uid` = %d", + dbesc(normalise_link($url)), intval($uid)); // Fetch the data from the contact table with "uid=0" (which is filled automatically) if (!$r) - $r = q("SELECT `id`, 0 AS `cid`, 0 AS `gid`, `uid`, `url`, `nurl`, `alias`, `network`, `name`, `nick`, `addr`, `location`, `about`, + $r = q("SELECT `id`, 0 AS `cid`, `id` AS `zid`, 0 AS `gid`, `uid`, `url`, `nurl`, `alias`, `network`, `name`, `nick`, `addr`, `location`, `about`, `keywords`, `gender`, `photo`, `thumb`, `forum`, `prv`, (`forum` | `prv`) AS `community`, `bd` AS `birthday`, 0 AS `self` FROM `contact` WHERE `nurl` = '%s' AND `uid` = 0", dbesc(normalise_link($url))); // Fetch the data from the gcontact table if (!$r) - $r = q("SELECT 0 AS `id`, 0 AS `cid`, `id` AS `gid`, 0 AS `uid`, `url`, `nurl`, `alias`, `network`, `name`, `nick`, `addr`, `location`, `about`, + $r = q("SELECT 0 AS `id`, 0 AS `cid`, `id` AS `gid`, 0 AS `zid`, 0 AS `uid`, `url`, `nurl`, `alias`, `network`, `name`, `nick`, `addr`, `location`, `about`, `keywords`, `gender`, `photo`, `photo` AS `thumb`, `community` AS `forum`, 0 AS `prv`, `community`, `birthday`, 0 AS `self` - FROM `gcontact` WHERE `nurl` = '%s' LIMIT 1", + FROM `gcontact` WHERE `nurl` = '%s'", dbesc(normalise_link($url))); if ($r) { - $profile = $r[0]; + // If there is more than one entry we filter out the connector networks + if (count($r) > 1) + foreach ($r AS $id => $result) + if ($result["network"] == NETWORK_STATUSNET) + unset($r[$id]); + + $profile = array_shift($r); // "bd" always contains the upcoming birthday of a contact. // "birthday" might contain the birthday including the year of birth. diff --git a/include/Core/Config.php b/include/Core/Config.php index b5d80c82e..8e387ca6f 100644 --- a/include/Core/Config.php +++ b/include/Core/Config.php @@ -172,7 +172,7 @@ class Config { // manage array value $dbvalue = (is_array($value)?serialize($value):$value); $dbvalue = (is_bool($dbvalue) ? intval($dbvalue) : $dbvalue); - if(self::get($family,$key,true) === false) { + if(is_null(self::get($family,$key,null,true))) { $a->config[$family][$key] = $value; $ret = q("INSERT INTO `config` ( `cat`, `k`, `v` ) VALUES ( '%s', '%s', '%s' ) ", dbesc($family), diff --git a/include/Core/PConfig.php b/include/Core/PConfig.php index 09c3c2a0b..ab351ef2c 100644 --- a/include/Core/PConfig.php +++ b/include/Core/PConfig.php @@ -161,7 +161,7 @@ class PConfig { // manage array value $dbvalue = (is_array($value)?serialize($value):$value); - if(self::get($uid,$family,$key,true) === false) { + if(is_null(self::get($uid,$family,$key,null, true))) { $a->config[$uid][$family][$key] = $value; $ret = q("INSERT INTO `pconfig` ( `uid`, `cat`, `k`, `v` ) VALUES ( %d, '%s', '%s', '%s' ) ", intval($uid), diff --git a/include/api.php b/include/api.php index f32dc97c6..c86a3cbe4 100644 --- a/include/api.php +++ b/include/api.php @@ -1309,7 +1309,7 @@ $r = q("SELECT STRAIGHT_JOIN `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`, `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, `contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`, - `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid` + `contact`.`id` AS `cid` FROM `item`, `contact` WHERE `item`.`uid` = %d AND `verb` = '%s' AND `item`.`visible` = 1 and `item`.`moderated` = 0 AND `item`.`deleted` = 0 @@ -1388,7 +1388,7 @@ $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`, `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, `contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`, - `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`, + `contact`.`id` AS `cid`, `user`.`nickname`, `user`.`hidewall` FROM `item` STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id` STRAIGHT_JOIN `user` ON `user`.`uid` = `item`.`uid` @@ -1457,7 +1457,7 @@ $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`, `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, `contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`, - `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid` + `contact`.`id` AS `cid` FROM `item`, `contact` WHERE `item`.`visible` = 1 and `item`.`moderated` = 0 AND `item`.`deleted` = 0 AND `contact`.`id` = `item`.`contact-id` AND `item`.`uid` = %d AND `item`.`verb` = '%s' @@ -1534,7 +1534,7 @@ $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`, `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, `contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`, - `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid` + `contact`.`id` AS `cid` FROM `item` INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` WHERE `item`.`parent` = %d AND `item`.`visible` @@ -1586,7 +1586,7 @@ $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`, `contact`.`nick` as `reply_author`, `contact`.`name`, `contact`.`photo` as `reply_photo`, `contact`.`url` as `reply_url`, `contact`.`rel`, `contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`, - `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid` + `contact`.`id` AS `cid` FROM `item`, `contact` WHERE `item`.`visible` = 1 and `item`.`moderated` = 0 AND `item`.`deleted` = 0 AND `contact`.`id` = `item`.`contact-id` @@ -1699,7 +1699,7 @@ $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`, `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, `contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`, - `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid` + `contact`.`id` AS `cid` FROM `item` FORCE INDEX (`uid_id`), `contact` WHERE `item`.`uid` = %d AND `verb` = '%s' AND NOT (`item`.`author-link` IN ('https://%s', 'http://%s')) @@ -1776,7 +1776,7 @@ $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`, `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, `contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`, - `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid` + `contact`.`id` AS `cid` FROM `item`, `contact` WHERE `item`.`uid` = %d AND `verb` = '%s' AND `item`.`contact-id` = %d @@ -1904,7 +1904,7 @@ $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`, `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, `contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`, - `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid` + `contact`.`id` AS `cid` FROM `item`, `contact` WHERE `item`.`uid` = %d AND `item`.`visible` = 1 and `item`.`moderated` = 0 AND `item`.`deleted` = 0 diff --git a/include/conversation.php b/include/conversation.php index 38f6e7686..87ad42b04 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -373,6 +373,86 @@ function visible_activity($item) { return true; } +/** + * @brief List of all contact fields that are needed for the conversation function + */ +function contact_fieldlist() { + + $fieldlist = "`contact`.`network`, `contact`.`url`, `contact`.`name`, `contact`.`writable`, + `contact`.`self`, `contact`.`id` AS `cid`, `contact`.`alias`"; + + return $fieldlist; +} + +/** + * @brief SQL condition for contacts + */ +function contact_condition() { + + $condition = "NOT `contact`.`blocked` AND NOT `contact`.`pending`"; + + return $condition; +} + +/** + * @brief List of all item fields that are needed for the conversation function + */ +function item_fieldlist() { + +/* +These Fields are not added below (yet). They are here to for bug search. +`item`.`type`, +`item`.`extid`, +`item`.`received`, +`item`.`changed`, +`item`.`author-avatar`, +`item`.`object`, +`item`.`target-type`, +`item`.`target`, +`item`.`resource-id`, +`item`.`tag`, +`item`.`attach`, +`item`.`inform`, +`item`.`pubmail`, +`item`.`moderated`, +`item`.`visible`, +`item`.`spam`, +`item`.`starred`, +`item`.`bookmark`, +`item`.`unseen`, +`item`.`deleted`, +`item`.`origin`, +`item`.`forum_mode`, +`item`.`last-child`, +`item`.`mention`, +`item`.`global`, +`item`.`gcontact-id`, +`item`.`shadow`, +*/ + + $fieldlist = "`item`.`author-link`, `item`.`verb`, `item`.`id`, `item`.`parent`, `item`.`file`, + `item`.`uid`, `item`.`author-name`, `item`.`location`, `item`.`coord`, + `item`.`title`, `item`.`uri`, `item`.`created`, `item`.`app`, `item`.`guid`, + `item`.`contact-id`, `item`.`thr-parent`, `item`.`parent-uri`, `item`.`rendered-hash`, + `item`.`body`, `item`.`rendered-html`, `item`.`private`, `item`.`edited`, + `item`.`allow_cid`, `item`.`allow_gid`, `item`.`deny_cid`, `item`.`deny_gid`, + `item`.`event-id`, `item`.`object-type`, `item`.`starred`, `item`.`created`, + `item`.`postopts`, `item`.`owner-link`, `item`.`owner-name`, `item`.`owner-avatar`, + `item`.`plink`, `item`.`wall`, `item`.`commented`, + `item`.`id` AS `item_id`, `item`.`network` AS `item_network`"; + + return $fieldlist; +} + +/** + * @brief SQL condition for items + */ +function item_condition() { + + $condition = "`item`.`visible` AND NOT `item`.`deleted` AND NOT `item`.`moderated`"; + + return $condition; +} /** * "Render" a conversation or list of items for HTML display. diff --git a/include/datetime.php b/include/datetime.php index 949f68dec..ea98f01fe 100644 --- a/include/datetime.php +++ b/include/datetime.php @@ -162,7 +162,7 @@ function datetime_convert($from = 'UTC', $to = 'UTC', $s = 'now', $fmt = "Y-m-d * @brief Wrapper for date selector, tailored for use in birthday fields. * * @param string $dob Date of Birth - * @return string + * @return string Formatted html */ function dob($dob) { list($year,$month,$day) = sscanf($dob,'%4d-%2d-%2d'); @@ -175,7 +175,18 @@ function dob($dob) { else $value = (($year) ? datetime_convert('UTC','UTC',$dob,'Y-m-d') : datetime_convert('UTC','UTC',$dob,'m-d')); - $o = ''; + $age = ((intval($value)) ? age($value, $a->user["timezone"], $a->user["timezone"]) : ""); + + $o = replace_macros(get_markup_template("field_input.tpl"), array( + '$field' => array( + 'dob', + t('Birthday:'), + $value, + (((intval($age)) > 0 ) ? t('Age: ') . $age : ""), + '', + 'placeholder="' . t('YYYY-MM-DD or MM-DD') . '"' + ) + )); // if ($dob && $dob != '0000-00-00') // $o = datesel($f,mktime(0,0,0,0,0,1900),mktime(),mktime(0,0,0,$month,$day,$year),'dob'); diff --git a/include/dfrn.php b/include/dfrn.php index a974056e6..c9b907acc 100644 --- a/include/dfrn.php +++ b/include/dfrn.php @@ -197,7 +197,6 @@ class dfrn { `contact`.`name`, `contact`.`network`, `contact`.`photo`, `contact`.`url`, `contact`.`name-date`, `contact`.`uri-date`, `contact`.`avatar-date`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`, - `contact`.`id` AS `contact-id`, `contact`.`uid` AS `contact-uid`, `sign`.`signed_text`, `sign`.`signature`, `sign`.`signer` FROM `item` $sql_post_table INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` @@ -369,6 +368,7 @@ class dfrn { xml::add_element($doc, $relocate, "dfrn:url", $owner['url']); xml::add_element($doc, $relocate, "dfrn:name", $owner['name']); + xml::add_element($doc, $relocate, "dfrn:addr", $owner['addr']); xml::add_element($doc, $relocate, "dfrn:photo", $photos[4]); xml::add_element($doc, $relocate, "dfrn:thumb", $photos[5]); xml::add_element($doc, $relocate, "dfrn:micro", $photos[6]); @@ -1546,6 +1546,7 @@ class dfrn { $relocate["uid"] = $importer["importer_uid"]; $relocate["cid"] = $importer["id"]; $relocate["url"] = $xpath->query("dfrn:url/text()", $relocation)->item(0)->nodeValue; + $relocate["addr"] = $xpath->query("dfrn:addr/text()", $relocation)->item(0)->nodeValue; $relocate["name"] = $xpath->query("dfrn:name/text()", $relocation)->item(0)->nodeValue; $relocate["photo"] = $xpath->query("dfrn:photo/text()", $relocation)->item(0)->nodeValue; $relocate["thumb"] = $xpath->query("dfrn:thumb/text()", $relocation)->item(0)->nodeValue; @@ -1556,6 +1557,9 @@ class dfrn { $relocate["poll"] = $xpath->query("dfrn:poll/text()", $relocation)->item(0)->nodeValue; $relocate["sitepubkey"] = $xpath->query("dfrn:sitepubkey/text()", $relocation)->item(0)->nodeValue; + if ($relocate["addr"] == "") + $relocate["addr"] = preg_replace("=(https?://)(.*)/profile/(.*)=ism", "$3@$2", $relocate["url"]); + // update contact $r = q("SELECT `photo`, `url` FROM `contact` WHERE `id` = %d AND `uid` = %d;", intval($importer["id"]), @@ -1565,6 +1569,30 @@ class dfrn { $old = $r[0]; + // Update the gcontact entry + $relocate["server_url"] = preg_replace("=(https?://)(.*)/profile/(.*)=ism", "$1$2", $relocate["url"]); + + $x = q("UPDATE `gcontact` SET + `name` = '%s', + `photo` = '%s', + `url` = '%s', + `nurl` = '%s', + `addr` = '%s', + `connect` = '%s', + `notify` = '%s', + `server_url` = '%s' + WHERE `nurl` = '%s';", + dbesc($relocate["name"]), + dbesc($relocate["photo"]), + dbesc($relocate["url"]), + dbesc(normalise_link($relocate["url"])), + dbesc($relocate["addr"]), + dbesc($relocate["addr"]), + dbesc($relocate["notify"]), + dbesc($relocate["server_url"]), + dbesc(normalise_link($old["url"]))); + + // Update the contact table. We try to find every entry. $x = q("UPDATE `contact` SET `name` = '%s', `photo` = '%s', @@ -1572,30 +1600,34 @@ class dfrn { `micro` = '%s', `url` = '%s', `nurl` = '%s', + `addr` = '%s', `request` = '%s', `confirm` = '%s', `notify` = '%s', `poll` = '%s', `site-pubkey` = '%s' - WHERE `id` = %d AND `uid` = %d;", + WHERE (`id` = %d AND `uid` = %d) OR (`nurl` = '%s');", dbesc($relocate["name"]), dbesc($relocate["photo"]), dbesc($relocate["thumb"]), dbesc($relocate["micro"]), dbesc($relocate["url"]), dbesc(normalise_link($relocate["url"])), + dbesc($relocate["addr"]), dbesc($relocate["request"]), dbesc($relocate["confirm"]), dbesc($relocate["notify"]), dbesc($relocate["poll"]), dbesc($relocate["sitepubkey"]), intval($importer["id"]), - intval($importer["importer_uid"])); + intval($importer["importer_uid"]), + dbesc(normalise_link($old["url"]))); if ($x === false) return false; // update items + /// @todo This is an extreme performance killer $fields = array( 'owner-link' => array($old["url"], $relocate["url"]), 'author-link' => array($old["url"], $relocate["url"]), diff --git a/include/items.php b/include/items.php index 5c0bb047a..203b7d0ee 100644 --- a/include/items.php +++ b/include/items.php @@ -507,6 +507,13 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa $arr['inform'] = ((x($arr,'inform')) ? trim($arr['inform']) : ''); $arr['file'] = ((x($arr,'file')) ? trim($arr['file']) : ''); + // Items cannot be stored before they happen ... + if ($arr['created'] > datetime_convert()) + $arr['created'] = datetime_convert(); + + // We haven't invented time travel by now. + if ($arr['edited'] > datetime_convert()) + $arr['edited'] = datetime_convert(); if (($arr['author-link'] == "") AND ($arr['owner-link'] == "")) logger("Both author-link and owner-link are empty. Called by: ".App::callstack(), LOGGER_DEBUG); diff --git a/index.php b/index.php index bf4ee378a..943763a51 100644 --- a/index.php +++ b/index.php @@ -114,7 +114,9 @@ load_translation_table($lang); * */ +$stamp1 = microtime(true); session_start(); +$a->save_timestamp($stamp1, "parser"); /** * Language was set earlier, but we can over-ride it in the session. diff --git a/mod/admin.php b/mod/admin.php index 36b2ca730..547c37fb6 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -289,7 +289,7 @@ function admin_page_federation(&$a) { // what versions for that platform do we know at all? // again only the active nodes - $v = q('SELECT COUNT(*) AS `total, version` FROM `gserver` + $v = q('SELECT COUNT(*) AS `total`, `version` FROM `gserver` WHERE `last_contact` > `last_failure` AND `platform` LIKE "%s" AND `version` != "" GROUP BY `version` ORDER BY `version`;', $p); diff --git a/mod/community.php b/mod/community.php index b6d72a355..a83bd39ec 100644 --- a/mod/community.php +++ b/mod/community.php @@ -120,23 +120,20 @@ function community_getitems($start, $itemspage) { if (get_config('system','community_page_style') == CP_GLOBAL_COMMUNITY) return(community_getpublicitems($start, $itemspage)); - $r = q("SELECT `item`.`uri`, `item`.*, `item`.`id` AS `item_id`, - `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`alias`, `contact`.`rel`, - `contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`, - `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`, - `user`.`nickname`, `user`.`hidewall` + $r = q("SELECT %s, %s, `user`.`nickname` FROM `thread` FORCE INDEX (`wall_private_received`) - INNER JOIN `user` ON `user`.`uid` = `thread`.`uid` AND `user`.`hidewall` = 0 + INNER JOIN `user` ON `user`.`uid` = `thread`.`uid` AND NOT `user`.`hidewall` INNER JOIN `item` ON `item`.`id` = `thread`.`iid` AND `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' INNER JOIN `contact` ON `contact`.`id` = `thread`.`contact-id` - AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 AND `contact`.`self` - WHERE `thread`.`visible` = 1 AND `thread`.`deleted` = 0 and `thread`.`moderated` = 0 - AND `thread`.`private` = 0 AND `thread`.`wall` = 1 - ORDER BY `thread`.`received` DESC LIMIT %d, %d ", - intval($start), - intval($itemspage) + AND %s AND `contact`.`self` + WHERE `thread`.`visible` AND NOT `thread`.`deleted` AND NOT `thread`.`moderated` + AND NOT `thread`.`private` AND `thread`.`wall` + ORDER BY `thread`.`received` DESC LIMIT %d, %d", + item_fieldlist(), contact_fieldlist(), + contact_condition(), + intval($start), intval($itemspage) ); return($r); @@ -144,14 +141,14 @@ function community_getitems($start, $itemspage) { } function community_getpublicitems($start, $itemspage) { - $r = q("SELECT `item`.`uri`, `item`.*, `item`.`id` AS `item_id`, - `author-name` AS `name`, `owner-avatar` AS `photo`, + + $r = q("SELECT %s, `author-name` AS `name`, `owner-avatar` AS `photo`, `owner-link` AS `url`, `owner-avatar` AS `thumb` FROM `thread` INNER JOIN `item` ON `item`.`id` = `thread`.`iid` WHERE `thread`.`uid` = 0 ORDER BY `thread`.`created` DESC LIMIT %d, %d", - intval($start), + item_fieldlist(), intval($start), intval($itemspage) ); diff --git a/mod/content.php b/mod/content.php index 1f373b80e..54d499d40 100644 --- a/mod/content.php +++ b/mod/content.php @@ -217,7 +217,7 @@ function content_content(&$a, $update = 0) { $items = q("SELECT `item`.*, `item`.`id` AS `item_id`, `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, `contact`.`writable`, `contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`, - `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid` + `contact`.`id` AS `cid` FROM $sql_table INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0 @@ -268,7 +268,7 @@ function content_content(&$a, $update = 0) { $items = q("SELECT `item`.*, `item`.`id` AS `item_id`, `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`alias`, `contact`.`rel`, `contact`.`writable`, `contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`, - `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid` + `contact`.`id` AS `cid` FROM $sql_table INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0 AND `item`.`moderated` = 0 diff --git a/mod/dirfind.php b/mod/dirfind.php index 44f70d641..0638fe14f 100644 --- a/mod/dirfind.php +++ b/mod/dirfind.php @@ -66,16 +66,15 @@ function dirfind_content(&$a, $prefix = "") { $objresult->tags = ""; $objresult->network = $user_data["network"]; - $contact = q("SELECT `id` FROM `contact` WHERE `nurl` = '%s' AND `uid` = %d LIMIT 1", - dbesc(normalise_link($user_data["url"])), intval(local_user())); - if ($contact) - $objresult->cid = $contact[0]["id"]; - + $contact = get_contact_details_by_url($user_data["url"], local_user()); + $objresult->cid = $contact["cid"]; $j->results[] = $objresult; - poco_check($user_data["url"], $user_data["name"], $user_data["network"], $user_data["photo"], - "", "", "", "", "", datetime_convert(), 0); + // Add the contact to the global contacts if it isn't already in our system + if (($contact["cid"] == 0) AND ($contact["zid"] == 0) AND ($contact["gid"] == 0)) + poco_check($user_data["url"], $user_data["name"], $user_data["network"], $user_data["photo"], + "", "", "", "", "", datetime_convert(), 0); } elseif ($local) { if ($community) @@ -100,6 +99,7 @@ function dirfind_content(&$a, $prefix = "") { $count = q("SELECT count(*) AS `total` FROM `gcontact` LEFT JOIN `contact` ON `contact`.`nurl` = `gcontact`.`nurl` + AND `contact`.`network` = `gcontact`.`network` AND `contact`.`uid` = %d AND NOT `contact`.`blocked` AND NOT `contact`.`pending` AND `contact`.`rel` IN ('%s', '%s') WHERE (`contact`.`id` > 0 OR (NOT `gcontact`.`hide` AND `gcontact`.`network` IN ('%s', '%s', '%s') AND @@ -114,6 +114,7 @@ function dirfind_content(&$a, $prefix = "") { $results = q("SELECT `contact`.`id` AS `cid`, `gcontact`.`url`, `gcontact`.`name`, `gcontact`.`photo`, `gcontact`.`network`, `gcontact`.`keywords`, `gcontact`.`addr` FROM `gcontact` LEFT JOIN `contact` ON `contact`.`nurl` = `gcontact`.`nurl` + AND `contact`.`network` = `gcontact`.`network` AND `contact`.`uid` = %d AND NOT `contact`.`blocked` AND NOT `contact`.`pending` AND `contact`.`rel` IN ('%s', '%s') WHERE (`contact`.`id` > 0 OR (NOT `gcontact`.`hide` AND `gcontact`.`network` IN ('%s', '%s', '%s') AND diff --git a/mod/display.php b/mod/display.php index 949ba5ab4..4ee26b740 100644 --- a/mod/display.php +++ b/mod/display.php @@ -362,17 +362,14 @@ function display_content(&$a, $update = 0) { return ''; } - $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`, - `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, - `contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`, - `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid` - FROM `item` INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` - AND NOT `contact`.`blocked` AND NOT `contact`.`pending` - WHERE `item`.`uid` = %d AND `item`.`visible` AND NOT `item`.`deleted` - AND NOT `item`.`moderated` + $r = q("SELECT %s, %s FROM `item` + INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND %s + WHERE %s AND `item`.`uid` = %d AND `item`.`parent` = (SELECT `parent` FROM `item` WHERE `id` = %d) $sql_extra ORDER BY `parent` DESC, `gravity` ASC, `id` ASC", + item_fieldlist(), contact_fieldlist(), + contact_condition(), item_condition(), intval($a->profile['uid']), intval($item_id) ); @@ -388,16 +385,13 @@ function display_content(&$a, $update = 0) { if($r) { $item_uri = $r[0]['uri']; - $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`, - `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, - `contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`, - `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid` - FROM `item` INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` - AND NOT `contact`.`blocked` AND NOT `contact`.`pending` - WHERE `item`.`uid` = %d AND `item`.`visible` AND NOT `item`.`deleted` - AND NOT `item`.`moderated` + $r = q("SELECT %s, %s FROM `item` + INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND %s + WHERE %s AND `item`.`uid` = %d AND `item`.`parent` = (SELECT `parent` FROM `item` WHERE `uri` = '%s' AND uid = %d) ORDER BY `parent` DESC, `gravity` ASC, `id` ASC ", + item_fieldlist(), contact_fieldlist(), + contact_condition(), item_condition(), intval(local_user()), dbesc($item_uri), intval(local_user()) diff --git a/mod/network.php b/mod/network.php index 2dc63edb4..ba97b4a4c 100644 --- a/mod/network.php +++ b/mod/network.php @@ -720,17 +720,14 @@ function network_content(&$a, $update = 0) { $sql_order = "`item`.`received`"; // "New Item View" - show all items unthreaded in reverse created date order - $items = q("SELECT `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`, - `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, `contact`.`writable`, - `contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`, - `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid` - FROM $sql_table $sql_post_table INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` - AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 - WHERE `item`.`uid` = %d AND `item`.`visible` = 1 - AND `item`.`deleted` = 0 AND `item`.`moderated` = 0 + $items = q("SELECT %s, %s FROM $sql_table $sql_post_table + INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND %s + WHERE %s AND `item`.`uid` = %d $simple_update $sql_extra $sql_nets ORDER BY $sql_order DESC $pager_sql ", + item_fieldlist(), contact_fieldlist(), + contact_condition(), item_condition(), intval($_SESSION['uid']) ); @@ -810,16 +807,13 @@ function network_content(&$a, $update = 0) { foreach ($parents_arr AS $parents) { // $sql_extra ORDER BY `item`.`commented` DESC LIMIT %d", - $thread_items = q("SELECT `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`, - `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`alias`, `contact`.`rel`, `contact`.`writable`, - `contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`, - `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid` - FROM `item` INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` - AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 - WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0 - AND `item`.`moderated` = 0 + $thread_items = q("SELECT %s, %s FROM `item` + INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND %s + WHERE %s AND `item`.`uid` = %d AND `item`.`parent` = %d ORDER BY `item`.`commented` DESC LIMIT %d", + item_fieldlist(), contact_fieldlist(), + contact_condition(), item_condition(), intval(local_user()), intval($parents), intval($max_comments + 1) diff --git a/mod/notes.php b/mod/notes.php index 73c1507e3..8d93fc13d 100644 --- a/mod/notes.php +++ b/mod/notes.php @@ -69,16 +69,15 @@ function notes_content(&$a,$update = false) { // Construct permissions // default permissions - anonymous user - + $sql_extra = " AND `allow_cid` = '<" . $a->contact['id'] . ">' "; $r = q("SELECT COUNT(*) AS `total` - FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` - WHERE `item`.`uid` = %d AND `item`.`visible` = 1 and `item`.`moderated` = 0 - AND `item`.`deleted` = 0 AND `item`.`type` = 'note' - AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 AND `contact`.`self` = 1 - AND `item`.`id` = `item`.`parent` AND `item`.`wall` = 0 + FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND %s + WHERE %s AND `item`.`uid` = %d AND `item`.`type` = 'note' + AND `contact`.`self` AND `item`.`id` = `item`.`parent` AND NOT `item`.`wall` $sql_extra ", + contact_condition(), item_condition(), intval(local_user()) ); @@ -88,14 +87,13 @@ function notes_content(&$a,$update = false) { $a->set_pager_itemspage(40); } - $r = q("SELECT `item`.`id` AS `item_id`, `contact`.`uid` AS `contact-uid` - FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` - WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0 - and `item`.`moderated` = 0 AND `item`.`type` = 'note' - AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 AND `contact`.`self` = 1 - AND `item`.`id` = `item`.`parent` AND `item`.`wall` = 0 + $r = q("SELECT `item`.`id` AS `item_id` FROM `item` + LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND %s AND `contact`.`self` + WHERE %s AND `item`.`uid` = %d AND `item`.`type` = 'note' + AND `item`.`id` = `item`.`parent` AND NOT `item`.`wall` $sql_extra ORDER BY `item`.`created` DESC LIMIT %d ,%d ", + contact_condition(), item_condition(), intval(local_user()), intval($a->pager['start']), intval($a->pager['itemspage']) @@ -109,17 +107,14 @@ function notes_content(&$a,$update = false) { foreach($r as $rr) $parents_arr[] = $rr['item_id']; $parents_str = implode(', ', $parents_arr); - - $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, - `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`alias`, `contact`.`network`, `contact`.`rel`, - `contact`.`thumb`, `contact`.`self`, `contact`.`writable`, - `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid` - FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` - WHERE `item`.`uid` = %d AND `item`.`visible` = 1 and `item`.`moderated` = 0 AND `item`.`deleted` = 0 - AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 - AND `item`.`parent` IN ( %s ) + + $r = q("SELECT %s, %s FROM `item` + LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND %s + WHERE %s AND `item`.`uid` = %d AND `item`.`parent` IN (%s) $sql_extra ORDER BY `parent` DESC, `gravity` ASC, `item`.`id` ASC ", + item_fieldlist(), contact_fieldlist(), + contact_condition(), item_condition(), intval(local_user()), dbesc($parents_str) ); diff --git a/mod/profile.php b/mod/profile.php index 58e3a1607..88de0227b 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -216,8 +216,7 @@ function profile_content(&$a, $update = 0) { if($update) { - $r = q("SELECT distinct(parent) AS `item_id`, `item`.`network` AS `item_network`, - `contact`.`uid` AS `contact-uid` + $r = q("SELECT distinct(parent) AS `item_id`, `item`.`network` AS `item_network` FROM `item` INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND @@ -282,8 +281,7 @@ function profile_content(&$a, $update = 0) { $pager_sql = sprintf(" LIMIT %d, %d ",intval($a->pager['start']), intval($a->pager['itemspage'])); - $r = q("SELECT `thread`.`iid` AS `item_id`, `thread`.`network` AS `item_network`, - `thread`.`uid` AS `contact-uid` + $r = q("SELECT `thread`.`iid` AS `item_id`, `thread`.`network` AS `item_network` FROM `thread` FORCE INDEX (`uid_created`) INNER JOIN `item` ON `item`.`id` = `thread`.`iid` $sql_post_table INNER JOIN `contact` ON `contact`.`id` = `thread`.`contact-id` AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 @@ -305,17 +303,13 @@ function profile_content(&$a, $update = 0) { $parents_arr[] = $rr['item_id']; $parents_str = implode(', ', $parents_arr); - $items = q("SELECT `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`, - `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`alias`, `contact`.`network`, `contact`.`rel`, - `contact`.`thumb`, `contact`.`self`, `contact`.`writable`, - `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid` - FROM `item`, `contact` - WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0 - and `item`.`moderated` = 0 - AND `contact`.`id` = `item`.`contact-id` - AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 - AND `item`.`parent` IN ( %s ) + $items = q("SELECT %s, %s FROM `item` + INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND %s + WHERE %s AND `item`.`uid` = %d + AND `item`.`parent` IN (%s) $sql_extra ", + item_fieldlist(), contact_fieldlist(), + contact_condition(), item_condition(), intval($a->profile['profile_uid']), dbesc($parents_str) ); diff --git a/mod/profiles.php b/mod/profiles.php index 780a279b5..9cd1ed8a0 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -255,7 +255,7 @@ function profiles_post(&$a) { if(count($links)) { foreach($links as $link) { if($link['@attributes']['rel'] === 'http://webfinger.net/rel/profile-page') { - $prf = $link['@attributes']['href']; + $prf = $link['@attributes']['href']; } } } @@ -304,8 +304,8 @@ function profiles_post(&$a) { $sexual = notags(trim($_POST['sexual'])); $homepage = notags(trim($_POST['homepage'])); if ((strpos($homepage, 'http') !== 0) && (strlen($homepage))) { - // neither http nor https in URL, add them - $homepage = 'http://'.$homepage; + // neither http nor https in URL, add them + $homepage = 'http://'.$homepage; } $hometown = notags(trim($_POST['hometown'])); $politic = notags(trim($_POST['politic'])); @@ -663,25 +663,29 @@ function profiles_content(&$a) { '$detailled_profile' => $detailled_profile, '$details' => array( - 'detailled_profile', //Name - t('Show more profile fields:'), //Label - $detailled_profile, //Value - '', //Help string - array(t('No'),t('Yes')) //Off - On strings - ), + 'detailled_profile', //Name + t('Show more profile fields:'), //Label + $detailled_profile, //Value + '', //Help string + array(t('No'),t('Yes')) //Off - On strings + ), + + '$multi_profiles' => feature_enabled(local_user(),'multi_profiles'), + '$form_security_token' => get_form_security_token("profile_edit"), + '$form_security_token_photo' => get_form_security_token("profile_photo"), + '$profile_clone_link' => ((feature_enabled(local_user(),'multi_profiles')) ? 'profiles/clone/' . $r[0]['id'] . '?t=' . get_form_security_token("profile_clone") : ""), + '$profile_drop_link' => 'profiles/drop/' . $r[0]['id'] . '?t=' . get_form_security_token("profile_drop"), + + '$profile_action' => t('Profile Actions'), + '$banner' => t('Edit Profile Details'), + '$submit' => t('Submit'), + '$profpic' => t('Change Profile Photo'), + '$viewprof' => t('View this profile'), + '$editvis' => t('Edit visibility'), + '$cr_prof' => t('Create a new profile using these settings'), + '$cl_prof' => t('Clone this profile'), + '$del_prof' => t('Delete this profile'), - '$multi_profiles' => feature_enabled(local_user(),'multi_profiles'), - '$form_security_token' => get_form_security_token("profile_edit"), - '$form_security_token_photo' => get_form_security_token("profile_photo"), - '$profile_clone_link' => 'profiles/clone/' . $r[0]['id'] . '?t=' . get_form_security_token("profile_clone"), - '$profile_drop_link' => 'profiles/drop/' . $r[0]['id'] . '?t=' . get_form_security_token("profile_drop"), - '$banner' => t('Edit Profile Details'), - '$submit' => t('Submit'), - '$profpic' => t('Change Profile Photo'), - '$viewprof' => t('View this profile'), - '$cr_prof' => t('Create a new profile using these settings'), - '$cl_prof' => t('Clone this profile'), - '$del_prof' => t('Delete this profile'), '$lbl_basic_section' => t('Basic information'), '$lbl_picture_section' => t('Profile picture'), '$lbl_location_section' => t('Location'), @@ -689,81 +693,55 @@ function profiles_content(&$a) { '$lbl_status_section' => t('Status information'), '$lbl_about_section' => t('Additional information'), '$lbl_interests_section' => t('Interests'), + '$lbl_personal_section' => t('Personal'), + '$lbl_relation_section' => t('Relation'), + '$lbl_miscellaneous_section' => t('Miscellaneous'), + '$lbl_profile_photo' => t('Upload Profile Photo'), - '$lbl_profname' => t('Profile Name:'), - '$lbl_fullname' => t('Your Full Name:'), - '$lbl_title' => t('Title/Description:'), '$lbl_gender' => t('Your Gender:'), - '$lbl_bd' => t("Birthday :"), - '$lbl_address' => t('Street Address:'), - '$lbl_city' => t('Locality/City:'), - '$lbl_zip' => t('Postal/Zip Code:'), - '$lbl_country' => t('Country:'), - '$lbl_region' => t('Region/State:'), '$lbl_marital' => t(' Marital Status:'), - '$lbl_with' => t("Who: \x28if applicable\x29"), - '$lbl_ex1' => t('Examples: cathy123, Cathy Williams, cathy@example.com'), - '$lbl_howlong' => t('Since [date]:'), '$lbl_sexual' => t('Sexual Preference:'), - '$lbl_homepage' => t('Homepage URL:'), - '$lbl_hometown' => t('Hometown:'), - '$lbl_politic' => t('Political Views:'), - '$lbl_religion' => t('Religious Views:'), - '$lbl_pubkey' => t('Public Keywords:'), - '$lbl_prvkey' => t('Private Keywords:'), - '$lbl_likes' => t('Likes:'), - '$lbl_dislikes' => t('Dislikes:'), '$lbl_ex2' => t('Example: fishing photography software'), - '$lbl_pubdsc' => t("\x28Used for suggesting potential friends, can be seen by others\x29"), - '$lbl_prvdsc' => t("\x28Used for searching profiles, never shown to others\x29"), - '$lbl_about' => t('Tell us about yourself...'), - '$lbl_hobbies' => t('Hobbies/Interests'), - '$lbl_social' => t('Contact information and Social Networks'), - '$lbl_music' => t('Musical interests'), - '$lbl_book' => t('Books, literature'), - '$lbl_tv' => t('Television'), - '$lbl_film' => t('Film/dance/culture/entertainment'), - '$lbl_love' => t('Love/romance'), - '$lbl_work' => t('Work/employment'), - '$lbl_school' => t('School/education'), + '$disabled' => (($is_default) ? 'onclick="return false;" style="color: #BBBBFF;"' : ''), '$baseurl' => $a->get_baseurl(true), '$profile_id' => $r[0]['id'], - '$profile_name' => $r[0]['profile-name'], + '$profile_name' => array('profile_name', t('Profile Name:'), $r[0]['profile-name'], t('Required'), '*'), + '$is_default' => $is_default, '$default' => (($is_default) ? '

' . t('This is your public profile.
It may be visible to anybody using the internet.') . '

' : ""), - '$name' => $r[0]['name'], - '$pdesc' => $r[0]['pdesc'], + '$name' => array('name', t('Your Full Name:'), $r[0]['name']), + '$pdesc' => array('pdesc', t('Title/Description:'), $r[0]['pdesc']), '$dob' => dob($r[0]['dob']), '$hide_friends' => $hide_friends, - '$address' => $r[0]['address'], - '$locality' => $r[0]['locality'], - '$region' => $r[0]['region'], - '$postal_code' => $r[0]['postal-code'], - '$country_name' => $r[0]['country-name'], + '$address' => array('address', t('Street Address:'), $r[0]['address']), + '$locality' => array('locality', t('Locality/City:'), $r[0]['locality']), + '$region' => array('region', t('Region/State:'), $r[0]['region']), + '$postal_code' => array('postal_code', t('Postal/Zip Code:'), $r[0]['postal-code']), + '$country_name' => array('country_name', t('Country:'), $r[0]['country-name']), '$age' => ((intval($r[0]['dob'])) ? '(' . t('Age: ') . age($r[0]['dob'],$a->user['timezone'],$a->user['timezone']) . ')' : ''), '$gender' => gender_selector($r[0]['gender']), '$marital' => marital_selector($r[0]['marital']), - '$with' => strip_tags($r[0]['with']), - '$howlong' => ($r[0]['howlong'] === '0000-00-00 00:00:00' ? '' : datetime_convert('UTC',date_default_timezone_get(),$r[0]['howlong'])), + '$with' => array('with', t("Who: \x28if applicable\x29"), strip_tags($r[0]['with']), t('Examples: cathy123, Cathy Williams, cathy@example.com')), + '$howlong' => array('howlong', t('Since [date]:'), ($r[0]['howlong'] === '0000-00-00 00:00:00' ? '' : datetime_convert('UTC',date_default_timezone_get(),$r[0]['howlong']))), '$sexual' => sexpref_selector($r[0]['sexual']), - '$about' => $r[0]['about'], - '$homepage' => $r[0]['homepage'], - '$hometown' => $r[0]['hometown'], - '$politic' => $r[0]['politic'], - '$religion' => $r[0]['religion'], - '$pub_keywords' => $r[0]['pub_keywords'], - '$prv_keywords' => $r[0]['prv_keywords'], - '$likes' => $r[0]['likes'], - '$dislikes' => $r[0]['dislikes'], - '$music' => $r[0]['music'], - '$book' => $r[0]['book'], - '$tv' => $r[0]['tv'], - '$film' => $r[0]['film'], - '$interest' => $r[0]['interest'], - '$romance' => $r[0]['romance'], - '$work' => $r[0]['work'], - '$education' => $r[0]['education'], - '$contact' => $r[0]['contact'] + '$about' => array('about', t('Tell us about yourself...'), $r[0]['about']), + '$homepage' => array('homepage', t('Homepage URL:'), $r[0]['homepage']), + '$hometown' => array('hometown', t('Hometown:'), $r[0]['hometown']), + '$politic' => array('politic', t('Political Views:'), $r[0]['politic']), + '$religion' => array('religion', t('Religious Views:'), $r[0]['religion']), + '$pub_keywords' => array('pub_keywords', t('Public Keywords:'), $r[0]['pub_keywords'], t("\x28Used for suggesting potential friends, can be seen by others\x29")), + '$prv_keywords' => array('prv_keywords', t('Private Keywords:'), $r[0]['prv_keywords'], t("\x28Used for searching profiles, never shown to others\x29")), + '$likes' => array('likes', t('Likes:'), $r[0]['likes']), + '$dislikes' => array('dislikes', t('Dislikes:'), $r[0]['dislikes']), + '$music' => array('music', t('Musical interests'), $r[0]['music']), + '$book' => array('book', t('Books, literature'), $r[0]['book']), + '$tv' => array('tv', t('Television'), $r[0]['tv']), + '$film' => array('film', t('Film/dance/culture/entertainment'), $r[0]['film']), + '$interest' => array('interest', t('Hobbies/Interests'), $r[0]['interest']), + '$romance' => array('romance',t('Love/romance'), $r[0]['romance']), + '$work' => array('work', t('Work/employment'), $r[0]['work']), + '$education' => array('education', t('School/education'), $r[0]['education']), + '$contact' => array('contact', t('Contact information and Social Networks'), $r[0]['contact']), )); $arr = array('profile' => $r[0], 'entry' => $o); @@ -791,19 +769,9 @@ function profiles_content(&$a) { local_user()); if(count($r)) { - $tpl_header = get_markup_template('profile_listing_header.tpl'); - $o .= replace_macros($tpl_header,array( - '$header' => t('Edit/Manage Profiles'), - '$chg_photo' => t('Change profile photo'), - '$cr_new' => t('Create New Profile'), - '$cr_new_link' => 'profiles/new?t=' . get_form_security_token("profile_new") - )); - - $tpl = get_markup_template('profile_entry.tpl'); - foreach($r as $rr) { - $o .= replace_macros($tpl, array( + $profiles .= replace_macros($tpl, array( '$photo' => $a->remove_baseurl($rr['thumb']), '$id' => $rr['id'], '$alt' => t('Profile Image'), @@ -812,6 +780,15 @@ function profiles_content(&$a) { : '' . t('Edit visibility') . '') )); } + + $tpl_header = get_markup_template('profile_listing_header.tpl'); + $o .= replace_macros($tpl_header,array( + '$header' => t('Edit/Manage Profiles'), + '$chg_photo' => t('Change profile photo'), + '$cr_new' => t('Create New Profile'), + '$cr_new_link' => 'profiles/new?t=' . get_form_security_token("profile_new"), + '$profiles' => $profiles + )); } return $o; } diff --git a/mod/search.php b/mod/search.php index 91c345b92..99ec6c5f7 100644 --- a/mod/search.php +++ b/mod/search.php @@ -191,17 +191,16 @@ function search_content(&$a) { if($tag) { logger("Start tag search for '".$search."'", LOGGER_DEBUG); - $r = q("SELECT STRAIGHT_JOIN `item`.`uri`, `item`.*, `item`.`id` AS `item_id`, - `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`alias`, `contact`.`rel`, - `contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`, - `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid` + $r = q("SELECT STRAIGHT_JOIN %s, %s FROM `term` INNER JOIN `item` ON `item`.`id`=`term`.`oid` - INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND NOT `contact`.`blocked` AND NOT `contact`.`pending` - WHERE `item`.`visible` AND NOT `item`.`deleted` AND NOT `item`.`moderated` - AND (`term`.`uid` = 0 OR (`term`.`uid` = %d AND NOT `term`.`global`)) AND `term`.`otype` = %d AND `term`.`type` = %d AND `term`.`term` = '%s' + INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND %s + WHERE %s AND (`term`.`uid` = 0 OR (`term`.`uid` = %d AND NOT `term`.`global`)) AND `term`.`otype` = %d AND `term`.`type` = %d AND `term`.`term` = '%s' ORDER BY term.created DESC LIMIT %d , %d ", - intval(local_user()), intval(TERM_OBJ_POST), intval(TERM_HASHTAG), dbesc(protect_sprintf($search)), + item_fieldlist(), contact_fieldlist(), + contact_condition(), item_condition(), + intval(local_user()), + intval(TERM_OBJ_POST), intval(TERM_HASHTAG), dbesc(protect_sprintf($search)), intval($a->pager['start']), intval($a->pager['itemspage'])); } else { logger("Start fulltext search for '".$search."'", LOGGER_DEBUG); @@ -212,17 +211,16 @@ function search_content(&$a) { $sql_extra = sprintf(" AND `item`.`body` REGEXP '%s' ", dbesc(protect_sprintf(preg_quote($search)))); } - $r = q("SELECT STRAIGHT_JOIN `item`.`uri`, `item`.*, `item`.`id` AS `item_id`, - `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`alias`, `contact`.`rel`, - `contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`, - `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid` + $r = q("SELECT STRAIGHT_JOIN %s, %s FROM `item` - INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND NOT `contact`.`blocked` AND NOT `contact`.`pending` - WHERE `item`.`visible` AND NOT `item`.`deleted` AND NOT `item`.`moderated` - AND (`item`.`uid` = 0 OR (`item`.`uid` = %s AND NOT `item`.`global`)) + INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND %s + WHERE %s AND (`item`.`uid` = 0 OR (`item`.`uid` = %s AND NOT `item`.`global`)) $sql_extra - GROUP BY `item`.`uri` ORDER BY `item`.`id` DESC LIMIT %d , %d ", - intval(local_user()), intval($a->pager['start']), intval($a->pager['itemspage'])); + GROUP BY `item`.`uri` ORDER BY `item`.`id` DESC LIMIT %d , %d", + item_fieldlist(), contact_fieldlist(), + contact_condition(), item_condition(), + intval(local_user()), + intval($a->pager['start']), intval($a->pager['itemspage'])); } if(! count($r)) { diff --git a/mod/settings.php b/mod/settings.php index 5168589f7..89406b707 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -989,6 +989,9 @@ function settings_content(&$a) { '$infinite_scroll' => array('infinite_scroll', t("Infinite scroll"), $infinite_scroll, ''), '$no_auto_update' => array('no_auto_update', t("Automatic updates only at the top of the network page"), $no_auto_update, 'When disabled, the network page is updated all the time, which could be confusing while reading.'), + '$d_tset' => t('General Theme Settings'), + '$d_ctset' => t('Custom Theme Settings'), + '$d_cset' => t('Content Settings'), 'stitle' => t('Theme settings'), '$theme_config' => $theme_config, )); diff --git a/view/templates/field_input.tpl b/view/templates/field_input.tpl index 8db8e545f..495493f2f 100644 --- a/view/templates/field_input.tpl +++ b/view/templates/field_input.tpl @@ -1,6 +1,6 @@
- + {{$field.3}}
diff --git a/view/templates/profile_edit.tpl b/view/templates/profile_edit.tpl index 76445685d..4623c77a8 100644 --- a/view/templates/profile_edit.tpl +++ b/view/templates/profile_edit.tpl @@ -24,20 +24,20 @@ {{if $detailled_profile}} {{include file="field_yesno.tpl" field=$details}}
- -
*
+ +
*
- - + +
- - + +
@@ -49,10 +49,7 @@
- -
-{{$dob}} {{$age}} -
+{{$dob}}
@@ -65,45 +62,45 @@
- - + +
- - + +
- - + +
- - +
- +
- - + +
@@ -116,10 +113,10 @@ {{$marital}} - - - - + + + +
@@ -132,33 +129,33 @@
- - + +
- - + +
- - + +
- - -
{{$lbl_pubdsc}}
+ + +
{{$pub_keywords.3}}
- - -
{{$lbl_prvdsc}}
+ + +
{{$prv_keywords.3}}
@@ -169,10 +166,10 @@

-{{$lbl_about}} +{{$about.1}}

- +
@@ -180,10 +177,10 @@

-{{$lbl_hobbies}} +{{$interest.1}}

- +
@@ -191,10 +188,10 @@

-{{$lbl_likes}} +{{$likes.1}}

- +
@@ -202,10 +199,10 @@

-{{$lbl_dislikes}} +{{$dislikes.1}}

- +
@@ -213,10 +210,10 @@

-{{$lbl_social}} +{{$contact.1}}

- +
@@ -230,20 +227,20 @@

-{{$lbl_music}} +{{$music.1}}

- +

-{{$lbl_book}} +{{$book.1}}

- +
@@ -252,10 +249,10 @@

-{{$lbl_tv}} +{{$tv.1}}

- +
@@ -264,10 +261,10 @@

-{{$lbl_film}} +{{$film.1}}

- +
@@ -281,10 +278,10 @@

-{{$lbl_love}} +{{$romance.1}}

- +
@@ -293,10 +290,10 @@

-{{$lbl_work}} +{{$work.1}}

- +
@@ -305,10 +302,10 @@

-{{$lbl_school}} +{{$education.1}}

- +
@@ -325,14 +322,14 @@ {{include file="field_yesno.tpl" field=$details}} {{/if}}
- -
*
+ +
*
- - + +
@@ -344,77 +341,74 @@
- -
-{{$dob}} {{$age}} -
+{{$dob}}
{{/if}}
- - + +
{{$hide_friends}}
- - + +
- - + +
- - + +
- - +
- +
- - -
{{$lbl_pubdsc}}
+ + +
{{$pub_keywords.3}}
- - -
{{$lbl_prvdsc}}
+ + +
{{$prv_keywords.3}}

-{{$lbl_about}} +{{$about.1}}

- +
@@ -424,25 +418,25 @@
- - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + {{/if}} - + diff --git a/view/templates/profile_entry.tpl b/view/templates/profile_entry.tpl index 3b0e88a87..69b39b9b3 100644 --- a/view/templates/profile_entry.tpl +++ b/view/templates/profile_entry.tpl @@ -1,12 +1,12 @@ -
-
-{{$alt}} -
-
-
{{$profile_name}}
-
{{$visible}}
+
+ {{$alt}} +
+
+
+ {{$profile_name}} +
+
{{$visible}}
- diff --git a/view/templates/profile_listing_header.tpl b/view/templates/profile_listing_header.tpl index a0fa1f499..88514c554 100644 --- a/view/templates/profile_listing_header.tpl +++ b/view/templates/profile_listing_header.tpl @@ -1,9 +1,14 @@

{{$header}}

+

-{{$chg_photo}} + {{$chg_photo}}

+ +
+ {{$profiles}} +
diff --git a/view/theme/frio/css/style.css b/view/theme/frio/css/style.css index deb3436de..eda0b3d71 100644 --- a/view/theme/frio/css/style.css +++ b/view/theme/frio/css/style.css @@ -953,6 +953,55 @@ aside .vcard #dfrn-request-link, aside .vcard #wallmessage-link { width: 100%; } +/* vcard-short-info */ +#vcard-short-info, +#nav-short-info .contact-wrapper { + margin-top: 2px; + height: 40px; + white-space: nowrap; + overflow: hidden; + padding-right: 20px; + margin-left: -14px; +} +#vcard-short-photo-wrapper img, +#nav-short-info .contact-wrapper img { + height: 34px; + width: 34px; + border-radius: 3px; +} +#vcard-short-desc, +#nav-short-info .contact-wrapper .media-body { + display: block; + height: 34px; + width: 100%; + text-overflow: ellipsis; +} +#vcard-short-desc > .media-heading, +#vcard-short-desc > .vcard-short-addr, +#nav-short-info .contact-wrapper .media-heading, +#nav-short-info .contact-wrapper #contact-entry-url-network { + text-overflow: ellipsis; + overflow: hidden; +} +#vcard-short-desc > .media-heading, +#nav-short-info .contact-wrapper .media-heading { + margin-bottom: 1px; + font-weight: bold; +} +#nav-short-info .contact-wrapper .media-heading a { + color: #555; + font-size: 14px !important; +} +#vcard-short-desc > .vcard-short-addr, +#nav-short-info .contact-wrapper #contact-entry-url-network { + color: #777; + font-size: 12px; +} +.network-content-wrapper > #viewcontact_wrapper-network, +#nav-short-info .contact-wrapper .contact-photo-overlay, +#nav-short-info .contact-wrapper .contact-actions{ + display: none +} aside #peoplefind-sidebar input, aside #follow-sidebar input { @@ -978,6 +1027,15 @@ aside #group-sidebar .sidebar-group-li .group-edit-tool:hover, aside #saved-search-list .saved-search-li .savedsearchdrop:hover { opacity: 1; } +aside #group-sidebar li .group-checkbox { + margin: 0; +} +aside #group-sidebar li .group-edit-tool { + padding-right: 10px; +} +aside #group-sidebar li .group-edit-tool:first-child { + padding-right: 0px; +} /* contact block widget */ #contact-block .contact-block-content { @@ -1707,7 +1765,7 @@ ul.dropdown-menu li:hover { /* PAGES */ /* Profile-page */ -#profile-page, .photos-content-wrapper, .settings-content-wrapper, +.generic-page-wrapper ,#profile-page, .profile_photo-content-wrapper, .photos-content-wrapper, .contacts-content-wrapper, .suggest-content-wrapper, .common-content-wrapper, .allfriends-content-wrapper, .match-content-wrapper, .dirfind-content-wrapper, .directory-content-wrapper, .manage-content-wrapper, .notes-content-wrapper, @@ -1982,6 +2040,62 @@ td.fc-day { } #event-edit-form-wrapper #event-edit-time { padding: 10px 0; +/* Profiles Page */ +.profile-listing-table { + display: table; + width: 100%; +} +.profile-listing-row { + display: table-row; +} +.profile-listing-cell { + display: table-cell; +} +.profile-listing-photo { + width: 48px; + height: 48px; + margin: 10px 0px; +} +#profile-listing-new-link-wrapper { + margin-bottom: 20px; +} +.panel-group-settings { + margin-left: -15px; + margin-right: -15px; +} +.panel-group-settings > .panel { + padding-left: 15px; + padding-right: 15px; +} +.profiles-content-wrapper #profile-photo-upload-section { + display: none; + margin-left: -15px; + margin-right: -15px; + margin-top: 15px; + padding: 15px; +} +#profile-photo-upload-close { + font-size: 14px; +} + +/* Settings */ +.section-subtitle-wrapper { + padding: 1px 10px; +} +.panel .section-subtitle-wrapper a.accordion-toggle:before { + font-family: FontAwesome; + content: "\f0d7"; + padding-right: 5px; +} +.panel .section-subtitle-wrapper a.accordion-toggle.collapsed:before { + font-family: FontAwesome; + content: "\f0da"; +} +#settings-nick-wrapper { + margin-bottom: 20px; +} +.group { + margin-left: 20px; } /* * Overwriting for transparency and other colors diff --git a/view/theme/frio/frameworks/jquery-scrollspy/README.md b/view/theme/frio/frameworks/jquery-scrollspy/README.md new file mode 100644 index 000000000..5707f31fe --- /dev/null +++ b/view/theme/frio/frameworks/jquery-scrollspy/README.md @@ -0,0 +1,183 @@ +# NOTE: This is the latest version of ScrollSpy, which includes a ton of bug fixes and efficiency improvements. It's recommended that you use this version for now instead of the official (which hasn't been updated in a while). + +# jQuery-ScrollSpy + +An adaptation of the Mootools Scrollspy (http://davidwalsh.name/mootools-scrollspy) plugin for jQuery + +(c) 2011 Samuel Alexander (https://github.com/sxalexander/jquery-scrollspy) + +(c) 2015 SoftwareSpot + +Released under The MIT License. + +## Description: + +ScrollSpy is a simple jQuery plugin for firing events based on where the user has scrolled to in a page. + +## Homepage: + +https://github.com/softwarespot/jquery-scrollspy + +## Source: + +Hosted at GitHub; browse at: + + https://github.com/softwarespot/jquery-scrollspy/tree/master + +Or clone from: + + git://github.com/softwarespot/jquery-scrollspy.git + +## Usage: + +1. Insert the necessary elements in to your document's `` section, e.g.: + +```html + + +``` + +2. Initialise ScrollSpy once the DOM has been loaded: + +```javascript + +``` + +Check out the /examples for more info ! + +## Documentation: + +ScrollSpy function signature: +```javascript + $('container').scrollspy(options, action) +``` + +Default options for ScrollSpy: +```javascript +// default options for ScrollSpy +var defaults = { + // the offset to be applied to the left and top positions of the container + buffer: 0, + + // the element to apply the 'scrolling' event to (default window) + container: window, + + // the maximum value of the X or Y coordinate, depending on mode the selected + max: 0, + + // the maximum value of the X or Y coordinate, depending on mode the selected + min: 0, + + // whether to listen to the X (horizontal) or Y (vertical) scrolling + mode: 'vertical', + + // namespace to append to the 'scroll' event + namespace: 'scrollspy', + + // call the following callback function every time the user enters the min / max zone + onEnter: null, + + // call the following callback function every time the user leaves the min / max zone + onLeave: null, + + // call the following callback function every time the user leaves the top zone + onLeaveTop: null, + + // call the following callback function every time the user leaves the bottom zone + onLeaveBottom: null, + + // call the following callback function on each scroll event within the min and max parameters + onTick: null, + + // call the following callback function on each scroll event when the element is inside the viewable view port + onView: null +}; +``` + +Events are triggered by ScrollSpy are: + + scrollTick: Fires on each scroll event within the min and max parameters: + position: an object with the current X and Y position. + inside: a Boolean value for whether or not the user is within the min and max parameters + enters: the number of times the min / max has been entered. + leaves: the number of times the min / max has been left. + + scrollEnter: Fires every time the user enters the min / max zone: + position: an object with the current X and Y position. + enters: the number of times the min / max has been entered. + + scrollLeave: Fires every time the user leaves the min / max zone: + position: an object with the current X and Y position. + leaves: the number of times the min / max has been left. + + scrollLeaveTop: Fires every time the user leaves the top zone: + position: an object with the current X and Y position. + leaves: the number of times the min / max has been left. + + scrollLeaveBottom: Fires every time the user leaves the bottom zone: + position: an object with the current X and Y position. + leaves: the number of times the min / max has been left. + + scrollView: Fires every time the element is inside the viewable view port: + position: an object with the current X and Y position. + leaves: the number of times the min / max has been left. + +### Tidy up + +To destroy ScrollSpy for a particular container, simple pass 'destroy' as the action parameter. The only options that will be honoured are `container` and `namespace`. + +## A note about forking: + +By forking this project you hereby grant permission for any commits to your fork to be +merged back into this repository and, with attribution, be released under the terms of +the MIT License. + +## Contribute + +To contribute to the project, you will first need to install [node](https://nodejs.org) globally on your system. Once installation has completed, change the working directory to the plugin's location and run the following command: + +```shell + npm install +``` + +After installation of the local modules, you're ready to start contributing to the project. Before you submit your PR, please don't forget to call `gulp`, which will run against [JSHint](http://jshint.com) for any errors, but will also minify the plugin. + +##### Watch +Call the following command to start 'watching' for any changes to the main JavaScript file(s). This will automatically invoke JSHint and Uglify. +```shell + gulp watch +``` + +##### JSHint +Call the following command to invoke JSHint and check that the changes meet the requirements set in .jshintrc. +```shell + gulp jshint +``` + +##### Uglify +Call the following command to invoke Uglify, which will minify the main JavaScript file(s) and output to a .min.js file respectively. +```shell + gulp uglify +``` + +##### Build +Call the following command to invoke both JSHint and Uglify. +```shell + gulp +``` diff --git a/view/theme/frio/frameworks/jquery-scrollspy/bower.json b/view/theme/frio/frameworks/jquery-scrollspy/bower.json new file mode 100644 index 000000000..8257ebdd8 --- /dev/null +++ b/view/theme/frio/frameworks/jquery-scrollspy/bower.json @@ -0,0 +1,18 @@ +{ + "name": "jquery-scrollspy", + "homepage": "https://github.com/sxalexander/jquery-scrollspy/", + "description": "scrollspy is a simple jQuery plugin for firing events based on where the user has scrolled to in a page.", + "main": "jquery-scrollspy.min.js", + "keywords": [ + "scrolling", + "scroll" + ], + "license": "MIT", + "ignore": [ + ], + "dependencies": { + "jquery": ">=1.7.0" + }, + "devDependencies": { + } +} diff --git a/view/theme/frio/frameworks/jquery-scrollspy/gulpfile.js b/view/theme/frio/frameworks/jquery-scrollspy/gulpfile.js new file mode 100644 index 000000000..4c7563c5d --- /dev/null +++ b/view/theme/frio/frameworks/jquery-scrollspy/gulpfile.js @@ -0,0 +1,65 @@ +/* global require */ + +var gulp = require('gulp'); +var eslint = require('gulp-eslint'); +var gulpIf = require('gulp-if'); +var rename = require('gulp-rename'); +var uglify = require('gulp-uglify'); + +// Assets for the project +var Assets = { + main: './jquery-scrollspy.js', + minified: './jquery-scrollspy.min.js', + package: './package.json', + readme: './README.md', + source: './', +}; + +// See the uglify documentation for more details +var _uglifySettings = { + compress: { + comparisons: true, + conditionals: true, + /* jscs: disable */ + dead_code: true, + drop_console: true, + /* jscs: enable */ + unsafe: true, + unused: true, + }, +}; + +// Check the main js file(s) meets the following standards outlined in .eslintrc +gulp.task('eslint', function esLintTask() { + // Has ESLint fixed the file contents? + function isFixed(file) { + return file.eslint !== undefined && file.eslint !== null && file.eslint.fixed; + } + + return gulp.src(Assets.main) + .pipe(eslint({ + fix: true, + useEslintrc: '.eslintrc', + })) + .pipe(eslint.format()) + .pipe(gulpIf(isFixed, gulp.dest(Assets.source))); +}); + +// Uglify aka minify the main file +gulp.task('uglify', function uglifyTask() { + return gulp.src(Assets.main) + .pipe(uglify(_uglifySettings)) + .pipe(rename(Assets.minified)) + .pipe(gulp.dest(Assets.source)); +}); + +// Watch for changes to the main file +gulp.task('watch', function watchTask() { + gulp.watch(Assets.main, ['eslint', 'uglify']); +}); + +// Register the default task +gulp.task('default', ['eslint', 'uglify']); + +// 'gulp eslint' to check the syntax of the main js file(s) +// 'gulp uglify' to uglify the main file diff --git a/view/theme/frio/frameworks/jquery-scrollspy/jquery-scrollspy.js b/view/theme/frio/frameworks/jquery-scrollspy/jquery-scrollspy.js new file mode 100644 index 000000000..4fd4f53a6 --- /dev/null +++ b/view/theme/frio/frameworks/jquery-scrollspy/jquery-scrollspy.js @@ -0,0 +1,267 @@ +/* + * jQuery ScrollSpy Plugin + * Author: @sxalexander, softwarespot + * Licensed under the MIT license + */ +(function jQueryScrollspy(window, $) { + // Plugin Logic + + $.fn.extend({ + scrollspy: function scrollspy(options, action) { + // If the options parameter is a string, then assume it's an 'action', therefore swap the parameters around + if (_isString(options)) { + var tempOptions = action; + + // Set the action as the option parameter + action = options; + + // Set to be the reference action pointed to + options = tempOptions; + } + + // override the default options with those passed to the plugin + options = $.extend({}, _defaults, options); + + // sanitize the following option with the default value if the predicate fails + _sanitizeOption(options, _defaults, 'container', _isObject); + + // cache the jQuery object + var $container = $(options.container); + + // check if it's a valid jQuery selector + if ($container.length === 0) { + return this; + } + + // sanitize the following option with the default value if the predicate fails + _sanitizeOption(options, _defaults, 'namespace', _isString); + + // check if the action is set to DESTROY/destroy + if (_isString(action) && action.toUpperCase() === 'DESTROY') { + $container.off('scroll.' + options.namespace); + return this; + } + + // sanitize the following options with the default values if the predicates fails + _sanitizeOption(options, _defaults, 'buffer', $.isNumeric); + _sanitizeOption(options, _defaults, 'max', $.isNumeric); + _sanitizeOption(options, _defaults, 'min', $.isNumeric); + + // callbacks + _sanitizeOption(options, _defaults, 'onEnter', $.isFunction); + _sanitizeOption(options, _defaults, 'onLeave', $.isFunction); + _sanitizeOption(options, _defaults, 'onLeaveTop', $.isFunction); + _sanitizeOption(options, _defaults, 'onLeaveBottom', $.isFunction); + _sanitizeOption(options, _defaults, 'onTick', $.isFunction); + + if ($.isFunction(options.max)) { + options.max = options.max(); + } + + if ($.isFunction(options.min)) { + options.min = options.min(); + } + + // check if the mode is set to VERTICAL/vertical + var isVertical = window.String(options.mode).toUpperCase() === 'VERTICAL'; + + return this.each(function each() { + // cache this + var _this = this; + + // cache the jQuery object + var $element = $(_this); + + // count the number of times a container is entered + var enters = 0; + + // determine if the scroll is with inside the container + var inside = false; + + // count the number of times a container is left + var leaves = 0; + + // create a scroll listener for the container + $container.on('scroll.' + options.namespace, function onScroll() { + // cache the jQuery object + var $this = $(this); + + // create a position object literal + var position = { + top: $this.scrollTop(), + left: $this.scrollLeft(), + }; + + var containerHeight = $container.height(); + + var max = options.max; + + var min = options.min; + + var xAndY = isVertical ? position.top + options.buffer : position.left + options.buffer; + + if (max === 0) { + // get the maximum value based on either the height or the outer width + max = isVertical ? containerHeight : $container.outerWidth() + $element.outerWidth(); + } + + // if we have reached the minimum bound, though are below the max + if (xAndY >= min && xAndY <= max) { + // trigger the 'scrollEnter' event + if (!inside) { + inside = true; + enters++; + + // trigger the 'scrollEnter' event + $element.trigger('scrollEnter', { + position: position, + }); + + // call the 'onEnter' function + if (options.onEnter !== null) { + options.onEnter(_this, position); + } + } + + // trigger the 'scrollTick' event + $element.trigger('scrollTick', { + position: position, + inside: inside, + enters: enters, + leaves: leaves, + }); + + // call the 'onTick' function + if (options.onTick !== null) { + options.onTick(_this, position, inside, enters, leaves); + } + } else { + if (inside) { + inside = false; + leaves++; + + // trigger the 'scrollLeave' event + $element.trigger('scrollLeave', { + position: position, + leaves: leaves, + }); + + // call the 'onLeave' function + if (options.onLeave !== null) { + options.onLeave(_this, position); + } + + if (xAndY <= min) { + // trigger the 'scrollLeaveTop' event + $element.trigger('scrollLeaveTop', { + position: position, + leaves: leaves, + }); + + // call the 'onLeaveTop' function + if (options.onLeaveTop !== null) { + options.onLeaveTop(_this, position); + } + } else if (xAndY >= max) { + // trigger the 'scrollLeaveBottom' event + $element.trigger('scrollLeaveBottom', { + position: position, + leaves: leaves, + }); + + // call the 'onLeaveBottom' function + if (options.onLeaveBottom !== null) { + options.onLeaveBottom(_this, position); + } + } + } else { + // Idea taken from: http://stackoverflow.com/questions/5353934/check-if-element-is-visible-on-screen + var containerScrollTop = $container.scrollTop(); + + // Get the element height + var elementHeight = $element.height(); + + // Get the element offset + var elementOffsetTop = $element.offset().top; + + if ((elementOffsetTop < (containerHeight + containerScrollTop)) && (elementOffsetTop > (containerScrollTop - elementHeight))) { + // trigger the 'scrollView' event + $element.trigger('scrollView', { + position: position, + }); + + // call the 'onView' function + if (options.onView !== null) { + options.onView(_this, position); + } + } + } + } + }); + }); + }, + }); + + // Fields (Private) + + // Defaults + + // default options + var _defaults = { + // the offset to be applied to the left and top positions of the container + buffer: 0, + + // the element to apply the 'scrolling' event to (default window) + container: window, + + // the maximum value of the X or Y coordinate, depending on mode the selected + max: 0, + + // the maximum value of the X or Y coordinate, depending on mode the selected + min: 0, + + // whether to listen to the X (horizontal) or Y (vertical) scrolling + mode: 'vertical', + + // namespace to append to the 'scroll' event + namespace: 'scrollspy', + + // call the following callback function every time the user enters the min / max zone + onEnter: null, + + // call the following callback function every time the user leaves the min / max zone + onLeave: null, + + // call the following callback function every time the user leaves the top zone + onLeaveTop: null, + + // call the following callback function every time the user leaves the bottom zone + onLeaveBottom: null, + + // call the following callback function on each scroll event within the min and max parameters + onTick: null, + + // call the following callback function on each scroll event when the element is inside the viewable view port + onView: null, + }; + + // Methods (Private) + + // check if a value is an object datatype + function _isObject(value) { + return $.type(value) === 'object'; + } + + // check if a value is a string datatype with a length greater than zero when whitespace is stripped + function _isString(value) { + return $.type(value) === 'string' && $.trim(value).length > 0; + } + + // check if an option is correctly formatted using a predicate; otherwise, return the default value + function _sanitizeOption(options, defaults, property, predicate) { + // set the property to the default value if the predicate returned false + if (!predicate(options[property])) { + options[property] = defaults[property]; + } + } +}(window, window.jQuery)); diff --git a/view/theme/frio/frameworks/jquery-scrollspy/jquery-scrollspy.min.js b/view/theme/frio/frameworks/jquery-scrollspy/jquery-scrollspy.min.js new file mode 100644 index 000000000..2782536b3 --- /dev/null +++ b/view/theme/frio/frameworks/jquery-scrollspy/jquery-scrollspy.min.js @@ -0,0 +1 @@ +!function(e,n){function o(e){return"object"===n.type(e)}function i(e){return"string"===n.type(e)&&n.trim(e).length>0}function t(e,n,o,i){i(e[o])||(e[o]=n[o])}n.fn.extend({scrollspy:function(l,s){if(i(l)){var a=s;s=l,l=a}l=n.extend({},r,l),t(l,r,"container",o);var c=n(l.container);if(0===c.length)return this;if(t(l,r,"namespace",i),i(s)&&"DESTROY"===s.toUpperCase())return c.off("scroll."+l.namespace),this;t(l,r,"buffer",n.isNumeric),t(l,r,"max",n.isNumeric),t(l,r,"min",n.isNumeric),t(l,r,"onEnter",n.isFunction),t(l,r,"onLeave",n.isFunction),t(l,r,"onLeaveTop",n.isFunction),t(l,r,"onLeaveBottom",n.isFunction),t(l,r,"onTick",n.isFunction),n.isFunction(l.max)&&(l.max=l.max()),n.isFunction(l.min)&&(l.min=l.min());var u="VERTICAL"===e.String(l.mode).toUpperCase();return this.each(function(){var e=this,o=n(e),i=0,t=!1,r=0;c.on("scroll."+l.namespace,function(){var s=n(this),a={top:s.scrollTop(),left:s.scrollLeft()},f=c.height(),p=l.max,m=l.min,v=u?a.top+l.buffer:a.left+l.buffer;if(0===p&&(p=u?f:c.outerWidth()+o.outerWidth()),v>=m&&p>=v)t||(t=!0,i++,o.trigger("scrollEnter",{position:a}),null!==l.onEnter&&l.onEnter(e,a)),o.trigger("scrollTick",{position:a,inside:t,enters:i,leaves:r}),null!==l.onTick&&l.onTick(e,a,t,i,r);else if(t)t=!1,r++,o.trigger("scrollLeave",{position:a,leaves:r}),null!==l.onLeave&&l.onLeave(e,a),m>=v?(o.trigger("scrollLeaveTop",{position:a,leaves:r}),null!==l.onLeaveTop&&l.onLeaveTop(e,a)):v>=p&&(o.trigger("scrollLeaveBottom",{position:a,leaves:r}),null!==l.onLeaveBottom&&l.onLeaveBottom(e,a));else{var g=c.scrollTop(),L=o.height(),h=o.offset().top;f+g>h&&h>g-L&&(o.trigger("scrollView",{position:a}),null!==l.onView&&l.onView(e,a))}})})}});var r={buffer:0,container:e,max:0,min:0,mode:"vertical",namespace:"scrollspy",onEnter:null,onLeave:null,onLeaveTop:null,onLeaveBottom:null,onTick:null,onView:null}}(window,window.jQuery); \ No newline at end of file diff --git a/view/theme/frio/frameworks/jquery-scrollspy/package.json b/view/theme/frio/frameworks/jquery-scrollspy/package.json new file mode 100644 index 000000000..27ca19663 --- /dev/null +++ b/view/theme/frio/frameworks/jquery-scrollspy/package.json @@ -0,0 +1,21 @@ +{ + "name": "jquery-scrollspy", + "version": "1.0.0", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/softwarespot/jquery-scrollspy.git" + }, + "devDependencies": { + "del": "^2.1.0", + "eslint": "^2.5.1", + "eslint-config-airbnb": "^6.2.0", + "gulp": "^3.9.1", + "gulp-eslint": "^2.0.0", + "gulp-if": "^2.0.0", + "gulp-rename": "~1.2.2", + "gulp-replace": "^0.5.4", + "gulp-uglify": "^1.5.3", + "merge2": "^1.0.1" + } +} diff --git a/view/theme/frio/js/modal.js b/view/theme/frio/js/modal.js index d27048e2d..0279b1c72 100644 --- a/view/theme/frio/js/modal.js +++ b/view/theme/frio/js/modal.js @@ -62,6 +62,11 @@ $(document).ready(function(){ toggleJotNav(this); }); + // bookmarklet page needs an jot modal which appears automatically + if(window.location.pathname.indexOf("/bookmarklet") >=0 && $("#jot-modal").length){ + jotShow(); + } + // Open filebrowser for elements with the class "image-select" // The following part handles the filebrowser for field_fileinput.tpl $("body").on("click", ".image-select", function(){ diff --git a/view/theme/frio/js/theme.js b/view/theme/frio/js/theme.js index f3bd543c1..f2537f487 100644 --- a/view/theme/frio/js/theme.js +++ b/view/theme/frio/js/theme.js @@ -149,12 +149,36 @@ $(document).ready(function(){ if( typeof searchValue !== "undefined") { $("#nav-search-input-field").val(searchValue); } - } // move the "Save the search" button to the second navbar $(".search-content-wrapper #search-save-form ").appendTo("#topbar-second > .container > #navbar-button"); + // append the vcard-short-info to the second nav after passing the element + // with .fn (vcard username). Use scrollspy to get the scroll position. + if( $("aside .vcard .fn").length) { + $(".vcard .fn").scrollspy({ + min: $(".vcard .fn").position().top - 50, + onLeaveTop: function onLeave(element) { + $("#vcard-short-info").fadeOut(500, function () { + $("#vcard-short-info").appendTo("#vcard-short-info-wrapper"); + }); + }, + onEnter: function(element) { + $("#vcard-short-info").appendTo("#nav-short-info"); + $("#vcard-short-info").fadeIn(500); + }, + }); + } + + // move the forum contact information of the network page into the second navbar + if( $(".network-content-wrapper > #viewcontact_wrapper-network").length) { + // get the contact-wrapper element and append it to the second nav bar + // Note: We need the first() element with this class since at the present time we + // store also the js template information in the html code and thats why + // there are two elements with this class but we don't want the js template + $(".network-content-wrapper > #viewcontact_wrapper-network .contact-wrapper").first().appendTo("#nav-short-info"); + } }); //function commentOpenUI(obj, id) { // $(document).unbind( "click.commentOpen", handler ); diff --git a/view/theme/frio/templates/field_input.tpl b/view/theme/frio/templates/field_input.tpl index 181360271..c7b0bbfb2 100644 --- a/view/theme/frio/templates/field_input.tpl +++ b/view/theme/frio/templates/field_input.tpl @@ -1,7 +1,7 @@
- + {{$field.3}}
diff --git a/view/theme/frio/templates/field_intcheckbox.tpl b/view/theme/frio/templates/field_intcheckbox.tpl new file mode 100644 index 000000000..192cf7384 --- /dev/null +++ b/view/theme/frio/templates/field_intcheckbox.tpl @@ -0,0 +1,7 @@ + +
+ + + {{$field.4}} +
+
diff --git a/view/theme/frio/templates/field_openid.tpl b/view/theme/frio/templates/field_openid.tpl new file mode 100644 index 000000000..8081f9cf1 --- /dev/null +++ b/view/theme/frio/templates/field_openid.tpl @@ -0,0 +1,7 @@ + +
+ + + {{$field.3}} +
+
diff --git a/view/theme/frio/templates/field_password.tpl b/view/theme/frio/templates/field_password.tpl index 87b689bd5..31defaf33 100644 --- a/view/theme/frio/templates/field_password.tpl +++ b/view/theme/frio/templates/field_password.tpl @@ -1,6 +1,7 @@ -
- - {{if $field.4}} {{$field.4}} {{/if}} +
+ + {{$field.3}} +
diff --git a/view/theme/frio/templates/field_textarea.tpl b/view/theme/frio/templates/field_textarea.tpl new file mode 100644 index 000000000..e70e3cbb4 --- /dev/null +++ b/view/theme/frio/templates/field_textarea.tpl @@ -0,0 +1,7 @@ + +
+ + + {{$field.3}} +
+
diff --git a/view/theme/frio/templates/head.tpl b/view/theme/frio/templates/head.tpl index afdfaa785..57148736d 100644 --- a/view/theme/frio/templates/head.tpl +++ b/view/theme/frio/templates/head.tpl @@ -73,6 +73,7 @@ + {{* own js files *}} diff --git a/view/theme/frio/templates/login.tpl b/view/theme/frio/templates/login.tpl new file mode 100644 index 000000000..1615294c8 --- /dev/null +++ b/view/theme/frio/templates/login.tpl @@ -0,0 +1,40 @@ + + +
+
+ + +
{{$login}}
+ +
+ {{include file="field_input.tpl" field=$lname}} + {{include file="field_password.tpl" field=$lpassword}} +
+ + {{if $openid}} +
+ {{include file="field_openid.tpl" field=$lopenid}} +
+ {{/if}} + + {{include file="field_checkbox.tpl" field=$lremember}} + + + +
+ +
+
+ + {{foreach $hiddens as $k=>$v}} + + {{/foreach}} + +
+
+ + + diff --git a/view/theme/frio/templates/nav.tpl b/view/theme/frio/templates/nav.tpl index 9b0b28356..a72a29a38 100644 --- a/view/theme/frio/templates/nav.tpl +++ b/view/theme/frio/templates/nav.tpl @@ -267,7 +267,7 @@ {{* The second navbar which contains nav points of the actual page - (nav points are actual handled by this theme throug js *}}
- +
diff --git a/view/theme/frio/templates/profile_edit.tpl b/view/theme/frio/templates/profile_edit.tpl new file mode 100644 index 000000000..5d82c1c14 --- /dev/null +++ b/view/theme/frio/templates/profile_edit.tpl @@ -0,0 +1,331 @@ + +
+ {{include file="section_title.tpl" title=$banner}} + + {{* The actions dropdown which can performed to the current profile *}} + + + + +
+ + + +
+ +
+ + +
+ +
+ +
+
+
+
+ + {{* Most of the Variables used below are arrays in the following style + 0 => Some kind of identifier (e.g. for the ID) + 1 => The label description + 2 => The input values + 3 => The additional help text (if available) + *}} + +
+ + + {{* Some hints to characteristics of the current profile (if available) *}} + {{if $is_default}} + + {{/if}} + + {{* friendica differs in $detailled_profile (all fields available and a short Version if this is variable false *}} + {{if $detailled_profile}} +
+ {{* The personal settings *}} +
+ + {{* for the $detailled_profile we use bootstraps collapsable panel-groups to have expandable groups *}} +
+
+ {{include file="field_yesno.tpl" field=$details}} + + {{include file="field_input.tpl" field=$profile_name}} + + {{include file="field_input.tpl" field=$name}} + + {{include file="field_input.tpl" field=$pdesc}} + + +
+ + {{$gender}} +
+
+ + {{$dob}} + + {{$hide_friends}} + +
+ +
+
+
+
+
+ + {{* The location settings *}} +
+ +
+
+ {{include file="field_input.tpl" field=$address}} + + {{include file="field_input.tpl" field=$locality}} + + + {{include file="field_input.tpl" field=$postal_code}} + +
+ + +
+
+ +
+ + +
+
+ + {{include file="field_input.tpl" field=$hometown}} + +
+ +
+
+
+
+
+ + {{* The settings for relations *}} +
+ +
+
+
+ + {{$marital}} +
+
+ + {{include file="field_input.tpl" field=$with}} + + {{include file="field_input.tpl" field=$howlong}} + +
+ + {{$sexual}} +
+
+ +
+ +
+
+
+
+
+ + {{* The miscellanous other settings *}} +
+ +
+
+ {{include file="field_input.tpl" field=$homepage}} + + {{include file="field_input.tpl" field=$pub_keywords}} + + {{include file="field_input.tpl" field=$prv_keywords}} + + {{include file="field_input.tpl" field=$politic}} + + {{include file="field_input.tpl" field=$religion}} + + + {{include file="field_textarea.tpl" field=$about}} + + {{include file="field_textarea.tpl" field=$contact}} + + {{include file="field_textarea.tpl" field=$interest}} + + {{include file="field_textarea.tpl" field=$likes}} + + {{include file="field_textarea.tpl" field=$dislikes}} + + {{include file="field_textarea.tpl" field=$music}} + + {{include file="field_textarea.tpl" field=$book}} + + {{include file="field_textarea.tpl" field=$tv}} + + {{include file="field_textarea.tpl" field=$film}} + + {{include file="field_textarea.tpl" field=$romance}} + + {{include file="field_textarea.tpl" field=$work}} + + {{include file="field_textarea.tpl" field=$education}} + +
+ +
+
+
+
+
+
+ + {{else}} + {{* if $detailled_profile not available a short version of the setting page is displayed *}} + {{if $personal_account}} + {{include file="field_yesno.tpl" field=$details}} + {{/if}} + + {{include file="field_input.tpl" field=$profile_name}} + + {{include file="field_input.tpl" field=$name}} + + {{if $personal_account}} +
+ + {{$gender}} +
+
+ + {{$dob}} + + {{/if}} + + {{include file="field_input.tpl" field=$homepage}} + + {{$hide_friends}} + + {{include file="field_input.tpl" field=$address}} + + {{include file="field_input.tpl" field=$locality}} + + + {{include file="field_input.tpl" field=$postal_code}} + +
+ + +
+
+ +
+ + +
+
+ + {{include file="field_input.tpl" field=$pub_keywords}} + + {{include file="field_input.tpl" field=$prv_keywords}} + + {{include file="field_textarea.tpl" field=$about}} + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + {{/if}} +
+
+ + diff --git a/view/theme/frio/templates/profile_entry.tpl b/view/theme/frio/templates/profile_entry.tpl new file mode 100644 index 000000000..fb5436fb5 --- /dev/null +++ b/view/theme/frio/templates/profile_entry.tpl @@ -0,0 +1,15 @@ + +
+
+ {{$alt}} +
+
+ +
+ {{$visible}} +
+
+
+ diff --git a/view/theme/frio/templates/profile_listing_header.tpl b/view/theme/frio/templates/profile_listing_header.tpl new file mode 100644 index 000000000..e042ff72a --- /dev/null +++ b/view/theme/frio/templates/profile_listing_header.tpl @@ -0,0 +1,15 @@ + +
+
+

{{$header}}

+
+ +
+ +
+ {{$profiles}} +
+
+
diff --git a/view/theme/frio/templates/profile_vcard.tpl b/view/theme/frio/templates/profile_vcard.tpl index e0babdc3a..de448b82b 100644 --- a/view/theme/frio/templates/profile_vcard.tpl +++ b/view/theme/frio/templates/profile_vcard.tpl @@ -20,7 +20,19 @@
+ {{* The short information which will appended to the second navbar by scrollspy *}} +
diff --git a/view/theme/frio/templates/removeme.tpl b/view/theme/frio/templates/removeme.tpl new file mode 100644 index 000000000..2e599a0da --- /dev/null +++ b/view/theme/frio/templates/removeme.tpl @@ -0,0 +1,24 @@ +
+ {{* include the title template for the settings title *}} + {{include file="section_title.tpl" title=$title }} + +
+
{{$desc}}
+ +
+ + +
+ + +
+
+ +
+ +
+
+
+
+
+ diff --git a/view/theme/frio/templates/searchbox.tpl b/view/theme/frio/templates/searchbox.tpl index 8f6354b26..95673698b 100644 --- a/view/theme/frio/templates/searchbox.tpl +++ b/view/theme/frio/templates/searchbox.tpl @@ -1,6 +1,6 @@ {{* important notes: The frio theme hides under certain conditions some parts of the templates through css. -Some parts of this template will be moved by js to other places (see theme.js) - E.g. the save-search button}} +Some parts of this template will be moved by js to other places (see theme.js) - E.g. the save-search button *}}
diff --git a/view/theme/frio/templates/settings.tpl b/view/theme/frio/templates/settings.tpl new file mode 100644 index 000000000..6eed613dd --- /dev/null +++ b/view/theme/frio/templates/settings.tpl @@ -0,0 +1,309 @@ +
+ {{* include the title template for the settings title *}} + {{include file="section_title.tpl" title=$ptitle }} + + {{$nickname_block}} + +
+ + + {{* We organize the settings in collapsable panel-groups *}} +
+ {{* The password setting section *}} +
+ +
+
+ {{include file="field_password.tpl" field=$password1}} + {{include file="field_password.tpl" field=$password2}} + {{include file="field_password.tpl" field=$password3}} + + {{if $oid_enable}} + {{include file="field_input.tpl" field=$openid}} + {{/if}} + +
+ +
+
+
+
+
+ + {{* The basic setting section *}} +
+ +
+
+ + {{include file="field_input.tpl" field=$username}} + {{include file="field_input.tpl" field=$email}} + {{include file="field_password.tpl" field=$password4}} + {{include file="field_custom.tpl" field=$timezone}} + {{include file="field_select.tpl" field=$language}} + {{include file="field_input.tpl" field=$defloc}} + {{include file="field_checkbox.tpl" field=$allowloc}} + +
+ +
+
+
+
+
+ + {{* The privacity setting section *}} +
+ +
+
+ + + + {{include file="field_input.tpl" field=$maxreq}} + + {{$profile_in_dir}} + + {{$profile_in_net_dir}} + + {{$hide_friends}} + + {{$hide_wall}} + + {{$blockwall}} + + {{$blocktags}} + + {{$suggestme}} + + {{$unkmail}} + + + {{include file="field_input.tpl" field=$cntunkmail}} + + {{include file="field_input.tpl" field=$expire.days}} + + +
+ {{$expire.label}} + + {{* The modal for advanced-expire *}} + +
+ + {{* Block for setting default permissions *}} +
+ {{$permissions}} {{$permdesc}} +
+ + {{* We include the aclModal directly into the template since we cant use frio's default modal *}} + +
+
+
+ + {{$group_select}} + + +
+ +
+
+
+
+
+ + {{* The notification setting section *}} +
+ +
+
+
+ +

{{$activity_options}}

+ +
+ {{include file="field_checkbox.tpl" field=$post_newfriend}} + {{include file="field_checkbox.tpl" field=$post_joingroup}} + {{include file="field_checkbox.tpl" field=$post_profilechange}} +
+ + +

{{$lbl_not}}

+ +
+ {{include file="field_intcheckbox.tpl" field=$notify1}} + {{include file="field_intcheckbox.tpl" field=$notify2}} + {{include file="field_intcheckbox.tpl" field=$notify3}} + {{include file="field_intcheckbox.tpl" field=$notify4}} + {{include file="field_intcheckbox.tpl" field=$notify5}} + {{include file="field_intcheckbox.tpl" field=$notify6}} + {{include file="field_intcheckbox.tpl" field=$notify7}} + {{include file="field_intcheckbox.tpl" field=$notify8}} +
+ + {{include file="field_checkbox.tpl" field=$email_textonly}} + + + {{* commented out because it was commented out in the original template +
+ + {{$desktop_notifications_note}} +
+ *}} + + {{include file="field_yesno.tpl" field=$desktop_notifications}} + +
+ +
+ +
+
+
+
+
+ + {{* The additional account setting section *}} +
+ +
+
+ +
{{$h_descadvn}}
+ + {{$pagetype}} + +
+ +
+
+
+
+
+ + {{* The relocate setting section *}} +
+ +
+
+ +
{{$relocate_text}}
+ +
+
+ +
+
+
+
+
+
+
+
+ diff --git a/view/theme/frio/templates/settings_display.tpl b/view/theme/frio/templates/settings_display.tpl new file mode 100644 index 000000000..585ea510d --- /dev/null +++ b/view/theme/frio/templates/settings_display.tpl @@ -0,0 +1,104 @@ + +
+ {{* include the title template for the settings title *}} + {{include file="section_title.tpl" title=$ptitle }} + + +
+ + +
+
+ + +
+
+ + {{include file="field_themeselect.tpl" field=$theme}} + + {{include file="field_themeselect.tpl" field=$mobile_theme}} + +
+ +
+
+ +
+
+
+ +
+ +
+
+ + {{if $theme_config}} + {{$theme_config}} + {{/if}} + +
+
+
+ +
+ +
+
+ + {{include file="field_input.tpl" field=$itemspage_network}} + {{include file="field_input.tpl" field=$itemspage_mobile_network}} + {{include file="field_input.tpl" field=$ajaxint}} + {{include file="field_checkbox.tpl" field=$no_auto_update}} + {{include file="field_checkbox.tpl" field=$nosmile}} + {{include file="field_checkbox.tpl" field=$noinfo}} + {{include file="field_checkbox.tpl" field=$infinite_scroll}} + +
+ +
+
+
+
+
+ +
+ +
+
+ + {{include file="field_select.tpl" field=$first_day_of_week}} + +
+ +
+
+
+
+
+
+
+
diff --git a/view/theme/frio/templates/settings_features.tpl b/view/theme/frio/templates/settings_features.tpl new file mode 100644 index 000000000..6d7ec79f9 --- /dev/null +++ b/view/theme/frio/templates/settings_features.tpl @@ -0,0 +1,36 @@ +
+ {{* include the title template for the settings title *}} + {{include file="section_title.tpl" title=$title }} + + +
+ + {{* We organize the settings in collapsable panel-groups *}} +
+ {{foreach $features as $g => $f}} +
+ +
+
+ {{foreach $f.1 as $fcat}} + {{include file="field_yesno.tpl" field=$fcat}} + {{/foreach}} + +
+ +
+
+
+
+
+ {{/foreach}} +
+ +
+
diff --git a/view/theme/frio/templates/settings_oauth.tpl b/view/theme/frio/templates/settings_oauth.tpl new file mode 100644 index 000000000..ffd40f2ab --- /dev/null +++ b/view/theme/frio/templates/settings_oauth.tpl @@ -0,0 +1,44 @@ +
+ {{* include the title template for the settings title *}} + {{include file="section_title.tpl" title=$title }} + + +
+ + + + + {{foreach $apps as $app}} +
+ + {{if $app.name}}

{{$app.name}}

{{else}}

{{$noname}}

{{/if}} + {{if $app.my}} + {{if $app.oauth_token}} +
+ {{/if}} + {{/if}} + {{if $app.my}} +   + + {{/if}} +
+ {{/foreach}} + +
+
diff --git a/view/theme/frio/templates/settings_oauth_edit.tpl b/view/theme/frio/templates/settings_oauth_edit.tpl new file mode 100644 index 000000000..91dfa0455 --- /dev/null +++ b/view/theme/frio/templates/settings_oauth_edit.tpl @@ -0,0 +1,18 @@ + +

{{$title}}

+ +
+ + + {{include file="field_input.tpl" field=$name}} + {{include file="field_input.tpl" field=$key}} + {{include file="field_input.tpl" field=$secret}} + {{include file="field_input.tpl" field=$redirect}} + {{include file="field_input.tpl" field=$icon}} + +
+ +
+
+ +
diff --git a/view/theme/frio/templates/theme_settings.tpl b/view/theme/frio/templates/theme_settings.tpl index ebedfcfb5..aa0b6ca56 100644 --- a/view/theme/frio/templates/theme_settings.tpl +++ b/view/theme/frio/templates/theme_settings.tpl @@ -63,8 +63,8 @@ }); -
- +
+
diff --git a/view/theme/frio/templates/vcard-widget.tpl b/view/theme/frio/templates/vcard-widget.tpl index e5aebecc8..472dced2b 100644 --- a/view/theme/frio/templates/vcard-widget.tpl +++ b/view/theme/frio/templates/vcard-widget.tpl @@ -6,6 +6,20 @@
{{$name}}
{{/if}} + {{* The short information which will appended to the second navbar by scrollspy *}} + +
{{$name}}
{{if $addr}}
{{$addr}}
{{/if}} diff --git a/view/theme/frio/theme.php b/view/theme/frio/theme.php index a7c3b0c5d..bab2d696a 100644 --- a/view/theme/frio/theme.php +++ b/view/theme/frio/theme.php @@ -1,8 +1,8 @@ ReadMe and GitHub. - * Version: V.0.1 Alpha + * Description: Bootstrap V3 theme. The theme is currently under construction, so it is far from finished. For further information have a look at the ReadMe. + * Version: V.0.2 Alpha * Author: Rabuzarus * */ diff --git a/view/theme/frost-mobile/templates/profile_edit.tpl b/view/theme/frost-mobile/templates/profile_edit.tpl index 2855e8fb1..8d7407b09 100644 --- a/view/theme/frost-mobile/templates/profile_edit.tpl +++ b/view/theme/frost-mobile/templates/profile_edit.tpl @@ -21,20 +21,20 @@
- -
*
+ +
*
- - + +
- - + +
@@ -46,10 +46,7 @@
- -
-{{$dob}} {{$age}} -
+{{$dob}}
@@ -62,45 +59,45 @@
- - + +
- - + +
- - + +
- - +
- +
- - + +
@@ -113,10 +110,10 @@ {{$marital}}
- - - - + + + +
@@ -129,33 +126,33 @@
- - + +
- - + +
- - + +
- - -
{{$lbl_pubdsc}}
+ + +
{{$pub_keywords.3}}
- - -
{{$lbl_prvdsc}}
+ + +
{{$prv_keywords.3}}
@@ -166,10 +163,10 @@

-{{$lbl_about}} +{{$about.1}}

- +
@@ -177,10 +174,10 @@

-{{$lbl_hobbies}} +{{$interest.1}}

- +
@@ -188,10 +185,10 @@

-{{$lbl_likes}} +{{$likes.1}}

- +
@@ -199,10 +196,10 @@

-{{$lbl_dislikes}} +{{$dislikes.1}}

- +
@@ -210,10 +207,10 @@

-{{$lbl_social}} +{{$contact.1}}

- +
@@ -227,20 +224,20 @@

-{{$lbl_music}} +{{$music.1}}

- +

-{{$lbl_book}} +{{$book.1}}

- +
@@ -249,10 +246,10 @@

-{{$lbl_tv}} +{{$tv.1}}

- +
@@ -261,10 +258,10 @@

-{{$lbl_film}} +{{$film.1}}

- +
@@ -278,10 +275,10 @@

-{{$lbl_love}} +{{$romance.1}}

- +
@@ -290,10 +287,10 @@

-{{$lbl_work}} +{{$work.1}}

- +
@@ -302,10 +299,10 @@

-{{$lbl_school}} +{{$education.1}}

- +
diff --git a/view/theme/frost/templates/profile_edit.tpl b/view/theme/frost/templates/profile_edit.tpl index a7c57c99a..40a3c86a2 100644 --- a/view/theme/frost/templates/profile_edit.tpl +++ b/view/theme/frost/templates/profile_edit.tpl @@ -21,20 +21,20 @@
- -
*
+ +
*
- - + +
- - + +
@@ -46,10 +46,7 @@
- -
-{{$dob}} {{$age}} -
+{{$dob}}
@@ -62,45 +59,45 @@
- - + +
- - + +
- - + +
- - +
- +
- - + +
@@ -113,10 +110,10 @@ {{$marital}}
- - - - + + + +
@@ -129,33 +126,33 @@
- - + +
- - + +
- - + +
- - -
{{$lbl_pubdsc}}
+ + +
{{$pub_keywords.3}}
- - -
{{$lbl_prvdsc}}
+ + +
{{$prv_keywords.3}}
@@ -166,10 +163,10 @@

-{{$lbl_about}} +{{$about.1}}

- +
@@ -177,10 +174,10 @@

-{{$lbl_hobbies}} +{{$interest.1}}

- +
@@ -188,10 +185,10 @@

-{{$lbl_likes}} +{{$likes.1}}

- +
@@ -199,10 +196,10 @@

-{{$lbl_dislikes}} +{{$dislikes.1}}

- +
@@ -210,10 +207,10 @@

-{{$lbl_social}} +{{$contact.1}}

- +
@@ -227,20 +224,20 @@

-{{$lbl_music}} +{{$music.1}}

- +

-{{$lbl_book}} +{{$book.1}}

- +
@@ -249,10 +246,10 @@

-{{$lbl_tv}} +{{$tv.1}}

- +
@@ -261,10 +258,10 @@

-{{$lbl_film}} +{{$film.1}}

- +
@@ -278,10 +275,10 @@

-{{$lbl_love}} +{{$romance.1}}

- +
@@ -290,10 +287,10 @@

-{{$lbl_work}} +{{$work.1}}

- +
@@ -302,10 +299,10 @@

-{{$lbl_school}} +{{$education.1}}

- +
diff --git a/view/theme/vier/templates/profile_edit.tpl b/view/theme/vier/templates/profile_edit.tpl index 927041056..fa2cd1857 100644 --- a/view/theme/vier/templates/profile_edit.tpl +++ b/view/theme/vier/templates/profile_edit.tpl @@ -29,7 +29,7 @@
- + {{if $detailled_profile}} @@ -67,17 +67,17 @@ {{if $multi_profiles}}
- -
*
+ +
*
{{else}} - + {{/if}}
- - + +
@@ -88,51 +88,48 @@
- - + +
- - + +
- -
- {{$dob}} {{$age}} -
+ {{$dob}}
{{$hide_friends}}
-
{{$lbl_about}}
- +
{{$about.1}}
+
-
{{$lbl_social}}
- +
{{$contact.1}}
+
- - + +
-
{{$lbl_pubdsc}}
+
{{$pub_keywords.3}}
- - + +
-
{{$lbl_prvdsc}}
+
{{$prv_keywords.3}}
@@ -151,42 +148,42 @@
{{$lbl_location_section}}
- - + +
- - + +
- - + +
- - +
- +
- - + +
@@ -201,26 +198,26 @@
- - + +
- - + +
-
{{$lbl_likes}}
- +
{{$likes.1}}
+
-
{{$lbl_dislikes}}
- +
{{$dislikes.1}}
+
@@ -241,27 +238,27 @@ {{$marital}}
- - - - + + + +
-
{{$lbl_love}}
- +
{{$romance.1}}
+
-
{{$lbl_work}}
- +
{{$work.1}}
+
-
{{$lbl_school}}
- +
{{$education.1}}
+
@@ -279,32 +276,32 @@
{{$pub_keywords.3}}
- - -
{{$lbl_prvdsc}}
+ + +
{{$prv_keywords.3}}

-{{$lbl_about}} +{{$about.1}}

- +
@@ -419,26 +413,26 @@
- - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + {{/if}} - +