*
* @param array $notes array of note arrays from db
* @return array Copy of input array with added properties
- *
+ *
* Set some extra properties to note array from db:
* - timestamp as int in default TZ
* - date_rel : relative date string
/**
* @brief List of pages for the Notifications TabBar
- *
- * @param app $a The
+ *
* @return array with with notifications TabBar data
*/
public function getTabs() {
/**
* @brief Format the notification query in an usable array
- *
+ *
* @param array $notifs The array from the db query
* @param string $ident The notifications identifier (e.g. network)
* @return array
}
/**
- * @brief Total number of network notifications
+ * @brief Total number of network notifications
* @param int|string $seen
* If 0 only include notifications into the query
* which aren't marked as "seen"
/**
* @brief Get network notifications
- *
+ *
* @param int|string $seen
* If 0 only include notifications into the query
* which aren't marked as "seen"
* @param int $start Start the query at this point
* @param int $limit Maximum number of query results
- *
+ *
* @return array with
* string 'ident' => Notification identifier
* int 'total' => Total number of available network notifications
}
/**
- * @brief Total number of system notifications
+ * @brief Total number of system notifications
* @param int|string $seen
* If 0 only include notifications into the query
* which aren't marked as "seen"
/**
* @brief Get system notifications
- *
+ *
* @param int|string $seen
* If 0 only include notifications into the query
* which aren't marked as "seen"
* @param int $start Start the query at this point
* @param int $limit Maximum number of query results
- *
+ *
* @return array with
* string 'ident' => Notification identifier
* int 'total' => Total number of available system notifications
/**
* @brief Addional SQL query string for the personal notifications
- *
+ *
* @return string The additional sql query
*/
private function _personal_sql_extra() {
}
/**
- * @brief Total number of personal notifications
+ * @brief Total number of personal notifications
* @param int|string $seen
* If 0 only include notifications into the query
* which aren't marked as "seen"
/**
* @brief Get personal notifications
- *
+ *
* @param int|string $seen
* If 0 only include notifications into the query
* which aren't marked as "seen"
* @param int $start Start the query at this point
* @param int $limit Maximum number of query results
- *
+ *
* @return array with
* string 'ident' => Notification identifier
* int 'total' => Total number of available personal notifications
$sql_seen = " AND `item`.`unseen` = 1 ";
$r = q("SELECT `item`.`id`,`item`.`parent`, `item`.`verb`, `item`.`author-name`, `item`.`unseen`,
- `item`.`author-link`, `item`.`author-avatar`, `item`.`created`, `item`.`object` AS `object`,
- `pitem`.`author-name` AS `pname`, `pitem`.`author-link` AS `plink`, `pitem`.`guid` AS `pguid`
+ `item`.`author-link`, `item`.`author-avatar`, `item`.`created`, `item`.`object` AS `object`,
+ `pitem`.`author-name` AS `pname`, `pitem`.`author-link` AS `plink`, `pitem`.`guid` AS `pguid`
FROM `item` INNER JOIN `item` AS `pitem` ON `pitem`.`id`=`item`.`parent`
WHERE `item`.`visible` = 1
$sql_extra
$sql_seen
- AND `item`.`deleted` = 0 AND `item`.`uid` = %d AND `item`.`wall` = 0
+ AND `item`.`deleted` = 0 AND `item`.`uid` = %d AND `item`.`wall` = 0
ORDER BY `item`.`created` DESC LIMIT %d, %d " ,
intval(local_user()),
intval($start),
if (dbm::is_result($r))
$notifs = $this->formatNotifs($r, $ident);
-
+
$arr = array (
'notifications' => $notifs,
'ident' => $ident,
}
/**
- * @brief Total number of home notifications
+ * @brief Total number of home notifications
* @param int|string $seen
* If 0 only include notifications into the query
* which aren't marked as "seen"
/**
* @brief Get home notifications
- *
+ *
* @param int|string $seen
* If 0 only include notifications into the query
* which aren't marked as "seen"
* @param int $start Start the query at this point
* @param int $limit Maximum number of query results
- *
+ *
* @return array with
* string 'ident' => Notification identifier
* int 'total' => Total number of available home notifications
}
/**
- * @brief Total number of introductions
+ * @brief Total number of introductions
* @param bool $all
* If false only include introductions into the query
* which aren't marked as ignored
/**
* @brief Get introductions
- *
+ *
* @param bool $all
* If false only include introductions into the query
* which aren't marked as ignored
* @param int $start Start the query at this point
* @param int $limit Maximum number of query results
- *
+ *
* @return array with
* string 'ident' => Notification identifier
* int 'total' => Total number of available introductions
/**
* @brief Format the notification query in an usable array
- *
+ *
* @param array $intros The array from the db query
* @return array with the introductions
*/
* @brief This file contains the Smilies class which contains functions to handle smiles
*/
+use Friendica\App;
+
/**
* This class contains functions to handle smiles
*/
/**
* @brief Function to list all smilies
- *
+ *
* Get an array of all smilies, both internal and from addons.
- *
+ *
* @return array
* 'texts' => smilie shortcut
* 'icons' => icon in html
- *
+ *
* @hook smilie ('texts' => smilies texts array, 'icons' => smilies html array)
*/
public static function get_list() {
);
$icons = array(
- '<img class="smiley" src="' . app::get_baseurl() . '/images/smiley-heart.gif" alt="<3" title="<3" />',
- '<img class="smiley" src="' . app::get_baseurl() . '/images/smiley-brokenheart.gif" alt="</3" title="</3" />',
- '<img class="smiley" src="' . app::get_baseurl() . '/images/smiley-brokenheart.gif" alt="<\\3" title="<\\3" />',
- '<img class="smiley" src="' . app::get_baseurl() . '/images/smiley-smile.gif" alt=":-)" title=":-)" />',
- '<img class="smiley" src="' . app::get_baseurl() . '/images/smiley-wink.gif" alt=";-)" title=";-)" />',
- '<img class="smiley" src="' . app::get_baseurl() . '/images/smiley-frown.gif" alt=":-(" title=":-(" />',
- '<img class="smiley" src="' . app::get_baseurl() . '/images/smiley-tongue-out.gif" alt=":-P" title=":-P" />',
- '<img class="smiley" src="' . app::get_baseurl() . '/images/smiley-tongue-out.gif" alt=":-p" title=":-P" />',
- '<img class="smiley" src="' . app::get_baseurl() . '/images/smiley-kiss.gif" alt=":-\" title=":-\" />',
- '<img class="smiley" src="' . app::get_baseurl() . '/images/smiley-kiss.gif" alt=":-\" title=":-\" />',
- '<img class="smiley" src="' . app::get_baseurl() . '/images/smiley-kiss.gif" alt=":-x" title=":-x" />',
- '<img class="smiley" src="' . app::get_baseurl() . '/images/smiley-kiss.gif" alt=":-X" title=":-X" />',
- '<img class="smiley" src="' . app::get_baseurl() . '/images/smiley-laughing.gif" alt=":-D" title=":-D" />',
- '<img class="smiley" src="' . app::get_baseurl() . '/images/smiley-surprised.gif" alt="8-|" title="8-|" />',
- '<img class="smiley" src="' . app::get_baseurl() . '/images/smiley-surprised.gif" alt="8-O" title="8-O" />',
- '<img class="smiley" src="' . app::get_baseurl() . '/images/smiley-surprised.gif" alt=":-O" title="8-O" />',
- '<img class="smiley" src="' . app::get_baseurl() . '/images/smiley-thumbsup.gif" alt="\\o/" title="\\o/" />',
- '<img class="smiley" src="' . app::get_baseurl() . '/images/smiley-Oo.gif" alt="o.O" title="o.O" />',
- '<img class="smiley" src="' . app::get_baseurl() . '/images/smiley-Oo.gif" alt="O.o" title="O.o" />',
- '<img class="smiley" src="' . app::get_baseurl() . '/images/smiley-Oo.gif" alt="o_O" title="o_O" />',
- '<img class="smiley" src="' . app::get_baseurl() . '/images/smiley-Oo.gif" alt="O_o" title="O_o" />',
- '<img class="smiley" src="' . app::get_baseurl() . '/images/smiley-cry.gif" alt=":\'(" title=":\'("/>',
- '<img class="smiley" src="' . app::get_baseurl() . '/images/smiley-foot-in-mouth.gif" alt=":-!" title=":-!" />',
- '<img class="smiley" src="' . app::get_baseurl() . '/images/smiley-undecided.gif" alt=":-/" title=":-/" />',
- '<img class="smiley" src="' . app::get_baseurl() . '/images/smiley-embarassed.gif" alt=":-[" title=":-[" />',
- '<img class="smiley" src="' . app::get_baseurl() . '/images/smiley-cool.gif" alt="8-)" title="8-)" />',
- '<img class="smiley" src="' . app::get_baseurl() . '/images/beer_mug.gif" alt=":beer" title=":beer" />',
- '<img class="smiley" src="' . app::get_baseurl() . '/images/beer_mug.gif" alt=":homebrew" title=":homebrew" />',
- '<img class="smiley" src="' . app::get_baseurl() . '/images/coffee.gif" alt=":coffee" title=":coffee" />',
- '<img class="smiley" src="' . app::get_baseurl() . '/images/smiley-facepalm.gif" alt=":facepalm" title=":facepalm" />',
- '<img class="smiley" src="' . app::get_baseurl() . '/images/like.gif" alt=":like" title=":like" />',
- '<img class="smiley" src="' . app::get_baseurl() . '/images/dislike.gif" alt=":dislike" title=":dislike" />',
- '<a href="http://friendica.com">~friendica <img class="smiley" src="' . app::get_baseurl() . '/images/friendica-16.png" alt="~friendica" title="~friendica" /></a>',
- '<a href="http://redmatrix.me/">red<img class="smiley" src="' . app::get_baseurl() . '/images/rm-16.png" alt="red#" title="red#" />matrix</a>',
- '<a href="http://redmatrix.me/">red<img class="smiley" src="' . app::get_baseurl() . '/images/rm-16.png" alt="red#matrix" title="red#matrix" />matrix</a>'
+ '<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-heart.gif" alt="<3" title="<3" />',
+ '<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-brokenheart.gif" alt="</3" title="</3" />',
+ '<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-brokenheart.gif" alt="<\\3" title="<\\3" />',
+ '<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-smile.gif" alt=":-)" title=":-)" />',
+ '<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-wink.gif" alt=";-)" title=";-)" />',
+ '<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-frown.gif" alt=":-(" title=":-(" />',
+ '<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-tongue-out.gif" alt=":-P" title=":-P" />',
+ '<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-tongue-out.gif" alt=":-p" title=":-P" />',
+ '<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-kiss.gif" alt=":-\" title=":-\" />',
+ '<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-kiss.gif" alt=":-\" title=":-\" />',
+ '<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-kiss.gif" alt=":-x" title=":-x" />',
+ '<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-kiss.gif" alt=":-X" title=":-X" />',
+ '<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-laughing.gif" alt=":-D" title=":-D" />',
+ '<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-surprised.gif" alt="8-|" title="8-|" />',
+ '<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-surprised.gif" alt="8-O" title="8-O" />',
+ '<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-surprised.gif" alt=":-O" title="8-O" />',
+ '<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-thumbsup.gif" alt="\\o/" title="\\o/" />',
+ '<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-Oo.gif" alt="o.O" title="o.O" />',
+ '<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-Oo.gif" alt="O.o" title="O.o" />',
+ '<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-Oo.gif" alt="o_O" title="o_O" />',
+ '<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-Oo.gif" alt="O_o" title="O_o" />',
+ '<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-cry.gif" alt=":\'(" title=":\'("/>',
+ '<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-foot-in-mouth.gif" alt=":-!" title=":-!" />',
+ '<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-undecided.gif" alt=":-/" title=":-/" />',
+ '<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-embarassed.gif" alt=":-[" title=":-[" />',
+ '<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-cool.gif" alt="8-)" title="8-)" />',
+ '<img class="smiley" src="' . App::get_baseurl() . '/images/beer_mug.gif" alt=":beer" title=":beer" />',
+ '<img class="smiley" src="' . App::get_baseurl() . '/images/beer_mug.gif" alt=":homebrew" title=":homebrew" />',
+ '<img class="smiley" src="' . App::get_baseurl() . '/images/coffee.gif" alt=":coffee" title=":coffee" />',
+ '<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-facepalm.gif" alt=":facepalm" title=":facepalm" />',
+ '<img class="smiley" src="' . App::get_baseurl() . '/images/like.gif" alt=":like" title=":like" />',
+ '<img class="smiley" src="' . App::get_baseurl() . '/images/dislike.gif" alt=":dislike" title=":dislike" />',
+ '<a href="http://friendica.com">~friendica <img class="smiley" src="' . App::get_baseurl() . '/images/friendica-16.png" alt="~friendica" title="~friendica" /></a>',
+ '<a href="http://redmatrix.me/">red<img class="smiley" src="' . App::get_baseurl() . '/images/rm-16.png" alt="red#" title="red#" />matrix</a>',
+ '<a href="http://redmatrix.me/">red<img class="smiley" src="' . App::get_baseurl() . '/images/rm-16.png" alt="red#matrix" title="red#matrix" />matrix</a>'
);
$params = array('texts' => $texts, 'icons' => $icons);
*
* @param string $s
* @param boolean $sample
- *
+ *
* @return string HML Output of the Smilie
*/
public static function replace($s, $sample = false) {
*
* @param string $x
* @return string HTML Output
- *
+ *
* @todo: Rework because it doesn't work correctly
*/
private function preg_heart($x) {
return $x[0];
$t = '';
for($cnt = 0; $cnt < strlen($x[1]); $cnt ++)
- $t .= '<img class="smiley" src="' . app::get_baseurl() . '/images/smiley-heart.gif" alt="<3" />';
+ $t .= '<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-heart.gif" alt="<3" />';
$r = str_replace($x[0],$t,$x[0]);
return $r;
}
$ext = Photo::supportedTypes();
foreach ($rp as $p) {
- $photos[$p['scale']] = app::get_baseurl().'/photo/'.$p['resource-id'].'-'.$p['scale'].'.'.$ext[$p['type']];
+ $photos[$p['scale']] = App::get_baseurl().'/photo/'.$p['resource-id'].'-'.$p['scale'].'.'.$ext[$p['type']];
}
unset($rp, $ext);
$root->setAttribute("xmlns:ostatus", NAMESPACE_OSTATUS);
$root->setAttribute("xmlns:statusnet", NAMESPACE_STATUSNET);
- xml::add_element($doc, $root, "id", app::get_baseurl()."/profile/".$owner["nick"]);
+ xml::add_element($doc, $root, "id", App::get_baseurl()."/profile/".$owner["nick"]);
xml::add_element($doc, $root, "title", $owner["name"]);
$attributes = array("uri" => "https://friendi.ca", "version" => FRIENDICA_VERSION."-".DB_UPDATE_VERSION);
// DFRN itself doesn't uses this. But maybe someone else wants to subscribe to the public feed.
ostatus::hublinks($doc, $root);
- $attributes = array("rel" => "salmon", "href" => app::get_baseurl()."/salmon/".$owner["nick"]);
+ $attributes = array("rel" => "salmon", "href" => App::get_baseurl()."/salmon/".$owner["nick"]);
xml::add_element($doc, $root, "link", "", $attributes);
- $attributes = array("rel" => "http://salmon-protocol.org/ns/salmon-replies", "href" => app::get_baseurl()."/salmon/".$owner["nick"]);
+ $attributes = array("rel" => "http://salmon-protocol.org/ns/salmon-replies", "href" => App::get_baseurl()."/salmon/".$owner["nick"]);
xml::add_element($doc, $root, "link", "", $attributes);
- $attributes = array("rel" => "http://salmon-protocol.org/ns/salmon-mention", "href" => app::get_baseurl()."/salmon/".$owner["nick"]);
+ $attributes = array("rel" => "http://salmon-protocol.org/ns/salmon-mention", "href" => App::get_baseurl()."/salmon/".$owner["nick"]);
xml::add_element($doc, $root, "link", "", $attributes);
}
}
xml::add_element($doc, $author, "name", $owner["name"], $attributes);
- xml::add_element($doc, $author, "uri", app::get_baseurl().'/profile/'.$owner["nickname"], $attributes);
+ xml::add_element($doc, $author, "uri", App::get_baseurl().'/profile/'.$owner["nickname"], $attributes);
xml::add_element($doc, $author, "dfrn:handle", $owner["addr"], $attributes);
$attributes = array("rel" => "photo", "type" => "image/jpeg",
$parent = q("SELECT `guid` FROM `item` WHERE `id` = %d", intval($item["parent"]));
$parent_item = (($item['thr-parent']) ? $item['thr-parent'] : $item['parent-uri']);
$attributes = array("ref" => $parent_item, "type" => "text/html",
- "href" => app::get_baseurl().'/display/'.$parent[0]['guid'],
+ "href" => App::get_baseurl().'/display/'.$parent[0]['guid'],
"dfrn:diaspora_guid" => $parent[0]['guid']);
xml::add_element($doc, $entry, "thr:in-reply-to", "", $attributes);
}
// We save this value in "plink". Maybe we should read it from there as well?
xml::add_element($doc, $entry, "link", "", array("rel" => "alternate", "type" => "text/html",
- "href" => app::get_baseurl()."/display/".$item["guid"]));
+ "href" => App::get_baseurl()."/display/".$item["guid"]));
// "comment-allow" is some old fashioned stuff for old Friendica versions.
// It is included in the rewritten code for completeness
xml::add_element($doc, $entry, "dfrn:bookmark", "true");
}
- if ($item['app']) {
- xml::add_element($doc, $entry, "statusnet:notice_info", "", array("local_id" => $item['id'], "source" => $item['app']));
+ if ($item['App']) {
+ xml::add_element($doc, $entry, "statusnet:notice_info", "", array("local_id" => $item['id'], "source" => $item['App']));
}
xml::add_element($doc, $entry, "dfrn:diaspora_guid", $item["guid"]);
if ($notice_info AND ($notice_info->length > 0)) {
foreach ($notice_info->item(0)->attributes AS $attributes) {
if ($attributes->name == "source") {
- $item["app"] = strip_tags($attributes->textContent);
+ $item["App"] = strip_tags($attributes->textContent);
}
}
}
/**
* @brief Creates the XML feed for a given nickname
*
- * @param app $a The application class
+ * @param App $a The application class
* @param string $owner_nick Nickname of the feed owner
* @param string $last_update Date of the last update
*
'$no' => t('No'),
));
- //echo "<pre>"; var_dump($app); killme();
-
return $o;
}
*
* Available Pages are 'Status', 'Profile', 'Contacts' and 'Common Friends'
*
- * @param app $a
+ * @param App $a
* @param int $contact_id The ID of the contact
* @param int $active_tab 1 if tab should be marked as active
*
/**
* @brief Get the network tabs menu
*
- * @param app $a The global App
+ * @param App $a The global App
* @return string Html of the networktab
*/
function network_tabs(App $a) {
q('START TRANSACTION');\r
\r
$r = q('SELECT `pid` FROM `process` WHERE `pid` = %d', intval(getmypid()));\r
- if (!dbm::is_result($r)) {\r
+ if (!\dbm::is_result($r)) {\r
q("INSERT INTO `process` (`pid`,`command`,`created`) VALUES (%d, '%s', '%s')", intval(getmypid()), dbesc($command), dbesc(datetime_convert()));\r
}\r
q('COMMIT');\r
q('START TRANSACTION');\r
\r
$r = q('SELECT `pid` FROM `process`');\r
- if (dbm::is_result($r)) {\r
+ if (\dbm::is_result($r)) {\r
foreach ($r AS $process) {\r
if (!posix_kill($process['pid'], 0)) {\r
q('DELETE FROM `process` WHERE `pid` = %d', intval($process['pid']));\r
}\r
}\r
\r
- $processlist = dbm::processlist();\r
+ $processlist = \dbm::processlist();\r
if ($processlist['list'] != '') {\r
logger('Processcheck: Processes: ' . $processlist['amount'] . ' - Processlist: ' . $processlist['list'], LOGGER_DEBUG);\r
\r
// If the last worker fork was less than 10 seconds before then don't fork another one.\r
// This should prevent the forking of masses of workers.\r
$cachekey = 'app:proc_run:started';\r
- $result = Cache::get($cachekey);\r
+ $result = \Cache::get($cachekey);\r
\r
if (!is_null($result) AND ( time() - $result) < 10) {\r
return;\r
}\r
\r
// Set the timestamp of the last proc_run\r
- Cache::set($cachekey, time(), CACHE_MINUTE);\r
+ \Cache::set($cachekey, time(), CACHE_MINUTE);\r
\r
array_unshift($args, ((x($this->config, 'php_path')) && (strlen($this->config['php_path'])) ? $this->config['php_path'] : 'php'));\r
\r
* Additionally the profile, status and photo page links will be changed
* to don't open in a new tab if the contact is a friendica contact.
*
- * @param app $a The app data
+ * @param App $a The app data
* @param array $args Contains contact data and the original photo_menu
*/
function frio_contact_photo_menu(App $a, &$args){
* Some links will point to the local pages because the user would expect
* local page (these pages are: search, community, help, apps, directory).
*
- * @param app $a The App class
+ * @param App $a The App class
* @param array $nav The original nav menu
*/
function frio_remote_nav($a,&$nav) {
* @param App $a The app data @TODO Unused
* @param array $results The array with the originals from acl_lookup()
*/
-function frio_acl_lookup($a, &$results) {
+function frio_acl_lookup(App $a, &$results) {
require_once("mod/contacts.php");
$nets = ((x($_GET,"nets")) ? notags(trim($_GET["nets"])) : "");