diff --git a/.gitignore b/.gitignore
index 19ce2922..c60897f7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,5 +2,6 @@
.htconfig.php
#*
favicon.*
-
-
+tests/coverage.html
+/vendor
+/nbproject/private/
diff --git a/.htaccess b/.htaccess
old mode 100755
new mode 100644
diff --git a/Makefile b/Makefile
new file mode 100644
index 00000000..3cf4a7c0
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,2 @@
+test:
+ cd tests && phpunit --coverage-html=coverage.html && x-www-browser ./coverage.html/index.html
\ No newline at end of file
diff --git a/README.md b/README.md
index fd47fc6c..60b4f25e 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,23 @@
-# Friendica Global Directory
+# Decentralized Friendica Directory
-Example cronjob.
+## Installing
+
+### 1. Initialize the database
+
+Create a database with a username and a password.
+Then import ````dfrndir.sql```` to it.
+
+### 2. Create an autoloader with composer
+
+Make sure you have composer installed globally, or rewrite the command to use a `.phar`.
+
+```sh
+composer dump-autoload
+```
+
+### 3. Set up the cronjobs.
+
+Example cronjob using `www-data` user.
```
*/30 * * * * www-data cd /var/www/friendica-directory; php include/cron_maintain.php
@@ -58,8 +75,6 @@ You can check the backlog of this queue at the `/admin` page.
* `.vcard .region` as `region`
* `.vcard .postal-code` as `postal-code`
* `.vcard .country-name` as `country-name`
- * `.vcard .x-gender` as `gender`
- * `.marital-text` as `marital`
3. If the `dfrn-global-visibility` value is set to false. Any existing records will be deleted.
And the process exits here.
@@ -93,4 +108,24 @@ You can check the backlog of this queue at the `/admin` page.
10. The `photo` provided will be downloaded and resized to 80x80, regardless of source size.
11. Should there somehow have been an error at this point such as that there is no profile ID known.
- Everything will get deleted based on the original `?url=` parameter.
\ No newline at end of file
+ Everything will get deleted based on the original `?url=` parameter.
+
+## Note about search
+
+The Directory uses MySQL fulltext capabilities to index profiles and offer a search feature.
+However, the default minimum word size MySQL will index is 4, which ignores words like `PHP` and `USA`.
+
+To index words smaller than 4 characters, you will have to edit your my.cnf/my.ini file to include this:
+
+````
+[mysqld]
+ft_min_word_len = 3
+````
+
+Then restart your MySQL server.
+
+If you already had data in your profile table, you will need to rebuild the index by executing the following query:
+
+````
+REPAIR TABLE `profile` QUICK;
+````
\ No newline at end of file
diff --git a/Vagrantfile b/Vagrantfile
new file mode 100644
index 00000000..9b4db068
--- /dev/null
+++ b/Vagrantfile
@@ -0,0 +1,43 @@
+
+server_ip = "192.168.33.10"
+server_memory = "384" # MB
+server_timezone = "UTC"
+
+public_folder = "/vagrant"
+
+Vagrant.configure(2) do |config|
+
+ # Set server to Ubuntu 14.04
+ config.vm.box = "ubuntu/trusty64"
+
+ # 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
+ # TO DO: Make this work with virtualhost along-side xip.io URL
+ config.vm.hostname = "friendica.dev"
+
+ # Create a static IP
+ config.vm.network :private_network, ip: server_ip
+
+ # 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
+
+ # Enable provisioning with a shell script.
+ config.vm.provision "shell", path: "./util/vagrant_provision.sh"
+ # run: "always"
+ # run: "once"
+end
diff --git a/assets/js/main.js b/assets/js/main.js
new file mode 100644
index 00000000..e72c142b
--- /dev/null
+++ b/assets/js/main.js
@@ -0,0 +1,30 @@
+jQuery(function($){
+
+ //Mobile menu, hamburger button.
+ $('body').on('click', '.hamburger', function(e){
+ e.preventDefault();
+ $('nav#links').toggleClass('open');
+ });
+
+ // Show/hide the reset link if the search field is populated/empty
+ function updateResetButton() {
+ if ($('.search-field').val()) {
+ $('.reset').show();
+ } else {
+ $('.reset').hide();
+ }
+ }
+ $('body').on('keyup', '.search-field', updateResetButton)
+
+ updateResetButton();
+
+ // Makes the entire profile card clickable...
+ $('body').on('click', '.profile', function(event) {
+ window.open(event.currentTarget.dataset.href, '_blank');
+ });
+
+ // ...while keeping inner a tags clickable
+ $('body').on('click', '.profile a', function(event) {
+ event.stopPropagation();
+ })
+});
diff --git a/assets/style.css b/assets/style.css
new file mode 100644
index 00000000..7b54d664
--- /dev/null
+++ b/assets/style.css
@@ -0,0 +1,448 @@
+* {
+ box-sizing: border-box;
+}
+
+html,body {
+ margin: 0;
+ padding: 0;
+}
+
+html {
+ font-family: 'Open Sans', sans-serif;
+ font-weight: 300;
+ font-size: 100%;
+}
+
+a {color: inherit;}
+
+p {
+ margin: 0 0 1em 0;
+}
+
+.mobile {
+ display: none !important;
+}
+
+#top-bar {
+ background: #f5f5f5;
+ padding: 8px 14px;
+ position: fixed;
+ z-index: 1;
+ top: 0;
+ height: 55px;
+ width: 100%;
+ font-weight: 300;
+ border-bottom: 1px solid #ddd;
+ display: flex;
+ justify-content: space-between;
+}
+#top-bar-spacer {
+ width: 100%;
+ height: 55px;
+}
+
+#top-bar .header {
+ display: inline-block;
+ font-size: 16px;
+ font-weight: 300;
+ line-height: 19px;
+ background: url('/images/friendica.svg') top left no-repeat;
+ background-size: 14px;
+ padding-left: 18px;
+ margin: 0;
+ white-space: nowrap;
+}
+
+#top-bar .search-form {
+ display: inline-block;
+}
+#top-bar .search-wrapper {
+ background: #fff;
+}
+
+nav#links {
+ line-height: 39px;
+ white-space: nowrap;
+}
+nav#links a {
+ display: inline-block;
+ margin: 0 4px;
+ padding: 0 5px;
+}
+
+.sub-menu-outer {
+ background: #eee;
+ line-height: 45px;
+ height: 45px;
+ border-bottom: 1px solid #ddd;
+}
+.sub-menu-outer .sub-menu-inner {
+ width: 500px;
+ margin: auto;
+}
+.sub-menu-inner .option {
+ padding: 9px 6px;
+ margin: 0 5px;
+}
+.sub-menu-inner .option.active {
+ border-bottom: 2px solid #f00;
+}
+
+.homepage-wrapper {
+ width: 500px;
+ margin: auto;
+ text-align: center;
+}
+
+.search-results,
+.directory-results {
+ margin-bottom: 25px;
+}
+
+.directory-results {
+ display: flex;
+ flex-flow: row;
+}
+
+.directory-results > aside {
+ flex: 1 6 20%;
+ order: 1;
+ padding: 0 1em;
+}
+
+.directory-results > section {
+ flex: 3 1 80%;
+ order: 2;
+}
+
+.homepage-wrapper {
+ margin: 120px auto;
+}
+
+.homepage-wrapper .header {
+ font-size: 68px;
+ font-weight: 100;
+ line-height: 0.9em;
+ background: url('/images/friendica.svg') top left no-repeat;
+ background-size: 61px;
+ margin-left: 40px;
+}
+.homepage-wrapper .about {
+ text-align: justify;
+ line-height: 1.5em;
+ color: #555;
+}
+
+.homepage-wrapper .profiles {
+ margin-top: 3em;
+}
+
+.profiles {
+ padding: 0 10px;
+ column-width: 400px;
+}
+
+.profiles > figure {
+ display: inline-block;
+ cursor: pointer;
+}
+
+nav#links a,
+.sub-menu-outer a {
+ text-decoration: none;
+}
+
+.search-results .intro {
+ text-align: justify;
+}
+
+.site,
+.profile {
+ width: 100%;
+ text-decoration: none;
+ color: #000;
+ padding: 2px;
+ outline: none;
+ margin: 5px 0;
+ display: inline;
+ background-color: rgba(0, 0, 0, .01);
+ border-radius: 23px .5em 23px .5em;
+}
+
+.site {
+ padding: 14px 2px;
+ margin: 20px 0;
+ border-bottom: 1px dashed #ccc;
+}
+
+.profile.selected,
+.profile: focus,
+.profile: hover {
+ padding: 1px;
+ border: 1px solid #ccc;
+}
+
+.site .site-info,
+.site .site-supports,
+.profile .profile-photo,
+.profile .profile-info {
+ display: table-cell;
+ vertical-align: top;
+ text-align: left;
+}
+.site .site-supports {
+ text-align: right;
+ padding: 8px;
+}
+
+.profile .profile-photo {
+ float: left;
+ margin: 8px;
+ border-radius: 15px;
+ border: 1px solid #ddd;
+}
+.site .site-info,
+.profile .profile-info {
+ padding: 8px;
+ width: 100%;
+}
+.site .site-info strong,
+.profile .profile-info strong {
+ font-weight: 600;
+}
+.site .site-info .fa,
+.profile .profile-info .fa {
+ line-height: 1.1em;
+ color: #999;
+}
+.site .site-info .url,
+.profile .profile-info .url {
+ font-size: 80%;
+ margin-bottom: 3px;
+ color: #555;
+
+ /** @see https: //css-tricks.com/snippets/css/prevent-long-urls-from-breaking-out-of-container/ */
+ overflow-wrap: break-word;
+ word-wrap: break-word;
+ -ms-word-break: break-all;
+ word-break: break-all;
+ word-break: break-word;
+ -ms-hyphens: auto;
+ -moz-hyphens: auto;
+ -webkit-hyphens: auto;
+ hyphens: auto;
+}
+
+.profile .profile-info .description {
+ margin-bottom: .5em;
+}
+
+.search-wrapper {
+ position: relative;
+ display: inline-block;
+ width: 500px;
+ background: #f5f5f5;
+ border: 1px solid #ddd;
+ border-radius: 8px;
+ height: 38px;
+ line-height: 22px;
+}
+.search-wrapper .search-field {
+ line-height: 22px;
+ display: block;
+ border: none;
+ outline: none;
+ background: none;
+ padding: 8px 12px;
+ padding-right: 117px;
+ width: 100%;
+}
+.search-wrapper .reset {
+ position: absolute;
+ top: 0;
+ right: 65px;
+ height: 25px;
+ width: 25px;
+ margin: 6px;
+ padding: 0;
+ line-height: 1;
+ font-size: 12px;
+ color: #555;
+ background: #eee;
+ border: 1px solid #ddd;
+ border-radius: 20px;
+ font-family: 'FontAwesome';
+ font-weight: 100;
+ line-height: 25px;
+ text-decoration: none;
+}
+.search-wrapper .search {
+ border: none;
+ border-left: 1px solid #ddd;
+ color: #555;
+ background: #eee;
+ position: absolute;
+ top: 0;
+ right: 0;
+ height: 36px;
+ width: 65px;
+ border-radius: 0 8px 8px 0;
+}
+
+.health {font-size: 120%; vertical-align: bottom;}
+.health.very-bad { color: #f99; }
+.health.bad { color: #f1ba7a; }
+.health.neutral { color: #e6e782; }
+.health.ok { color: #bef273; }
+.health.good { color: #7cf273; }
+.health.perfect { color: #33ff80; }
+
+.btn {
+ border: 1px solid #ddd;
+ color: #555;
+ background: #eee;
+ border-radius: 8px 8px;
+ height: 36px;
+ line-height: 34px;
+ min-width: 80px;
+ padding: 0 10px;
+ text-decoration: none;
+ display: inline-block;
+}
+
+/* smaller than tablet in portrait */
+@media screen and (max-width: 880px) {
+
+ body {
+ overflow-x: hidden;
+ }
+
+ .mobile {
+ display: inherit !important;
+ }
+
+ #top-bar .header {
+ overflow: hidden;
+ width: 0px;
+ padding-left: 28px;
+ height: 28px;
+ background-size: 28px;
+ }
+
+ #top-bar .search-form {
+ display: block;
+ width: 100%;
+ padding: 0 35px;
+ margin: 0;
+ }
+
+ .homepage-wrapper,
+ .search-wrapper {
+ width: 100%;
+ max-width: 500px;
+ }
+ .homepage-wrapper .search-wrapper {
+ width: 100%;
+ }
+
+ .homepage-wrapper {
+ margin: 90px auto;
+ }
+
+ .search-results,
+ .sub-menu-outer .sub-menu-inner {
+ width: 95%;
+ max-width: 500px;
+ }
+
+ .hamburger {
+ padding: 8px;
+ font-size: 22px;
+ line-height: 22px;
+ cursor: pointer;
+ }
+
+ nav#links {
+ position: absolute;
+ width: 100%;
+ top: 54px;
+ right: 0;
+ padding-bottom: 5px;
+ }
+ nav#links .viewport {
+ position: absolute;
+ z-index: 1;
+ left: 100%;
+ width: 100%;
+ transition: left ease 200ms;
+ background: #fff;
+ padding: 20px 0;
+ box-shadow: 1px 3px 3px rgba(0,0,0,0.2);
+ font-size: 150%;
+ text-align: center;
+ }
+ nav#links.open .viewport {
+ left: 0%;
+ }
+ #top-bar nav#links .viewport {
+ background: #f5f5f5;
+ }
+ nav#links h3 {
+ margin: 0;
+ display: block;
+ line-height: 2em;
+ }
+ nav#links a {
+ display: block;
+ line-height: 2.5em;
+ margin: 4px 0;
+ }
+
+ .profile,
+ .profile .profile-info {
+ overflow-wrap: break-word;
+ word-wrap: break-word;
+ overflow: hidden;
+ }
+
+ .directory-results {
+ flex-flow: column;
+ }
+
+ .directory-results > aside {
+ order: 2;
+ }
+
+ .directory-results > section {
+ order: 1;
+ }
+
+}
+
+/* The moment the header starts getting squashed */
+@media screen and (max-width: 520px) {
+ .homepage-wrapper {
+ margin: 30px auto;
+ }
+ .homepage-wrapper .header {
+ font-size: 40px;
+ background-size: 36px;
+ display: inline-block;
+ margin-left: 18px;
+ width: 275px;
+ }
+}
+
+/* close to mobile in portrait */
+@media screen and (max-width: 400px) {
+
+ .profile .profile-photo {
+ width: 60px;
+ border-radius: 11.25px;
+ margin: 8px 4px;
+ }
+ .profile .profile-info .url {
+ display: none;
+ }
+
+}
diff --git a/boot.php b/boot.php
index 786f3045..1c869c39 100755
--- a/boot.php
+++ b/boot.php
@@ -1,419 +1,347 @@
\r\n");
+define('EOL', "
\r\n");
-define ( 'REGISTER_CLOSED', 0);
-define ( 'REGISTER_APPROVE', 1);
-define ( 'REGISTER_OPEN', 2);
+define('REGISTER_CLOSED', 0);
+define('REGISTER_APPROVE', 1);
+define('REGISTER_OPEN', 2);
-define ( 'DIRECTION_NONE', 0);
-define ( 'DIRECTION_IN', 1);
-define ( 'DIRECTION_OUT', 2);
-define ( 'DIRECTION_BOTH', 3);
+define('DIRECTION_NONE', 0);
+define('DIRECTION_IN', 1);
+define('DIRECTION_OUT', 2);
+define('DIRECTION_BOTH', 3);
-define ( 'NOTIFY_INTRO', 0x0001 );
-define ( 'NOTIFY_CONFIRM', 0x0002 );
-define ( 'NOTIFY_WALL', 0x0004 );
-define ( 'NOTIFY_COMMENT', 0x0008 );
-define ( 'NOTIFY_MAIL', 0x0010 );
+define('NOTIFY_INTRO', 0x0001);
+define('NOTIFY_CONFIRM', 0x0002);
+define('NOTIFY_WALL', 0x0004);
+define('NOTIFY_COMMENT', 0x0008);
+define('NOTIFY_MAIL', 0x0010);
-define ( 'NAMESPACE_DFRN' , 'http://purl.org/macgirvin/dfrn/1.0' );
+define('NAMESPACE_DFRN', 'http://purl.org/macgirvin/dfrn/1.0');
/**
* log levels
*/
+define('LOGGER_NORMAL', 0);
+define('LOGGER_TRACE', 1);
+define('LOGGER_DEBUG', 2);
+define('LOGGER_DATA', 3);
+define('LOGGER_ALL', 4);
-define ( 'LOGGER_NORMAL', 0 );
-define ( 'LOGGER_TRACE', 1 );
-define ( 'LOGGER_DEBUG', 2 );
-define ( 'LOGGER_DATA', 3 );
-define ( 'LOGGER_ALL', 4 );
-
-
-if(! class_exists('App')) {
-class App {
-
- public $module_loaded = false;
- public $query_string;
- public $config;
- public $page;
- public $profile;
- public $user;
- public $cid;
- public $contact;
- public $content;
- public $data;
- public $error = false;
- public $cmd;
- public $argv;
- public $argc;
- public $module;
- public $pager;
- public $strings;
- public $path;
-
- private $scheme;
- private $hostname;
- private $baseurl;
- private $db;
-
- function __construct() {
-
- $this->config = array();
- $this->page = array();
- $this->pager= array();
-
- $this->scheme = ((isset($_SERVER['HTTPS'])
- && ($_SERVER['HTTPS'])) ? 'https' : 'http' );
- $this->hostname = str_replace('www.','',
- $_SERVER['SERVER_NAME']);
- set_include_path("include/$this->hostname"
- . PATH_SEPARATOR . 'include'
- . PATH_SEPARATOR . '.' );
-
- if(substr($_SERVER['QUERY_STRING'],0,2) == "q=")
- $_SERVER['QUERY_STRING'] = substr($_SERVER['QUERY_STRING'],2);
-
- $this->query_string = $_SERVER['QUERY_STRING'];
-
- $this->cmd = trim($_GET['q'],'/');
-
-
- $this->argv = explode('/',$this->cmd);
- $this->argc = count($this->argv);
- if((array_key_exists('0',$this->argv)) && strlen($this->argv[0])) {
- $this->module = $this->argv[0];
- }
- else {
- $this->module = 'directory';
- }
-
- $this->pager['page'] = ((x($_GET,'page')) ? $_GET['page'] : 1);
- $this->pager['itemspage'] = 50;
- $this->pager['start'] = ($this->pager['page'] * $this->pager['itemspage']) - $this->pager['itemspage'];
- $this->pager['total'] = 0;
- }
-
- function get_baseurl($ssl = false) {
- if(strlen($this->baseurl))
- return $this->baseurl;
-
- $this->baseurl = (($ssl) ? 'https' : $this->scheme) . "://" . $this->hostname
- . ((isset($this->path) && strlen($this->path))
- ? '/' . $this->path : '' );
- return $this->baseurl;
- }
-
- function set_baseurl($url) {
- $this->baseurl = $url;
- $this->hostname = basename($url);
- }
-
- function get_hostname() {
- return $this->hostname;
- }
-
- function set_hostname($h) {
- $this->hostname = $h;
- }
-
- function set_path($p) {
- $this->path = ltrim(trim($p),'/');
- }
-
- function get_path() {
- return $this->path;
- }
-
- function set_pager_total($n) {
- $this->pager['total'] = intval($n);
- }
-
- function set_pager_itemspage($n) {
- $this->pager['itemspage'] = intval($n);
- $this->pager['start'] = ($this->pager['page'] * $this->pager['itemspage']) - $this->pager['itemspage'];
-
- }
-
- function init_pagehead() {
- if(file_exists("view/head.tpl"))
- $s = file_get_contents("view/head.tpl");
- $this->page['htmlhead'] = replace_macros($s,array(
- '$baseurl' => $this->get_baseurl()
- ));
- }
-
-}}
-
-
-if(! function_exists('x')) {
-function x($s,$k = NULL) {
- if($k != NULL) {
- if((is_array($s)) && (array_key_exists($k,$s))) {
- if($s[$k])
- return (int) 1;
- return (int) 0;
- }
- return false;
- }
- else {
- if(isset($s)) {
- if($s) {
- return (int) 1;
+if (!function_exists('x')) {
+ function x($s, $k = null)
+ {
+ if ($k != null) {
+ if ((is_array($s)) && (array_key_exists($k, $s))) {
+ if ($s[$k]) {
+ return (int) 1;
+ }
+ return (int) 0;
}
- return (int) 0;
+ return false;
+ } else {
+ if (isset($s)) {
+ if ($s) {
+ return (int) 1;
+ }
+ return (int) 0;
+ }
+ return false;
+ }
+ }
+}
+
+if (!function_exists('system_unavailable')) {
+ function system_unavailable()
+ {
+ include('system_unavailable.php');
+ killme();
+ }
+}
+
+if (!function_exists('logger')) {
+ function logger($msg, $level = 0)
+ {
+ $debugging = 1;
+ $loglevel = LOGGER_ALL;
+ $logfile = 'logfile.out';
+
+ if ((!$debugging) || (!$logfile) || ($level > $loglevel)) {
+ return;
+ }
+ require_once('include/datetime.php');
+
+ @file_put_contents($logfile, datetime_convert() . ':' . ' ' . $msg . "\n", FILE_APPEND);
+ return;
+ }
+}
+
+
+if (!function_exists('replace_macros')) {
+ function replace_macros($s, $r)
+ {
+ $search = array();
+ $replace = array();
+
+ if (is_array($r) && count($r)) {
+ foreach ($r as $k => $v) {
+ $search[] = $k;
+ $replace[] = $v;
+ }
+ }
+ return str_replace($search, $replace, $s);
+ }
+}
+
+
+if (!function_exists('load_translation_table')) {
+ function load_translation_table($lang)
+ {
+ global $a;
+ }
+}
+
+if (!function_exists('t')) {
+ function t($s)
+ {
+ global $a;
+
+ if ($a->strings[$s]) {
+ return $a->strings[$s];
+ }
+ return $s;
+ }
+}
+
+if (!function_exists('fetch_url')) {
+ function fetch_url($url, $binary = false, $timeout = 20)
+ {
+ $ch = curl_init($url);
+ if (!$ch) {
+ return false;
+ }
+
+ curl_setopt($ch, CURLOPT_HEADER, 0);
+ curl_setopt($ch, CURLOPT_TIMEOUT, max(intval($timeout), 1)); //Minimum of 1 second timeout.
+ curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
+ curl_setopt($ch, CURLOPT_MAXREDIRS, 8);
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+ if ($binary) {
+ curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
+ }
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
+ $s = curl_exec($ch);
+ curl_close($ch);
+ return($s);
+ }
+}
+
+if (!function_exists('post_url')) {
+ function post_url($url, $params)
+ {
+ $ch = curl_init($url);
+ if (!$ch) {
+ return false;
+ }
+
+ curl_setopt($ch, CURLOPT_HEADER, 0);
+ curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
+ curl_setopt($ch, CURLOPT_MAXREDIRS, 8);
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+ curl_setopt($ch, CURLOPT_POST, 1);
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
+ $s = curl_exec($ch);
+ curl_close($ch);
+ return($s);
+ }
+}
+
+if (!function_exists('random_string')) {
+ function random_string()
+ {
+ return(hash('sha256', uniqid(rand(), true)));
+ }
+}
+
+if (!function_exists('notags')) {
+ function notags($string)
+ {
+ // protect against :<> with high-bit set
+ return(str_replace(array("<", ">", "\xBA", "\xBC", "\xBE"), array('[', ']', '', '', ''), $string));
+ }
+}
+
+if (!function_exists('escape_tags')) {
+ function escape_tags($string)
+ {
+ return(htmlspecialchars($string));
+ }
+}
+
+if (!function_exists('login')) {
+ function login($register = false)
+ {
+ $o = "";
+ $register_html = (($register) ? file_get_contents("view/register-link.tpl") : "");
+
+
+ if (x($_SESSION, 'authenticated')) {
+ $o = file_get_contents("view/logout.tpl");
+ } else {
+ $o = file_get_contents("view/login.tpl");
+
+ $o = replace_macros($o, array('$register_html' => $register_html));
+ }
+ return $o;
+ }
+}
+
+if (!function_exists('killme')) {
+ function killme()
+ {
+ session_write_close();
+ closedb();
+ exit;
+ }
+}
+
+if (!function_exists('goaway')) {
+ function goaway($s)
+ {
+ header("Location: $s");
+ killme();
+ }
+}
+
+if (!function_exists('local_user')) {
+ function local_user()
+ {
+ if ((x($_SESSION, 'authenticated')) && (x($_SESSION, 'uid'))) {
+ return $_SESSION['uid'];
}
return false;
}
-}}
+}
-if(! function_exists('system_unavailable')) {
-function system_unavailable() {
- include('system_unavailable.php');
- killme();
-}}
-
-if(! function_exists('logger')) {
-function logger($msg,$level = 0) {
- $debugging = 1;
- $loglevel = LOGGER_ALL;
- $logfile = 'logfile.out';
-
- if((! $debugging) || (! $logfile) || ($level > $loglevel))
- return;
- require_once('include/datetime.php');
-
- @file_put_contents($logfile, datetime_convert() . ':' . ' ' . $msg . "\n", FILE_APPEND);
- return;
-}}
-
-
-if(! function_exists('replace_macros')) {
-function replace_macros($s,$r) {
-
- $search = array();
- $replace = array();
-
- if(is_array($r) && count($r)) {
- foreach ($r as $k => $v ) {
- $search[] = $k;
- $replace[] = $v;
+if (!function_exists('notice')) {
+ function notice($s)
+ {
+ if (!isset($_SESSION['sysmsg'])) {
+ $_SESSION['sysmsg'] = '';
}
+ $_SESSION['sysmsg'] .= $s;
}
- return str_replace($search,$replace,$s);
-}}
+}
-
-if(! function_exists('load_translation_table')) {
-function load_translation_table($lang) {
- global $a;
-
-}}
-
-if(! function_exists('t')) {
-function t($s) {
- global $a;
-
- if($a->strings[$s])
- return $a->strings[$s];
- return $s;
-}}
-
-
-
-
-if(! function_exists('fetch_url')) {
-function fetch_url($url,$binary = false, $timeout=20) {
- $ch = curl_init($url);
- if(! $ch) return false;
-
- curl_setopt($ch, CURLOPT_HEADER, 0);
- curl_setopt($ch, CURLOPT_TIMEOUT, max(intval($timeout), 1)); //Minimum of 1 second timeout.
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION,true);
- curl_setopt($ch, CURLOPT_MAXREDIRS,8);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
- if($binary)
- curl_setopt($ch, CURLOPT_BINARYTRANSFER,1);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- $s = curl_exec($ch);
- curl_close($ch);
- return($s);
-}}
-
-
-if(! function_exists('post_url')) {
-function post_url($url,$params) {
- $ch = curl_init($url);
- if(! $ch) return false;
-
- curl_setopt($ch, CURLOPT_HEADER, 0);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION,true);
- curl_setopt($ch, CURLOPT_MAXREDIRS,8);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
- curl_setopt($ch, CURLOPT_POST,1);
- curl_setopt($ch, CURLOPT_POSTFIELDS,$params);
- $s = curl_exec($ch);
- curl_close($ch);
- return($s);
-}}
-
-
-if(! function_exists('random_string')) {
-function random_string() {
- return(hash('sha256',uniqid(rand(),true)));
-}}
-
-if(! function_exists('notags')) {
-function notags($string) {
- // protect against :<> with high-bit set
- return(str_replace(array("<",">","\xBA","\xBC","\xBE"), array('[',']','','',''), $string));
-}}
-
-if(! function_exists('escape_tags')) {
-function escape_tags($string) {
-
- return(htmlspecialchars($string));
-}}
-
-if(! function_exists('login')) {
-function login($register = false) {
- $o = "";
- $register_html = (($register) ? file_get_contents("view/register-link.tpl") : "");
-
-
- if(x($_SESSION,'authenticated')) {
- $o = file_get_contents("view/logout.tpl");
+if (!function_exists('hex2bin')) {
+ function hex2bin($s)
+ {
+ return(pack("H*", $s));
}
- else {
- $o = file_get_contents("view/login.tpl");
+}
- $o = replace_macros($o,array('$register_html' => $register_html ));
- }
- return $o;
-}}
+if (!function_exists('paginate')) {
+ function paginate(&$a)
+ {
+ $o = '';
+ $stripped = preg_replace("/&page=[0-9]*/", "", $a->query_string);
+ $stripped = str_replace('q=', '', $stripped);
+ $stripped = trim($stripped, '/');
+ $pagenum = $a->pager['page'];
+ $url = $a->get_baseurl() . '/' . $stripped;
+ if ($a->pager['total'] > $a->pager['itemspage']) {
+ $o .= '
=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()}, -CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m, -g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)}, -text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}}, -setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return hl[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h= -h[3];l=0;for(m=h.length;l =0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m=== -"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g, -h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l ";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&& -q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML=""; -if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}(); -(function(){var g=s.createElement("div");g.innerHTML="";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}: -function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q =0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f
0)for(var j=d;j 0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j= -{},i;if(f&&a.length){e=0;for(var o=a.length;e -1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a=== -"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode", -d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")? -a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType=== -1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/"+d+">"},F={option:[1,""],legend:[1,""],thead:[1," ","
"],tr:[2,"","
"],td:[3,""],col:[2,"
"," "],area:[1,""],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div
"," ",""];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= -c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, -wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, -prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, -this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); -return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja, -""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]); -return this}else{e=0;for(var j=d.length;e 0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["", -""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]===" "&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e= -c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]? -c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja= -function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter= -Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a, -"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f= -a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b= -a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=/'.PHP_EOL; + $a->page['htmlhead'] .= ''.PHP_EOL; + $a->page['htmlhead'] .= ''.PHP_EOL; + $a->page['htmlhead'] .= ''.PHP_EOL; + $a->page['htmlhead'] .= ''; + //The overall health status. $r = q( "SELECT * FROM `site-health` @@ -142,6 +179,22 @@ function health_details($a, $id) $site = $r[0]; + //Does it redirect to a known site? + $redirectStatement = ''; + if($site['effective_base_url']){ + + //The effective health status. + $r = q( + "SELECT * FROM `site-health` + WHERE `base_url`= '%s'", + dbesc($site['effective_base_url']) + ); + if(count($r)){ + $redirectStatement = 'Redirects to '.$site['effective_base_url'].''; + } + + } + //Figure out SSL state. $urlMeta = parse_url($site['base_url']); if($urlMeta['scheme'] !== 'https'){ @@ -169,8 +222,10 @@ function health_details($a, $id) //Get avg probe speed. $r = q( "SELECT AVG(`request_time`) as `avg_probe_time` FROM `site-probe` - WHERE `site_health_id` = %u", - intval($site['id']) + WHERE `site_health_id` = %u + AND `dt_performed` > '%s'", + intval($site['id']), + $maxDate ); if(count($r)){ $site['avg_probe_time'] = $r[0]['avg_probe_time']; @@ -184,8 +239,10 @@ function health_details($a, $id) AVG(`photo_time`) as `avg_photo_time`, AVG(`total_time`) as `avg_submit_time` FROM `site-scrape` - WHERE `site_health_id` = %u", - intval($site['id']) + WHERE `site_health_id` = %u + AND `dt_performed` > '%s'", + intval($site['id']), + $maxDate ); if(count($r)){ $site['avg_profile_time'] = $r[0]['avg_profile_time']; @@ -196,62 +253,18 @@ function health_details($a, $id) //Get probe speed data. $r = q( - "SELECT `request_time`, `dt_performed` FROM `site-probe` - WHERE `site_health_id` = %u", - intval($site['id']) + "SELECT AVG(`request_time`) as `avg_time`, date(`dt_performed`) as `date` FROM `site-probe` + WHERE `site_health_id` = %u + AND `dt_performed` > '%s' + GROUP BY `date`", + intval($site['id']), + $maxDate ); if(count($r)){ //Include graphael line charts. - $a->page['htmlhead'] .= ''.PHP_EOL; - $a->page['htmlhead'] .= ''.PHP_EOL; - $a->page['htmlhead'] .= ''; - $speeds = array(); - $times = array(); - $mintime = time(); - foreach($r as $row){ - $speeds[] = $row['request_time']; - $time = strtotime($row['dt_performed']); - $times[] = $time; - if($mintime > $time) $mintime = $time; - } - for($i=0; $i < count($times); $i++){ - $times[$i] -= $mintime; - $times[$i] = floor($times[$i] / (24*3600)); - } - $a->page['htmlhead'] .= - ''; - } - - //Get scrape speed data. - $r = q( - "SELECT AVG(`total_time`) as `avg_time`, date(`dt_performed`) as `date` FROM `site-scrape` - WHERE `site_health_id` = %u GROUP BY `date`", - intval($site['id']) - // date('Y-m-d H:i:s', time()-(3*24*3600)) //Max 3 days old. - ); - if($r && count($r)){ - //Include graphael line charts. - $a->page['htmlhead'] .= ''.PHP_EOL; - $a->page['htmlhead'] .= ''.PHP_EOL; - $a->page['htmlhead'] .= ''; + $a->page['htmlhead'] .= ''.PHP_EOL; + $a->page['htmlhead'] .= ''.PHP_EOL; + $a->page['htmlhead'] .= ''; $speeds = array(); $times = array(); $mintime = time(); @@ -267,23 +280,82 @@ function health_details($a, $id) } $a->page['htmlhead'] .= ''; + } + + //Get scrape speed data. + $r = q( + "SELECT AVG(`total_time`) as `avg_time`, date(`dt_performed`) as `date` FROM `site-scrape` + WHERE `site_health_id` = %u + AND `dt_performed` > '%s' + GROUP BY `date`", + intval($site['id']), + $maxDate + ); + if($r && count($r)){ + //Include graphael line charts. + $a->page['htmlhead'] .= ''.PHP_EOL; + $a->page['htmlhead'] .= ''.PHP_EOL; + $a->page['htmlhead'] .= ''; + $speeds = array(); + $times = array(); + $mintime = time(); + foreach($r as $row){ + $speeds[] = $row['avg_time']; + $time = strtotime($row['date']); + $times[] = $time; + if($mintime > $time) $mintime = $time; + } + for($i=0; $i < count($times); $i++){ + $times[$i] -= $mintime; + $times[$i] = floor($times[$i] / (24*3600)); + } + $a->page['htmlhead'] .= + ''; } @@ -298,6 +370,7 @@ function health_details($a, $id) $tpl .= file_get_contents('view/health_details.tpl'); return replace_macros($tpl, array( '$name' => $site['name'], + '$redirectStatement' => $redirectStatement, '$policy' => $policy, '$site_info' => $site['info'], '$base_url' => $site['base_url'], @@ -320,5 +393,3 @@ function health_details($a, $id) '$avg_photo_time' => round($site['avg_photo_time']), '$avg_submit_time' => round($site['avg_submit_time']) )); - -} \ No newline at end of file diff --git a/mod/help.php b/mod/help.php new file mode 100644 index 00000000..db14e7a6 --- /dev/null +++ b/mod/help.php @@ -0,0 +1,10 @@ +output(); + } +} + diff --git a/mod/home.php b/mod/home.php old mode 100755 new mode 100644 index 3c437657..28c9432c --- a/mod/home.php +++ b/mod/home.php @@ -1,14 +1,17 @@ get_baseurl() . "/profile/" . $r[0]['nickname'] ); - else - goaway( $a->get_baseurl() . "/register" ); +use Friendica\Directory\Rendering\View; +use Friendica\Directory\Helper\Profile as ProfileHelper; +if(! function_exists('home_content')) { +function home_content(&$a) { + + $profiles = q("SELECT * FROM profile WHERE comm=1 AND LENGTH(pdesc)>0 ORDER BY RAND() LIMIT 3"); + + $view = new View('homepage', 'minimal'); + $view->addHelper('photoUrl', ProfileHelper::get('photoUrl')); + $view->output(array( + 'profiles' => $profiles + )); + }} - - diff --git a/mod/login.php b/mod/login.php old mode 100755 new mode 100644 diff --git a/mod/lsearch.php b/mod/lsearch.php old mode 100755 new mode 100644 diff --git a/mod/moderate.php b/mod/moderate.php old mode 100755 new mode 100644 index 0d1b9879..52ffe94b --- a/mod/moderate.php +++ b/mod/moderate.php @@ -107,9 +107,6 @@ function moderate_content(&$a) { $details .= $rr['country-name']; } - if(strlen($rr['gender'])) - $details .= '
' . t('Gender: ') . t($rr['gender']) ; - $o .= replace_macros($tpl,array( '$id' => $rr['id'], '$mod' => '', @@ -120,8 +117,7 @@ function moderate_content(&$a) { '$star' => '', '$pclass' => (($rr['comm']) ? ' group' : ''), '$pgroup' => (($rr['comm']) ? '' . t('[Public Group]') . '' : ''), - '$details' => $pdesc . $details, - '$marital' => ((strlen($rr['marital'])) ? '♥ Status: ' . $rr['marital'] . '' : '') + '$details' => $pdesc . $details diff --git a/mod/msearch.php b/mod/msearch.php old mode 100755 new mode 100644 diff --git a/mod/opensearch.php b/mod/opensearch.php old mode 100755 new mode 100644 diff --git a/mod/photo.php b/mod/photo.php old mode 100755 new mode 100644 index 31d8c6cc..c832a9e9 --- a/mod/photo.php +++ b/mod/photo.php @@ -1,9 +1,12 @@ argc) { +require_once 'datetime.php'; + +function photo_init(App $a) +{ + switch ($a->argc) { case 2: $photo = $a->argv[1]; break; @@ -14,18 +17,36 @@ function photo_init(&$a) { $profile_id = str_replace('.jpg', '', $photo); - $r = q("SELECT * FROM `photo` WHERE `profile-id` = %d LIMIT 1", - intval($profile_id) - ); - if(count($r)) { + $r = q('SELECT * FROM `photo` WHERE `profile-id` = %d LIMIT 1', intval($profile_id)); + + if (count($r)) { $data = $r[0]['data']; } - if(x($data) === false || (! strlen($data))) { - $data = file_get_contents('images/default-profile-sm.jpg'); + + if (x($data) === false || (!strlen($data))) { + $data = file_get_contents('images/default-profile-sm.jpg'); } - header("Content-type: image/jpeg"); - header('Expires: ' . datetime_convert('UTC','UTC', 'now + 1 week', 'D, d M Y H:i:s' . ' GMT')); + //Enable async process from here. + session_write_close(); + + //Try and cache our result. + $etag = md5($data); + header('Etag: ' . $etag); + header('Expires: ' . datetime_convert('UTC', 'UTC', 'now + 1 week', 'D, d M Y H:i:s' . ' GMT')); + header('Cache-Control: max-age=' . intval(7 * 24 * 3600)); + + if (function_exists('header_remove')) { + header_remove('Pragma'); + header_remove('pragma'); + } + + if (isset($_SERVER['HTTP_IF_NONE_MATCH']) && $_SERVER['HTTP_IF_NONE_MATCH'] == $etag) { + header('HTTP/1.1 304 Not Modified'); + exit; + } + + header('Content-type: image/jpeg'); echo $data; exit; -} \ No newline at end of file +} diff --git a/mod/pubsites.php b/mod/pubsites.php old mode 100755 new mode 100644 diff --git a/mod/redir.php b/mod/redir.php old mode 100755 new mode 100644 diff --git a/mod/search.php b/mod/search.php new file mode 100644 index 00000000..9847f14b --- /dev/null +++ b/mod/search.php @@ -0,0 +1,97 @@ +argc >= 2) { + $filter = $a->argv[1]; + switch ($filter) { + + case 'forums': + $community = 1; + break; + + case 'people': + $community = 0; + break; + + default: + $community = null; + $filter = null; + break; + } + } + + $alpha = false; + if (x($_GET, 'alpha') == 1) + $alpha = true; + + //Query + $search = ((x($_GET, 'query')) ? notags(trim($_GET['query'])) : ''); + + if (empty($search)) { + goaway('/home'); + } + + if ($search) { + $alpha = true; + } + + //Run our query. + if ($search) { + $search = dbesc($search . '*'); + } + + $sql_extra = ((strlen($search)) ? " AND MATCH (`name`, `pdesc`, `homepage`, `locality`, `region`, `country-name`, `tags` ) + AGAINST ('$search' IN BOOLEAN MODE) " : ''); + + if (!is_null($community)) { + $sql_extra .= ' AND `comm` = ' . intval($community) . ' '; + } + + $sql_extra = str_replace('%', '%%', $sql_extra); + + $total = 0; + $r = q("SELECT COUNT(*) AS `total` FROM `profile` WHERE `censored` = 0 $sql_extra "); + if (count($r)) { + $total = $r[0]['total']; + $a->set_pager_total($total); + } + + if ($alpha) { + $order = ' ORDER BY `name` ASC '; + } else { + $order = ' ORDER BY `updated` DESC, `id` DESC '; + } + + $r = q("SELECT * FROM `profile` WHERE `censored` = 0 $sql_extra $order LIMIT %d , %d ", + intval($a->pager['start']), + intval($a->pager['itemspage']) + ); + + //Show results. + $view = new View('search'); + + $view->addHelper('paginate', function() use ($a) { + return paginate($a); + }); + $view->addHelper('photoUrl', ProfileHelper::get('photoUrl')); + $view->addHelper('filterAllUrl', SearchHelper::get('filterAllUrl')); + $view->addHelper('filterPeopleUrl', SearchHelper::get('filterPeopleUrl')); + $view->addHelper('filterForumsUrl', SearchHelper::get('filterForumsUrl')); + + $view->output(array( + 'total' => number_format($total), + 'results' => $r, + 'filter' => $filter, + 'query' => x($_GET, 'query') ? $_GET['query'] : '' + )); +} diff --git a/mod/servers.php b/mod/servers.php new file mode 100644 index 00000000..8ad4776a --- /dev/null +++ b/mod/servers.php @@ -0,0 +1,127 @@ + $v) + { + + //Stop at unhealthy sites. + $site = $site_healths[$k]; + + if($site['health_score'] <= 20) break; + + //Skip small sites. + $users = $sites[$k]; + if($users < 5) continue; + + //Add health score name and user count. + $site['health_score_name'] = health_score_to_name($site['health_score']); + $site['users'] = $users; + + //Figure out what this server supports. + $plugins = explode("\r\n", $site['plugins']); + $site['plugins'] = $plugins; + $hasPlugin = function(array $input)use($plugins){ + return !!count(array_intersect($input, $plugins)); + }; + + $site['supports'] = array( + 'HTTPS' => $site['ssl_state'] == 1, + 'Twitter' => $hasPlugin(array('buffer', 'twitter')), + 'Facebook' => $hasPlugin(array('buffer')), + 'Google+' => $hasPlugin(array('buffer', 'gpluspost')), + 'RSS/Atom' => true, //Built-in. + 'Diaspora*' => $hasPlugin(array('diaspora')), + 'pump.io' => $hasPlugin(array('pumpio')), + 'StatusNet' => $hasPlugin(array('statusnet')), + 'Tumblr' => $hasPlugin(array('tumblr')), + 'Blogger' => $hasPlugin(array('blogger')), + 'Dreamwidth' => $hasPlugin(array('dwpost')), + 'Wordpress' => $hasPlugin(array('wppost')), + 'LiveJournal' => $hasPlugin(array('ljpost')), + 'Insanejournal' => $hasPlugin(array('ijpost')), + 'Libertree' => $hasPlugin(array('libertree')) + ); + + //Subset of the full support list, to show popular items. + $site['popular_supports'] = array( + 'HTTPS' => $site['supports']['HTTPS'], + 'Twitter' => $site['supports']['Twitter'], + 'Google+' => $site['supports']['Google+'], + 'Wordpress' => $site['supports']['Wordpress'] + ); + + //For practical usage. + $site['less_popular_supports'] = array_diff_assoc($site['supports'], $site['popular_supports']); + + //Get the difference. + $site['supports_more'] = 0; + foreach ($site['supports'] as $key => $value){ + if($value && !array_key_exists($key, $site['popular_supports'])){ + $site['supports_more']++; + } + } + + //Push to results. + $public_sites[] = $site; + + //Count the result. + $total ++; + + } + + //In case we asked for a surprise, pick a random one from the top 10! :D + if($a->argc > 1 && $a->argv[1] == 'surprise'){ + $max = min(count($public_sites), 10); + $i = mt_rand(0, $max-1); + $surpriseSite = $public_sites[$i]; + header('Location:'.$surpriseSite['base_url'].'/register'); + exit; + } + + + //Show results. + $view = new View('servers'); + + $view->output(array( + 'total' => number_format($total), + 'sites' => $public_sites + )); + +} diff --git a/mod/settings.php b/mod/settings.php old mode 100755 new mode 100644 diff --git a/mod/siteinfo.php b/mod/siteinfo.php old mode 100755 new mode 100644 diff --git a/mod/sites.php b/mod/sites.php old mode 100755 new mode 100644 diff --git a/mod/stats.php b/mod/stats.php new file mode 100644 index 00000000..866b33cd --- /dev/null +++ b/mod/stats.php @@ -0,0 +1,10 @@ +output(); + } +} + diff --git a/mod/submit.php b/mod/submit.php old mode 100755 new mode 100644 diff --git a/mod/updatesites.php b/mod/updatesites.php old mode 100755 new mode 100644 diff --git a/mod/viewcontacts.php b/mod/viewcontacts.php old mode 100755 new mode 100644 diff --git a/mod/wall_upload.php b/mod/wall_upload.php old mode 100755 new mode 100644 diff --git a/mod/xrd.php b/mod/xrd.php old mode 100755 new mode 100644 diff --git a/src/App.php b/src/App.php new file mode 100644 index 00000000..8540892a --- /dev/null +++ b/src/App.php @@ -0,0 +1,123 @@ +config = array(); + $this->page = array(); + $this->pager = array(); + + $this->scheme = ((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'])) ? 'https' : 'http'); + $this->hostname = str_replace('www.', '', $_SERVER['SERVER_NAME']); + set_include_path(get_include_path() + . PATH_SEPARATOR . "include/$this->hostname" + . PATH_SEPARATOR . 'include' + . PATH_SEPARATOR . '.'); + + if (substr($_SERVER['QUERY_STRING'], 0, 2) == "q=") { + $_SERVER['QUERY_STRING'] = substr($_SERVER['QUERY_STRING'], 2); + } + + $this->query_string = $_SERVER['QUERY_STRING']; + + $q = isset($_GET['q']) ? $_GET['q'] : ''; + $this->cmd = trim($q, '/'); + + $this->argv = explode('/', $this->cmd); + $this->argc = count($this->argv); + if ((array_key_exists('0', $this->argv)) && strlen($this->argv[0])) { + $this->module = $this->argv[0]; + } else { + $this->module = 'directory'; + } + + $this->pager['page'] = ((x($_GET, 'page')) ? $_GET['page'] : 1); + $this->pager['itemspage'] = 50; + $this->pager['start'] = ($this->pager['page'] * $this->pager['itemspage']) - $this->pager['itemspage']; + $this->pager['total'] = 0; + } + + public function get_baseurl($ssl = false) + { + if (strlen($this->baseurl)) { + return $this->baseurl; + } + + $this->baseurl = (($ssl) ? 'https' : $this->scheme) . "://" . $this->hostname + . ((isset($this->path) && strlen($this->path)) ? '/' . $this->path : ''); + return $this->baseurl; + } + + public function set_baseurl($url) + { + $this->baseurl = $url; + $this->hostname = basename($url); + } + + public function get_hostname() + { + return $this->hostname; + } + + public function set_hostname($h) + { + $this->hostname = $h; + } + + public function set_path($p) + { + $this->path = ltrim(trim($p), '/'); + } + + public function get_path() + { + return $this->path; + } + + public function set_pager_total($n) + { + $this->pager['total'] = intval($n); + } + + public function set_pager_itemspage($n) + { + $this->pager['itemspage'] = intval($n); + $this->pager['start'] = ($this->pager['page'] * $this->pager['itemspage']) - $this->pager['itemspage']; + } + + public function init_pagehead() + { + if (file_exists("view/head.tpl")) { + $s = file_get_contents("view/head.tpl"); + } + $this->page['htmlhead'] = replace_macros($s, array( + '$baseurl' => $this->get_baseurl() + )); + } +} \ No newline at end of file diff --git a/src/Example/Hello.php b/src/Example/Hello.php new file mode 100644 index 00000000..d45fbf92 --- /dev/null +++ b/src/Example/Hello.php @@ -0,0 +1,10 @@ +{$name}; + } + + public function __construct() + { + global $a; + $this->app = $a; + } + + //Provides access to a wrapper for your helper functions. + public function __get($name) + { + if (!method_exists($this, $name)) { + throw new OutOfBoundsException("Helper method '$name' does not exist on " . get_class($this)); + } + + $helper = $this; + $method = new ReflectionMethod($this, $name); + return function()use($method, $helper) { + $arguments = func_get_args(); + return $method->invokeArgs($helper, $arguments); + }; + } +} diff --git a/src/Helper/Profile.php b/src/Helper/Profile.php new file mode 100644 index 00000000..7fca5366 --- /dev/null +++ b/src/Helper/Profile.php @@ -0,0 +1,16 @@ +app->get_baseurl() . '/photo/' . $profileId; + } + +} \ No newline at end of file diff --git a/src/Helper/Search.php b/src/Helper/Search.php new file mode 100644 index 00000000..f33ef552 --- /dev/null +++ b/src/Helper/Search.php @@ -0,0 +1,26 @@ +app->get_baseurl() . '/search?query=' . urlencode($query); + } + + public function filterPeopleUrl($query) + { + return $this->app->get_baseurl() . '/search/people?query=' . urlencode($query); + } + + public function filterForumsUrl($query) + { + return $this->app->get_baseurl() . '/search/forums?query=' . urlencode($query); + } + +} \ No newline at end of file diff --git a/src/Rendering/View.php b/src/Rendering/View.php new file mode 100644 index 00000000..5b6d87f7 --- /dev/null +++ b/src/Rendering/View.php @@ -0,0 +1,109 @@ +helpers; + } + + public function addHelper($name, Closure $helper) + { + $this->helpers[$name] = $helper; + } + + public function getView(){ + return $this->view; + } + + public function setView($value){ + $this->view = $value; + } + + public function getLayout(){ + return $this->layout; + } + + public function setLayout($value){ + $this->layout = $value; + } + + public function __construct($view=null, $layout="default") + { + + $this->view = $view; + $this->layout = $layout; + $this->helpers = array(); + + } + + public function render(array $data=array()) + { + + //First the outer view. + $view = self::getViewPath($this->view); + $viewContent = $this->encapsulatedRequire($view, $data); + + //Then the layout, including the view as $content. + $data['content'] = $viewContent; + $layout = self::getLayoutPath($this->layout); + return $this->encapsulatedRequire($layout, $data); + + } + + public function output(array $data=array()) + { + + header("Content-type: text/html; charset=utf-8"); + echo $this->render($data); + exit; + + } + + public function encapsulatedRequire($filename, array $data=null) + { + + //This will provide our variables on the global scope. + $call = function($__FILE__, $__VARS__){ + extract($__VARS__, EXTR_SKIP); + require $__FILE__; + }; + + //Use our current data as fallback. + if(!is_array($data)){ + $data = $this->currentData; + } + + //This will add the helper class to $this. + $helpers = new ViewHelpers($this, $data); + $call = $call->bindTo($helpers, get_class($helpers)); + + //Run and return the value. + ob_start(); + $call($filename, $data); + return ob_get_clean(); + + } + +} \ No newline at end of file diff --git a/src/Rendering/ViewHelpers.php b/src/Rendering/ViewHelpers.php new file mode 100644 index 00000000..1ee0c652 --- /dev/null +++ b/src/Rendering/ViewHelpers.php @@ -0,0 +1,59 @@ +view = $view; + $this->contextData = $contextData; + } + + public function view($name, array $overrides=null) + { + + $data = $this->contextData; + + if(is_array($overrides)){ + $data = array_merge($data, $overrides); + } + + return $this->view->encapsulatedRequire(View::getViewPath($name), $data); + + } + + public function layout($name, array $overrides=null) + { + + $data = $this->contextData; + + if(is_array($overrides)){ + $data = array_merge($data, $overrides); + } + + return $this->view->encapsulatedRequire(View::getLayoutPath($name), $data); + + } + + public function __call($name, $arguments) + { + + $helpers = $this->view->getHelpers(); + + if(array_key_exists($name, $helpers)){ + return call_user_func_array($helpers[$name], $arguments); + } + + throw new BadMethodCallException("Helper method '$name' does not exist or is not added."); + + } + +} \ No newline at end of file diff --git a/src/templates/layout/_navigation.php b/src/templates/layout/_navigation.php new file mode 100644 index 00000000..bddaf155 --- /dev/null +++ b/src/templates/layout/_navigation.php @@ -0,0 +1,10 @@ + + \ No newline at end of file diff --git a/src/templates/layout/_searcher.php b/src/templates/layout/_searcher.php new file mode 100644 index 00000000..baf1fe95 --- /dev/null +++ b/src/templates/layout/_searcher.php @@ -0,0 +1,7 @@ + diff --git a/src/templates/layout/_topBar.php b/src/templates/layout/_topBar.php new file mode 100644 index 00000000..3c698849 --- /dev/null +++ b/src/templates/layout/_topBar.php @@ -0,0 +1,14 @@ ++ + + + \ No newline at end of file diff --git a/src/templates/layout/default.php b/src/templates/layout/default.php new file mode 100644 index 00000000..ccac1ae3 --- /dev/null +++ b/src/templates/layout/default.php @@ -0,0 +1,5 @@ +layout('minimal', array( + 'topBar' => $this->layout('_topBar') +)); diff --git a/src/templates/layout/minimal.php b/src/templates/layout/minimal.php new file mode 100644 index 00000000..8044d640 --- /dev/null +++ b/src/templates/layout/minimal.php @@ -0,0 +1,22 @@ + + + + + + + ++ Friendica
+ + + layout('_searcher'); ?> + + layout('_navigation'); ?> + +
Directory +Friendica Directory + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/templates/view/_profile.php b/src/templates/view/_profile.php new file mode 100644 index 00000000..46d143d0 --- /dev/null +++ b/src/templates/view/_profile.php @@ -0,0 +1,37 @@ + \ No newline at end of file diff --git a/src/templates/view/_site.php b/src/templates/view/_site.php new file mode 100644 index 00000000..b5333b8f --- /dev/null +++ b/src/templates/view/_site.php @@ -0,0 +1,40 @@ ++ +diff --git a/src/templates/view/directory.php b/src/templates/view/directory.php new file mode 100644 index 00000000..19d5f240 --- /dev/null +++ b/src/templates/view/directory.php @@ -0,0 +1,35 @@ + + ++ Features + $value): if(!$value) continue; ?> + +++ , Grade: √ ++ + 0): ?> + + $value){ + if(!$value) continue; + $more .= $key.PHP_EOL; + } + ?> + + more + ++ +diff --git a/src/templates/view/help.php b/src/templates/view/help.php new file mode 100644 index 00000000..d7f6cbe3 --- /dev/null +++ b/src/templates/view/help.php @@ -0,0 +1,9 @@ ++ ++ + + view('_profile', array('profile' => $profile)); + } + ?> + + + + ++ paginate();?> +There were no results
+ + + ++\ No newline at end of file diff --git a/src/templates/view/homepage.php b/src/templates/view/homepage.php new file mode 100644 index 00000000..a1d7f0c3 --- /dev/null +++ b/src/templates/view/homepage.php @@ -0,0 +1,25 @@ +layout('_navigation'); ?> + +++Help
+Registering a Friendica account (with an existing server)
+Setting up a Friendica server
+Finding people - Getting new friends
+More help
++ +diff --git a/src/templates/view/search.php b/src/templates/view/search.php new file mode 100644 index 00000000..f3cc544d --- /dev/null +++ b/src/templates/view/search.php @@ -0,0 +1,29 @@ + + ++ Friendica
+ + layout('_searcher'); ?> + +
Directory ++ Friendica is a decentralized social network. + And this is a directory to find people on this network. + If you want to create your own account on a public server, have a look + on our Public servers listing. +
+ +++ +Random groups
+ view('_profile', array('profile'=>$profile)); + ?> ++diff --git a/src/templates/view/servers.php b/src/templates/view/servers.php new file mode 100644 index 00000000..4cc8f6dc --- /dev/null +++ b/src/templates/view/servers.php @@ -0,0 +1,24 @@ +Results for "" ()
++ + + view('_profile', array('profile' => $profile)); + } + ?> + + + + ++ paginate();?> +There were no results
+ + ++\ No newline at end of file diff --git a/src/templates/view/stats.php b/src/templates/view/stats.php new file mode 100644 index 00000000..a62a4e2c --- /dev/null +++ b/src/templates/view/stats.php @@ -0,0 +1,5 @@ +++Public servers
++ If you are not interested in hosting your own server, you can still use Friendica. + Here are some public server run by enthousiasts that you can join. + We recommend these based on their health. +
++ Keep in mind that different servers may support different features like communicating with additional networks besides Friendica. + It's best to pick the one that best suits your needs. +
+ ++ Surprise me » ++ +Recommending public servers
+ view('_site', array('site'=>$site)); + ?> ++diff --git a/tests/phpunit.xml b/tests/phpunit.xml new file mode 100644 index 00000000..36d1d950 --- /dev/null +++ b/tests/phpunit.xml @@ -0,0 +1,12 @@ +++Stats
++ diff --git a/tests/unit/src/Example/HelloTest.php b/tests/unit/src/Example/HelloTest.php new file mode 100644 index 00000000..3e6c06a0 --- /dev/null +++ b/tests/unit/src/Example/HelloTest.php @@ -0,0 +1,23 @@ +sayHello(); + + //Check that it returns the message we expect. + $this->assertEquals("Hello world!", $output); + + } + +} \ No newline at end of file diff --git a/.htconfig.php b/util/htconfig.vagrant.php similarity index 90% rename from .htconfig.php rename to util/htconfig.vagrant.php index 6752b9cd..4c2d39fb 100644 --- a/.htconfig.php +++ b/util/htconfig.vagrant.php @@ -2,9 +2,9 @@ //MySQL host. $db_host = 'localhost'; -$db_user = 'friendica-dir'; -$db_pass = 'thisisyourpasswordbuddy'; -$db_data = 'friendica-dir'; +$db_user = 'root'; +$db_pass = 'root'; +$db_data = 'friendica_dir'; // Choose a legal default timezone. If you are unsure, use "America/Los_Angeles". // It can be changed later and only applies to timestamps for anonymous viewers. @@ -13,6 +13,14 @@ $default_timezone = 'Europe/Amsterdam'; // What is your site name? $a->config['sitename'] = "EXPERIMENTAL Friendica public directory"; +//Statistic display settings. +$a->config['stats'] = array( + + //For site health, the max age for which to display data. + 'maxDataAge' => 3600*24*30*4 //120 days = ~4 months + +); + //Settings related to the syncing feature. $a->config['syncing'] = array( @@ -46,7 +54,7 @@ $a->config['site-health'] = array( //Wait for at least ... before probing a site again. //The longer this value, the more "stable" site-healths will be over time. //Note: If a bad (negative) health site submits something, a probe will be performed regardless. - 'min_probe_delay' => 3*24*3600, // 3 days + 'min_probe_delay' => 24*3600, // 1 day //Probes get a simple /friendica/json file from the server. //Feel free to set this timeout to a very tight value. diff --git a/util/messages.po b/util/messages.po index 290c930e..e68df2ea 100644 --- a/util/messages.po +++ b/util/messages.po @@ -178,10 +178,6 @@ msgstr "" msgid "Search for: " msgstr "" -#: ../../mod/directory.php:96 ../../mod/moderate.php:109 -msgid "Gender: " -msgstr "" - #: ../../mod/directory.php:100 msgid "Flag this entry" msgstr "" diff --git a/util/run_xgettext.sh b/util/run_xgettext.sh old mode 100644 new mode 100755 diff --git a/util/vagrant_default_sync_servers.sql b/util/vagrant_default_sync_servers.sql new file mode 100644 index 00000000..4ed4e0e7 --- /dev/null +++ b/util/vagrant_default_sync_servers.sql @@ -0,0 +1,5 @@ +-- +-- Sync targets to poulate the development directory +-- +INSERT INTO `friendica_dir`.`sync-targets` (`base_url`, `pull`, `push`, `dt_last_pull`) VALUES ('dir.friendica.com', 1, 0, ''); +INSERT INTO `friendica_dir`.`sync-targets` (`base_url`, `pull`, `push`, `dt_last_pull`) VALUES ('dir.friendi.ca', 1, 0, ''); \ No newline at end of file diff --git a/util/vagrant_provision.sh b/util/vagrant_provision.sh new file mode 100644 index 00000000..d9013e92 --- /dev/null +++ b/util/vagrant_provision.sh @@ -0,0 +1,84 @@ +#!/bin/bash +#Script to setup the vagrant instance for running friendica +# +#DO NOT RUN on your physical machine as this won't be of any use +#and f.e. deletes your /var/www/ folder! +echo "Friendica configuration settings" +sudo apt-get update + +#Selfsigned cert +echo ">>> Installing *.xip.io self-signed SSL" +SSL_DIR="/etc/ssl/xip.io" +DOMAIN="*.xip.io" +PASSPHRASE="vaprobash" +SUBJ=" +C=US +ST=Connecticut +O=Vaprobash +localityName=New Haven +commonName=$DOMAIN +organizationalUnitName= +emailAddress= +" +sudo mkdir -p "$SSL_DIR" +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" +sudo apt-get install -y apache2 +sudo a2enmod rewrite actions ssl +sudo cp /vagrant/util/vagrant_vhost.sh /usr/local/bin/vhost +sudo chmod guo+x /usr/local/bin/vhost +sudo vhost -s 192.168.33.10.xip.io -d /var/www -p /etc/ssl/xip.io -c xip.io -a friendica.dev +sudo a2dissite 000-default +sudo service apache2 restart + +#Install php +echo ">>> Installing PHP5" +sudo apt-get install -y php5 libapache2-mod-php5 php5-cli php5-mysql php5-curl php5-gd +sudo service apache2 restart + + +#Install mysql +echo ">>> Installing Mysql" +sudo debconf-set-selections <<< "mysql-server mysql-server/root_password password root" +sudo debconf-set-selections <<< "mysql-server mysql-server/root_password_again password root" +sudo apt-get install -qq mysql-server +# enable remote access +# setting the mysql bind-address to allow connections from everywhere +sed -i "s/bind-address.*/bind-address = 0.0.0.0/" /etc/mysql/my.cnf +# adding grant privileges to mysql root user from everywhere +# thx to http://stackoverflow.com/questions/7528967/how-to-grant-mysql-privileges-in-a-bash-script for this +MYSQL=`which mysql` +Q1="GRANT ALL ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;" +Q2="FLUSH PRIVILEGES;" +SQL="${Q1}${Q2}" +$MYSQL -uroot -proot -e "$SQL" +service mysql restart + +#make the vagrant directory the docroot +sudo rm -rf /var/www/ +sudo ln -fs /vagrant /var/www + +# initial config file for friendica in vagrant +cp /vagrant/util/htconfig.vagrant.php /vagrant/.htconfig.php + +# create the friendica database +echo "create database friendica_dir" | mysql -u root -proot +# import test database +$MYSQL -uroot -proot friendica_dir < /vagrant/dfrndir.sql +$MYSQL -uroot -proot friendica_dir < /vagrant/util/vagrant_default_sync_servers.sql + +#Install composer +cd /vagrant +curl -sS https://getcomposer.org/installer | php +php composer.phar install + +#create cronjob +echo "*/30 * * * * www-data cd /vagrant; php include/cron_maintain.php" >> friendicacron +echo "*/5 * * * * www-data cd /vagrant; php include/cron_sync.php" >> friendicacron +sudo crontab friendicacron +sudo rm friendicacron \ No newline at end of file diff --git a/util/vagrant_vhost.sh b/util/vagrant_vhost.sh new file mode 100644 index 00000000..f26d8e14 --- /dev/null +++ b/util/vagrant_vhost.sh @@ -0,0 +1,177 @@ +#!/usr/bin/env bash + +# Run this as sudo! +# I move this file to /usr/local/bin/vhost and run command 'vhost' from anywhere, using sudo. + +# +# Show Usage, Output to STDERR +# +function show_usage { +cat <<- _EOF_ + +Create a new vHost in Ubuntu Server +Assumes /etc/apache2/sites-available and /etc/apache2/sites-enabled setup used + + -d DocumentRoot - i.e. /var/www/yoursite + -h Help - Show this menu. + -s ServerName - i.e. example.com or sub.example.com + -a ServerAlias - i.e. *.example.com or another domain altogether + -p File path to the SSL certificate. Directories only, no file name. + If using an SSL Certificate, also creates a port :443 vhost as well. + This *ASSUMES* a .crt and a .key file exists + at file path /provided-file-path/your-server-or-cert-name.[crt|key]. + Otherwise you can except Apache errors when you reload Apache. + Ensure Apache's mod_ssl is enabled via "sudo a2enmod ssl". + -c Certificate filename. "xip.io" becomes "xip.io.key" and "xip.io.crt". + + Example Usage. Serve files from /var/www/xip.io at http(s)://192.168.33.10.xip.io + using ssl files from /etc/ssl/xip.io/xip.io.[key|crt] + sudo vhost -d /var/www/xip.io -s 192.168.33.10.xip.io -p /etc/ssl/xip.io -c xip.io + +_EOF_ +exit 1 +} + + +# +# Output vHost skeleton, fill with userinput +# To be outputted into new file +# +function create_vhost { +cat <<- _EOF_ ++ ++ +unit/src ++ ++ +../src ++ ServerAdmin webmaster@localhost + ServerName $ServerName + $ServerAlias + + DocumentRoot $DocumentRoot + + + +_EOF_ +} + +function create_ssl_vhost { +cat <<- _EOF_ ++ Options Indexes FollowSymLinks MultiViews + AllowOverride All + Order allow,deny + allow from all + + + ErrorLog \${APACHE_LOG_DIR}/$ServerName-error.log + + # Possible values include: debug, info, notice, warn, error, crit, + # alert, emerg. + LogLevel warn + + CustomLog \${APACHE_LOG_DIR}/$ServerName-access.log combined + + ++ ServerAdmin webmaster@localhost + ServerName $ServerName + $ServerAlias + + DocumentRoot $DocumentRoot + + +_EOF_ +} + +#Sanity Check - are there two arguments with 2 values? +if [ "$#" -lt 4 ]; then + show_usage +fi + +CertPath="" + +#Parse flags +while getopts "d:s:a:p:c:h" OPTION; do + case $OPTION in + h) + show_usage + ;; + d) + DocumentRoot=$OPTARG + ;; + s) + ServerName=$OPTARG + ;; + a) + Alias=$OPTARG + ;; + p) + CertPath=$OPTARG + ;; + c) + CertName=$OPTARG + ;; + *) + show_usage + ;; + esac +done + +# If alias is set: +if [ "$Alias" != "" ]; then + ServerAlias="ServerAlias "$Alias +else + ServerAlias="" +fi + +# If CertName doesn't get set, set it to ServerName +if [ "$CertName" == "" ]; then + CertName=$ServerName +fi + +if [ ! -d $DocumentRoot ]; then + mkdir -p $DocumentRoot + #chown USER:USER $DocumentRoot #POSSIBLE IMPLEMENTATION, new flag -u ? +fi + +if [ -f "$DocumentRoot/$ServerName.conf" ]; then + echo 'vHost already exists. Aborting' + show_usage +else + create_vhost > /etc/apache2/sites-available/${ServerName}.conf + + # Add :443 handling + if [ "$CertPath" != "" ]; then + create_ssl_vhost >> /etc/apache2/sites-available/${ServerName}.conf + fi + + # Enable Site + cd /etc/apache2/sites-available/ && a2ensite ${ServerName}.conf + service apache2 reload +fi \ No newline at end of file diff --git a/view/#head.tpl# b/view/#head.tpl# deleted file mode 100755 index 4eb44e8c..00000000 --- a/view/#head.tpl# +++ /dev/null @@ -1,10 +0,0 @@ - -+ Options Indexes FollowSymLinks MultiViews + AllowOverride All + Order allow,deny + allow from all + + + ErrorLog \${APACHE_LOG_DIR}/$ServerName-error.log + + # Possible values include: debug, info, notice, warn, error, crit, + # alert, emerg. + LogLevel warn + + CustomLog \${APACHE_LOG_DIR}/$ServerName-access.log combined + + SSLEngine on + + SSLCertificateFile $CertPath/$CertName.crt + SSLCertificateKeyFile $CertPath/$CertName.key + ++ SSLOptions +StdEnvVars + + + BrowserMatch "MSIE [2-6]" \\ + nokeepalive ssl-unclean-shutdown \\ + downgrade-1.0 force-response-1.0 + # MSIE 7 and newer should be able to use keepalive + BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown +- - - - - - diff --git a/view/acl_selectors.php b/view/acl_selectors.php old mode 100755 new mode 100644 diff --git a/view/album_edit.tpl b/view/album_edit.tpl old mode 100755 new mode 100644 diff --git a/view/atom_cmnt.tpl b/view/atom_cmnt.tpl old mode 100755 new mode 100644 diff --git a/view/atom_feed.tpl b/view/atom_feed.tpl old mode 100755 new mode 100644 diff --git a/view/atom_item.tpl b/view/atom_item.tpl old mode 100755 new mode 100644 diff --git a/view/atom_mail.tpl b/view/atom_mail.tpl old mode 100755 new mode 100644 diff --git a/view/atom_tomb.tpl b/view/atom_tomb.tpl old mode 100755 new mode 100644 diff --git a/view/cmnt_received_eml.tpl b/view/cmnt_received_eml.tpl old mode 100755 new mode 100644 diff --git a/view/comment_item.tpl b/view/comment_item.tpl old mode 100755 new mode 100644 diff --git a/view/contact_edit.tpl b/view/contact_edit.tpl old mode 100755 new mode 100644 diff --git a/view/contact_selectors.php b/view/contact_selectors.php old mode 100755 new mode 100644 diff --git a/view/contact_self.tpl b/view/contact_self.tpl old mode 100755 new mode 100644 diff --git a/view/contact_template.tpl b/view/contact_template.tpl old mode 100755 new mode 100644 diff --git a/view/contacts-top.tpl b/view/contacts-top.tpl old mode 100755 new mode 100644 diff --git a/view/cropbody.tpl b/view/cropbody.tpl old mode 100755 new mode 100644 diff --git a/view/crophead.tpl b/view/crophead.tpl old mode 100755 new mode 100644 diff --git a/view/custom_tinymce.css b/view/custom_tinymce.css old mode 100755 new mode 100644 diff --git a/view/default.php b/view/default.php old mode 100755 new mode 100644 index 25d8ea1d..7f86257a --- a/view/default.php +++ b/view/default.php @@ -1,15 +1,15 @@ - - + + - - - - - + + + + + diff --git a/view/dfrn_req_confirm.tpl b/view/dfrn_req_confirm.tpl old mode 100755 new mode 100644 diff --git a/view/dfrn_request.tpl b/view/dfrn_request.tpl old mode 100755 new mode 100644 diff --git a/view/directory_header.tpl b/view/directory_header.tpl old mode 100755 new mode 100644 index 1ac049a3..2431a5c4 --- a/view/directory_header.tpl +++ b/view/directory_header.tpl @@ -5,13 +5,11 @@ $finding - - +- diff --git a/view/directory_item.tpl b/view/directory_item.tpl old mode 100755 new mode 100644 index d840d29f..c4dc4ec3 --- a/view/directory_item.tpl +++ b/view/directory_item.tpl @@ -13,6 +13,5 @@ $star $pgroup$details-$marital \ No newline at end of file diff --git a/view/group_drop.tpl b/view/group_drop.tpl old mode 100755 new mode 100644 diff --git a/view/group_edit.tpl b/view/group_edit.tpl old mode 100755 new mode 100644 diff --git a/view/group_new.tpl b/view/group_new.tpl old mode 100755 new mode 100644 diff --git a/view/head.tpl b/view/head.tpl old mode 100755 new mode 100644 index 0389e64f..6a6d9c86 --- a/view/head.tpl +++ b/view/head.tpl @@ -3,13 +3,14 @@ - + - - + + - - diff --git a/view/health_details.tpl b/view/health_details.tpl index 7d6f694e..45b5b057 100644 --- a/view/health_details.tpl +++ b/view/health_details.tpl @@ -1,12 +1,13 @@♥ $name
- -
- $base_url + $base_url
♥ Status:-Homepage:diff --git a/view/profile_advanced.php b/view/profile_advanced.php old mode 100755 new mode 100644 index 73a15540..928fa313 --- a/view/profile_advanced.php +++ b/view/profile_advanced.php @@ -19,16 +19,6 @@ $o .= <<< EOT EOT; } -if($a->profile['gender']) { -$o .= <<< EOT --- -EOT; -} - if($a->profile['dob']) { $o .= <<< EOTGender:-{$a->profile['gender']}-@@ -57,16 +47,6 @@ $o .= <<< EOT EOT; } -if($a->profile['marital']) { -$o .= <<< EOT --- -EOT; -} - if($a->profile['sexual']) { $o .= <<< EOT♥ Status:-{$a->profile['marital']}-diff --git a/view/profile_edit.tpl b/view/profile_edit.tpl old mode 100755 new mode 100644 index 44ca3922..6f13b380 --- a/view/profile_edit.tpl +++ b/view/profile_edit.tpl @@ -29,12 +29,6 @@ $default-- -$gender -- -@@ -94,12 +88,6 @@ $hide_friends-- -$marital -- -$sexual diff --git a/view/profile_entry.tpl b/view/profile_entry.tpl old mode 100755 new mode 100644 diff --git a/view/profile_entry_default.tpl b/view/profile_entry_default.tpl old mode 100755 new mode 100644 diff --git a/view/profile_listing_header.tpl b/view/profile_listing_header.tpl old mode 100755 new mode 100644 diff --git a/view/profile_photo.tpl b/view/profile_photo.tpl old mode 100755 new mode 100644 diff --git a/view/profile_selectors.php b/view/profile_selectors.php old mode 100755 new mode 100644 index 03dd2aac..29f5320e --- a/view/profile_selectors.php +++ b/view/profile_selectors.php @@ -1,18 +1,6 @@ "; - foreach($select as $selection) { - $selected = (($selection == $current) ? ' selected="selected" ' : ''); - $o .= ""; - } - $o .= ''; - return $o; -} - function sexpref_selector($current="",$suffix="") { $select = array('', t('Males'), t('Females'), t('Bisexual'), t('Autosexual'), t('Abstinent'), t('Virgin'), t('Nonsexual')); @@ -23,17 +11,4 @@ function sexpref_selector($current="",$suffix="") { } $o .= ''; return $o; -} - - -function marital_selector($current="",$suffix="") { - $select = array('', t('Single'), t('Lonely'), t('Available'), t('Unavailable'), t('Dating'), t('Unfaithful'), t('Sex Addict'), t('Friends'), t('Friends/Benefits'), t('Casual'), t('Engaged'), t('Married'), t('Partners'), t('Cohabiting'), t('Happy'), t('Not Looking'), t('Swinger'), t('Betrayed'), t('Separated'), t('Unstable'), t('Divorced'), t('Widowed'), t('Uncertain'), t('Complicated'), t('Don\'t care'), t('Ask me') ); - - $o .= "'; - return $o; -} +} diff --git a/view/profile_tabs.tpl b/view/profile_tabs.tpl old mode 100755 new mode 100644 diff --git a/view/prv_message.tpl b/view/prv_message.tpl old mode 100755 new mode 100644 diff --git a/view/pwdreset.tpl b/view/pwdreset.tpl old mode 100755 new mode 100644 diff --git a/view/register-link.tpl b/view/register-link.tpl old mode 100755 new mode 100644 diff --git a/view/register.tpl b/view/register.tpl old mode 100755 new mode 100644 diff --git a/view/request_notify_eml.tpl b/view/request_notify_eml.tpl old mode 100755 new mode 100644 diff --git a/view/settings.tpl b/view/settings.tpl old mode 100755 new mode 100644 diff --git a/view/settings_nick_set.tpl b/view/settings_nick_set.tpl old mode 100755 new mode 100644 diff --git a/view/settings_nick_subdir.tpl b/view/settings_nick_subdir.tpl old mode 100755 new mode 100644 diff --git a/view/settings_nick_unset.tpl b/view/settings_nick_unset.tpl old mode 100755 new mode 100644 diff --git a/view/sidenote.tpl b/view/sidenote.tpl old mode 100755 new mode 100644 diff --git a/view/theme/default/style.css b/view/theme/default/style.css index e85116e5..5ca3e17c 100755 --- a/view/theme/default/style.css +++ b/view/theme/default/style.css @@ -544,14 +544,12 @@ input#dfrn-url { #profile-edit-profile-name-label, #profile-edit-name-label, -#profile-edit-gender-label, #profile-edit-dob-label, #profile-edit-address-label, #profile-edit-locality-label, #profile-edit-region-label, #profile-edit-postal-code-label, #profile-edit-country-name-label, -#profile-edit-marital-label, #profile-edit-sexual-label, #profile-edit-politic-label, #profile-edit-religion-label, @@ -562,14 +560,12 @@ input#dfrn-url { #profile-edit-profile-name, #profile-edit-name, -#gender-select, #profile-edit-dob, #profile-edit-address, #profile-edit-locality, #profile-edit-region, #profile-edit-postal-code, #profile-edit-country-name, -#marital-select, #sexual-select, #profile-edit-politic, #profile-edit-religion, @@ -597,14 +593,12 @@ input#dfrn-url { #profile-edit-profile-name-end, #profile-edit-name-end, -#profile-edit-gender-end, #profile-edit-dob-end, #profile-edit-address-end, #profile-edit-locality-end, #profile-edit-region-end, #profile-edit-postal-code-end, #profile-edit-country-name-end, -#profile-edit-marital-end, #profile-edit-sexual-end, #profile-edit-politic-end, #profile-edit-religion-end, @@ -619,8 +613,7 @@ input#dfrn-url { - -#gender-select, #marital-select, #sexual-select { +#sexual-select { width: 220px; } @@ -896,7 +889,7 @@ input#dfrn-url { margin-top: 10px; margin-left: 35px; } -.directory-details, .marital { +.directory-details { font-size: 0.7em; text-align: center; margin-left: 5px; @@ -956,10 +949,8 @@ input#dfrn-url { #advanced-profile-name-wrapper, -#advanced-profile-gender-wrapper, #advanced-profile-dob-wrapper, #advanced-profile-age-wrapper, -#advanced-profile-marital-wrapper, #advanced-profile-sexual-wrapper, #advanced-profile-homepage-wrapper, #advanced-profile-politic-wrapper, @@ -978,10 +969,8 @@ input#dfrn-url { } #advanced-profile-name-text, -#advanced-profile-gender-text, #advanced-profile-dob-text, #advanced-profile-age-text, -#advanced-profile-marital-text, #advanced-profile-sexual-text, #advanced-profile-homepage-text, #advanced-profile-politic-text, @@ -1001,10 +990,8 @@ input#dfrn-url { } #advanced-profile-name-end, -#advanced-profile-gender-end, #advanced-profile-dob-end, #advanced-profile-age-end, -#advanced-profile-marital-end, #advanced-profile-sexual-end, #advanced-profile-homepage-end, #advanced-profile-politic-end, @@ -1027,10 +1014,8 @@ input#dfrn-url { } #advanced-profile-name, -#advanced-profile-gender, #advanced-profile-dob, #advanced-profile-age, -#advanced-profile-marital, #advanced-profile-sexual, #advanced-profile-homepage, #advanced-profile-politic, diff --git a/view/viewcontact_template.tpl b/view/viewcontact_template.tpl old mode 100755 new mode 100644 diff --git a/view/wall_item.tpl b/view/wall_item.tpl old mode 100755 new mode 100644 diff --git a/view/wall_item_drop.tpl b/view/wall_item_drop.tpl old mode 100755 new mode 100644 diff --git a/view/wall_received_eml.tpl b/view/wall_received_eml.tpl old mode 100755 new mode 100644 diff --git a/view/wallwall_item.tpl b/view/wallwall_item.tpl old mode 100755 new mode 100644 diff --git a/view/xrd_host.tpl b/view/xrd_host.tpl old mode 100755 new mode 100644 diff --git a/view/xrd_person.tpl b/view/xrd_person.tpl old mode 100755 new mode 100644