We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34162
    • 1 Posts
    This is an auto-generated topic for <a href="http://modxcms.com/extras/package/577">PubKitBlog (pkBlog) 1.4.2-beta</a> by kp!.

    Brief Description:
    <p>Full list of changes since v1.2 is in changelog.txt.</p>
    <p>Major points:</p>

    <ul>
    <li>eliminated dependence on PHx;</li>
    <li>tag settings preserved on re-edit;</li>
    <li>placeholder to copy Intro into main body</li>
    <li>improved instructions</li>
    </ul>
      • 28704
      • 1 Posts
      When I try to download I only get:

      Error!

      For some reason, the file pkblog-1.4.2.zip was not found. The website administrators have been notified of this issue and will resolve it shortly. at /home/jason/public_html/modx-repos/10/577/pkblog-1.4.2.zip

      sad
        • 16278
        • 928 Posts

        EDIT 25 Nov: I re-uploaded the zip file yesterday, and now the download seems to be working OK.

        And there was me so pleased the "update extra" finally seemed to have worked!

        Zip file is also available from Pogwatch site and root message of development thread
        laugh KP
          • 1751
          • 57 Posts
          Hi There, just a quick question,
          I have 2 sites which were successfully running the beta version. I decided to update them to v1.4.2.
          1 is working fine. The other has a problem with previews. the correct url is loaded ie index.php?id=2?template=preview&id=53
          however in ie7 i get 404, and in firefox, i get just a preview of the post without the publish buttons etc. When I use firebug, it would seem that
          blog.preview.tpl has not been loaded.
          The only difference i can think of is that on this site, friendly urls are not set I can’t set them at the moment either as I have a test environment set up.
          Could this be the answer?
          Or is there somewhere else I should look?

          Thanks

          Anni
            • 4041
            • 788 Posts
            Actually it looks to me as if the url is not entirely right, the 2nd ? before template should be &.
            index.php?id=2?template=preview&id=53

            Look in assets/snippets/pubkit/pubKitBlog.inc.php, find line 333.
            $landing .= '?template=preview&id=' . $doc->Get('id');


            Try changing it to this and see if it helps:
            $landing .= ($modx->config[friendly_urls] =='1') ? '?' : '&').'template=preview&id=' . $doc->Get('id');

              xforum
              http://frsbuilders.net (under construction) forum for evolution
              • 1751
              • 57 Posts
              hi Breezer
              thaanks for your suggestion, but after trying it, I can’t even edit a post let alone preview it, I just get a blank page.
              I thought the url string should be right, because it’s the same format that I get on the site that is working fine...?

              Any other ideas?

              Anni
                • 4041
                • 788 Posts
                Maybe just try changing line 333 to this:

                $landing .= '&template=preview&id=' . $doc->Get('id');


                Sorry if I wasted your time and this doesn’t work, if not I would wait for the snippet author to chime in as I haven’t installed this snippet package yet to play around with to see what it actually does (it’s on my todo list).
                  xforum
                  http://frsbuilders.net (under construction) forum for evolution
                  • 1751
                  • 57 Posts
                  Hey breezer,
                  no problem, I’ll try anything if there’s a chance it might work, so don’t worry you’re not wasting my time at all smiley
                  I tried your 2nd option and it gives the url index.php?id=2&template=preview&id=53
                  but unfortunately still doesn’t seem to be picking up on that blog.preview.tpl
                  so, same error as before I guess, so that would suggest that it’s not a problem with the url I suppose.....

                  Added:- I just read on the Pogwatch site that
                  The blog.first.tpl template chunk is used for the listing unless the query string "?template=preview" is appended to the URL.
                  so the original index.php?id=2?template=preview&id=53 is indeed correct.

                  This is my blog.config.php
                  <?php
                  if ($_REQUEST['template'] !== 'preview') {
                      if (empty($_REQUEST['tags'])) {
                          $display = '3' ;
                      }
                    $tpl = 'blog.first.tpl' ;
                    $extenders = array('summary') ;
                    $tagData = 'pwTags' ;
                    $tagDelimiter = ',' ;
                    $tagDisplayDelimiter = ', ' ;
                    $orderBy = array('parsed'=>array(), 'custom'=>array(), 'unparsed'=>'pkDate DESC, menuindex DESC');
                  } else {
                    $documents = $_REQUEST['id'];
                    $showPublishedOnly = 0;
                    $display = '1' ;
                    $tpl = 'blog.preview.tpl' ;
                    $extenders = array('summary') ;
                    $tagData = 'pwTags' ;
                    $tagDelimiter = ',' ;
                    $tagDisplayDelimiter = ', ' ;
                  }
                  ?>

                  and this is my blog.preview.tpl
                  <form action="[~48~]" method="post">
                  <input type="hidden" name="docId" value="[+id+]" />
                  <input type="hidden" name="tags" value="[+pwTags+]" />
                  <input type="hidden" name="returnId" value = "47" />
                  
                  <input type="submit" name="command" value="edit" />
                  <input type="submit" name="command" value="delete" />
                  <input type="submit" name="command" value="publish" />
                  </form>
                  <div class="blogItem">
                  <h4>[+pagetitle+]</h4>
                  <h5>[+pkDate:date=`%d %b %y`+] <span class="links">[+tagLinks+]</span></h5>
                  <h3><a href="[+url+]">[+longtitle+]</a></h3>
                  <div class="blog_intro">[+summary+]</div>
                  <p class="more">[+link+]</p>
                  </div>
                  <hr />
                  [+content+]


                  my pkPreviewFlag tv is set as Checkbox with Input Option Values: Preview==1

                  I just can’t see what’s wrong here and like I said, the other site (which does have friendly urls set), is working fine.

                  Any ideas anyone?

                  Anni
                    • 16278
                    • 928 Posts
                    I haven’t checked with friendly URLs off, but I’m sure Breezer is right about the URL problem - you only use the question mark on the first parameter in the query string, so if MODx is setting that to identify the document, the "template" parameter has to have an ampersand (preferably &amp; for us xhtml purists, of course).

                    MODx is already setting a parameter called "id", so now there’s a clash, because pkBlog is also using that name. That is, we’ll have to change the snippet’s formation of the URL a little more, e.g. (untested)
                    $landing .= '&template=preview&docid=' . $doc->Get('id');
                    and make it
                    } else {
                      $documents = $_REQUEST['docid'];
                      $showPublishedOnly = 0;
                    in the config file.

                    There may well be other places where the document identifier parameter could clash with "hostile" URLs - I’ll try to check and incorporate into the next update. Thanks to Breezer for the pointer to the solution.
                    laugh KP
                      • 1751
                      • 57 Posts
                      Hi,
                      Thanks for your reply...
                      I’ve just tried this and (if I’ve understood how to implement it correctly - not sure that I have)
                      I am now getting index.php?id=2&amp;template=preview&amp;docid=53
                      However I am now just seeing the main blog page.... ie not the article and no preview template
                      I tried:
                      //  		$landing .= '?template=preview&id=' . $doc->Get('id');
                      $landing .= '&template=preview&docid=' . $doc->Get('id');
                      //	} else {
                      } else {
                        $documents = $_REQUEST['docid'];
                        $showPublishedOnly = 0;
                      //   		$landing .= (!empty($docId)) ? '#' . $prefix . $docId: '';
                      	}
                      
                          $modx->sendRedirect($landing);
                      }


                      and

                      //  		$landing .= '?template=preview&id=' . $doc->Get('id');
                      $landing .= '&template=preview&docid=' . $doc->Get('id');
                      //	} else {
                      } else {
                        $documents = $_REQUEST['docid'];
                        $showPublishedOnly = 0;
                         		$landing .= (!empty($docId)) ? '#' . $prefix . $docId: '';
                      	}
                      
                          $modx->sendRedirect($landing);
                      }
                      


                      with the same results... I’m absolutely clueless with php so perhaps I misunderstood how to change the pubKitBlog.inc file?

                      Anni