Compare commits
11 commits
Author | SHA1 | Date | |
---|---|---|---|
fbd2b29089 | |||
26f97b8284 | |||
d8630dbdd8 | |||
36a77c6db2 | |||
4f4d6bace6 | |||
b376f21533 | |||
b919a1e35a | |||
f0b6400584 | |||
ceabd7629b | |||
fab63ca751 | |||
768acb0a3f |
67
README
67
README
|
@ -2,71 +2,14 @@
|
|||
Mistpark
|
||||
Distributed Social Network
|
||||
|
||||
What if there was a social network which was free to use, open source - and
|
||||
where your privacy is always under your control?
|
||||
Mistpark has been discontinued - but don't be alarmed. We've merely changed
|
||||
the name. The project is alive and well at
|
||||
|
||||
What if this social network could scale to encompass the entire internet, and
|
||||
*not* require a central organisation to provide servers (in exchange for
|
||||
selling your private information to advertisers)?
|
||||
http://github.com/friendika/friendika
|
||||
|
||||
Look no further.
|
||||
|
||||
Mistpark is a social network without boundaries. Mistpark installations can
|
||||
link together into a global social network which is free from central
|
||||
control. We are developing connectors to seamlessly communicate with many
|
||||
other open social networks and providers - GNU-social, Diaspora, Status.net,
|
||||
and even some of the larger closed services such as Facebook and Twitter.
|
||||
Find us on the web at http://friendika.com
|
||||
|
||||
Over the coming months, the boundaries between these networks will start to
|
||||
become indistinguishable as they all become part of your social circle.
|
||||
|
||||
|
||||
Your personal thoughts and conversations belong to you - and are shared with
|
||||
those you wish to share them with.
|
||||
|
||||
Period.
|
||||
|
||||
Mistpark is secure, and as private as you wish it to be. Our privacy settings
|
||||
are straight-forward and simple, because we know that relationships rarely are
|
||||
(straight-forward and simple). Whether you're communicating with drinking
|
||||
buddies or potential employers, you can rest assured that each is only able to
|
||||
see the side of you that you wish to present.
|
||||
|
||||
A single instance of Mistpark Server can easily support hundreds of (and up to
|
||||
several thousand) people using commodity hosting hardware. Each of these
|
||||
people are able to connect with potentially hundreds or thousands of friends
|
||||
and associates on any other supported network anywhere in the world and share
|
||||
photos, links, status updates, etc.
|
||||
|
||||
But maybe you don't want to be connected to the world... That's OK too.
|
||||
Mistpark may also be closed off from the global community and used to support
|
||||
social networking amongst corporate, educational, religious, and other private
|
||||
communities. This makes it an excellent choice for the social networking needs
|
||||
of young teenagers and especially k-12 organisations.
|
||||
|
||||
Every person on Mistpark has unlimited profiles available to them. There is a
|
||||
"public profile" which can be seen by anybody. Additional profiles may be
|
||||
tailored to specific groups or individuals.
|
||||
|
||||
Groups may be created and used for closed conversations. In this way your
|
||||
conversations with one group of friends is completely isolated from other
|
||||
friends or groups of friends.
|
||||
|
||||
You may also create interactive band/celebrity pages, special interest groups,
|
||||
and even organisational 'soapboxes' - for social communications that require
|
||||
the ability to scale to global levels. Mistpark provides for automatic
|
||||
relationship management in these extreme cases so that you can concentrate on
|
||||
your message and public persona - and not worry about being swamped by friend
|
||||
requests. You can even maintain private social contact with your closest
|
||||
friends and public updates to your hordes of fans - using the same interface.
|
||||
|
||||
No other social network offers this ability.
|
||||
|
||||
IMPORTANT: Please see the file INSTALL for system requirements.
|
||||
|
||||
Visit http://mistpark.com for more information.
|
||||
|
||||
You may also contact the author and raise issues via the source code
|
||||
repository on github -- http://github.com/macgirvin/mistpark
|
||||
|
||||
It's your network now. If social networking isn't what you thought it would
|
||||
be, help us to make it better.
|
||||
|
|
70
boot.php
70
boot.php
|
@ -2,12 +2,20 @@
|
|||
|
||||
set_time_limit(0);
|
||||
|
||||
define ( 'BUILD_ID', 1012 );
|
||||
define ( 'BUILD_ID', 1013 );
|
||||
define ( 'DFRN_PROTOCOL_VERSION', '2.0' );
|
||||
|
||||
define ( 'EOL', "<br />\r\n" );
|
||||
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
|
||||
|
||||
// log levels
|
||||
|
||||
define ( 'LOGGER_NORMAL', 0 );
|
||||
define ( 'LOGGER_TRACE', 1 );
|
||||
define ( 'LOGGER_DEBUG', 2 );
|
||||
define ( 'LOGGER_DATA', 3 );
|
||||
define ( 'LOGGER_ALL', 4 );
|
||||
|
||||
// registration policy
|
||||
|
||||
define ( 'REGISTER_CLOSED', 0 );
|
||||
|
@ -129,12 +137,16 @@ class App {
|
|||
$this->pager= array();
|
||||
|
||||
$this->scheme = ((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'])) ? 'https' : 'http' );
|
||||
$this->hostname = $_SERVER['SERVER_NAME'];
|
||||
|
||||
if(x($_SERVER,'SERVER_NAME'))
|
||||
$this->hostname = $_SERVER['SERVER_NAME'];
|
||||
|
||||
set_include_path("include/$this->hostname" . PATH_SEPARATOR . 'include' . PATH_SEPARATOR . '.' );
|
||||
|
||||
if(substr($_SERVER['QUERY_STRING'],0,2) == "q=")
|
||||
if((x($_SERVER,'QUERY_STRING')) && substr($_SERVER['QUERY_STRING'],0,2) == "q=")
|
||||
$_SERVER['QUERY_STRING'] = substr($_SERVER['QUERY_STRING'],2);
|
||||
$this->cmd = trim($_GET['q'],'/');
|
||||
if(x($_GET,'q'))
|
||||
$this->cmd = trim($_GET['q'],'/');
|
||||
|
||||
|
||||
$this->argv = explode('/',$this->cmd);
|
||||
|
@ -604,8 +616,7 @@ function goaway($s) {
|
|||
if(! function_exists('xml_status')) {
|
||||
function xml_status($st, $message = '') {
|
||||
|
||||
if(strlen($message))
|
||||
$xml_message = "\t<message>" . xmlify($message) . "</message>\r\n";
|
||||
$xml_message = ((strlen($message)) ? "\t<message>" . xmlify($message) . "</message>\r\n" : '');
|
||||
|
||||
header( "Content-type: text/xml" );
|
||||
echo '<?xml version="1.0" encoding="UTF-8"?>'."\r\n";
|
||||
|
@ -1226,6 +1237,7 @@ function allowed_email($email) {
|
|||
|
||||
if(! function_exists('format_like')) {
|
||||
function format_like($cnt,$arr,$type,$id) {
|
||||
$o = '';
|
||||
if($cnt == 1)
|
||||
$o .= $arr[0] . (($type === 'like') ? t(' likes this.') : t(' doesn\'t like this.')) . EOL ;
|
||||
else {
|
||||
|
@ -1277,12 +1289,13 @@ function attribute_contains($attr,$s) {
|
|||
}}
|
||||
|
||||
if(! function_exists('logger')) {
|
||||
function logger($msg) {
|
||||
function logger($msg,$level = 0) {
|
||||
|
||||
$debugging = get_config('system','debugging');
|
||||
$loglevel = intval(get_config('system','loglevel'));
|
||||
$logfile = get_config('system','logfile');
|
||||
|
||||
if((! $debugging) || (! $logfile))
|
||||
if((! $debugging) || (! $logfile) || ($level > $loglevel))
|
||||
return;
|
||||
|
||||
@file_put_contents($logfile, datetime_convert() . ':' . session_id() . ' ' . $msg . "\n", FILE_APPEND);
|
||||
|
@ -1292,7 +1305,7 @@ function logger($msg) {
|
|||
|
||||
if(! function_exists('activity_match')) {
|
||||
function activity_match($haystack,$needle) {
|
||||
if(($haystack === $needle) || (($basename($needle) === $haystack) && strstr($needle,NAMESPACE_ACTIVITY_SCHEMA)))
|
||||
if(($haystack === $needle) || ((basename($needle) === $haystack) && strstr($needle,NAMESPACE_ACTIVITY_SCHEMA)))
|
||||
return true;
|
||||
return false;
|
||||
}}
|
||||
|
@ -1329,3 +1342,42 @@ function qp($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;
|
||||
}}
|
||||
|
||||
|
||||
function get_mentions($item) {
|
||||
$o = '';
|
||||
if(! strlen($item['tag']))
|
||||
return $o;
|
||||
|
||||
$arr = explode(',',$item['tag']);
|
||||
foreach($arr as $x) {
|
||||
$matches = null;
|
||||
if(preg_match('/@\[url=([^\]]*)\]/',$x,$matches))
|
||||
$o .= "\t\t" . '<link rel="mentioned" href="' . $matches[1] . '" />' . "\r\n";
|
||||
}
|
||||
return $o;
|
||||
}
|
|
@ -176,6 +176,7 @@ CREATE TABLE IF NOT EXISTS `item` (
|
|||
`object` text NOT NULL,
|
||||
`resource-id` char(255) NOT NULL,
|
||||
`tag` mediumtext NOT NULL,
|
||||
`inform` mediumtext NOT NULL,
|
||||
`location` char(255) NOT NULL,
|
||||
`coord` char(255) NOT NULL,
|
||||
`allow_cid` mediumtext NOT NULL,
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
// login/logout
|
||||
|
||||
if((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
|
||||
|
||||
|
@ -53,16 +53,19 @@ if((x($_SESSION,'authenticated')) && (! ($_POST['auth-params'] === 'login'))) {
|
|||
}
|
||||
else {
|
||||
|
||||
unset($_SESSION['authenticated']);
|
||||
unset($_SESSION['uid']);
|
||||
unset($_SESSION['visitor_id']);
|
||||
unset($_SESSION['administrator']);
|
||||
unset($_SESSION['cid']);
|
||||
unset($_SESSION['theme']);
|
||||
unset($_SESSION['my_url']);
|
||||
unset($_SESSION['page_flags']);
|
||||
if(isset($_SESSION)) {
|
||||
unset($_SESSION['authenticated']);
|
||||
unset($_SESSION['uid']);
|
||||
unset($_SESSION['visitor_id']);
|
||||
unset($_SESSION['administrator']);
|
||||
unset($_SESSION['cid']);
|
||||
unset($_SESSION['theme']);
|
||||
unset($_SESSION['my_url']);
|
||||
unset($_SESSION['page_flags']);
|
||||
}
|
||||
|
||||
$encrypted = hash('whirlpool',trim($_POST['password']));
|
||||
if(x($_POST,'password'))
|
||||
$encrypted = hash('whirlpool',trim($_POST['password']));
|
||||
|
||||
if((x($_POST,'auth-params')) && $_POST['auth-params'] === 'login') {
|
||||
|
||||
|
|
|
@ -36,8 +36,8 @@ class dba {
|
|||
|
||||
$mesg = '';
|
||||
|
||||
if($this->db->mysqli->errno)
|
||||
$debug_text .= $this->db->mysqli->error . EOL;
|
||||
if($this->db->errno)
|
||||
$debug_text .= $this->db->error . EOL;
|
||||
|
||||
if($result === false)
|
||||
$mesg = 'false';
|
||||
|
|
|
@ -122,11 +122,13 @@ function group_get_members($gid) {
|
|||
|
||||
function group_side($every="contacts",$each="group") {
|
||||
|
||||
if(! local_user())
|
||||
return;
|
||||
$o = '';
|
||||
|
||||
$createtext = t('Create a new group');
|
||||
$linktext= t('Everybody');
|
||||
if(! local_user())
|
||||
return '';
|
||||
|
||||
$createtext = t('Create a new group');
|
||||
$linktext= t('Everybody');
|
||||
|
||||
$o .= <<< EOT
|
||||
|
||||
|
|
|
@ -27,8 +27,10 @@ function get_feed_for(&$a, $dfrn_id, $owner_id, $last_update, $direction = 0) {
|
|||
$r = q("SELECT * FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1",
|
||||
intval($owner_id)
|
||||
);
|
||||
if(count($r))
|
||||
if(count($r)) {
|
||||
$owner = $r[0];
|
||||
$owner['nickname'] = $owner_nick;
|
||||
}
|
||||
else
|
||||
killme();
|
||||
|
||||
|
@ -90,7 +92,7 @@ function get_feed_for(&$a, $dfrn_id, $owner_id, $last_update, $direction = 0) {
|
|||
$sort = 'ASC';
|
||||
|
||||
if(! strlen($last_update))
|
||||
$last_update = 'now - 30 days';
|
||||
$last_update = 'now -30 days';
|
||||
|
||||
$check_date = datetime_convert('UTC','UTC',$last_update,'Y-m-d H:i:s');
|
||||
|
||||
|
@ -117,9 +119,6 @@ function get_feed_for(&$a, $dfrn_id, $owner_id, $last_update, $direction = 0) {
|
|||
$items = $r;
|
||||
|
||||
$feed_template = load_view_file('view/atom_feed.tpl');
|
||||
$tomb_template = load_view_file('view/atom_tomb.tpl');
|
||||
$item_template = load_view_file('view/atom_item.tpl');
|
||||
$cmnt_template = load_view_file('view/atom_cmnt.tpl');
|
||||
|
||||
$atom = '';
|
||||
|
||||
|
@ -146,7 +145,7 @@ function get_feed_for(&$a, $dfrn_id, $owner_id, $last_update, $direction = 0) {
|
|||
$atom .= replace_macros($feed_template, array(
|
||||
'$feed_id' => xmlify($a->get_baseurl() . '/profile/' . $owner_nick),
|
||||
'$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,
|
||||
'$salmon' => $salmon,
|
||||
'$name' => xmlify($owner['name']),
|
||||
|
@ -169,66 +168,13 @@ function get_feed_for(&$a, $dfrn_id, $owner_id, $last_update, $direction = 0) {
|
|||
// public feeds get html, our own nodes use bbcode
|
||||
|
||||
if($dfrn_id === '*') {
|
||||
$allow = (($item['last-child']) ? 1 : 0);
|
||||
$item['body'] = bbcode($item['body']);
|
||||
$type = 'html';
|
||||
}
|
||||
else {
|
||||
$allow = ((($item['last-child']) && ($contact['rel']) && ($contact['rel'] != REL_FAN)) ? 1 : 0);
|
||||
$type = 'text';
|
||||
}
|
||||
|
||||
if($item['deleted']) {
|
||||
$atom .= replace_macros($tomb_template, array(
|
||||
'$id' => xmlify($item['uri']),
|
||||
'$updated' => xmlify(datetime_convert('UTC', 'UTC', $item['edited'] . '+00:00' , ATOM_TIME))
|
||||
));
|
||||
}
|
||||
else {
|
||||
$verb = construct_verb($item);
|
||||
$actobj = construct_activity($item);
|
||||
|
||||
if($item['parent'] == $item['id']) {
|
||||
$atom .= replace_macros($item_template, array(
|
||||
'$name' => xmlify($item['name']),
|
||||
'$profile_page' => xmlify($item['url']),
|
||||
'$thumb' => xmlify($item['thumb']),
|
||||
'$owner_name' => xmlify($item['owner-name']),
|
||||
'$owner_profile_page' => xmlify($item['owner-link']),
|
||||
'$owner_thumb' => xmlify($item['owner-avatar']),
|
||||
'$item_id' => xmlify($item['uri']),
|
||||
'$title' => xmlify($item['title']),
|
||||
'$published' => xmlify(datetime_convert('UTC', 'UTC', $item['created'] . '+00:00' , ATOM_TIME)),
|
||||
'$updated' => xmlify(datetime_convert('UTC', 'UTC', $item['edited'] . '+00:00' , ATOM_TIME)),
|
||||
'$location' => xmlify($item['location']),
|
||||
'$coord' => xmlify($item['coord']),
|
||||
'$type' => $type,
|
||||
'$alt' => xmlify($a->get_baseurl() . '/display/' . $owner_nick . '/' . $item['id']),
|
||||
'$content' => xmlify($item['body']),
|
||||
'$verb' => xmlify($verb),
|
||||
'$actobj' => $actobj, // do not xmlify
|
||||
'$comment_allow' => $allow
|
||||
));
|
||||
}
|
||||
else {
|
||||
$atom .= replace_macros($cmnt_template, array(
|
||||
'$name' => xmlify($item['name']),
|
||||
'$profile_page' => xmlify($item['url']),
|
||||
'$thumb' => xmlify($item['thumb']),
|
||||
'$item_id' => xmlify($item['uri']),
|
||||
'$title' => xmlify($item['title']),
|
||||
'$published' => xmlify(datetime_convert('UTC', 'UTC', $item['created'] . '+00:00' , ATOM_TIME)),
|
||||
'$updated' => xmlify(datetime_convert('UTC', 'UTC', $item['edited'] . '+00:00' , ATOM_TIME)),
|
||||
'$type' => $type,
|
||||
'$content' => xmlify($item['body']),
|
||||
'$alt' => xmlify($a->get_baseurl() . '/display/' . $owner_nick . '/' . $item['id']),
|
||||
'$verb' => xmlify($verb),
|
||||
'$actobj' => $actobj, // do not xmlify
|
||||
'$parent_id' => xmlify($item['parent-uri']),
|
||||
'$comment_allow' => $allow
|
||||
));
|
||||
}
|
||||
}
|
||||
$atom .= atom_entry($item,$type,null,$owner,true);
|
||||
}
|
||||
|
||||
$atom .= '</feed>' . "\r\n";
|
||||
|
@ -587,7 +533,7 @@ function get_item_contact($item,$contacts) {
|
|||
}
|
||||
|
||||
|
||||
function dfrn_deliver($owner,$contact,$atom,$debugging = false) {
|
||||
function dfrn_deliver($owner,$contact,$atom) {
|
||||
|
||||
|
||||
if((! strlen($contact['dfrn-id'])) && (! $contact['duplex']) && (! ($owner['page-flags'] == PAGE_COMMUNITY)))
|
||||
|
@ -602,13 +548,11 @@ function dfrn_deliver($owner,$contact,$atom,$debugging = false) {
|
|||
|
||||
$url = $contact['notify'] . '?dfrn_id=' . $idtosend . '&dfrn_version=' . DFRN_PROTOCOL_VERSION ;
|
||||
|
||||
if($debugging)
|
||||
echo "URL: $url\n";
|
||||
logger('dfrn_deliver: ' . $url);
|
||||
|
||||
$xml = fetch_url($url);
|
||||
|
||||
if($debugging)
|
||||
echo $xml;
|
||||
logger('dfrn_deliver: ' . $xml);
|
||||
|
||||
if(! $xml)
|
||||
return 3;
|
||||
|
@ -641,8 +585,7 @@ function dfrn_deliver($owner,$contact,$atom,$debugging = false) {
|
|||
$final_dfrn_id = substr($final_dfrn_id,2);
|
||||
|
||||
if($final_dfrn_id != $orig_id) {
|
||||
if($debugging)
|
||||
echo "Wrong ID - did not decode\n";
|
||||
logger('dfrn_deliver: wrong dfrn_id.');
|
||||
// did not decode properly - cannot trust this site
|
||||
return 3;
|
||||
}
|
||||
|
@ -662,10 +605,7 @@ function dfrn_deliver($owner,$contact,$atom,$debugging = false) {
|
|||
|
||||
$xml = post_url($contact['notify'],$postvars);
|
||||
|
||||
if($debugging) {
|
||||
echo "SENDING: " . print_r($postvars,true) . "\n";
|
||||
echo "RECEIVING: " . $xml;
|
||||
}
|
||||
logger('dfrn_deliver: ' . "SENDING: " . print_r($postvars,true) . "\n" . "RECEIVING: " . $xml);
|
||||
|
||||
$res = simplexml_load_string($xml);
|
||||
|
||||
|
@ -1053,4 +993,73 @@ function subscribe_to_hub($url,$importer,$contact) {
|
|||
post_url($url,$params);
|
||||
return;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function atom_author($tag,$name,$uri,$h,$w,$photo) {
|
||||
$o = '';
|
||||
if(! $tag)
|
||||
return $o;
|
||||
$name = xmlify($name);
|
||||
$uri = xmlify($uri);
|
||||
$h = intval($h);
|
||||
$w = intval($w);
|
||||
$photo = xmlify($photo);
|
||||
|
||||
|
||||
$o .= "<$tag>\r\n";
|
||||
$o .= "<name>$name</name>\r\n";
|
||||
$o .= "<uri>$uri</uri>\r\n";
|
||||
$o .= '<link rel="photo" type="image/jpeg" media:width="' . $w . '" media:height="' . $h . '" href="' . $photo . '" />' . "\r\n";
|
||||
$o .= '<link rel="avatar" type="image/jpeg" media:width="' . $w . '" media:height="' . $h . '" href="' . $photo . '" />' . "\r\n";
|
||||
$o .= "</$tag>\r\n";
|
||||
return $o;
|
||||
}
|
||||
|
||||
function atom_entry($item,$type,$author,$owner,$comment = false) {
|
||||
|
||||
if($item['deleted'])
|
||||
return '<at:deleted-entry ref="' . xmlify($item['uri']) . '" when="' . xmlify(datetime_convert('UTC','UTC',$item['edited'] . '+00:00',ATOM_TIME)) . '" />' . "\r\n";
|
||||
|
||||
$a = get_app();
|
||||
|
||||
$o = "\r\n\r\n<entry>\r\n";
|
||||
|
||||
if(is_array($author))
|
||||
$o .= atom_author('author',$author['name'],$author['url'],80,80,$author['thumb']);
|
||||
else
|
||||
$o .= atom_author('author',$item['name'],$item['url'],80,80,$item['thumb']);
|
||||
if(strlen($item['owner-name']))
|
||||
$o .= atom_author('dfrn:owner',$item['owner-name'],$item['owner-link'],80,80,$item['owner-avatar']);
|
||||
|
||||
if($item['parent'] != $item['id'])
|
||||
$o .= '<thr:in-reply-to ref="' . xmlify($item['parent-uri']) . '" type="text/html" href="' . xmlify($a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id']) . '" />' . "\r\n";
|
||||
|
||||
$o .= '<id>' . xmlify($item['uri']) . '</id>' . "\r\n";
|
||||
$o .= '<title>' . xmlify($item['title']) . '</title>' . "\r\n";
|
||||
$o .= '<published>' . xmlify(datetime_convert('UTC','UTC',$item['created'] . '+00:00',ATOM_TIME)) . '</published>' . "\r\n";
|
||||
$o .= '<updated>' . xmlify(datetime_convert('UTC','UTC',$item['edited'] . '+00:00',ATOM_TIME)) . '</updated>' . "\r\n";
|
||||
$o .= '<content type="' . $type . '" >' . xmlify(($type === 'html') ? bbcode($item['body']) : $item['body']) . '</content>' . "\r\n";
|
||||
$o .= '<link rel="alternate" href="' . xmlify($a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id']) . '" />' . "\r\n";
|
||||
if($comment)
|
||||
$o .= '<dfrn:comment-allow>' . intval($item['last-child']) . '</dfrn:comment-allow>' . "\r\n";
|
||||
if($item['location'])
|
||||
$o .= '<dfrn:location>' . xmlify($item['location']) . '</dfrn:location>' . "\r\n";
|
||||
if($item['coord'])
|
||||
$o .= '<georss:point>' . xmlify($item['coord']) . '</georss:point>' . "\r\n";
|
||||
|
||||
$verb = construct_verb($item);
|
||||
$o .= '<as:verb>' . xmlify($verb) . '</as:verb>' . "\r\n";
|
||||
$actobj = construct_activity($item);
|
||||
if(strlen($actobj))
|
||||
$o .= $actobj;
|
||||
|
||||
$mentioned = get_mentions($item);
|
||||
if($mentioned)
|
||||
$o .= $mentioned;
|
||||
|
||||
$o .= '</entry>' . "\r\n";
|
||||
|
||||
return $o;
|
||||
}
|
||||
|
|
@ -1,5 +1,8 @@
|
|||
<?php
|
||||
|
||||
if(! x($a->page,'nav'))
|
||||
$a->page['nav'] = '';
|
||||
|
||||
$a->page['nav'] .= '<div id="panel" style="display: none;"></div>' ;
|
||||
|
||||
if(local_user()) {
|
||||
|
|
|
@ -10,12 +10,10 @@
|
|||
unset($db_host, $db_user, $db_pass, $db_data);
|
||||
|
||||
|
||||
$debugging = get_config('system','debugging');
|
||||
|
||||
require_once("session.php");
|
||||
require_once("datetime.php");
|
||||
require_once('include/items.php');
|
||||
|
||||
require_once('include/bbcode.php');
|
||||
|
||||
if($argc < 3)
|
||||
exit;
|
||||
|
@ -34,10 +32,8 @@
|
|||
break;
|
||||
}
|
||||
|
||||
if($debugging)
|
||||
dbg(3);
|
||||
|
||||
$recipients = array();
|
||||
$url_recipients = array();
|
||||
|
||||
if($cmd === 'mail') {
|
||||
|
||||
|
@ -84,10 +80,11 @@
|
|||
killme();
|
||||
|
||||
$hub = get_config('system','huburl');
|
||||
|
||||
// If this is a public conversation, notify the feed hub
|
||||
$notify_hub = true;
|
||||
|
||||
// fill this in with a salmon slap if applicable
|
||||
// fill this in with a single salmon slap if applicable
|
||||
$slap = '';
|
||||
|
||||
if($cmd != 'mail') {
|
||||
|
@ -108,8 +105,9 @@
|
|||
if((strlen($parent['allow_cid']))
|
||||
|| (strlen($parent['allow_gid']))
|
||||
|| (strlen($parent['deny_cid']))
|
||||
|| (strlen($parent['deny_gid'])))
|
||||
|| (strlen($parent['deny_gid']))) {
|
||||
$notify_hub = false; // private recipients, not public
|
||||
}
|
||||
|
||||
$allow_people = expand_acl($parent['allow_cid']);
|
||||
$allow_groups = expand_groups(expand_acl($parent['allow_gid']));
|
||||
|
@ -121,8 +119,23 @@
|
|||
foreach($items as $item) {
|
||||
$recipients[] = $item['contact-id'];
|
||||
$conversants[] = $item['contact-id'];
|
||||
// pull out additional tagged people to notify (if public message)
|
||||
if($notify_hub && strlen($item['inform'])) {
|
||||
$people = explode(',',$item['inform']);
|
||||
foreach($people as $person) {
|
||||
if(substr($person,0,4) === 'cid:') {
|
||||
$recipients[] = intval(substr($person,4));
|
||||
$conversants[] = intval(substr($person,4));
|
||||
}
|
||||
else {
|
||||
$url_recipients[] = substr($person,4);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
logger('notifier: url_recipients' . print_r($url_recipients,true));
|
||||
|
||||
$conversants = array_unique($conversants,SORT_NUMERIC);
|
||||
|
||||
|
||||
|
@ -139,18 +152,15 @@
|
|||
killme();
|
||||
|
||||
$contacts = $r;
|
||||
|
||||
$tomb_template = load_view_file('view/atom_tomb.tpl');
|
||||
$item_template = load_view_file('view/atom_item.tpl');
|
||||
$cmnt_template = load_view_file('view/atom_cmnt.tpl');
|
||||
}
|
||||
|
||||
$feed_template = load_view_file('view/atom_feed.tpl');
|
||||
$mail_template = load_view_file('view/atom_mail.tpl');
|
||||
|
||||
$atom = '';
|
||||
|
||||
$hubxml = '';
|
||||
$slaps = array();
|
||||
|
||||
if(strlen($hub)) {
|
||||
$hubs = explode(',', $hub);
|
||||
if(count($hubs)) {
|
||||
|
@ -180,6 +190,7 @@
|
|||
|
||||
if($cmd === 'mail') {
|
||||
$notify_hub = false; // mail is not public
|
||||
|
||||
$atom .= replace_macros($mail_template, array(
|
||||
'$name' => xmlify($owner['name']),
|
||||
'$profile_page' => xmlify($owner['url']),
|
||||
|
@ -195,103 +206,28 @@
|
|||
|
||||
if($followup) {
|
||||
foreach($items as $item) { // there is only one item
|
||||
|
||||
$verb = construct_verb($item);
|
||||
$actobj = construct_activity($item);
|
||||
|
||||
if($item['id'] == $item_id) {
|
||||
$slap = replace_macros($cmnt_template, array(
|
||||
'$name' => xmlify($owner['name']),
|
||||
'$profile_page' => xmlify($owner['url']),
|
||||
'$thumb' => xmlify($owner['thumb']),
|
||||
'$owner_name' => xmlify($item['owner-name']),
|
||||
'$owner_profile_page' => xmlify($item['owner-link']),
|
||||
'$owner_thumb' => xmlify($item['owner-avatar']),
|
||||
'$item_id' => xmlify($item['uri']),
|
||||
'$title' => xmlify($item['title']),
|
||||
'$published' => xmlify(datetime_convert('UTC', 'UTC', $item['created'] . '+00:00' , ATOM_TIME)),
|
||||
'$updated' => xmlify(datetime_convert('UTC', 'UTC', $item['edited'] . '+00:00' , ATOM_TIME)),
|
||||
'$location' => xmlify($item['location']),
|
||||
'$coord' => xmlify($item['coord']),
|
||||
'$type' => 'text',
|
||||
'$verb' => xmlify($verb),
|
||||
'$actobj' => $actobj,
|
||||
'$alt' => xmlify($a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id']),
|
||||
'$content' => xmlify($item['body']),
|
||||
'$parent_id' => xmlify($item['parent-uri']),
|
||||
'$comment_allow' => 0
|
||||
));
|
||||
$slap = atom_entry($item,'html',$owner,$owner,false);
|
||||
$atom .= atom_entry($item,'text',$owner,$owner,false);
|
||||
}
|
||||
}
|
||||
$atom .= $slap;
|
||||
}
|
||||
else {
|
||||
foreach($items as $item) {
|
||||
if($item['deleted']) {
|
||||
$atom .= replace_macros($tomb_template, array(
|
||||
'$id' => xmlify($item['uri']),
|
||||
'$updated' => xmlify(datetime_convert('UTC', 'UTC', $item['edited'] . '+00:00' , ATOM_TIME))
|
||||
));
|
||||
}
|
||||
else {
|
||||
$contact = get_item_contact($item,$contacts);
|
||||
if(! $contact)
|
||||
continue;
|
||||
$contact = get_item_contact($item,$contacts);
|
||||
if(! $contact)
|
||||
continue;
|
||||
|
||||
$verb = construct_verb($item);
|
||||
$actobj = construct_activity($item);
|
||||
|
||||
if($item['parent'] == $item['id']) {
|
||||
$atom .= replace_macros($item_template, array(
|
||||
'$name' => xmlify($contact['name']),
|
||||
'$profile_page' => xmlify($contact['url']),
|
||||
'$thumb' => xmlify($contact['thumb']),
|
||||
'$owner_name' => xmlify($item['owner-name']),
|
||||
'$owner_profile_page' => xmlify($item['owner-link']),
|
||||
'$owner_thumb' => xmlify($item['owner-avatar']),
|
||||
'$item_id' => xmlify($item['uri']),
|
||||
'$title' => xmlify($item['title']),
|
||||
'$published' => xmlify(datetime_convert('UTC', 'UTC', $item['created'] . '+00:00' , ATOM_TIME)),
|
||||
'$updated' => xmlify(datetime_convert('UTC', 'UTC', $item['edited'] . '+00:00' , ATOM_TIME)),
|
||||
'$location' => xmlify($item['location']),
|
||||
'$coord' => xmlify($item['coord']),
|
||||
'$type' => 'text',
|
||||
'$verb' => xmlify($verb),
|
||||
'$actobj' => $actobj,
|
||||
'$content' => xmlify($item['body']),
|
||||
'$alt' => xmlify($a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id']),
|
||||
'$comment_allow' => (($item['last-child']) ? 1 : 0)
|
||||
));
|
||||
}
|
||||
else {
|
||||
$atom .= replace_macros($cmnt_template, array(
|
||||
'$name' => xmlify($contact['name']),
|
||||
'$profile_page' => xmlify($contact['url']),
|
||||
'$thumb' => xmlify($contact['thumb']),
|
||||
'$item_id' => xmlify($item['uri']),
|
||||
'$title' => xmlify($item['title']),
|
||||
'$published' => xmlify(datetime_convert('UTC', 'UTC', $item['created'] . '+00:00' , ATOM_TIME)),
|
||||
'$updated' => xmlify(datetime_convert('UTC', 'UTC', $item['edited'] . '+00:00' , ATOM_TIME)),
|
||||
'$content' => xmlify($item['body']),
|
||||
'$alt' => xmlify($a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id']),
|
||||
'$location' => xmlify($item['location']),
|
||||
'$coord' => xmlify($item['coord']),
|
||||
'$type' => 'text',
|
||||
'$verb' => xmlify($verb),
|
||||
'$actobj' => $actobj,
|
||||
'$parent_id' => xmlify($item['parent-uri']),
|
||||
'$comment_allow' => (($item['last-child']) ? 1 : 0)
|
||||
));
|
||||
}
|
||||
}
|
||||
$atom .= atom_entry($item,'text',$contact,$owner,true);
|
||||
$slaps[] = atom_entry($item,'html',$contact,$owner,true);
|
||||
}
|
||||
}
|
||||
}
|
||||
$atom .= '</feed>' . "\r\n";
|
||||
|
||||
if($debugging)
|
||||
echo $atom;
|
||||
logger('notifier: ' . $atom, LOGGER_DATA);
|
||||
|
||||
logger('notifier: slaps: ' . print_r($slaps,true), LOGGER_DATA);
|
||||
|
||||
if($followup)
|
||||
$recip_str = $parent['contact-id'];
|
||||
|
@ -299,7 +235,7 @@
|
|||
$recip_str = implode(', ', $recipients);
|
||||
|
||||
|
||||
$r = q("SELECT * FROM `contact` WHERE `id` IN ( %s ) ",
|
||||
$r = q("SELECT * FROM `contact` WHERE `id` IN ( %s ) AND `blocked` = 0 ",
|
||||
dbesc($recip_str)
|
||||
);
|
||||
if(! count($r))
|
||||
|
@ -307,7 +243,7 @@
|
|||
|
||||
// delivery loop
|
||||
|
||||
|
||||
require_once('include/salmon.php');
|
||||
|
||||
foreach($r as $contact) {
|
||||
if($contact['self'])
|
||||
|
@ -317,12 +253,24 @@
|
|||
|
||||
switch($contact['network']) {
|
||||
case 'dfrn':
|
||||
$deliver_status = dfrn_deliver($owner,$contact,$atom,$debugging);
|
||||
logger('notifier: dfrndelivery: ' . $contact['name']);
|
||||
$deliver_status = dfrn_deliver($owner,$contact,$atom);
|
||||
break;
|
||||
default:
|
||||
if($followup) {
|
||||
require_once('include/salmon.php');
|
||||
slapper($owner,$contact,$slap);
|
||||
slapper($owner,$contact['notify'],$slap);
|
||||
}
|
||||
else {
|
||||
|
||||
// only send salmon if public - e.g. if it's ok to notify
|
||||
// a public hub, it's ok to send a salmon
|
||||
|
||||
if(count($slaps) && $notify_hub) {
|
||||
logger('notifier: slapdelivery: ' . $contact['name']);
|
||||
foreach($slaps as $slappy) {
|
||||
slapper($owner,$contact['notify'],$slappy);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -332,6 +280,18 @@
|
|||
intval($item_id)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// send additional slaps to mentioned remote tags (@foo@example.com)
|
||||
|
||||
if(count($slaps) && count($url_recipients) && $notify_hub) {
|
||||
foreach($url_recipients as $url) {
|
||||
logger('notifier: urldelivery: ' . $url);
|
||||
foreach($slaps as $slappy) {
|
||||
slapper($owner,$url,$slappy);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if((strlen($hub)) && ($notify_hub)) {
|
||||
|
|
|
@ -86,13 +86,13 @@ function get_salmon_key($uri,$keyhash) {
|
|||
|
||||
|
||||
|
||||
function slapper($owner,$contact,$slap) {
|
||||
function slapper($owner,$url,$slap) {
|
||||
|
||||
logger('slapper called. Data: ' . $slap);
|
||||
|
||||
// does contact have a salmon endpoint?
|
||||
|
||||
if(! strlen($contact['notify']))
|
||||
if(! strlen($url))
|
||||
return;
|
||||
|
||||
// add all namespaces to item
|
||||
|
@ -147,7 +147,7 @@ EOT;
|
|||
));
|
||||
|
||||
// slap them
|
||||
post_url($contact['notify'],$salmon, array(
|
||||
post_url($url,$salmon, array(
|
||||
'Content-type: application/magic-envelope+xml',
|
||||
'Content-length: ' . strlen($salmon)
|
||||
));
|
||||
|
@ -172,7 +172,7 @@ EOT;
|
|||
));
|
||||
|
||||
// slap them
|
||||
post_url($contact['notify'],$salmon, array(
|
||||
post_url($url,$salmon, array(
|
||||
'Content-type: application/magic-envelope+xml',
|
||||
'Content-length: ' . strlen($salmon)
|
||||
));
|
||||
|
|
11
index.php
11
index.php
|
@ -12,7 +12,7 @@ $install = ((file_exists('.htconfig.php')) ? false : true);
|
|||
|
||||
@include(".htconfig.php");
|
||||
|
||||
if(x($lang))
|
||||
if(isset($lang) && strlen($lang))
|
||||
load_translation_table($lang);
|
||||
|
||||
require_once("dba.php");
|
||||
|
@ -31,9 +31,12 @@ $a->init_pagehead();
|
|||
session_start();
|
||||
|
||||
|
||||
if((x($_SESSION,'authenticated')) || (x($_POST['auth-params'])))
|
||||
if((x($_SESSION,'authenticated')) || (x($_POST,'auth-params')))
|
||||
require("auth.php");
|
||||
|
||||
if(! x($_SESSION,'sysmsg'))
|
||||
$_SESSION['sysmsg'] = '';
|
||||
|
||||
if($install)
|
||||
$a->module = 'install';
|
||||
else
|
||||
|
@ -71,7 +74,9 @@ if($a->module_loaded) {
|
|||
|
||||
if((! $a->error) && (function_exists($a->module . '_content'))) {
|
||||
$func = $a->module . '_content';
|
||||
$a->page['content'] .= $func($a);
|
||||
if(! x($a->page,'content'))
|
||||
$a->page['content'] = '';
|
||||
$a->page['content'] .= $func($a);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,6 +4,8 @@ require_once('include/Contact.php');
|
|||
|
||||
function contacts_init(&$a) {
|
||||
require_once('include/group.php');
|
||||
if(! x($a->page,'aside'))
|
||||
$a->page['aside'] = '';
|
||||
$a->page['aside'] .= group_side();
|
||||
|
||||
if($a->config['register_policy'] != REGISTER_CLOSED)
|
||||
|
@ -84,7 +86,11 @@ function contacts_post(&$a) {
|
|||
|
||||
function contacts_content(&$a) {
|
||||
|
||||
$sort_type = 0;
|
||||
$o = '';
|
||||
$o .= '<script> $(document).ready(function() { $(\'#nav-contacts-link\').addClass(\'nav-selected\'); });</script>';
|
||||
|
||||
|
||||
if(! local_user()) {
|
||||
notice( t('Permission denied.') . EOL);
|
||||
return;
|
||||
|
|
|
@ -6,16 +6,11 @@ require_once('include/auth.php');
|
|||
|
||||
function dfrn_poll_init(&$a) {
|
||||
|
||||
$dfrn_id = '';
|
||||
|
||||
if(x($_GET,'dfrn_id'))
|
||||
$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'] : '');
|
||||
$dfrn_id = ((x($_GET,'dfrn_id')) ? $_GET['dfrn_id'] : '');
|
||||
$type = ((x($_GET,'type')) ? $_GET['type'] : '');
|
||||
$last_update = ((x($_GET,'last_update')) ? $_GET['last_update'] : '');
|
||||
$destination_url = ((x($_GET,'destination_url')) ? $_GET['destination_url'] : '');
|
||||
$dfrn_version = ((x($_GET,'dfrn_version')) ? (float) $_GET['dfrn_version'] : 0);
|
||||
|
||||
|
||||
$direction = (-1);
|
||||
|
@ -23,7 +18,7 @@ function dfrn_poll_init(&$a) {
|
|||
|
||||
if(strpos($dfrn_id,':') == 1) {
|
||||
$direction = intval(substr($dfrn_id,0,1));
|
||||
$dfrn_id = substr($dfrn_id,2);
|
||||
$dfrn_id = substr($dfrn_id,2);
|
||||
}
|
||||
|
||||
if(($dfrn_id === '') && (! x($_POST,'dfrn_id')) && ($a->argc > 1)) {
|
||||
|
@ -33,7 +28,7 @@ function dfrn_poll_init(&$a) {
|
|||
killme();
|
||||
}
|
||||
|
||||
if((x($type)) && ($type === 'profile')) {
|
||||
if((isset($type)) && ($type === 'profile')) {
|
||||
|
||||
$sql_extra = '';
|
||||
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) {
|
||||
case 1:
|
||||
|
@ -119,15 +114,15 @@ function dfrn_poll_init(&$a) {
|
|||
|
||||
function dfrn_poll_post(&$a) {
|
||||
|
||||
$dfrn_id = $_POST['dfrn_id'];
|
||||
$challenge = $_POST['challenge'];
|
||||
$url = $_POST['url'];
|
||||
$dfrn_version = (float) $_POST['dfrn_version'];
|
||||
$dfrn_id = ((x($_POST,'dfrn_id')) ? $_POST['dfrn_id'] : '');
|
||||
$challenge = ((x($_POST,'challenge')) ? $_POST['challenge'] : '');
|
||||
$url = ((x($_POST,'url')) ? $_POST['url'] : '');
|
||||
$dfrn_version = ((x($_POST,'dfrn_version')) ? (float) $_POST['dfrn_version'] : 0);
|
||||
|
||||
$direction = (-1);
|
||||
if(strpos($dfrn_id,':') == 1) {
|
||||
$direction = intval(substr($dfrn_id,0,1));
|
||||
$dfrn_id = substr($dfrn_id,2);
|
||||
$dfrn_id = substr($dfrn_id,2);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -4,11 +4,12 @@ function directory_init(&$a) {
|
|||
}
|
||||
|
||||
function directory_content(&$a) {
|
||||
$o = '';
|
||||
$o .= '<script> $(document).ready(function() { $(\'#nav-directory-link\').addClass(\'nav-selected\'); });</script>';
|
||||
|
||||
$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 = '';
|
||||
$gdirpath = dirname(get_config('system','directory_submit_url'));
|
||||
|
|
|
@ -113,40 +113,18 @@ function display_content(&$a) {
|
|||
if(count($r)) {
|
||||
|
||||
foreach($r as $item) {
|
||||
$sparkle = '';
|
||||
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>';
|
||||
}
|
||||
like_puller($a,$item,$alike,'like');
|
||||
like_puller($a,$item,$dlike,'dislike');
|
||||
}
|
||||
|
||||
|
||||
|
||||
foreach($r as $item) {
|
||||
$comment = '';
|
||||
$template = $tpl;
|
||||
|
||||
$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;
|
||||
|
||||
$lock = (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
|
||||
|
|
|
@ -163,7 +163,7 @@ function follow_post(&$a) {
|
|||
);
|
||||
|
||||
require_once('include/salmon.php');
|
||||
slapper($r[0],$contact,$slap);
|
||||
slapper($r[0],$contact['notify'],$slap);
|
||||
|
||||
goaway($_SESSION['return_url']);
|
||||
// NOTREACHED
|
||||
|
|
|
@ -13,6 +13,9 @@ function home_init(&$a) {
|
|||
if(! function_exists('home_content')) {
|
||||
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>";
|
||||
$o .= '<h1>Welcome' . ((x($a->config,'sitename')) ? " to {$a->config['sitename']}" : "" ) . '</h1>';
|
||||
if(file_exists('home.html'))
|
||||
|
|
34
mod/item.php
34
mod/item.php
|
@ -14,8 +14,7 @@ function item_post(&$a) {
|
|||
|
||||
require_once('include/security.php');
|
||||
|
||||
$uid = $_SESSION['uid'];
|
||||
|
||||
$uid = local_user();
|
||||
|
||||
$parent = ((x($_POST,'parent')) ? intval($_POST['parent']) : 0);
|
||||
|
||||
|
@ -115,24 +114,27 @@ function item_post(&$a) {
|
|||
}
|
||||
|
||||
$str_tags = '';
|
||||
$tagged = array();
|
||||
$inform = '';
|
||||
|
||||
$tags = get_tags($body);
|
||||
|
||||
|
||||
if($tags) {
|
||||
if(count($tags)) {
|
||||
foreach($tags as $tag) {
|
||||
if(strpos($tag,'@') === 0) {
|
||||
$name = substr($tag,1);
|
||||
if(strpos($name,'@')) {
|
||||
|
||||
$links = @webfinger($name);
|
||||
if((strpos($name,'@')) || (strpos($name,'http://'))) {
|
||||
$newname = $name;
|
||||
$links = @lrdd($name);
|
||||
if(count($links)) {
|
||||
foreach($links as $link) {
|
||||
if($link['@attributes']['rel'] === 'http://webfinger.net/rel/profile-page')
|
||||
$profile = $link['@attributes']['href'];
|
||||
if($link['@attributes']['rel'] === 'salmon')
|
||||
$salmon = $link['@attributes']['href'];
|
||||
if($link['@attributes']['rel'] === 'salmon') {
|
||||
if(strlen($inform))
|
||||
$inform .= ',';
|
||||
$inform .= 'url:' . str_replace(',','%2c',$link['@attributes']['href']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -153,7 +155,9 @@ function item_post(&$a) {
|
|||
}
|
||||
if(count($r)) {
|
||||
$profile = $r[0]['url'];
|
||||
$salmon = $r[0]['notify'];
|
||||
if(strlen($inform))
|
||||
$inform .= ',';
|
||||
$inform .= 'cid:' . $r[0]['id'];
|
||||
}
|
||||
}
|
||||
if($profile) {
|
||||
|
@ -161,7 +165,7 @@ function item_post(&$a) {
|
|||
if(strlen($str_tags))
|
||||
$str_tags .= ',';
|
||||
$profile = str_replace(',','%2c',$profile);
|
||||
$str_tags .= '[url=' . $profile . ']' . $newname . '[/url]';
|
||||
$str_tags .= '@[url=' . $profile . ']' . $newname . '[/url]';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -181,9 +185,9 @@ function item_post(&$a) {
|
|||
$uri = item_new_uri($a->get_hostname(),$profile_uid);
|
||||
|
||||
$r = q("INSERT INTO `item` (`uid`,`type`,`wall`,`gravity`,`contact-id`,`owner-name`,`owner-link`,`owner-avatar`,
|
||||
`author-name`, `author-link`, `author-avatar`, `created`,
|
||||
`edited`, `changed`, `uri`, `title`, `body`, `location`, `coord`, `verb`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`)
|
||||
VALUES( %d, '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' )",
|
||||
`author-name`, `author-link`, `author-avatar`, `created`, `edited`, `changed`, `uri`, `title`, `body`, `location`, `coord`,
|
||||
`tag`, `inform`, `verb`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`)
|
||||
VALUES( %d, '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' )",
|
||||
intval($profile_uid),
|
||||
dbesc($post_type),
|
||||
intval($wall),
|
||||
|
@ -203,6 +207,8 @@ function item_post(&$a) {
|
|||
dbesc($body),
|
||||
dbesc($location),
|
||||
dbesc($coord),
|
||||
dbesc($str_tags),
|
||||
dbesc($inform),
|
||||
dbesc($verb),
|
||||
dbesc($str_contact_allow),
|
||||
dbesc($str_group_allow),
|
||||
|
|
|
@ -86,6 +86,8 @@ function message_post(&$a) {
|
|||
}
|
||||
|
||||
function message_content(&$a) {
|
||||
|
||||
$o = '';
|
||||
$o .= '<script> $(document).ready(function() { $(\'#nav-messages-link\').addClass(\'nav-selected\'); });</script>';
|
||||
|
||||
if(! local_user()) {
|
||||
|
@ -156,7 +158,7 @@ function message_content(&$a) {
|
|||
|
||||
$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');
|
||||
$o .= replace_macros($tpl,array(
|
||||
'$header' => t('Send Private Message'),
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
|
||||
function network_init(&$a) {
|
||||
require_once('include/group.php');
|
||||
if(! x($a->page,'aside'))
|
||||
$a->page['aside'] = '';
|
||||
$a->page['aside'] .= group_side('network','network');
|
||||
}
|
||||
|
||||
|
@ -10,7 +12,9 @@ function network_init(&$a) {
|
|||
function network_content(&$a, $update = 0) {
|
||||
|
||||
if(! local_user())
|
||||
return;
|
||||
return '';
|
||||
|
||||
$o = '';
|
||||
|
||||
require_once("include/bbcode.php");
|
||||
|
||||
|
@ -140,32 +144,10 @@ function network_content(&$a, $update = 0) {
|
|||
$dlike = array();
|
||||
|
||||
if(count($r)) {
|
||||
|
||||
foreach($r as $item) {
|
||||
|
||||
$sparkle = '';
|
||||
|
||||
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>';
|
||||
}
|
||||
like_puller($a,$item,$alike,'like');
|
||||
like_puller($a,$item,$dlike,'dislike');
|
||||
}
|
||||
|
||||
foreach($r as $item) {
|
||||
|
@ -173,11 +155,11 @@ function network_content(&$a, $update = 0) {
|
|||
$comment = '';
|
||||
$template = $tpl;
|
||||
$commentww = '';
|
||||
|
||||
$owner_url = $owner_photo = $owner_name = '';
|
||||
$profile_url = $item['url'];
|
||||
$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;
|
||||
|
||||
$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']) : '');
|
||||
$dislike = (($dlike[$item['id']]) ? format_like($dlike[$item['id']],$dlike[$item['id'] . '-l'],'dislike',$item['id']) : '');
|
||||
$like = ((x($alike,$item['id'])) ? format_like($alike[$item['id']],$alike[$item['id'] . '-l'],'like',$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>' : '');
|
||||
$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
|
||||
}
|
||||
|
||||
if(x($type)) {
|
||||
if(isset($type)) {
|
||||
switch($type) {
|
||||
|
||||
case 'profile':
|
||||
|
@ -37,7 +37,7 @@ function photo_init(&$a) {
|
|||
if(count($r)) {
|
||||
$data = $r[0]['data'];
|
||||
}
|
||||
if(x($data) === false) {
|
||||
if(! isset($data)) {
|
||||
$data = file_get_contents(($resolution == 5)
|
||||
? 'images/default-profile-sm.jpg'
|
||||
: 'images/default-profile.jpg');
|
||||
|
|
179
mod/photos.php
179
mod/photos.php
|
@ -3,6 +3,7 @@
|
|||
require_once('Photo.php');
|
||||
require_once('include/items.php');
|
||||
require_once('view/acl_selectors.php');
|
||||
require_once('include/bbcode.php');
|
||||
|
||||
function photos_init(&$a) {
|
||||
|
||||
|
@ -51,12 +52,17 @@ function photos_post(&$a) {
|
|||
killme();
|
||||
}
|
||||
|
||||
|
||||
$r = q("SELECT `contact`.* `user`.`nickname` FROM `contact` LEFT JOIN `user` ON `user`.`uid` = `contact`.`uid`
|
||||
$r = q("SELECT `contact`.*, `user`.`nickname` FROM `contact` LEFT JOIN `user` ON `user`.`uid` = `contact`.`uid`
|
||||
WHERE `user`.`uid` = %d AND `self` = 1 LIMIT 1",
|
||||
intval(local_user())
|
||||
);
|
||||
|
||||
if(! count($r)) {
|
||||
notice( t('Contact information unavailable') . EOL);
|
||||
logger('photos_post: unable to locate contact record for logged in user. uid=' . local_user());
|
||||
killme();
|
||||
}
|
||||
|
||||
$contact_record = $r[0];
|
||||
|
||||
|
||||
|
@ -179,19 +185,18 @@ function photos_post(&$a) {
|
|||
return; // NOTREACHED
|
||||
}
|
||||
|
||||
if(($a->argc > 1) && ((x($_POST,'desc') !== false) || (x($_POST,'newtag') !== false))) {
|
||||
|
||||
|
||||
if(($a->argc > 1) && (x($_POST,'desc') !== false)) {
|
||||
$desc = notags(trim($_POST['desc']));
|
||||
$tags = notags(trim($_POST['tags']));
|
||||
$item_id = intval($_POST['item_id']);
|
||||
$desc = ((x($_POST,'desc')) ? notags(trim($_POST['desc'])) : '');
|
||||
$rawtags = ((x($_POST,'newtag')) ? notags(trim($_POST['newtag'])) : '');
|
||||
$item_id = ((x($_POST,'item_id')) ? intval($_POST['item_id']) : 0);
|
||||
$resource_id = $a->argv[1];
|
||||
|
||||
$p = q("SELECT * FROM `photo` WHERE `resource-id` = '%s' AND `uid` = %d ORDER BY `scale` DESC",
|
||||
dbesc($resource_id),
|
||||
intval(local_user())
|
||||
);
|
||||
if(count($r)) {
|
||||
if((count($p)) && ($p[0]['desc'] !== $desc)) {
|
||||
$r = q("UPDATE `photo` SET `desc` = '%s' WHERE `resource-id` = '%s' AND `uid` = %d",
|
||||
dbesc($desc),
|
||||
dbesc($resource_id),
|
||||
|
@ -200,10 +205,11 @@ function photos_post(&$a) {
|
|||
}
|
||||
if(! $item_id) {
|
||||
|
||||
// Create item container
|
||||
|
||||
$title = '';
|
||||
$basename = basename($filename);
|
||||
$uri = item_new_uri($a->get_hostname(),local_user());
|
||||
// Create item container
|
||||
|
||||
$arr = array();
|
||||
|
||||
|
@ -231,14 +237,100 @@ function photos_post(&$a) {
|
|||
|
||||
}
|
||||
|
||||
$r = q("UPDATE `item` SET `tag` = '%s', `edited` = '%s', `changed` = '%s' WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||
dbesc($tags),
|
||||
dbesc(datetime_convert()),
|
||||
dbesc(datetime_convert()),
|
||||
intval($item_id),
|
||||
intval(local_user())
|
||||
);
|
||||
if($item_id) {
|
||||
$r = q("SELECT * FROM `item` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||
intval($item_id),
|
||||
intval(local_user())
|
||||
);
|
||||
}
|
||||
if(count($r)) {
|
||||
$old_tag = $r[0]['tag'];
|
||||
$old_inform = $r[0]['inform'];
|
||||
}
|
||||
|
||||
if(strlen($rawtags)) {
|
||||
|
||||
$str_tags = '';
|
||||
$inform = '';
|
||||
|
||||
// if the new tag doesn't have a namespace specifier (@foo or #foo) give it a hashtag
|
||||
|
||||
$x = substr($rawtags,0,1);
|
||||
if($x !== '@' && $x !== '#')
|
||||
$rawtags = '#' . $rawtags;
|
||||
|
||||
$tags = get_tags($rawtags);
|
||||
|
||||
if(count($tags)) {
|
||||
foreach($tags as $tag) {
|
||||
if(strpos($tag,'@') === 0) {
|
||||
$name = substr($tag,1);
|
||||
if((strpos($name,'@')) || (strpos($name,'http://'))) {
|
||||
$newname = $name;
|
||||
$links = @lrdd($name);
|
||||
if(count($links)) {
|
||||
foreach($links as $link) {
|
||||
if($link['@attributes']['rel'] === 'http://webfinger.net/rel/profile-page')
|
||||
$profile = $link['@attributes']['href'];
|
||||
if($link['@attributes']['rel'] === 'salmon') {
|
||||
if(strlen($inform))
|
||||
$inform .= ',';
|
||||
$inform .= 'url:' . str_replace(',','%2c',$link['@attributes']['href']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$newname = $name;
|
||||
if(strstr($name,'_')) {
|
||||
$newname = str_replace('_',' ',$name);
|
||||
$r = q("SELECT * FROM `contact` WHERE `name` = '%s' AND `uid` = %d LIMIT 1",
|
||||
dbesc($newname),
|
||||
intval(local_user())
|
||||
);
|
||||
}
|
||||
else {
|
||||
$r = q("SELECT * FROM `contact` WHERE `nick` = '%s' AND `uid` = %d LIMIT 1",
|
||||
dbesc($name),
|
||||
intval(local_user())
|
||||
);
|
||||
}
|
||||
if(count($r)) {
|
||||
$profile = $r[0]['url'];
|
||||
if(strlen($inform))
|
||||
$inform .= ',';
|
||||
$inform .= 'cid:' . $r[0]['id'];
|
||||
}
|
||||
}
|
||||
if($profile) {
|
||||
if(strlen($str_tags))
|
||||
$str_tags .= ',';
|
||||
$profile = str_replace(',','%2c',$profile);
|
||||
$str_tags .= '@[url=' . $profile . ']' . $newname . '[/url]';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$newtag = $old_tag;
|
||||
if(strlen($newtag) && strlen($str_tags))
|
||||
$newtag .= ',';
|
||||
$newtag .= $str_tags;
|
||||
|
||||
$newinform = $old_inform;
|
||||
if(strlen($newinform) && strlen($inform))
|
||||
$newinform .= ',';
|
||||
$newinform .= $inform;
|
||||
|
||||
$r = q("UPDATE `item` SET `tag` = '%s', `inform` = '%s', `edited` = '%s', `changed` = '%s' WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||
dbesc($newtag),
|
||||
dbesc($newinform),
|
||||
dbesc(datetime_convert()),
|
||||
dbesc(datetime_convert()),
|
||||
intval($item_id),
|
||||
intval(local_user())
|
||||
);
|
||||
}
|
||||
goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']);
|
||||
return; // NOTREACHED
|
||||
}
|
||||
|
@ -623,11 +715,12 @@ function photos_content(&$a) {
|
|||
$r = q("SELECT COUNT(*) AS `total`
|
||||
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
|
||||
WHERE `parent-uri` = '%s' AND `uri` != '%s' AND `item`.`deleted` = 0
|
||||
AND NOT `item`.`type` IN ( 'remote', 'net-comment')
|
||||
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
|
||||
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
|
||||
AND `item`.`uid` = %d
|
||||
$sql_extra ",
|
||||
dbesc($i1[0]['uri']),
|
||||
dbesc($i1[0]['uri'])
|
||||
dbesc($i1[0]['uri']),
|
||||
intval($i1[0]['uid'])
|
||||
|
||||
);
|
||||
|
||||
|
@ -641,12 +734,13 @@ function photos_content(&$a) {
|
|||
`contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
|
||||
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
|
||||
WHERE `parent-uri` = '%s' AND `uri` != '%s' AND `item`.`deleted` = 0
|
||||
AND NOT `item`.`type` IN ( 'remote', 'net-comment')
|
||||
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
|
||||
AND `item`.`uid` = %d
|
||||
$sql_extra
|
||||
ORDER BY `parent` DESC, `id` ASC LIMIT %d ,%d ",
|
||||
dbesc($i1[0]['uri']),
|
||||
dbesc($i1[0]['uri']),
|
||||
intval($i1[0]['uid']),
|
||||
intval($a->pager['start']),
|
||||
intval($a->pager['itemspage'])
|
||||
|
||||
|
@ -656,9 +750,17 @@ function photos_content(&$a) {
|
|||
$o .= '<div id="photo-caption" >' . $ph[0]['desc'] . '</div>';
|
||||
|
||||
if(count($i1) && strlen($i1[0]['tag'])) {
|
||||
$arr = explode(',',$i1[0]['tag']);
|
||||
// parse tags and add links
|
||||
$o .= '<div id="in-this-photo-text">' . t('In this photo: ') . '</div>';
|
||||
$o .= '<div id="in-this-photo">' . $i1[0]['tag'] . '</div>';
|
||||
$o .= '<div id="in-this-photo-text">' . t('Tags: ') . '</div>';
|
||||
$o .= '<div id="in-this-photo">';
|
||||
$tag_str = '';
|
||||
foreach($arr as $t) {
|
||||
if(strlen($tag_str))
|
||||
$tag_str .= ', ';
|
||||
$tag_str .= bbcode($t);
|
||||
}
|
||||
$o .= $tag_str . '</div>';
|
||||
}
|
||||
|
||||
if($cmd === 'edit') {
|
||||
|
@ -668,8 +770,9 @@ function photos_content(&$a) {
|
|||
'$resource_id' => $ph[0]['resource-id'],
|
||||
'$capt_label' => t('Caption'),
|
||||
'$caption' => $ph[0]['desc'],
|
||||
'$tag_label' => t('Tags'),
|
||||
'$tag_label' => t('Add a Tag'),
|
||||
'$tags' => $i1[0]['tag'],
|
||||
'$help_tags' => t('Example: @bob, @Barbara_Jensen, @jim@example.com, #California, #camping'),
|
||||
'$item_id' => ((count($i1)) ? $i1[0]['id'] : 0),
|
||||
'$submit' => t('Submit'),
|
||||
'$delete' => t('Delete Photo')
|
||||
|
@ -678,12 +781,13 @@ function photos_content(&$a) {
|
|||
}
|
||||
|
||||
if(count($i1)) {
|
||||
// pull out how many people like the photo
|
||||
|
||||
$cmnt_tpl = load_view_file('view/comment_item.tpl');
|
||||
$tpl = load_view_file('view/photo_item.tpl');
|
||||
$return_url = $a->cmd;
|
||||
|
||||
$like_tpl = load_view_file('view/like.tpl');
|
||||
|
||||
if(can_write_wall($a,$a->data['user']['uid'])) {
|
||||
if($i1[0]['last-child']) {
|
||||
$o .= replace_macros($cmnt_tpl,array(
|
||||
|
@ -700,16 +804,41 @@ function photos_content(&$a) {
|
|||
}
|
||||
}
|
||||
|
||||
$alike = array();
|
||||
$dlike = array();
|
||||
|
||||
// display comments
|
||||
if(count($r)) {
|
||||
|
||||
foreach($r as $item) {
|
||||
like_puller($a,$item,$alike,'like');
|
||||
like_puller($a,$item,$dlike,'dislike');
|
||||
}
|
||||
|
||||
$likebuttons = '';
|
||||
|
||||
if(can_write_wall($a,$a->data['user']['uid']))
|
||||
$likebuttons = replace_macros($like_tpl,array('$id' => $i1[0]['id']));
|
||||
|
||||
$like = ((isset($alike[$i1[0]['id']])) ? format_like($alike[$i1[0]['id']],$alike[$i1[0]['id'] . '-l'],'like',$i1[0]['id']) : '');
|
||||
$dislike = ((isset($dlike[$i1[0]['id']])) ? format_like($dlike[$i1[0]['id']],$dlike[$i1[0]['id'] . '-l'],'dislike',$i1[0]['id']) : '');
|
||||
|
||||
$o .= $likebuttons;
|
||||
$o .= $like;
|
||||
$o .= $dislike;
|
||||
|
||||
foreach($r as $item) {
|
||||
$comment = '';
|
||||
$template = $tpl;
|
||||
|
||||
$sparkle = '';
|
||||
|
||||
if(((activity_match($item['verb'],ACTIVITY_LIKE)) || (activity_match($item['verb'],ACTIVITY_DISLIKE))) && ($item['id'] != $item['parent']))
|
||||
continue;
|
||||
|
||||
$redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
|
||||
|
||||
if(can_write_wall($a,$a->data['user']['uid'])) {
|
||||
|
||||
if($item['last-child']) {
|
||||
$comment = replace_macros($cmnt_tpl,array(
|
||||
'$return_path' => $return_url,
|
||||
|
|
|
@ -25,7 +25,7 @@ function ping_init(&$a) {
|
|||
);
|
||||
$intro = $r[0]['total'];
|
||||
|
||||
$myurl = $a->get_baseurl() . '/profile/' . $user['nickname'] ;
|
||||
$myurl = $a->get_baseurl() . '/profile/' . $a->user['nickname'] ;
|
||||
$r = q("SELECT COUNT(*) AS `total` FROM `mail`
|
||||
WHERE `uid` = %d AND `seen` = 0 AND `from-url` != '%s' ",
|
||||
intval(local_user()),
|
||||
|
|
|
@ -85,7 +85,7 @@ function profile_content(&$a, $update = 0) {
|
|||
$groups = array();
|
||||
|
||||
$tab = 'posts';
|
||||
|
||||
$o = '';
|
||||
|
||||
if($update) {
|
||||
// Ensure we've got a profile owner if updating.
|
||||
|
@ -256,7 +256,6 @@ function profile_content(&$a, $update = 0) {
|
|||
|
||||
);
|
||||
|
||||
|
||||
$cmnt_tpl = load_view_file('view/comment_item.tpl');
|
||||
|
||||
$like_tpl = load_view_file('view/like.tpl');
|
||||
|
@ -277,31 +276,8 @@ function profile_content(&$a, $update = 0) {
|
|||
if(count($r)) {
|
||||
|
||||
foreach($r as $item) {
|
||||
|
||||
$sparkle = '';
|
||||
|
||||
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>';
|
||||
}
|
||||
like_puller($a,$item,$alike,'like');
|
||||
like_puller($a,$item,$dlike,'dislike');
|
||||
}
|
||||
|
||||
foreach($r as $item) {
|
||||
|
@ -314,7 +290,8 @@ function profile_content(&$a, $update = 0) {
|
|||
|
||||
$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;
|
||||
|
||||
$lock = (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
|
||||
|
@ -366,14 +343,14 @@ function profile_content(&$a, $update = 0) {
|
|||
$drop = '';
|
||||
$dropping = false;
|
||||
|
||||
if(($item['contact-id'] == $_SESSION['visitor_id']) || ($item['uid'] == $_SESSION['uid']))
|
||||
if(($item['contact-id'] == remote_user()) || ($item['uid'] == local_user()))
|
||||
$dropping = true;
|
||||
|
||||
$drop = replace_macros((($dropping)? $droptpl : $fakedrop), array('$id' => $item['id']));
|
||||
|
||||
|
||||
$like = (($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']) : '');
|
||||
$like = ((isset($alike[$item['id']])) ? format_like($alike[$item['id']],$alike[$item['id'] . '-l'],'like',$item['id']) : '');
|
||||
$dislike = ((isset($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>' : '');
|
||||
$coord = (($item['coord']) ? '<a target="map" href="http://maps.google.com/?q=' . urlencode($item['coord']) . '">' . $item['coord'] . '</a>' : '');
|
||||
if($coord) {
|
||||
|
|
|
@ -157,6 +157,7 @@ function profiles_post(&$a) {
|
|||
|
||||
|
||||
function profiles_content(&$a) {
|
||||
$o = '';
|
||||
$o .= '<script> $(document).ready(function() { $(\'#nav-profiles-link\').addClass(\'nav-selected\'); });</script>';
|
||||
if(! local_user()) {
|
||||
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",
|
||||
intval($a->argv[1]),
|
||||
intval($_SESSION['uid'])
|
||||
|
|
|
@ -86,7 +86,8 @@ function pubsub_post(&$a) {
|
|||
|
||||
$xml = file_get_contents('php://input');
|
||||
|
||||
logger('pubsub: feed arrived from ' . $_SERVER['REMOTE_ADDR'] . ' for ' . $a->cmd . ':' . $xml);
|
||||
logger('pubsub: feed arrived from ' . $_SERVER['REMOTE_ADDR'] . ' for ' . $a->cmd );
|
||||
logger('pubsub: data: ' . $xml, $LOGGER_DATA);
|
||||
|
||||
$nick = (($a->argc > 1) ? notags(trim($a->argv[1])) : '');
|
||||
$contact_id = (($a->argc > 2) ? intval($a->argv[2]) : 0);
|
||||
|
|
|
@ -155,6 +155,7 @@ function settings_post(&$a) {
|
|||
if(! function_exists('settings_content')) {
|
||||
function settings_content(&$a) {
|
||||
|
||||
$o = '';
|
||||
$o .= '<script> $(document).ready(function() { $(\'#nav-settings-link\').addClass(\'nav-selected\'); });</script>';
|
||||
|
||||
if(! local_user()) {
|
||||
|
|
|
@ -92,4 +92,8 @@ function update_1011() {
|
|||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function update_1012() {
|
||||
q("ALTER TABLE `item` ADD `inform` MEDIUMTEXT NOT NULL AFTER `tag` ");
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
-- Run this with mysql or import into phpmyadmin if you installed mistpark between Sep22 and Oct 6 2010.
|
||||
-- The database schema was missing some updates
|
||||
|
||||
ALTER TABLE `item` DROP `like`, DROP `dislike` ;
|
||||
|
||||
ALTER TABLE `item` ADD `verb` CHAR( 255 ) NOT NULL AFTER `body` ,
|
||||
ADD `object-type` CHAR( 255 ) NOT NULL AFTER `verb` ,
|
||||
ADD `object` TEXT NOT NULL AFTER `object-type` ;
|
||||
|
||||
ALTER TABLE `intro` ADD `duplex` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `knowyou` ;
|
||||
ALTER TABLE `contact` ADD `duplex` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `rel` ;
|
||||
ALTER TABLE `contact` ADD `term-date` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `avatar-date`;
|
||||
|
|
@ -18,6 +18,9 @@ $a->strings[' other people'] = ' other people';
|
|||
$a->strings[' like this.'] = ' like this.';
|
||||
$a->strings[' don\'t like this.'] = ' don\'t like this.';
|
||||
$a->strings["Invite Friends"] = "Invite Friends";
|
||||
$a->strings['Connect/Follow [profile address]'] = 'Connect/Follow [profile address]';
|
||||
$a->strings['Example: bob@example.com, http://example.com/barbara'] = 'Example: bob@example.com, http://example.com/barbara';
|
||||
$a->strings['Follow'] = 'Follow';
|
||||
$a->strings['Could not access contact record.'] = 'Could not access contact record.';
|
||||
$a->strings['Could not locate selected profile.'] = 'Could not locate selected profile.';
|
||||
$a->strings['Contact updated.'] = 'Contact updated.';
|
||||
|
@ -46,13 +49,13 @@ $a->strings['Find'] = 'Find';
|
|||
$a->strings['Visit '] = 'Visit ';
|
||||
$a->strings['\'s profile'] = '\'s profile';
|
||||
$a->strings['Edit contact'] = 'Edit contact';
|
||||
$a->strings['Profile not found.'] = 'Profile not found.';
|
||||
$a->strings['Response from remote site was not understood.'] = 'Response from remote site was not understood.';
|
||||
$a->strings['Unexpected response from remote site: '] = 'Unexpected response from remote site: ';
|
||||
$a->strings["Confirmation completed successfully."] = "Confirmation completed successfully.";
|
||||
$a->strings['Remote site reported: '] = 'Remote site reported: ';
|
||||
$a->strings["Temporary failure. Please wait and try again."] = "Temporary failure. Please wait and try again.";
|
||||
$a->strings["Introduction failed or was revoked."] = "Introduction failed or was revoked.";
|
||||
$a->strings['Contact Photos'] = 'Contact Photos';
|
||||
$a->strings['Unable to set contact photo.'] = 'Unable to set contact photo.';
|
||||
$a->strings['No user record found for '] = 'No user record found for ';
|
||||
$a->strings['Our site encryption key is apparently messed up.'] = 'Our site encryption key is apparently messed up.';
|
||||
|
@ -81,6 +84,7 @@ $a->strings['Profile unavailable.'] = 'Profile unavailable.';
|
|||
$a->strings["Invalid locator"] = "Invalid locator";
|
||||
$a->strings["Unable to resolve your name at the provided location."] = "Unable to resolve your name at the provided location.";
|
||||
$a->strings['You have already introduced yourself here.'] = 'You have already introduced yourself here.';
|
||||
$a->strings['Apparently you are already friends with .'] = 'Apparently you are already friends with .';
|
||||
$a->strings['Invalid profile URL.'] = 'Invalid profile URL.';
|
||||
$a->strings['Disallowed profile URL.'] = 'Disallowed profile URL.';
|
||||
$a->strings['Your introduction has been sent.'] = 'Your introduction has been sent.';
|
||||
|
@ -92,6 +96,9 @@ $a->strings['Item not found.'] = 'Item not found.';
|
|||
$a->strings['Private Message'] = 'Private Message';
|
||||
$a->strings['This is you'] = 'This is you';
|
||||
$a->strings['Item has been removed.'] = 'Item has been removed.';
|
||||
$a->strings['The profile address specified does not provide adequate information.'] = 'The profile address specified does not provide adequate information.';
|
||||
$a->strings['Unable to retrieve contact information.'] = 'Unable to retrieve contact information.';
|
||||
$a->strings['following'] = 'following';
|
||||
$a->strings['Group created.'] = 'Group created.';
|
||||
$a->strings['Could not create group.'] = 'Could not create group.';
|
||||
$a->strings['Group not found.'] = 'Group not found.';
|
||||
|
@ -132,6 +139,7 @@ $a->strings['doesn\'t like'] = 'doesn\'t like';
|
|||
$a->strings['\'s'] = '\'s';
|
||||
$a->strings['Visible to:'] = 'Visible to:';
|
||||
$a->strings['No recipient selected.'] = 'No recipient selected.';
|
||||
$a->strings['[no subject]'] = '[no subject]';
|
||||
$a->strings['Unable to locate contact information.'] = 'Unable to locate contact information.';
|
||||
$a->strings['Message sent.'] = 'Message sent.';
|
||||
$a->strings['Message could not be sent.'] = 'Message could not be sent.';
|
||||
|
@ -159,10 +167,14 @@ $a->strings['Discard'] = 'Discard';
|
|||
$a->strings['Ignore'] = 'Ignore';
|
||||
$a->strings['Show Ignored Requests'] = 'Show Ignored Requests';
|
||||
$a->strings['Hide Ignored Requests'] = 'Hide Ignored Requests';
|
||||
$a->strings['Claims to be known to you: '] = 'Claims to be known to you: ';
|
||||
$a->strings['yes'] = 'yes';
|
||||
$a->strings['no'] = 'no';
|
||||
$a->strings['Friend/Connect Request'] = 'Friend/Connect Request';
|
||||
$a->strings['New Follower'] = 'New Follower';
|
||||
$a->strings['No notifications.'] = 'No notifications.';
|
||||
$a->strings['Photo Albums'] = 'Photo Albums';
|
||||
$a->strings['Contact Photos'] = 'Contact Photos';
|
||||
$a->strings['Profile Photos'] = 'Profile Photos';
|
||||
$a->strings['Album not found.'] = 'Album not found.';
|
||||
$a->strings['Delete Album'] = 'Delete Album';
|
||||
|
@ -181,9 +193,10 @@ $a->strings['View Photo'] = 'View Photo';
|
|||
$a->strings['Photo not available'] = 'Photo not available';
|
||||
$a->strings['Edit photo'] = 'Edit photo';
|
||||
$a->strings['View Full Size'] = 'View Full Size';
|
||||
$a->strings['In this photo: '] = 'In this photo: ';
|
||||
$a->strings['Tags: '] = 'Tags: ';
|
||||
$a->strings['Caption'] = 'Caption';
|
||||
$a->strings['Tags'] = 'Tags';
|
||||
$a->strings['Add a Tag'] = 'Add a Tag';
|
||||
$a->strings['Example: @bob, @Barbara_Jensen, @jim@example.com, #California, #camping'] = 'Example: @bob, @Barbara_Jensen, @jim@example.com, #California, #camping';
|
||||
$a->strings['Recent Photos'] = 'Recent Photos';
|
||||
$a->strings['Upload New Photos'] = 'Upload New Photos';
|
||||
$a->strings['View Album'] = 'View Album';
|
||||
|
@ -194,7 +207,6 @@ $a->strings['Image size reduction [80] failed.'] = 'Image size reduction [80] fa
|
|||
$a->strings['Unable to process image'] = 'Unable to process image';
|
||||
$a->strings['Image uploaded successfully.'] = 'Image uploaded successfully.';
|
||||
$a->strings['Image size reduction [640] failed.'] = 'Image size reduction [640] failed.';
|
||||
$a->strings['Profile not found.'] = 'Profile not found.';
|
||||
$a->strings['Profile Name is required.'] = 'Profile Name is required.';
|
||||
$a->strings['Profile updated.'] = 'Profile updated.';
|
||||
$a->strings['Profile deleted.'] = 'Profile deleted.';
|
||||
|
@ -210,7 +222,6 @@ $a->strings[' Name too short.'] = ' Name too short.';
|
|||
$a->strings[' That doesn\'t appear to be your full name.'] = ' That doesn\'t appear to be your full name.';
|
||||
$a->strings[' Not valid email.'] = ' Not valid email.';
|
||||
$a->strings[' Your email domain is not among those allowed on this site.'] = ' Your email domain is not among those allowed on this site.';
|
||||
$a->strings[' Your email address is already registered on this system.'] = ' Your email address is already registered on this system.';
|
||||
$a->strings[' Nickname <strong>must</strong> start with a letter and contain only letters, numbers, dashes, or underscore.'] = ' Nickname <strong>must</strong> start with a letter and contain only letters, numbers, dashes, or underscore.';
|
||||
$a->strings[' Nickname is already registered. Please choose another.'] = ' Nickname is already registered. Please choose another.';
|
||||
$a->strings['An error occurred during registration. Please try again.'] = 'An error occurred during registration. Please try again.';
|
||||
|
@ -229,9 +240,8 @@ $a->strings['Passwords do not match. Password unchanged.'] = 'Passwords do not m
|
|||
$a->strings['Empty passwords are not allowed. Password unchanged.'] = 'Empty passwords are not allowed. Password unchanged.';
|
||||
$a->strings['Password changed.'] = 'Password changed.';
|
||||
$a->strings['Password update failed. Please try again.'] = 'Password update failed. Please try again.';
|
||||
$a->strings[' This email address is already registered.'] = ' This email address is already registered.';
|
||||
$a->strings['Settings updated.'] = 'Settings updated.';
|
||||
$a->strings['Profile is not published.'] = 'Profile is not published.';
|
||||
$a->strings['Profile is <strong>not published</strong>.'] = 'Profile is <strong>not published</strong>.';
|
||||
$a->strings['Default Post Permissions'] = 'Default Post Permissions';
|
||||
$a->strings['View Contacts'] = 'View Contacts';
|
||||
$a->strings['No contacts.'] = 'No contacts.';
|
||||
|
|
|
@ -5,6 +5,11 @@
|
|||
|
||||
include 'boot.php';
|
||||
|
||||
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
|
||||
ini_set('display_errors', '1');
|
||||
ini_set('log_errors','0');
|
||||
|
||||
|
||||
$a = new App();
|
||||
|
||||
$files = glob('mod/*.php');
|
||||
|
|
|
@ -16,5 +16,6 @@
|
|||
<dfrn:comment-allow>$comment_allow</dfrn:comment-allow>
|
||||
<as:verb>$verb</as:verb>
|
||||
$actobj
|
||||
$mentioned
|
||||
</entry>
|
||||
|
||||
|
|
|
@ -23,5 +23,6 @@
|
|||
<dfrn:comment-allow>$comment_allow</dfrn:comment-allow>
|
||||
<as:verb>$verb</as:verb>
|
||||
$actobj
|
||||
$mentioned
|
||||
|
||||
</entry>
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
<!DOCTYPE html >
|
||||
<html>
|
||||
<head>
|
||||
<title><?php echo $page['title'] ?></title>
|
||||
<?php echo $page['htmlhead'] ?>
|
||||
<title><?php if(x($page,'title')) echo $page['title'] ?></title>
|
||||
<?php if(x($page,'htmlhead')) echo $page['htmlhead'] ?>
|
||||
</head>
|
||||
<body>
|
||||
<header><?php echo $page['header']; ?></header>
|
||||
<nav><div id="top-margin"></div><?php echo $page['nav']; ?></nav>
|
||||
<aside><?php echo $page['aside']; ?></aside>
|
||||
<section><?php echo $page['content']; ?>
|
||||
<header><?php if(x($page,'header')) echo $page['header']; ?></header>
|
||||
<nav><div id="top-margin"></div><?php if(x($page,'nav')) echo $page['nav']; ?></nav>
|
||||
<aside><?php if(x($page,'aside')) echo $page['aside']; ?></aside>
|
||||
<section><?php if(x($page,'content')) echo $page['content']; ?>
|
||||
<div id="page-footer"></div>
|
||||
</section>
|
||||
<footer><?php echo $page['footer']; ?></footer>
|
||||
<footer><?php if(x($page,'footer')) echo $page['footer']; ?></footer>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
|
||||
<div id="photo-edit-caption-end"></div>
|
||||
|
||||
<label id="photo-edit-tags-label" for="photo-edit-tags-textarea" >$tag_label</label>
|
||||
<textarea name="tags" id="photo-edit-tags-textarea" rows="3" cols="64" >$tags</textarea>
|
||||
<label id="photo-edit-tags-label" for="photo-edit-newtag" >$tag_label</label>
|
||||
<input name="newtag" id="photo-edit-newtag" size="84" title="$help_tags" type="text" />
|
||||
<div id="photo-edit-tags-end"></div>
|
||||
|
||||
<input id="photo-edit-submit-button" type="submit" name="submit" value="$submit" />
|
||||
|
|
|
@ -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 ?>
|
||||
<html>
|
||||
<head>
|
||||
<title><?php echo $page['title']; ?></title>
|
||||
<?php echo $page['htmlhead']; ?>
|
||||
<title><?php if(x($page,'title')) echo $page['title']; ?></title>
|
||||
<?php if(x($page,'htmlhead')) echo $page['htmlhead']; ?>
|
||||
</head>
|
||||
<body>
|
||||
<header><?php echo $page['header']; ?></header>
|
||||
<nav><div id="top-margin"></div><?php echo $page['nav']; ?></nav>
|
||||
<header><?php if(x($page,'header')) echo $page['header']; ?></header>
|
||||
<nav><div id="top-margin"></div><?php if(x($page,'nav')) echo $page['nav']; ?></nav>
|
||||
<aside>
|
||||
<?php if((is_array($profile)) && count($profile)) { ?>
|
||||
<div class="vcard">
|
||||
|
@ -57,17 +57,17 @@
|
|||
<?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>
|
||||
<?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>
|
||||
<?php } ?>
|
||||
<?php echo $page['aside'] ?>
|
||||
<?php if(x($page,'aside')) echo $page['aside'] ?>
|
||||
</aside>
|
||||
<section>
|
||||
<?php echo $page['content']; ?>
|
||||
<?php if(x($page,'content')) echo $page['content']; ?>
|
||||
<div id="page-footer"></div>
|
||||
</section>
|
||||
<footer>
|
||||
<?php echo $page['footer']; ?>
|
||||
<?php if(x($page,'footer')) echo $page['footer']; ?>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
|
||||
function gender_selector($current="",$suffix="") {
|
||||
$o = '';
|
||||
$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\" >";
|
||||
|
@ -14,6 +15,7 @@ function gender_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'));
|
||||
|
||||
$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="") {
|
||||
$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') );
|
||||
|
||||
$o .= "<select name=\"marital\" id=\"marital-select\" size=\"1\" >";
|
||||
|
|
30
view/tag_slap.tpl
Normal file
30
view/tag_slap.tpl
Normal file
|
@ -0,0 +1,30 @@
|
|||
<entry>
|
||||
<author>
|
||||
<name>$name</name>
|
||||
<uri>$profile_page</uri>
|
||||
<link rel="photo" type="image/jpeg" media:width="80" media:height="80" href="$thumb" />
|
||||
<link rel="avatar" type="image/jpeg" media:width="80" media:height="80" href="$thumb" />
|
||||
</author>
|
||||
|
||||
<id>$item_id</id>
|
||||
<title>$title</title>
|
||||
<published>$published</published>
|
||||
<content type="$type" >$content</content>
|
||||
<link rel="mentioned" href="$accturi" />
|
||||
<as:actor>
|
||||
<as:object-type>http://activitystrea.ms/schema/1.0/person</as:object-type>
|
||||
<id>$profile_page</id>
|
||||
<title></title>
|
||||
<link rel="avatar" type="image/jpeg" media:width="175" media:height="175" href="$photo"/>
|
||||
<link rel="avatar" type="image/jpeg" media:width="80" media:height="80" href="$thumb"/>
|
||||
<poco:preferredUsername>$nick</poco:preferredUsername>
|
||||
<poco:displayName>$name</poco:displayName>
|
||||
</as:actor>
|
||||
<as:verb>$verb</as:verb>
|
||||
<as:object>
|
||||
<as:object-type></as:object-type>
|
||||
</as:object>
|
||||
<as:target>
|
||||
<as:object-type></as:object-type>
|
||||
</as:target>
|
||||
</entry>
|
|
@ -1680,9 +1680,9 @@ a.mail-list-link:hover {
|
|||
float: left;
|
||||
width: 150px;
|
||||
}
|
||||
#photo-edit-caption, #photo-edit-tags-textarea {
|
||||
#photo-edit-caption, #photo-edit-newtag {
|
||||
float: left;
|
||||
margin-bottom: 15px;
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
|
||||
#photo-edit-caption-end, #photo-edit-tags-end {
|
||||
|
@ -1692,6 +1692,9 @@ a.mail-list-link:hover {
|
|||
#photo-edit-delete-button {
|
||||
margin-left: 200px;
|
||||
}
|
||||
#photo-edit-end {
|
||||
margin-bottom: 35px;
|
||||
}
|
||||
#photo-caption {
|
||||
font-size: 110%;
|
||||
font-weight: bold;
|
||||
|
|
Loading…
Reference in a new issue