Cleanup /format pre-move

This commit is contained in:
Hypolite Petovan 2017-04-30 00:01:26 -04:00
vecāks f77632378b
revīzija 56ee734b00
85 mainīti faili ar 522 papildinājumiem un 581 dzēšanām

Parādīt failu

@ -19,7 +19,7 @@
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/network.php');

Parādīt failu

@ -5,8 +5,8 @@
*
*/
use \Friendica\Core\Config;
use \Friendica\Core\PConfig;
use Friendica\Core\Config;
use Friendica\Core\PConfig;
require_once("include/feed.php");
require_once('include/email.php');

Parādīt failu

@ -6,7 +6,7 @@
* @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/bbcode.php';

Parādīt failu

@ -1,6 +1,6 @@
<?php
use \Friendica\Core\Config;
use Friendica\Core\Config;
require_once('include/security.php');
require_once('include/datetime.php');

Parādīt failu

@ -32,6 +32,8 @@
*
*/
use Friendica\App;
if (sizeof($_SERVER["argv"]) == 0)
die();

Parādīt failu

@ -1,5 +1,7 @@
<?php
use Friendica\App;
use League\HTMLToMarkdown\HtmlConverter;
require_once "include/oembed.php";

Parādīt failu

@ -1,5 +1,6 @@
<?php
use \Friendica\Core\Config;
use Friendica\Core\Config;
require_once 'include/oembed.php';
require_once 'include/event.php';

Parādīt failu

@ -1,6 +1,6 @@
<?php /** @file */
use \Friendica\Core\Config;
use Friendica\Core\Config;
require_once('boot.php');

Parādīt failu

@ -3,7 +3,6 @@
require_once "include/bbcode.php";
require_once "include/acl_selectors.php";
/*
* 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

Parādīt failu

@ -1,5 +1,6 @@
<?php
use \Friendica\Core\Config;
use Friendica\Core\Config;
function cronjobs_run(&$argv, &$argc){
global $a;

Parādīt failu

@ -1,6 +1,6 @@
<?php
use \Friendica\Core\Config;
use Friendica\Core\Config;
require_once("boot.php");
require_once("include/text.php");

Parādīt failu

@ -1,6 +1,6 @@
<?php
use \Friendica\Core\Config;
use Friendica\Core\Config;
require_once('include/queue_fn.php');
require_once('include/html2plain.php');

Parādīt failu

@ -8,7 +8,7 @@
* This will change in the future.
*/
use \Friendica\Core\Config;
use Friendica\Core\Config;
require_once 'include/items.php';
require_once 'include/bb2diaspora.php';

Parādīt failu

@ -535,7 +535,7 @@ function get_event_strings() {
*
* @param array $dates Array of possibly duplicated events
* @return array Cleaned events
*
*
* @todo We should replace this with a separate update function if there is some time left
*/
function event_remove_duplicates($dates) {

Parādīt failu

@ -4,7 +4,7 @@
* @file include/items.php
*/
use \Friendica\ParseUrl;
use Friendica\ParseUrl;
require_once 'include/bbcode.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,
* if possible and not already present.
* Expects "body" element to exist in $arr.
*
*
* @todo Add a parameter to request forcing override
*/
function item_add_language_opt(&$arr) {

Parādīt failu

@ -1,8 +1,6 @@
<?php
// send a private message
// send a private message
function send_message($recipient=0, $body='', $subject='', $replyto=''){

Parādīt failu

@ -4,7 +4,7 @@
* @file include/network.php
*/
use \Friendica\Core\Config;
use Friendica\Core\Config;
require_once("include/xml.php");
require_once('include/Probe.php');

Parādīt failu

@ -1,6 +1,6 @@
<?php
use \Friendica\Core\Config;
use Friendica\Core\Config;
require_once('include/queue_fn.php');
require_once('include/html2plain.php');

Parādīt failu

@ -61,13 +61,13 @@ class FKOAuthDataStore extends OAuthDataStore {
logger(__function__.":".$consumer.", ". $callback);
$key = $this->gen_token();
$sec = $this->gen_token();
if ($consumer->key){
$k = $consumer->key;
} else {
$k = $consumer;
}
$r = q("INSERT INTO tokens (id, secret, client_id, scope, expires) VALUES ('%s','%s','%s','%s', UNIX_TIMESTAMP()+%d)",
dbesc($key),
dbesc($sec),
@ -80,19 +80,19 @@ class FKOAuthDataStore extends OAuthDataStore {
function new_access_token($token, $consumer, $verifier = null) {
logger(__function__.":".$token.", ". $consumer.", ". $verifier);
// return a new access token attached to this consumer
// for the user associated with this token if the request token
// is authorized
// should also invalidate the request token
$ret=Null;
// get user for this verifier
$uverifier = get_config("oauth", $verifier);
logger(__function__.":".$verifier.",".$uverifier);
if (is_null($verifier) || ($uverifier!==false)){
$key = $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)",
@ -103,13 +103,13 @@ class FKOAuthDataStore extends OAuthDataStore {
intval(ACCESS_TOKEN_DURATION),
intval($uverifier));
if ($r)
$ret = new OAuthToken($key,$sec);
$ret = new OAuthToken($key,$sec);
}
q("DELETE FROM tokens WHERE id='%s'", $token->key);
if (!is_null($ret) && $uverifier!==false){
del_config("oauth", $verifier);
/* $apps = get_pconfig($uverifier, "oauth", "apps");
@ -117,9 +117,9 @@ class FKOAuthDataStore extends OAuthDataStore {
$apps[] = $consumer->key;
set_pconfig($uverifier, "oauth", "apps", $apps);*/
}
return $ret;
}
}
@ -172,9 +172,9 @@ class FKOAuth1 extends OAuthServer {
intval($_SESSION['uid'])
);
call_hooks('logged_in', $a->user);
call_hooks('logged_in', $a->user);
}
}
/*
class FKOAuth2 extends OAuth2 {
@ -190,13 +190,13 @@ class FKOAuth2 extends OAuth2 {
dbesc($client_secret),
dbesc($redirect_uri)
);
return $r;
}
protected function checkClientCredentials($client_id, $client_secret = NULL) {
$client_secret = $this->db_secret($client_secret);
$r = q("SELECT pw FROM clients WHERE client_id = '%s'",
dbesc($client_id));
@ -218,21 +218,21 @@ class FKOAuth2 extends OAuth2 {
protected function getAccessToken($oauth_token) {
$r = q("SELECT client_id, expires, scope FROM tokens WHERE id = '%s'",
dbesc($oauth_token));
if (dbm::is_result($r))
return $r[0];
return 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')",
dbesc($oauth_token),
dbesc($client_id),
intval($expires),
dbesc($scope));
return $r;
}
@ -246,23 +246,23 @@ class FKOAuth2 extends OAuth2 {
protected function getAuthCode($code) {
$r = q("SELECT id, client_id, redirect_uri, expires, scope FROM auth_codes WHERE id = '%s'",
dbesc($code));
if (dbm::is_result($r))
return $r[0];
return null;
}
protected function setAuthCode($code, $client_id, $redirect_uri, $expires, $scope = NULL) {
$r = q("INSERT INTO auth_codes
(id, client_id, redirect_uri, expires, scope) VALUES
$r = q("INSERT INTO auth_codes
(id, client_id, redirect_uri, expires, scope) VALUES
('%s', '%s', '%s', %d, '%s')",
dbesc($code),
dbesc($client_id),
dbesc($redirect_uri),
intval($expires),
dbesc($scope));
return $r;
}
return $r;
}
}
*/

Parādīt failu

@ -4,8 +4,8 @@
* @file include/oembed.php
*/
use \Friendica\ParseUrl;
use \Friendica\Core\Config;
use Friendica\ParseUrl;
use Friendica\Core\Config;
function oembed_replacecb($matches){
$embedurl=$matches[1];

Parādīt failu

@ -4,7 +4,7 @@
* @file include/plaintext.php
*/
use \Friendica\ParseUrl;
use Friendica\ParseUrl;
require_once("include/Photo.php");
require_once("include/bbcode.php");

Parādīt failu

@ -1,7 +1,7 @@
<?php
/**
* @file include/plugin.php
*
*
* @brief Some functions to handle addons and themes.
*/
@ -164,7 +164,7 @@ function register_hook($hook,$file,$function,$priority=0) {
/**
* @brief unregisters a hook.
*
*
* @param string $hook the name of the hook
* @param string $file the name of the file that hooks into
* @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.
*
*
* like
* \code
* ..* Name: My Theme
@ -545,11 +545,11 @@ function upgrade_bool_message($bbcode = false) {
/**
* @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)
* if there is a directory with the file extension and for a file with the given
* filename.
*
* filename.
*
* @param string $file Filename
* @param string $root Full root path
* @return string Path to the file or empty string if the file isn't found

Parādīt failu

@ -1,4 +1,7 @@
<?php
use Friendica\Core\Config;
if (!file_exists("boot.php") AND (sizeof($_SERVER["argv"]) != 0)) {
$directory = dirname($_SERVER["argv"][0]);
@ -10,8 +13,6 @@ if (!file_exists("boot.php") AND (sizeof($_SERVER["argv"]) != 0)) {
chdir($directory);
}
use \Friendica\Core\Config;
require_once("boot.php");
function poller_run($argv, $argc){

Parādīt failu

@ -1,5 +1,6 @@
<?php
use \Friendica\Core\Config;
use Friendica\Core\Config;
require_once('include/items.php');
require_once('include/ostatus.php');

Parādīt failu

@ -1,6 +1,6 @@
<?php
use \Friendica\Core\Config;
use Friendica\Core\Config;
require_once("boot.php");
require_once("include/threads.php");

Parādīt failu

@ -1,13 +1,13 @@
<?php
/**
* @file include/socgraph.php
*
*
* @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 Detect if it is a forum
*/
use \Friendica\Core\Config;
use Friendica\Core\Config;
require_once('include/datetime.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`.*
FROM `glink` INNER JOIN `gcontact` on `glink`.`gcid` = `gcontact`.`id`
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",
intval($zcid),
intval($uid),

Parādīt failu

@ -6,7 +6,6 @@ require_once("include/Smilies.php");
require_once("include/map.php");
require_once("mod/proxy.php");
if(! function_exists('replace_macros')) {
/**
* This is our template processor

Parādīt failu

@ -1,11 +1,5 @@
<?php
/**
* import account file exported from mod/uexport
* args:
* $a App Friendica App Class
* $file Array array from $_FILES
*/
require_once("include/Photo.php");
define("IMPORT_DEBUG", False);
@ -75,6 +69,12 @@ function import_cleanup($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) {
logger("Start user import from " . $file['tmp_name']);
/*
@ -255,10 +255,6 @@ function import_account(App $a, $file) {
}
}
foreach ($account['photo'] as &$photo) {
$photo['uid'] = $newuid;
$photo['data'] = hex2bin($photo['data']);

Parādīt failu

@ -13,7 +13,7 @@
*
*/
use \Friendica\Core\Config;
use Friendica\Core\Config;
require_once('boot.php');
require_once('object/BaseObject.php');
@ -486,7 +486,7 @@ header("X-Friendica-Version: " . FRIENDICA_VERSION);
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.
* The page templates are located in /view/php/ or in the theme directory.
*/

Parādīt failu

@ -1,6 +1,6 @@
<?php
use \Friendica\Core\Config;
use Friendica\Core\Config;
require_once("mod/hostxrd.php");
require_once("mod/nodeinfo.php");

Parādīt failu

@ -6,7 +6,7 @@
* @brief Friendica admin
*/
use \Friendica\Core\Config;
use Friendica\Core\Config;
require_once("include/enotify.php");
require_once("include/text.php");

Parādīt failu

@ -1,8 +1,7 @@
<?php
function amcd_content(App $a) {
//header("Content-type: text/json");
echo <<< EOT
echo <<< JSON
{
"version":1,
"sessionstatus":{
@ -44,6 +43,6 @@ echo <<< EOT
}
}
}
EOT;
killme();
JSON;
killme();
}

Parādīt failu

@ -1,25 +1,24 @@
<?php
function apps_content(App $a) {
$privateaddons = get_config('config','private_addons');
if ($privateaddons === "1") {
if((! (local_user()))) {
info( t("You must be logged in to use addons. "));
return;};
}
$privateaddons = get_config('config', 'private_addons');
if ($privateaddons === "1") {
if ((!(local_user()))) {
info(t("You must be logged in to use addons. "));
return;
};
}
$title = t('Applications');
if(count($a->apps)==0)
notice( t('No installed applications.') . EOL);
$title = t('Applications');
if (count($a->apps) == 0) {
notice(t('No installed applications.') . EOL);
}
$tpl = get_markup_template("apps.tpl");
return replace_macros($tpl, array(
'$title' => $title,
'$apps' => $a->apps,
));
}

Parādīt failu

@ -1,6 +1,6 @@
<?php
use \Friendica\Core\Config;
use Friendica\Core\Config;
function community_init(App $a) {
if (! local_user()) {
@ -9,7 +9,6 @@ function community_init(App $a) {
}
}
function community_content(App $a, $update = 0) {
$o = '';

Parādīt failu

@ -3,8 +3,6 @@
require_once('include/group.php');
function contactgroup_content(App $a) {
if (! local_user()) {
killme();
}

Parādīt failu

@ -1,20 +1,22 @@
<?php
/**
* Show a credits page for all the developers who helped with the project
* (only contributors to the git repositories for friendica core and the
* addons repository will be listed though ATM)
*/
function credits_content (App $a) {
/* fill the page with credits */
$f = fopen('util/credits.txt','r');
$names = fread($f, filesize('util/credits.txt'));
$arr = explode("\n", htmlspecialchars($names));
fclose($f);
$tpl = get_markup_template('credits.tpl');
return replace_macros( $tpl, array(
'$title' => t('Credits'),
'$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,
));
function credits_content(App $a) {
/* fill the page with credits */
$f = fopen('util/credits.txt', 'r');
$names = fread($f, filesize('util/credits.txt'));
$arr = explode("\n", htmlspecialchars($names));
fclose($f);
$tpl = get_markup_template('credits.tpl');
return replace_macros($tpl, array(
'$title' => t('Credits'),
'$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,
));
}

Parādīt failu

@ -5,7 +5,6 @@ function delegate_init(App $a) {
return settings_init($a);
}
function delegate_content(App $a) {
if (! local_user()) {

Parādīt failu

@ -3,10 +3,7 @@ require_once('include/items.php');
require_once('include/auth.php');
require_once('include/dfrn.php');
function dfrn_poll_init(App $a) {
$dfrn_id = ((x($_GET,'dfrn_id')) ? $_GET['dfrn_id'] : '');
$type = ((x($_GET,'type')) ? $_GET['type'] : 'data');
$last_update = ((x($_GET,'last_update')) ? $_GET['last_update'] : '');

Parādīt failu

@ -9,24 +9,18 @@ function directory_init(App $a) {
$a->page['aside'] .= findpeople_widget();
$a->page['aside'] .= follow_widget();
}
else {
unset($_SESSION['theme']);
unset($_SESSION['mobile-theme']);
}
}
function directory_post(App $a) {
if(x($_POST,'search'))
$a->data['search'] = $_POST['search'];
}
function directory_content(App $a) {
global $db;

Parādīt failu

@ -21,8 +21,6 @@ function dirfind_init(App $a) {
$a->page['aside'] .= follow_widget();
}
function dirfind_content(App $a, $prefix = "") {
$community = false;

Parādīt failu

@ -106,7 +106,6 @@ function display_init(App $a) {
}
profile_load($a, $nick, 0, $profiledata);
}
function display_fetchauthor($a, $item) {

Parādīt failu

@ -4,7 +4,6 @@ require_once('include/security.php');
require_once('include/bbcode.php');
require_once('include/items.php');
function filer_content(App $a) {
if (! local_user()) {

Parādīt failu

@ -1,6 +1,6 @@
<?php
use \Friendica\Core\Config;
use Friendica\Core\Config;
function friendica_init(App $a) {
if ($a->argv[1] == "json"){

Parādīt failu

@ -15,6 +15,7 @@ function hovercard_init(App $a) {
// Just for testing purposes
$_GET["mode"] = "minimal";
}
function hovercard_content() {
$profileurl = (x($_REQUEST,'profileurl') ? $_REQUEST['profileurl'] : "");
$datatype = (x($_REQUEST,'datatype') ?$_REQUEST['datatype'] : "json");

Parādīt failu

@ -1,8 +1,8 @@
<?php
require_once "include/Photo.php";
$install_wizard_pass=1;
$install_wizard_pass = 1;
function install_init(App $a) {

Parādīt failu

@ -1,13 +1,16 @@
<?php
function login_content(App $a) {
if(x($_SESSION,'theme'))
if (x($_SESSION, 'theme')) {
unset($_SESSION['theme']);
if(x($_SESSION,'mobile-theme'))
}
if (x($_SESSION, 'mobile-theme')) {
unset($_SESSION['mobile-theme']);
}
if(local_user())
if (local_user()) {
goaway(z_root());
}
return login(($a->config['register_policy'] == REGISTER_CLOSED) ? false : true);
}

Parādīt failu

@ -1,6 +1,6 @@
<?php
use \Friendica\Core\Config;
use Friendica\Core\Config;
function maintenance_content(App $a) {

Parādīt failu

@ -1,26 +1,25 @@
<?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');
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();
header('Content-type: application/manifest+json');
$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();
}

Parādīt failu

@ -1,5 +1,5 @@
<?php
include_once('include/text.php');
require_once('include/text.php');
require_once('include/socgraph.php');
require_once('include/contact_widgets.php');
require_once('mod/proxy.php');

Parādīt failu

@ -4,7 +4,6 @@ require_once('include/security.php');
require_once('include/bbcode.php');
require_once('include/items.php');
function mood_init(App $a) {
if (! local_user()) {

Parādīt failu

@ -1,83 +1,53 @@
<?php
function newmember_content(App $a) {
$o = '<h1>' . t('Welcome to Friendica') . '</h1>';
$o .= '<h3>' . t('New Member Checklist') . '</h3>';
$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 .= '<h4>' . t('Getting Started') . '</h4>';
$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 .= '</ul>';
$o .= '<h4>' . t('Settings') . '</h4>';
$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>' . 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 .= '<h4>' . t('Profile') . '</h4>';
$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="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 .= '</ul>';
$o .= '<h4>' . t('Connecting') . '</h4>';
$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="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="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 .= '<h4>' . t('Groups') . '</h4>';
$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;
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 .= '</ul>';
$o .= '<h4>' . t('Getting Help') . '</h4>';
$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 .= '</ul>';
$o .= '</div>';
return $o;

Parādīt failu

@ -5,7 +5,7 @@
* Documentation: http://nodeinfo.diaspora.software/schema.html
*/
use \Friendica\Core\Config;
use Friendica\Core\Config;
require_once 'include/plugin.php';

Parādīt failu

@ -1,20 +1,20 @@
<?php
/* identi.ca -> friendica items permanent-url compatibility */
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);
/* identi.ca -> friendica items permanent-url compatibility */
}
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;
}

Parādīt failu

@ -3,7 +3,6 @@
require_once('library/openid.php');
function openid_content(App $a) {
$noid = get_config('system','no_openid');

Parādīt failu

@ -1,18 +1,18 @@
<?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(
'$baseurl' => App::get_baseurl(),
'$nodename' => $a->get_hostname(),
));
$tpl = get_markup_template('opensearch.tpl');
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();
}

Parādīt failu

@ -10,7 +10,7 @@
* @see ParseUrl::getSiteinfo() for more information about scraping embeddable content
*/
use \Friendica\ParseUrl;
use Friendica\ParseUrl;
require_once("include/items.php");

Parādīt failu

@ -1,4 +1,7 @@
<?php
use Friendica\Core\Config;
require_once 'include/Photo.php';
require_once 'include/photos.php';
require_once 'include/items.php';
@ -10,8 +13,6 @@ require_once 'include/tags.php';
require_once 'include/threads.php';
require_once 'include/Probe.php';
use \Friendica\Core\Config;
function photos_init(App $a) {
if ($a->argc > 1) {

Parādīt failu

@ -1,5 +1,5 @@
<?php
require_once("include/datetime.php");
require_once('include/datetime.php');
require_once('include/bbcode.php');
require_once('include/ForumManager.php');
require_once('include/group.php');

Parādīt failu

@ -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
* 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.
@ -13,7 +12,7 @@
* 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/bbcode.php');
require_once('include/items.php');

Parādīt failu

@ -2,21 +2,21 @@
function pretheme_init(App $a) {
if($_REQUEST['theme']) {
if ($_REQUEST['theme']) {
$theme = $_REQUEST['theme'];
$info = get_theme_info($theme);
if($info) {
if ($info) {
// unfortunately there will be no translation for this string
$desc = $info['description'];
$version = $info['version'];
$credits = $info['credits'];
}
else {
} else {
$desc = '';
$version = '';
$credits = '';
}
echo json_encode(array('img' => get_theme_screenshot($theme), 'desc' => $desc, 'version' => $version, 'credits' => $credits));
}
killme();
}

Parādīt failu

@ -5,27 +5,26 @@ require_once('include/Scrape.php');
function probe_content(App $a) {
if (!local_user()) {
http_status_exit(403,
array("title" => t("Public access denied."),
"description" => t("Only logged in users are permitted to perform a probing.")));
http_status_exit(403, array("title" => t("Public access denied."),
"description" => t("Only logged in users are permitted to perform a probing.")));
killme();
}
$o .= '<h3>Probe Diagnostic</h3>';
$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 .= '<br /><br />';
if(x($_GET,'addr')) {
if (x($_GET, 'addr')) {
$addr = trim($_GET['addr']);
$res = probe_url($addr);
$o .= '<pre>';
$o .= str_replace("\n",'<br />',print_r($res,true));
$o .= str_replace("\n", '<br />', print_r($res, true));
$o .= '</pre>';
}
return $o;
}

Parādīt failu

@ -3,7 +3,6 @@
require_once('include/contact_widgets.php');
require_once('include/redir.php');
function profile_init(App $a) {
if(! x($a->page,'aside'))

Parādīt failu

@ -9,10 +9,8 @@ function profile_photo_init(App $a) {
}
profile_load($a,$a->user['nickname']);
}
function profile_photo_post(App $a) {
if (! local_user()) {

Parādīt failu

@ -48,4 +48,3 @@ function qsearch_init(App $a) {
echo json_encode((object) $results);
killme();
}

Parādīt failu

@ -9,10 +9,8 @@ require_once('include/salmon.php');
require_once('include/crypto.php');
require_once('include/diaspora.php');
function receive_post(App $a) {
$enabled = intval(get_config('system','diaspora_enabled'));
if(! $enabled) {
logger('mod-diaspora: disabled');

Parādīt failu

@ -1,4 +1,5 @@
<?php
/**
* @file mod/robots_text.php
* @brief Module which returns the default robots.txt
@ -13,7 +14,6 @@
*/
function robots_txt_init(App $a)
{
$allDisalloweds = array(
'/settings/',
'/admin/',
@ -21,9 +21,9 @@ function robots_txt_init(App $a)
);
header('Content-Type: text/plain');
echo 'User-agent: *'.PHP_EOL;
echo 'User-agent: *' . PHP_EOL;
foreach ($allDisalloweds as $disallowed) {
echo 'Disallow: '.$disallowed.PHP_EOL;
echo 'Disallow: ' . $disallowed . PHP_EOL;
}
killme();
}

Parādīt failu

@ -1,24 +1,24 @@
<?php
function rsd_xml_content(App $a) {
function rsd_xml_content(App $a)
{
header ("Content-Type: text/xml");
echo '<?xml version="1.0" encoding="UTF-8"?>
<rsd version="1.0" xmlns="http://archipelago.phrasewise.com/rsd">
<service>
<engineName>Friendica</engineName>
<engineLink>http://friendica.com/</engineLink>
<apis>
<api name="Twitter" preferred="true" apiLink="'.App::get_baseurl().'/api/" blogID="">
<settings>
<docs>http://status.net/wiki/TwitterCompatibleAPI</docs>
<setting name="OAuth">false</setting>
</settings>
</api>
</apis>
</service>
</rsd>
';
die();
<rsd version="1.0" xmlns="http://archipelago.phrasewise.com/rsd">
<service>
<engineName>Friendica</engineName>
<engineLink>http://friendica.com/</engineLink>
<apis>
<api name="Twitter" preferred="true" apiLink="'.App::get_baseurl().'/api/" blogID="">
<settings>
<docs>http://status.net/wiki/TwitterCompatibleAPI</docs>
<setting name="OAuth">false</setting>
</settings>
</api>
</apis>
</service>
</rsd>';
killme();
}

Parādīt failu

@ -7,15 +7,14 @@
require_once("include/Smilies.php");
function smilies_content(App $a) {
if ($a->argv[1]==="json"){
if ($a->argv[1] === "json") {
$tmp = Smilies::get_list();
$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]);
}
json_return_and_die($results);
}
else {
return Smilies::replace('',true);
} else {
return Smilies::replace('', true);
}
}

Parādīt failu

@ -1,4 +1,5 @@
<?php
/**
* @file mod/statistics_json.php
*/
@ -7,21 +8,21 @@ require_once("include/plugin.php");
function statistics_json_init(App $a) {
if (!get_config("system", "nodeinfo")) {
http_status_exit(404);
killme();
}
if (!get_config("system", "nodeinfo")) {
http_status_exit(404);
killme();
}
$statistics = array(
"name" => $a->config["sitename"],
"network" => FRIENDICA_PLATFORM,
"version" => FRIENDICA_VERSION."-".DB_UPDATE_VERSION,
"registrations_open" => ($a->config['register_policy'] != 0),
"total_users" => get_config('nodeinfo','total_users'),
"active_users_halfyear" => get_config('nodeinfo','active_users_halfyear'),
"active_users_monthly" => get_config('nodeinfo','active_users_monthly'),
"local_posts" => get_config('nodeinfo','local_posts')
);
"name" => $a->config["sitename"],
"network" => FRIENDICA_PLATFORM,
"version" => FRIENDICA_VERSION . "-" . DB_UPDATE_VERSION,
"registrations_open" => ($a->config['register_policy'] != 0),
"total_users" => get_config('nodeinfo', 'total_users'),
"active_users_halfyear" => get_config('nodeinfo', 'active_users_halfyear'),
"active_users_monthly" => get_config('nodeinfo', 'active_users_monthly'),
"local_posts" => get_config('nodeinfo', 'local_posts')
);
$statistics["services"] = array();
$statistics["services"]["appnet"] = plugin_enabled("appnet");
@ -53,7 +54,7 @@ function statistics_json_init(App $a) {
$statistics["wordpress"] = $statistics["services"]["wordpress"];
header("Content-Type: application/json");
echo json_encode($statistics, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);
logger("statistics_init: printed ".print_r($statistics, true), LOGGER_DATA);
echo json_encode($statistics, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
logger("statistics_init: printed " . print_r($statistics, true), LOGGER_DATA);
killme();
}

Parādīt failu

@ -4,7 +4,6 @@ require_once('include/security.php');
require_once('include/bbcode.php');
require_once('include/items.php');
function subthread_content(App $a) {
if(! local_user() && ! remote_user()) {

Parādīt failu

@ -4,7 +4,6 @@ require_once('include/security.php');
require_once('include/bbcode.php');
require_once('include/items.php');
function tagger_content(App $a) {
if(! local_user() && ! remote_user()) {

Parādīt failu

@ -16,4 +16,3 @@ function toggle_mobile_init(App $a) {
goaway($address);
}

Parādīt failu

@ -1,7 +1,7 @@
<?php
function uexport_init(App $a) {
if (! local_user()) {
if (!local_user()) {
killme();
}
@ -14,8 +14,8 @@ function uexport_content(App $a) {
if ($a->argc > 1) {
header("Content-type: application/json");
header('Content-Disposition: attachment; filename="'.$a->user['nickname'].'.'.$a->argv[1].'"');
switch($a->argv[1]) {
header('Content-Disposition: attachment; filename="' . $a->user['nickname'] . '.' . $a->argv[1] . '"');
switch ($a->argv[1]) {
case "backup":
uexport_all($a);
killme();
@ -51,9 +51,9 @@ function _uexport_multirow($query) {
$result = array();
$r = q($query);
if (dbm::is_result($r)) {
foreach($r as $rr){
foreach ($r as $rr) {
$p = array();
foreach($rr as $k => $v) {
foreach ($rr as $k => $v) {
$p[$k] = $v;
}
$result[] = $p;
@ -66,8 +66,8 @@ function _uexport_row($query) {
$result = array();
$r = q($query);
if (dbm::is_result($r)) {
foreach($r as $rr) {
foreach($rr as $k => $v) {
foreach ($r as $rr) {
foreach ($rr as $k => $v) {
$result[$k] = $v;
}
}
@ -75,39 +75,38 @@ function _uexport_row($query) {
return $result;
}
function uexport_account($a){
function uexport_account($a) {
$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(
sprintf( "SELECT * FROM `contact` WHERE `uid` = %d ",intval(local_user()) )
sprintf("SELECT * FROM `contact` WHERE `uid` = %d ", intval(local_user()))
);
$profile =_uexport_multirow(
sprintf( "SELECT * FROM `profile` WHERE `uid` = %d ", intval(local_user()) )
$profile = _uexport_multirow(
sprintf("SELECT * FROM `profile` WHERE `uid` = %d ", intval(local_user()))
);
$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) {
$p['data'] = bin2hex($p['data']);
}
$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(
sprintf( "SELECT * FROM `group` WHERE uid = %d",intval(local_user()) )
sprintf("SELECT * FROM `group` WHERE uid = %d", intval(local_user()))
);
$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(
@ -150,13 +149,13 @@ function uexport_all(App $a) {
intval($x),
intval(500)
);
/*if (dbm::is_result($r)) {
foreach($r as $rr)
foreach($rr as $k => $v)
$item[][$k] = $v;
}*/
/* if (dbm::is_result($r)) {
foreach($r as $rr)
foreach($rr as $k => $v)
$item[][$k] = $v;
} */
$output = array('item' => $r);
echo json_encode($output)."\n";
echo json_encode($output) . "\n";
}
}

Parādīt failu

@ -1,35 +1,35 @@
<?php
/**
* View for user import
* @TODO This file has DOS line endings!
*/
require_once("include/uimport.php");
function uimport_post(App $a) {
switch($a->config['register_policy']) {
case REGISTER_OPEN:
$blocked = 0;
$verified = 1;
break;
switch ($a->config['register_policy']) {
case REGISTER_OPEN:
$blocked = 0;
$verified = 1;
break;
case REGISTER_APPROVE:
$blocked = 1;
$verified = 0;
break;
case REGISTER_APPROVE:
$blocked = 1;
$verified = 0;
break;
default:
case REGISTER_CLOSED:
if ((! x($_SESSION,'authenticated') && (! x($_SESSION,'administrator')))) {
notice( t('Permission denied.') . EOL );
return;
}
$blocked = 1;
$verified = 0;
break;
default:
case REGISTER_CLOSED:
if ((!x($_SESSION, 'authenticated') && (!x($_SESSION, 'administrator')))) {
notice(t('Permission denied.') . EOL);
return;
}
$blocked = 1;
$verified = 0;
break;
}
if (x($_FILES,'accountfile')){
if (x($_FILES, 'accountfile')) {
/// @TODO Pass $blocked / $verified, send email to admin on REGISTER_APPROVE
import_account($a, $_FILES['accountfile']);
return;
@ -38,26 +38,26 @@ function uimport_post(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);
return;
}
$max_dailies = intval(get_config('system','max_daily_registrations'));
$max_dailies = intval(get_config('system', 'max_daily_registrations'));
if ($max_dailies) {
$r = q("select count(*) as total from user where register_date > UTC_TIMESTAMP - INTERVAL 1 day");
if ($r && $r[0]['total'] >= $max_dailies) {
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;
}
}
if (x($_SESSION,'theme')) {
if (x($_SESSION, 'theme')) {
unset($_SESSION['theme']);
}
if (x($_SESSION,'mobile-theme')) {
if (x($_SESSION, 'mobile-theme')) {
unset($_SESSION['mobile-theme']);
}
@ -65,11 +65,11 @@ function uimport_content(App $a) {
return replace_macros($tpl, array(
'$regbutt' => t('Import'),
'$import' => array(
'title' => t("Move account"),
'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."),
'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"')),
'title' => t("Move account"),
'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."),
'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"')),
),
));
}

Parādīt failu

@ -5,7 +5,6 @@ require_once('include/bbcode.php');
require_once('include/security.php');
require_once('include/redir.php');
function videos_init(App $a) {
if($a->argc > 1)

Parādīt failu

@ -3,17 +3,16 @@
/**
* @file mod/wall_upload.php
* @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.
* You can specify a different album by adding an optional query string "album="
* to the url
*/
use \Friendica\Core\Config;
use Friendica\Core\Config;
require_once 'include/Photo.php';
function wall_upload_post(App $a, $desktopmode = true) {
logger("wall upload: starting new upload", LOGGER_DEBUG);

Parādīt failu

@ -3,7 +3,7 @@
* @package util
*/
/*
/*
* require boot.php
*/
require_once("boot.php");

Parādīt failu

@ -1,6 +1,6 @@
<?php
use \Friendica\Core\Config;
use Friendica\Core\Config;
require_once("boot.php");

Parādīt failu

@ -1,204 +1,203 @@
<?php
/**
* Read strings.php file and create messages.po
*
* php utils/php2po.php <path/to/strings.php>
*
* Output to <path/to/messages.po>
*/
DEFINE("NORM_REGEXP", "|[\\\]|");
if(! class_exists('App')) {
class TmpA {
public $strings = Array();
/**
* Read strings.php file and create messages.po
*
* php utils/php2po.php <path/to/strings.php>
*
* Output to <path/to/messages.po>
*/
DEFINE("NORM_REGEXP", "|[\\\]|");
if(! class_exists('App')) {
class TmpA {
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)) {
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;
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);
}
$phpfile = $argv[1];
$pofile = dirname($phpfile)."/messages.po";
if (!file_exists($phpfile)){
print "Unable to find '$phpfile'\n";
return;
if (startsWith($l, '"') && $_f==1) {
$_mid .= "\n".$l;
$_mids[count($_mids)-1] .= "\n".$l;
//~ print "\t+mid: $_mid \n";
}
// utility functions
function startsWith($haystack, $needle) {
// search backwards starting from haystack length characters from the end
return $needle === "" || strrpos($haystack, $needle, -strlen($haystack)) !== FALSE;
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
// 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 = '';
$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];
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];
}
$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) );
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";
}
if (startsWith($l, 'return')) {
$lang_logic = str_replace( '$', '', trim( str_replace( 'return ' , '', $l) , ';') );
break;
foreach ( $str as $n => $msgstr) {
$out .= 'msgstr['.$n.'] '. massage_string($msgstr) . "\n";
}
} 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";
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);
print " done\n";
if ($warnings=="") {
print "No warnings.\n";
} else {
print $warnings;
}
file_put_contents($pofile, $out);
print " done\n";
if ($warnings=="") {
print "No warnings.\n";
} else {
print $warnings;
}

Parādīt failu

@ -1,59 +1,59 @@
<?php
// Tired of chasing typos and finding them after a commit.
// Run this from cmdline in basedir and quickly see if we've
// got any parse errors in our application files.
// Tired of chasing typos and finding them after a commit.
// Run this from cmdline in basedir and quickly see if we've
// got any parse errors in our application files.
error_reporting(E_ERROR | E_WARNING | E_PARSE );
ini_set('display_errors', '1');
ini_set('log_errors','0');
error_reporting(E_ERROR | E_WARNING | E_PARSE );
ini_set('display_errors', '1');
ini_set('log_errors','0');
include 'boot.php';
include 'boot.php';
$a = new App();
$a = new App();
if(x($a->config,'php_path'))
$phpath = $a->config['php_path'];
else
$phpath = 'php';
if(x($a->config,'php_path'))
$phpath = $a->config['php_path'];
else
$phpath = 'php';
echo "Directory: mod\n";
$files = glob('mod/*.php');
echo "Directory: mod\n";
$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) {
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();
}
passthru("$phpath -l $file", $ret); $ret===0 or die();
}
}
echo "String files\n";
echo "String files\n";
echo 'util/strings.php' . "\n";
passthru("$phpath -l util/strings.php", $ret); $ret===0 or die();
echo 'util/strings.php' . "\n";
passthru("$phpath -l util/strings.php", $ret); $ret===0 or die();
$files = glob('view/lang/*/strings.php');
foreach($files as $file) {
passthru("$phpath -l $file", $ret); $ret===0 or die();
}
$files = glob('view/lang/*/strings.php');
foreach($files as $file) {
passthru("$phpath -l $file", $ret); $ret===0 or die();
}

Parādīt failu

@ -1,4 +1,5 @@
<?php
/**
* Theme settings
*/

Parādīt failu

@ -19,10 +19,10 @@
<script>var frio="<?php echo "view/theme/frio"; ?>";</script>
<?php $baseurl = App::get_baseurl(); ?>
<?php $frio = "view/theme/frio"; ?>
<?php
<?php
// 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)
//
//
/// @todo Think about to move js stuff in the footer
if(!$minimal) {
if(x($page,'htmlhead')) echo $page['htmlhead'];

Parādīt failu

@ -3,7 +3,7 @@
/**
* @file view/theme/frio/php/frio_boot.php
*
* @brief This file contains functions for page contstruction
* @brief This file contains functions for page construction
*
*/

Parādīt failu

@ -1,4 +1,5 @@
<?php
/**
* Theme settings
*/

Parādīt failu

@ -16,7 +16,7 @@ function smoothly_init(App $a) {
$cssFile = null;
$ssl_state = null;
$baseurl = App::get_baseurl($ssl_state);
$a->page['htmlhead'] .= <<< EOT
$a->page['htmlhead'] .= <<< EOT
<script>
function insertFormatting(BBcode, id) {
@ -99,13 +99,12 @@ $(document).ready(function() {
</script>
EOT;
/** custom css **/
/** custom css **/
if (!is_null($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')) {