On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Hi there,

    this is the official support channel for PubWarner for MODX revolution. As you found it, I assume you have an issue with it.

    Link to MODX repository: http://modx.com/extras/package/pubwarner
    Current Version: 1.0.0-pl
    Works with: any version of Revolution, I guess

    What does Pubwarner do?
    It displays a red bar on top if you do two things at the same time:

    1. be logged into the manager
    2. view a ressource in the frontend that is NOT published yet (but you can see it as you are logged in)

    Hot do I get help?
    Please let me know what you are trying to do, how you noticed that it doesnt work the way you want it to and what you have tried until this moment to solve it.

    Cheers!
    • It looks like it's not showing up in the package manager. Can you edit the package and make sure mysql and sqlsrv are checked for the supported database drivers? Looks like it's not set for either.
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
      • You mean where it says:
        Check the Database(s) this add-on supports. If you aren’t sure, skip this.
        ?
        smiley Done! Thank you
        • Oooh! A shiny new addition to my Expo presentation!

          Hmmm... could add a "Publish Now" button to that. User's group would need to have "publish" permission for the context for the button to show.

          That's 'resource_unpublished'

          GitHub!!! Please!!! [ed. note: sottwell last edited this post 5 years, 7 months ago.]
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
          • I have added some code to the plugin to add a "publish now" button. Here's the whole thing after I've meddled with it.
            <?php
            # Plugin to display a warning that the viewed resource will not be visible when the user logs out of the manager.
            # Fires on: OnLoadWebDucument
            # Author: guido.gallenkamp@bytethinker.com
            
            if (!$modx->resource->get('published')&&$modx->user->hasSessionContext('mgr')) {
                $modx->getService('lexicon','modLexicon');
                $modx->lexicon->load('resource');
                if ($modx->lexicon('resource_unpublished')) {
                    $message = $modx->lexicon('resource_unpublished');
                }
                else {
                    $message = "Page is not published";
                }
                
                // add "Publish Now" button, clear cache and refresh page
                // 8 Nov 2015 sottwell
                $button = '';
                if($modx->hasPermission('publish')) {
                  $button = '<form action="" method="post" style="display:inline-block;"><input type="submit" id="pubnow" name="pubnow" value="Publish Now"></form>';
                  if(isset($_POST['pubnow']) && ($_POST['pubnow'] == 'Publish Now')) {
                    $rid = $modx->resource->get('id');
                    $result = $modx->runProcessor('resource/publish', array('id' => $rid));
                    $url = $modx->makeURL($rid);
                    $modx->sendRedirect($url);
                  }
                }
                
                $modx->regClientHTMLBlock('
                <div style="position: fixed; top: 0; width:100%; height: 50px; background-color: #f33; opacity: 0.6;">
                <div style="padding: 15px; margin: 0 auto; width: 800px; color: #fff; text-shadow: 1px 1px 5px #000">'.$message . ' - ' . $button . '</div>
                </div>
                ');
            }
            [ed. note: sottwell last edited this post 5 years, 6 months ago.]
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
            • Hey Susan, nice button! I will integrate it ASAP.

              I am still trying to figure out a workflow for me to get my code to github and back to the repository. I've bee a single player for most of my projects smiley
              • Yea, that github thing, I did not dig it at all.

                I understand the usefulness of collaboration, but Github lingo has been one of the worst experiences I have come across in terms of workflow and getting things uploaded peacefully.
                I am still trying to learn the stupid thing.
                  TinymceWrapper: Complete back/frontend content solution.
                  Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
                  5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
                • I rely on GitHub as a backup for almost all my MODX dev. work. I think the secret is learning to use command-line Git commands to interact with GitHub. When you create a GitHub Repo, GitHub shows you the commands to clone it locally using Git Bash or something similar.

                  I have a Git Bash terminal set up inside PhpStorm (I don't use PhpStorm's Build-in Git features). I can pop open the terminal window and do whatever I want with Git, including pushing stuff to GitHub.

                  Since I'm using MyComponent, everything I do is in a file and it's easy to run or debug unit tests inside PhpStorm. I've just been working on UpgradeMODX and the ability to step through all its code in a unit test and watch the variables change saved me *many* hours of frustration.

                  If Git, MyComponent, or PhpStorm went away tomorrow, I'd have to shoot myself. I don't know how to work without them.
                    Did I help you? Buy me a beer
                    Get my Book: MODX:The Official Guide
                    MODX info for everyone: http://bobsguides.com/modx.html
                    My MODX Extras
                    Bob's Guides is now hosted at A2 MODX Hosting
                  • This conflicts badly with a typical Bootstrap fixed top menu. One solution is to modify the HTML block's style attribute in the plugin to attach it to the bottom of the page instead of the top.

                    I think that after the Expo I'll play with this a bit to have it use a chunk and getChunk instead of being hard-coded. Maybe even add its own assets/components/pubwarner/css/ for styling, something like the QuickBar snippet.
                      Studying MODX in the desert - http://sottwell.com
                      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                      Join the Slack Community - http://modx.org