Jump to content

clsource

Members
  • Posts

    373
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by clsource

  1. May be starting with something small like a subscription service. Then making things a little more complex like a T shirt shop. Then a more complex one with features similar to woocommerce or something like that. I think is a wonderful idea.
  2. clsource

    Voxgram

    Hello I opensourced my Telegram bot called "Voxgram" https://github.com/NinjasCL/voxgram Now you all have an example of working with the Rest Helper and the Python Telegram Framework (I think the my python code is a mess) but anyway here you go :).
  3. Hello, I will try to respond these questions Questions 1, 2 and 4 could be resolved by using "Transformers" a "Transformer" is simply a class that convert data from one format to another. In this case a transformer that converts PW pages to rest json. And example. If you got a template named video that stores youtube videos and contains the following fields: url, title. You can create a Transformer named like transformers/youtube.php <?php namespace ProcessWire; class YoutubeTransformer { public $source; public __construct(Page $source) { $this->source = $source; } public function toArray() { return [ "url" => $this->source->url, "title" => $this->source->title ]; } public function toJson() { return json_encode($this->toArray()); } } That way you could create a special class that could render specific outputs depending on what do you need. For example {catID}/articleList/{articleID}/galleryList/{galleryID} You could have a specific transformer for categories, articles and gallery items and share the output for each class and join them in the final response. This could also be combined with field specific templates https://processwire.com/blog/posts/processwire-3.0.7-expands-field-rendering-page-path-history-and-more/ 3.- For answering this it depends on your architecture and your api requirements. The rule of thumb is think how the developers will use the api and what information they will need. 5.- Well depends on what do you need and feel more confortable, those are just helper methods. there are tons of good code that you could use like https://github.com/marcj/php-rest-service http://symfony.com/doc/current/bundles/FOSRestBundle/index.html http://symfony.com/components/Guard http://symfony.com/components/HttpFoundation http://symfony.com/components/Serializer
  4. Hello, I created a simple telegram bot. What it does? it enables you to save your voice messages and send them later using emojis or keywords in your group chats. Just add @voxgrambot in your group chats and search all the public voice messages available using text or emojis. If you want to create a new voice message just send a private message to the bot with the command /new . If you want more info send the command /help. The bot was made using Python and https://python-telegram-bot.org The backend was made using ProcessWire 3.x and my Rest API helper. http://telegra.ph/Voxgram-Telegram-Bot-12-03
  5. Hello, Yes maybe this could help you https://github.com/NinjasCL/pw-rest
  6. Hi welcome to PW!. If you need a case study look at this hope it helps
  7. Ok well. I separated the assertions in their own class. And created a simple file for using the command line https://github.com/NinjasCL/ProcessServerAssert/blob/master/Assert.php just use php Assert.php in your server (or execute that file in the browser) and you can know if ProcessWire can run in the server
  8. Yes. May be I will do a merge request to wireshell for including this functionality as a command line app. The use case is when you do an installation of a previously configured site. So maybe the server could run ProcessWire, but some modules may be not present (like gd) and you discover that later in the development of the site.
  9. if your file is in templates and is using the ProcessWire namespace you don't need to include index.php. take a look in my rest helper if you need an example https://github.com/NinjasCL/pw-rest
  10. Hello, This is a very simple module that helps you asserting if the server has all the requirements for running ProcessWire. Helpful if you are developing in local and then have to upload to a production server. https://github.com/NinjasCL/ProcessServerAssert
  11. you could use the wireRenderFile method. all $page properties could be used inside the html // templates/planets.php $content = wireRenderFile('views/planets'); // templates/views/planets.php <html> <body> <?php echo $page->title ?> </body> </html> see https://github.com/NinjasCL/wire-render-pattern
  12. The wikipedia article of processwire is down! https://en.wikipedia.org/wiki/ProcessWire only available as a draft https://en.wikipedia.org/wiki/Draft:ProcessWire
  13. Hacktoberfest is right around the corner this year. A great opportuniy for contributing to open source and specially Processwire ecosystem https://hacktoberfest.digitalocean.com/
  14. It just a Rest Helper So technically will be compatible with Zapier but only if you create the endpoints and json responses for your system. It´s not intended to, for example, a Rest Wrapper to PW that works like the admin page, but with a rest way of creating pages, templates and so on.
  15. clsource

    Birthdays

    Yey happy birthday to both of you
  16. You could always access the $page object using wireRenderFile if you put the namespace in Processwire 3.x <?php namespace Processwire; ?> <title> <?php echo $page->title ?> </title> If you are in the 2.x branch use wire('page').
  17. clsource

    Thank U All.

    I just want to write how much I feel welcomed in this community. I came for the tech, but stay for the community. Just wanted to say how awesome are you guys and gals here at the PW community. long live PW and the jolly folks at its community
  18. If you are using Processwire 3.x you could import PW namespace <?php namespace Processwire; and use the functions without the need for wire() method.
  19. May be using this https://transfer.sh could help too.
  20. You could try out my rest api helper https://github.com/NinjasCL/pw-rest Alamo Fire as AFNetworking its format agnostic, so it could easily adapt to your api design I recommend you to follow http://jsonapi.org principles. also reading this book https://leanpub.com/build-apis-you-wont-hate and this book https://leanpub.com/iosappswithrest could help you start out. If you need something done quick maybe using Parse Server SDK its more appropriate for a middleware (you can call PW later with that) https://parseplatform.github.io
  21. Maybe you can create your own pagination $pageNumber = $sanitizer->selectorValue($input->urlSegment(2)); // wil get 2 from example.com/foo/2/ if(empty($pageNumber) || !is_numeric($pageNumber) || $pageNumber < 0) { $pageNumber = 0; } $limit = 10; $base = "template=post"; $query = $base . ", start=" . (($pageNumber > 0) ? $pageNumber + $limit : $pageNumber); $query = $query . ", limit=$limit"; // template=post, start=0, limit=10 $results = $pages->find($query); $total = $pages->count($base); $current = $pageNumber; $next = $pageNumber++; if($next > $total){ $next = $total; } $prev = $pageNumber--; if($prev < 0) { $prev = ''; }
  22. I think you should create a thumbnail on after saving the image with a hook. see https://processwire.com/api/hooks/captain-hook/?filter=image <?php // hook to this method protected function ___fileAdded(Pagefile $pagefile); $this->addHookAfter('InputFieldImage::fileAdded', $this, 'createThumbnail'); // create the thumbnail public function createThumbnail(HookEvent $event){ $file = $event->return; // new thumb $page->image->width(200); } with that you create the thumbnail right away on image uploading. I think that would work. But haven't tested that code.
  23. I hope now it does not shows any more warnings Please get the latests changes in the github repo thanks
×
×
  • Create New...