more lint
This commit is contained in:
parent
ceabd7629b
commit
f0b6400584
20 changed files with 114 additions and 130 deletions
28
boot.php
28
boot.php
|
@ -608,8 +608,7 @@ function goaway($s) {
|
||||||
if(! function_exists('xml_status')) {
|
if(! function_exists('xml_status')) {
|
||||||
function xml_status($st, $message = '') {
|
function xml_status($st, $message = '') {
|
||||||
|
|
||||||
if(strlen($message))
|
$xml_message = ((strlen($message)) ? "\t<message>" . xmlify($message) . "</message>\r\n" : '');
|
||||||
$xml_message = "\t<message>" . xmlify($message) . "</message>\r\n";
|
|
||||||
|
|
||||||
header( "Content-type: text/xml" );
|
header( "Content-type: text/xml" );
|
||||||
echo '<?xml version="1.0" encoding="UTF-8"?>'."\r\n";
|
echo '<?xml version="1.0" encoding="UTF-8"?>'."\r\n";
|
||||||
|
@ -1334,3 +1333,28 @@ function qp($s) {
|
||||||
return str_replace ("%","=",rawurlencode($s));
|
return str_replace ("%","=",rawurlencode($s));
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
|
||||||
|
if(! function_exists('like_puller')) {
|
||||||
|
function like_puller($a,$item,&$arr,$mode) {
|
||||||
|
|
||||||
|
$url = '';
|
||||||
|
$sparkle = '';
|
||||||
|
$verb = (($mode === 'like') ? ACTIVITY_LIKE : ACTIVITY_DISLIKE);
|
||||||
|
|
||||||
|
if((activity_match($item['verb'],$verb)) && ($item['id'] != $item['parent'])) {
|
||||||
|
$url = $item['url'];
|
||||||
|
if(($item['network'] === 'dfrn') && (! $item['self'])) {
|
||||||
|
$url = $a->get_baseurl() . '/redir/' . $item['contact-id'];
|
||||||
|
$sparkle = ' class="sparkle" ';
|
||||||
|
}
|
||||||
|
if(! ((isset($arr[$item['parent'] . '-l'])) && (is_array($arr[$item['parent'] . '-l']))))
|
||||||
|
$arr[$item['parent'] . '-l'] = array();
|
||||||
|
if(! isset($arr[$item['parent']]))
|
||||||
|
$arr[$item['parent']] = 1;
|
||||||
|
else
|
||||||
|
$arr[$item['parent']] ++;
|
||||||
|
$arr[$item['parent'] . '-l'][] = '<a href="'. $url . '"'. $sparkle .'>' . $item['name'] . '</a>';
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}}
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
// login/logout
|
// login/logout
|
||||||
|
|
||||||
if((isset($_SESSION)) && (x($_SESSION,'authenticated')) && (! ($_POST['auth-params'] === 'login'))) {
|
if((isset($_SESSION)) && (x($_SESSION,'authenticated')) && ((! (x($_POST,'auth-params'))) || ($_POST['auth-params'] !== 'login'))) {
|
||||||
|
|
||||||
if($_POST['auth-params'] === 'logout' || $a->module === 'logout') {
|
if(((x($_POST,'auth-params')) && ($_POST['auth-params'] === 'logout')) || ($a->module === 'logout')) {
|
||||||
|
|
||||||
// process logout request
|
// process logout request
|
||||||
|
|
||||||
|
|
|
@ -122,8 +122,10 @@ function group_get_members($gid) {
|
||||||
|
|
||||||
function group_side($every="contacts",$each="group") {
|
function group_side($every="contacts",$each="group") {
|
||||||
|
|
||||||
|
$o = '';
|
||||||
|
|
||||||
if(! local_user())
|
if(! local_user())
|
||||||
return;
|
return '';
|
||||||
|
|
||||||
$createtext = t('Create a new group');
|
$createtext = t('Create a new group');
|
||||||
$linktext= t('Everybody');
|
$linktext= t('Everybody');
|
||||||
|
|
|
@ -146,7 +146,7 @@ function get_feed_for(&$a, $dfrn_id, $owner_id, $last_update, $direction = 0) {
|
||||||
$atom .= replace_macros($feed_template, array(
|
$atom .= replace_macros($feed_template, array(
|
||||||
'$feed_id' => xmlify($a->get_baseurl() . '/profile/' . $owner_nick),
|
'$feed_id' => xmlify($a->get_baseurl() . '/profile/' . $owner_nick),
|
||||||
'$feed_title' => xmlify($owner['name']),
|
'$feed_title' => xmlify($owner['name']),
|
||||||
'$feed_updated' => xmlify(datetime_convert('UTC', 'UTC', $updated . '+00:00' , ATOM_TIME)) ,
|
'$feed_updated' => xmlify(datetime_convert('UTC', 'UTC', 'now' , ATOM_TIME)) ,
|
||||||
'$hub' => $hubxml,
|
'$hub' => $hubxml,
|
||||||
'$salmon' => $salmon,
|
'$salmon' => $salmon,
|
||||||
'$name' => xmlify($owner['name']),
|
'$name' => xmlify($owner['name']),
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
if(! x($a->page,'nav'))
|
||||||
|
$a->page['nav'] = '';
|
||||||
|
|
||||||
$a->page['nav'] .= '<div id="panel" style="display: none;"></div>' ;
|
$a->page['nav'] .= '<div id="panel" style="display: none;"></div>' ;
|
||||||
|
|
||||||
if(local_user()) {
|
if(local_user()) {
|
||||||
|
|
|
@ -31,9 +31,12 @@ $a->init_pagehead();
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
|
|
||||||
if((x($_SESSION,'authenticated')) || (x($_POST['auth-params'])))
|
if((x($_SESSION,'authenticated')) || (x($_POST,'auth-params')))
|
||||||
require("auth.php");
|
require("auth.php");
|
||||||
|
|
||||||
|
if(! x($_SESSION,'sysmsg'))
|
||||||
|
$_SESSION['sysmsg'] = '';
|
||||||
|
|
||||||
if($install)
|
if($install)
|
||||||
$a->module = 'install';
|
$a->module = 'install';
|
||||||
else
|
else
|
||||||
|
@ -71,6 +74,8 @@ if($a->module_loaded) {
|
||||||
|
|
||||||
if((! $a->error) && (function_exists($a->module . '_content'))) {
|
if((! $a->error) && (function_exists($a->module . '_content'))) {
|
||||||
$func = $a->module . '_content';
|
$func = $a->module . '_content';
|
||||||
|
if(! x($a->page,'content'))
|
||||||
|
$a->page['content'] = '';
|
||||||
$a->page['content'] .= $func($a);
|
$a->page['content'] .= $func($a);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,8 @@ require_once('include/Contact.php');
|
||||||
|
|
||||||
function contacts_init(&$a) {
|
function contacts_init(&$a) {
|
||||||
require_once('include/group.php');
|
require_once('include/group.php');
|
||||||
|
if(! x($a->page,'aside'))
|
||||||
|
$a->page['aside'] = '';
|
||||||
$a->page['aside'] .= group_side();
|
$a->page['aside'] .= group_side();
|
||||||
|
|
||||||
if($a->config['register_policy'] != REGISTER_CLOSED)
|
if($a->config['register_policy'] != REGISTER_CLOSED)
|
||||||
|
@ -84,7 +86,11 @@ function contacts_post(&$a) {
|
||||||
|
|
||||||
function contacts_content(&$a) {
|
function contacts_content(&$a) {
|
||||||
|
|
||||||
|
$sort_type = 0;
|
||||||
|
$o = '';
|
||||||
$o .= '<script> $(document).ready(function() { $(\'#nav-contacts-link\').addClass(\'nav-selected\'); });</script>';
|
$o .= '<script> $(document).ready(function() { $(\'#nav-contacts-link\').addClass(\'nav-selected\'); });</script>';
|
||||||
|
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -6,16 +6,11 @@ require_once('include/auth.php');
|
||||||
|
|
||||||
function dfrn_poll_init(&$a) {
|
function dfrn_poll_init(&$a) {
|
||||||
|
|
||||||
$dfrn_id = '';
|
$dfrn_id = ((x($_GET,'dfrn_id')) ? $_GET['dfrn_id'] : '');
|
||||||
|
$type = ((x($_GET,'type')) ? $_GET['type'] : '');
|
||||||
if(x($_GET,'dfrn_id'))
|
$last_update = ((x($_GET,'last_update')) ? $_GET['last_update'] : '');
|
||||||
$dfrn_id = $_GET['dfrn_id'];
|
|
||||||
if(x($_GET,'type'))
|
|
||||||
$type = $_GET['type'];
|
|
||||||
if(x($_GET,'last_update'))
|
|
||||||
$last_update = $_GET['last_update'];
|
|
||||||
$dfrn_version = (float) $_GET['dfrn_version'] ;
|
|
||||||
$destination_url = ((x($_GET,'destination_url')) ? $_GET['destination_url'] : '');
|
$destination_url = ((x($_GET,'destination_url')) ? $_GET['destination_url'] : '');
|
||||||
|
$dfrn_version = ((x($_GET,'dfrn_version')) ? (float) $_GET['dfrn_version'] : 0);
|
||||||
|
|
||||||
|
|
||||||
$direction = (-1);
|
$direction = (-1);
|
||||||
|
@ -33,7 +28,7 @@ function dfrn_poll_init(&$a) {
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
if((x($type)) && ($type === 'profile')) {
|
if((isset($type)) && ($type === 'profile')) {
|
||||||
|
|
||||||
$sql_extra = '';
|
$sql_extra = '';
|
||||||
switch($direction) {
|
switch($direction) {
|
||||||
|
@ -89,7 +84,7 @@ function dfrn_poll_init(&$a) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if((x($type)) && ($type === 'profile-check')) {
|
if((isset($type)) && ($type === 'profile-check')) {
|
||||||
|
|
||||||
switch($direction) {
|
switch($direction) {
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -119,10 +114,10 @@ function dfrn_poll_init(&$a) {
|
||||||
|
|
||||||
function dfrn_poll_post(&$a) {
|
function dfrn_poll_post(&$a) {
|
||||||
|
|
||||||
$dfrn_id = $_POST['dfrn_id'];
|
$dfrn_id = ((x($_POST,'dfrn_id')) ? $_POST['dfrn_id'] : '');
|
||||||
$challenge = $_POST['challenge'];
|
$challenge = ((x($_POST,'challenge')) ? $_POST['challenge'] : '');
|
||||||
$url = $_POST['url'];
|
$url = ((x($_POST,'url')) ? $_POST['url'] : '');
|
||||||
$dfrn_version = (float) $_POST['dfrn_version'];
|
$dfrn_version = ((x($_POST,'dfrn_version')) ? (float) $_POST['dfrn_version'] : 0);
|
||||||
|
|
||||||
$direction = (-1);
|
$direction = (-1);
|
||||||
if(strpos($dfrn_id,':') == 1) {
|
if(strpos($dfrn_id,':') == 1) {
|
||||||
|
|
|
@ -4,11 +4,12 @@ function directory_init(&$a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function directory_content(&$a) {
|
function directory_content(&$a) {
|
||||||
|
$o = '';
|
||||||
$o .= '<script> $(document).ready(function() { $(\'#nav-directory-link\').addClass(\'nav-selected\'); });</script>';
|
$o .= '<script> $(document).ready(function() { $(\'#nav-directory-link\').addClass(\'nav-selected\'); });</script>';
|
||||||
|
|
||||||
$search = ((x($_GET,'search')) ? notags(trim($_GET['search'])) : '');
|
$search = ((x($_GET,'search')) ? notags(trim($_GET['search'])) : '');
|
||||||
|
|
||||||
$tpl .= load_view_file('view/directory_header.tpl');
|
$tpl = load_view_file('view/directory_header.tpl');
|
||||||
|
|
||||||
$globaldir = '';
|
$globaldir = '';
|
||||||
$gdirpath = dirname(get_config('system','directory_submit_url'));
|
$gdirpath = dirname(get_config('system','directory_submit_url'));
|
||||||
|
|
|
@ -113,32 +113,9 @@ function display_content(&$a) {
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
|
|
||||||
foreach($r as $item) {
|
foreach($r as $item) {
|
||||||
$sparkle = '';
|
like_puller($a,$item,$alike,'like');
|
||||||
if(($item['verb'] == ACTIVITY_LIKE) && ($item['id'] != $item['parent'])) {
|
like_puller($a,$item,$dlike,'dislike');
|
||||||
$url = $item['url'];
|
|
||||||
if(($item['network'] === 'dfrn') && (! $item['self'])) {
|
|
||||||
$url = $a->get_baseurl() . '/redir/' . $item['contact-id'];
|
|
||||||
$sparkle = ' class="sparkle"';
|
|
||||||
}
|
}
|
||||||
if(! is_array($alike[$item['parent'] . '-l']))
|
|
||||||
$alike[$item['parent'] . '-l'] = array();
|
|
||||||
$alike[$item['parent']] ++;
|
|
||||||
$alike[$item['parent'] . '-l'][] = '<a href="'. $url . '"' . $sparkle . '>' . $item['name'] . '</a>';
|
|
||||||
}
|
|
||||||
if(($item['verb'] == ACTIVITY_DISLIKE) && ($item['id'] != $item['parent'])) {
|
|
||||||
$url = $item['url'];
|
|
||||||
if(($item['network'] === 'dfrn') && (! $item['self'])) {
|
|
||||||
$url = $a->get_baseurl() . '/redir/' . $item['contact-id'];
|
|
||||||
$sparkle = ' class="sparkle"';
|
|
||||||
}
|
|
||||||
if(! is_array($dlike[$item['parent'] . '-l']))
|
|
||||||
$dlike[$item['parent'] . '-l'] = array();
|
|
||||||
$dlike[$item['parent']] ++;
|
|
||||||
$dlike[$item['parent'] . '-l'][] = '<a href="'. $url . '"' . $sparkle . '>' . $item['name'] . '</a>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
foreach($r as $item) {
|
foreach($r as $item) {
|
||||||
$comment = '';
|
$comment = '';
|
||||||
|
@ -146,7 +123,8 @@ function display_content(&$a) {
|
||||||
|
|
||||||
$redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
|
$redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
|
||||||
|
|
||||||
if((($item['verb'] == ACTIVITY_LIKE) || ($item['verb'] == ACTIVITY_DISLIKE)) && ($item['id'] != $item['parent']))
|
if(((activity_match($item['verb'],ACTIVITY_LIKE)) || (activity_match($item['verb'],ACTIVITY_DISLIKE)))
|
||||||
|
&& ($item['id'] != $item['parent']))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
$lock = (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
|
$lock = (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
|
||||||
|
|
|
@ -13,6 +13,9 @@ function home_init(&$a) {
|
||||||
if(! function_exists('home_content')) {
|
if(! function_exists('home_content')) {
|
||||||
function home_content(&$a) {
|
function home_content(&$a) {
|
||||||
|
|
||||||
|
$o = '';
|
||||||
|
if(! (x($a->page,'footer')))
|
||||||
|
$a->page['footer'] = '';
|
||||||
$a->page['footer'] .= "<div class=\"powered\" >Powered by <a href=\"http://mistpark.com\" name=\"mistpark\" >mistpark</a></div>";
|
$a->page['footer'] .= "<div class=\"powered\" >Powered by <a href=\"http://mistpark.com\" name=\"mistpark\" >mistpark</a></div>";
|
||||||
$o .= '<h1>Welcome' . ((x($a->config,'sitename')) ? " to {$a->config['sitename']}" : "" ) . '</h1>';
|
$o .= '<h1>Welcome' . ((x($a->config,'sitename')) ? " to {$a->config['sitename']}" : "" ) . '</h1>';
|
||||||
if(file_exists('home.html'))
|
if(file_exists('home.html'))
|
||||||
|
|
|
@ -86,6 +86,8 @@ function message_post(&$a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function message_content(&$a) {
|
function message_content(&$a) {
|
||||||
|
|
||||||
|
$o = '';
|
||||||
$o .= '<script> $(document).ready(function() { $(\'#nav-messages-link\').addClass(\'nav-selected\'); });</script>';
|
$o .= '<script> $(document).ready(function() { $(\'#nav-messages-link\').addClass(\'nav-selected\'); });</script>';
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
|
@ -156,7 +158,7 @@ function message_content(&$a) {
|
||||||
|
|
||||||
$a->page['htmlhead'] .= replace_macros($tpl, array('$baseurl' => $a->get_baseurl()));
|
$a->page['htmlhead'] .= replace_macros($tpl, array('$baseurl' => $a->get_baseurl()));
|
||||||
|
|
||||||
$select .= contact_select('messageto','message-to-select', false, 4, true);
|
$select = contact_select('messageto','message-to-select', false, 4, true);
|
||||||
$tpl = load_view_file('view/prv_message.tpl');
|
$tpl = load_view_file('view/prv_message.tpl');
|
||||||
$o .= replace_macros($tpl,array(
|
$o .= replace_macros($tpl,array(
|
||||||
'$header' => t('Send Private Message'),
|
'$header' => t('Send Private Message'),
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
|
|
||||||
function network_init(&$a) {
|
function network_init(&$a) {
|
||||||
require_once('include/group.php');
|
require_once('include/group.php');
|
||||||
|
if(! x($a->page,'aside'))
|
||||||
|
$a->page['aside'] = '';
|
||||||
$a->page['aside'] .= group_side('network','network');
|
$a->page['aside'] .= group_side('network','network');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,7 +12,9 @@ function network_init(&$a) {
|
||||||
function network_content(&$a, $update = 0) {
|
function network_content(&$a, $update = 0) {
|
||||||
|
|
||||||
if(! local_user())
|
if(! local_user())
|
||||||
return;
|
return '';
|
||||||
|
|
||||||
|
$o = '';
|
||||||
|
|
||||||
require_once("include/bbcode.php");
|
require_once("include/bbcode.php");
|
||||||
|
|
||||||
|
@ -140,32 +144,10 @@ function network_content(&$a, $update = 0) {
|
||||||
$dlike = array();
|
$dlike = array();
|
||||||
|
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
|
|
||||||
foreach($r as $item) {
|
foreach($r as $item) {
|
||||||
|
like_puller($a,$item,$alike,'like');
|
||||||
$sparkle = '';
|
like_puller($a,$item,$dlike,'dislike');
|
||||||
|
|
||||||
if(($item['verb'] == ACTIVITY_LIKE) && ($item['id'] != $item['parent'])) {
|
|
||||||
$url = $item['url'];
|
|
||||||
if(($item['network'] === 'dfrn') && (! $item['self'])) {
|
|
||||||
$url = $a->get_baseurl() . '/redir/' . $item['contact-id'];
|
|
||||||
$sparkle = ' class="sparkle"';
|
|
||||||
}
|
|
||||||
if(! is_array($alike[$item['parent'] . '-l']))
|
|
||||||
$alike[$item['parent'] . '-l'] = array();
|
|
||||||
$alike[$item['parent']] ++;
|
|
||||||
$alike[$item['parent'] . '-l'][] = '<a href="'. $url . '"' . $sparkle . '>' . $item['name'] . '</a>';
|
|
||||||
}
|
|
||||||
if(($item['verb'] == ACTIVITY_DISLIKE) && ($item['id'] != $item['parent'])) {
|
|
||||||
$url = $item['url'];
|
|
||||||
if(($item['network'] === 'dfrn') && (! $item['self'])) {
|
|
||||||
$url = $a->get_baseurl() . '/redir/' . $item['contact-id'];
|
|
||||||
$sparkle = ' class="sparkle"';
|
|
||||||
}
|
|
||||||
if(! is_array($dlike[$item['parent'] . '-l']))
|
|
||||||
$dlike[$item['parent'] . '-l'] = array();
|
|
||||||
$dlike[$item['parent']] ++;
|
|
||||||
$dlike[$item['parent'] . '-l'][] = '<a href="'. $url . '"' . $sparkle . '>' . $item['name'] . '</a>';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($r as $item) {
|
foreach($r as $item) {
|
||||||
|
@ -177,7 +159,7 @@ function network_content(&$a, $update = 0) {
|
||||||
$profile_url = $item['url'];
|
$profile_url = $item['url'];
|
||||||
$redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
|
$redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
|
||||||
|
|
||||||
if((($item['verb'] == ACTIVITY_LIKE) || ($item['verb'] == ACTIVITY_DISLIKE)) && ($item['id'] != $item['parent']))
|
if(((activity_match($item['verb'],ACTIVITY_LIKE)) || (activity_match($item['verb'],ACTIVITY_DISLIKE))) && ($item['id'] != $item['parent']))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
$lock = (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
|
$lock = (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
|
||||||
|
@ -274,8 +256,8 @@ function network_content(&$a, $update = 0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$like = (($alike[$item['id']]) ? format_like($alike[$item['id']],$alike[$item['id'] . '-l'],'like',$item['id']) : '');
|
$like = ((x($alike,$item['id'])) ? format_like($alike[$item['id']],$alike[$item['id'] . '-l'],'like',$item['id']) : '');
|
||||||
$dislike = (($dlike[$item['id']]) ? format_like($dlike[$item['id']],$dlike[$item['id'] . '-l'],'dislike',$item['id']) : '');
|
$dislike = ((x($dlike,$item['id'])) ? format_like($dlike[$item['id']],$dlike[$item['id'] . '-l'],'dislike',$item['id']) : '');
|
||||||
|
|
||||||
$location = (($item['location']) ? '<a target="map" href="http://maps.google.com/?q=' . urlencode($item['location']) . '">' . $item['location'] . '</a>' : '');
|
$location = (($item['location']) ? '<a target="map" href="http://maps.google.com/?q=' . urlencode($item['location']) . '">' . $item['location'] . '</a>' : '');
|
||||||
$coord = (($item['coord']) ? '<a target="map" href="http://maps.google.com/?q=' . urlencode($item['coord']) . '">' . $item['coord'] . '</a>' : '');
|
$coord = (($item['coord']) ? '<a target="map" href="http://maps.google.com/?q=' . urlencode($item['coord']) . '">' . $item['coord'] . '</a>' : '');
|
||||||
|
|
|
@ -16,7 +16,7 @@ function photo_init(&$a) {
|
||||||
return; // NOTREACHED
|
return; // NOTREACHED
|
||||||
}
|
}
|
||||||
|
|
||||||
if(x($type)) {
|
if(isset($type)) {
|
||||||
switch($type) {
|
switch($type) {
|
||||||
|
|
||||||
case 'profile':
|
case 'profile':
|
||||||
|
@ -37,7 +37,7 @@ function photo_init(&$a) {
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
$data = $r[0]['data'];
|
$data = $r[0]['data'];
|
||||||
}
|
}
|
||||||
if(x($data) === false) {
|
if(! isset($data)) {
|
||||||
$data = file_get_contents(($resolution == 5)
|
$data = file_get_contents(($resolution == 5)
|
||||||
? 'images/default-profile-sm.jpg'
|
? 'images/default-profile-sm.jpg'
|
||||||
: 'images/default-profile.jpg');
|
: 'images/default-profile.jpg');
|
||||||
|
|
|
@ -276,31 +276,8 @@ function profile_content(&$a, $update = 0) {
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
|
|
||||||
foreach($r as $item) {
|
foreach($r as $item) {
|
||||||
|
like_puller($a,$item,$alike,'like');
|
||||||
$sparkle = '';
|
like_puller($a,$item,$dlike,'dislike');
|
||||||
|
|
||||||
if(($item['verb'] == ACTIVITY_LIKE) && ($item['id'] != $item['parent'])) {
|
|
||||||
$url = $item['url'];
|
|
||||||
if(($item['network'] === 'dfrn') && (! $item['self'])) {
|
|
||||||
$url = $a->get_baseurl() . '/redir/' . $item['contact-id'];
|
|
||||||
$sparkle = ' class="sparkle" ';
|
|
||||||
}
|
|
||||||
if(! is_array($alike[$item['parent'] . '-l']))
|
|
||||||
$alike[$item['parent'] . '-l'] = array();
|
|
||||||
$alike[$item['parent']] ++;
|
|
||||||
$alike[$item['parent'] . '-l'][] = '<a href="'. $url . '"'. $sparkle .'>' . $item['name'] . '</a>';
|
|
||||||
}
|
|
||||||
if(($item['verb'] == ACTIVITY_DISLIKE) && ($item['id'] != $item['parent'])) {
|
|
||||||
$url = $item['url'];
|
|
||||||
if(($item['network'] === 'dfrn') && (! $item['self'])) {
|
|
||||||
$url = $a->get_baseurl() . '/redir/' . $item['contact-id'];
|
|
||||||
$sparkle = ' class="sparkle" ';
|
|
||||||
}
|
|
||||||
if(! is_array($dlike[$item['parent'] . '-l']))
|
|
||||||
$dlike[$item['parent'] . '-l'] = array();
|
|
||||||
$dlike[$item['parent']] ++;
|
|
||||||
$dlike[$item['parent'] . '-l'][] = '<a href="'. $url . '"'. $sparkle .'>' . $item['name'] . '</a>';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($r as $item) {
|
foreach($r as $item) {
|
||||||
|
@ -313,7 +290,8 @@ function profile_content(&$a, $update = 0) {
|
||||||
|
|
||||||
$redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
|
$redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
|
||||||
|
|
||||||
if((($item['verb'] == ACTIVITY_LIKE) || ($item['verb'] == ACTIVITY_DISLIKE)) && ($item['id'] != $item['parent']))
|
if(((activity_match($item['verb'],ACTIVITY_LIKE)) || (activity_match($item['verb'],ACTIVITY_DISLIKE)))
|
||||||
|
&& ($item['id'] != $item['parent']))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
$lock = (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
|
$lock = (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
|
||||||
|
|
|
@ -157,6 +157,7 @@ function profiles_post(&$a) {
|
||||||
|
|
||||||
|
|
||||||
function profiles_content(&$a) {
|
function profiles_content(&$a) {
|
||||||
|
$o = '';
|
||||||
$o .= '<script> $(document).ready(function() { $(\'#nav-profiles-link\').addClass(\'nav-selected\'); });</script>';
|
$o .= '<script> $(document).ready(function() { $(\'#nav-profiles-link\').addClass(\'nav-selected\'); });</script>';
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
|
@ -266,7 +267,7 @@ function profiles_content(&$a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(intval($a->argv[1])) {
|
if(($a->argc > 1 && intval($a->argv[1])) {
|
||||||
$r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
$r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||||
intval($a->argv[1]),
|
intval($a->argv[1]),
|
||||||
intval($_SESSION['uid'])
|
intval($_SESSION['uid'])
|
||||||
|
|
|
@ -155,6 +155,7 @@ function settings_post(&$a) {
|
||||||
if(! function_exists('settings_content')) {
|
if(! function_exists('settings_content')) {
|
||||||
function settings_content(&$a) {
|
function settings_content(&$a) {
|
||||||
|
|
||||||
|
$o = '';
|
||||||
$o .= '<script> $(document).ready(function() { $(\'#nav-settings-link\').addClass(\'nav-selected\'); });</script>';
|
$o .= '<script> $(document).ready(function() { $(\'#nav-settings-link\').addClass(\'nav-selected\'); });</script>';
|
||||||
|
|
||||||
if(! local_user()) {
|
if(! local_user()) {
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
<!DOCTYPE html >
|
<!DOCTYPE html >
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title><?php echo $page['title'] ?></title>
|
<title><?php if(x($page,'title')) echo $page['title'] ?></title>
|
||||||
<?php echo $page['htmlhead'] ?>
|
<?php if(x($page,'htmlhead')) echo $page['htmlhead'] ?>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header><?php echo $page['header']; ?></header>
|
<header><?php if(x($page,'header')) echo $page['header']; ?></header>
|
||||||
<nav><div id="top-margin"></div><?php echo $page['nav']; ?></nav>
|
<nav><div id="top-margin"></div><?php if(x($page,'nav')) echo $page['nav']; ?></nav>
|
||||||
<aside><?php echo $page['aside']; ?></aside>
|
<aside><?php if(x($page,'aside')) echo $page['aside']; ?></aside>
|
||||||
<section><?php echo $page['content']; ?>
|
<section><?php if(x($page,'content')) echo $page['content']; ?>
|
||||||
<div id="page-footer"></div>
|
<div id="page-footer"></div>
|
||||||
</section>
|
</section>
|
||||||
<footer><?php echo $page['footer']; ?></footer>
|
<footer><?php if(x($page,'footer')) echo $page['footer']; ?></footer>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
<!DOCTYPE html ><?php // This is a perfect example of why I prefer to use template files rather than mixed PHP/HTML ?>
|
<!DOCTYPE html ><?php // This is a perfect example of why I prefer to use template files rather than mixed PHP/HTML ?>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title><?php echo $page['title']; ?></title>
|
<title><?php if(x($page,'title')) echo $page['title']; ?></title>
|
||||||
<?php echo $page['htmlhead']; ?>
|
<?php if(x($page,'htmlhead')) echo $page['htmlhead']; ?>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header><?php echo $page['header']; ?></header>
|
<header><?php if(x($page,'header')) echo $page['header']; ?></header>
|
||||||
<nav><div id="top-margin"></div><?php echo $page['nav']; ?></nav>
|
<nav><div id="top-margin"></div><?php if(x($page,'nav')) echo $page['nav']; ?></nav>
|
||||||
<aside>
|
<aside>
|
||||||
<?php if((is_array($profile)) && count($profile)) { ?>
|
<?php if((is_array($profile)) && count($profile)) { ?>
|
||||||
<div class="vcard">
|
<div class="vcard">
|
||||||
|
@ -57,17 +57,17 @@
|
||||||
<?php if(strlen($profile['marital'])) { ?>
|
<?php if(strlen($profile['marital'])) { ?>
|
||||||
<div class="marital"><span class="marital-label"><span class="heart">♥</span> Status: </span><span class="marital-text"><?php echo $profile['marital']; ?></span></div>
|
<div class="marital"><span class="marital-label"><span class="heart">♥</span> Status: </span><span class="marital-text"><?php echo $profile['marital']; ?></span></div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<?php if(strlen($profile['url'])) { ?>
|
<?php if(strlen($profile['homepage'])) { ?>
|
||||||
<div class="homepage"><span class="homepage-label">Homepage: </span><span class="homepage-url"><?php echo $profile['homepage']; ?></span></div>
|
<div class="homepage"><span class="homepage-label">Homepage: </span><span class="homepage-url"><?php echo $profile['homepage']; ?></span></div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<?php echo $page['aside'] ?>
|
<?php if(x($page,'aside')) echo $page['aside'] ?>
|
||||||
</aside>
|
</aside>
|
||||||
<section>
|
<section>
|
||||||
<?php echo $page['content']; ?>
|
<?php if(x($page,'content')) echo $page['content']; ?>
|
||||||
<div id="page-footer"></div>
|
<div id="page-footer"></div>
|
||||||
</section>
|
</section>
|
||||||
<footer>
|
<footer>
|
||||||
<?php echo $page['footer']; ?>
|
<?php if(x($page,'footer')) echo $page['footer']; ?>
|
||||||
</footer>
|
</footer>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
|
|
||||||
function gender_selector($current="",$suffix="") {
|
function gender_selector($current="",$suffix="") {
|
||||||
|
$o = '';
|
||||||
$select = array('', t('Male'), t('Female'), t('Transsexual'), t('Hermaphrodite'), t('Neuter'), t('Other'), t('Undecided'));
|
$select = array('', t('Male'), t('Female'), t('Transsexual'), t('Hermaphrodite'), t('Neuter'), t('Other'), t('Undecided'));
|
||||||
|
|
||||||
$o .= "<select name=\"gender$suffix\" id=\"gender-select$suffix\" size=\"1\" >";
|
$o .= "<select name=\"gender$suffix\" id=\"gender-select$suffix\" size=\"1\" >";
|
||||||
|
@ -14,6 +15,7 @@ function gender_selector($current="",$suffix="") {
|
||||||
}
|
}
|
||||||
|
|
||||||
function sexpref_selector($current="",$suffix="") {
|
function sexpref_selector($current="",$suffix="") {
|
||||||
|
$o = '';
|
||||||
$select = array('', t('Males'), t('Females'), t('Bisexual'), t('Autosexual'), t('Abstinent'), t('Virgin'), t('Nonsexual'));
|
$select = array('', t('Males'), t('Females'), t('Bisexual'), t('Autosexual'), t('Abstinent'), t('Virgin'), t('Nonsexual'));
|
||||||
|
|
||||||
$o .= "<select name=\"sexual$suffix\" id=\"sexual-select$suffix\" size=\"1\" >";
|
$o .= "<select name=\"sexual$suffix\" id=\"sexual-select$suffix\" size=\"1\" >";
|
||||||
|
@ -27,6 +29,7 @@ function sexpref_selector($current="",$suffix="") {
|
||||||
|
|
||||||
|
|
||||||
function marital_selector($current="",$suffix="") {
|
function marital_selector($current="",$suffix="") {
|
||||||
|
$o = '';
|
||||||
$select = array('', t('Single'), t('Lonely'), t('Available'), t('Unavailable'), t('Dating'), t('Unfaithful'), t('Sex Addict'), t('Friends'), t('Friends/Benefits'), t('Casual'), t('Engaged'), t('Married'), t('Partners'), t('Cohabiting'), t('Happy'), t('Not Looking'), t('Swinger'), t('Betrayed'), t('Separated'), t('Unstable'), t('Divorced'), t('Widowed'), t('Uncertain'), t('Complicated'), t('Don\'t care'), t('Ask me') );
|
$select = array('', t('Single'), t('Lonely'), t('Available'), t('Unavailable'), t('Dating'), t('Unfaithful'), t('Sex Addict'), t('Friends'), t('Friends/Benefits'), t('Casual'), t('Engaged'), t('Married'), t('Partners'), t('Cohabiting'), t('Happy'), t('Not Looking'), t('Swinger'), t('Betrayed'), t('Separated'), t('Unstable'), t('Divorced'), t('Widowed'), t('Uncertain'), t('Complicated'), t('Don\'t care'), t('Ask me') );
|
||||||
|
|
||||||
$o .= "<select name=\"marital\" id=\"marital-select\" size=\"1\" >";
|
$o .= "<select name=\"marital\" id=\"marital-select\" size=\"1\" >";
|
||||||
|
|
Loading…
Reference in a new issue