Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Allow users to view bookmarks in Mobile

Hello, I was wondering if it was possible to use bookmarks in Mobile view (default)... and if not by default how can I change the /discussions page in the top to /discussions/bookmarked in only mobile?

Comments

  • The Mobile theme can be edited from Themes/Mobile.

  • LincLinc Admin

    No, what you should do is copy the mobile theme to a new theme, then assign that new theme to be used as the mobile theme via the config file.

    Never, ever edit a file that comes in the standard Vanilla download.

  • Just checking if this still does not come standard with our forum installations? We still have to do what was suggested above?

  • peregrineperegrine MVP
    edited September 2012

    Just checking if this still does not come standard with our forum installations?

    you are correct

    We still have to do what was suggested above?

    yes

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • phreakphreak MVP
    edited November 2013

    @stephenmac7: It's pretty easy. Just put a link to your favorites site somewhere in the mobile template and it will be called.
    http://www.yourForum.com/discussions/bookmarked

    What i would like to know is, how is it possible to activate "bookmarking" in the mobile template as i have a lot of users just surfing with the mobile phone. Anyone has an idea, how to activate the stars on mobile?

    • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
    • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
  • @phreak The default mobile theme uses theme hooks to disable the options menu.

    In /themes/mobile/class.mobilethemehooks.php, comment out the lines that say $Sender->ShowOptions = FALSE;

    You also might have to remove the $this->DiscussionsClickable() call too.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • P.S. Using the table view in 2.1b2 shows the bookmark star on mobile.

    Not that I condone the table view ;)

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • @hgtonight: Thanx for the tip. But i forgot to mention the version. I run 2.0.18.8 and the themehooks do not include your suggested code parts. :/ Any other way of enabling it. :)

    • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
    • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
  • hgtonighthgtonight MVP
    edited February 2014

    Sorry, I thought you were running 2.1.

    In 2.0.18.8, you need to update the WriteOptions() function in /themes/mobile/views/discussions/helper_functions.php file.

    function WriteOptions($Discussion, &$Sender, &$Session) {
      if ($Session->IsValid() && $Sender->ShowOptions) {
          echo '<div class="Options">';
          // Bookmark link
          $Title = T($Discussion->Bookmarked == '1' ? 'Unbookmark' : 'Bookmark');
          echo Anchor(
             '<span class="Star">'
                .Img('applications/dashboard/design/images/pixel.png', array('alt' => $Title))
             .'</span>',
             '/vanilla/discussion/bookmark/'.$Discussion->DiscussionID.'/'.$Session->TransientKey().'?Target='.urlencode($Sender->SelfUrl),
             'Bookmark' . ($Discussion->Bookmarked == '1' ? ' Bookmarked' : ''),
             array('title' => $Title)
          );
    
          echo '</div>';
       }
    }
    

    Should work, but untested.

    EDIT - The comment filtering gobbled the html, so here is a pastebin link: http://pastebin.com/eYHtrzS7

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • peregrineperegrine MVP
    edited November 2013

    just testing here:

     
    
        function WriteOptions($Discussion, &$Sender, &$Session) {
          if ($Session->IsValid() && $Sender->ShowOptions) {
              echo '<div class="Options">';
              // Allow plugins to add options
              $Sender->FireEvent('DiscussionOptions');
         
              // Bookmark link
              $Title = T($Discussion->Bookmarked == '1' ? 'Unbookmark' : 'Bookmark');
              echo Anchor(
                 '<span class="Star">'
                    .Img('applications/dashboard/design/images/pixel.png', array('alt' => $Title))
                 .'</span>',
                 '/vanilla/discussion/bookmark/'.$Discussion->DiscussionID.'/'.$Session->TransientKey().'?Target='.urlencode($Sender->SelfUrl),
                 'Bookmark' . ($Discussion->Bookmarked == '1' ? ' Bookmarked' : ''),
                 array('title' => $Title)
              );
             
              echo '</div>';
           }
        }
    
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • phreakphreak MVP
    edited February 2014

    Thank you @hgtonight and @peregrine and sorry for the late return. I have two additional question.

    The options DIV appears gets rendered that way:

    <div class="Options">
    <li class="Item Alt New">
    <div class="Options">
    <li class="Item New">
    <div class="Options">
    <li class="Item Alt New">
    

    Is there a way to drop it inside the list element?

    <li class="Item Alt New">
    

    And the other thing is that the bookmark star doesn't get rendered inside a discussion in the comment view (on the first comment).

    Could you help me with those 2 questions?

    • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
    • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
  • @phreak mind sharing the current markup and the desired markup?

    I am getting confused.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Jep. Sorry, i tend to be confused these days. ;)

    This the current markup.

    <div class="Options">...</div> <li class="Item Alt New">...</li> <div class="Options">...</div> <li class="Item New">...</li> <div class="Options">...</div> <li class="Item Alt New">...</li>

    But i'm looking for something like this.

    <li class="Item Alt New">... <span class="Options">...</span> </li>

    I think it might be easier to work with Classes like "position". Or would you suggest it the way it is right now?!

    • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
    • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
Sign In or Register to comment.