Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/13/2014 in all areas

  1. You know the effect: you buy new car, you start seeing similar cars everywhere. Your wife is pregnant - you see pregnant women everywhere. You have new logo with P in the circle - you see logos with P in the circle everywhere...
    4 points
  2. Why is there P everywhere?! And I'm not just talking about my baby daughter
    3 points
  3. Hey Ryan, I'm interested to know if this issue has gotten any more attention, I'm currently working on http://fisherhouse.org and would really love this
    3 points
  4. If you put Hybridauth in the site/ directory, it will use the default PHP session.save_path. Your template in Processwire uses pw's session path (assets/sessions). You need to ensure that both the session paths are same for it to work. You can do this by commenting the following line in index.php //if(ini_get('session.save_handler') == 'files') ini_set("session.save_path", rtrim($config->paths->sessions, '/')); This will make pw's session.save_path as the default PHP session.save_path. Now session variables can easily be passes between PW and Hybridauth templates.
    2 points
  5. Hi renobird I have no intention of deleting any of these video pages once they are created, so I am not too worried about that aspect. All that I foresee is unpublishing them or not ever calling on them via the page reference field. If anything, it makes me extend the question now, how do we auto increment and disable deleting! But thanks so much for your great suggestions. I have just about zero experience with URL segments. So I will have to ponder on this and work at it for a while and read up on them. Once I have done that I will try and implement your suggestions. Thanks renobird!
    2 points
  6. @Lance: weird thing here is that nothing should've changed regarding passwords and hashes between 2.3 and 2.4. These parts of the code are exactly identical as far as I can tell. I'd try installing a fresh 2.4 on this server you're using. If it works properly, then the problem most definitely has something to do with stored users and the password reset trick just didn't (for some reason I can't quite comprehend) work. Another thing you could try would be creating entirely new user via API, so that it's definitely specific to this particular server.
    2 points
  7. Under input tab. Set USE ACF to No. Other settings which you have probably right. CKEditor Toolbar JustifyLeft, JustifyCenter, JustifyRight, JustifyBlock Extra Plugins pwimage,pwlink,sourcedialog,justify
    2 points
  8. This is the nature of how the ajax uploading works, as it triggers a page save (though saving only the field you upload to). One way we could solve it is to add a status field to the file/image fieldtypes, giving them a way to identify a file as unpublished. Not sure how simple it will be to implement, but this is one of the things I've had on my list for awhile. If it comes up more often, I'll definitely bump it higher up the priority list.
    2 points
  9. MarkupCache is a simple module that enables you to cache any individual parts in a template. I'm working on a site now that has 500+ cities in a select pulldown generated from ProcessWire pages. Loading 500+ pages and creating the select options on every pageview isn't terribly efficient, but I didn't want to cache the whole template because it needed to support dynamic parameters in the URL. The solution was to cache just the code that generated the select options. Here's an example: $cache = $modules->get("MarkupCache"); if(!$data = $cache->get("something")) { // ... generate your markup in $data ... $cache->save($data); } echo $data; I left the markup generation code (the part that gets cached) out of the example above to keep it simple. Below is the same example as above, but filled out with code that finds the pages and generates the markup (the part that gets cached): $cache = $modules->get("MarkupCache"); if(!$data = $cache->get("city_options")) { foreach($pages->find("template=city, sort=name") as $city) { $data .= "<option value='{$city->id}'>{$city->title}</option>"; } $cache->save($data); } echo $data; That was an example of a place where this module might be useful, but of course this module can used to cache any snippets of code. By default, it caches the markup for an hour. If you wanted to cache it for a longer or shorter amount of time, you would just specify the number of seconds as a second parameter in the get() call. For example, this would keep a 60-second cache of the data: $cache->get("city_options", 60) I hope to have it posted to GitHub soon and it will be included in the ProcessWire distribution. If anyone wants it now, just let me know and I'll post it here or email it to you.
    1 point
  10. Ah, you have a new car, right?
    1 point
  11. And I see stupid people everywhere.
    1 point
  12. //$related = count($page->related) . renderNav($page->related); // instead of the above, try this: // I assume from your old code, that this will keep the markup for related articles $related = ''; // Check if there is more than 0 related pages if ($page->related->count() > 0) { $related .= "<h2>Check out these related articles</h2>"; // Render headline $related .= "<ul>"; foreach($page->related as $p) { // Loop through all related pages and then generate their markup $related .= "<li><a href='$p->url'>$p->title</a></li>"; } $related .= "</ul>"; } In your old code you are actually outputting the count and then something. What we don't know is your renderNav function (what it does), since it's not visible for us.
    1 point
  13. Something you wish to tell us?
    1 point
  14. This is a very useful plugin, and it gets better every day (or new release). Thanks Soma for taking the time to improve all this code. And please, be patient with all copy & paste php gurus.
    1 point
  15. Try commenting all the session's configuration in index.php // session_name($config->sessionName); // ini_set('session.use_cookies', true); // ini_set('session.use_only_cookies', 1); // ini_set("session.gc_maxlifetime", $config->sessionExpireSeconds); // ini_set("session.save_path", rtrim($config->paths->sessions, '/')); It worked for me.
    1 point
  16. Running 2.4 on PHP 5.2.17 here. All is working fine.
    1 point
  17. haha, not just read it.
    1 point
  18. What! That's already me on a good day
    1 point
  19. None that I know of, but you can always do this: $fs = array("body", "title", "summary"); foreach ($fs as $f) $page->save($f); According to Page.php, for single field save you'll want to hook into Pages::saveField(). Isn't this exactly the same question that Wanze answered quite a while ago, or am I missing something? If you still need those wildcards, then it could, of course, get more complicated
    1 point
  20. Macrura, Glad to have helped. I will warn you, creating simple ProcessModules are a gateway drug. Once you start creating modules, it's addicting. As has been stated by others, there are definitely cases where using the module is a good choice too.
    1 point
  21. First of all: Thank you for all you support during the last month! It took some time but finally my new website is online: http://www.lange-belichtung.com/ It is my first site running PW and I would like to thank for this real alternative to MODx To understand PW I decided to build my own gallery script for easily managing images. Some facts: - using EXIF data to prefill necessary fields (e.g. title, meta description, alt tag, etc) - keeping an original (non-resized) image and adding a "canonical-link" for every smaller copy to reference the original - some images are availabe as wallpaper in different resolutions + resolution recommendation based on your monitor ... I hope you will like it even it is only in German language.
    1 point
  22. You want to READ about it? Sorry, I am having real problems with that concept....
    1 point
  23. In some cases Kimono might be overkill. If all you want is to extract some simple info from a webpage you can use an html parser. Here's an example using http://simplehtmldom.sourceforge.net/ <?php include "simple_html_dom.php"; $html = file_get_html('http://www.wunderground.com/cgi-bin/findweather/hdfForecast?query=porto,+portugal'); $location = $html->getElementById('#locationName')->plaintext; $temperature = $html->getElementById('#rapidtemp')->find('.b')[0]->plaintext; echo "Temperature in {$location} is {$temperature} °C"; //echoes "Temperature in Porto, Portugal is 22 °C" (that should make most of you jealous )
    1 point
  24. Hi Bbeer, you can try the sharpening option values: $options = array( 'cropping' => 'center', 'sharpening' => 'medium' // none | soft | medium | strong ); You may also check your default setting in the site/config.php file: $config->imageSizerOptions = array( 'upscaling' => true, // upscale if necessary to reach target size? 'cropping' => true, // crop if necessary to reach target size? 'autoRotation' => true, // automatically correct orientation? 'sharpening' => 'soft', // sharpening: none | soft | medium | strong 'quality' => 90, // quality: 1-100 where higher is better but bigger ); EDIT: if you want to test out different settings, remember to use $thumb->removeVariations() before creating the new thumb.
    1 point
  25. $config->styles->append("/site/templates-admin/styles/custom.css"); $config->scripts->append("/site/templates-admin/scripts/custom.js"); Not PW guru myself, are you getting the things rendered in view source ? If so what are you getting the url as and when clicking the same are you getting the desired output .
    1 point
  26. Alright, sounds really good, I'll take a look today I have a few days spare and I think the everyone here could find this enjoyable. I'll let you know
    1 point
  27. Sounds like your site_header_banner field allows more than one image. That's probably why it's returning directory path instead of image URL -- it doesn't know which image you want to output. Try altering that field to only allow one image (via field settings) or try doing this instead to get URL for first image in that field: <img src="<?php echo $pages->get("/site-settings/")->site_header_banner->eq(0)->url ?>">
    1 point
  28. @bcartier: The ImportPagesCSV-module can't do this as is. But I tried making a tiny addition to make it support FieldtypePage (those used to make page references) and it worked amazingly well. The only change needed was to add 'FieldtypePage' to $fieldtypes array (just before init() function if you take a look at the module file), like this: protected $fieldtypes = array( 'FieldtypePageTitle', 'FieldtypeText', 'FieldtypeTextarea', 'FieldtypeInteger', 'FieldtypeFloat', 'FieldtypeEmail', 'FieldtypeURL', 'FieldtypeCheckbox', 'FieldtypeFile', 'FieldtypePage', // add this line ); After that addition it's possible to choose a Page field when connecting the fields from the CSV to the ones in the chosen template. I had pre-populated categories at the target site and used their id's in the CSV file to reference those categories. Multiple categories worked like a charm as well, just use a pipe in between id's (123|456|789). Moreover, if you've got only one category per entry to reference, then you don't even need the id's of the categories - you can use paths as well. Here's a little example: cat.csv: title one two three four entries.csv: title,categories a,/cats/four/ b,/cats/three/ c,/cats/one/ d,/cats/two/ Import cat.csv using a template for categories with (at least) title field, under a page at /cats/. Then import entries.csv using a template for entries, having a title field and a page field. This should leave you with entries that are connected to categories. I hope this gets you somewhere. @ryan: Looks like page references could be supported very easily. I just used this successfully to import ~3500 pages with category references from an old site to a new PW one. But maybe there's still something else to be done before they're fully supported?
    1 point
  29. I think your files field may not be fully created yet. Go back to that field in Setup > Fields and hit save. Now try it again. If you still get the error then go back to that field again, click on it's "details" tab and note the file extensions. Make sure that the file you are uploading is in the list of allowed extensions. Add more extensions as needed and save the field.
    1 point
  30. Because users and roles are also pages, you just have to use a normal "page" fieltype for this. When creating the field, go to the input tab, and choose user as the "template of selectable pages". Still on the input tab, insert roles=1013 on the "Custom selector to find selectable pages", where 1013 would be the ID of the given role.
    1 point
×
×
  • Create New...