Leaderboard
Popular Content
Showing content with the highest reputation on 05/25/2013 in all areas
-
just had a look at the answers in this forum - Ryan has worked himself through every unanswered post! On a Sunday afternoon...4 points
-
Well said, because soon you won't like it a lot anymore. You will love it4 points
-
We've got family in town, so I don't have to entertain kids and was finally able to catch up with the forum and some emails. Hopefully next weekend I'll be able to finish testing a giant batch of updates I've been making to the dev branch. It's become so much stuff that I've now started to worry the dev branch might become a little too "dev", since I know some are using this branch in production (including me). As a result, I've been holding off a bit so I can test more. I tried testing it out here on processwire.com and got a dreaded "class PDO not found" error (never expected that!). But ServInt is upgrading this machine as we type (sounds like I specified I only wanted mysqli before), and upgrading us to PHP 5.4 while they are at it. --Edit: Sunday afternoon? It's Saturday afternoon here.3 points
-
My first idea was to directly use the webservice APIs via cronjob. But then I remembered IFTTT.com and now everytime something happens on a social network IFTTT will send an E-Mail to social@nico.is and this IMAP inbox is automatically checked and processed via cronjob so that for every email a page in my pw installation will be created and the mail will be deleted.3 points
-
And good old Soma has even a module for it: https://gist.github.com/somatonic/23119943 points
-
It's starting to make sense now Only reason this could break (that I can think of right now) is that you've got multiple database connections open, so it might be necessary to define which connection is used here, like this: mysql_query($sql1, $connection); If that doesn't help, there's probably something else we're missing. You're getting "internal server error" by running this -- any chance you could take a look at Apache (web server) error log somehow? There should be a more detailed description of this error there. PW has it's own error log at /site/assets/logs/errors.txt, which you should also take a look at and another thing you could try (unless this is a live site already!) would be turning ProcessWire debug mode on from /site/config.php. This might give you a bit more information about the nature of this error (though in this case I don't think PW will have a chance to actually put anything there..)2 points
-
Sounds like you found a good solution there. I just wanted to mention one alternative that I've used before too, just for the sake of discussion. You can add this to your .htaccess file: AddType application/x-httpd-php .cfm That will make files ending with ".cfm" get run by PHP. Then you could create this file: /store_item_detail.cfm require("./index.php"); // bootstrap ProcessWire $itemID = (int) wire('input')->get->item_ID; if($itemID) { $item = wire('pages')->get("template=product-legacy, legacy_item_id=$itemID"); if($item->id) { // now you can either render the page… echo $item->render(); // …or if you prefer, redirect to it: wire('session')->redirect($item->url); } else { echo "Unknown item ID"; } } else { echo "No item ID specified"; } There you have it–ProcessWire powering ColdFusion scripts.2 points
-
I understand the convenience, but I don't think having separate core downloads for PW depending on language (or other factors) is sustainable from a version or security standpoint, so would rather avoid that by always having the core download be directly from our GitHub. But having clear additional download links for language pack, docs, etc., to accompany the main download link would be great. Longer term, we'll have an automated download function that can bundle modules and language packages automatically at runtime.2 points
-
Hi thijs, It's in the dev branch only. So you have two (there are more of course, it's Pw!) solutions: Use the dev version of Pw and get the page that rendered the template with $options['pageStack']. The method ryan mentioned in the post at the end. Before rendering the home template: $home->caller = $page; Then in your home template, you can access the caller page with $page->caller;2 points
-
2 points
-
Just thought I'd share this module which I modified from the PageEditPerUser module by Ryan Cramer. I needed page-specific edit access by roles, not by user. So... Overview Assign edit access to roles on a per-page basis. Description The user must already have page-edit permission on one of their roles in order to get edit access to assigned pages. Otherwise, they will only gain view access. This module is fully functional as-is, but intended as a proof-of-concept for those wanting to go further with adding custom edit and/or view access. How to install 1. Copy the PageEditPerRole.module file to /site/modules/ 2. Go to Modules in the ProcessWire admin and click "Check for new modules" 3. Click "install" for "Page Edit Per Role" How to use 1. Create a new role called "editor" (or whatever you want to call it) and give the role "page-edit" permission. If you already have a role in place that you want to use, that is fine too. 2. Under "Access > Roles" locate the role you want to assign edit access to. Edit this role. 3. For this roles's "Editable Pages" field: select one or more pages you want users with this role to be able to edit. 4. Save the role. 5. Under "Access > Users" locate the user you want to apply the role to. Edit this user. 6. For this user's "Roles" field, select the new role you added - "editor". 7. Save the user and your are done. 8. To test, login as the user you edited to confirm it works how you expect. Download http://modules.processwire.com/modules/page-edit-per-role/1 point
-
Today I want to present my personal website with a new design and my tumblr posts (in "Blog" section) directly imported into ProcessWire: Nico.is What do you think?1 point
-
1 point
-
Assuming those 3 result in identical results, most likely the 2nd one would be fastest since it is 1 API call rather than 2. The 1st one would be the second fastest since $page->children() is faster than $page->find, as it doesn't have to consider hierarchy beyond 1 level. These are my best guesses anyway. If you want to test them out, take a look at Debug::timer() (/wire/core/Debug.php). Also note you'll want to use double quotes for your selectors as the $date variable would not be dereferenced in single quotes.1 point
-
Glad you found the solution there. I've also resolved strange PHP issues in the past by clearing the opcode cache (APC), and/or restarting Apache, and that seems to do the trick. Though in this case, I'm guessing that your mysqlcheck reset something that fixed it. Some index must have been broken or not working quite right.1 point
-
Works great for me–awesome tool Soma! I have added a note about it to our download page: http://processwire.com/download/ It looks like the domain forwarding service I'm using (Namecheap) won't let me add redirects for anything other than www and @. So I can't add a dev download just yet. But I'll plan to add a dev.grab.pw or grab.pw/dev once I move the DNS.1 point
-
removeAll() is a method of a PageArray not a Page. So I think your code will need to check what type it's dealing with in order to avoid that error. if($reset) { if($page->$name instanceof PageArray) $page->$name->removeAll(); else $page->$name = null; }1 point
-
Any chance you could specify exactly what (or how) you're trying to do? I don't see a relation between sending email and MySQL, so I'm a bit confused here If it's SQL you're talking about, that shouldn't be a problem at template level, but you should probably run it through PW's own $db object: $sql = "SELECT * FROM my_table WHERE my_field RLIKE 'my value'"; $result = $db->query($sql); while ($row = mysqli_fetch_assoc($result)) { echo "this is a row from database: {$row['my_column']}"; }1 point
-
For stuff like this, I would be more inclined to use an Apache rewrite rule, just because there would be less overhead and code to make it happen. Something like this might work in your .htaccess (somewhere after the "RewriteEngine On" line): RewriteRule ^(continent[0-9]+)/(land[0-9]+)/(project[0-9]+)/donation/?$ /stuff/donation/$3/$2/$1/ [R=301,L]1 point
-
got it! after sleeping, solutions often appear... everybody was talking about local installs with that error, so I controlled the DBHost. had the config.php overwritten with the local copy, when I put on the debug mode... Where can I mark the thread as solved?1 point
-
Mystery solved. It seems that the php config for this server had php safe_mode on. Safe mode is deprecated in 5.3 and removed in 5.4 but I'm on 5.2.17, so it was on. Turn safe mode off and all is well again. Thanks for your effort guys. Hopefully this post can help someone out in the future.1 point
-
MySQL version is the problem! On our staging server, where the problem is happening, it is running 5.0.51. If I switch to my local install, running 5.5.24...success! Curious to know what the specific bug in 5.0.51 is. Thanks all.1 point
-
I recall this thread about sorting problems with MySQL 5.0.51 Could that be it? Welcome to PW Simonds!1 point
-
Ah, thanks a lot for the quick answer! I tried "role=something" but not "roles" and then i got lost in the documentation... Now back to work1 point
-
Sure you can. $pages->find('template=user, roles=editor') Or same with $users1 point
-
Welcome tron1000. If you put stuff in /wire/ core it will get overwritten if you update PW. Custom stuff and plugins belong to the /site/ or /site/modules folder. I guess it's that php files aren't allowed to be accessed inside site or wire folder and blocked by htaccess. In TinyMCE you have a configuration field you can install plugin from within a folder outside. Look for example this thread http://processwire.com/talk/topic/1655-add-bramus-cssextras-plugin-to-tinymce-inputfield/1 point
-
Greetings Everyone, Sorry I missed this discussion until now. Yes, I am working on a ProcessWire book and companion Web site. As a technical writer/developer/designer, ProcessWire has been an inspiration on multiple fronts: creating Web sites, going deeper with design/development, and writing/documenting the system. I've been working regularly on the book project, and I have about 175 pages completed already. I'll have much more to share in the coming weeks. Stay tuned, Matthew1 point
-
Pw is sanitizing the filename, meaning it replaces any problematic characters such as Umlauts (ä,ö,ü) and spaces with '_'. See Pagefiles::cleanBasename() // ... $basename = preg_replace('/[^-_.a-zA-Z0-9]/', '_', $basename); $ext = preg_replace('/[^a-z0-9.]/', '_', $ext); // ...1 point
-
If I've understood right you only need to get rid of the <ul>...</ul> wrapping the initial function call and modify the if-statement inside the function just a little bit to let it proceed on the first round even if there are no records found. Like this: <?php function listProducts($productCat,$level=0) { $result = wire('db')->query("SELECT id, product, productcat FROM products WHERE productcat='$productCat' ORDER BY subcat"); if($level > 0 && $result->num_rows == 0) return; echo "<ul class='sortable'>\n"; while (list ($id, $product) = $result->fetch_row()) { echo "<li id='item_{$id}'>\n"; echo "<div class='dd-handle'>{$product}</div>\n"; listProducts($id,$level+1); echo "</li>\n"; } echo "</ul>\n"; } ?> <div> <h5>Products</h5> <?php echo listProducts(0);//call the function ?> </div> As a side note, I usually build a simple safety net when using recursive functions just to be on the safe side if (when) there's suddenly broken data in the database. Here that would mean adding one line at the beginning of the function: // ~25 levels of product categories could be considered an error, I think. // Use something big enough to allow any legitimate data but small enough to allow the server stay alive. if($limit > 25) throw new WireException("Recursion gone wild"); While it's not necessary, it's a small price to pay for peace of mind .1 point
-
I'm reporting back here, although I'm not entirely sure what happened. In addition to not being able to access /processwire, I was also experiencing some odd DB behavior. so, via command line ran: mysqlcheck --repair; While everything came back as OK — when it was done— all my issues cleared up. I had also re-uploaded the /site and /wire directories, so that may have been what fixed it as well. All I know is that something was seriously borked, just not sure what. Anyhow, back to work.1 point
-
yeah thumbs down for Drupal & Joomla 6 (2013) Movie saw it last week, in this 5th sequel, Drupal meets Joomla, Drupal loses Joomla, Drupal finds Joomla again, marries Joomla... Drupal & Joomla VII (2014) (sci-fi) Drupal meets Joomla. Drupal loses Joomla. Drupal builds Joomla. Drupal, Wordpress & Joomla (2015) Drupal meets Wordpress. Drupal loses Wordpress. Drupal finds Joomla. Chase takes forty minutes, dialogue six, and gun shots fill in void. Drupal & Processwire (2016) Drupal meets Processwire, they belong to different gangs, war breaks out.1 point
-
Hi simonds, As a developer you'll love ProcessWire Hm sounds strange. Can you check if the template of the parent has a predefined setting for sorting the children? This setting can also exist on the parent page itself under the "Children" tab, at the bottom. Though Pw should give you a javascript message that the reordering isn't possible because the pages are sorted by field XY. Which version of Pw? Any 3thparty modules installed? Cheers1 point
-
This module is available on the modules section now http://modules.processwire.com/modules/process-admin-custom-pages/ mods.pw/4Y1 point
-
I was checking out the site last month. Seems cool to me. The service stands out because they are communicating great value at extremely low prices. I have colleagues who will barely build you a stock WordPress site for $5K, and there is practically zero focus on any kind of marketing or user decision-making. Usually there's also more to the story that you can't see on the website. Examples: Yes, we advertise $5K / 2 weeks but most of our clients are just loading us up with ongoing work that is much more expensive. We probably couldn't take on your project. Yes, we advertise those things, but we recommend that you do X, which is our cool new thing, just a bit more expensive. OK, here is your $5K / 2 week design! It was fun to work on. The results are looking great so far! Here is a list of things we think we should help you do next. The cost is based on some multiplier of the original cost. Yes, we do all that, but this is kind of a side gig for us. Once it gets really serious, our prices are going to be up there with everyone else's. Thanks for contacting us--right now we are booked 6 months out. If you're willing to pay more, however... Thanks for getting in touch. For your special project we think we'd approach this as a consultancy. We think we can do X,Y, and Z for you. Let us know if you can afford a weekly rate of $X. If so, I think you'll like the results... The value they are communicating, and their prominent voice, will probably give them the ability to pick the best from lots of different potential clients. So they can say things like the points above to people who have deep pockets and deadlines, and it works out fine. It can be weird and depressing to see this stuff as a fellow web designer, especially if you have ever charged more than that for a site that is considerably less hip, but they must have realized that most web firms are very hesitant to write down a cost and time, especially if they do amazing work. So they stand out based on that alone. But as I said above, there is usually more to the story. They also develop proprietary widget-type stuff that is pretty neat, so it's not just great Photoshop work. There's also the concept of the "smart site" and the various qualifications you jump through as you get ready to get in touch with them. They want a specific type of person who has either already bought in or is willing to be very flexible. Overall I think there's a lot to learn from this approach, but it can't really be taken at face value. I'd be interested to hear what they're up to right now.1 point
-
1 point
-
Replying to my own question, I think I've found the way: Edit Template > Family > Allowed Template(s) for Children1 point
-
Hi Soma, just tested and works awesome here! Thanks1 point
-
1 point
-
Hi Willy, Thank you very much for your response, it seems to be OK now ! My PHP knowledge is not very good... I'll dive into the CMS in order to test it and I'll post a response here. Thanks again.1 point
-
Thanks Adrian & Soma. I will definitely look into that. Wish I had known about it sooner! Edit: Hmmm, I feel kind of stupid for having to ask this, but... How do I enable the Codemagic plugin? Do I have to add a separate button to the toolbar, and does it go under "third party" or just the standard plugins? Edit 2: Alright, I figured it out through trial & error Add "codemagic" to the list of plugins (not third party) and then add "codemagic" to the toolbar.1 point
-
You are probably right about Joomla... but I think even for experienced developers the time is spent better working with PW than trying to hack or extend Joomla. That is (for me) the absolute best thing about PW: the api is actually helping me to get things done quicker and easier, instead of forcing me to learn a new language or "hack the core".1 point
-
Well-said Matthew! I still can't believe that I can "write php" code, thanks to ProcessWire! The API - it's friendliness and power - has encouraged me to write code. I don't think I would have dared to code a single line of snippet in MODX save for echo "Hello World"; ! It's not a problem with MODX; it's just that PW makes many difficult things easy. choppingblock, I think I have said welcome before; if not, welcome to PW! Cheers.1 point
-
Greetings, Choppingblock: there are a lot of (former) ModX people here. Seems that the kind of people who want high flexibility are attracted to ModX, and the fact that so many ModX people then see ProcessWire as a higher level of flexibility really tells you something about ProcessWire! After using ProcessWire for several months now (I came from Joomla -- a very inflexible system), I am impressed over and over again how every kind of development challenge can be achieved with such concise, neat solutions using the ProcessWire API. Thanks, Matthew1 point
-
I have come to PW from MODx just a couple of weeks ago... before that, MODx (both Evo and Revo) was my CMS of choice and I always praised its flexibility (e.g. building page templates or adding code snippets was really easy, compared to most other CMSs). I still think that it is a good CMS (I have used it for years without finding a better alternative). Now that I have done some projects in PW, I doubt I will be going back to MODx. PW is much, much faster, has a very intuitive UI, a unique "the-api-is-everything" approach which allows instant production with just a quick look at the cheatsheet, and, very important, a small but incredibly helpful and friendly community. Thumbs up for PW!1 point
-
Hmmm.. you're right. so, to clarify, the methods Page::editable, Page::viewable, etc.. were all added in the PagePermissions module by calling: $this->addHook('Page::editable', $this, 'editable'); correct? which means, in my module, I could essentially *add* my own method hook to the Page class like this? $this->addHook('Page::pogidudemethod', $this, 'pogidudeSomeMethod'); to which other modules can also hook into and which could also be used like: $var = $page->pogidudemethod(); very coool... yeah, sorry I was only skimming over the modules/threads since I wanted something I could implement quickly. But what you have going here is pretty neat too. thanks!1 point
-
u try edit /index.php file comment.out this line ini_set("session.save_path", rtrim($config->paths->sessions, '/')); so like: // ini_set("session.save_path", rtrim($config->paths->sessions, '/')); fixed ?1 point
-
I got it working, but it is very hackish and definately should be looked after. I will fork apeisa's code tomorrow and try to figure out why my current version does work and the latest on github won't. For now you can check if this gist works for you. It does for me. It's an old version of the module I installed on my local machine at home. Then I changed some code with the new version. I didn't fix one warning, just placed an @ before it to stop the warning.1 point
-
Hello Soma. Works perfectly! on localhost. Is it possible to include some 'must' moduls as well?. Regards.1 point
-
Lea Verou explains Regular Expressions. This is actually very easy to follow! Her RegExp playground is pretty cool too http://leaverou.github.io/regexplained/. And since we are at it, check out this Regexp editor by Cody Lindley http://jsfiddle.net/codylindley/u4E6P/1 point
-
I've not tried seddass's solution, but it looks right on. I'm using some of his code in my example too. So here's another option, which is to piggyback onto the MarkupPagerNav module, even though you aren't dealing with pages. <?php // get the images you are going to display $items_per_page = 4; $start = ($input->pageNum - 1) * $items_per_page; $total = count($page->images); $images = $page->images->slice($start, $items_per_page); // make this to give MarkupPagerNav what it needs $a = new PageArray(); // add in some generic placeholder pages foreach($images as $unused) $a->add(new Page()); // tell the PageArray some details it needs for pagination // (something that PW usually does internally, for pages it loads) $a->setTotal($total); $a->setLimit($items_per_page); $a->setStart($start); // output your images foreach($images as $p) { $img = $p->img; echo "<img src='{$img->url}' alt='{$img->description}' />"; } // output the pagination navigation echo $a->renderPager(); Btw, an images field on a page isn't going to scale infinitely. At some point, you are going to find it difficult to manage, sort, etc. So I would still place some limits on yourself for the max number of images you are going to attach to a single page.1 point