.htconfig.php and make it writable by the web server.
5. Visit your website with a web browser and follow the instructions. Please
-note any error messages and correct these before continuing. If you are using
-SSL with a known signature authority (recommended), use the https: link to your
-website. If you are using a self-signed cert or no cert, use the http: link.
+note any error messages and correct these before continuing.
+
+If you are using SSL with a known signature authority (recommended), use the
+https: link to your website. If you are using a self-signed cert or no cert,
+use the http: link.
+
+If you need to specify a port for the connection to the database, you can do
+so in the host name setting for the database.
6. *If* the automated installation fails for any reason, check the following:
Point your web browser to the new site and follow the instructions.
Please note any error messages and correct these before continuing.
+If you need to specify a port for the connection to the database, you can do so in the host name setting for the database.
+
*If* the automated installation fails for any reason, check the following:
* Does ".htconfig.php" exist? If not, edit htconfig.php and change the system settings. Rename to .htconfig.php
If you want to have a more personalized closing line for the notification emails you can set a variable for the admin_name.
$a->config['admin_name'] = "Marvin";
+
+## Database Settings
+
+The configuration variables db_host, db_user, db_pass and db_data are holding your credentials for the database connection.
+If you need to specify a port to access the database, you can do so by appending ":portnumber" to the db_host variable.
+
+ $db_host = 'your.mysqlhost.com:123456';
}
function construct_acl_data(App $a, $user) {
+ // This function is now deactivated. It seems as if the generated data isn't used anywhere.
+ /// @todo Remove this function and all function calls before releasing Friendica 3.5.3
+ return;
// Get group and contact information for html ACL selector
$acl_data = acl_lookup($a, 'html');
return $atom;
}
+ /**
+ * @brief Generate an atom entry for a given item id
+ *
+ * @param int $item_id The item id
+ *
+ * @return string DFRN feed entry
+ */
+ public static function itemFeed($item_id) {
+ $r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
+ `contact`.`name`, `contact`.`network`, `contact`.`photo`, `contact`.`url`,
+ `contact`.`name-date`, `contact`.`uri-date`, `contact`.`avatar-date`,
+ `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
+ `sign`.`signed_text`, `sign`.`signature`, `sign`.`signer`
+ FROM `item`
+ STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
+ AND (NOT `contact`.`blocked` OR `contact`.`pending`)
+ LEFT JOIN `sign` ON `sign`.`iid` = `item`.`id`
+ WHERE `item`.`id` = %d AND `item`.`visible` AND NOT `item`.`moderated` AND `item`.`parent` != 0
+ AND `item`.`wall` AND NOT `item`.`private`",
+ intval($item_id)
+ );
+
+ if (!dbm::is_result($r)) {
+ killme();
+ }
+
+ $item = $r[0];
+
+ $r = q("SELECT `contact`.*, `user`.`nickname`, `user`.`timezone`, `user`.`page-flags`, `user`.`account-type`
+ FROM `contact` INNER JOIN `user` ON `user`.`uid` = `contact`.`uid`
+ WHERE `contact`.`self` AND `user`.`uid` = %d LIMIT 1",
+ intval($item['uid'])
+ );
+
+ if (!dbm::is_result($r)) {
+ killme();
+ }
+
+ $owner = $r[0];
+
+ $doc = new DOMDocument('1.0', 'utf-8');
+ $doc->formatOutput = true;
+
+ $alternatelink = $owner['url'];
+
+ $root = self::add_header($doc, $owner, 'dfrn:owner', $alternatelink, true);
+
+ $type = 'html';
+
+ $entry = self::entry($doc, $type, $item, $owner, true);
+ $root->appendChild($entry);
+
+ $atom = trim($doc->saveXML());
+ return $atom;
+ }
+
/**
* @brief Create XML text for DFRN mails
*
use Friendica\App;
+require_once('include/dfrn.php');
+
function display_init(App $a) {
if ((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
$nick = (($a->argc > 1) ? $a->argv[1] : '');
$profiledata = array();
+ if ($a->argc == 3) {
+ if (substr($a->argv[2], -5) == '.atom') {
+ $item_id = substr($a->argv[2], 0, -5);
+ $xml = dfrn::itemFeed($item_id);
+ header("Content-type: application/atom+xml");
+ echo $xml;
+ http_status_exit(($xml) ? 200 : 500);
+ }
+ }
+
// If there is only one parameter, then check if this parameter could be a guid
if ($a->argc == 2) {
$nick = "";
$o = '';
- $a->page['htmlhead'] .= replace_macros(get_markup_template('display-head.tpl'), array());
-
-
if ($update) {
$nick = $_REQUEST['nick'];
} else {
return;
}
+ // We are displaying an "alternate" link if that post was public. See issue 2864
+ $items = q("SELECT `id` FROM `item` WHERE `id` = %d AND NOT `private` AND `wall`", intval($item_id));
+ if (dbm::is_result($items)) {
+ $alternate = App::get_baseurl().'/display/'.$nick.'/'.$item_id.'.atom';
+ } else {
+ $alternate = '';
+ }
+
+ $a->page['htmlhead'] .= replace_macros(get_markup_template('display-head.tpl'),
+ array('$alternate' => $alternate));
$groups = array();
-
+{{if $alternate}}<link href='{{$alternate}}' rel='alternate' type='application/atom+xml'>{{/if}}
<script>
$(document).ready(function() {
$(".comment-edit-wrapper textarea").editor_autocomplete(baseurl+"/acl");
$(".wall-item-comment-wrapper textarea").editor_autocomplete(baseurl+"/acl");
});
</script>
-
<?php
/* ********************************************************************
- * The following configuration has to be within the .htconfig file
- * and will not be overruled by decisions made in the admin panel.
+ * The following configuration has to be within the .htconfig.php
+ * file and will not be overruled by decisions made in the admin panel.
*
* See below for variables that may be overruled by the admin panel.
* ********************************************************************/
// Set the following for your MySQL installation
-// Copy or rename this file to .htconfig.php
+//
+// If you need to specify a port for reacing the database, you can do so by
+// adding ":portnumber" after "your.mysqlhost.com" in the $db_host config.
$db_host = '{{$dbhost}}';
$db_user = '{{$dbuser}}';