News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Bookmarks

Started by Matthew K., July 16, 2007, 01:07:24 PM

Previous topic - Next topic

Matthew Schenker

Good Morning,
This looks like a great modification!

Is there a way to make it so only certain membergroups have permission to set bookmarks?

Thanks,
Matthew

AlenNS

#241
Quote from: Angelotus on July 18, 2008, 01:23:11 AM
Quote from: AlenNS on July 17, 2008, 02:47:41 PM
Any suggestion?

I use this

Quote
// Can the user bookmark the contents of this post?
      if ($context['can_reply'])
         echo ' | <a href="', $scripturl, '?action=bookmarks;sa=add;topic=' . $context['current_topic'], '"><img src="http://www.nessekrekers.nl/favorieten.gif" border="0"/>&nbsp;Bookmark</a>';
Thanks. I managed to install this mod with little change in the code you gave me.

I've made this for different type of languages.

Quote// Can the user bookmark the contents of this post?
      
if ($context['can_reply'])
         echo 
' <a href="'$scripturl'?action=bookmarks;sa=add;topic=' $context['current_topic'], '"><img src="' $settings['images_url'] . '/' $context['user']['language'] . '/bookmarks2.gif" alt="' $txt['bookmark'] . '" border="0" /></a>';

Angelotus

Your welcome! I edited the code for my own needs indeed! Thanks for commercialize the code ;D

AlenNS

No problem. We're here to help each other. :)

Matthew Schenker

Good Morning,
Does that code shown above also allow me to set who has permission to use bookmarks?
Thanks,
Matthew

Angelotus

Yes. if someone can reply, then they can bookmark.

AlenNS

Well, this code allows all of the users who can reply to bookmark the topic, this part of code is telling you that.

 if ($context['can_reply'])

Maybe you could make through ManagePermissions.php from the sources folder to limit to some membergroups to bookmark the topics.

EDIT: I didn't sew that Angelotus replied. Sorry

Leeloo5E

Yesterday I downloaded this great mod and installed it successfully on my smf 1.1.5...

Where can I add this

Quote// Can the user bookmark the contents of this post?
      
if ($context['can_reply'])
         echo 
' <a href="'$scripturl'?action=bookmarks;sa=add;topic=' $context['current_topic'], '"><img src="' $settings['images_url'] . '/' $context['user']['language'] . '/bookmarks2.gif" alt="' $txt['bookmark'] . '" border="0" /></a>';

But I also find some errors and something seems to be missing ...

1. While trying I got an error ... I found out, that in bookmark11.xml there was a "after" instead of an "before". Sometimes I found it very mistakable to set position to "after" while inserting "before" and reversed.

Set the after to before on line 57 in bookmark11.xml
<search position="before"><![CDATA[

2.  In Bookmark.template.php line 34 or so you add a coloumn for Last Pots.
<td class="titlebg" width="24%">', $txt[659], '</td>

But while adding the bookmarked topics in the next rows, there is no coloumn for adding the last post data of the bookmarked topic. I found it very usefull to have this. But when you load the user's bookmarks at line 42ff in Bookmarks.php you do not add a key for last posts on the selected topics. So I can't add this in the template.

3. For deleting a bookmark entry you are using a form with check boxes and a button. It would be very nice, if there was a link above and under the bookmark table like it is overall in smf.

Thanks.
Leeloo

AlenNS

Quote from: Leeloo5E on July 24, 2008, 03:29:38 AM
Where can I add this

Quote// Can the user bookmark the contents of this post?
      
if ($context['can_reply'])
         echo 
' <a href="'$scripturl'?action=bookmarks;sa=add;topic=' $context['current_topic'], '"><img src="' $settings['images_url'] . '/' $context['user']['language'] . '/bookmarks2.gif" alt="' $txt['bookmark'] . '" border="0" /></a>';
Display.template.php

Smoky "Rider" Blue

Aaron, i am now trying to add this to the beta 3.. it uploads alright, but then i get this message, when applying:

Quote

Installations actions for "Bookmarks":
The package you are trying to download or install is either corrupt or not compatible with this version of SMF.


hope we can get this fixed ;)
**Take the time to remember friendships and family.. Sometimes it's all we have, and missed very much**

AlenNS

I've reported that several times in this tread but no answer. :)

http://www.simplemachines.org/community/index.php?topic=182923.msg1617194#msg1617194

It is possible to install that package but manual and with little change that Angelotus and I have been writing couple a days ago.

There is a mistake in package for SMF 2.x because there isn't this part:

$normal_buttons = array(
      
'reply' => array('test' => 'can_reply''text' => 'reply''image' => 'reply.gif''lang' => true'url' => $scripturl .

Smoky "Rider" Blue

ok.. thanks AlenNS  ;)
**Take the time to remember friendships and family.. Sometimes it's all we have, and missed very much**

AlenNS

No, problem. I hope that helped you! :)

Smoky "Rider" Blue

it helped, but im thinking i will wait on this.. makes sense to, since there are more updates to the beta so i can wait..   but thanks again.. i do miss the mod!! ;)
**Take the time to remember friendships and family.. Sometimes it's all we have, and missed very much**

DSollick

Upon installing this mod and attempting to load a topic, I got a lovely parse error!

[Good thing I installed this on a test server before going live x_x.  That would have been bad.]

In a nutshell it says this:

Template Parse Error!
There was a problem loading the /Themes/default/Display.template.php template or language file.  [Insert other stuff here.]

Parse error: syntax error, unexpected T_DOUBLE_ARROW in .../Themes/default/Display.template.php on line 168

[This is the line that is highlighted.]  168             'bookmark' => array('text' => 'bookmark_add', 'test' => 'can_reply', 'lang' => true, 'url' => $scripturl . '?action=bookmarks;sa=add;topic=' . $context['current_topic']),

I'm just using SMF 1.1.5 with a few other packages installed [As it is a test server.]

The entirety of the parse error content is quoted below.  I didn't look through the topic to see if anyone else had this problem, so I don't know if there's an easy fix or not, so if there is, just kindly link it to me or reply with it :)

QuoteTemplate Parse Error!
There was a problem loading the /Themes/default/Display.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.

Parse error: syntax error, unexpected T_DOUBLE_ARROW in .../Themes/default/Display.template.php on line 168
159:                         </li>';
160:       echo '
161:                   </ul>
162:             </td>
163:       </tr>
164: </table>';
165:    }
166:
167:    // Build the normal button array.
168:       'bookmark' => array('text' => 'bookmark_add', 'test' => 'can_reply', 'lang' => true, 'url' => $scripturl . '?action=bookmarks;sa=add;topic=' . $context['current_topic']),
169:    $normal_buttons = array(
170:       'reply' => array('test' => 'can_reply', 'text' => 146, 'image' => 'reply.gif', 'lang' => true, 'url' => $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';num_replies=' . $context['num_replies']),
171:       'notify' => array('test' => 'can_mark_notify', 'text' => 125, 'image' => 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_topic'] : $txt['notification_enable_topic']) . '\');"', 'url' => $scripturl . '?action=notify;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id']),
172:       'custom' => array(),

ccbtimewiz

// Build the normal button array.
       'bookmark' => array('text' => 'bookmark_add', 'test' => 'can_reply', 'lang' => true, 'url' => $scripturl . '?action=bookmarks;sa=add;topic=' . $context['current_topic']),
    $normal_buttons = array(
       'reply' => array('test' => 'can_reply', 'text' => 146, 'image' => 'reply.gif', 'lang' => true, 'url' => $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';num_replies=' . $context['num_replies']),


Should be
// Build the normal button array.
    $normal_buttons = array(
       'reply' => array('test' => 'can_reply', 'text' => 146, 'image' => 'reply.gif', 'lang' => true, 'url' => $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';num_replies=' . $context['num_replies']),
       'bookmark' => array('text' => 'bookmark_add', 'test' => 'can_reply', 'lang' => true, 'url' => $scripturl . '?action=bookmarks;sa=add;topic=' . $context['current_topic']),

AlenNS

I need a help.

I've edited Bookmarks.template.php and tried to add more information for bookmarked topic but didn't succeed.

I've used codes from MessageIndex.template.php of Babylon Theme and got empty cells with no information.

Only Subject, Board and Starter are in there.

Replies, Views and last message and it's time are not there.

I've tried several options and nothing.

Also and topic and post icons are not there. I've putted same icon for all bookmarked topic, but that shouldn't be a goal.

Please if there is someone who could help me with this...

I've attached edited Bookmarks.template.php

AlenNS

Bump!

Please if someone could help me with this. I'm going on vacation on friday and I wouldn't like to leave this empty.

Thanks.

Aaron

Quote from: AlenNS on August 05, 2008, 05:31:29 PM
I've used codes from MessageIndex.template.php of Babylon Theme and got empty cells with no information.

That's because the rest isn't loaded in Bookmarks.php. You can easily add it to the query though.

AlenNS

Any suggestion?
I've tried to make some changes to Bookmarks.php but no result.

Advertisement: