Jump to content

blynx

Members
  • Posts

    174
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by blynx

  1. Hi!

    Mh can't really tell from that screenshot.
    One thing I noticed by myself already is, that it doesn't seem to work when caching is turned on - but I can't find the time to work on it right now. : |

    Can you have a look into the markup and see what actually was appended, also which actual paths/urls are used which are failing here?

    cheers!

  2. +1 for Tower!

    Switched away from Sourcetree because it requires an account now. 

    For now, Tower/Sourcetree/... are easier for me to handle all kinds of git-things apart from simple commit/push/pull like for example: rebase, stash, squash, ... and it is visually nice.

    I also use vs code. It is still nice to browse diffs in it or just to have a convenient second place to commit/push.

    • Like 3
  3. if($flip) {
      echo "H"
    }

    You are exactly right, I think you just miss a thought:

    The condition relates to the value of $flip. The value is either 0 or 1. And in PHP, 1 in a condition is “like” true, and 0 is “like” false.

    So $flip may be 1. In that case PHP will coerce it to true and finally print H because the condition is met.
    If $flip is 0, PHP will coerce that to false and print T because the condition for the if() was not met. So the else block is executed.

    Hope that helps?

    • Like 7
  4. 1 hour ago, dragan said:

    You could try like this: http://thisinterestsme.com/php-login-to-website-with-curl/

    That doesn't work (would have been too easy). PW uses some hidden token field, for security reasons I guess, which changes on each request.

    Yeah, that was my idea first, too. Then I remembered the token field. But you can force login a user with the other approach. I think in this case the token is not really useful since you have to authenticate manually on every request anyway.
    The token is a prevention of CSRF attacks: https://de.wikipedia.org/wiki/Cross-Site-Request-Forgery. As I understand it correctly, it ensures that any potentially harmful request to the server is really made by you, the person using the website/app, and not someone else who might have tricked you to send a bad request. Any request is only executed if it includes the correct tokens.

    @monchu

    Mh, then it depends.

    • I would not recommend this approach, because you would have to put the credentials into the script, since you cannot (don't want to) ask for name and password every time. I guess putting plain text passwords into scripts is not so cool. ;P
      But yes, it is “possible”.
    • Otherwise, a simpler way would be to use a “supersecret-obfuscated-url”—while keeping in mind that this is just security by obscurity and in fact the url will be public. It might be just fine if the content is not “classified”-secret but just “it just should not be so easy to find”-secret. Make sure to exclude the pages from any sitemaps, etc. ...
    • If you have some admin/ssh access to the server you could use scp (scp?download file with scp) - using ssh authentication. 
    • Or any kind of secure command thing. sftp? Maybe even curl. Not sure ... I think it depends on what you want to achieve.

     

    Btw. I would like to put a little disclaimer here, that I am by no means a security expert - these are just pieces of my humble knowledge and please regard all of it just as hints for further own research! :o Anyone with profound knowledge is invited to complement and/or correct :rolleyes:

    • Thanks 1
  5. Hi,

    Regarding the shell script, I assume you are talking about curl and the like? I don't know exactly - haven't tried specifically this, yet, but I think this could be roughly the right direction. (Just some thoughts about how I would probably approach this taking the script direction)

    That page/template which handles the document could be an endpoint for a custom login-like GET request. In your shell script, promt for unsername and password and send them in the url parameters to that url via curl (using https these are encrypted). An additional parameter like “cli-document-request=1” could be handy to distinguish the different requests in your template. (web browser vs. curl). See if the login succeeds and deliver the contents of the file.

    You have to look up the exact curl command by yourself, I don't use it that often :rolleyes: 
    Random helpful stuff for inspiration:

    download with curl: http://osxdaily.com/2014/02/13/download-with-curl/

    curl: https://curl.haxx.se/docs/manpage.html

    prompt for password, without echoing password: https://stackoverflow.com/questions/3980668/how-to-get-a-password-from-a-shell-script-without-echoing#3980904

    https://askubuntu.com/questions/299870/http-post-and-get-using-curl-in-linux (aha, you can also “log in” with curl → I am sure there are even more advanced techniques using curl for a more proper authentication, but the above might be just fine.)

    hope that was helpful :)

    (If you have any more specific questions don't hesitate to ask)

    best wishes
    Steffen

    • Like 1
  6. 2 hours ago, pwuser1 said:

    css grid is not responsive?

    Let me be nitpicky here :rolleyes: ... „no“  ...

    I would describe it like this: Responsiveness is a characteristic of the resulting website or app. It is achieved through technologies like CSS grid, media queries, Javascript, etc. etc. ... but indeed, CSS grids can make it extremely easy in certain situations to create responsive websites. 

    The question regarding „bootstrap vs. css grid“ is not if any of them is responsive, but wether you want to do some work by hand and learn the underlying tech (no bootstrap) or you rather want to build a website relatively quickly with ready-made pieces of code (yay bootstrap).

     

    • Like 1
  7. 4 hours ago, pwuser1 said:

    Hello all why use CSS grid when Bootstrap has responsive grids?

    CSS grid is „just“ new CSS technology which bootstrap will most certainly adopt in the future - just like the newer frontend frameworks are using flexbox now. It allows some pretty neat and clever layouting.

    CSS grid, just like all other CSS (flexbox, float, etc, etc ...) is the underlying technology the frameworks rely on.

    It is roughly a matter of „will readymade feature X / Y / Z of bootstrap easen the development of the project“ and „which browser versions do I need to support at reasonable effort“ to decide on using frontend frameworks.

    https://gridbyexample.com/examples/
    https://css-tricks.com/snippets/css/complete-guide-grid/

    cheers
     

    • Like 3
  8. Hm!

    This is weird - but it looks like a permissions problem on your side? I guess you can fix this by setting the file/folder permissions.
    I couldn't find anything wrong here at my place - is the folder name of the module correct?

    How did you install it?

    Sorry for the trouble - will have a closer look later the week

    Maybe try a fresh installation of the module for now -

  9. Although I don't believe this is would be coming any time soon, I'd just like to leave a note here that I would really really really enjoy sqlite for processwire very much. It would be so much easier to handle and synchronise smaller sites just by version controlling the files of the project.

    *sigh*

    ... could the FileCompiler offer a new approach on creating a universal compatibility especially for 3rd party modules?

    • Like 2
  10. Ok,

    so there is the new version out now which includes a gallery type like the ones in the medium articles.

    The whole module has been rewritten and I changed the way the galleries are rendered. Instead of weird template files the galleries are now modules which extend the MarkupPwpswpGallery module. Have a look at the readme for some more info.

    Everything should work just fine when updating despite the code changes. I build a gallery module which should ensure compatibility in case anyone was using her/his own template file.

    This is the new gallery type „Petersburger Hängung

    petersburger.gif.b4f2866466f2d40855977717dd78f484.gif

     

    The inspiration for that type: https://github.com/SiteMarina/guggenheim

    The linear partition problem:
    http://www8.cs.umu.se/kurser/TDBAfl/VT06/algorithms/BOOK/BOOK2/NODE45.HTM
    https://github.com/crispymtn/linear-partition/blob/master/linear_partition.coffee#L11 (coffee script)

    Yet, I implemented a simplier and I guess faster algorithm: https://stackoverflow.com/a/6670011/3004669
    Maybe I will implement the original algorithm, too, at some point. ... 

     

    • Like 8
  11. This sounds like you are looking for something like Repeater fields?

    There is the standard Repeater field included in the core - you have to install it under modules > core > Repeater. Check out Repeaters here: https://processwire.com/api/fieldtypes/repeaters/

    And there is also RepeaterMatrix, but this is a pro module and costs some few $$. Don't know if you actually need it here ...

    But regarding where you put the code ... it doesn't really matter as long as you get along with it and it works for you. Processwire lets you do your own thing there. You will find out later if you could/should improve something.

    • Like 1
    • Thanks 1
  12. Where is the data from of which this list is made of?
    Basically „yes“ - put it into home.php if this is the home page.

    Maybe, depending on what the data is, you may want to check out the possibilities of the /fields/ folder and $page->render('field')
    (Check out this processwire blog post about that functionality)

    E.g.:

    In case these items are children of some page. Maybe like so:
    (assuming )

    // assumed site structure
    
    -home [template: home]
        -portfolio [template: portfolio]
            -nice [template: project]
            -cool [template: project]
            -awesome [template: project]
            -...
    
    // templates/home.php
    
    <?php
    include('_top.php');
    echo $pages->get('/portfolio/')->render('children');
    include('_bottom.php');
    ?>
    
    // templates/fields/children.portfolio.php
    
    <div class="portfolio">
      <?php foreach($value as $item): ?>
        <div class="portfolio__item">
          <h2><?= $item->title ?></h2>
          <img src="<?= $item->someImage->url ?>">
        </div>
      <?php endforeach ?>
    </div>

    But there are many ways to do anything. See this as some inspiration. :)

    cheers
    Steffen

    • Like 1
  13. That should work - but that would kinda eliminate the use of it for me.
    I Just try to find a way for others to make  those kind of modules. So the interface should have been some guide for that.

    Butttt: Actually it's nothing big and I do hardly need it aaaaand: These submodules extend this one base submodule now which implements the interface already and therefore the functions are already implemented there and can be used by extending modules. So ... ... ... 

    Ah, message incoming while typing ... thanks kongondo, but I think a problem like that was already solved.
    In the beginning I had a typo and got an error thrown that the interface was not found or something like that. Corrected it and the processwire module list worked fine. Then, the error occurred when installing the modules.

    So I thought when installing modules the main module is probably not loaded yet and the interface fails?

    The setup:

    MarkupTheModule -- is already installed and includes the interface
    MarkupSubmodule -- not installed yet, one of those submodules which can be used by TheModule, should implement interface
    MarkupSubmoduleB ...
    MarkupSubmoduleC ...
    ...

    #+ä+0ad :-[ ASdsdjfgs dgiguh 

    aha. So I tested some things after I wrote down the setup and it actually works now. So I must have missed something.

    *blush*

     

    edit

    Mhm! Maybe what I was looking for are abstract classes ...

×
×
  • Create New...