bookmark debug logging

This commit is contained in:
friendica 2014-02-05 03:15:10 -08:00
parent 8a11c29413
commit f30a39f9df
3 changed files with 9 additions and 7 deletions

View File

@ -7,10 +7,6 @@ function bookmark_add($channel,$sender,$taxonomy,$private) {
$iarr = array();
$channel_id = $channel['channel_id'];
if($private)
$iarr['contact_allow'] = array($channel['channel_hash']);
$iarr['mitem_link'] = $taxonomy['url'];
@ -45,12 +41,14 @@ function bookmark_add($channel,$sender,$taxonomy,$private) {
logger('bookmark_add: unable to create menu ' . $arr['menu_name']);
return;
}
logger('add_bookmark: menu_id ' . $menu_id);
$r = q("select * from menu_item where mitem_link = '%s' and mitem_menu_id = %d and mitem_channel_id = %d limit 1",
dbesc($iarr['mitem_link']),
intval($menu_id),
intval($channel_id)
);
if($r)
logger('duplicate menu entry');
if(! $r)
$r = menu_add_item($menu_id,$channel_id,$iarr);
return $r;

View File

@ -26,9 +26,13 @@ function bookmarks_init(&$a) {
require_once('include/bookmarks.php');
require_once('include/Contact.php');
$s = channelx_by_hash($i[0]['author_xchan']);
if(! $s) {
notice( t('Author lookup failed') . EOL);
killme();
}
foreach($terms as $t) {
bookmark_add($u,$s[0],$t,$i[0]['item_private']);
notice( t('Bookmark(s) added') . EOL);
notice( t('Bookmark added') . EOL);
}
}
killme();

View File

@ -1 +1 @@
2014-02-04.578
2014-02-05.579