#set_include_path("include/$this->hostname" . PATH_SEPARATOR . get_include_path());
- if((x($_SERVER,'QUERY_STRING')) && substr($_SERVER['QUERY_STRING'],0,9) === "pagename=") {
+ if ((x($_SERVER,'QUERY_STRING')) && substr($_SERVER['QUERY_STRING'],0,9) === "pagename=") {
$this->query_string = substr($_SERVER['QUERY_STRING'],9);
// removing trailing / - maybe a nginx problem
if (substr($this->query_string, 0, 1) == "/")
$this->query_string = substr($this->query_string, 1);
- } elseif((x($_SERVER,'QUERY_STRING')) && substr($_SERVER['QUERY_STRING'],0,2) === "q=") {
+ } elseif ((x($_SERVER,'QUERY_STRING')) && substr($_SERVER['QUERY_STRING'],0,2) === "q=") {
$this->query_string = substr($_SERVER['QUERY_STRING'],2);
// removing trailing / - maybe a nginx problem
if (substr($this->query_string, 0, 1) == "/")
$this->query_string = substr($this->query_string, 1);
}
- if (x($_GET,'pagename'))
+ if (x($_GET,'pagename')) {
$this->cmd = trim($_GET['pagename'],'/\\');
- elseif (x($_GET,'q'))
+ } elseif (x($_GET,'q')) {
$this->cmd = trim($_GET['q'],'/\\');
+ }
// fix query_string
// unix style "homedir"
- if(substr($this->cmd,0,1) === '~')
+ if (substr($this->cmd,0,1) === '~') {
$this->cmd = 'profile/' . substr($this->cmd,1);
+ }
// Diaspora style profile url
- if(substr($this->cmd,0,2) === 'u/')
+ if (substr($this->cmd,0,2) === 'u/') {
$this->cmd = 'profile/' . substr($this->cmd,2);
+ }
/*
$url = str_replace('/#!/','/',$url);
- if(! allowed_url($url)) {
+ if (! allowed_url($url)) {
$result['message'] = t('Disallowed profile URL.');
return $result;
}
- if(! $url) {
+ if (! $url) {
$result['message'] = t('Connect URL missing.');
return $result;
}
call_hooks('follow', $arr);
- if(x($arr['contact'],'name'))
+ if (x($arr['contact'],'name')) {
$ret = $arr['contact'];
- else
+ }
+ else {
$ret = probe_url($url);
+ }
- if($ret['network'] === NETWORK_DFRN) {
- if($interactive) {
- if(strlen($a->path))
+ if ($ret['network'] === NETWORK_DFRN) {
+ if ($interactive) {
+ if (strlen($a->path)) {
$myaddr = bin2hex(App::get_baseurl() . '/profile/' . $a->user['nickname']);
- else
+ }
+ else {
$myaddr = bin2hex($a->user['nickname'] . '@' . $a->get_hostname());
+ }
goaway($ret['request'] . "&addr=$myaddr");
// We have found at least one key URL
// If it's inline, parse it - otherwise get the key
- if(count($ret) > 0) {
- for($x = 0; $x < count($ret); $x ++) {
- if(substr($ret[$x],0,5) === 'data:') {
- if(strstr($ret[$x],','))
+ if (count($ret) > 0) {
+ for ($x = 0; $x < count($ret); $x ++) {
+ if (substr($ret[$x],0,5) === 'data:') {
+ if (strstr($ret[$x],',')) {
$ret[$x] = substr($ret[$x],strpos($ret[$x],',')+1);
- else
+ } else {
$ret[$x] = substr($ret[$x],5);
- } elseif (normalise_link($ret[$x]) == 'http://')
+ }
+ } elseif (normalise_link($ret[$x]) == 'http://') {
$ret[$x] = fetch_url($ret[$x]);
+ }
}
}
logger('Key located: ' . print_r($ret,true));
- if(count($ret) == 1) {
+ if (count($ret) == 1) {
// We only found one one key so we don't care if the hash matches.
// If it's the wrong key we'll find out soon enough because
return $ret[0];
}
else {
- foreach($ret as $a) {
+ foreach ($ret as $a) {
$hash = base64url_encode(hash('sha256',$a));
- if($hash == $keyhash)
+ if ($hash == $keyhash) {
return $a;
+ }
}
}
}
- if($login_initial) {
+ if ($login_initial) {
call_hooks('logged_in', $a->user);
- if(($a->module !== 'home') && isset($_SESSION['return_url']))
+ if (($a->module !== 'home') && isset($_SESSION['return_url'])) {
goaway(App::get_baseurl() . '/' . $_SESSION['return_url']);
+ }
}
}
static $verified = 0;
- if((! (local_user())) && (! (remote_user())))
+ if ((! (local_user())) && (! (remote_user()))) {
return false;
+ }
$uid = local_user();
- if(($uid) && ($uid == $owner)) {
+ if (($uid) && ($uid == $owner)) {
return true;
}
- if(remote_user()) {
+ if (remote_user()) {
// use remembered decision and avoid a DB lookup for each and every display item
// DO NOT use this function if there are going to be multiple owners
// We have a contact-id for an authenticated remote user, this block determines if the contact
// belongs to this page owner, and has the necessary permissions to post content
- if($verified === 2)
+ if ($verified === 2) {
return true;
- elseif($verified === 1)
+ } elseif ($verified === 1) {
return false;
- else {
+ } else {
$cid = 0;
- if(is_array($_SESSION['remote'])) {
- foreach($_SESSION['remote'] as $visitor) {
- if($visitor['uid'] == $owner) {
+ if (is_array($_SESSION['remote'])) {
+ foreach ($_SESSION['remote'] as $visitor) {
+ if ($visitor['uid'] == $owner) {
$cid = $visitor['cid'];
break;
}
}
}
- if(! $cid)
+ if (! $cid) {
return false;
-
+ }
$r = q("SELECT `contact`.*, `user`.`page-flags` FROM `contact` INNER JOIN `user` on `user`.`uid` = `contact`.`uid`
WHERE `contact`.`uid` = %d AND `contact`.`id` = %d AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
$name = $entry->displayName;
- if(isset($entry->urls)) {
- foreach($entry->urls as $url) {
+ if (isset($entry->urls)) {
+ foreach ($entry->urls as $url) {
if ($url->type == 'profile') {
$profile_url = $url->value;
continue;
}
}
if (isset($entry->photos)) {
- foreach($entry->photos as $photo) {
+ foreach ($entry->photos as $photo) {
if ($photo->type == 'profile') {
$profile_photo = $photo->value;
continue;
}
}
- if(isset($entry->updated))
+ if (isset($entry->updated)) {
$updated = date("Y-m-d H:i:s", strtotime($entry->updated));
+ }
- if(isset($entry->network))
+ if (isset($entry->network)) {
$network = $entry->network;
+ }
- if(isset($entry->currentLocation))
+ if (isset($entry->currentLocation)) {
$location = $entry->currentLocation;
+ }
- if(isset($entry->aboutMe))
+ if (isset($entry->aboutMe)) {
$about = html2bbcode($entry->aboutMe);
+ }
- if(isset($entry->gender))
+ if (isset($entry->gender)) {
$gender = $entry->gender;
+ }
- if(isset($entry->generation) AND ($entry->generation > 0))
+ if (isset($entry->generation) AND ($entry->generation > 0)) {
$generation = ++$entry->generation;
+ }
- if(isset($entry->tags))
- foreach($entry->tags as $tag)
+ if (isset($entry->tags)) {
+ foreach($entry->tags as $tag) {
$keywords = implode(", ", $tag);
+ }
+ }
- if(isset($entry->contactType) AND ($entry->contactType >= 0))
+ if (isset($entry->contactType) AND ($entry->contactType >= 0))
$contact_type = $entry->contactType;
// If you query a Friendica server for its profiles, the network has to be Friendica
function poco_check($profile_url, $name, $network, $profile_photo, $about, $location, $gender, $keywords, $connect_url, $updated, $generation, $cid = 0, $uid = 0, $zcid = 0) {
- $a = get_app();
-
// Generation:
// 0: No definition
// 1: Profiles on this server
$done[] = App::get_baseurl() . '/poco';
- if(strlen(get_config('system','directory'))) {
+ if (strlen(get_config('system','directory'))) {
$x = fetch_url(get_server()."/pubsites");
if ($x) {
$j = json_decode($x);
if ($j->entries) {
- foreach($j->entries as $entry) {
+ foreach ($j->entries as $entry) {
poco_check_server($entry->url);
);
if (dbm::is_result($r)) {
- foreach($r as $rr) {
+ foreach ($r as $rr) {
$base = substr($rr['poco'],0,strrpos($rr['poco'],'/'));
if(! in_array($base,$done))
poco_load(0,0,0,$base);
function poco_discover_federation() {
$last = get_config('poco','last_federation_discovery');
- if($last) {
+ if ($last) {
$next = $last + (24 * 60 * 60);
if($next > time())
return;
$name = $entry->displayName;
- if(isset($entry->urls)) {
+ if (isset($entry->urls)) {
foreach($entry->urls as $url) {
if ($url->type == 'profile') {
$profile_url = $url->value;
}
}
- if(isset($entry->photos)) {
- foreach($entry->photos as $photo) {
- if($photo->type == 'profile') {
+ if (isset($entry->photos)) {
+ foreach ($entry->photos as $photo) {
+ if ($photo->type == 'profile') {
$profile_photo = $photo->value;
continue;
}
}
}
- if(isset($entry->updated))
+ if (isset($entry->updated)) {
$updated = date("Y-m-d H:i:s", strtotime($entry->updated));
+ }
- if(isset($entry->network))
+ if(isset($entry->network)) {
$network = $entry->network;
+ }
- if(isset($entry->currentLocation))
+ if(isset($entry->currentLocation)) {
$location = $entry->currentLocation;
+ }
- if(isset($entry->aboutMe))
+ if(isset($entry->aboutMe)) {
$about = html2bbcode($entry->aboutMe);
+ }
- if(isset($entry->gender))
+ if(isset($entry->gender)) {
$gender = $entry->gender;
+ }
- if(isset($entry->generation) AND ($entry->generation > 0))
+ if(isset($entry->generation) AND ($entry->generation > 0)) {
$generation = ++$entry->generation;
+ }
- if(isset($entry->contactType) AND ($entry->contactType >= 0))
+ if(isset($entry->contactType) AND ($entry->contactType >= 0)) {
$contact_type = $entry->contactType;
+ }
- if(isset($entry->tags))
- foreach($entry->tags as $tag)
+ if(isset($entry->tags)) {
+ foreach ($entry->tags as $tag) {
$keywords = implode(", ", $tag);
+ }
+ }
if ($generation > 0) {
$success = true;
// header('Link: <' . App::get_baseurl() . '/amcd>; rel="acct-mgmt";');
-if(x($_COOKIE["Friendica"]) || (x($_SESSION,'authenticated')) || (x($_POST,'auth-params')) || ($a->module === 'login'))
+if (x($_COOKIE["Friendica"]) || (x($_SESSION,'authenticated')) || (x($_POST,'auth-params')) || ($a->module === 'login')) {
require("include/auth.php");
+}
-if(! x($_SESSION,'authenticated'))
+if (! x($_SESSION,'authenticated')) {
header('X-Account-Management-Status: none');
+}
/* set up page['htmlhead'] and page['end'] for the modules to use */
$a->page['htmlhead'] = '';
$a->page['end'] = '';
-if(! x($_SESSION,'sysmsg'))
+if (! x($_SESSION,'sysmsg')) {
$_SESSION['sysmsg'] = array();
+}
-if(! x($_SESSION,'sysmsg_info'))
+if (! x($_SESSION,'sysmsg_info')) {
$_SESSION['sysmsg_info'] = array();
+}
/*
* check_config() is responsible for running update scripts. These automatically
// in install mode, any url loads install module
// but we need "view" module for stylesheet
-if($install && $a->module!="view")
+if ($install && $a->module!="view") {
$a->module = 'install';
-elseif($maintenance && $a->module!="view")
+} elseif ($maintenance && $a->module!="view") {
$a->module = 'maintenance';
-else {
+} else {
check_url($a);
check_db();
check_plugins($a);
//Don't populate apps_menu if apps are private
$privateapps = get_config('config','private_addons');
-if((local_user()) || (! $privateapps === "1"))
-{
+if ((local_user()) || (! $privateapps === "1")) {
$arr = array('app_menu' => $a->apps);
call_hooks('app_menu', $arr);
$privateapps = get_config('config','private_addons');
- if(is_array($a->plugins) && in_array($a->module,$a->plugins) && file_exists("addon/{$a->module}/{$a->module}.php")) {
+ if (is_array($a->plugins) && in_array($a->module,$a->plugins) && file_exists("addon/{$a->module}/{$a->module}.php")) {
//Check if module is an app and if public access to apps is allowed or not
- if((!local_user()) && plugin_is_app($a->module) && $privateapps === "1") {
+ if ((!local_user()) && plugin_is_app($a->module) && $privateapps === "1") {
info( t("You must be logged in to use addons. "));
}
else {
* If not, next look for a 'standard' program module in the 'mod' directory
*/
- if((! $a->module_loaded) && (file_exists("mod/{$a->module}.php"))) {
+ if ((! $a->module_loaded) && (file_exists("mod/{$a->module}.php"))) {
include_once("mod/{$a->module}.php");
$a->module_loaded = true;
}
*
*/
- if(! $a->module_loaded) {
+ if (! $a->module_loaded) {
// Stupid browser tried to pre-fetch our Javascript img template. Don't log the event or return anything - just quietly exit.
- if((x($_SERVER,'QUERY_STRING')) && preg_match('/{[0-9]}/',$_SERVER['QUERY_STRING']) !== 0) {
+ if ((x($_SERVER,'QUERY_STRING')) && preg_match('/{[0-9]}/',$_SERVER['QUERY_STRING']) !== 0) {
killme();
}
- if((x($_SERVER,'QUERY_STRING')) && ($_SERVER['QUERY_STRING'] === 'q=internal_error.html') && isset($dreamhost_error_hack)) {
+ if ((x($_SERVER,'QUERY_STRING')) && ($_SERVER['QUERY_STRING'] === 'q=internal_error.html') && isset($dreamhost_error_hack)) {
logger('index.php: dreamhost_error_hack invoked. Original URI =' . $_SERVER['REQUEST_URI']);
goaway(App::get_baseurl() . $_SERVER['REQUEST_URI']);
}
/* initialise content region */
-if(! x($a->page,'content'))
+if (! x($a->page,'content')) {
$a->page['content'] = '';
+}
-if(!$install && !$maintenance)
+if (!$install && !$maintenance) {
call_hooks('page_content_top',$a->page['content']);
+}
/**
* Call module functions
$failed[] = $upd;
}
}
- if(! count($failed)) {
+ if (! count($failed)) {
$o = replace_macros(get_markup_template('structure_check.tpl'),array(
- '$base' => App::get_baseurl(true),
+ '$base' => App::get_baseurl(true),
'$banner' => t('No failed updates.'),
- '$check' => t('Check database structure'),
+ '$check' => t('Check database structure'),
));
} else {
$o = replace_macros(get_markup_template('failed_updates.tpl'),array(
- '$base' => App::get_baseurl(true),
+ '$base' => App::get_baseurl(true),
'$banner' => t('Failed Updates'),
- '$desc' => t('This does not include updates prior to 1139, which did not return a status.'),
- '$mark' => t('Mark success (if update was manually applied)'),
- '$apply' => t('Attempt to execute this update step automatically'),
+ '$desc' => t('This does not include updates prior to 1139, which did not return a status.'),
+ '$mark' => t('Mark success (if update was manually applied)'),
+ '$apply' => t('Attempt to execute this update step automatically'),
'$failed' => $failed
));
}
* @param App $a
*/
function admin_page_users_post(&$a){
- $pending = (x($_POST, 'pending') ? $_POST['pending'] : array());
- $users = (x($_POST, 'user') ? $_POST['user'] : array());
- $nu_name = (x($_POST, 'new_user_name') ? $_POST['new_user_name'] : '');
- $nu_nickname = (x($_POST, 'new_user_nickname') ? $_POST['new_user_nickname'] : '');
- $nu_email = (x($_POST, 'new_user_email') ? $_POST['new_user_email'] : '');
+ $pending = (x($_POST, 'pending') ? $_POST['pending'] : array());
+ $users = (x($_POST, 'user') ? $_POST['user'] : array());
+ $nu_name = (x($_POST, 'new_user_name') ? $_POST['new_user_name'] : '');
+ $nu_nickname = (x($_POST, 'new_user_nickname') ? $_POST['new_user_nickname'] : '');
+ $nu_email = (x($_POST, 'new_user_email') ? $_POST['new_user_email'] : '');
$nu_language = get_config('system', 'language');
check_form_security_token_redirectOnErr('/admin/users', 'admin_users');
* List plugins
*/
- if(x($_GET,"a") && $_GET['a']=="r") {
+ if (x($_GET,"a") && $_GET['a']=="r") {
check_form_security_token_redirectOnErr(App::get_baseurl().'/admin/plugins', 'admin_themes', 't');
reload_plugins();
info("Plugins reloaded");
$plugins = array();
$files = glob("addon/*/");
- if($files) {
- foreach($files as $file) {
- if(is_dir($file)) {
+ if ($files) {
+ foreach ($files as $file) {
+ if (is_dir($file)) {
list($tmp, $id)=array_map("trim", explode("/",$file));
$info = get_plugin_info($id);
$show_plugin = true;
// If the addon is unsupported, then only show it, when it is enabled
- if((strtolower($info["status"]) == "unsupported") AND !in_array($id, $a->plugins))
+ if ((strtolower($info["status"]) == "unsupported") AND !in_array($id, $a->plugins)) {
$show_plugin = false;
+ }
// Override the above szenario, when the admin really wants to see outdated stuff
- if(get_config("system", "show_unsupported_addons"))
+ if (get_config("system", "show_unsupported_addons")) {
$show_plugin = true;
+ }
- if($show_plugin)
+ if ($show_plugin) {
$plugins[] = array($id, (in_array($id, $a->plugins)?"on":"off") , $info);
+ }
}
}
}
// reload active themes
- if(x($_GET,"a") && $_GET['a']=="r") {
+ if (x($_GET,"a") && $_GET['a']=="r") {
check_form_security_token_redirectOnErr(App::get_baseurl().'/admin/themes', 'admin_themes', 't');
- if($themes) {
- foreach($themes as $th) {
- if($th['allowed']) {
+ if ($themes) {
+ foreach ($themes as $th) {
+ if ($th['allowed']) {
uninstall_theme($th['name']);
install_theme($th['name']);
}
*/
$xthemes = array();
- if($themes) {
+ if ($themes) {
foreach($themes as $th) {
$xthemes[] = array($th['name'],(($th['allowed']) ? "on" : "off"), get_theme_info($th['name']));
}
$t = get_markup_template("admin_plugins.tpl");
return replace_macros($t, array(
- '$title' => t('Administration'),
- '$page' => t('Themes'),
- '$submit' => t('Save Settings'),
- '$reload' => t('Reload active themes'),
- '$baseurl' => App::get_baseurl(true),
- '$function' => 'themes',
- '$plugins' => $xthemes,
- '$pcount' => count($themes),
- '$noplugshint' => sprintf(t('No themes found on the system. They should be paced in %1$s'),'<code>/view/themes</code>'),
- '$experimental' => t('[Experimental]'),
- '$unsupported' => t('[Unsupported]'),
+ '$title' => t('Administration'),
+ '$page' => t('Themes'),
+ '$submit' => t('Save Settings'),
+ '$reload' => t('Reload active themes'),
+ '$baseurl' => App::get_baseurl(true),
+ '$function' => 'themes',
+ '$plugins' => $xthemes,
+ '$pcount' => count($themes),
+ '$noplugshint' => sprintf(t('No themes found on the system. They should be paced in %1$s'),'<code>/view/themes</code>'),
+ '$experimental' => t('[Experimental]'),
+ '$unsupported' => t('[Unsupported]'),
'$form_security_token' => get_form_security_token("admin_themes"),
));
}
);
if (! count($c)) {
- }
return;
+ }
$a->page['aside'] = "";
profile_load($a, "", 0, get_contact_details_by_url($c[0]["url"]));
$r = sort_by_date($r);
foreach($r as $rr) {
$j = (($rr['adjust']) ? datetime_convert('UTC',date_default_timezone_get(),$rr['start'], 'j') : datetime_convert('UTC','UTC',$rr['start'],'j'));
- if(! x($links,$j)) {
+ if (! x($links,$j)) {
$links[$j] = App::get_baseurl() . '/' . $a->cmd . '#link-' . $j;
}
}
return;
}
- if($a->argc > 2 && $a->argv[1] === 'add' && intval($a->argv[2])) {
+ if ($a->argc > 2 && $a->argv[1] === 'add' && intval($a->argv[2])) {
// delegated admins can view but not change delegation permissions
goaway(App::get_baseurl() . '/delegate');
}
- if($a->argc > 2 && $a->argv[1] === 'remove' && intval($a->argv[2])) {
+ if ($a->argc > 2 && $a->argv[1] === 'remove' && intval($a->argv[2])) {
// delegated admins can view but not change delegation permissions
// Let's send our user to the contact editor in case they want to
// do anything special with this new friend.
- if($handsfree === null)
+ if ($handsfree === null) {
goaway(App::get_baseurl() . '/contacts/' . intval($contact_id));
- else
+ } else {
return;
+ }
//NOTREACHED
}
*
*/
- if(x($_POST,'source_url')) {
+ if (x($_POST,'source_url')) {
// We are processing an external confirmation to an introduction created by our user.
// If $aes_key is set, both of these items require unpacking from the hex transport encoding.
- if(x($aes_key)) {
+ if (x($aes_key)) {
$aes_key = hex2bin($aes_key);
$public_key = hex2bin($public_key);
}
$parms = Probe::profile($dfrn_url);
- if(! count($parms)) {
+ if (! count($parms)) {
notice( t('Profile location is not valid or does not contain profile information.') . EOL );
return;
}
else {
- if(! x($parms,'fn'))
+ if (! x($parms,'fn')) {
notice( t('Warning: profile location has no identifiable owner name.') . EOL );
- if(! x($parms,'photo'))
+ }
+ if (! x($parms,'photo')) {
notice( t('Warning: profile location has no profile photo.') . EOL );
+ }
$invalid = Probe::valid_dfrn($parms);
- if($invalid) {
+ if ($invalid) {
notice( sprintf( tt("%d required parameter was not found at the given location",
"%d required parameters were not found at the given location",
$invalid), $invalid) . EOL );
);
}
else {
- if(! validate_url($url)) {
+ if (! validate_url($url)) {
notice( t('Invalid profile URL.') . EOL);
goaway(App::get_baseurl() . '/' . $a->cmd);
return; // NOTREACHED
}
- if(! allowed_url($url)) {
+ if (! allowed_url($url)) {
notice( t('Disallowed profile URL.') . EOL);
goaway(App::get_baseurl() . '/' . $a->cmd);
return; // NOTREACHED
$parms = Probe::profile(($hcard) ? $hcard : $url);
- if(! count($parms)) {
+ if (! count($parms)) {
notice( t('Profile location is not valid or does not contain profile information.') . EOL );
goaway(App::get_baseurl() . '/' . $a->cmd);
}
else {
- if(! x($parms,'fn'))
+ if (! x($parms,'fn')) {
notice( t('Warning: profile location has no identifiable owner name.') . EOL );
- if(! x($parms,'photo'))
+ }
+ if (! x($parms,'photo')) {
notice( t('Warning: profile location has no profile photo.') . EOL );
+ }
$invalid = Probe::valid_dfrn($parms);
- if($invalid) {
+ if ($invalid) {
notice( sprintf( tt("%d required parameter was not found at the given location",
"%d required parameters were not found at the given location",
$invalid), $invalid) . EOL );
$myaddr = hex2bin($_GET['addr']);
elseif (x($_GET,'address') AND ($_GET['address'] != ""))
$myaddr = $_GET['address'];
- elseif(local_user()) {
- if(strlen($a->path)) {
+ elseif (local_user()) {
+ if (strlen($a->path)) {
$myaddr = App::get_baseurl() . '/profile/' . $a->user['nickname'];
}
else {
$myaddr = $a->user['nickname'] . '@' . substr(z_root(), strpos(z_root(),'://') + 3 );
}
- } else // last, try a zrl
+ }
+ else {
+ // last, try a zrl
$myaddr = get_my_url();
+ }
$target_addr = $a->profile['nickname'] . '@' . substr(z_root(), strpos(z_root(),'://') + 3 );
*
*/
- if($a->profile['page-flags'] == PAGE_NORMAL)
+ if ($a->profile['page-flags'] == PAGE_NORMAL) {
$tpl = get_markup_template('dfrn_request.tpl');
- else
+ }
+ else {
$tpl = get_markup_template('auto_request.tpl');
+ }
$page_desc = t("Please enter your 'Identity Address' from one of the following supported communications networks:");
return;
}
- if(! x($a->page,'aside'))
+ if (! x($a->page,'aside')) {
$a->page['aside'] = '';
+ }
$a->page['aside'] .= findpeople_widget();
$search = $prefix.notags(trim($_REQUEST['search']));
- if(strpos($search,'@') === 0) {
+ if (strpos($search,'@') === 0) {
$search = substr($search,1);
$header = sprintf( t('People Search - %s'), $search);
if ((valid_email($search) AND validate_email($search)) OR
}
}
- if(strpos($search,'!') === 0) {
+ if (strpos($search,'!') === 0) {
$search = substr($search,1);
$community = true;
$header = sprintf( t('Forum Search - %s'), $search);
$o = '';
- if($search) {
+ if ($search) {
if ($discover_user) {
$j = new stdClass();
$perpage = 80;
$startrec = (($a->pager['page']) * $perpage) - $perpage;
- if (get_config('system','diaspora_enabled'))
+ if (get_config('system','diaspora_enabled')) {
$diaspora = NETWORK_DIASPORA;
- else
+ }
+ else {
$diaspora = NETWORK_DFRN;
+ }
- if (!get_config('system','ostatus_disabled'))
+ if (!get_config('system','ostatus_disabled')) {
$ostatus = NETWORK_OSTATUS;
- else
+ }
+ else {
$ostatus = NETWORK_DFRN;
+ }
$search2 = "%".$search."%";
$j->items_page = $perpage;
$j->page = $a->pager['page'];
foreach ($results AS $result) {
- if (poco_alternate_ostatus_url($result["url"]))
- continue;
+ if (poco_alternate_ostatus_url($result["url"])) {
+ continue;
+ }
$result = get_contact_details_by_url($result["url"], local_user(), $result);
$j = json_decode($x);
}
- if($j->total) {
+ if ($j->total) {
$a->set_pager_total($j->total);
$a->set_pager_itemspage($j->items_page);
}
- if(count($j->results)) {
+ if (count($j->results)) {
$id = 0;
- foreach($j->results as $jj) {
+ foreach ($j->results as $jj) {
$alt_text = "";
$photo_menu = contact_photo_menu($contact[0]);
$details = _contact_detail_for_template($contact[0]);
$alt_text = $details['alt_text'];
- } else
+ }
+ else {
$photo_menu = array();
+ }
} else {
$connlnk = App::get_baseurl().'/follow/?url='.(($jj->connect) ? $jj->connect : $jj->url);
$conntxt = t('Connect');
$ignored = ((x($_REQUEST,'ignored')) ? intval($_REQUEST['ignored']) : 0);
if($a->argc > 1) {
- if($a->argc > 2 && $a->argv[1] == 'event') {
+ if ($a->argc > 2 && $a->argv[1] == 'event') {
$mode = 'edit';
$event_id = intval($a->argv[2]);
}
- if($a->argv[1] === 'new') {
+ if ($a->argv[1] === 'new') {
$mode = 'new';
$event_id = 0;
}
- if($a->argc > 2 && intval($a->argv[1]) && intval($a->argv[2])) {
+ if ($a->argc > 2 && intval($a->argv[1]) && intval($a->argv[2])) {
$mode = 'view';
$y = intval($a->argv[1]);
$m = intval($a->argv[2]);
}
// The view mode part is similiar to /mod/cal.php
- if($mode == 'view') {
+ if ($mode == 'view') {
$thisyear = datetime_convert('UTC',date_default_timezone_get(),'now','Y');
$thismonth = datetime_convert('UTC',date_default_timezone_get(),'now','m');
- if(! $y)
+ if (! $y) {
$y = intval($thisyear);
- if(! $m)
+ }
+ if (! $m) {
$m = intval($thismonth);
+ }
// Put some limits on dates. The PHP date functions don't seem to do so well before 1900.
// An upper limit was chosen to keep search engines from exploring links millions of years in the future.
- if($y < 1901)
+ if ($y < 1901) {
$y = 1900;
- if($y > 2099)
+ }
+ if ($y > 2099) {
$y = 2100;
+ }
$nextyear = $y;
$nextmonth = $m + 1;
$r = sort_by_date($r);
foreach($r as $rr) {
$j = (($rr['adjust']) ? datetime_convert('UTC',date_default_timezone_get(),$rr['start'], 'j') : datetime_convert('UTC','UTC',$rr['start'],'j'));
- if(! x($links,$j)) {
+ if (! x($links,$j)) {
$links[$j] = App::get_baseurl() . '/' . $a->cmd . '#link-' . $j;
}
}
));
}
- if(strlen(get_config('system','directory'))) {
+ if (strlen(get_config('system','directory'))) {
$profile_in_net_dir = replace_macros($opt_tpl,array(
'$field' => array('profile_in_netdirectory', t('Publish your default profile in the global social directory?'), $profile['net-publish'], '', array(t('No'),t('Yes'))),
));
}
- else
+ else {
$profile_in_net_dir = '';
+ }
$hide_friends = replace_macros($opt_tpl,array(