Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

518 lines
18 KiB

  1. <?php
  2. function display_init(&$a) {
  3. if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
  4. return;
  5. }
  6. $nick = (($a->argc > 1) ? $a->argv[1] : '');
  7. $profiledata = array();
  8. // If there is only one parameter, then check if this parameter could be a guid
  9. if ($a->argc == 2) {
  10. $nick = "";
  11. $itemuid = 0;
  12. // Does the local user have this item?
  13. if (local_user()) {
  14. $r = q("SELECT `id`, `parent`, `author-name`, `author-link`, `author-avatar`, `network`, `body`, `uid` FROM `item`
  15. WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0
  16. AND `guid` = '%s' AND `uid` = %d", dbesc($a->argv[1]), local_user());
  17. if (count($r)) {
  18. $nick = $a->user["nickname"];
  19. $itemuid = local_user();
  20. }
  21. }
  22. // Or is it anywhere on the server?
  23. if ($nick == "") {
  24. $r = q("SELECT `user`.`nickname`, `item`.`id`, `item`.`parent`, `item`.`author-name`,
  25. `item`.`author-link`, `item`.`author-avatar`, `item`.`network`, `item`.`uid`, `item`.`body`
  26. FROM `item` INNER JOIN `user` ON `user`.`uid` = `item`.`uid`
  27. WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0
  28. AND `item`.`allow_cid` = '' AND `item`.`allow_gid` = ''
  29. AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = ''
  30. AND `item`.`private` = 0 AND NOT `user`.`hidewall`
  31. AND `item`.`guid` = '%s'", dbesc($a->argv[1]));
  32. // AND `item`.`private` = 0 AND `item`.`wall` = 1
  33. if (count($r)) {
  34. $nick = $r[0]["nickname"];
  35. $itemuid = $r[0]["uid"];
  36. }
  37. }
  38. // Is it an item with uid=0?
  39. if ($nick == "") {
  40. $r = q("SELECT `item`.`id`, `item`.`parent`, `item`.`author-name`,
  41. `item`.`author-link`, `item`.`author-avatar`, `item`.`network`, `item`.`uid`, `item`.`body`
  42. FROM `item` WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0
  43. AND `item`.`allow_cid` = '' AND `item`.`allow_gid` = ''
  44. AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = ''
  45. AND `item`.`private` = 0 AND `item`.`uid` = 0
  46. AND `item`.`guid` = '%s'", dbesc($a->argv[1]));
  47. // AND `item`.`private` = 0 AND `item`.`wall` = 1
  48. }
  49. if (count($r)) {
  50. if ($r[0]["id"] != $r[0]["parent"])
  51. $r = q("SELECT `id`, `author-name`, `author-link`, `author-avatar`, `network`, `body`, `uid` FROM `item`
  52. WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0
  53. AND `id` = %d", $r[0]["parent"]);
  54. $profiledata = display_fetchauthor($a, $r[0]);
  55. if (strstr(normalise_link($profiledata["url"]), normalise_link($a->get_baseurl()))) {
  56. $nickname = str_replace(normalise_link($a->get_baseurl())."/profile/", "", normalise_link($profiledata["url"]));
  57. if (($nickname != $a->user["nickname"])) {
  58. $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile`
  59. INNER JOIN `contact` on `contact`.`uid` = `profile`.`uid` INNER JOIN `user` ON `profile`.`uid` = `user`.`uid`
  60. WHERE `user`.`nickname` = '%s' AND `profile`.`is-default` = 1 and `contact`.`self` = 1 LIMIT 1",
  61. dbesc($nickname)
  62. );
  63. if (count($r))
  64. $profiledata = $r[0];
  65. $profiledata["network"] = NETWORK_DFRN;
  66. } else
  67. $profiledata = array();
  68. }
  69. } else {
  70. $a->error = 404;
  71. notice( t('Item not found.') . EOL);
  72. return;
  73. }
  74. }
  75. profile_load($a, $nick, 0, $profiledata);
  76. }
  77. function display_fetchauthor($a, $item) {
  78. require_once("mod/proxy.php");
  79. require_once("include/bbcode.php");
  80. $profiledata = array();
  81. $profiledata["uid"] = -1;
  82. $profiledata["nickname"] = $item["author-name"];
  83. $profiledata["name"] = $item["author-name"];
  84. $profiledata["picdate"] = "";
  85. $profiledata["photo"] = proxy_url($item["author-avatar"]);
  86. $profiledata["url"] = $item["author-link"];
  87. $profiledata["network"] = $item["network"];
  88. // Fetching further contact data from the contact table
  89. $r = q("SELECT `photo`, `nick`, `location`, `about` FROM `contact` WHERE `nurl` = '%s' AND `uid` = %d AND `network` = '%s'",
  90. dbesc(normalise_link($profiledata["url"])), intval($item["uid"]), dbesc($item["network"]));
  91. if (!count($r))
  92. $r = q("SELECT `photo`, `nick`, `location`, `about` FROM `contact` WHERE `nurl` = '%s' AND `uid` = %d",
  93. dbesc(normalise_link($profiledata["url"])), intval($item["uid"]));
  94. if (!count($r))
  95. $r = q("SELECT `photo`, `nick`, `location`, `about` FROM `contact` WHERE `nurl` = '%s' AND `uid` = 0",
  96. dbesc(normalise_link($profiledata["url"])));
  97. if (count($r)) {
  98. $profiledata["photo"] = proxy_url($r[0]["photo"]);
  99. $profiledata["address"] = proxy_parse_html(bbcode($r[0]["location"]));
  100. $profiledata["about"] = proxy_parse_html(bbcode($r[0]["about"]));
  101. if ($r[0]["nick"] != "")
  102. $profiledata["nickname"] = $r[0]["nick"];
  103. }
  104. // Fetching profile data from unique contacts
  105. $r = q("SELECT `avatar`, `nick`, `location`, `about` FROM `unique_contacts` WHERE `url` = '%s'", dbesc(normalise_link($profiledata["url"])));
  106. if (count($r)) {
  107. if ($profiledata["photo"] == "")
  108. $profiledata["photo"] = proxy_url($r[0]["avatar"]);
  109. if ($profiledata["address"] == "")
  110. $profiledata["address"] = proxy_parse_html(bbcode($r[0]["location"]));
  111. if ($profiledata["about"] == "")
  112. $profiledata["about"] = proxy_parse_html(bbcode($r[0]["about"]));
  113. if (($profiledata["nickname"] == "") AND ($r[0]["nick"] != ""))
  114. $profiledata["nickname"] = $r[0]["nick"];
  115. }
  116. // Check for a repeated message
  117. $skip = false;
  118. $body = trim($item["body"]);
  119. // Skip if it isn't a pure repeated messages
  120. // Does it start with a share?
  121. if (!$skip AND strpos($body, "[share") > 0)
  122. $skip = true;
  123. // Does it end with a share?
  124. if (!$skip AND (strlen($body) > (strrpos($body, "[/share]") + 8)))
  125. $skip = true;
  126. if (!$skip) {
  127. $attributes = preg_replace("/\[share(.*?)\]\s?(.*?)\s?\[\/share\]\s?/ism","$1",$body);
  128. // Skip if there is no shared message in there
  129. if ($body == $attributes)
  130. $skip = true;
  131. }
  132. if (!$skip) {
  133. $author = "";
  134. preg_match("/author='(.*?)'/ism", $attributes, $matches);
  135. if ($matches[1] != "")
  136. $profiledata["name"] = html_entity_decode($matches[1],ENT_QUOTES,'UTF-8');
  137. preg_match('/author="(.*?)"/ism', $attributes, $matches);
  138. if ($matches[1] != "")
  139. $profiledata["name"] = html_entity_decode($matches[1],ENT_QUOTES,'UTF-8');
  140. $profile = "";
  141. preg_match("/profile='(.*?)'/ism", $attributes, $matches);
  142. if ($matches[1] != "")
  143. $profiledata["url"] = $matches[1];
  144. preg_match('/profile="(.*?)"/ism', $attributes, $matches);
  145. if ($matches[1] != "")
  146. $profiledata["url"] = $matches[1];
  147. $avatar = "";
  148. preg_match("/avatar='(.*?)'/ism", $attributes, $matches);
  149. if ($matches[1] != "")
  150. $profiledata["photo"] = $matches[1];
  151. preg_match('/avatar="(.*?)"/ism', $attributes, $matches);
  152. if ($matches[1] != "")
  153. $profiledata["photo"] = $matches[1];
  154. $profiledata["nickname"] = $profiledata["name"];
  155. $profiledata["network"] = GetProfileUsername($profiledata["url"], "", false, true);
  156. $profiledata["address"] = "";
  157. $profiledata["about"] = "";
  158. // Fetching profile data from unique contacts
  159. if ($profiledata["url"] != "") {
  160. $r = q("SELECT `avatar`, `nick`, `location`, `about` FROM `unique_contacts` WHERE `url` = '%s'", dbesc(normalise_link($profiledata["url"])));
  161. if (count($r)) {
  162. $profiledata["photo"] = proxy_url($r[0]["avatar"]);
  163. $profiledata["address"] = proxy_parse_html(bbcode($r[0]["location"]));
  164. $profiledata["about"] = proxy_parse_html(bbcode($r[0]["about"]));
  165. if ($r[0]["nick"] != "")
  166. $profiledata["nickname"] = $r[0]["nick"];
  167. }
  168. }
  169. }
  170. if (local_user()) {
  171. if (in_array($profiledata["network"], array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS)))
  172. $profiledata["remoteconnect"] = $a->get_baseurl()."/follow?url=".urlencode($profiledata["url"]);
  173. //if ($profiledata["network"] == NETWORK_DFRN) {
  174. // $connect = str_replace("/profile/", "/dfrn_request/", $profiledata["url"])."&addr=".bin2hex($a->get_baseurl()."/profile/".$a->user["nickname"]);
  175. // $profiledata["remoteconnect"] = $connect;
  176. //} elseif ($profiledata["network"] == NETWORK_DIASPORA)
  177. // $profiledata["remoteconnect"] = $a->get_baseurl()."/contacts?add=".GetProfileUsername($profiledata["url"], "", true);
  178. } elseif ($profiledata["network"] == NETWORK_DFRN) {
  179. $connect = str_replace("/profile/", "/dfrn_request/", $profiledata["url"]);
  180. $profiledata["remoteconnect"] = $connect;
  181. }
  182. return($profiledata);
  183. }
  184. function display_content(&$a, $update = 0) {
  185. if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
  186. notice( t('Public access denied.') . EOL);
  187. return;
  188. }
  189. require_once("include/bbcode.php");
  190. require_once('include/security.php');
  191. require_once('include/conversation.php');
  192. require_once('include/acl_selectors.php');
  193. $o = '';
  194. $a->page['htmlhead'] .= replace_macros(get_markup_template('display-head.tpl'), array());
  195. if($update) {
  196. $nick = $_REQUEST['nick'];
  197. }
  198. else {
  199. $nick = (($a->argc > 1) ? $a->argv[1] : '');
  200. }
  201. if($update) {
  202. $item_id = $_REQUEST['item_id'];
  203. $a->profile = array('uid' => intval($update), 'profile_uid' => intval($update));
  204. }
  205. else {
  206. $item_id = (($a->argc > 2) ? $a->argv[2] : 0);
  207. if ($a->argc == 2) {
  208. $nick = "";
  209. if (local_user()) {
  210. $r = q("SELECT `id` FROM `item`
  211. WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0
  212. AND `guid` = '%s' AND `uid` = %d", dbesc($a->argv[1]), local_user());
  213. if (count($r)) {
  214. $item_id = $r[0]["id"];
  215. $nick = $a->user["nickname"];
  216. }
  217. }
  218. if ($nick == "") {
  219. $r = q("SELECT `user`.`nickname`, `item`.`id` FROM `item` INNER JOIN `user` ON `user`.`uid` = `item`.`uid`
  220. WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0
  221. AND `item`.`allow_cid` = '' AND `item`.`allow_gid` = ''
  222. AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = ''
  223. AND `item`.`private` = 0 AND NOT `user`.`hidewall`
  224. AND `item`.`guid` = '%s'", dbesc($a->argv[1]));
  225. // AND `item`.`private` = 0 AND `item`.`wall` = 1
  226. if (count($r)) {
  227. $item_id = $r[0]["id"];
  228. $nick = $r[0]["nickname"];
  229. }
  230. }
  231. if ($nick == "") {
  232. $r = q("SELECT `item`.`id` FROM `item`
  233. WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0
  234. AND `item`.`allow_cid` = '' AND `item`.`allow_gid` = ''
  235. AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = ''
  236. AND `item`.`private` = 0 AND `item`.`uid` = 0
  237. AND `item`.`guid` = '%s'", dbesc($a->argv[1]));
  238. // AND `item`.`private` = 0 AND `item`.`wall` = 1
  239. if (count($r)) {
  240. $item_id = $r[0]["id"];
  241. }
  242. }
  243. }
  244. }
  245. if(! $item_id) {
  246. $a->error = 404;
  247. notice( t('Item not found.') . EOL);
  248. return;
  249. }
  250. $groups = array();
  251. $contact = null;
  252. $remote_contact = false;
  253. $contact_id = 0;
  254. if(is_array($_SESSION['remote'])) {
  255. foreach($_SESSION['remote'] as $v) {
  256. if($v['uid'] == $a->profile['uid']) {
  257. $contact_id = $v['cid'];
  258. break;
  259. }
  260. }
  261. }
  262. if($contact_id) {
  263. $groups = init_groups_visitor($contact_id);
  264. $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
  265. intval($contact_id),
  266. intval($a->profile['uid'])
  267. );
  268. if(count($r)) {
  269. $contact = $r[0];
  270. $remote_contact = true;
  271. }
  272. }
  273. if(! $remote_contact) {
  274. if(local_user()) {
  275. $contact_id = $_SESSION['cid'];
  276. $contact = $a->contact;
  277. }
  278. }
  279. $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 1 LIMIT 1",
  280. intval($a->profile['uid'])
  281. );
  282. if(count($r))
  283. $a->page_contact = $r[0];
  284. $is_owner = ((local_user()) && (local_user() == $a->profile['profile_uid']) ? true : false);
  285. if($a->profile['hidewall'] && (! $is_owner) && (! $remote_contact)) {
  286. notice( t('Access to this profile has been restricted.') . EOL);
  287. return;
  288. }
  289. if ($is_owner) {
  290. $x = array(
  291. 'is_owner' => true,
  292. 'allow_location' => $a->user['allow_location'],
  293. 'default_location' => $a->user['default-location'],
  294. 'nickname' => $a->user['nickname'],
  295. 'lockstate' => ( (is_array($a->user)) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))) ? 'lock' : 'unlock'),
  296. 'acl' => populate_acl($a->user, true),
  297. 'bang' => '',
  298. 'visitor' => 'block',
  299. 'profile_uid' => local_user(),
  300. 'acl_data' => construct_acl_data($a, $a->user), // For non-Javascript ACL selector
  301. );
  302. $o .= status_editor($a,$x,0,true);
  303. }
  304. $sql_extra = item_permissions_sql($a->profile['uid'],$remote_contact,$groups);
  305. // AND `item`.`parent` = ( SELECT `parent` FROM `item` FORCE INDEX (PRIMARY, `uri`) WHERE ( `id` = '%s' OR `uri` = '%s' ))
  306. if($update) {
  307. $r = q("SELECT id FROM item WHERE item.uid = %d
  308. AND `item`.`parent` = (SELECT `parent` FROM `item` WHERE (`id` = '%s' OR `uri` = '%s'))
  309. $sql_extra AND unseen = 1",
  310. intval($a->profile['uid']),
  311. dbesc($item_id),
  312. dbesc($item_id)
  313. );
  314. if(!$r)
  315. return '';
  316. }
  317. // AND `item`.`parent` = ( SELECT `parent` FROM `item` FORCE INDEX (PRIMARY, `uri`) WHERE ( `id` = '%s' OR `uri` = '%s' )
  318. $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`,
  319. `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
  320. `contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`,
  321. `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
  322. FROM `item` INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
  323. AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
  324. WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
  325. and `item`.`moderated` = 0
  326. AND `item`.`parent` = (SELECT `parent` FROM `item` WHERE (`id` = '%s' OR `uri` = '%s')
  327. AND uid = %d)
  328. $sql_extra
  329. ORDER BY `parent` DESC, `gravity` ASC, `id` ASC",
  330. intval($a->profile['uid']),
  331. dbesc($item_id),
  332. dbesc($item_id),
  333. intval($a->profile['uid'])
  334. );
  335. if(!$r && local_user()) {
  336. // Check if this is another person's link to a post that we have
  337. $r = q("SELECT `item`.uri FROM `item`
  338. WHERE (`item`.`id` = '%s' OR `item`.`uri` = '%s' )
  339. LIMIT 1",
  340. dbesc($item_id),
  341. dbesc($item_id)
  342. );
  343. if($r) {
  344. $item_uri = $r[0]['uri'];
  345. // AND `item`.`parent` = ( SELECT `parent` FROM `item` FORCE INDEX (PRIMARY, `uri`) WHERE `uri` = '%s' AND uid = %d )
  346. $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`,
  347. `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
  348. `contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`,
  349. `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
  350. FROM `item` INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
  351. AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
  352. WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
  353. and `item`.`moderated` = 0
  354. AND `item`.`parent` = (SELECT `parent` FROM `item` WHERE `uri` = '%s' AND uid = %d)
  355. ORDER BY `parent` DESC, `gravity` ASC, `id` ASC ",
  356. intval(local_user()),
  357. dbesc($item_uri),
  358. intval(local_user())
  359. );
  360. }
  361. }
  362. if($r) {
  363. if((local_user()) && (local_user() == $a->profile['uid'])) {
  364. q("UPDATE `item` SET `unseen` = 0
  365. WHERE `parent` = %d AND `unseen` = 1",
  366. intval($r[0]['parent'])
  367. );
  368. }
  369. $items = conv_sort($r,"`commented`");
  370. if(!$update)
  371. $o .= "<script> var netargs = '?f=&nick=" . $nick . "&item_id=" . $item_id . "'; </script>";
  372. $o .= conversation($a,$items,'display', $update);
  373. // Preparing the meta header
  374. require_once('include/bbcode.php');
  375. require_once("include/html2plain.php");
  376. $description = trim(html2plain(bbcode($r[0]["body"], false, false), 0, true));
  377. $title = trim(html2plain(bbcode($r[0]["title"], false, false), 0, true));
  378. $author_name = $r[0]["author-name"];
  379. $image = "";
  380. if ($image == "")
  381. $image = $r[0]["thumb"];
  382. if ($title == "")
  383. $title = $author_name;
  384. $description = htmlspecialchars($description, ENT_COMPAT, 'UTF-8', true); // allow double encoding here
  385. $title = htmlspecialchars($title, ENT_COMPAT, 'UTF-8', true); // allow double encoding here
  386. $author_name = htmlspecialchars($author_name, ENT_COMPAT, 'UTF-8', true); // allow double encoding here
  387. //<meta name="keywords" content="">
  388. $a->page['htmlhead'] .= '<meta name="author" content="'.$author_name.'" />'."\n";
  389. $a->page['htmlhead'] .= '<meta name="title" content="'.$title.'" />'."\n";
  390. $a->page['htmlhead'] .= '<meta name="fulltitle" content="'.$title.'" />'."\n";
  391. $a->page['htmlhead'] .= '<meta name="description" content="'.$description.'" />'."\n";
  392. // Schema.org microdata
  393. $a->page['htmlhead'] .= '<meta itemprop="name" content="'.$title.'" />'."\n";
  394. $a->page['htmlhead'] .= '<meta itemprop="description" content="'.$description.'" />'."\n";
  395. $a->page['htmlhead'] .= '<meta itemprop="image" content="'.$image.'" />'."\n";
  396. $a->page['htmlhead'] .= '<meta itemprop="author" content="'.$author_name.'" />'."\n";
  397. // Twitter cards
  398. $a->page['htmlhead'] .= '<meta name="twitter:card" content="summary" />'."\n";
  399. $a->page['htmlhead'] .= '<meta name="twitter:title" content="'.$title.'" />'."\n";
  400. $a->page['htmlhead'] .= '<meta name="twitter:description" content="'.$description.'" />'."\n";
  401. $a->page['htmlhead'] .= '<meta name="twitter:image" content="'.$image.'" />'."\n";
  402. $a->page['htmlhead'] .= '<meta name="twitter:url" content="'.$r[0]["plink"].'" />'."\n";
  403. // Dublin Core
  404. $a->page['htmlhead'] .= '<meta name="DC.title" content="'.$title.'" />'."\n";
  405. $a->page['htmlhead'] .= '<meta name="DC.description" content="'.$description.'" />'."\n";
  406. // Open Graph
  407. $a->page['htmlhead'] .= '<meta property="og:type" content="website" />'."\n";
  408. $a->page['htmlhead'] .= '<meta property="og:title" content="'.$title.'" />'."\n";
  409. $a->page['htmlhead'] .= '<meta property="og:image" content="'.$image.'" />'."\n";
  410. $a->page['htmlhead'] .= '<meta property="og:url" content="'.$r[0]["plink"].'" />'."\n";
  411. $a->page['htmlhead'] .= '<meta property="og:description" content="'.$description.'" />'."\n";
  412. $a->page['htmlhead'] .= '<meta name="og:article:author" content="'.$author_name.'" />'."\n";
  413. // article:tag
  414. return $o;
  415. }
  416. $r = q("SELECT `id`,`deleted` FROM `item` WHERE `id` = '%s' OR `uri` = '%s' LIMIT 1",
  417. dbesc($item_id),
  418. dbesc($item_id)
  419. );
  420. if($r) {
  421. if($r[0]['deleted']) {
  422. notice( t('Item has been removed.') . EOL );
  423. }
  424. else {
  425. notice( t('Permission denied.') . EOL );
  426. }
  427. }
  428. else {
  429. notice( t('Item not found.') . EOL );
  430. }
  431. return $o;
  432. }