-server_ip = "192.168.22.10"
-server_memory = "384" # MB
-server_timezone = "UTC"
+server_ip = "192.168.22.10"
+server_memory = "384" # MB
+server_timezone = "UTC"
-public_folder = "/vagrant"
+public_folder = "/vagrant"
-Vagrant.configure("2") do |config|
+Vagrant.configure(2) do |config|
- # Set server to Ubuntu 12.04
- config.vm.box = "precise64"
+ # Set server to Ubuntu 14.04
+ config.vm.box = "ubuntu/trusty64"
- config.vm.box_url = "http://files.vagrantup.com/precise64.box"
+ # Disable automatic box update checking. If you disable this, then
+ # boxes will only be checked for updates when the user runs
+ # `vagrant box outdated`. This is not recommended.
+ # config.vm.box_check_update = false
# Create a hostname, don't forget to put it to the `hosts` file
# This will point to the server's default virtual host
# Create a static IP
config.vm.network :private_network, ip: server_ip
- # If using VirtualBox
- config.vm.provider :virtualbox do |vb|
-
- # Set server memory
- vb.customize ["modifyvm", :id, "--memory", server_memory]
-
- # Set the timesync threshold to 10 seconds, instead of the default 20 minutes.
- # If the clock gets more than 15 minutes out of sync (due to your laptop going
- # to sleep for instance, then some 3rd party services will reject requests.
- vb.customize ["guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold", 10000]
-
- # Prevent VMs running on Ubuntu to lose internet connection
- vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
- vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
-
+ # Share a folder between host and guest
+ config.vm.synced_folder "./", "/vagrant/", owner: "www-data", group: "vagrant"
+
+ # Provider-specific configuration so you can fine-tune various
+ # backing providers for Vagrant. These expose provider-specific options.
+ config.vm.provider "virtualbox" do |vb|
+ # # Display the VirtualBox GUI when booting the machine
+ # vb.gui = true
+ #
+ # # Customize the amount of memory on the VM:
+ vb.memory = server_memory
end
- # If using VMWare Fusion
- config.vm.provider "vmware_fusion" do |vb, override|
- override.vm.box_url = "http://files.vagrantup.com/precise64_vmware.box"
-
- # Set server memory
- vb.vmx["memsize"] = server_memory
-
- end
-
-
- ####
- # Local Scripts
- # Any local scripts you may want to run post-provisioning.
- # Add these to the same directory as the Vagrantfile.
- ##########
-
- config.vm.synced_folder "./", "/vagrant/", :owner=> 'www-data', :group=>'vagrant', :mount_options => ['dmode=775', 'fmode=775']
- config.vm.provision "shell", path: "./util/vagrant_provision.sh"
-
+ # Enable provisioning with a shell script.
+ config.vm.provision "shell", path: "./util/vagrant_provision.sh"
+ # run: "always"
+ # run: "once"
end
define ( 'FRIENDICA_CODENAME', 'Lily of the valley');
define ( 'FRIENDICA_VERSION', '3.4.3-dev' );
define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
-define ( 'DB_UPDATE_VERSION', 1189 );
+define ( 'DB_UPDATE_VERSION', 1190 );
define ( 'EOL', "<br />\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
-- ------------------------------------------
--- Friendica 3.4.1 (Lily of the valley)
--- DB_UPDATE_VERSION 1189
+-- Friendica 3.4.2 (Lily of the valley)
+-- DB_UPDATE_VERSION 1190
-- ------------------------------------------
`gender` varchar(32) NOT NULL DEFAULT '',
`community` tinyint(1) NOT NULL DEFAULT 0,
`network` varchar(255) NOT NULL DEFAULT '',
+ `addr` varchar(255) NOT NULL DEFAULT '',
`generation` tinyint(3) NOT NULL DEFAULT 0,
`server_url` varchar(255) NOT NULL DEFAULT '',
INDEX `nurl` (`nurl`),
Please see the sample addon 'randplace' for a working example of using some of these features.
Addons work by intercepting event hooks - which must be registered.
-Modules work by intercepting specific page requests (by URL path).
+Modules work by intercepting specific page requests (by URL path).
Plugin names cannot contain spaces or other punctuation and are used as filenames and function names.
You may supply a "friendly" name within the comment block.
These two functions take no arguments and are usually responsible for registering (and unregistering) event hooks that your plugin will require.
The install and uninstall functions will also be called (i.e. re-installed) if the plugin changes after installation.
Therefore your uninstall should not destroy data and install should consider that data may already exist.
-Future extensions may provide for "setup" amd "remove".
+Future extensions may provide for "setup" amd "remove".
-Plugins should contain a comment block with the four following parameters:
+Plugins should contain a comment block with the four following parameters:
/*
- * Name: My Great Plugin
+ * Name: My Great Plugin
* Description: This is what my plugin does. It's really cool
* Version: 1.0
* Author: John Q. Public <john@myfriendicasite.com>
* which module has been called,
* configuration information,
* the page contents at the point the hook was invoked,
-* profile and user information, etc.
+* profile and user information, etc.
It is recommeded you call this '$a' to match its usage elsewhere.
Your module functions will often contain the function plugin_name_content(&$a), which defines and returns the page body content.
They may also contain plugin_name_post(&$a) which is called before the _content function and typically handles the results of POST forms.
-You may also have plugin_name_init(&$a) which is called very early on and often does module initialisation.
+You may also have plugin_name_init(&$a) which is called very early on and often does module initialisation.
Templates
----------
In your code, like in the function plugin_name_content(), load the template file and execute it passing needed values:
- # load template file. first argument is the template name,
+ # load template file. first argument is the template name,
# second is the plugin path relative to friendica top folder
$tpl = get_markup_template('mytemplate.tpl', 'addon/plugin_name/');
- # apply template. first argument is the loaded template,
+ # apply template. first argument is the loaded template,
# second an array of 'name'=>'values' to pass to template
$output = replace_macros($tpl,array(
'title' => 'My beautiful plugin',
is called after the navigational menu is build in include/nav.php.
$b is an array containing $nav from nav.php.
+###'template_vars'
+is called before vars are passed to the template engine to render the page.
+The registered function can add,change or remove variables passed to template.
+$b is an array with:
+
+ 'template' => filename of template
+ 'vars' => array of vars passed to template
+
+
+
Complete list of hook callbacks
---
include/text.php: call_hooks('smilie', $s);
-include/text.php: call_hooks('prepare_body_init', $item);
+include/text.php: call_hooks('prepare_body_init', $item);
include/text.php: call_hooks('prepare_body', $prep_arr);
include/bbcode.php: call_hooks('bbcode',$Text);
-include/oauth.php: call_hooks('logged_in', $a->user);
+include/oauth.php: call_hooks('logged_in', $a->user);
include/acl_selectors.php: call_hooks($a->module . '_pre_' . $selname, $arr);
mod/photos.php: call_hooks('photo_upload_form',$ret);
-mod/friendica.php: call_hooks('about_hook', $o);
+mod/friendica.php: call_hooks('about_hook', $o);
mod/editpost.php: call_hooks('jot_tool', $jotplugins);
This configures the URL to update the global directory, and is supplied in the default configuration.
The undocumented part is that if this is not set, the global directory is completely unavailable to the application.
-This allows a private community to be completely isolated from the global mistpark network.
+This allows a private community to be completely isolated from the global network.
$a->config['system']['directory'] = 'http://dir.friendi.ca';
[Vagrant](https://www.vagrantup.com/) is a virtualization solution for developers.
No need to setup up a webserver, database etc. before actually starting.
-Vagrant creates a virtual machine (an Ubuntu 12.04) for you that you can just run inside VirtualBox and start to work directly on Friendica.
+Vagrant creates a virtual machine (an Ubuntu 14.04) for you that you can just run inside VirtualBox and start to work directly on Friendica.
+
What you need to do:
1. Install VirtualBox and vagrant.
+Please use an up-to-date vagrant version from https://www.vagrantup.com/downloads.html.
2. Git clone your Friendica repository.
Inside, you'll find a "Vagrantfile" and some scripts in the utils folder.
3. Run "vagrant up" from inside the friendica clone.
5. Open 192.168.22.10 in a browser.
The mysql database is called "friendica", the mysql user and password both are "root".
6. Work on Friendica's code in your git clone on your machine (not in the VM).
+Your local working directory is set up as a shared directory with the VM (/vagrant).
7. Check the changes in your browser in the VM.
Debug via the "vagrant ssh" login.
+Find the Friendica log file /vagrant/logfile.out.
8. Commit and push your changes directly back to Github.
If you want to stop vagrant after finishing your work, run the following command
* friendica2 and friendica3 are conntected. friendica4 and friendica5 are connected.
For further documentation of vagrant, please see [the vagrant*docs*](https://docs.vagrantup.com/v2/).
+
+**Important notice:**
+If you already had an Ubuntu 12.04 Vagrant VM, please run
+
+ $> vagrant destroy
+
+before starting the new 14.04 machine.
if ($uid == -1)
$uid = local_user();
- $r = q("SELECT `url`, `name`, `nick`, `photo`, `location`, `about`, `keywords`, `gender`, `community`, `network` FROM `gcontact` WHERE `nurl` = '%s' LIMIT 1",
+ $r = q("SELECT `id` AS `gid`, `url`, `name`, `nick`, `addr`, `photo`, `location`, `about`, `keywords`, `gender`, `community`, `network` FROM `gcontact` WHERE `nurl` = '%s' LIMIT 1",
dbesc(normalise_link($url)));
- if ($r)
+ if ($r) {
$profile = $r[0];
- else {
+
+ if ((($profile["addr"] == "") OR ($profile["name"] == "")) AND
+ in_array($profile["network"], array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS)))
+ proc_run('php',"include/update_gcontact.php", $profile["gid"]);
+
+ } else {
$r = q("SELECT `url`, `name`, `nick`, `avatar` AS `photo`, `location`, `about` FROM `unique_contacts` WHERE `url` = '%s'",
dbesc(normalise_link($url)));
$profile["gender"] = "";
$profile["community"] = false;
$profile["network"] = "";
+ $profile["addr"] = "";
}
}
// Fetching further contact data from the contact table
- $r = q("SELECT `id`, `uid`, `url`, `network`, `name`, `nick`, `location`, `about`, `keywords`, `gender`, `photo`, `addr`, `forum`, `prv`, `bd` FROM `contact` WHERE `nurl` = '%s' AND `uid` = %d AND `network` = '%s'",
+ $r = q("SELECT `id`, `uid`, `url`, `network`, `name`, `nick`, `addr`, `location`, `about`, `keywords`, `gender`, `photo`, `addr`, `forum`, `prv`, `bd` FROM `contact` WHERE `nurl` = '%s' AND `uid` = %d AND `network` = '%s'",
dbesc(normalise_link($url)), intval($uid), dbesc($profile["network"]));
if (!count($r))
- $r = q("SELECT `id`, `uid`, `url`, `network`, `name`, `nick`, `location`, `about`, `keywords`, `gender`, `photo`, `addr`, `forum`, `prv`, `bd` FROM `contact` WHERE `nurl` = '%s' AND `uid` = %d",
+ $r = q("SELECT `id`, `uid`, `url`, `network`, `name`, `nick`, `addr`, `location`, `about`, `keywords`, `gender`, `photo`, `addr`, `forum`, `prv`, `bd` FROM `contact` WHERE `nurl` = '%s' AND `uid` = %d",
dbesc(normalise_link($url)), intval($uid));
if (!count($r))
- $r = q("SELECT `id`, `uid`, `url`, `network`, `name`, `nick`, `location`, `about`, `keywords`, `gender`, `photo`, `addr`, `forum`, `prv`, `bd` FROM `contact` WHERE `nurl` = '%s' AND `uid` = 0",
+ $r = q("SELECT `id`, `uid`, `url`, `network`, `name`, `nick`, `addr`, `location`, `about`, `keywords`, `gender`, `photo`, `addr`, `forum`, `prv`, `bd` FROM `contact` WHERE `nurl` = '%s' AND `uid` = 0",
dbesc(normalise_link($url)));
if ($r) {
$profile["name"] = $r[0]["name"];
if (isset($r[0]["nick"]) AND $r[0]["nick"] AND ($profile["nick"] == ""))
$profile["nick"] = $r[0]["nick"];
+ if (isset($r[0]["addr"]) AND $r[0]["addr"] AND ($profile["addr"] == ""))
+ $profile["addr"] = $r[0]["addr"];
if (isset($r[0]["photo"]) AND $r[0]["photo"])
$profile["photo"] = $r[0]["photo"];
if (isset($r[0]["location"]) AND $r[0]["location"])
$profile["keywords"] = $r[0]["keywords"];
if (isset($r[0]["gender"]) AND $r[0]["gender"])
$profile["gender"] = $r[0]["gender"];
- if (isset($r[0]["forum"]) AND isset($r[0]["prv"]))
+ if (isset($r[0]["forum"]) OR isset($r[0]["prv"]))
$profile["community"] = ($r[0]["forum"] OR $r[0]["prv"]);
if (isset($r[0]["network"]) AND $r[0]["network"])
$profile["network"] = $r[0]["network"];
* PROBE_DIASPORA has a bias towards returning Diaspora information
* while PROBE_NORMAL has a bias towards dfrn/zot - in the case where
* an address (such as a Friendica address) supports more than one type
- * of network.
+ * of network.
*
*/
$pubkey = $diaspora_key;
$diaspora = true;
}
- if($link['@attributes']['rel'] === 'http://ostatus.org/schema/1.0/subscribe') {
+ if(($link['@attributes']['rel'] === 'http://ostatus.org/schema/1.0/subscribe') AND ($mode == PROBE_NORMAL)) {
$diaspora = false;
}
}
$baseurl = rtrim($baseurl, "/");
+ if(strpos($url,'@') AND ($addr == "") AND ($network == NETWORK_DFRN))
+ $addr = str_replace('acct:', '', $url);
+
$vcard['fn'] = notags($vcard['fn']);
$vcard['nick'] = str_replace(' ','',notags($vcard['nick']));
$author = q("SELECT id FROM unique_contacts WHERE url='%s' LIMIT 1",
dbesc(normalise_link($item['author-link'])));
} else if ($item["author-link"].$item["author-name"] != $author[0]["url"].$author[0]["name"]) {
- q("UPDATE unique_contacts SET name = '%s', avatar = '%s' WHERE url = '%s'",
- dbesc($item["author-name"]), dbesc($item["author-avatar"]), dbesc(normalise_link($item["author-link"])));
+ q("UPDATE unique_contacts SET name = '%s', avatar = '%s' WHERE (`name` != '%s' OR `avatar` != '%s') AND url = '%s'",
+ dbesc($item["author-name"]), dbesc($item["author-avatar"]),
+ dbesc($item["author-name"]), dbesc($item["author-avatar"]),
+ dbesc(normalise_link($item["author-link"])));
}
$owner = q("SELECT id FROM unique_contacts WHERE url='%s' LIMIT 1",
$owner = q("SELECT id FROM unique_contacts WHERE url='%s' LIMIT 1",
dbesc(normalise_link($item['owner-link'])));
} else if ($item["owner-link"].$item["owner-name"] != $owner[0]["url"].$owner[0]["name"]) {
- q("UPDATE unique_contacts SET name = '%s', avatar = '%s' WHERE url = '%s'",
- dbesc($item["owner-name"]), dbesc($item["owner-avatar"]), dbesc(normalise_link($item["owner-link"])));
+ q("UPDATE unique_contacts SET name = '%s', avatar = '%s' WHERE (`name` != '%s' OR `avatar` != '%s') AND url = '%s'",
+ dbesc($item["owner-name"]), dbesc($item["owner-avatar"]),
+ dbesc($item["owner-name"]), dbesc($item["owner-avatar"]),
+ dbesc(normalise_link($item["owner-link"])));
}
// Comments in threads may appear as wall-to-wall postings.
logger('api_status_show: user_info: '.print_r($user_info, true), LOGGER_DEBUG);
+ if ($type == "raw")
+ $privacy_sql = "AND `item`.`allow_cid`='' AND `item`.`allow_gid`='' AND `item`.`deny_cid`='' AND `item`.`deny_gid`=''";
+ else
+ $privacy_sql = "";
+
// get last public wall message
$lastwall = q("SELECT `item`.*, `i`.`contact-id` as `reply_uid`, `i`.`author-link` AS `item-author`
FROM `item`, `item` as `i`
WHERE `item`.`contact-id` = %d AND `item`.`uid` = %d
AND ((`item`.`author-link` IN ('%s', '%s')) OR (`item`.`owner-link` IN ('%s', '%s')))
AND `i`.`id` = `item`.`parent`
- AND `item`.`type`!='activity'
- AND `item`.`allow_cid`='' AND `item`.`allow_gid`='' AND `item`.`deny_cid`='' AND `item`.`deny_gid`=''
+ AND `item`.`type`!='activity' $privacy_sql
ORDER BY `item`.`created` DESC
LIMIT 1",
intval($user_info['cid']),
$in_reply_to_screen_name = NULL;
}
- $converted = api_convert_item($item);
+ $converted = api_convert_item($lastwall);
$status_info = array(
'created_at' => api_date($lastwall['created']),
unset($status_info["user"]["self"]);
}
+ logger('status_info: '.print_r($status_info, true), LOGGER_DEBUG);
+
if ($type == "raw")
return($status_info);
}
}
- $converted = api_convert_item($item);
+ $converted = api_convert_item($lastwall);
$user_info['status'] = array(
'text' => $converted["text"],
//}
if ($nick != "") {
- q("UPDATE unique_contacts SET nick = '%s' WHERE url = '%s'",
- dbesc($nick), dbesc(normalise_link($profile)));
+ q("UPDATE unique_contacts SET nick = '%s' WHERE `nick` != '%s' AND url = '%s'",
+ dbesc($nick), dbesc($nick), dbesc(normalise_link($profile)));
return($nick);
}
"gender" => array("type" => "varchar(32)", "not null" => "1", "default" => ""),
"community" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"),
"network" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
+ "addr" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
"generation" => array("type" => "tinyint(3)", "not null" => "1", "default" => "0"),
"server_url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""),
),
require_once "object/TemplateEngine.php";
require_once("library/Smarty/libs/Smarty.class.php");
+require_once "include/plugin.php";
define('SMARTY3_TEMPLATE_FOLDER','templates');
}
return $this->fetch('file:' . $this->filename);
}
-
+
}
class FriendicaSmartyEngine implements ITemplateEngine {
static $name ="smarty3";
-
+
public function __construct(){
if(!is_writable('view/smarty3/')){
echo "<b>ERROR:</b> folder <tt>view/smarty3/</tt> must be writable by webserver."; killme();
}
- }
-
+ }
+
// ITemplateEngine interface
public function replace_macros($s, $r) {
$template = '';
$template = $s;
$s = new FriendicaSmarty();
}
+
+ // "middleware": inject variables into templates
+ $arr = array(
+ "template"=> basename($s->filename),
+ "vars" => $r
+ );
+ call_hooks("template_vars", $arr);
+ $r = $arr['vars'];
+
foreach($r as $key=>$value) {
if($key[0] === '$') {
$key = substr($key, 1);
}
$s->assign($key, $value);
}
- return $s->parsed($template);
+ return $s->parsed($template);
}
-
+
public function get_template_file($file, $root=''){
$a = get_app();
$template_file = get_template_file($a, SMARTY3_TEMPLATE_FOLDER.'/'.$file, $root);
if(x($opts,'nobody')){
@curl_setopt($ch, CURLOPT_NOBODY, $opts['nobody']);
}
- if(intval($timeout)) {
- @curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
- }
- else {
+ if(x($opts,'timeout')){
+ @curl_setopt($ch, CURLOPT_TIMEOUT, $opts['timeout']);
+ } else {
$curl_time = intval(get_config('system','curl_timeout'));
@curl_setopt($ch, CURLOPT_TIMEOUT, (($curl_time !== false) ? $curl_time : 60));
}
}
if(is_null($db)) {
- @include(".htconfig.php");
- require_once("include/dba.php");
- $db = new dba($db_host, $db_user, $db_pass, $db_data);
- unset($db_host, $db_user, $db_pass, $db_data);
+ @include(".htconfig.php");
+ require_once("include/dba.php");
+ $db = new dba($db_host, $db_user, $db_pass, $db_data);
+ unset($db_host, $db_user, $db_pass, $db_data);
};
}
if (array_search(__file__,get_included_files())===0){
- onepoll_run($_SERVER["argv"],$_SERVER["argc"]);
- killme();
+ onepoll_run($_SERVER["argv"],$_SERVER["argc"]);
+ killme();
}
$created = $x[0]["created"];
$server_url = $x[0]["server_url"];
$nick = $x[0]["nick"];
+ $addr = $x[0]["addr"];
} else {
$created = "0000-00-00 00:00:00";
$server_url = "";
$urlparts = parse_url($profile_url);
$nick = end(explode("/", $urlparts["path"]));
+ $addr = "";
}
- if ((($network == "") OR ($name == "") OR ($profile_photo == "") OR ($server_url == "") OR $alternate)
+ if ((($network == "") OR ($name == "") OR ($addr == "") OR ($profile_photo == "") OR ($server_url == "") OR $alternate)
AND poco_reachable($profile_url, $server_url, $network, false)) {
$data = probe_url($profile_url);
$network = $data["network"];
$name = $data["name"];
$nick = $data["nick"];
+ $addr = $data["addr"];
$profile_url = $data["url"];
$profile_photo = $data["photo"];
$server_url = $data["baseurl"];
if (($keywords == "") AND ($x[0]['keywords'] != ""))
$keywords = $x[0]['keywords'];
+ if (($addr == "") AND ($x[0]['addr'] != ""))
+ $addr = $x[0]['addr'];
+
if (($generation == 0) AND ($x[0]['generation'] > 0))
$generation = $x[0]['generation'];
if($x[0]['name'] != $name || $x[0]['photo'] != $profile_photo || $x[0]['updated'] < $updated) {
- q("UPDATE `gcontact` SET `name` = '%s', `network` = '%s', `photo` = '%s', `connect` = '%s', `url` = '%s', `server_url` = '%s',
+ q("UPDATE `gcontact` SET `name` = '%s', `addr` = '%s', `network` = '%s', `photo` = '%s', `connect` = '%s', `url` = '%s', `server_url` = '%s',
`updated` = '%s', `location` = '%s', `about` = '%s', `keywords` = '%s', `gender` = '%s', `generation` = %d
WHERE (`generation` >= %d OR `generation` = 0) AND `nurl` = '%s'",
dbesc($name),
+ dbesc($addr),
dbesc($network),
dbesc($profile_photo),
dbesc($connect_url),
);
}
} else {
- q("INSERT INTO `gcontact` (`name`, `nick`, `network`, `url`, `nurl`, `photo`, `connect`, `server_url`, `created`, `updated`, `location`, `about`, `keywords`, `gender`, `generation`)
- VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d)",
+ q("INSERT INTO `gcontact` (`name`, `nick`, `addr`, `network`, `url`, `nurl`, `photo`, `connect`, `server_url`, `created`, `updated`, `location`, `about`, `keywords`, `gender`, `generation`)
+ VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d)",
dbesc($name),
dbesc($nick),
+ dbesc($addr),
dbesc($network),
dbesc($profile_url),
dbesc(normalise_link($profile_url)),
$r = q("SELECT count(*) as `total`
FROM `glink` INNER JOIN `gcontact` on `glink`.`gcid` = `gcontact`.`id`
- where `glink`.`cid` = %d and `glink`.`uid` = %d
- and `gcontact`.`nurl` in (select nurl from contact where uid = %d and self = 0 and blocked = 0 and hidden = 0 and id != %d ) ",
+ WHERE `glink`.`cid` = %d AND `glink`.`uid` = %d AND
+ ((`gcontact`.`last_contact` >= `gcontact`.`last_failure`) OR (`gcontact`.`updated` >= `gcontact`.`last_failure`))
+ AND `gcontact`.`nurl` IN (select nurl from contact where uid = %d and self = 0 and blocked = 0 and hidden = 0 and id != %d ) ",
intval($cid),
intval($uid),
intval($uid),
intval($cid)
);
-// logger("count_common_friends: $uid $cid {$r[0]['total']}");
+// logger("count_common_friends: $uid $cid {$r[0]['total']}");
if(count($r))
return $r[0]['total'];
return 0;
else
$sql_extra = " order by `gcontact`.`name` asc ";
- $r = q("SELECT `gcontact`.*
- FROM `glink` INNER JOIN `gcontact` on `glink`.`gcid` = `gcontact`.`id`
- where `glink`.`cid` = %d and `glink`.`uid` = %d
- and `gcontact`.`nurl` in (select nurl from contact where uid = %d and self = 0 and blocked = 0 and hidden = 0 and id != %d )
- $sql_extra limit %d, %d",
+ $r = q("SELECT `gcontact`.*, `contact`.`id` AS `cid`
+ FROM `glink`
+ INNER JOIN `gcontact` ON `glink`.`gcid` = `gcontact`.`id`
+ INNER JOIN `contact` ON `gcontact`.`nurl` = `contact`.`nurl`
+ WHERE `glink`.`cid` = %d and `glink`.`uid` = %d
+ AND `contact`.`uid` = %d AND `contact`.`self` = 0 AND `contact`.`blocked` = 0
+ AND `contact`.`hidden` = 0 AND `contact`.`id` != %d
+ AND ((`gcontact`.`last_contact` >= `gcontact`.`last_failure`) OR (`gcontact`.`updated` >= `gcontact`.`last_failure`))
+ $sql_extra LIMIT %d, %d",
intval($cid),
intval($uid),
intval($uid),
$r = q("SELECT count(*) as `total`
FROM `glink` INNER JOIN `gcontact` on `glink`.`gcid` = `gcontact`.`id`
- where `glink`.`cid` = %d and `glink`.`uid` = %d ",
+ where `glink`.`cid` = %d and `glink`.`uid` = %d AND
+ ((`gcontact`.`last_contact` >= `gcontact`.`last_failure`) OR (`gcontact`.`updated` >= `gcontact`.`last_failure`))",
intval($cid),
intval($uid)
);
function all_friends($uid,$cid,$start = 0, $limit = 80) {
- $r = q("SELECT `gcontact`.*
- FROM `glink` INNER JOIN `gcontact` on `glink`.`gcid` = `gcontact`.`id`
- where `glink`.`cid` = %d and `glink`.`uid` = %d
- order by `gcontact`.`name` asc LIMIT %d, %d ",
+ $r = q("SELECT `gcontact`.*, `contact`.`id` AS `cid`
+ FROM `glink`
+ INNER JOIN `gcontact` on `glink`.`gcid` = `gcontact`.`id`
+ LEFT JOIN `contact` ON `contact`.`nurl` = `gcontact`.`nurl` AND `contact`.`uid` = %d
+ WHERE `glink`.`cid` = %d AND `glink`.`uid` = %d AND
+ ((`gcontact`.`last_contact` >= `gcontact`.`last_failure`) OR (`gcontact`.`updated` >= `gcontact`.`last_failure`))
+ ORDER BY `gcontact`.`name` ASC LIMIT %d, %d ",
+ intval($uid),
intval($cid),
intval($uid),
intval($start),
if($x) {
$s = preg_replace('/\<div class\=\"map\"\>/','$0' . $x,$s);
}
- }
+ }
// Look for spoiler
return implode("\n", $lines);
}
-function formatBytes($bytes, $precision = 2) {
- $units = array('B', 'KB', 'MB', 'GB', 'TB');
+function formatBytes($bytes, $precision = 2) {
+ $units = array('B', 'KB', 'MB', 'GB', 'TB');
- $bytes = max($bytes, 0);
- $pow = floor(($bytes ? log($bytes) : 0) / log(1024));
- $pow = min($pow, count($units) - 1);
+ $bytes = max($bytes, 0);
+ $pow = floor(($bytes ? log($bytes) : 0) / log(1024));
+ $pow = min($pow, count($units) - 1);
$bytes /= pow(1024, $pow);
- return round($bytes, $precision) . ' ' . $units[$pow];
-}
+ return round($bytes, $precision) . ' ' . $units[$pow];
+}
--- /dev/null
+<?php
+
+require_once("boot.php");
+
+function update_gcontact_run(&$argv, &$argc){
+ global $a, $db;
+
+ if(is_null($a)) {
+ $a = new App;
+ }
+
+ if(is_null($db)) {
+ @include(".htconfig.php");
+ require_once("include/dba.php");
+ $db = new dba($db_host, $db_user, $db_pass, $db_data);
+ unset($db_host, $db_user, $db_pass, $db_data);
+ };
+
+ require_once('include/pidfile.php');
+ require_once('include/Scrape.php');
+ require_once("include/socgraph.php");
+
+ load_config('config');
+ load_config('system');
+
+ $a->set_baseurl(get_config('system','url'));
+
+ load_hooks();
+
+ logger('update_gcontact: start');
+
+ if(($argc > 1) && (intval($argv[1])))
+ $contact_id = intval($argv[1]);
+
+ if(!$contact_id) {
+ logger('update_gcontact: no contact');
+ return;
+ }
+
+ $lockpath = get_lockpath();
+ if ($lockpath != '') {
+ $pidfile = new pidfile($lockpath, 'update_gcontact'.$contact_id);
+ if ($pidfile->is_already_running()) {
+ logger("update_gcontact: Already running for contact ".$contact_id);
+ if ($pidfile->running_time() > 9*60) {
+ $pidfile->kill();
+ logger("killed stale process");
+ }
+ exit;
+ }
+ }
+
+ $r = q("SELECT * FROM `gcontact` WHERE `id` = %d", intval($contact_id));
+
+ if (!$r)
+ return;
+
+ if (!in_array($r[0]["network"], array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS)))
+ return;
+
+ $data = probe_url($r[0]["url"]);
+
+ if (!in_array($data["network"], array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS))) {
+ if ($r[0]["server_url"] != "")
+ poco_check_server($r[0]["server_url"], $r[0]["network"]);
+
+ q("UPDATE `gcontact` SET `last_failure` = '%s' WHERE `id` = %d",
+ dbesc(datetime_convert()), intval($contact_id));
+ return;
+ }
+
+ if (($data["name"] == "") AND ($r[0]['name'] != ""))
+ $data["name"] = $r[0]['name'];
+
+ if (($data["nick"] == "") AND ($r[0]['nick'] != ""))
+ $data["nick"] = $r[0]['nick'];
+
+ if (($data["addr"] == "") AND ($r[0]['addr'] != ""))
+ $data["addr"] = $r[0]['addr'];
+
+ if (($data["photo"] == "") AND ($r[0]['photo'] != ""))
+ $data["photo"] = $r[0]['photo'];
+
+
+ q("UPDATE `gcontact` SET `name` = '%s', `nick` = '%s', `addr` = '%s', `photo` = '%s'
+ WHERE `id` = %d",
+ dbesc($data["name"]),
+ dbesc($data["nick"]),
+ dbesc($data["addr"]),
+ dbesc($data["photo"]),
+ intval($contact_id)
+ );
+
+ q("UPDATE `contact` SET `name` = '%s', `nick` = '%s', `addr` = '%s', `photo` = '%s'
+ WHERE `uid` = 0 AND `addr` = '' AND `nurl` = '%s'",
+ dbesc($data["name"]),
+ dbesc($data["nick"]),
+ dbesc($data["addr"]),
+ dbesc($data["photo"]),
+ dbesc(normalise_link($data["url"]))
+ );
+
+ q("UPDATE `contact` SET `addr` = '%s'
+ WHERE `uid` != 0 AND `addr` = '' AND `nurl` = '%s'",
+ dbesc($data["addr"]),
+ dbesc(normalise_link($data["url"]))
+ );
+}
+
+if (array_search(__file__,get_included_files())===0){
+ update_gcontact_run($_SERVER["argv"],$_SERVER["argc"]);
+ killme();
+}
$rino = ((x($_POST,'rino')) ? intval($_POST['rino']) : 0);
$embedly = ((x($_POST,'embedly')) ? notags(trim($_POST['embedly'])) : '');
+ if ($a->get_path() != "")
+ $diaspora_enabled = false;
+
+ if (!$thread_allow)
+ $ostatus_disabled = true;
if($ssl_policy != intval(get_config('system','ssl_policy'))) {
if($ssl_policy == SSL_POLICY_FULL) {
set_config('system','ostatus_disabled', $ostatus_disabled);
set_config('system','ostatus_poll_interval', $ostatus_poll_interval);
set_config('system','diaspora_enabled', $diaspora_enabled);
+
set_config('config','private_addons', $private_addons);
set_config('system','force_ssl', $force_ssl);
set_config('system','old_pager', $old_pager);
set_config('system','only_tag_search', $only_tag_search);
-
+
if ($rino==2 and !function_exists('mcrypt_create_iv')){
- notice(t("RINO2 needs mcrypt php extension to work."));
- } else {
+ notice(t("RINO2 needs mcrypt php extension to work."));
+ } else {
set_config('system','rino_encrypt', $rino);
}
if ($a->config['hostname'] == "")
$a->config['hostname'] = $a->get_hostname();
+ $diaspora_able = ($a->get_path() == "");
+
$t = get_markup_template("admin_site.tpl");
return replace_macros($t, array(
'$title' => t('Administration'),
'$max_author_posts_community_page' => array('max_author_posts_community_page', t("Posts per user on community page"), get_config('system','max_author_posts_community_page'), t("The maximum number of posts per user on the community page. (Not valid for 'Global Community')")),
'$ostatus_disabled' => array('ostatus_disabled', t("Enable OStatus support"), !get_config('system','ostatus_disabled'), t("Provide built-in OStatus \x28StatusNet, GNU Social etc.\x29 compatibility. All communications in OStatus are public, so privacy warnings will be occasionally displayed.")),
'$ostatus_poll_interval' => array('ostatus_poll_interval', t("OStatus conversation completion interval"), (string) intval(get_config('system','ostatus_poll_interval')), t("How often shall the poller check for new entries in OStatus conversations? This can be a very ressource task."), $ostatus_poll_choices),
+ '$ostatus_not_able' => t("OStatus support can only be enabled if threading is enabled."),
+ '$diaspora_able' => $diaspora_able,
+ '$diaspora_not_able' => t("Diaspora support can't be enabled because Friendica was installed into a sub directory."),
'$diaspora_enabled' => array('diaspora_enabled', t("Enable Diaspora support"), get_config('system','diaspora_enabled'), t("Provide built-in Diaspora network compatibility.")),
'$dfrn_only' => array('dfrn_only', t('Only allow Friendica contacts'), get_config('system','dfrn_only'), t("All contacts must use Friendica protocols. All other built-in communication protocols disabled.")),
'$verifyssl' => array('verifyssl', t("Verify SSL"), get_config('system','verifyssl'), t("If you wish, you can turn on strict certificate checking. This will mean you cannot connect (at all) to self-signed SSL sites.")),
* List plugins
*/
- if (x($_GET,"a") && $_GET['a']=="r"){
+ if (x($_GET,"a") && $_GET['a']=="r"){
check_form_security_token_redirectOnErr($a->get_baseurl().'/admin/plugins', 'admin_themes', 't');
reload_plugins();
info("Plugins reloaded");
'$title' => t('Administration'),
'$page' => t('Plugins'),
'$submit' => t('Save Settings'),
+ '$reload' => t('Reload active plugins'),
'$baseurl' => $a->get_baseurl(true),
'$function' => 'plugins',
'$plugins' => $plugins,
));
}
+
+ // reload active themes
+ if (x($_GET,"a") && $_GET['a']=="r"){
+ check_form_security_token_redirectOnErr($a->get_baseurl().'/admin/themes', 'admin_themes', 't');
+ if ($themes) {
+ foreach($themes as $th) {
+ if ($th['allowed']) {
+ uninstall_theme($th['name']);
+ install_theme($th['name']);
+ }
+ }
+ }
+ info("Themes reloaded");
+ goaway($a->get_baseurl().'/admin/themes');
+ }
+
/**
* List themes
*/
}
}
+
$t = get_markup_template("admin_plugins.tpl");
return replace_macros($t, array(
'$title' => t('Administration'),
'$page' => t('Themes'),
'$submit' => t('Save Settings'),
+ '$reload' => t('Reload active themes'),
'$baseurl' => $a->get_baseurl(true),
'$function' => 'themes',
'$plugins' => $xthemes,
<?php
require_once('include/socgraph.php');
+require_once('include/Contact.php');
+require_once('include/contact_selectors.php');
function allfriends_content(&$a) {
if($a->argc > 1)
$cid = intval($a->argv[1]);
+
if(! $cid)
return;
- $c = q("select name, url, photo from contact where id = %d and uid = %d limit 1",
+ $uid = $a->user[uid];
+
+ $c = q("SELECT `name`, `url`, `photo` FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval($cid),
intval(local_user())
);
if(! count($c))
return;
- $o .= replace_macros(get_markup_template("section_title.tpl"),array(
- '$title' => sprintf( t('Friends of %s'), htmlentities($c[0]['name']))
- ));
-
$r = all_friends(local_user(),$cid);
return $o;
}
- $tpl = get_markup_template('common_friends.tpl');
+ $id = 0;
foreach($r as $rr) {
- $o .= replace_macros($tpl,array(
- '$url' => $rr['url'],
- '$name' => htmlentities($rr['name']),
- '$photo' => $rr['photo'],
- '$tags' => ''
- ));
+ //get further details of the contact
+ $contact_details = get_contact_details_by_url($rr['url'], $uid);
+
+ $photo_menu = '';
+
+ // $rr[cid] is only available for common contacts. So if the contact is a common one, use contact_photo_menu to generate the photo_menu
+ // If the contact is not common to the user, Connect/Follow' will be added to the photo menu
+ if ($rr[cid]) {
+ $rr[id] = $rr[cid];
+ $photo_menu = contact_photo_menu ($rr);
+ }
+ else {
+ $connlnk = $a->get_baseurl() . '/follow/?url=' . $rr['url'];
+ $photo_menu = array(array(t("View Profile"), zrl($rr['url'])));
+ $photo_menu[] = array(t("Connect/Follow"), $connlnk);
+ }
+
+ $entry = array(
+ 'url' => $rr['url'],
+ 'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $rr['url']),
+ 'name' => htmlentities($rr['name']),
+ 'thumb' => proxy_url($rr['photo'], false, PROXY_SIZE_THUMB),
+ 'img_hover' => htmlentities($rr['name']),
+ 'details' => $contact_details['location'],
+ 'tags' => $contact_details['keywords'],
+ 'about' => $contact_details['about'],
+ 'account_type' => (($contact_details['community']) ? t('Forum') : ''),
+ 'network' => network_to_name($contact_details['network'], $contact_details['url']),
+ 'photo_menu' => $photo_menu,
+ 'conntxt' => t('Connect'),
+ 'connlnk' => $connlnk,
+ 'id' => ++$id,
+ );
+ $entries[] = $entry;
}
- $o .= cleardiv();
+ $tpl = get_markup_template('viewcontact_template.tpl');
+
+ $o .= replace_macros($tpl,array(
+ '$title' => sprintf( t('Friends of %s'), htmlentities($c[0]['name'])),
+ '$contacts' => $entries,
+ ));
+
// $o .= paginate($a);
return $o;
}
<?php
require_once('include/socgraph.php');
+require_once('include/Contact.php');
+require_once('include/contact_selectors.php');
function common_content(&$a) {
$cid = intval($a->argv[3]);
$zcid = 0;
+ if (! local_user()) {
+ notice( t('Permission denied.') . EOL);
+ return;
+ }
+
if($cmd !== 'loc' && $cmd != 'rem')
return;
+
if(! $uid)
return;
if($cmd === 'loc' && $cid) {
- $c = q("select name, url, photo from contact where id = %d and uid = %d limit 1",
+ $c = q("SELECT `name`, `url`, `photo` FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval($cid),
intval($uid)
);
}
else {
- $c = q("select name, url, photo from contact where self = 1 and uid = %d limit 1",
+ $c = q("SELECT `name`, `url`, `photo` FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1",
intval($uid)
);
}
if(! count($c))
return;
- $o .= replace_macros(get_markup_template("section_title.tpl"),array(
- '$title' => t('Common Friends')
- ));
-
-
if(! $cid) {
if(get_my_url()) {
- $r = q("select id from contact where nurl = '%s' and uid = %d limit 1",
+ $r = q("SELECT `id` FROM `contact` WHERE `nurl` = '%s' AND `uid` = %d LIMIT 1",
dbesc(normalise_link(get_my_url())),
intval($profile_uid)
);
if(count($r))
$cid = $r[0]['id'];
else {
- $r = q("select id from gcontact where nurl = '%s' limit 1",
+ $r = q("SELECT `id` FROM `gcontact` WHERE `nurl` = '%s' LIMIT 1",
dbesc(normalise_link(get_my_url()))
);
if(count($r))
if($cid == 0 && $zcid == 0)
- return;
+ return;
if($cid)
return $o;
}
- $tpl = get_markup_template('common_friends.tpl');
+ $id = 0;
foreach($r as $rr) {
- $o .= replace_macros($tpl,array(
- '$url' => $rr['url'],
- '$name' => htmlentities($rr['name']),
- '$photo' => $rr['photo'],
- '$tags' => ''
- ));
+ //get further details of the contact
+ $contact_details = get_contact_details_by_url($rr['url'], $uid);
+
+ // $rr[id] is needed to use contact_photo_menu()
+ $rr[id] = $rr[cid];
+
+ $photo_menu = '';
+ $photo_menu = contact_photo_menu ($rr);
+
+ $entry = array(
+ 'url' => $rr['url'],
+ 'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $rr['url']),
+ 'name' => $rr['name'],
+ 'thumb' => proxy_url($rr['photo'], false, PROXY_SIZE_THUMB),
+ 'img_hover' => htmlentities($rr['name']),
+ 'details' => $contact_details['location'],
+ 'tags' => $contact_details['keywords'],
+ 'about' => $contact_details['about'],
+ 'account_type' => (($contact_details['community']) ? t('Forum') : ''),
+ 'network' => network_to_name($contact_details['network'], $contact_details['url']),
+ 'photo_menu' => $photo_menu,
+ 'id' => ++$id,
+ );
+ $entries[] = $entry;
}
- $o .= cleardiv();
+ $tpl = get_markup_template('viewcontact_template.tpl');
+
+ $o .= replace_macros($tpl,array(
+ '$title' => t('Common Friends'),
+ '$contacts' => $entries,
+ ));
+
// $o .= paginate($a);
return $o;
}
'name' => htmlentities($rr['name']),
'username' => htmlentities($rr['name']),
'sparkle' => $sparkle,
- 'itemurl' => $rr['url'],
+ 'itemurl' => (($rr['addr'] != "") ? $rr['addr'] : $rr['url']),
'url' => $url,
'network' => network_to_name($rr['network'], $rr['url']),
);
else {
$location_e = $location;
}
+
+ $photo_menu = array(array(t("View Profile"), zrl($profile_link)));
$entry = array(
'id' => $rr['id'],
'marital' => $marital,
'homepage' => $homepage,
'about' => $about,
+ 'photo_menu' => $photo_menu,
);
$perpage = 80;
$startrec = (($a->pager['page']) * $perpage) - $perpage;
+ if (get_config('system','diaspora_enabled'))
+ $diaspora = NETWORK_DIASPORA;
+ else
+ $diaspora = NETWORK_DFRN;
+
+ if (!get_config('system','ostatus_disabled'))
+ $ostatus = NETWORK_OSTATUS;
+ else
+ $ostatus = NETWORK_DFRN;
+
$count = q("SELECT count(*) AS `total` FROM `gcontact` WHERE `network` IN ('%s', '%s', '%s') AND
(`url` REGEXP '%s' OR `name` REGEXP '%s' OR `location` REGEXP '%s' OR
`about` REGEXP '%s' OR `keywords` REGEXP '%s')".$extra_sql,
- dbesc(NETWORK_DFRN), dbesc(NETWORK_OSTATUS), dbesc(NETWORK_DIASPORA),
+ dbesc(NETWORK_DFRN), dbesc($ostatus), dbesc($diaspora),
dbesc(escape_tags($search)), dbesc(escape_tags($search)), dbesc(escape_tags($search)),
dbesc(escape_tags($search)), dbesc(escape_tags($search)));
- $results = q("SELECT `contact`.`id` AS `cid`, `gcontact`.`url`, `gcontact`.`name`, `gcontact`.`photo`, `gcontact`.`network` , `gcontact`.`keywords`
+ $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`.`uid` = %d AND NOT `contact`.`blocked`
GROUP BY `gcontact`.`nurl`
ORDER BY `gcontact`.`updated` DESC LIMIT %d, %d",
intval(local_user()), dbesc(CONTACT_IS_SHARING), dbesc(CONTACT_IS_FRIEND),
- dbesc(NETWORK_DFRN), dbesc(NETWORK_OSTATUS), dbesc(NETWORK_DIASPORA),
+ dbesc(NETWORK_DFRN), dbesc($ostatus), dbesc($diaspora),
dbesc(escape_tags($search)), dbesc(escape_tags($search)), dbesc(escape_tags($search)),
dbesc(escape_tags($search)), dbesc(escape_tags($search)),
intval($startrec), intval($perpage));
$objresult = new stdClass();
$objresult->cid = $result["cid"];
$objresult->name = $result["name"];
+ $objresult->addr = $result["addr"];
$objresult->url = $result["url"];
$objresult->photo = $result["photo"];
$objresult->tags = $result["keywords"];
$alt_text = "";
- $itemurl = $jj->url;
+ $contact_details = get_contact_details_by_url($jj->url, local_user());
+
+ $itemurl = (($contact_details["addr"] != "") ? $contact_details["addr"] : $jj->url);
// If We already know this contact then don't show the "connect" button
if ($jj->cid > 0) {
'conntxt' => $conntxt,
'connlnk' => $connlnk,
'photo_menu' => $photo_menu,
+ 'details' => $contact_details['location'],
+ 'tags' => $contact_details['keywords'],
+ 'about' => $contact_details['about'],
'network' => network_to_name($jj->network, $jj->url),
'id' => ++$id,
);
$uid = local_user();
$url = notags(trim($_REQUEST['url']));
+ $submit = t('Submit Request');
+
// There is a current issue. It seems as if you can't start following a Friendica that is following you
// With Diaspora this works - but Friendica is special, it seems ...
$r = q("SELECT `url` FROM `contact` WHERE `uid` = %d AND ((`rel` != %d) OR (`network` = '%s')) AND
if ($r) {
notice(t('You already added this contact.').EOL);
- goaway($_SESSION['return_url']);
+ $submit = "";
+ //goaway($_SESSION['return_url']);
// NOTREACHED
}
$ret = probe_url($url);
+ if (($ret["network"] == NETWORK_DIASPORA) AND !get_config('system','diaspora_enabled')) {
+ notice( t("Diaspora support isn't enabled. Contact can't be added.") . EOL);
+ $submit = "";
+ //goaway($_SESSION['return_url']);
+ // NOTREACHED
+ }
+
+ if (($ret["network"] == NETWORK_OSTATUS) AND get_config('system','ostatus_disabled')) {
+ notice( t("OStatus support is disabled. Contact can't be added.") . EOL);
+ $submit = "";
+ //goaway($_SESSION['return_url']);
+ // NOTREACHED
+ }
+
if ($ret["network"] == NETWORK_PHANTOM) {
notice( t("The network type couldn't be detected. Contact can't be added.") . EOL);
- goaway($_SESSION['return_url']);
+ $submit = "";
+ //goaway($_SESSION['return_url']);
// NOTREACHED
}
'$your_address' => t('Your Identity Address:'),
'$invite_desc' => "",
'$emailnet' => "",
- '$submit' => t('Submit Request'),
+ '$submit' => $submit,
'$cancel' => t('Cancel'),
'$nickname' => "",
'$name' => $ret["name"],
<?php
+require_once "include/Photo.php";
$install_wizard_pass=1;
'$phpath' => $phpath,
'$adminmail' => $adminmail
));
-
+
$result = file_put_contents('.htconfig.php', $txt);
if(! $result) {
$a->data['txt'] = $txt;
}
-
+
$errors = load_database($db);
-
+
if($errors)
$a->data['db_failed'] = $errors;
check_funcs($checks);
+ check_imagik($checks);
+
check_htconfig($checks);
check_smarty3($checks);
$help = "";
if(!$passed) {
$help .= t('Could not find a command line version of PHP in the web server PATH.'). EOL;
- $help .= t("If you don't have a command line version of PHP installed on server, you will not be able to run background polling via cron. See <a href='http://friendica.com/node/27'>'Activating scheduled tasks'</a>") . EOL ;
+ $help .= t("If you don't have a command line version of PHP installed on server, you will not be able to run background polling via cron. See <a href='https://github.com/friendica/friendica/blob/master/doc/Install.md#set-up-the-poller'>'Setup the poller'</a>") . EOL ;
$help .= EOL . EOL ;
$tpl = get_markup_template('field_input.tpl');
$help .= replace_macros($tpl, array(
$ck_funcs[5]['help']= t('Error: mcrypt PHP module required but not installed.');
}
-
-
$checks = array_merge($checks, $ck_funcs);
+ // check for 'mcrypt_create_iv()', needed for RINO2
+ if ($ck_funcs[5]['status']) {
+ if (function_exists('mcrypt_create_iv')) {
+ $__status = true;
+ $__help = "If you are using php_cli, please make sure that mcrypt module is enabled in its config file";
+ } else {
+ $__status = false;
+ $__help = t('Function mcrypt_create_iv() is not defined. This is needed to enable RINO2 encryption layer.');
+ }
+ check_add($checks, t('mcrypt_create_iv() function'), $__status, false, $__help);
+ }
+
+
/*if((x($_SESSION,'sysmsg')) && is_array($_SESSION['sysmsg']) && count($_SESSION['sysmsg']))
notice( t('Please see the file "INSTALL.txt".') . EOL);*/
}
}
}
+function check_imagik(&$checks) {
+ $imagick = false;
+ $gif = false;
+
+ if (class_exists('Imagick')) {
+ $imagick = true;
+ $supported = Photo::supportedTypes();
+ if (array_key_exists('image/gif', $supported)) {
+ $gif = true;
+ }
+ }
+ check_add($checks, t('ImageMagick PHP extension is installed'), $imagick, false, "");
+ if ($imagick) {
+ check_add($checks, t('ImageMagick supports GIF'), $gif, false, "");
+ }
+}
+
+
function manual_config(&$a) {
$data = htmlentities($a->data['txt'],ENT_COMPAT,'UTF-8');
$photo_menu = array(array(t("View Profile"), zrl($jj->url)));
$photo_menu[] = array(t("Connect/Follow"), $connlnk);
+ $contact_details = get_contact_details_by_url($jj->url, local_user());
+
$entry = array(
'url' => zrl($jj->url),
- 'itemurl' => $jj->url,
+ 'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $jj->url),
'name' => $jj->name,
+ 'details' => $contact_details['location'],
+ 'tags' => $contact_details['keywords'],
+ 'about' => $contact_details['about'],
'thumb' => proxy_url($jj->photo, false, PROXY_SIZE_THUMB),
'inttxt' => ' ' . t('is interested in:'),
'conntxt' => t('Connect'),
if(count($r)) {
foreach($r as $rr) {
+ $contact_details = get_contact_details_by_url($rr['url'], local_user());
$contacts[] = array(
'img_hover' => sprintf( t('Visit %s\'s profile [%s]'),$rr['name'],$rr['url']),
'thumb' => $rr['thumb'],
'name' => $rr['name'],
'username' => $rr['name'],
+ 'details' => $contact_details['location'],
+ 'tags' => $contact_details['keywords'],
+ 'about' => $contact_details['about'],
'sparkle' => $sparkle,
- 'itemurl' => $rr['url'],
+ 'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $rr['url']),
'url' => $url,
'network' => network_to_name($rr['network'], $url),
);
$connlnk = $a->get_baseurl() . '/follow/?url=' . (($rr['connect']) ? $rr['connect'] : $rr['url']);
$ignlnk = $a->get_baseurl() . '/suggest?ignore=' . $rr['id'];
- $photo_menu = array(array(t("View Profile"), zrl($jj->url)));
+ $photo_menu = array(array(t("View Profile"), zrl($rr["url"])));
$photo_menu[] = array(t("Connect/Follow"), $connlnk);
$photo_menu[] = array(t('Ignore/Hide'), $ignlnk);
+ $contact_details = get_contact_details_by_url($rr["url"], local_user());
$entry = array(
'url' => zrl($rr['url']),
- 'itemurl' => $rr['url'],
+ 'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $rr['url']),
'img_hover' => $rr['url'],
'name' => $rr['name'],
'thumb' => proxy_url($rr['photo'], false, PROXY_SIZE_THUMB),
+ 'details' => $contact_details['location'],
+ 'tags' => $contact_details['keywords'],
+ 'about' => $contact_details['about'],
'ignlnk' => $ignlnk,
'ignid' => $rr['id'],
'conntxt' => t('Connect'),
<?php
+require_once('include/Contact.php');
require_once('include/contact_selectors.php');
function viewcontacts_init(&$a) {
function viewcontacts_content(&$a) {
-
require_once("mod/proxy.php");
if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
else
$url = zrl($url);
+ $contact_details = get_contact_details_by_url($rr['url'], $a->profile['uid']);
+
$contacts[] = array(
'id' => $rr['id'],
'img_hover' => sprintf( t('Visit %s\'s profile [%s]'), $rr['name'], $rr['url']),
'thumb' => proxy_url($rr['thumb'], false, PROXY_SIZE_THUMB),
'name' => htmlentities(substr($rr['name'],0,20)),
'username' => htmlentities($rr['name']),
+ 'details' => $contact_details['location'],
+ 'tags' => $contact_details['keywords'],
+ 'about' => $contact_details['about'],
'url' => $url,
'sparkle' => '',
- 'itemurl' => $rr['url'],
+ 'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $rr['url']),
'network' => network_to_name($rr['network'], $rr['url']),
);
}
<?php
-define( 'UPDATE_VERSION' , 1189 );
+define( 'UPDATE_VERSION' , 1190 );
/**
*
// Location of the global directory
$a->config['system']['directory'] = 'http://dir.friendi.ca';
+
+// turn on friendica's log
+$a->config['system']['debugging'] = true;
+$a->config['system']['logfile'] = 'logfile.out';
+$a->config['system']['loglevel'] = LOGGER_DEBUG;
+
emailAddress=
"
sudo mkdir -p "$SSL_DIR"
-sudo openssl genrsa -out "$SSL_DIR/xip.io.key" 1024
+sudo openssl genrsa -out "$SSL_DIR/xip.io.key" 4096
sudo openssl req -new -subj "$(echo -n "$SUBJ" | tr "\n" "/")" -key "$SSL_DIR/xip.io.key" -out "$SSL_DIR/xip.io.csr" -passin pass:$PASSPHRASE
sudo openssl x509 -req -days 365 -in "$SSL_DIR/xip.io.csr" -signkey "$SSL_DIR/xip.io.key" -out "$SSL_DIR/xip.io.crt"
#Install apache2
echo ">>> Installing Apache2 webserver"
-# The package python-software-properties provides add-apt-repository on Ubuntu Precise Server
-sudo apt-get install python-software-properties
-sudo add-apt-repository -y ppa:ondrej/apache2
-sudo apt-key update
-sudo apt-get update
sudo apt-get install -y apache2
sudo a2enmod rewrite actions ssl
sudo cp /vagrant/util/vagrant_vhost.sh /usr/local/bin/vhost
<div id='adminpage'>
<h1>{{$title}} - {{$page}}</h1>
- <a class="btn" href="{{$baseurl}}/admin/{{$function}}?a=r&t={{$form_security_token}}">{{"Reload active plugins"|t}}</a>
+ <a class="btn" href="{{$baseurl}}/admin/{{$function}}?a=r&t={{$form_security_token}}">{{$reload}}</a>
<ul id='pluginslist'>
{{foreach $plugins as $p}}
<li class='plugin {{$p.1}}'>
{{include file="field_checkbox.tpl" field=$force_publish}}
{{include file="field_select.tpl" field=$community_page_style}}
{{include file="field_input.tpl" field=$max_author_posts_community_page}}
- {{include file="field_checkbox.tpl" field=$ostatus_disabled}}
- {{include file="field_select.tpl" field=$ostatus_poll_interval}}
- {{include file="field_checkbox.tpl" field=$diaspora_enabled}}
+
+ {{if $thread_allow.2}}
+ {{include file="field_checkbox.tpl" field=$ostatus_disabled}}
+ {{include file="field_select.tpl" field=$ostatus_poll_interval}}
+ {{else}}
+ <div class='field checkbox' id='div_id_{{$ostatus_disabled.0}}'>
+ <label for='id_{{$ostatus_disabled.0}}'>{{$ostatus_disabled.1}}</label>
+ <span id='id_{{$ostatus_disabled.0}}'>{{$ostatus_not_able}}</span>
+ </div>
+ {{/if}}
+
+ {{if $diaspora_able}}
+ {{include file="field_checkbox.tpl" field=$diaspora_enabled}}
+ {{else}}
+ <div class='field checkbox' id='div_id_{{$diaspora_enabled.0}}'>
+ <label for='id_{{$diaspora_enabled.0}}'>{{$diaspora_enabled.1}}</label>
+ <span id='id_{{$diaspora_enabled.0}}'>{{$diaspora_not_able}}</span>
+ </div>
+ {{/if}}
{{include file="field_checkbox.tpl" field=$dfrn_only}}
{{include file="field_input.tpl" field=$global_directory}}
{{include file="field_checkbox.tpl" field=$thread_allow}}
</div>
<div id="dfrn-request-submit-wrapper">
- <input type="submit" name="submit" id="dfrn-request-submit-button" value="{{$submit|escape:'html'}}" />
+ {{if $submit}}
+ <input type="submit" name="submit" id="dfrn-request-submit-button" value="{{$submit|escape:'html'}}" />
+ {{/if}}
<input type="submit" name="cancel" id="dfrn-request-cancel-button" value="{{$cancel|escape:'html'}}" />
</div>
</form>
+++ /dev/null
-
-<div class="profile-match-wrapper">
- <div class="profile-match-photo">
- <a href="{{$url}}">
- <img src="{{$photo}}" alt="{{$name}}" width="80" height="80" title="{{$name}} [{{$url}}]" />
- </a>
- </div>
- <div class="profile-match-break"></div>
- <div class="profile-match-name">
- <a href="{{$url}}" title="{{$name}}[{{$tags}}]">{{$name}}</a>
- </div>
- <div class="profile-match-end"></div>
-</div>
\ No newline at end of file
</div>
<div class="contact-entry-desc">
- <div class="contact-entry-name" id="contact-entry-name-{{$contact.id}}" >{{$contact.name}}</div>
+ <div class="contact-entry-name" id="contact-entry-name-{{$contact.id}}" >
+ {{$contact.name}}
+ {{if $contact.account_type}} <span class="contact-entry-details" id="contact-entry-accounttype-{{$contact.id}}">({{$contact.account_type}})</span>{{/if}}
+ </div>
{{if $contact.alt_text}}<div class="contact-entry-details" id="contact-entry-rel-{{$contact.id}}" >{{$contact.alt_text}}</div>{{/if}}
{{if $contact.itemurl}}<div class="contact-entry-details" id="contact-entry-url-{{$contact.id}}" >{{$contact.itemurl}}</div>{{/if}}
- {{if $contact.network}}<div class="contact-entry-details" id="contact-entry-network-{{$contact.id}}" >{{$contact.network}}</div>{{/if}}
+ {{if $contact.tags}}<div class="contact-entry-details" id="contact-entry-tags-{{$contact.id}}" >{{$contact.tags}}</div>{{/if}}
{{if $contact.details}}<div class="contact-entry-details" id="contact-entry-details-{{$contact.id}}" >{{$contact.details}}</div>{{/if}}
+ {{if $contact.network}}<div class="contact-entry-details" id="contact-entry-network-{{$contact.id}}" >{{$contact.network}}</div>{{/if}}
+
</div>
<div class="contact-entry-end" ></div>
</div>
<div id="dfrn-request-submit-wrapper">
- <input type="submit" name="submit" id="dfrn-request-submit-button" value="{{$submit|escape:'html'}}" />
+ {{if $submit}}
+ <input type="submit" name="submit" id="dfrn-request-submit-button" value="{{$submit|escape:'html'}}" />
+ {{/if}}
<input type="submit" name="cancel" id="dfrn-request-cancel-button" value="{{$cancel|escape:'html'}}" />
</div>
</form>
-
-
<div class='field checkbox' id='div_id_{{$field.0}}'>
<label for='id_{{$field.0}}'>{{$field.1}}</label>
<input type="checkbox" name='{{$field.0}}' id='id_{{$field.0}}' value="1" {{if $field.2}}checked="checked"{{/if}}>
{{if $contact.photo_menu}}
{{*<!-- <span onclick="openClose('contact-photo-menu-{{$contact.id}}');" class="fakelink contact-photo-menu-button" id="contact-photo-menu-button-{{$contact.id}}">menu</span>-->*}}
- <div class="contact-photo-menu" id="contact-photo-menu-{{$contact.id}}">
- <ul>
- {{foreach $contact.photo_menu as $c}}
- {{if $c.2}}
- <li><a target="redir" href="{{$c.1}}">{{$c.0}}</a></li>
- {{else}}
- <li><a href="{{$c.1}}">{{$c.0}}</a></li>
- {{/if}}
- {{/foreach}}
- </ul>
- </div>
+ <div class="contact-photo-menu" id="contact-photo-menu-{{$contact.id}}">
+ <ul>
+ {{foreach $contact.photo_menu as $c}}
+ {{if $c.2}}
+ <li><a target="redir" href="{{$c.1}}">{{$c.0}}</a></li>
+ {{else}}
+ <li><a href="{{$c.1}}">{{$c.0}}</a></li>
+ {{/if}}
+ {{/foreach}}
+ </ul>
+ </div>
{{/if}}
</div>
</div>
<div class="contact-entry-desc">
- <div class="contact-entry-name" id="contact-entry-name-{{$contact.id}}" >{{$contact.name}}</div>
+ <div class="contact-entry-name" id="contact-entry-name-{{$contact.id}}" >
+ {{$contact.name}}
+ {{if $contact.account_type}} <span class="contact-entry-details" id="contact-entry-accounttype-{{$contact.id}}">({{$contact.account_type}})</span>{{/if}}
+ </div>
{{if $contact.alt_text}}<div class="contact-entry-details" id="contact-entry-rel-{{$contact.id}}" >{{$contact.alt_text}}</div>{{/if}}
{{if $contact.itemurl}}<div class="contact-entry-details" id="contact-entry-url-{{$contact.id}}" >{{$contact.itemurl}}</div>{{/if}}
- {{if $contact.network}}<div class="contact-entry-network" id="contact-entry-network-{{$contact.id}}" >{{$contact.network}}</div>{{/if}}
+ {{if $contact.tags}}<div class="contact-entry-details" id="contact-entry-tags-{{$contact.id}}" >{{$contact.tags}}</div>{{/if}}
{{if $contact.details}}<div class="contact-entry-details" id="contact-entry-details-{{$contact.id}}" >{{$contact.details}}</div>{{/if}}
+ {{if $contact.network}}<div class="contact-entry-network" id="contact-entry-network-{{$contact.id}}" >{{$contact.network}}</div>{{/if}}
</div>
<div class="contact-entry-end" ></div>
</div>
<div class="contact-entry-desc">
- <div class="contact-entry-name" id="contact-entry-name-{{$contact.id}}" >{{$contact.name}}</div>
+ <div class="contact-entry-name" id="contact-entry-name-{{$contact.id}}" >
+ {{$contact.name}}
+ {{if $contact.account_type}} <span class="contact-entry-details" id="contact-entry-accounttype-{{$contact.id}}">({{$contact.account_type}})</span>{{/if}}
+ </div>
{{if $contact.alt_text}}<div class="contact-entry-details" id="contact-entry-rel-{{$contact.id}}" >{{$contact.alt_text}}</div>{{/if}}
{{if $contact.itemurl}}<div class="contact-entry-details" id="contact-entry-url-{{$contact.id}}" >{{$contact.itemurl}}</div>{{/if}}
- {{if $contact.network}}<div class="contact-entry-network" id="contact-entry-network-{{$contact.id}}" >{{$contact.network}}</div>{{/if}}
+ {{if $contact.tags}}<div class="contact-entry-details" id="contact-entry-tags-{{$contact.id}}" >{{$contact.tags}}</div>{{/if}}
{{if $contact.details}}<div class="contact-entry-details" id="contact-entry-details-{{$contact.id}}" >{{$contact.details}}</div>{{/if}}
+ {{if $contact.network}}<div class="contact-entry-network" id="contact-entry-network-{{$contact.id}}" >{{$contact.network}}</div>{{/if}}
</div>
<div class="contact-entry-end" ></div>
}
.contact-name {
font-weight: bold;
- padding-top: 15px;
+ /* padding-top: 15px; */
}
.contact-details {
color: #999999;
}
.contact-name {
font-weight: bold;
- padding-top: 15px;
+ /* padding-top: 15px; */
}
.contact-details {
color: #999999;
}
.contact-name {
font-weight: bold;
- padding-top: 15px;
+ /* padding-top: 15px; */
}
.contact-details {
color: #999999;
img { width: 175px; height: 175px; }
}
}
-.contact-name { font-weight: bold; padding-top: 15px; }
+.contact-name { font-weight: bold; /* padding-top: 15px; */}
.contact-details {
color: @Grey3; white-space: nowrap;
overflow: hidden;
</div>
</div>
- <div class="contact-name" id="contact-entry-name-{{$contact.id}}" >{{$contact.name}}</div>
+ <div class="contact-name" id="contact-entry-name-{{$contact.id}}" >
+ {{$contact.name}}
+ {{if $contact.account_type}} <span class="contact-entry-details" id="contact-entry-accounttype-{{$contact.id}}">({{$contact.account_type}})</span>{{/if}}
+ </div>
{{if $contact.alt_text}}<div class="contact-details" id="contact-entry-rel-{{$contact.id}}" >{{$contact.alt_text}}</div>{{/if}}
{{if $contact.itemurl}}<div class="contact-details" id="contact-entry-url-{{$contact.id}}" >{{$contact.itemurl}}</div>{{/if}}
- {{if $contact.network}}<div class="contact-details" id="contact-entry-network-{{$contact.id}}" >{{$contact.network}}</div>{{/if}}
+ {{if $contact.tags}}<div class="contact-details" id="contact-entry-tags-{{$contact.id}}" >{{$contact.tags}}</div>{{/if}}
{{if $contact.details}}<div class="contact-details" id="contact-entry-details-{{$contact.id}}" >{{$contact.details}}</div>{{/if}}
+ {{if $contact.network}}<div class="contact-details" id="contact-entry-network-{{$contact.id}}" >{{$contact.network}}</div>{{/if}}
{{if $contact.connlnk}}
<div class="contact-entry-connect"><a href="{{$contact.connlnk}}" title="{{$contact.conntxt}}">{{$contact.conntxt}}</a></div>
background-color: #2C77AE !important
}
-aside, .menu-popup, .fc-state-highlight, a.off, .autocomplete {
+aside, right_aside, .menu-popup, .fc-state-highlight, a.off, .autocomplete {
color: #989898 !important;
background-color: #252C33 !important;
border-right: 1px solid #D2D2D2;
aside {
border-right: 1px solid #D2D2D2;
}
+
+right_aside {
+ border-left: 1px solid #D2D2D2;
+}
--- /dev/null
+aside, header, #nav-events-link, #search-box, #nav-admin-link, #activitiy-by-date-tab, #shared-links-tab,
+.wall-item-location {
+ display: none;
+}
+
+.hide-comments-outer {
+ width: calc(100% - 105px);
+}
+
+section {
+ /* left: calc((100% - (784px)) / 2); */
+ left: 0px;
+ width: calc(100% - 20px);
+ max-width: 100%;
+ padding: 10px;
+}
+
+body, section, nav .nav-menu, div.pager, ul.tabs {
+ font-size: 16px;
+}
+
+.wall-item-container .wall-item-ago, .wall-item-network,.type-link blockquote, .type-video blockquote {
+ font-size: 13px;
+}
+
+nav {
+ min-width: 480px;
+}
+
+.wall-item-container .wall-item-content {
+ max-width: 100%;
+ overflow: hidden;
+ text-overflow: ellipsis;
+/* margin-left: -70px;
+ padding-top: 25px; */
+}
+
+nav ul {
+ margin-left: 0px;
+}
+
+
+.wall-item-container .wall-item-content img,
+.children .wall-item-container .wall-item-item .wall-item-content img,
+.wall-item-container .wall-item-content .type-link img.attachment-image, .type-link img.attachment-image, .type-video img.attachment-image {
+ max-width: 650px;
+}
+
+@media screen and (max-width: 800px) {
+ .wall-item-container .wall-item-content img,
+ .children .wall-item-container .wall-item-item .wall-item-content img,
+ .wall-item-container .wall-item-content .type-link img.attachment-image, .type-link img.attachment-image, .type-video img.attachment-image {
+ max-width: 450px;
+ }
+}
+
+@media screen and (max-width: 600px) {
+ .wall-item-container .wall-item-content img,
+ .children .wall-item-container .wall-item-item .wall-item-content img,
+ .wall-item-container .wall-item-content .type-link img.attachment-image, .type-link img.attachment-image, .type-video img.attachment-image {
+ max-width: 350px;
+ }
+}
+
+@media screen and (max-width: 480px) {
+ .wall-item-container .wall-item-content img,
+ .children .wall-item-container .wall-item-item .wall-item-content img,
+ .wall-item-container .wall-item-content .type-link img.attachment-image, .type-link img.attachment-image, .type-video img.attachment-image {
+ max-width: 200px;
+ }
+}
+
+.wall-item-container.thread_level_2,
+.wall-item-container.thread_level_3,
+.wall-item-container.thread_level_4,
+.wall-item-container.thread_level_5,
+.wall-item-container.thread_level_6,
+.wall-item-container.thread_level_7 {
+ margin-left: 60px;
+ width: calc(100% - 70px);
+}
+
+.wall-item-container.thread_level_2 .wall-item-content,
+.wall-item-container.thread_level_3 .wall-item-content,
+.wall-item-container.thread_level_4 .wall-item-content,
+.wall-item-container.thread_level_5 .wall-item-content,
+.wall-item-container.thread_level_6 .wall-item-content,
+.wall-item-container.thread_level_7 .wall-item-content {
+ max-width: 100%;
+}
/* background-color: #FFFFF9; */
background-color: #fffafa;
}
-
height: calc(100% - 54px);
}
+right_aside {
+ top: 44px;
+}
+
section {
top: 44px;
}
}
right_aside {
- width: 0px;
- top: 32px;
display: none;
+ vertical-align: top;
+ width: 185px;
+ padding-top: 10px;
+ padding-right: 20px;
+ padding-bottom: 0px;
+ padding-left: 10px;
+ background-color: #FFFFFF;
+ font-size: 13px;
+ overflow-y: auto;
+ z-index: 2;
+ line-height: 17px;
+ color: #737373;
+ box-shadow: 1px 2px 0px 0px #D8D8D8;
+ top: 32px;
+ position: absolute;
+ margin-left: calc(100% - 215px);
}
/* aside */
.contact-entry-wrapper {
float: left;
width: 363px;
- height: 90px;
+ height: 100px;
padding-right: 10px;
margin: 0 10px 10px 0px;
}
.contact-entry-wrapper .contact-entry-photo-wrapper {
float: left;
margin-right: 10px;
+ width: 80px;
+ height: 80px;
}
.contact-entry-photo-wrapper {
position: relative;
<div class="contact-entry-photo-end" ></div>
<div class="contact-entry-desc">
- <div class="contact-entry-name" id="contact-entry-name-{{$contact.id}}" >{{$contact.name}}</div>
+ <div class="contact-entry-name" id="contact-entry-name-{{$contact.id}}" >
+ {{$contact.name}}
+ {{if $contact.account_type}} <span class="contact-entry-details" id="contact-entry-accounttype-{{$contact.id}}">({{$contact.account_type}})</span>{{/if}}
+ </div>
{{if $contact.alt_text}}<div class="contact-entry-details" id="contact-entry-rel-{{$contact.id}}" >{{$contact.alt_text}}</div>{{/if}}
- {{if $contact.itemurl}}<div class="contact-entry-details" id="contact-entry-url-{{$contact.id}}" >{{$contact.itemurl}}</div>{{/if}}
- {{if $contact.network}}<div class="contact-entry-details" id="contact-entry-network-{{$contact.id}}" >{{$contact.network}}</div>{{/if}}
+ <div class="contact-entry-details">
+ {{if $contact.itemurl}}<span class="contact-entry-details" id="contact-entry-url-{{$contact.id}}" >{{$contact.itemurl}}</span>{{/if}}
+ {{if $contact.network}}<span class="contact-entry-details" id="contact-entry-network-{{$contact.id}}" > ({{$contact.network}})</span>{{/if}}
+ </div>
+ {{if $contact.tags}}<div class="contact-entry-details" id="contact-entry-tags-{{$contact.id}}" >{{$contact.tags}}</div>{{/if}}
{{if $contact.details}}<div class="contact-entry-details" id="contact-entry-details-{{$contact.id}}" >{{$contact.details}}</div>{{/if}}
</div>
if ($a->argv[0].$a->argv[1] === "profile".$a->user['nickname'] or $a->argv[0] === "network" && local_user()) {
vier_community_info();
- $a->page['htmlhead'] .= "<link rel='stylesheet' media='screen and (min-width: 1300px)' href='view/theme/vier/wide.css' />";
+ $a->page['htmlhead'] .= "<link rel='stylesheet' type='text/css' href='view/theme/vier/wide.css' media='screen and (min-width: 1300px)'/>\n";
}
+ if ($a->is_mobile || $a->is_tablet) {
+ $a->page['htmlhead'] .= '<meta name=viewport content="width=device-width, initial-scale=1">'."\n";
+ $a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="view/theme/vier/mobile.css" media="screen"/>'."\n";
+ }
+ $a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="view/theme/vier/mobile.css" media="screen and (max-width: 1000px)"/>'."\n";
+
$a->page['htmlhead'] .= <<< EOT
-<link rel='stylesheet' media='screen and (max-width: 1100px)' href='view/theme/vier/narrow.css' />
+<link rel='stylesheet' type='text/css' href='view/theme/vier/narrow.css' media='screen and (max-width: 1100px)' />
<script type="text/javascript">
function insertFormatting(comment,BBcode,id) {
// Hide the left menu bar
if (($a->page['aside'] == "") AND in_array($a->argv[0], array("community", "events", "help", "manage", "notifications",
- "probe", "webfinger", "login", "invite")))
+ "probe", "webfinger", "login", "invite", "credits")))
$a->page['htmlhead'] .= "<link rel='stylesheet' href='view/theme/vier/hide.css' />";
}
right_aside {
- vertical-align: top;
- width: 185px;
- padding-top: 10px;
- padding-right: 20px;
- padding-bottom: 0px;
- padding-left: 10px;
- background-color: #FFFFFF;
- font-size: 13px;
- overflow-y: auto;
- z-index: 2;
- line-height: 17px;
- color: #737373;
- top: 44px;
- position: absolute;
-/* position: fixed;
- height: calc(100% - 54px); */
display: block;
- margin-left: calc(100% - 215px);
- box-shadow: 1px 2px 0px 0px #D8D8D8;
}
#forumlist-sidebar {