-
Posts
70 -
Joined
-
Last visited
Profile Information
-
Gender
Not Telling
Recent Profile Visitors
4,465 profile views
woop's Achievements
-
The plugin's description links to this page, so I thought I should point out that there's an error in the code example above (MyHook instead of MyFunc). See: https://processwire.com/api/modules/lazy-cron/ for updated information.
-
yes. I would use a page for each image. can you describe the workflow further? Not sure what parts you want automated. the image uploading? how many images do you want to upload? how often?
-
What do I need to set up or secure a website, to accept online payments?
woop replied to OrganizedFellow's topic in Dev Talk
Stripe seems like an interesting alternative to PayPal. Pete worked on a module some time ago: https://processwire.com/talk/topic/4363-stripe-arrives-to-continental-europe/ -
Just thought I'd share my git hook (post-receive) that I've been successfully using for a few months now to update my beta site and production site via git (no more ftp!). Might help someone else. As you can see, I only have the "site" folder under version control. But now when I'm thinking about it, site/templates should probably be enough. #!/bin/bash while read oldrev newrev ref do if [[ $ref =~ .*/master$ ]]; then echo -e "Master ref received. \e[42mDeploying master branch to production site...\e[0m" WORKTREE=../site # define your work tree, where you want to push the files cd $WORKTREE # navigate to the work tree GITDIR=../mysite.git # in relation to the "cd" command above # update the working tree git --work-tree=./ --git-dir=$GITDIR checkout -f master git --work-tree=./ --git-dir=$GITDIR clean -fd master # return to git directory cd $GITDIR else echo -e "Ref $ref received. \e[104mDeploying $ref branch to beta site\e[0m" WORKTREE=../beta/site cd $WORKTREE GITDIR=../../mysite.git # in relation to the "cd" command above # update the working tree git --work-tree=./ --git-dir=$GITDIR checkout -f stage git --work-tree=./ --git-dir=$GITDIR clean -fd stage # return to git directory cd $GITDIR fi done
-
Import Disqus content to Comments module? (.xml to comments)
woop replied to woop's topic in Modules/Plugins
Hi again! Here's my Disqus import script! Some fields doesn't work correctly, but the basic parsing and import works fine. Will update this post as my code improves. Feel free to chip in! EDIT: Updated code, which runs fine now. Just successfully imported +16000 comments <?php # Heavily inspired by: http://www.binarytides.com/disqus-comments-importer-script-in-php/ ini_set('max_execution_time', 0); // unlimited execution time, because of large amount of comments ini_set('memory_limit', '512M'); $file = 'disquscomments.xml'; $doc = new DOMDocument(); $doc->load($file); $thread_list = array(); $threads = $doc->getElementsByTagName('thread'); foreach($threads as $thread) { if (!isset($thread->getElementsByTagName('link')->item(0)->textContent)) continue; $comment = array(); $comment['thread_id'] = $thread->getAttribute('dsq:id'); $comment['url'] = $thread->getElementsByTagName('link')->item(0)->textContent; $path = parse_url($comment['url'], PHP_URL_PATH); $path = preg_replace("/(\/){2,}/", "/", $path); // remove multiple slashes $path = $sanitizer->url($path); if ($pages->get($path)->id){ $comment['page_id'] = $pages->get($path)->id; } $thread_list[$comment['thread_id']] = $comment; } $post_list = array(); $posts = $doc->getElementsByTagName('post'); foreach($posts as $post) { $comment = array(); $comment['comment_id'] = $post->getAttribute('dsq:id'); $comment['thread_id'] = $post->getElementsByTagName('thread')->item(0)->getAttribute('dsq:id'); $comment['comment'] = $post->getElementsByTagName('message')->item(0)->nodeValue; $comment['created_at'] = $post->getElementsByTagName('createdAt')->item(0)->nodeValue; $comment['email'] = $post->getElementsByTagName('author')->item(0)->getElementsByTagName('email')->item(0)->nodeValue; $comment['name'] = $post->getElementsByTagName('author')->item(0)->getElementsByTagName('name')->item(0)->nodeValue; if ($post->getElementsByTagName('parent')->item(0)) { $comment['d_parent_id'] = $post->getElementsByTagName('parent')->item(0)->getAttribute('dsq:id'); } if (isset($thread_list[$comment['thread_id']]) && isset($thread_list[$comment['thread_id']]['page_id'])){ $thread = $thread_list[$comment['thread_id']]; $comment['page_id'] = $thread['page_id']; // the corresponding PW page's ID $post_list[$comment['comment_id']] = $comment; // only accept pages with pageids } } $postsadded = 0; foreach($post_list as $post){ if ($pages->get("disqus_id={$post['comment_id']}")->id) continue; //ignore already imported $c = new Page(); $c->setOutputFormatting(false); $c->template = $templates->get("mycomment"); $c->username = $post['name']; $c->title = "temporary title"; $c->publish_date = $post['created_at']; $c->disqus_id = $post['comment_id']; $c->body = $post['comment']; // If there's a parent comment, use this as parent if (isset($post['d_parent_id']) && isset($post_list[$post['d_parent_id']])){ $disqusparentID = $post_list[$post['d_parent_id']]; $savedParent = $pages->get("disqus_id={$disqusparentID['comment_id']}"); // must find already created page if ($savedParent->id){ $c->parent = $savedParent; } else { $c->parent = $page; // dump it here } } elseif (isset($post['page_id'])){ $c->parent = $post['page_id']; // root comment } else { continue; } $c->save(); $c->name = $c->id; $c->title = $c->id; $c->save(); $postsadded++; } echo "<br>#######STATS#########<br>"; echo "added +{$postsadded} comments<br>"; echo "total of threads in disquscomments.xml: ".$threads->length."<br>"; echo "total of posts in disquscomments.xml: ".$posts->length."<br>"; echo "total of posts imported: ".count($pages->find('template=mycomment')); -
I basically wrote my own comments system using regular pages. Works great and gives me full control of the content. The new Lister Pro is a great way to moderate them, too. Probably less lightweight than using the comments module, but I like to keep things consistent. I simply set the article as the parent page, and then sub-threads as children of other comments for that article. Makes it easy to manage using the admin. I'm currently writing a import script to get all my content from Disqus into this system, which is pretty straightforward thanks to the API.
-
Help understand the _ files in the template
woop replied to mikeroosa's topic in Themes and Profiles
We recently had a lengthy discussion regarding issues like this. Ryan has provided an alternative profile/theme that makes it much easier to get things running. This might be included in future versions of PW, by default. See: https://processwire.com/talk/topic/7565-making-pw-more-userfriendly/?p=74425 -
I think Ryan solved it nicely by adding underscore to the included files. It makes it easier to get an overview of your files when template files and head includes doesn't look the same in the file browser.
- 206 replies
-
- standarisation
- templates
-
(and 1 more)
Tagged with:
-
I think the rewrote looks really good. like diogo pointed out, experienced PHP devs will probably see the possibilities PW brings and use their own strategy. having the "direct output" as the default profile and then adding the "delayed output" version as an alternative seems like a great compromise (if you're ok with maintaining both).
- 206 replies
-
- 1
-
- standarisation
- templates
-
(and 1 more)
Tagged with:
-
so good! I think the URL logic makes sense. here's some feedback during my brief testing on the lightning.pw site: I think the title with the info icon should stick stay even after you click it. Compare to Templates -> Filters, which can be expanded in a similar way. It feels more consistent to have it work the same. Maybe lose the punctation mark in each title, since PW adds "..." anyway External and internal links looks the same. It's hard to know where you'll end up when you click them. Not a major issue but maybe we could differentiate external links (to processwire.com, youtube etc) with a small icon. Or the have the titles say "Learn more on Processwire.com" etc. not sure. The "uninstall" button in the bottom right of each box feels redundant and maybe a bit repetitive? perhaps the info on the first screen is enough? Experienced users (that doesn't need the help) will probably know how to uninstall it anyway.
-
Ryan, great work as always! I know the character in my PDF was a bit over the top but I don't think it's unlikely to think that people who've outgrown drupal/wordpress would have a similar experiences when first trying Processwire 2.5. The simplicity of PW's API combined with PW 2.2's "direct output" strategy is what tipped me over. It was so easy to get started I felt it was worth the effort trying to rebuild a better version of my site from scratch using PW. Haven't looked back since. The delayed output method is, in my honest opinion, a step backwards. It may be less scalable then the direct output method but coming from Drupal where it's common to put PHP snippets in the admin – it's a huge improvement and extremely intuitive. However, the new READ ME you just added will make this less of a problem Cheers!
- 206 replies
-
- standarisation
- templates
-
(and 1 more)
Tagged with:
-
The learning curve would be even lower if there was no need for documentation for simple tasks at all. In my opinion any CMS should aim for such high usability standards that creating a simple site with pages, news/blog, forms, and gallery, based on a default install should be possible without having to learn anything that is beyond general content creation standards. Usability is not the same thing as a 1-click install. You will (and should) need to code your own gallery in PW. That's the whole point of PW and what makes it flexible. Processwire needs to get better at aiding you in the process of learning how to do this, though. That is what a user friendly CMS is about in my opinion: making it easy to do core content creation without having to study. Agreed. You should be able to create a template, add fields, attach a page and visit that page (with correct output rendered) without having to read through any documentation. However, it's not achieved using modules. It's achieved using helpful code examples and a well structured default theme (amongst other things previously mentioned)
- 206 replies
-
- standarisation
- templates
-
(and 1 more)
Tagged with:
-
@joss Wordpress is no longer aimed towards "casual bloggers". It's used to power millions of sites ranging from personal blogs to full blown websites. It's chosen by developers and businesses around the world because of it's (perceived) ease of use and its large share of the market which results in better support. Processwire isn't truly "agnostic". You still have rules and boundaries which shapes the way you work. In Processwire, it's pages, templates and fields. In Drupal it's nodes, taxonomies, blocks and views. These tools has to be introduced in some way. External documentation should always be the last resort. It takes you away from the moment and makes you lose context. I think ProcessWire has the potential to be one of those CMS that "just makes sense" from the start. Just adding a small intro text when you first install it, like you suggest, would be a huge leap in the right direction. Coding isn't something unique to PW. The people who show interest in PW has probably already coded in another CMS by modifying a module/plugin or adding a bit of PHP to a view in Drupal. This has probably been a horrible experience and we need to make sure people understand how coding in PW is not the same thing as trying to hack a module someone else wrote. You'll get results faster in Wordpress, but then you have to tweak it in order to get it right. In PW, getting that initial result will take you some time but then it will turn out exactly like you wanted (and the underlying code makes sense, since you wrote it). I think the key to success is to make that initial learning curve as painless as possible.
- 206 replies
-
- 1
-
- standarisation
- templates
-
(and 1 more)
Tagged with:
-
The walkthrough module is great. We just have to make sure we also answer the basic questions like "What is a field", "What is a template" and "What is a page". Creating a field is already very easy to do (it's just a basic form). The question is, why do you do it and how does it relate to a template and its pages? We've already covered this thousands of times in tutorials, video walkthroughs, faqs and forum posts – but we don't explain it in the actual user interface. couldn't get the module to work 100%, but I imagine the guided tour to be something like this Create new text field -> Create new template -> Add the same field you created in the first step, to your new template -> Create a page based on this template -> Point the user to the template file and describe how to add the field to the output of that template -> Visit the final page -> Recap all the steps in text and point to relevant documentation for further reading.
- 206 replies
-
- 2
-
- standarisation
- templates
-
(and 1 more)
Tagged with: