Cleanup /format pre-move
This commit is contained in:
parent
f77632378b
commit
56ee734b00
85 changed files with 522 additions and 581 deletions
2
boot.php
2
boot.php
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
require_once(__DIR__ . DIRECTORY_SEPARATOR. 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php');
|
require_once(__DIR__ . DIRECTORY_SEPARATOR. 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php');
|
||||||
|
|
||||||
use \Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
|
|
||||||
require_once('include/config.php');
|
require_once('include/config.php');
|
||||||
require_once('include/network.php');
|
require_once('include/network.php');
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use \Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
use \Friendica\Core\PConfig;
|
use Friendica\Core\PConfig;
|
||||||
|
|
||||||
require_once("include/feed.php");
|
require_once("include/feed.php");
|
||||||
require_once('include/email.php');
|
require_once('include/email.php');
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* @todo Automatically detect if incoming data is HTML or BBCode
|
* @todo Automatically detect if incoming data is HTML or BBCode
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use \Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
|
|
||||||
require_once 'include/HTTPExceptions.php';
|
require_once 'include/HTTPExceptions.php';
|
||||||
require_once 'include/bbcode.php';
|
require_once 'include/bbcode.php';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use \Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
|
|
||||||
require_once('include/security.php');
|
require_once('include/security.php');
|
||||||
require_once('include/datetime.php');
|
require_once('include/datetime.php');
|
||||||
|
|
|
@ -32,6 +32,8 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
|
|
||||||
if (sizeof($_SERVER["argv"]) == 0)
|
if (sizeof($_SERVER["argv"]) == 0)
|
||||||
die();
|
die();
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use Friendica\App;
|
||||||
|
|
||||||
use League\HTMLToMarkdown\HtmlConverter;
|
use League\HTMLToMarkdown\HtmlConverter;
|
||||||
|
|
||||||
require_once "include/oembed.php";
|
require_once "include/oembed.php";
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
use \Friendica\Core\Config;
|
|
||||||
|
use Friendica\Core\Config;
|
||||||
|
|
||||||
require_once 'include/oembed.php';
|
require_once 'include/oembed.php';
|
||||||
require_once 'include/event.php';
|
require_once 'include/event.php';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php /** @file */
|
<?php /** @file */
|
||||||
|
|
||||||
use \Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
|
|
||||||
require_once('boot.php');
|
require_once('boot.php');
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
require_once "include/bbcode.php";
|
require_once "include/bbcode.php";
|
||||||
require_once "include/acl_selectors.php";
|
require_once "include/acl_selectors.php";
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Note: the code in 'item_extract_images' and 'item_redir_and_replace_images'
|
* Note: the code in 'item_extract_images' and 'item_redir_and_replace_images'
|
||||||
* is identical to the code in mod/message.php for 'item_extract_images' and
|
* is identical to the code in mod/message.php for 'item_extract_images' and
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
use \Friendica\Core\Config;
|
|
||||||
|
use Friendica\Core\Config;
|
||||||
|
|
||||||
function cronjobs_run(&$argv, &$argc){
|
function cronjobs_run(&$argv, &$argc){
|
||||||
global $a;
|
global $a;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use \Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
|
|
||||||
require_once("boot.php");
|
require_once("boot.php");
|
||||||
require_once("include/text.php");
|
require_once("include/text.php");
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use \Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
|
|
||||||
require_once('include/queue_fn.php');
|
require_once('include/queue_fn.php');
|
||||||
require_once('include/html2plain.php');
|
require_once('include/html2plain.php');
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
* This will change in the future.
|
* This will change in the future.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use \Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
|
|
||||||
require_once 'include/items.php';
|
require_once 'include/items.php';
|
||||||
require_once 'include/bb2diaspora.php';
|
require_once 'include/bb2diaspora.php';
|
||||||
|
|
|
@ -535,7 +535,7 @@ function get_event_strings() {
|
||||||
*
|
*
|
||||||
* @param array $dates Array of possibly duplicated events
|
* @param array $dates Array of possibly duplicated events
|
||||||
* @return array Cleaned events
|
* @return array Cleaned events
|
||||||
*
|
*
|
||||||
* @todo We should replace this with a separate update function if there is some time left
|
* @todo We should replace this with a separate update function if there is some time left
|
||||||
*/
|
*/
|
||||||
function event_remove_duplicates($dates) {
|
function event_remove_duplicates($dates) {
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* @file include/items.php
|
* @file include/items.php
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use \Friendica\ParseUrl;
|
use Friendica\ParseUrl;
|
||||||
|
|
||||||
require_once 'include/bbcode.php';
|
require_once 'include/bbcode.php';
|
||||||
require_once 'include/oembed.php';
|
require_once 'include/oembed.php';
|
||||||
|
@ -339,7 +339,7 @@ function add_page_info_to_body($body, $texturl = false, $no_photos = false) {
|
||||||
* Adds a "lang" specification in a "postopts" element of given $arr,
|
* Adds a "lang" specification in a "postopts" element of given $arr,
|
||||||
* if possible and not already present.
|
* if possible and not already present.
|
||||||
* Expects "body" element to exist in $arr.
|
* Expects "body" element to exist in $arr.
|
||||||
*
|
*
|
||||||
* @todo Add a parameter to request forcing override
|
* @todo Add a parameter to request forcing override
|
||||||
*/
|
*/
|
||||||
function item_add_language_opt(&$arr) {
|
function item_add_language_opt(&$arr) {
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
// send a private message
|
// send a private message
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function send_message($recipient=0, $body='', $subject='', $replyto=''){
|
function send_message($recipient=0, $body='', $subject='', $replyto=''){
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* @file include/network.php
|
* @file include/network.php
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use \Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
|
|
||||||
require_once("include/xml.php");
|
require_once("include/xml.php");
|
||||||
require_once('include/Probe.php');
|
require_once('include/Probe.php');
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use \Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
|
|
||||||
require_once('include/queue_fn.php');
|
require_once('include/queue_fn.php');
|
||||||
require_once('include/html2plain.php');
|
require_once('include/html2plain.php');
|
||||||
|
|
|
@ -61,13 +61,13 @@ class FKOAuthDataStore extends OAuthDataStore {
|
||||||
logger(__function__.":".$consumer.", ". $callback);
|
logger(__function__.":".$consumer.", ". $callback);
|
||||||
$key = $this->gen_token();
|
$key = $this->gen_token();
|
||||||
$sec = $this->gen_token();
|
$sec = $this->gen_token();
|
||||||
|
|
||||||
if ($consumer->key){
|
if ($consumer->key){
|
||||||
$k = $consumer->key;
|
$k = $consumer->key;
|
||||||
} else {
|
} else {
|
||||||
$k = $consumer;
|
$k = $consumer;
|
||||||
}
|
}
|
||||||
|
|
||||||
$r = q("INSERT INTO tokens (id, secret, client_id, scope, expires) VALUES ('%s','%s','%s','%s', UNIX_TIMESTAMP()+%d)",
|
$r = q("INSERT INTO tokens (id, secret, client_id, scope, expires) VALUES ('%s','%s','%s','%s', UNIX_TIMESTAMP()+%d)",
|
||||||
dbesc($key),
|
dbesc($key),
|
||||||
dbesc($sec),
|
dbesc($sec),
|
||||||
|
@ -80,19 +80,19 @@ class FKOAuthDataStore extends OAuthDataStore {
|
||||||
|
|
||||||
function new_access_token($token, $consumer, $verifier = null) {
|
function new_access_token($token, $consumer, $verifier = null) {
|
||||||
logger(__function__.":".$token.", ". $consumer.", ". $verifier);
|
logger(__function__.":".$token.", ". $consumer.", ". $verifier);
|
||||||
|
|
||||||
// return a new access token attached to this consumer
|
// return a new access token attached to this consumer
|
||||||
// for the user associated with this token if the request token
|
// for the user associated with this token if the request token
|
||||||
// is authorized
|
// is authorized
|
||||||
// should also invalidate the request token
|
// should also invalidate the request token
|
||||||
|
|
||||||
$ret=Null;
|
$ret=Null;
|
||||||
|
|
||||||
// get user for this verifier
|
// get user for this verifier
|
||||||
$uverifier = get_config("oauth", $verifier);
|
$uverifier = get_config("oauth", $verifier);
|
||||||
logger(__function__.":".$verifier.",".$uverifier);
|
logger(__function__.":".$verifier.",".$uverifier);
|
||||||
if (is_null($verifier) || ($uverifier!==false)){
|
if (is_null($verifier) || ($uverifier!==false)){
|
||||||
|
|
||||||
$key = $this->gen_token();
|
$key = $this->gen_token();
|
||||||
$sec = $this->gen_token();
|
$sec = $this->gen_token();
|
||||||
$r = q("INSERT INTO tokens (id, secret, client_id, scope, expires, uid) VALUES ('%s','%s','%s','%s', UNIX_TIMESTAMP()+%d, %d)",
|
$r = q("INSERT INTO tokens (id, secret, client_id, scope, expires, uid) VALUES ('%s','%s','%s','%s', UNIX_TIMESTAMP()+%d, %d)",
|
||||||
|
@ -103,13 +103,13 @@ class FKOAuthDataStore extends OAuthDataStore {
|
||||||
intval(ACCESS_TOKEN_DURATION),
|
intval(ACCESS_TOKEN_DURATION),
|
||||||
intval($uverifier));
|
intval($uverifier));
|
||||||
if ($r)
|
if ($r)
|
||||||
$ret = new OAuthToken($key,$sec);
|
$ret = new OAuthToken($key,$sec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
q("DELETE FROM tokens WHERE id='%s'", $token->key);
|
q("DELETE FROM tokens WHERE id='%s'", $token->key);
|
||||||
|
|
||||||
|
|
||||||
if (!is_null($ret) && $uverifier!==false){
|
if (!is_null($ret) && $uverifier!==false){
|
||||||
del_config("oauth", $verifier);
|
del_config("oauth", $verifier);
|
||||||
/* $apps = get_pconfig($uverifier, "oauth", "apps");
|
/* $apps = get_pconfig($uverifier, "oauth", "apps");
|
||||||
|
@ -117,9 +117,9 @@ class FKOAuthDataStore extends OAuthDataStore {
|
||||||
$apps[] = $consumer->key;
|
$apps[] = $consumer->key;
|
||||||
set_pconfig($uverifier, "oauth", "apps", $apps);*/
|
set_pconfig($uverifier, "oauth", "apps", $apps);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,9 +172,9 @@ class FKOAuth1 extends OAuthServer {
|
||||||
intval($_SESSION['uid'])
|
intval($_SESSION['uid'])
|
||||||
);
|
);
|
||||||
|
|
||||||
call_hooks('logged_in', $a->user);
|
call_hooks('logged_in', $a->user);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
class FKOAuth2 extends OAuth2 {
|
class FKOAuth2 extends OAuth2 {
|
||||||
|
@ -190,13 +190,13 @@ class FKOAuth2 extends OAuth2 {
|
||||||
dbesc($client_secret),
|
dbesc($client_secret),
|
||||||
dbesc($redirect_uri)
|
dbesc($redirect_uri)
|
||||||
);
|
);
|
||||||
|
|
||||||
return $r;
|
return $r;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function checkClientCredentials($client_id, $client_secret = NULL) {
|
protected function checkClientCredentials($client_id, $client_secret = NULL) {
|
||||||
$client_secret = $this->db_secret($client_secret);
|
$client_secret = $this->db_secret($client_secret);
|
||||||
|
|
||||||
$r = q("SELECT pw FROM clients WHERE client_id = '%s'",
|
$r = q("SELECT pw FROM clients WHERE client_id = '%s'",
|
||||||
dbesc($client_id));
|
dbesc($client_id));
|
||||||
|
|
||||||
|
@ -218,21 +218,21 @@ class FKOAuth2 extends OAuth2 {
|
||||||
protected function getAccessToken($oauth_token) {
|
protected function getAccessToken($oauth_token) {
|
||||||
$r = q("SELECT client_id, expires, scope FROM tokens WHERE id = '%s'",
|
$r = q("SELECT client_id, expires, scope FROM tokens WHERE id = '%s'",
|
||||||
dbesc($oauth_token));
|
dbesc($oauth_token));
|
||||||
|
|
||||||
if (dbm::is_result($r))
|
if (dbm::is_result($r))
|
||||||
return $r[0];
|
return $r[0];
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected function setAccessToken($oauth_token, $client_id, $expires, $scope = NULL) {
|
protected function setAccessToken($oauth_token, $client_id, $expires, $scope = NULL) {
|
||||||
$r = q("INSERT INTO tokens (id, client_id, expires, scope) VALUES ('%s', '%s', %d, '%s')",
|
$r = q("INSERT INTO tokens (id, client_id, expires, scope) VALUES ('%s', '%s', %d, '%s')",
|
||||||
dbesc($oauth_token),
|
dbesc($oauth_token),
|
||||||
dbesc($client_id),
|
dbesc($client_id),
|
||||||
intval($expires),
|
intval($expires),
|
||||||
dbesc($scope));
|
dbesc($scope));
|
||||||
|
|
||||||
return $r;
|
return $r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -246,23 +246,23 @@ class FKOAuth2 extends OAuth2 {
|
||||||
protected function getAuthCode($code) {
|
protected function getAuthCode($code) {
|
||||||
$r = q("SELECT id, client_id, redirect_uri, expires, scope FROM auth_codes WHERE id = '%s'",
|
$r = q("SELECT id, client_id, redirect_uri, expires, scope FROM auth_codes WHERE id = '%s'",
|
||||||
dbesc($code));
|
dbesc($code));
|
||||||
|
|
||||||
if (dbm::is_result($r))
|
if (dbm::is_result($r))
|
||||||
return $r[0];
|
return $r[0];
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function setAuthCode($code, $client_id, $redirect_uri, $expires, $scope = NULL) {
|
protected function setAuthCode($code, $client_id, $redirect_uri, $expires, $scope = NULL) {
|
||||||
$r = q("INSERT INTO auth_codes
|
$r = q("INSERT INTO auth_codes
|
||||||
(id, client_id, redirect_uri, expires, scope) VALUES
|
(id, client_id, redirect_uri, expires, scope) VALUES
|
||||||
('%s', '%s', '%s', %d, '%s')",
|
('%s', '%s', '%s', %d, '%s')",
|
||||||
dbesc($code),
|
dbesc($code),
|
||||||
dbesc($client_id),
|
dbesc($client_id),
|
||||||
dbesc($redirect_uri),
|
dbesc($redirect_uri),
|
||||||
intval($expires),
|
intval($expires),
|
||||||
dbesc($scope));
|
dbesc($scope));
|
||||||
return $r;
|
return $r;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
* @file include/oembed.php
|
* @file include/oembed.php
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use \Friendica\ParseUrl;
|
use Friendica\ParseUrl;
|
||||||
use \Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
|
|
||||||
function oembed_replacecb($matches){
|
function oembed_replacecb($matches){
|
||||||
$embedurl=$matches[1];
|
$embedurl=$matches[1];
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* @file include/plaintext.php
|
* @file include/plaintext.php
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use \Friendica\ParseUrl;
|
use Friendica\ParseUrl;
|
||||||
|
|
||||||
require_once("include/Photo.php");
|
require_once("include/Photo.php");
|
||||||
require_once("include/bbcode.php");
|
require_once("include/bbcode.php");
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @file include/plugin.php
|
* @file include/plugin.php
|
||||||
*
|
*
|
||||||
* @brief Some functions to handle addons and themes.
|
* @brief Some functions to handle addons and themes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ function register_hook($hook,$file,$function,$priority=0) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief unregisters a hook.
|
* @brief unregisters a hook.
|
||||||
*
|
*
|
||||||
* @param string $hook the name of the hook
|
* @param string $hook the name of the hook
|
||||||
* @param string $file the name of the file that hooks into
|
* @param string $file the name of the file that hooks into
|
||||||
* @param string $function the name of the function that the hook called
|
* @param string $function the name of the function that the hook called
|
||||||
|
@ -325,7 +325,7 @@ function get_plugin_info($plugin){
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Parse theme comment in search of theme infos.
|
* @brief Parse theme comment in search of theme infos.
|
||||||
*
|
*
|
||||||
* like
|
* like
|
||||||
* \code
|
* \code
|
||||||
* ..* Name: My Theme
|
* ..* Name: My Theme
|
||||||
|
@ -545,11 +545,11 @@ function upgrade_bool_message($bbcode = false) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the full path to relevant theme files by filename
|
* @brief Get the full path to relevant theme files by filename
|
||||||
*
|
*
|
||||||
* This function search in the theme directory (and if not present in global theme directory)
|
* This function search in the theme directory (and if not present in global theme directory)
|
||||||
* if there is a directory with the file extension and for a file with the given
|
* if there is a directory with the file extension and for a file with the given
|
||||||
* filename.
|
* filename.
|
||||||
*
|
*
|
||||||
* @param string $file Filename
|
* @param string $file Filename
|
||||||
* @param string $root Full root path
|
* @param string $root Full root path
|
||||||
* @return string Path to the file or empty string if the file isn't found
|
* @return string Path to the file or empty string if the file isn't found
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use Friendica\Core\Config;
|
||||||
|
|
||||||
if (!file_exists("boot.php") AND (sizeof($_SERVER["argv"]) != 0)) {
|
if (!file_exists("boot.php") AND (sizeof($_SERVER["argv"]) != 0)) {
|
||||||
$directory = dirname($_SERVER["argv"][0]);
|
$directory = dirname($_SERVER["argv"][0]);
|
||||||
|
|
||||||
|
@ -10,8 +13,6 @@ if (!file_exists("boot.php") AND (sizeof($_SERVER["argv"]) != 0)) {
|
||||||
chdir($directory);
|
chdir($directory);
|
||||||
}
|
}
|
||||||
|
|
||||||
use \Friendica\Core\Config;
|
|
||||||
|
|
||||||
require_once("boot.php");
|
require_once("boot.php");
|
||||||
|
|
||||||
function poller_run($argv, $argc){
|
function poller_run($argv, $argc){
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
use \Friendica\Core\Config;
|
|
||||||
|
use Friendica\Core\Config;
|
||||||
|
|
||||||
require_once('include/items.php');
|
require_once('include/items.php');
|
||||||
require_once('include/ostatus.php');
|
require_once('include/ostatus.php');
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use \Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
|
|
||||||
require_once("boot.php");
|
require_once("boot.php");
|
||||||
require_once("include/threads.php");
|
require_once("include/threads.php");
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @file include/socgraph.php
|
* @file include/socgraph.php
|
||||||
*
|
*
|
||||||
* @todo Move GNU Social URL schemata (http://server.tld/user/number) to http://server.tld/username
|
* @todo Move GNU Social URL schemata (http://server.tld/user/number) to http://server.tld/username
|
||||||
* @todo Fetch profile data from profile page for Redmatrix users
|
* @todo Fetch profile data from profile page for Redmatrix users
|
||||||
* @todo Detect if it is a forum
|
* @todo Detect if it is a forum
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use \Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
|
|
||||||
require_once('include/datetime.php');
|
require_once('include/datetime.php');
|
||||||
require_once("include/Scrape.php");
|
require_once("include/Scrape.php");
|
||||||
|
@ -1430,7 +1430,7 @@ function common_friends_zcid($uid,$zcid,$start = 0, $limit = 9999,$shuffle = fal
|
||||||
$r = q("SELECT `gcontact`.*
|
$r = q("SELECT `gcontact`.*
|
||||||
FROM `glink` INNER JOIN `gcontact` on `glink`.`gcid` = `gcontact`.`id`
|
FROM `glink` INNER JOIN `gcontact` on `glink`.`gcid` = `gcontact`.`id`
|
||||||
where `glink`.`zcid` = %d
|
where `glink`.`zcid` = %d
|
||||||
and `gcontact`.`nurl` in (select nurl from contact where uid = %d and self = 0 and blocked = 0 and hidden = 0 )
|
and `gcontact`.`nurl` in (select nurl from contact where uid = %d and self = 0 and blocked = 0 and hidden = 0 )
|
||||||
$sql_extra limit %d, %d",
|
$sql_extra limit %d, %d",
|
||||||
intval($zcid),
|
intval($zcid),
|
||||||
intval($uid),
|
intval($uid),
|
||||||
|
|
|
@ -6,7 +6,6 @@ require_once("include/Smilies.php");
|
||||||
require_once("include/map.php");
|
require_once("include/map.php");
|
||||||
require_once("mod/proxy.php");
|
require_once("mod/proxy.php");
|
||||||
|
|
||||||
|
|
||||||
if(! function_exists('replace_macros')) {
|
if(! function_exists('replace_macros')) {
|
||||||
/**
|
/**
|
||||||
* This is our template processor
|
* This is our template processor
|
||||||
|
|
|
@ -1,11 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
|
||||||
* import account file exported from mod/uexport
|
|
||||||
* args:
|
|
||||||
* $a App Friendica App Class
|
|
||||||
* $file Array array from $_FILES
|
|
||||||
*/
|
|
||||||
require_once("include/Photo.php");
|
require_once("include/Photo.php");
|
||||||
define("IMPORT_DEBUG", False);
|
define("IMPORT_DEBUG", False);
|
||||||
|
|
||||||
|
@ -75,6 +69,12 @@ function import_cleanup($newuid) {
|
||||||
q("DELETE FROM `pconfig` WHERE uid = %d", $newuid);
|
q("DELETE FROM `pconfig` WHERE uid = %d", $newuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Import account file exported from mod/uexport
|
||||||
|
*
|
||||||
|
* @param App $a Friendica App Class
|
||||||
|
* @param array $file array from $_FILES
|
||||||
|
*/
|
||||||
function import_account(App $a, $file) {
|
function import_account(App $a, $file) {
|
||||||
logger("Start user import from " . $file['tmp_name']);
|
logger("Start user import from " . $file['tmp_name']);
|
||||||
/*
|
/*
|
||||||
|
@ -255,10 +255,6 @@ function import_account(App $a, $file) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
foreach ($account['photo'] as &$photo) {
|
foreach ($account['photo'] as &$photo) {
|
||||||
$photo['uid'] = $newuid;
|
$photo['uid'] = $newuid;
|
||||||
$photo['data'] = hex2bin($photo['data']);
|
$photo['data'] = hex2bin($photo['data']);
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use \Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
|
|
||||||
require_once('boot.php');
|
require_once('boot.php');
|
||||||
require_once('object/BaseObject.php');
|
require_once('object/BaseObject.php');
|
||||||
|
@ -486,7 +486,7 @@ header("X-Friendica-Version: " . FRIENDICA_VERSION);
|
||||||
header("Content-type: text/html; charset=utf-8");
|
header("Content-type: text/html; charset=utf-8");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We use $_GET["mode"] for special page templates. So we will check if we have
|
* We use $_GET["mode"] for special page templates. So we will check if we have
|
||||||
* to load another page template than the default one.
|
* to load another page template than the default one.
|
||||||
* The page templates are located in /view/php/ or in the theme directory.
|
* The page templates are located in /view/php/ or in the theme directory.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use \Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
|
|
||||||
require_once("mod/hostxrd.php");
|
require_once("mod/hostxrd.php");
|
||||||
require_once("mod/nodeinfo.php");
|
require_once("mod/nodeinfo.php");
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* @brief Friendica admin
|
* @brief Friendica admin
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use \Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
|
|
||||||
require_once("include/enotify.php");
|
require_once("include/enotify.php");
|
||||||
require_once("include/text.php");
|
require_once("include/text.php");
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function amcd_content(App $a) {
|
function amcd_content(App $a) {
|
||||||
//header("Content-type: text/json");
|
echo <<< JSON
|
||||||
echo <<< EOT
|
|
||||||
{
|
{
|
||||||
"version":1,
|
"version":1,
|
||||||
"sessionstatus":{
|
"sessionstatus":{
|
||||||
|
@ -44,6 +43,6 @@ echo <<< EOT
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EOT;
|
JSON;
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
25
mod/apps.php
25
mod/apps.php
|
@ -1,25 +1,24 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
function apps_content(App $a) {
|
function apps_content(App $a) {
|
||||||
$privateaddons = get_config('config','private_addons');
|
$privateaddons = get_config('config', 'private_addons');
|
||||||
if ($privateaddons === "1") {
|
if ($privateaddons === "1") {
|
||||||
if((! (local_user()))) {
|
if ((!(local_user()))) {
|
||||||
info( t("You must be logged in to use addons. "));
|
info(t("You must be logged in to use addons. "));
|
||||||
return;};
|
return;
|
||||||
}
|
};
|
||||||
|
}
|
||||||
|
|
||||||
$title = t('Applications');
|
$title = t('Applications');
|
||||||
|
|
||||||
if(count($a->apps)==0)
|
|
||||||
notice( t('No installed applications.') . EOL);
|
|
||||||
|
|
||||||
|
if (count($a->apps) == 0) {
|
||||||
|
notice(t('No installed applications.') . EOL);
|
||||||
|
}
|
||||||
|
|
||||||
$tpl = get_markup_template("apps.tpl");
|
$tpl = get_markup_template("apps.tpl");
|
||||||
return replace_macros($tpl, array(
|
return replace_macros($tpl, array(
|
||||||
'$title' => $title,
|
'$title' => $title,
|
||||||
'$apps' => $a->apps,
|
'$apps' => $a->apps,
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use \Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
|
|
||||||
function community_init(App $a) {
|
function community_init(App $a) {
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
|
@ -9,7 +9,6 @@ function community_init(App $a) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function community_content(App $a, $update = 0) {
|
function community_content(App $a, $update = 0) {
|
||||||
|
|
||||||
$o = '';
|
$o = '';
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
require_once('include/group.php');
|
require_once('include/group.php');
|
||||||
|
|
||||||
function contactgroup_content(App $a) {
|
function contactgroup_content(App $a) {
|
||||||
|
|
||||||
|
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,20 +1,22 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a credits page for all the developers who helped with the project
|
* Show a credits page for all the developers who helped with the project
|
||||||
* (only contributors to the git repositories for friendica core and the
|
* (only contributors to the git repositories for friendica core and the
|
||||||
* addons repository will be listed though ATM)
|
* addons repository will be listed though ATM)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function credits_content (App $a) {
|
|
||||||
/* fill the page with credits */
|
function credits_content(App $a) {
|
||||||
$f = fopen('util/credits.txt','r');
|
/* fill the page with credits */
|
||||||
$names = fread($f, filesize('util/credits.txt'));
|
$f = fopen('util/credits.txt', 'r');
|
||||||
$arr = explode("\n", htmlspecialchars($names));
|
$names = fread($f, filesize('util/credits.txt'));
|
||||||
fclose($f);
|
$arr = explode("\n", htmlspecialchars($names));
|
||||||
$tpl = get_markup_template('credits.tpl');
|
fclose($f);
|
||||||
return replace_macros( $tpl, array(
|
$tpl = get_markup_template('credits.tpl');
|
||||||
'$title' => t('Credits'),
|
return replace_macros($tpl, array(
|
||||||
'$thanks' => t('Friendica is a community project, that would not be possible without the help of many people. Here is a list of those who have contributed to the code or the translation of Friendica. Thank you all!'),
|
'$title' => t('Credits'),
|
||||||
'$names' => $arr,
|
'$thanks' => t('Friendica is a community project, that would not be possible without the help of many people. Here is a list of those who have contributed to the code or the translation of Friendica. Thank you all!'),
|
||||||
));
|
'$names' => $arr,
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,6 @@ function delegate_init(App $a) {
|
||||||
return settings_init($a);
|
return settings_init($a);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function delegate_content(App $a) {
|
function delegate_content(App $a) {
|
||||||
|
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
|
|
|
@ -3,10 +3,7 @@ require_once('include/items.php');
|
||||||
require_once('include/auth.php');
|
require_once('include/auth.php');
|
||||||
require_once('include/dfrn.php');
|
require_once('include/dfrn.php');
|
||||||
|
|
||||||
|
|
||||||
function dfrn_poll_init(App $a) {
|
function dfrn_poll_init(App $a) {
|
||||||
|
|
||||||
|
|
||||||
$dfrn_id = ((x($_GET,'dfrn_id')) ? $_GET['dfrn_id'] : '');
|
$dfrn_id = ((x($_GET,'dfrn_id')) ? $_GET['dfrn_id'] : '');
|
||||||
$type = ((x($_GET,'type')) ? $_GET['type'] : 'data');
|
$type = ((x($_GET,'type')) ? $_GET['type'] : 'data');
|
||||||
$last_update = ((x($_GET,'last_update')) ? $_GET['last_update'] : '');
|
$last_update = ((x($_GET,'last_update')) ? $_GET['last_update'] : '');
|
||||||
|
|
|
@ -9,24 +9,18 @@ function directory_init(App $a) {
|
||||||
$a->page['aside'] .= findpeople_widget();
|
$a->page['aside'] .= findpeople_widget();
|
||||||
|
|
||||||
$a->page['aside'] .= follow_widget();
|
$a->page['aside'] .= follow_widget();
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
unset($_SESSION['theme']);
|
unset($_SESSION['theme']);
|
||||||
unset($_SESSION['mobile-theme']);
|
unset($_SESSION['mobile-theme']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function directory_post(App $a) {
|
function directory_post(App $a) {
|
||||||
if(x($_POST,'search'))
|
if(x($_POST,'search'))
|
||||||
$a->data['search'] = $_POST['search'];
|
$a->data['search'] = $_POST['search'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function directory_content(App $a) {
|
function directory_content(App $a) {
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
|
|
|
@ -21,8 +21,6 @@ function dirfind_init(App $a) {
|
||||||
$a->page['aside'] .= follow_widget();
|
$a->page['aside'] .= follow_widget();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function dirfind_content(App $a, $prefix = "") {
|
function dirfind_content(App $a, $prefix = "") {
|
||||||
|
|
||||||
$community = false;
|
$community = false;
|
||||||
|
|
|
@ -106,7 +106,6 @@ function display_init(App $a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
profile_load($a, $nick, 0, $profiledata);
|
profile_load($a, $nick, 0, $profiledata);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function display_fetchauthor($a, $item) {
|
function display_fetchauthor($a, $item) {
|
||||||
|
|
|
@ -4,7 +4,6 @@ require_once('include/security.php');
|
||||||
require_once('include/bbcode.php');
|
require_once('include/bbcode.php');
|
||||||
require_once('include/items.php');
|
require_once('include/items.php');
|
||||||
|
|
||||||
|
|
||||||
function filer_content(App $a) {
|
function filer_content(App $a) {
|
||||||
|
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use \Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
|
|
||||||
function friendica_init(App $a) {
|
function friendica_init(App $a) {
|
||||||
if ($a->argv[1] == "json"){
|
if ($a->argv[1] == "json"){
|
||||||
|
|
|
@ -15,6 +15,7 @@ function hovercard_init(App $a) {
|
||||||
// Just for testing purposes
|
// Just for testing purposes
|
||||||
$_GET["mode"] = "minimal";
|
$_GET["mode"] = "minimal";
|
||||||
}
|
}
|
||||||
|
|
||||||
function hovercard_content() {
|
function hovercard_content() {
|
||||||
$profileurl = (x($_REQUEST,'profileurl') ? $_REQUEST['profileurl'] : "");
|
$profileurl = (x($_REQUEST,'profileurl') ? $_REQUEST['profileurl'] : "");
|
||||||
$datatype = (x($_REQUEST,'datatype') ?$_REQUEST['datatype'] : "json");
|
$datatype = (x($_REQUEST,'datatype') ?$_REQUEST['datatype'] : "json");
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once "include/Photo.php";
|
require_once "include/Photo.php";
|
||||||
|
|
||||||
$install_wizard_pass=1;
|
$install_wizard_pass = 1;
|
||||||
|
|
||||||
|
|
||||||
function install_init(App $a) {
|
function install_init(App $a) {
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,16 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function login_content(App $a) {
|
function login_content(App $a) {
|
||||||
if(x($_SESSION,'theme'))
|
if (x($_SESSION, 'theme')) {
|
||||||
unset($_SESSION['theme']);
|
unset($_SESSION['theme']);
|
||||||
if(x($_SESSION,'mobile-theme'))
|
}
|
||||||
|
if (x($_SESSION, 'mobile-theme')) {
|
||||||
unset($_SESSION['mobile-theme']);
|
unset($_SESSION['mobile-theme']);
|
||||||
|
}
|
||||||
|
|
||||||
if(local_user())
|
if (local_user()) {
|
||||||
goaway(z_root());
|
goaway(z_root());
|
||||||
|
}
|
||||||
|
|
||||||
return login(($a->config['register_policy'] == REGISTER_CLOSED) ? false : true);
|
return login(($a->config['register_policy'] == REGISTER_CLOSED) ? false : true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use \Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
|
|
||||||
function maintenance_content(App $a) {
|
function maintenance_content(App $a) {
|
||||||
|
|
||||||
|
|
|
@ -1,26 +1,25 @@
|
||||||
<?php
|
<?php
|
||||||
use Friendica\Core\Config;
|
|
||||||
|
|
||||||
function manifest_content(App $a) {
|
use Friendica\Core\Config;
|
||||||
|
|
||||||
$tpl = get_markup_template('manifest.tpl');
|
function manifest_content(App $a) {
|
||||||
|
|
||||||
header('Content-type: application/manifest+json');
|
$tpl = get_markup_template('manifest.tpl');
|
||||||
|
|
||||||
$touch_icon = Config::get('system', 'touch_icon', 'images/friendica-128.png');
|
header('Content-type: application/manifest+json');
|
||||||
if ($touch_icon == '') {
|
|
||||||
$touch_icon = 'images/friendica-128.png';
|
|
||||||
}
|
|
||||||
|
|
||||||
$o = replace_macros($tpl, array(
|
|
||||||
'$baseurl' => App::get_baseurl(),
|
|
||||||
'$touch_icon' => $touch_icon,
|
|
||||||
'$title' => Config::get('config', 'sitename', 'Friendica'),
|
|
||||||
));
|
|
||||||
|
|
||||||
echo $o;
|
|
||||||
|
|
||||||
killme();
|
|
||||||
|
|
||||||
|
$touch_icon = Config::get('system', 'touch_icon', 'images/friendica-128.png');
|
||||||
|
if ($touch_icon == '') {
|
||||||
|
$touch_icon = 'images/friendica-128.png';
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
|
$o = replace_macros($tpl, array(
|
||||||
|
'$baseurl' => App::get_baseurl(),
|
||||||
|
'$touch_icon' => $touch_icon,
|
||||||
|
'$title' => Config::get('config', 'sitename', 'Friendica'),
|
||||||
|
));
|
||||||
|
|
||||||
|
echo $o;
|
||||||
|
|
||||||
|
killme();
|
||||||
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
include_once('include/text.php');
|
require_once('include/text.php');
|
||||||
require_once('include/socgraph.php');
|
require_once('include/socgraph.php');
|
||||||
require_once('include/contact_widgets.php');
|
require_once('include/contact_widgets.php');
|
||||||
require_once('mod/proxy.php');
|
require_once('mod/proxy.php');
|
||||||
|
|
|
@ -4,7 +4,6 @@ require_once('include/security.php');
|
||||||
require_once('include/bbcode.php');
|
require_once('include/bbcode.php');
|
||||||
require_once('include/items.php');
|
require_once('include/items.php');
|
||||||
|
|
||||||
|
|
||||||
function mood_init(App $a) {
|
function mood_init(App $a) {
|
||||||
|
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
|
|
|
@ -1,83 +1,53 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
function newmember_content(App $a) {
|
function newmember_content(App $a) {
|
||||||
|
|
||||||
|
|
||||||
$o = '<h1>' . t('Welcome to Friendica') . '</h1>';
|
$o = '<h1>' . t('Welcome to Friendica') . '</h1>';
|
||||||
|
|
||||||
$o .= '<h3>' . t('New Member Checklist') . '</h3>';
|
$o .= '<h3>' . t('New Member Checklist') . '</h3>';
|
||||||
|
|
||||||
$o .= '<div style="font-size: 120%;">';
|
$o .= '<div style="font-size: 120%;">';
|
||||||
|
|
||||||
$o .= t('We would like to offer some tips and links to help make your experience enjoyable. Click any item to visit the relevant page. A link to this page will be visible from your home page for two weeks after your initial registration and then will quietly disappear.');
|
$o .= t('We would like to offer some tips and links to help make your experience enjoyable. Click any item to visit the relevant page. A link to this page will be visible from your home page for two weeks after your initial registration and then will quietly disappear.');
|
||||||
|
|
||||||
$o .= '<h4>' . t('Getting Started') . '</h4>';
|
$o .= '<h4>' . t('Getting Started') . '</h4>';
|
||||||
|
|
||||||
$o .= '<ul>';
|
$o .= '<ul>';
|
||||||
|
|
||||||
$o .= '<li> ' . '<a target="newmember" href="help/guide">' . t('Friendica Walk-Through') . '</a><br />' . t('On your <em>Quick Start</em> page - find a brief introduction to your profile and network tabs, make some new connections, and find some groups to join.') . '</li>' . EOL;
|
$o .= '<li> ' . '<a target="newmember" href="help/guide">' . t('Friendica Walk-Through') . '</a><br />' . t('On your <em>Quick Start</em> page - find a brief introduction to your profile and network tabs, make some new connections, and find some groups to join.') . '</li>' . EOL;
|
||||||
|
|
||||||
$o .= '</ul>';
|
$o .= '</ul>';
|
||||||
|
|
||||||
$o .= '<h4>' . t('Settings') . '</h4>';
|
$o .= '<h4>' . t('Settings') . '</h4>';
|
||||||
|
|
||||||
$o .= '<ul>';
|
$o .= '<ul>';
|
||||||
|
|
||||||
$o .= '<li>' . '<a target="newmember" href="settings">' . t('Go to Your Settings') . '</a><br />' . t('On your <em>Settings</em> page - change your initial password. Also make a note of your Identity Address. This looks just like an email address - and will be useful in making friends on the free social web.') . '</li>' . EOL;
|
$o .= '<li>' . '<a target="newmember" href="settings">' . t('Go to Your Settings') . '</a><br />' . t('On your <em>Settings</em> page - change your initial password. Also make a note of your Identity Address. This looks just like an email address - and will be useful in making friends on the free social web.') . '</li>' . EOL;
|
||||||
|
|
||||||
$o .= '<li>' . t('Review the other settings, particularly the privacy settings. An unpublished directory listing is like having an unlisted phone number. In general, you should probably publish your listing - unless all of your friends and potential friends know exactly how to find you.') . '</li>' . EOL;
|
$o .= '<li>' . t('Review the other settings, particularly the privacy settings. An unpublished directory listing is like having an unlisted phone number. In general, you should probably publish your listing - unless all of your friends and potential friends know exactly how to find you.') . '</li>' . EOL;
|
||||||
|
|
||||||
$o .= '</ul>';
|
$o .= '</ul>';
|
||||||
|
|
||||||
$o .= '<h4>' . t('Profile') . '</h4>';
|
$o .= '<h4>' . t('Profile') . '</h4>';
|
||||||
|
|
||||||
$o .= '<ul>';
|
$o .= '<ul>';
|
||||||
|
|
||||||
$o .= '<li>' . '<a target="newmember" href="profile_photo">' . t('Upload Profile Photo') . '</a><br />' . t('Upload a profile photo if you have not done so already. Studies have shown that people with real photos of themselves are ten times more likely to make friends than people who do not.') . '</li>' . EOL;
|
$o .= '<li>' . '<a target="newmember" href="profile_photo">' . t('Upload Profile Photo') . '</a><br />' . t('Upload a profile photo if you have not done so already. Studies have shown that people with real photos of themselves are ten times more likely to make friends than people who do not.') . '</li>' . EOL;
|
||||||
|
|
||||||
$o .= '<li>' . '<a target="newmember" href="profiles">' . t('Edit Your Profile') . '</a><br />' . t('Edit your <strong>default</strong> profile to your liking. Review the settings for hiding your list of friends and hiding the profile from unknown visitors.') . '</li>' . EOL;
|
$o .= '<li>' . '<a target="newmember" href="profiles">' . t('Edit Your Profile') . '</a><br />' . t('Edit your <strong>default</strong> profile to your liking. Review the settings for hiding your list of friends and hiding the profile from unknown visitors.') . '</li>' . EOL;
|
||||||
|
|
||||||
$o .= '<li>' . '<a target="newmember" href="profiles">' . t('Profile Keywords') . '</a><br />' . t('Set some public keywords for your default profile which describe your interests. We may be able to find other people with similar interests and suggest friendships.') . '</li>' . EOL;
|
$o .= '<li>' . '<a target="newmember" href="profiles">' . t('Profile Keywords') . '</a><br />' . t('Set some public keywords for your default profile which describe your interests. We may be able to find other people with similar interests and suggest friendships.') . '</li>' . EOL;
|
||||||
|
|
||||||
$o .= '</ul>';
|
$o .= '</ul>';
|
||||||
|
|
||||||
$o .= '<h4>' . t('Connecting') . '</h4>';
|
$o .= '<h4>' . t('Connecting') . '</h4>';
|
||||||
|
|
||||||
$o .= '<ul>';
|
$o .= '<ul>';
|
||||||
|
|
||||||
$mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
|
$mail_disabled = ((function_exists('imap_open') && (!get_config('system', 'imap_disabled'))) ? 0 : 1);
|
||||||
|
|
||||||
if(! $mail_disabled)
|
if (!$mail_disabled) {
|
||||||
$o .= '<li>' . '<a target="newmember" href="settings/connectors">' . t('Importing Emails') . '</a><br />' . t('Enter your email access information on your Connector Settings page if you wish to import and interact with friends or mailing lists from your email INBOX') . '</li>' . EOL;
|
$o .= '<li>' . '<a target="newmember" href="settings/connectors">' . t('Importing Emails') . '</a><br />' . t('Enter your email access information on your Connector Settings page if you wish to import and interact with friends or mailing lists from your email INBOX') . '</li>' . EOL;
|
||||||
|
}
|
||||||
|
|
||||||
$o .= '<li>' . '<a target="newmember" href="contacts">' . t('Go to Your Contacts Page') . '</a><br />' . t('Your Contacts page is your gateway to managing friendships and connecting with friends on other networks. Typically you enter their address or site URL in the <em>Add New Contact</em> dialog.') . '</li>' . EOL;
|
$o .= '<li>' . '<a target="newmember" href="contacts">' . t('Go to Your Contacts Page') . '</a><br />' . t('Your Contacts page is your gateway to managing friendships and connecting with friends on other networks. Typically you enter their address or site URL in the <em>Add New Contact</em> dialog.') . '</li>' . EOL;
|
||||||
|
|
||||||
$o .= '<li>' . '<a target="newmember" href="directory">' . t("Go to Your Site's Directory") . '</a><br />' . t('The Directory page lets you find other people in this network or other federated sites. Look for a <em>Connect</em> or <em>Follow</em> link on their profile page. Provide your own Identity Address if requested.') . '</li>' . EOL;
|
$o .= '<li>' . '<a target="newmember" href="directory">' . t("Go to Your Site's Directory") . '</a><br />' . t('The Directory page lets you find other people in this network or other federated sites. Look for a <em>Connect</em> or <em>Follow</em> link on their profile page. Provide your own Identity Address if requested.') . '</li>' . EOL;
|
||||||
|
|
||||||
$o .= '<li>' . '<a target="newmember" href="contacts">' . t('Finding New People') . '</a><br />' . t("On the side panel of the Contacts page are several tools to find new friends. We can match people by interest, look up people by name or interest, and provide suggestions based on network relationships. On a brand new site, friend suggestions will usually begin to be populated within 24 hours.") . '</li>' . EOL;
|
$o .= '<li>' . '<a target="newmember" href="contacts">' . t('Finding New People') . '</a><br />' . t("On the side panel of the Contacts page are several tools to find new friends. We can match people by interest, look up people by name or interest, and provide suggestions based on network relationships. On a brand new site, friend suggestions will usually begin to be populated within 24 hours.") . '</li>' . EOL;
|
||||||
|
|
||||||
$o .= '</ul>';
|
$o .= '</ul>';
|
||||||
|
|
||||||
$o .= '<h4>' . t('Groups') . '</h4>';
|
$o .= '<h4>' . t('Groups') . '</h4>';
|
||||||
|
|
||||||
$o .= '<ul>';
|
$o .= '<ul>';
|
||||||
|
|
||||||
$o .= '<li>' . '<a target="newmember" href="contacts">' . t('Group Your Contacts') . '</a><br />' . t('Once you have made some friends, organize them into private conversation groups from the sidebar of your Contacts page and then you can interact with each group privately on your Network page.') . '</li>' . EOL;
|
$o .= '<li>' . '<a target="newmember" href="contacts">' . t('Group Your Contacts') . '</a><br />' . t('Once you have made some friends, organize them into private conversation groups from the sidebar of your Contacts page and then you can interact with each group privately on your Network page.') . '</li>' . EOL;
|
||||||
|
|
||||||
if(get_config('system', 'newuser_private')) {
|
if (get_config('system', 'newuser_private')) {
|
||||||
$o .= '<li>' . '<a target="newmember" href="help/Groups-and-Privacy">' . t("Why Aren't My Posts Public?") . '</a><br />' . t("Friendica respects your privacy. By default, your posts will only show up to people you've added as friends. For more information, see the help section from the link above.") . '</li>' . EOL;
|
$o .= '<li>' . '<a target="newmember" href="help/Groups-and-Privacy">' . t("Why Aren't My Posts Public?") . '</a><br />' . t("Friendica respects your privacy. By default, your posts will only show up to people you've added as friends. For more information, see the help section from the link above.") . '</li>' . EOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
$o .= '</ul>';
|
$o .= '</ul>';
|
||||||
|
|
||||||
$o .= '<h4>' . t('Getting Help') . '</h4>';
|
$o .= '<h4>' . t('Getting Help') . '</h4>';
|
||||||
|
|
||||||
$o .= '<ul>';
|
$o .= '<ul>';
|
||||||
|
|
||||||
$o .= '<li>' . '<a target="newmember" href="help">' . t('Go to the Help Section') . '</a><br />' . t('Our <strong>help</strong> pages may be consulted for detail on other program features and resources.') . '</li>' . EOL;
|
$o .= '<li>' . '<a target="newmember" href="help">' . t('Go to the Help Section') . '</a><br />' . t('Our <strong>help</strong> pages may be consulted for detail on other program features and resources.') . '</li>' . EOL;
|
||||||
|
|
||||||
$o .= '</ul>';
|
$o .= '</ul>';
|
||||||
|
|
||||||
$o .= '</div>';
|
$o .= '</div>';
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* Documentation: http://nodeinfo.diaspora.software/schema.html
|
* Documentation: http://nodeinfo.diaspora.software/schema.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use \Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
|
|
||||||
require_once 'include/plugin.php';
|
require_once 'include/plugin.php';
|
||||||
|
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
<?php
|
<?php
|
||||||
/* identi.ca -> friendica items permanent-url compatibility */
|
|
||||||
|
|
||||||
function notice_init(App $a) {
|
/* identi.ca -> friendica items permanent-url compatibility */
|
||||||
$id = $a->argv[1];
|
|
||||||
$r = q("SELECT user.nickname FROM user LEFT JOIN item ON item.uid=user.uid WHERE item.id=%d",
|
|
||||||
intval($id)
|
|
||||||
);
|
|
||||||
if (dbm::is_result($r)){
|
|
||||||
$nick = $r[0]['nickname'];
|
|
||||||
$url = App::get_baseurl()."/display/$nick/$id";
|
|
||||||
goaway($url);
|
|
||||||
} else {
|
|
||||||
$a->error = 404;
|
|
||||||
notice( t('Item not found.') . EOL);
|
|
||||||
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
|
|
||||||
|
function notice_init(App $a) {
|
||||||
|
|
||||||
|
$id = $a->argv[1];
|
||||||
|
$r = q("SELECT `user`.`nickname` FROM `user` LEFT JOIN `item` ON `item`.`uid` = `user`.`uid` WHERE `item`.`id` = %d", intval($id));
|
||||||
|
if (dbm::is_result($r)) {
|
||||||
|
$nick = $r[0]['nickname'];
|
||||||
|
$url = App::get_baseurl() . "/display/$nick/$id";
|
||||||
|
goaway($url);
|
||||||
|
} else {
|
||||||
|
$a->error = 404;
|
||||||
|
notice(t('Item not found.') . EOL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
|
|
||||||
require_once('library/openid.php');
|
require_once('library/openid.php');
|
||||||
|
|
||||||
|
|
||||||
function openid_content(App $a) {
|
function openid_content(App $a) {
|
||||||
|
|
||||||
$noid = get_config('system','no_openid');
|
$noid = get_config('system','no_openid');
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
function opensearch_content(App $a) {
|
|
||||||
|
|
||||||
$tpl = get_markup_template('opensearch.tpl');
|
|
||||||
|
|
||||||
header("Content-type: application/opensearchdescription+xml");
|
function opensearch_content(App $a) {
|
||||||
|
|
||||||
$o = replace_macros($tpl, array(
|
$tpl = get_markup_template('opensearch.tpl');
|
||||||
'$baseurl' => App::get_baseurl(),
|
|
||||||
'$nodename' => $a->get_hostname(),
|
|
||||||
));
|
|
||||||
|
|
||||||
echo $o;
|
header("Content-type: application/opensearchdescription+xml");
|
||||||
|
|
||||||
killme();
|
$o = replace_macros($tpl, array(
|
||||||
|
'$baseurl' => App::get_baseurl(),
|
||||||
|
'$nodename' => $a->get_hostname(),
|
||||||
|
));
|
||||||
|
|
||||||
}
|
echo $o;
|
||||||
?>
|
|
||||||
|
killme();
|
||||||
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
* @see ParseUrl::getSiteinfo() for more information about scraping embeddable content
|
* @see ParseUrl::getSiteinfo() for more information about scraping embeddable content
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use \Friendica\ParseUrl;
|
use Friendica\ParseUrl;
|
||||||
|
|
||||||
require_once("include/items.php");
|
require_once("include/items.php");
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use Friendica\Core\Config;
|
||||||
|
|
||||||
require_once 'include/Photo.php';
|
require_once 'include/Photo.php';
|
||||||
require_once 'include/photos.php';
|
require_once 'include/photos.php';
|
||||||
require_once 'include/items.php';
|
require_once 'include/items.php';
|
||||||
|
@ -10,8 +13,6 @@ require_once 'include/tags.php';
|
||||||
require_once 'include/threads.php';
|
require_once 'include/threads.php';
|
||||||
require_once 'include/Probe.php';
|
require_once 'include/Probe.php';
|
||||||
|
|
||||||
use \Friendica\Core\Config;
|
|
||||||
|
|
||||||
function photos_init(App $a) {
|
function photos_init(App $a) {
|
||||||
|
|
||||||
if ($a->argc > 1) {
|
if ($a->argc > 1) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
require_once("include/datetime.php");
|
require_once('include/datetime.php');
|
||||||
require_once('include/bbcode.php');
|
require_once('include/bbcode.php');
|
||||||
require_once('include/ForumManager.php');
|
require_once('include/ForumManager.php');
|
||||||
require_once('include/group.php');
|
require_once('include/group.php');
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<?php /** @file */
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* Poke, prod, finger, or otherwise do unspeakable things to somebody - who must be a connection in your address book
|
* Poke, prod, finger, or otherwise do unspeakable things to somebody - who must be a connection in your address book
|
||||||
* This function can be invoked with the required arguments (verb and cid and private and possibly parent) silently via ajax or
|
* This function can be invoked with the required arguments (verb and cid and private and possibly parent) silently via ajax or
|
||||||
* other web request. You must be logged in and connected to a profile.
|
* other web request. You must be logged in and connected to a profile.
|
||||||
|
@ -13,7 +12,7 @@
|
||||||
* private creates a private conversation with the recipient. Otherwise your profile's default post privacy is used.
|
* private creates a private conversation with the recipient. Otherwise your profile's default post privacy is used.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
* @file mod/poke.php
|
||||||
require_once('include/security.php');
|
require_once('include/security.php');
|
||||||
require_once('include/bbcode.php');
|
require_once('include/bbcode.php');
|
||||||
require_once('include/items.php');
|
require_once('include/items.php');
|
||||||
|
|
|
@ -2,21 +2,21 @@
|
||||||
|
|
||||||
function pretheme_init(App $a) {
|
function pretheme_init(App $a) {
|
||||||
|
|
||||||
if($_REQUEST['theme']) {
|
if ($_REQUEST['theme']) {
|
||||||
$theme = $_REQUEST['theme'];
|
$theme = $_REQUEST['theme'];
|
||||||
$info = get_theme_info($theme);
|
$info = get_theme_info($theme);
|
||||||
if($info) {
|
if ($info) {
|
||||||
// unfortunately there will be no translation for this string
|
// unfortunately there will be no translation for this string
|
||||||
$desc = $info['description'];
|
$desc = $info['description'];
|
||||||
$version = $info['version'];
|
$version = $info['version'];
|
||||||
$credits = $info['credits'];
|
$credits = $info['credits'];
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$desc = '';
|
$desc = '';
|
||||||
$version = '';
|
$version = '';
|
||||||
$credits = '';
|
$credits = '';
|
||||||
}
|
}
|
||||||
echo json_encode(array('img' => get_theme_screenshot($theme), 'desc' => $desc, 'version' => $version, 'credits' => $credits));
|
echo json_encode(array('img' => get_theme_screenshot($theme), 'desc' => $desc, 'version' => $version, 'credits' => $credits));
|
||||||
}
|
}
|
||||||
|
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,27 +5,26 @@ require_once('include/Scrape.php');
|
||||||
function probe_content(App $a) {
|
function probe_content(App $a) {
|
||||||
|
|
||||||
if (!local_user()) {
|
if (!local_user()) {
|
||||||
http_status_exit(403,
|
http_status_exit(403, array("title" => t("Public access denied."),
|
||||||
array("title" => t("Public access denied."),
|
"description" => t("Only logged in users are permitted to perform a probing.")));
|
||||||
"description" => t("Only logged in users are permitted to perform a probing.")));
|
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
$o .= '<h3>Probe Diagnostic</h3>';
|
$o .= '<h3>Probe Diagnostic</h3>';
|
||||||
|
|
||||||
$o .= '<form action="probe" method="get">';
|
$o .= '<form action="probe" method="get">';
|
||||||
$o .= 'Lookup address: <input type="text" style="width: 250px;" name="addr" value="' . $_GET['addr'] .'" />';
|
$o .= 'Lookup address: <input type="text" style="width: 250px;" name="addr" value="' . $_GET['addr'] . '" />';
|
||||||
$o .= '<input type="submit" name="submit" value="Submit" /></form>';
|
$o .= '<input type="submit" name="submit" value="Submit" /></form>';
|
||||||
|
|
||||||
$o .= '<br /><br />';
|
$o .= '<br /><br />';
|
||||||
|
|
||||||
if(x($_GET,'addr')) {
|
if (x($_GET, 'addr')) {
|
||||||
|
|
||||||
$addr = trim($_GET['addr']);
|
$addr = trim($_GET['addr']);
|
||||||
$res = probe_url($addr);
|
$res = probe_url($addr);
|
||||||
$o .= '<pre>';
|
$o .= '<pre>';
|
||||||
$o .= str_replace("\n",'<br />',print_r($res,true));
|
$o .= str_replace("\n", '<br />', print_r($res, true));
|
||||||
$o .= '</pre>';
|
$o .= '</pre>';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
require_once('include/contact_widgets.php');
|
require_once('include/contact_widgets.php');
|
||||||
require_once('include/redir.php');
|
require_once('include/redir.php');
|
||||||
|
|
||||||
|
|
||||||
function profile_init(App $a) {
|
function profile_init(App $a) {
|
||||||
|
|
||||||
if(! x($a->page,'aside'))
|
if(! x($a->page,'aside'))
|
||||||
|
|
|
@ -9,10 +9,8 @@ function profile_photo_init(App $a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
profile_load($a,$a->user['nickname']);
|
profile_load($a,$a->user['nickname']);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function profile_photo_post(App $a) {
|
function profile_photo_post(App $a) {
|
||||||
|
|
||||||
if (! local_user()) {
|
if (! local_user()) {
|
||||||
|
|
|
@ -48,4 +48,3 @@ function qsearch_init(App $a) {
|
||||||
echo json_encode((object) $results);
|
echo json_encode((object) $results);
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,10 +9,8 @@ require_once('include/salmon.php');
|
||||||
require_once('include/crypto.php');
|
require_once('include/crypto.php');
|
||||||
require_once('include/diaspora.php');
|
require_once('include/diaspora.php');
|
||||||
|
|
||||||
|
|
||||||
function receive_post(App $a) {
|
function receive_post(App $a) {
|
||||||
|
|
||||||
|
|
||||||
$enabled = intval(get_config('system','diaspora_enabled'));
|
$enabled = intval(get_config('system','diaspora_enabled'));
|
||||||
if(! $enabled) {
|
if(! $enabled) {
|
||||||
logger('mod-diaspora: disabled');
|
logger('mod-diaspora: disabled');
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file mod/robots_text.php
|
* @file mod/robots_text.php
|
||||||
* @brief Module which returns the default robots.txt
|
* @brief Module which returns the default robots.txt
|
||||||
|
@ -13,7 +14,6 @@
|
||||||
*/
|
*/
|
||||||
function robots_txt_init(App $a)
|
function robots_txt_init(App $a)
|
||||||
{
|
{
|
||||||
|
|
||||||
$allDisalloweds = array(
|
$allDisalloweds = array(
|
||||||
'/settings/',
|
'/settings/',
|
||||||
'/admin/',
|
'/admin/',
|
||||||
|
@ -21,9 +21,9 @@ function robots_txt_init(App $a)
|
||||||
);
|
);
|
||||||
|
|
||||||
header('Content-Type: text/plain');
|
header('Content-Type: text/plain');
|
||||||
echo 'User-agent: *'.PHP_EOL;
|
echo 'User-agent: *' . PHP_EOL;
|
||||||
foreach ($allDisalloweds as $disallowed) {
|
foreach ($allDisalloweds as $disallowed) {
|
||||||
echo 'Disallow: '.$disallowed.PHP_EOL;
|
echo 'Disallow: ' . $disallowed . PHP_EOL;
|
||||||
}
|
}
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,24 +1,24 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
function rsd_xml_content(App $a)
|
||||||
function rsd_xml_content(App $a) {
|
{
|
||||||
header ("Content-Type: text/xml");
|
header ("Content-Type: text/xml");
|
||||||
echo '<?xml version="1.0" encoding="UTF-8"?>
|
echo '<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<rsd version="1.0" xmlns="http://archipelago.phrasewise.com/rsd">
|
<rsd version="1.0" xmlns="http://archipelago.phrasewise.com/rsd">
|
||||||
<service>
|
<service>
|
||||||
<engineName>Friendica</engineName>
|
<engineName>Friendica</engineName>
|
||||||
<engineLink>http://friendica.com/</engineLink>
|
<engineLink>http://friendica.com/</engineLink>
|
||||||
<apis>
|
<apis>
|
||||||
<api name="Twitter" preferred="true" apiLink="'.App::get_baseurl().'/api/" blogID="">
|
<api name="Twitter" preferred="true" apiLink="'.App::get_baseurl().'/api/" blogID="">
|
||||||
<settings>
|
<settings>
|
||||||
<docs>http://status.net/wiki/TwitterCompatibleAPI</docs>
|
<docs>http://status.net/wiki/TwitterCompatibleAPI</docs>
|
||||||
<setting name="OAuth">false</setting>
|
<setting name="OAuth">false</setting>
|
||||||
</settings>
|
</settings>
|
||||||
</api>
|
</api>
|
||||||
</apis>
|
</apis>
|
||||||
</service>
|
</service>
|
||||||
</rsd>
|
</rsd>';
|
||||||
';
|
|
||||||
die();
|
killme();
|
||||||
}
|
}
|
|
@ -7,15 +7,14 @@
|
||||||
require_once("include/Smilies.php");
|
require_once("include/Smilies.php");
|
||||||
|
|
||||||
function smilies_content(App $a) {
|
function smilies_content(App $a) {
|
||||||
if ($a->argv[1]==="json"){
|
if ($a->argv[1] === "json") {
|
||||||
$tmp = Smilies::get_list();
|
$tmp = Smilies::get_list();
|
||||||
$results = array();
|
$results = array();
|
||||||
for($i = 0; $i < count($tmp['texts']); $i++) {
|
for ($i = 0; $i < count($tmp['texts']); $i++) {
|
||||||
$results[] = array('text' => $tmp['texts'][$i], 'icon' => $tmp['icons'][$i]);
|
$results[] = array('text' => $tmp['texts'][$i], 'icon' => $tmp['icons'][$i]);
|
||||||
}
|
}
|
||||||
json_return_and_die($results);
|
json_return_and_die($results);
|
||||||
}
|
} else {
|
||||||
else {
|
return Smilies::replace('', true);
|
||||||
return Smilies::replace('',true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file mod/statistics_json.php
|
* @file mod/statistics_json.php
|
||||||
*/
|
*/
|
||||||
|
@ -7,21 +8,21 @@ require_once("include/plugin.php");
|
||||||
|
|
||||||
function statistics_json_init(App $a) {
|
function statistics_json_init(App $a) {
|
||||||
|
|
||||||
if (!get_config("system", "nodeinfo")) {
|
if (!get_config("system", "nodeinfo")) {
|
||||||
http_status_exit(404);
|
http_status_exit(404);
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
$statistics = array(
|
$statistics = array(
|
||||||
"name" => $a->config["sitename"],
|
"name" => $a->config["sitename"],
|
||||||
"network" => FRIENDICA_PLATFORM,
|
"network" => FRIENDICA_PLATFORM,
|
||||||
"version" => FRIENDICA_VERSION."-".DB_UPDATE_VERSION,
|
"version" => FRIENDICA_VERSION . "-" . DB_UPDATE_VERSION,
|
||||||
"registrations_open" => ($a->config['register_policy'] != 0),
|
"registrations_open" => ($a->config['register_policy'] != 0),
|
||||||
"total_users" => get_config('nodeinfo','total_users'),
|
"total_users" => get_config('nodeinfo', 'total_users'),
|
||||||
"active_users_halfyear" => get_config('nodeinfo','active_users_halfyear'),
|
"active_users_halfyear" => get_config('nodeinfo', 'active_users_halfyear'),
|
||||||
"active_users_monthly" => get_config('nodeinfo','active_users_monthly'),
|
"active_users_monthly" => get_config('nodeinfo', 'active_users_monthly'),
|
||||||
"local_posts" => get_config('nodeinfo','local_posts')
|
"local_posts" => get_config('nodeinfo', 'local_posts')
|
||||||
);
|
);
|
||||||
|
|
||||||
$statistics["services"] = array();
|
$statistics["services"] = array();
|
||||||
$statistics["services"]["appnet"] = plugin_enabled("appnet");
|
$statistics["services"]["appnet"] = plugin_enabled("appnet");
|
||||||
|
@ -53,7 +54,7 @@ function statistics_json_init(App $a) {
|
||||||
$statistics["wordpress"] = $statistics["services"]["wordpress"];
|
$statistics["wordpress"] = $statistics["services"]["wordpress"];
|
||||||
|
|
||||||
header("Content-Type: application/json");
|
header("Content-Type: application/json");
|
||||||
echo json_encode($statistics, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);
|
echo json_encode($statistics, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
|
||||||
logger("statistics_init: printed ".print_r($statistics, true), LOGGER_DATA);
|
logger("statistics_init: printed " . print_r($statistics, true), LOGGER_DATA);
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@ require_once('include/security.php');
|
||||||
require_once('include/bbcode.php');
|
require_once('include/bbcode.php');
|
||||||
require_once('include/items.php');
|
require_once('include/items.php');
|
||||||
|
|
||||||
|
|
||||||
function subthread_content(App $a) {
|
function subthread_content(App $a) {
|
||||||
|
|
||||||
if(! local_user() && ! remote_user()) {
|
if(! local_user() && ! remote_user()) {
|
||||||
|
|
|
@ -4,7 +4,6 @@ require_once('include/security.php');
|
||||||
require_once('include/bbcode.php');
|
require_once('include/bbcode.php');
|
||||||
require_once('include/items.php');
|
require_once('include/items.php');
|
||||||
|
|
||||||
|
|
||||||
function tagger_content(App $a) {
|
function tagger_content(App $a) {
|
||||||
|
|
||||||
if(! local_user() && ! remote_user()) {
|
if(! local_user() && ! remote_user()) {
|
||||||
|
|
|
@ -16,4 +16,3 @@ function toggle_mobile_init(App $a) {
|
||||||
|
|
||||||
goaway($address);
|
goaway($address);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
function uexport_init(App $a) {
|
function uexport_init(App $a) {
|
||||||
if (! local_user()) {
|
if (!local_user()) {
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,8 +14,8 @@ function uexport_content(App $a) {
|
||||||
|
|
||||||
if ($a->argc > 1) {
|
if ($a->argc > 1) {
|
||||||
header("Content-type: application/json");
|
header("Content-type: application/json");
|
||||||
header('Content-Disposition: attachment; filename="'.$a->user['nickname'].'.'.$a->argv[1].'"');
|
header('Content-Disposition: attachment; filename="' . $a->user['nickname'] . '.' . $a->argv[1] . '"');
|
||||||
switch($a->argv[1]) {
|
switch ($a->argv[1]) {
|
||||||
case "backup":
|
case "backup":
|
||||||
uexport_all($a);
|
uexport_all($a);
|
||||||
killme();
|
killme();
|
||||||
|
@ -51,9 +51,9 @@ function _uexport_multirow($query) {
|
||||||
$result = array();
|
$result = array();
|
||||||
$r = q($query);
|
$r = q($query);
|
||||||
if (dbm::is_result($r)) {
|
if (dbm::is_result($r)) {
|
||||||
foreach($r as $rr){
|
foreach ($r as $rr) {
|
||||||
$p = array();
|
$p = array();
|
||||||
foreach($rr as $k => $v) {
|
foreach ($rr as $k => $v) {
|
||||||
$p[$k] = $v;
|
$p[$k] = $v;
|
||||||
}
|
}
|
||||||
$result[] = $p;
|
$result[] = $p;
|
||||||
|
@ -66,8 +66,8 @@ function _uexport_row($query) {
|
||||||
$result = array();
|
$result = array();
|
||||||
$r = q($query);
|
$r = q($query);
|
||||||
if (dbm::is_result($r)) {
|
if (dbm::is_result($r)) {
|
||||||
foreach($r as $rr) {
|
foreach ($r as $rr) {
|
||||||
foreach($rr as $k => $v) {
|
foreach ($rr as $k => $v) {
|
||||||
$result[$k] = $v;
|
$result[$k] = $v;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,39 +75,38 @@ function _uexport_row($query) {
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function uexport_account($a) {
|
||||||
function uexport_account($a){
|
|
||||||
|
|
||||||
$user = _uexport_row(
|
$user = _uexport_row(
|
||||||
sprintf( "SELECT * FROM `user` WHERE `uid` = %d LIMIT 1", intval(local_user()) )
|
sprintf("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1", intval(local_user()))
|
||||||
);
|
);
|
||||||
|
|
||||||
$contact = _uexport_multirow(
|
$contact = _uexport_multirow(
|
||||||
sprintf( "SELECT * FROM `contact` WHERE `uid` = %d ",intval(local_user()) )
|
sprintf("SELECT * FROM `contact` WHERE `uid` = %d ", intval(local_user()))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
$profile =_uexport_multirow(
|
$profile = _uexport_multirow(
|
||||||
sprintf( "SELECT * FROM `profile` WHERE `uid` = %d ", intval(local_user()) )
|
sprintf("SELECT * FROM `profile` WHERE `uid` = %d ", intval(local_user()))
|
||||||
);
|
);
|
||||||
|
|
||||||
$photo = _uexport_multirow(
|
$photo = _uexport_multirow(
|
||||||
sprintf( "SELECT * FROM `photo` WHERE uid = %d AND profile = 1", intval(local_user()) )
|
sprintf("SELECT * FROM `photo` WHERE uid = %d AND profile = 1", intval(local_user()))
|
||||||
);
|
);
|
||||||
foreach ($photo as &$p) {
|
foreach ($photo as &$p) {
|
||||||
$p['data'] = bin2hex($p['data']);
|
$p['data'] = bin2hex($p['data']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$pconfig = _uexport_multirow(
|
$pconfig = _uexport_multirow(
|
||||||
sprintf( "SELECT * FROM `pconfig` WHERE uid = %d",intval(local_user()) )
|
sprintf("SELECT * FROM `pconfig` WHERE uid = %d", intval(local_user()))
|
||||||
);
|
);
|
||||||
|
|
||||||
$group = _uexport_multirow(
|
$group = _uexport_multirow(
|
||||||
sprintf( "SELECT * FROM `group` WHERE uid = %d",intval(local_user()) )
|
sprintf("SELECT * FROM `group` WHERE uid = %d", intval(local_user()))
|
||||||
);
|
);
|
||||||
|
|
||||||
$group_member = _uexport_multirow(
|
$group_member = _uexport_multirow(
|
||||||
sprintf( "SELECT * FROM `group_member` WHERE uid = %d",intval(local_user()) )
|
sprintf("SELECT * FROM `group_member` WHERE uid = %d", intval(local_user()))
|
||||||
);
|
);
|
||||||
|
|
||||||
$output = array(
|
$output = array(
|
||||||
|
@ -150,13 +149,13 @@ function uexport_all(App $a) {
|
||||||
intval($x),
|
intval($x),
|
||||||
intval(500)
|
intval(500)
|
||||||
);
|
);
|
||||||
/*if (dbm::is_result($r)) {
|
/* if (dbm::is_result($r)) {
|
||||||
foreach($r as $rr)
|
foreach($r as $rr)
|
||||||
foreach($rr as $k => $v)
|
foreach($rr as $k => $v)
|
||||||
$item[][$k] = $v;
|
$item[][$k] = $v;
|
||||||
}*/
|
} */
|
||||||
|
|
||||||
$output = array('item' => $r);
|
$output = array('item' => $r);
|
||||||
echo json_encode($output)."\n";
|
echo json_encode($output) . "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,35 +1,35 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* View for user import
|
* View for user import
|
||||||
* @TODO This file has DOS line endings!
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once("include/uimport.php");
|
require_once("include/uimport.php");
|
||||||
|
|
||||||
function uimport_post(App $a) {
|
function uimport_post(App $a) {
|
||||||
switch($a->config['register_policy']) {
|
switch ($a->config['register_policy']) {
|
||||||
case REGISTER_OPEN:
|
case REGISTER_OPEN:
|
||||||
$blocked = 0;
|
$blocked = 0;
|
||||||
$verified = 1;
|
$verified = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case REGISTER_APPROVE:
|
case REGISTER_APPROVE:
|
||||||
$blocked = 1;
|
$blocked = 1;
|
||||||
$verified = 0;
|
$verified = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
case REGISTER_CLOSED:
|
case REGISTER_CLOSED:
|
||||||
if ((! x($_SESSION,'authenticated') && (! x($_SESSION,'administrator')))) {
|
if ((!x($_SESSION, 'authenticated') && (!x($_SESSION, 'administrator')))) {
|
||||||
notice( t('Permission denied.') . EOL );
|
notice(t('Permission denied.') . EOL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$blocked = 1;
|
$blocked = 1;
|
||||||
$verified = 0;
|
$verified = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (x($_FILES,'accountfile')){
|
if (x($_FILES, 'accountfile')) {
|
||||||
/// @TODO Pass $blocked / $verified, send email to admin on REGISTER_APPROVE
|
/// @TODO Pass $blocked / $verified, send email to admin on REGISTER_APPROVE
|
||||||
import_account($a, $_FILES['accountfile']);
|
import_account($a, $_FILES['accountfile']);
|
||||||
return;
|
return;
|
||||||
|
@ -38,26 +38,26 @@ function uimport_post(App $a) {
|
||||||
|
|
||||||
function uimport_content(App $a) {
|
function uimport_content(App $a) {
|
||||||
|
|
||||||
if ((! local_user()) && ($a->config['register_policy'] == REGISTER_CLOSED)) {
|
if ((!local_user()) && ($a->config['register_policy'] == REGISTER_CLOSED)) {
|
||||||
notice("Permission denied." . EOL);
|
notice("Permission denied." . EOL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$max_dailies = intval(get_config('system','max_daily_registrations'));
|
$max_dailies = intval(get_config('system', 'max_daily_registrations'));
|
||||||
if ($max_dailies) {
|
if ($max_dailies) {
|
||||||
$r = q("select count(*) as total from user where register_date > UTC_TIMESTAMP - INTERVAL 1 day");
|
$r = q("select count(*) as total from user where register_date > UTC_TIMESTAMP - INTERVAL 1 day");
|
||||||
if ($r && $r[0]['total'] >= $max_dailies) {
|
if ($r && $r[0]['total'] >= $max_dailies) {
|
||||||
logger('max daily registrations exceeded.');
|
logger('max daily registrations exceeded.');
|
||||||
notice( t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.') . EOL);
|
notice(t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.') . EOL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (x($_SESSION,'theme')) {
|
if (x($_SESSION, 'theme')) {
|
||||||
unset($_SESSION['theme']);
|
unset($_SESSION['theme']);
|
||||||
}
|
}
|
||||||
if (x($_SESSION,'mobile-theme')) {
|
if (x($_SESSION, 'mobile-theme')) {
|
||||||
unset($_SESSION['mobile-theme']);
|
unset($_SESSION['mobile-theme']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,11 +65,11 @@ function uimport_content(App $a) {
|
||||||
return replace_macros($tpl, array(
|
return replace_macros($tpl, array(
|
||||||
'$regbutt' => t('Import'),
|
'$regbutt' => t('Import'),
|
||||||
'$import' => array(
|
'$import' => array(
|
||||||
'title' => t("Move account"),
|
'title' => t("Move account"),
|
||||||
'intro' => t("You can import an account from another Friendica server."),
|
'intro' => t("You can import an account from another Friendica server."),
|
||||||
'instruct' => t("You need to export your account from the old server and upload it here. We will recreate your old account here with all your contacts. We will try also to inform your friends that you moved here."),
|
'instruct' => t("You need to export your account from the old server and upload it here. We will recreate your old account here with all your contacts. We will try also to inform your friends that you moved here."),
|
||||||
'warn' => t("This feature is experimental. We can't import contacts from the OStatus network (GNU Social/Statusnet) or from Diaspora"),
|
'warn' => t("This feature is experimental. We can't import contacts from the OStatus network (GNU Social/Statusnet) or from Diaspora"),
|
||||||
'field' => array('accountfile', t('Account file'),'<input id="id_accountfile" name="accountfile" type="file">', t('To export your account, go to "Settings->Export your personal data" and select "Export account"')),
|
'field' => array('accountfile', t('Account file'), '<input id="id_accountfile" name="accountfile" type="file">', t('To export your account, go to "Settings->Export your personal data" and select "Export account"')),
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,6 @@ require_once('include/bbcode.php');
|
||||||
require_once('include/security.php');
|
require_once('include/security.php');
|
||||||
require_once('include/redir.php');
|
require_once('include/redir.php');
|
||||||
|
|
||||||
|
|
||||||
function videos_init(App $a) {
|
function videos_init(App $a) {
|
||||||
|
|
||||||
if($a->argc > 1)
|
if($a->argc > 1)
|
||||||
|
|
|
@ -3,17 +3,16 @@
|
||||||
/**
|
/**
|
||||||
* @file mod/wall_upload.php
|
* @file mod/wall_upload.php
|
||||||
* @brief Module for uploading a picture to the profile wall
|
* @brief Module for uploading a picture to the profile wall
|
||||||
*
|
*
|
||||||
* By default the picture will be stored in the photo album with the name Wall Photos.
|
* By default the picture will be stored in the photo album with the name Wall Photos.
|
||||||
* You can specify a different album by adding an optional query string "album="
|
* You can specify a different album by adding an optional query string "album="
|
||||||
* to the url
|
* to the url
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use \Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
|
|
||||||
require_once 'include/Photo.php';
|
require_once 'include/Photo.php';
|
||||||
|
|
||||||
|
|
||||||
function wall_upload_post(App $a, $desktopmode = true) {
|
function wall_upload_post(App $a, $desktopmode = true) {
|
||||||
|
|
||||||
logger("wall upload: starting new upload", LOGGER_DEBUG);
|
logger("wall upload: starting new upload", LOGGER_DEBUG);
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* @package util
|
* @package util
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* require boot.php
|
* require boot.php
|
||||||
*/
|
*/
|
||||||
require_once("boot.php");
|
require_once("boot.php");
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use \Friendica\Core\Config;
|
use Friendica\Core\Config;
|
||||||
|
|
||||||
require_once("boot.php");
|
require_once("boot.php");
|
||||||
|
|
||||||
|
|
371
util/php2po.php
371
util/php2po.php
|
@ -1,204 +1,203 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Read strings.php file and create messages.po
|
* Read strings.php file and create messages.po
|
||||||
*
|
*
|
||||||
* php utils/php2po.php <path/to/strings.php>
|
* php utils/php2po.php <path/to/strings.php>
|
||||||
*
|
*
|
||||||
* Output to <path/to/messages.po>
|
* Output to <path/to/messages.po>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
DEFINE("NORM_REGEXP", "|[\\\]|");
|
|
||||||
|
DEFINE("NORM_REGEXP", "|[\\\]|");
|
||||||
|
|
||||||
if(! class_exists('App')) {
|
if(! class_exists('App')) {
|
||||||
class TmpA {
|
class TmpA {
|
||||||
public $strings = Array();
|
public $strings = Array();
|
||||||
|
}
|
||||||
|
$a = new TmpA();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($argc<2 || in_array('-h', $argv) || in_array('--h', $argv)) {
|
||||||
|
print "Usage: ".$argv[0]." [-p <n>] <strings.php>\n\n";
|
||||||
|
print "Options:\n";
|
||||||
|
print "p\tNumber of plural forms. Default: 2\n";
|
||||||
|
print "\n";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$phpfile = $argv[1];
|
||||||
|
$pofile = dirname($phpfile)."/messages.po";
|
||||||
|
|
||||||
|
if (!file_exists($phpfile)){
|
||||||
|
print "Unable to find '$phpfile'\n";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// utility functions
|
||||||
|
function startsWith($haystack, $needle) {
|
||||||
|
// search backwards starting from haystack length characters from the end
|
||||||
|
return $needle === "" || strrpos($haystack, $needle, -strlen($haystack)) !== FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// start !
|
||||||
|
include_once($phpfile);
|
||||||
|
|
||||||
|
$out = '';
|
||||||
|
$out .= "# FRIENDICA Distributed Social Network\n";
|
||||||
|
$out .= "# Copyright (C) 2010, 2011, 2012, 2013 the Friendica Project\n";
|
||||||
|
$out .= "# This file is distributed under the same license as the Friendica package.\n";
|
||||||
|
$out .= "# \n";
|
||||||
|
$out .= 'msgid ""' ."\n";
|
||||||
|
$out .= 'msgstr ""' ."\n";
|
||||||
|
$out .= '"Project-Id-Version: friendica\n"' ."\n";
|
||||||
|
$out .= '"Report-Msgid-Bugs-To: \n"' ."\n";
|
||||||
|
$out .= '"POT-Creation-Date: '. date("Y-m-d H:i:sO").'\n"' ."\n";
|
||||||
|
$out .= '"MIME-Version: 1.0\n"' ."\n";
|
||||||
|
$out .= '"Content-Type: text/plain; charset=UTF-8\n"' ."\n";
|
||||||
|
$out .= '"Content-Transfer-Encoding: 8bit\n"' ."\n";
|
||||||
|
|
||||||
|
// search for plural info
|
||||||
|
$lang = "";
|
||||||
|
$lang_logic = "";
|
||||||
|
$lang_pnum = 2;
|
||||||
|
|
||||||
|
$_idx = array_search('-p', $argv);
|
||||||
|
if ($_idx !== false) {
|
||||||
|
$lang_pnum = $argv[$_idx+1];
|
||||||
|
}
|
||||||
|
|
||||||
|
$infile = file($phpfile);
|
||||||
|
foreach($infile as $l) {
|
||||||
|
$l = trim($l);
|
||||||
|
if (startsWith($l, 'function string_plural_select_')) {
|
||||||
|
$lang = str_replace( 'function string_plural_select_' , '', str_replace( '($n){','', $l) );
|
||||||
|
}
|
||||||
|
if (startsWith($l, 'return')) {
|
||||||
|
$lang_logic = str_replace( '$', '', trim( str_replace( 'return ' , '', $l) , ';') );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "Language: $lang\n";
|
||||||
|
echo "Plural forms: $lang_pnum\n";
|
||||||
|
echo "Plural logic: $lang_logic;\n";
|
||||||
|
|
||||||
|
$out .= sprintf('"Language: %s\n"', $lang) ."\n";
|
||||||
|
$out .= sprintf('"Plural-Forms: nplurals=%s; plural=%s;\n"', $lang_pnum, $lang_logic) ."\n";
|
||||||
|
$out .= "\n";
|
||||||
|
|
||||||
|
print "\nLoading base message.po...";
|
||||||
|
|
||||||
|
// load base messages.po and extract msgids
|
||||||
|
$base_msgids = array();
|
||||||
|
$norm_base_msgids = array();
|
||||||
|
$base_f = file("util/messages.po") or die("No base messages.po\n");
|
||||||
|
$_f = 0; $_mid = ""; $_mids = array();
|
||||||
|
foreach( $base_f as $l) {
|
||||||
|
$l = trim($l);
|
||||||
|
//~ print $l."\n";
|
||||||
|
|
||||||
|
if (startsWith($l, 'msgstr')) {
|
||||||
|
if ($_mid != '""') {
|
||||||
|
$base_msgids[$_mid] = $_mids;
|
||||||
|
$norm_base_msgids[preg_replace(NORM_REGEXP, "", $_mid)] = $_mid;
|
||||||
|
//~ print "\t\t\t".$_mid. print_r($base_msgids[$_mid], true);
|
||||||
}
|
}
|
||||||
$a = new TmpA();
|
|
||||||
|
$_f = 0;
|
||||||
|
$_mid = "";
|
||||||
|
$_mids = array();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($argc<2 || in_array('-h', $argv) || in_array('--h', $argv)) {
|
if (startsWith($l, '"') && $_f==2) {
|
||||||
print "Usage: ".$argv[0]." [-p <n>] <strings.php>\n\n";
|
$_mids[count($_mids)-1] .= "\n".$l;
|
||||||
print "Options:\n";
|
//~ print "\t\t+mids: ".print_t($_mids, true);
|
||||||
print "p\tNumber of plural forms. Default: 2\n";
|
}
|
||||||
print "\n";
|
if (startsWith($l, 'msgid_plural ')) {
|
||||||
return;
|
$_f = 2;
|
||||||
|
$_mids[] = str_replace('msgid_plural ', '' , $l);
|
||||||
|
//~ print "\t\t mids: ".print_r($_mids, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$phpfile = $argv[1];
|
if (startsWith($l, '"') && $_f==1) {
|
||||||
$pofile = dirname($phpfile)."/messages.po";
|
$_mid .= "\n".$l;
|
||||||
|
$_mids[count($_mids)-1] .= "\n".$l;
|
||||||
if (!file_exists($phpfile)){
|
//~ print "\t+mid: $_mid \n";
|
||||||
print "Unable to find '$phpfile'\n";
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
if (startsWith($l, 'msgid ')) {
|
||||||
// utility functions
|
$_f = 1;
|
||||||
function startsWith($haystack, $needle) {
|
$_mid = str_replace('msgid ', '' , $l);
|
||||||
// search backwards starting from haystack length characters from the end
|
$_mids = array($_mid);
|
||||||
return $needle === "" || strrpos($haystack, $needle, -strlen($haystack)) !== FALSE;
|
//~ print "\t mid: $_mid \n";
|
||||||
}
|
}
|
||||||
|
//~ print "\t\t\t\t$_f\n\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
print " done\n";
|
||||||
|
print "Creating '$pofile'...";
|
||||||
|
// create msgid and msgstr
|
||||||
|
|
||||||
// start !
|
/**
|
||||||
include_once($phpfile);
|
* Get a string and retun a message.po ready text
|
||||||
|
* - replace " with \"
|
||||||
|
* - replace tab char with \t
|
||||||
|
* - manage multiline strings
|
||||||
|
*/
|
||||||
|
function massage_string($str) {
|
||||||
|
$str = str_replace('\\','\\\\',$str);
|
||||||
|
$str = str_replace('"','\"',$str);
|
||||||
|
$str = str_replace("\t",'\t',$str);
|
||||||
|
$str = str_replace("\n",'\n"'."\n".'"',$str);
|
||||||
|
if (strpos($str, "\n")!==false && $str[0]!=='"') $str = '"'."\n".$str;
|
||||||
|
$str = preg_replace("|\n([^\"])|", "\n\"$1", $str);
|
||||||
|
return sprintf('"%s"', $str);
|
||||||
|
}
|
||||||
|
|
||||||
$out = '';
|
function find_original_msgid($str) {
|
||||||
$out .= "# FRIENDICA Distributed Social Network\n";
|
global $norm_base_msgids;
|
||||||
$out .= "# Copyright (C) 2010, 2011, 2012, 2013 the Friendica Project\n";
|
$norm_str = preg_replace(NORM_REGEXP, "", $str);
|
||||||
$out .= "# This file is distributed under the same license as the Friendica package.\n";
|
if (array_key_exists($norm_str, $norm_base_msgids)) {
|
||||||
$out .= "# \n";
|
return $norm_base_msgids[$norm_str];
|
||||||
$out .= 'msgid ""' ."\n";
|
|
||||||
$out .= 'msgstr ""' ."\n";
|
|
||||||
$out .= '"Project-Id-Version: friendica\n"' ."\n";
|
|
||||||
$out .= '"Report-Msgid-Bugs-To: \n"' ."\n";
|
|
||||||
$out .= '"POT-Creation-Date: '. date("Y-m-d H:i:sO").'\n"' ."\n";
|
|
||||||
$out .= '"MIME-Version: 1.0\n"' ."\n";
|
|
||||||
$out .= '"Content-Type: text/plain; charset=UTF-8\n"' ."\n";
|
|
||||||
$out .= '"Content-Transfer-Encoding: 8bit\n"' ."\n";
|
|
||||||
|
|
||||||
// search for plural info
|
|
||||||
$lang = "";
|
|
||||||
$lang_logic = "";
|
|
||||||
$lang_pnum = 2;
|
|
||||||
|
|
||||||
$_idx = array_search('-p', $argv);
|
|
||||||
if ($_idx !== false) {
|
|
||||||
$lang_pnum = $argv[$_idx+1];
|
|
||||||
}
|
}
|
||||||
|
return $str;
|
||||||
$infile = file($phpfile);
|
}
|
||||||
foreach($infile as $l) {
|
|
||||||
$l = trim($l);
|
$warnings = "";
|
||||||
if (startsWith($l, 'function string_plural_select_')) {
|
foreach($a->strings as $key=>$str) {
|
||||||
$lang = str_replace( 'function string_plural_select_' , '', str_replace( '($n){','', $l) );
|
$msgid = massage_string($key);
|
||||||
|
|
||||||
|
if (preg_match("|%[sd0-9](\$[sn])*|", $msgid)) {
|
||||||
|
$out .= "#, php-format\n";
|
||||||
|
}
|
||||||
|
$msgid = find_original_msgid($msgid);
|
||||||
|
$out .= 'msgid '. $msgid . "\n";
|
||||||
|
|
||||||
|
if (is_array($str)) {
|
||||||
|
if (array_key_exists($msgid, $base_msgids) && isset($base_msgids[$msgid][1])) {
|
||||||
|
$out .= 'msgid_plural '. $base_msgids[$msgid][1] . "\n";
|
||||||
|
} else {
|
||||||
|
$out .= 'msgid_plural '. $msgid . "\n";
|
||||||
|
$warnings .= "[W] No source plural form for msgid:\n". str_replace("\n","\n\t", $msgid) . "\n\n";
|
||||||
}
|
}
|
||||||
if (startsWith($l, 'return')) {
|
foreach ( $str as $n => $msgstr) {
|
||||||
$lang_logic = str_replace( '$', '', trim( str_replace( 'return ' , '', $l) , ';') );
|
$out .= 'msgstr['.$n.'] '. massage_string($msgstr) . "\n";
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$out .= 'msgstr '. massage_string($str) . "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "Language: $lang\n";
|
|
||||||
echo "Plural forms: $lang_pnum\n";
|
|
||||||
echo "Plural logic: $lang_logic;\n";
|
|
||||||
|
|
||||||
$out .= sprintf('"Language: %s\n"', $lang) ."\n";
|
|
||||||
$out .= sprintf('"Plural-Forms: nplurals=%s; plural=%s;\n"', $lang_pnum, $lang_logic) ."\n";
|
|
||||||
$out .= "\n";
|
$out .= "\n";
|
||||||
|
|
||||||
print "\nLoading base message.po...";
|
}
|
||||||
|
|
||||||
// load base messages.po and extract msgids
|
|
||||||
$base_msgids = array();
|
|
||||||
$norm_base_msgids = array();
|
|
||||||
$base_f = file("util/messages.po") or die("No base messages.po\n");
|
|
||||||
$_f = 0; $_mid = ""; $_mids = array();
|
|
||||||
foreach( $base_f as $l) {
|
|
||||||
$l = trim($l);
|
|
||||||
//~ print $l."\n";
|
|
||||||
|
|
||||||
if (startsWith($l, 'msgstr')) {
|
|
||||||
if ($_mid != '""') {
|
|
||||||
$base_msgids[$_mid] = $_mids;
|
|
||||||
$norm_base_msgids[preg_replace(NORM_REGEXP, "", $_mid)] = $_mid;
|
|
||||||
//~ print "\t\t\t".$_mid. print_r($base_msgids[$_mid], true);
|
|
||||||
}
|
|
||||||
|
|
||||||
$_f = 0;
|
|
||||||
$_mid = "";
|
|
||||||
$_mids = array();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (startsWith($l, '"') && $_f==2) {
|
|
||||||
$_mids[count($_mids)-1] .= "\n".$l;
|
|
||||||
//~ print "\t\t+mids: ".print_t($_mids, true);
|
|
||||||
}
|
|
||||||
if (startsWith($l, 'msgid_plural ')) {
|
|
||||||
$_f = 2;
|
|
||||||
$_mids[] = str_replace('msgid_plural ', '' , $l);
|
|
||||||
//~ print "\t\t mids: ".print_r($_mids, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (startsWith($l, '"') && $_f==1) {
|
|
||||||
$_mid .= "\n".$l;
|
|
||||||
$_mids[count($_mids)-1] .= "\n".$l;
|
|
||||||
//~ print "\t+mid: $_mid \n";
|
|
||||||
}
|
|
||||||
if (startsWith($l, 'msgid ')) {
|
|
||||||
$_f = 1;
|
|
||||||
$_mid = str_replace('msgid ', '' , $l);
|
|
||||||
$_mids = array($_mid);
|
|
||||||
//~ print "\t mid: $_mid \n";
|
|
||||||
}
|
|
||||||
//~ print "\t\t\t\t$_f\n\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
print " done\n";
|
|
||||||
print "Creating '$pofile'...";
|
|
||||||
// create msgid and msgstr
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get a string and retun a message.po ready text
|
|
||||||
* - replace " with \"
|
|
||||||
* - replace tab char with \t
|
|
||||||
* - manage multiline strings
|
|
||||||
*/
|
|
||||||
function massage_string($str) {
|
|
||||||
$str = str_replace('\\','\\\\',$str);
|
|
||||||
$str = str_replace('"','\"',$str);
|
|
||||||
$str = str_replace("\t",'\t',$str);
|
|
||||||
$str = str_replace("\n",'\n"'."\n".'"',$str);
|
|
||||||
if (strpos($str, "\n")!==false && $str[0]!=='"') $str = '"'."\n".$str;
|
|
||||||
$str = preg_replace("|\n([^\"])|", "\n\"$1", $str);
|
|
||||||
return sprintf('"%s"', $str);
|
|
||||||
}
|
|
||||||
|
|
||||||
function find_original_msgid($str) {
|
|
||||||
global $norm_base_msgids;
|
|
||||||
$norm_str = preg_replace(NORM_REGEXP, "", $str);
|
|
||||||
if (array_key_exists($norm_str, $norm_base_msgids)) {
|
|
||||||
return $norm_base_msgids[$norm_str];
|
|
||||||
}
|
|
||||||
return $str;
|
|
||||||
}
|
|
||||||
|
|
||||||
$warnings = "";
|
|
||||||
foreach($a->strings as $key=>$str) {
|
|
||||||
$msgid = massage_string($key);
|
|
||||||
|
|
||||||
if (preg_match("|%[sd0-9](\$[sn])*|", $msgid)) {
|
|
||||||
$out .= "#, php-format\n";
|
|
||||||
}
|
|
||||||
$msgid = find_original_msgid($msgid);
|
|
||||||
$out .= 'msgid '. $msgid . "\n";
|
|
||||||
|
|
||||||
if (is_array($str)) {
|
|
||||||
if (array_key_exists($msgid, $base_msgids) && isset($base_msgids[$msgid][1])) {
|
|
||||||
$out .= 'msgid_plural '. $base_msgids[$msgid][1] . "\n";
|
|
||||||
} else {
|
|
||||||
$out .= 'msgid_plural '. $msgid . "\n";
|
|
||||||
$warnings .= "[W] No source plural form for msgid:\n". str_replace("\n","\n\t", $msgid) . "\n\n";
|
|
||||||
}
|
|
||||||
foreach ( $str as $n => $msgstr) {
|
|
||||||
$out .= 'msgstr['.$n.'] '. massage_string($msgstr) . "\n";
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$out .= 'msgstr '. massage_string($str) . "\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$out .= "\n";
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
file_put_contents($pofile, $out);
|
file_put_contents($pofile, $out);
|
||||||
|
|
||||||
print " done\n";
|
print " done\n";
|
||||||
|
|
||||||
if ($warnings=="") {
|
if ($warnings=="") {
|
||||||
print "No warnings.\n";
|
print "No warnings.\n";
|
||||||
} else {
|
} else {
|
||||||
print $warnings;
|
print $warnings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,59 +1,59 @@
|
||||||
<?php
|
<?php
|
||||||
// Tired of chasing typos and finding them after a commit.
|
// Tired of chasing typos and finding them after a commit.
|
||||||
// Run this from cmdline in basedir and quickly see if we've
|
// Run this from cmdline in basedir and quickly see if we've
|
||||||
// got any parse errors in our application files.
|
// got any parse errors in our application files.
|
||||||
|
|
||||||
|
|
||||||
error_reporting(E_ERROR | E_WARNING | E_PARSE );
|
error_reporting(E_ERROR | E_WARNING | E_PARSE );
|
||||||
ini_set('display_errors', '1');
|
ini_set('display_errors', '1');
|
||||||
ini_set('log_errors','0');
|
ini_set('log_errors','0');
|
||||||
|
|
||||||
include 'boot.php';
|
include 'boot.php';
|
||||||
|
|
||||||
$a = new App();
|
$a = new App();
|
||||||
|
|
||||||
if(x($a->config,'php_path'))
|
if(x($a->config,'php_path'))
|
||||||
$phpath = $a->config['php_path'];
|
$phpath = $a->config['php_path'];
|
||||||
else
|
else
|
||||||
$phpath = 'php';
|
$phpath = 'php';
|
||||||
|
|
||||||
|
|
||||||
echo "Directory: mod\n";
|
echo "Directory: mod\n";
|
||||||
$files = glob('mod/*.php');
|
$files = glob('mod/*.php');
|
||||||
|
foreach($files as $file) {
|
||||||
|
passthru("$phpath -l $file", $ret); $ret===0 or die();
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "Directory: include\n";
|
||||||
|
$files = glob('include/*.php');
|
||||||
|
foreach($files as $file) {
|
||||||
|
passthru("$phpath -l $file", $ret); $ret===0 or die();
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "Directory: object\n";
|
||||||
|
$files = glob('object/*.php');
|
||||||
|
foreach($files as $file) {
|
||||||
|
passthru("$phpath -l $file", $ret); $ret===0 or die();
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "Directory: addon\n";
|
||||||
|
$dirs = glob('addon/*');
|
||||||
|
|
||||||
|
foreach($dirs as $dir) {
|
||||||
|
$addon = basename($dir);
|
||||||
|
$files = glob($dir . '/' . $addon . '.php');
|
||||||
foreach($files as $file) {
|
foreach($files as $file) {
|
||||||
passthru("$phpath -l $file", $ret); $ret===0 or die();
|
passthru("$phpath -l $file", $ret); $ret===0 or die();
|
||||||
}
|
|
||||||
|
|
||||||
echo "Directory: include\n";
|
|
||||||
$files = glob('include/*.php');
|
|
||||||
foreach($files as $file) {
|
|
||||||
passthru("$phpath -l $file", $ret); $ret===0 or die();
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "Directory: object\n";
|
|
||||||
$files = glob('object/*.php');
|
|
||||||
foreach($files as $file) {
|
|
||||||
passthru("$phpath -l $file", $ret); $ret===0 or die();
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "Directory: addon\n";
|
|
||||||
$dirs = glob('addon/*');
|
|
||||||
|
|
||||||
foreach($dirs as $dir) {
|
|
||||||
$addon = basename($dir);
|
|
||||||
$files = glob($dir . '/' . $addon . '.php');
|
|
||||||
foreach($files as $file) {
|
|
||||||
passthru("$phpath -l $file", $ret); $ret===0 or die();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
echo "String files\n";
|
echo "String files\n";
|
||||||
|
|
||||||
echo 'util/strings.php' . "\n";
|
echo 'util/strings.php' . "\n";
|
||||||
passthru("$phpath -l util/strings.php", $ret); $ret===0 or die();
|
passthru("$phpath -l util/strings.php", $ret); $ret===0 or die();
|
||||||
|
|
||||||
$files = glob('view/lang/*/strings.php');
|
$files = glob('view/lang/*/strings.php');
|
||||||
foreach($files as $file) {
|
foreach($files as $file) {
|
||||||
passthru("$phpath -l $file", $ret); $ret===0 or die();
|
passthru("$phpath -l $file", $ret); $ret===0 or die();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Theme settings
|
* Theme settings
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,10 +19,10 @@
|
||||||
<script>var frio="<?php echo "view/theme/frio"; ?>";</script>
|
<script>var frio="<?php echo "view/theme/frio"; ?>";</script>
|
||||||
<?php $baseurl = App::get_baseurl(); ?>
|
<?php $baseurl = App::get_baseurl(); ?>
|
||||||
<?php $frio = "view/theme/frio"; ?>
|
<?php $frio = "view/theme/frio"; ?>
|
||||||
<?php
|
<?php
|
||||||
// Because we use minimal for modals the header and the included js stuff should be only loaded
|
// Because we use minimal for modals the header and the included js stuff should be only loaded
|
||||||
// if the page is an standard page (so we don't have it twice for modals)
|
// if the page is an standard page (so we don't have it twice for modals)
|
||||||
//
|
//
|
||||||
/// @todo Think about to move js stuff in the footer
|
/// @todo Think about to move js stuff in the footer
|
||||||
if(!$minimal) {
|
if(!$minimal) {
|
||||||
if(x($page,'htmlhead')) echo $page['htmlhead'];
|
if(x($page,'htmlhead')) echo $page['htmlhead'];
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* @file view/theme/frio/php/frio_boot.php
|
* @file view/theme/frio/php/frio_boot.php
|
||||||
*
|
*
|
||||||
* @brief This file contains functions for page contstruction
|
* @brief This file contains functions for page construction
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Theme settings
|
* Theme settings
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -16,7 +16,7 @@ function smoothly_init(App $a) {
|
||||||
$cssFile = null;
|
$cssFile = null;
|
||||||
$ssl_state = null;
|
$ssl_state = null;
|
||||||
$baseurl = App::get_baseurl($ssl_state);
|
$baseurl = App::get_baseurl($ssl_state);
|
||||||
$a->page['htmlhead'] .= <<< EOT
|
$a->page['htmlhead'] .= <<< EOT
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function insertFormatting(BBcode, id) {
|
function insertFormatting(BBcode, id) {
|
||||||
|
@ -99,13 +99,12 @@ $(document).ready(function() {
|
||||||
</script>
|
</script>
|
||||||
EOT;
|
EOT;
|
||||||
|
|
||||||
/** custom css **/
|
/** custom css **/
|
||||||
if (!is_null($cssFile)) {
|
if (!is_null($cssFile)) {
|
||||||
$a->page['htmlhead'] .= sprintf('<link rel="stylesheet" type="text/css" href="%s" />', $cssFile);
|
$a->page['htmlhead'] .= sprintf('<link rel="stylesheet" type="text/css" href="%s" />', $cssFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
_js_in_foot();
|
_js_in_foot();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! function_exists('_js_in_foot')) {
|
if (! function_exists('_js_in_foot')) {
|
||||||
|
|
Loading…
Reference in a new issue