Bookmarks plugin – UserPro Forums https://forum.userproplugin.com/forums/topic/bookmarks-plugin/feed/ Mon, 13 May 2024 23:01:11 +0000 https://bbpress.org/?v=2.6.2 en-US https://forum.userproplugin.com/forums/topic/bookmarks-plugin/#post-28315 <![CDATA[Bookmarks plugin]]> https://forum.userproplugin.com/forums/topic/bookmarks-plugin/#post-28315 Mon, 17 Mar 2014 18:48:42 +0000 williamr4j I have the bookmarks plugin and I was wondering how I might add another standard collection to the list of collections. Just to clarify, there is a standard collection that you can name in the admin section and I would just like to add a second one to be a default collection.

Love your plugins!

]]>
https://forum.userproplugin.com/forums/topic/bookmarks-plugin/#post-28337 <![CDATA[Reply To: Bookmarks plugin]]> https://forum.userproplugin.com/forums/topic/bookmarks-plugin/#post-28337 Mon, 17 Mar 2014 20:33:22 +0000 admin Do you need two default collections?

]]>
https://forum.userproplugin.com/forums/topic/bookmarks-plugin/#post-28342 <![CDATA[Reply To: Bookmarks plugin]]> https://forum.userproplugin.com/forums/topic/bookmarks-plugin/#post-28342 Mon, 17 Mar 2014 20:37:19 +0000 williamr4j If I can get the direction on how to do this I can do it myself, it doesn’t need to be a complete change of the plugin. I have added the field in the admin area for a second set but I cant figure out how to add it to the array as a default.

Thank you for your time.

]]>
https://forum.userproplugin.com/forums/topic/bookmarks-plugin/#post-28345 <![CDATA[Reply To: Bookmarks plugin]]> https://forum.userproplugin.com/forums/topic/bookmarks-plugin/#post-28345 Mon, 17 Mar 2014 20:38:47 +0000 admin Hi williamr, can you verify purchase here first? 🙂 And please show me what you tried already so I can understand what are you trying to do

]]>
https://forum.userproplugin.com/forums/topic/bookmarks-plugin/#post-28351 <![CDATA[Reply To: Bookmarks plugin]]> https://forum.userproplugin.com/forums/topic/bookmarks-plugin/#post-28351 Mon, 17 Mar 2014 20:43:31 +0000 williamr4j https://forum.userproplugin.com/forums/topic/bookmarks-plugin/#post-28357 <![CDATA[Reply To: Bookmarks plugin]]> https://forum.userproplugin.com/forums/topic/bookmarks-plugin/#post-28357 Mon, 17 Mar 2014 20:50:59 +0000 admin Hi william,

you need to hook/integrate your custom collection here: collection_options API function in api.php 🙂

See the options list, integrate yours somewhere there.

]]>
https://forum.userproplugin.com/forums/topic/bookmarks-plugin/#post-28372 <![CDATA[Reply To: Bookmarks plugin]]> https://forum.userproplugin.com/forums/topic/bookmarks-plugin/#post-28372 Mon, 17 Mar 2014 20:59:01 +0000 williamr4j You are talking about here, line 162:

/* Get collections for user */
function collection_options($default_collection, $post_id){
$output = ”;
$user_id = get_current_user_id();
$collections = $this->get_collections($user_id);
$bookmarks = (array) get_user_meta($user_id, ‘_userpro_bookmarks’, true);
if (isset($bookmarks[$post_id])){
$cur_collection = $bookmarks[$post_id];
} else {
$cur_collection = 0;
}
foreach($collections as $k => $v) {
if (!isset($v[‘label’])) $v[‘label’] = $default_collection;
$output .= ‘<option value=”‘.$k.'” ‘.selected($k, $cur_collection, 0).’ >’.$v[‘label’];
$output .= ‘</option>’;
}
return $output;
}

But I’m not sure what to do to add what I need to, sorry.

]]>
https://forum.userproplugin.com/forums/topic/bookmarks-plugin/#post-28376 <![CDATA[Reply To: Bookmarks plugin]]> https://forum.userproplugin.com/forums/topic/bookmarks-plugin/#post-28376 Mon, 17 Mar 2014 21:01:35 +0000 admin in output

before foreach(.. etc line

$output .= ‘‘;

try that.

]]>
https://forum.userproplugin.com/forums/topic/bookmarks-plugin/#post-28379 <![CDATA[Reply To: Bookmarks plugin]]> https://forum.userproplugin.com/forums/topic/bookmarks-plugin/#post-28379 Mon, 17 Mar 2014 21:04:11 +0000 williamr4j Thank you, like this right:

function collection_options($default_collection, $post_id){
$output = ”;
$user_id = get_current_user_id();
$collections = $this->get_collections($user_id);
$bookmarks = (array) get_user_meta($user_id, ‘_userpro_bookmarks’, true);
if (isset($bookmarks[$post_id])){
$cur_collection = $bookmarks[$post_id];
} else {
$cur_collection = 0;
}
$output .= ‘default_collection2’;
foreach($collections as $k => $v) {
if (!isset($v[‘label’])) $v[‘label’] = $default_collection;
$output .= ‘<option value=”‘.$k.'” ‘.selected($k, $cur_collection, 0).’ >’.$v[‘label’];
$output .= ‘</option>’;
}
return $output;
}

]]>
https://forum.userproplugin.com/forums/topic/bookmarks-plugin/#post-28393 <![CDATA[Reply To: Bookmarks plugin]]> https://forum.userproplugin.com/forums/topic/bookmarks-plugin/#post-28393 Mon, 17 Mar 2014 21:18:07 +0000 williamr4j Just tried and it did not work. Have any other suggestions 🙂

]]>