We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22427
    • 793 Posts
    Hello kp52,
    many thanks for this really useful snippet. I implemented successfully a News section into one of my testing projects, following your example using tags and having subfolders for each category. All worked fine so far.
    But let me add some observations:
    (1) I understood that the TV for the Tags list could be also a check list (allowing more than one tag for an item). But it works only using radio buttons.
    (2) For beginners it may be confusing that you use one single site template for all your examples. The TVs of all the examples are assigned to that template. So if you just want to implement the News Section and have a look to the TVs f.i. of the News Admin page, you see also the TVs for the PTA and the Commission examples.
    (3) On my wishing list I have the possibility to use Friendly URLs with Friendly Alias Paths ON, too.
    Thank you again and kind regards
    ottogal
      • 16278
      • 928 Posts
      Thanks for the feedback. BTW PubKit is now published in the Extras, so maybe future questions should be handled in its support thread.

      Re tags, you should be able to use any of the options type of TVs (radio, checkbox, single or multiple listbox). If you look at the sample blog, for instance, you’ll find checkbox implemented. The optionsbuilder class reads the TV type from its definition and generates a relevant SELECT tag for any of the above. If a radio button TV is working, just changing its type to checkbox in the TV definition creates a checkbox set in the form. (You can then only have a single &postid parameter, as I just found when testing that statement on the News section).

      I know the template scheme is crude, but taking the example too far risks spending a lot of time to create a "blog in a box" that people might expect to use with a minor tweak here or there. An interesting challenge in its own right, but I’m more into creating tools for developers to customize to their own requirements at a slightly deeper level, so the example site is just a vehicle to deliver a reasonably consistent set of working materials.

      Similarly, the restriction to unfriendly paths refers only to the example - I was spending too much time fiddling with getting the full paths right in all the subsidiary elements, then updating the installer SQL files for the resources involved (by hand, in Notepad++, what am I, some kind of masochist?). So the restriction in the example is an arbitrary one - I do use friendly URL paths with PubKit where it suits the site, as you can see in the News section of Pog Academy of the PubKit demo site. You just need to be careful to keep all the FORM tags’ action attributes up to date.
      wink KP
        • 22427
        • 793 Posts
        Thank you very much for your reply.
        ... taking the example too far risks spending a lot of time to create a "blog in a box" that people might expect to use with a minor tweak here or there. An interesting challenge in its own right, but I’m more into creating tools for developers to customize to their own requirements at a slightly deeper level
        Fully acknowledged - and the latter was what I did. smiley
        I do use friendly URL paths with PubKit where it suits the site, as you can see in the News section of Pog Academy of the PubKit demo site. You just need to be careful to keep all the FORM tags’ action attributes up to date.
        I will have a look to Pog Academy; helpful the hint to pay attention to the action attributes.
        Thanks again!
        ottogal
          • 16278
          • 928 Posts
          I had a nasty surprise today when AVG told me a file on my PC was infected. It turned out to be one of two illicit files planted on the development site I had just mirrored locally - the alert came when my backup program accessed one of them.

          Files in question are called cyberspy5.asp and db.php. They appear to have been uploaded using a gallery management page I am developing for PubKit. The raw logs show that someone on IP 41.143.57.163 used Google to find a news-edit page on my personal sites, so they may have been seeking to abuse an open news input page. Mea culpa - for convenience, I was using ordinary published pages instead of unpublished ones that would have been 404 when not logged in. Mea maxima culpa - though the photo upload checks for a "jpg" file extension, and checks for a JPG file identifier within the file after transferring, it didn’t (until today, that is) delete the transferred file if no JPG identifier was found. At least the hacker seems to have believed the error messages - no sign of having called up the ASP or PHP files was logged.

          So the moral of the story is: if you’re using PubKit, please make sure your editing area is secure. There’s at least one person out there targeting it. And make your dev site "no-index".
          >:( KP
          • Quote from: kp52 at Apr 11, 2011, 02:29 PM

            They appear to have been uploaded using a gallery management page I am developing for PubKit.
            What gallery management, keith?
              Rico
              Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
              MODx is great, but knowing how to use it well makes it perfect!

              www.virtudraft.com

              Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

              Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

              Maintainter/contributor of Babel

              Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
              • 16278
              • 928 Posts
              I have dovetailed into PubKit the PHP code I used with XML storage on a site before I discovered MODX. It’s still a bit scrappy round the edges, for instance you need to create a DB table and a TV listing your gallery names to hook up to it, and there are probably some separate PHP files that should be lumped into a class file. But there are some fairly neat (IMHO) features: you get to keep the original filenames; auto-creation of thumbnails and resizing if pictures are over a set limit; management includes captioning, repositioning (move #X to #Y, not fancy jQuery dragging as yet), transfer between galleries and a choice of Delete actions (kill or archive). Attached screenshots show some management features, published side is at http://www.walthamband.com/gallery.html. Again, nothing too fancy. I was experimenting with jQuery and a lightbox, but haven’t worked out how to span more than one page of thumbs for the next/previous action.

              My plan was to tidy things up as far as possible this week to make the main PubKit developments fit for publication - including a messaging/guestbook page, and the gallery stuff if it works out well enough. I was just mirroring the site I’ve been using as a test-bed for the latest version when I discovered the intrusion, so I’ve spent most of the day checking logs etc. instead of getting on with the masterplan.

              laugh KP
                • 36626
                • 51 Posts
                I've downloaded the latest release, but the sample site will not load. Whenever I run ImportCSV I get the message "no record found for id 0". I'm sure it's something stupid I'm overlooking on my end, but it's frustrating. Any help would be appreciated.
                  • 16278
                  • 928 Posts
                  See page 1 of the PDF docs:
                  To configure the module, go to Modules > Manage Modules and hover over ImportCSV. Note the ID in the status bar (&id=N), then click on the module name to edit it.
                  In the Configuration tab's Module Configuration box, enter &modId=Module ID;int;N.
                  The default name of the import file is pubkit-demo.csv. The parameter, &dataFile=CSV Data;string;<filename>, can be used to change that.
                  Close and Run the module from the menu, and choose which parts of the sample to import.
                  Clear the cache and click on the Refresh Site Tree icon, and your sample pages will appear.
                  ;) KP
                    • 36626
                    • 51 Posts
                    Hi thank you for responding. I did all of that per the included documentation, but it's not working.
                      • 16278
                      • 928 Posts
                      If your're still getting "no record found for id 0", you haven't configured the module correctly. It should look something like the screenshot.
                      ??? KP