• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
  • This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

[pfps.com.br] Bookmark Posts

Status
Not open for further replies.

Fuhrmann

Well-known member
#1
Bookmark Posts 1.2.1

Suggested here: http://xenforo.com/community/thread...ts-for-future-reference-bookmark-center.1472/

For those who use this plugin on XF 1.0.4 see this: http://xenforo.com/community/threads/pfps-com-br-bookmark-posts.21166/page-2#post-273825

Installation
  1. Upload the js, library, style directories into your XenForo's
  2. Import the addon
  3. Configure user group options in Users > User Group Permissions > Bookmark Posts
  4. Go to AdminCP>Options>Bookmark Posts and set the options
Upgrade
  1. Upload the js, library, style directories into your XenForo's
  2. Choose Upgrade in AdminCP
  3. Configure user group options in Users > User Group Permissions > Bookmark Posts
  4. Go to AdminCP>Options>Bookmark Posts and set the options
Please, give me your feedback. Suggestions, bugs!

Changelog:

1.2.1 (26/10/2011)
- Now this add-on suports friendly url
- Added a description to the bookmarks homepage template
- Bug fixes

1.2.0

- Homepage to show the latest bookmarks/most bookmarked posts (very simple)
- Added a option to chosse between icon, icon/text and only text.
- Option to choose the ammout of bookmarks to show in homepage
- Filter tags globaly
- Option to hide the content of the post in the account
- New 'View' page. View the bookmarks.
- Option to show the activity of bookmarking in the news feed.
- Fixed bugs
- A LOT of internal changes.

1.1.0
- No icons anymore. I had some problems with it.
- New options in the AdminCP.
- Now you can edit bookmarks.
- Tag bookmarks.
- Write a note in the bookmark.
- 'Share' changed to Public. Now you can make a bookmark 'Public' or 'Private'.
- Search all over yours bookmarks.
- Search only in certain tags.
- Two styles to choose of the post message bookmarks.
- Filter bookmarks by tag. One click.
- Import notes from the add-on 'PostIt'.
- Choose the default state of the bookmarks.
- Choose the default tag of the bookmarks.

1.0.0 BETA
- Bookmark posts for future reference
- Share your bookmarks to your profile
- Allow certain usergroups to "can bookmark" or not

NOTE: The importer still is presente in the Installer. But, for now, i have disabled it. If you want to show the importer Posts-It, open the file library/BookmarkPosts/Installer.php and uncomment this:

PHP:
/*If ($db->fetchRow('SHOW TABLES LIKE \'postit_content\''))
        {
            $db->query
                    ('
                    INSERT IGNORE INTO xf_bookmark_posts
                        (user_id, post_id, bookmark_date, bookmark_tag, bookmark_note, bookmark_state)
                        SELECT postit_user_id, content_id, postit_date, \'Imported\', postit_note, \'private\' FROM postit_content
                    ');
        }*/
Sem título.png Sem título3.png Sem título.png Sem título.png Sem título.png Sem título.png Sem título.png MaisUmSem título.png

NOTE2: I STRONGLY recommend, if you already has this add-on installed, to uninstall and install again. There is a lot of bugs fixed and some permissions set.
 

Attachments

Brogan

XenForo moderator
Staff member
#4
I just installed this to test it out.

The image paths use \ instead of / so none of the images load.

In addition, the images need to be uploaded to the /default directory.

I've deleted mine as I have no need of it, as have probably a few others.
I would recommend moving the images out of that directory.

Other than that, nice work.
 

Brogan

XenForo moderator
Staff member
#16
I spotted a few more bugs in my testing.

The phrase x_do_not_have_any_bookmarks should be does not have any bookmarks.

The share and unshare this icons were a bit confusing at first, I thought they were sharing with social networks.
I'll probably remove those icons and replace them with Make Public/Private links.

Likewise with the star icon, I'll probably just replace it with a Bookmark link, to match the other public controls in a post.
 
R

ragtek

Guest
#18
Some suggestions if i'm allowed to:p

Why do you do this in the account controller?
PHP:
        foreach ($bookmarks as &$bookmark){
            $bookmark['user'] = XenForo_Application::arrayFilterKeys($bookmark, array(
                                'user_id',
                                'username',
                                'gender',
                                'gravatar',
                                'avatar_date',
                            ));
            $bookmark['post'] = XenForo_Application::arrayFilterKeys($bookmark, array(
                                'post_id',
                                'username',
                                'gender',
                                'gravatar',
                                'avatar_date',
                            ));
        }
inside of the controller?

1. I would create a "prepare Method" inside the bookmark model which does this. This stuff shouldn't be handeled in the controller / controller isn't responsible for this;) If you want to do this on an other place, you'll have ugly c&p code;)
edit: you have it already:p you're having the same stuff in member and account controller
If you need a example, check attachmentmodel::prepareAttachment or usermodel::prepareUser
 
R

ragtek

Guest
#19
Next one:

Instead of including the template ALWAYS and check inside the template if the user is allowed creates IMO unnecessary overhead. Yes it's minimal, but you don't need to create a template object if you don't need it)
Code:
<xen:if is="{$canBookmarkPost}"> <li>  <a class="{xen:if "{$selectedKey} == 'alerts/bookmarks'", 'secondaryContent', 'primaryContent'}" href="{xen:link account/bookmarks}">{xen:phrase your_bookmarks}</a> </li> </xen:if>
PHP:
case 'account_wrapper_sidebar_your_account':
                $ourTemplate = $template->create('account_bookmarks_link', $viewParams);
                $rendered = $ourTemplate->render();
                $contents .= $rendered;
                break;
could be handeled direct in the template hook via:
PHP:
case 'account_wrapper_sidebar_your_account':
      if ($model->canBookmarkPost()){
                $ourTemplate = $template->create('account_bookmarks_link', $viewParams);
                $rendered = $ourTemplate->render();
                $contents .= $rendered;

}                break;
this makes also sometimes debugging easier because you don't run unnecessary code
 
Status
Not open for further replies.