-
Posts
461 -
Joined
-
Last visited
-
Days Won
7
Everything posted by Tom.
-
@BitPoet sadly this has broken the website. All date format fields when using the time field also get the following error - All the data has reset to 1970. It also breaks the ability to do $pages->find("timeon<=". time() ."); Error saving field "timeon" - SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '' for column 'data' at row 1
-
HI fbg13, I have already namespaced it, thank you for your reply. I was making BitPoet aware. I opted to namespace the entire php file.
-
Exactly what I'm looking for, thank you very much! Edit: @BitPoet Not working with 3.0 - Error: Class 'ProcessWire\WireDT' not found (line 109 of /home/peterand/public_html/pwtramlines/site/modules/WireDT/FieldtypeDatetimeAdvanced.module)
-
Hey, I'm wanting to build a selector where you can filter the day (Friday, Saturday, Sunday). However, it doesn't matter the date as long as it falls on a Friday, Saturday or Sunday. $pages->find("template=act, showing_on=Friday"); I'm using a dateTime field because it will show the actual date, the only thing I can think of is have a date select and a options field to select the day. I was just wondering if there is a better way of doing it avoiding the user selecting twice. Before I was looping through each act and converting the dateTime to day and checking if it doesn't equal the day !="Friday" and removing it from the array if it doesn't. However this crashes the server when traffic is high.
-
Hello, I've recently done an update on one of our websites adding a field to a template. I changed 1 template by adding the field echo <?=$page->field->url?>, that was the only change. After clearing ProCache so users can see the update. All images stopped working on the website, strange? I only edited the one file. Then I noticed that the SEO module stopped working, and also a lot of functionality just stopped working. Here's where it gets strange, if I'm logged in everything is fine. I've cleared and disabled ProCache however, that hasn't fixed anything. This is the error I'm getting in the logs based on an image Error: Call to a member function width() on boolean (line 15 of /home/eizo/public_html/site/assets/cache/FileCompiler/site/templates/stockist.php) Why would the image field come out as a boolean? I've ran an update on ProcessWire and nothing. EDIT: Deleting the folder /home/eizo/public_html/site/assets/cache/FileCompiler/ does nothing. EDIT2: It appears that it was due to Access on the field, even though guest and moderator had permission to view the field but not edit (which I want). No idea how to get around this so our moderator can not change images on the website, without it breaking the website. However the SEO module still isn't working.
-
Perfect! I knew I was taking the long way around! There's always a simpler way in ProcessWire I've found $results = $pages->find([ ['parent', '/posts/'], ['tags|category.title|title', '%=', explode(",", $input->get->search), 'selectorValue'], ['limit', '25'], ['sort', '-created'] ]);
-
Sorry about that, I was just doing some urgent updates after posting. Should be all good now thanks for pointing it out.
-
One of the biggest projects I've done yet! ProcessWire has been such a god-send so far, and it continues giving. This is an estate agents powered by Vebra in real-time, which ProcessWire imports all the data from and stores as pages, allowing us to use ProcessWires amazing built in API functions. ProcessWire is really perfect for any project big or small. http://www.spencersestateagents.co.uk/ The team here at Peter & Paul really love ProcessWire and so do our clients!
- 2 replies
-
- 10
-
-
I'm building in search in which you can search tags by the following: "Typography, Css" I initially thought to do a string replace of comma into a pipe and run it though a sanitizer. However, selectorValue removes the pipe. First sanitizing the string then doing a string replace will leave a search like "Typograph| css" which wouldn't work because it's wrapped in quotes. I eventually came up with the following - which works: // Remove space and replace with pipe $search = preg_replace("/,\s*/", "|", $input->get->search); // Explode pipe into array $search = explode("|", $search); // Sanitize each value foreach($search as &$item) { $item = $sanitizer->selectorValue($item); } // Array back to string $search = implode("|", $search); $results = $pages->find("parent=/posts/, tags|category.title|title%=$search, limit=25, sort=-created"); However, I'm wondering if I'm missing something here? Is there a more effective way to do this?
-
Hello, I've just launched a new site, however I'm finding that the page save function is performing really slow. We are pulling properties from Vebra (Jupix) and saving them as a page (so we can use PageArray functions such as filter and search). $letType = array("0" => "Not Specified", "1" => "Long Term", "2" => "Short Term", "3" => "Student", "4" => "Commercial"); $furnished = array("0" => "Furnished", "1" => "Part Furnished", "2" => "Un-Furnished", "3" => "Not Specified", "4" => "Furnished / Un-Furnished"); $database = array("1" => "For Sale", "2" => "To Rent", "5" => "Commercial", "6" => "Commercial", "7" => "Commercial", "15" => "Developments", "41" => "To Rent", "118" => "Commercial"); $qualifier = array("1" => "Price on Application", "2" => "Guide Price", "3" => "Fixed Price", "4" => "Offers in Excess of", "5" => "Offers in the Region of", "6" => "Sale by Tender", "7" => "From", "9" => "Shared Ownership", "10" => "Offers Over", "11" => "Part Buy Part Rent", "12" => "Shared Equity"); $property = simplexml_load_string(vebraConnect($url)); $id = $property->attributes()->id; if(wire('pages')->count("template=property, name=$id")) { $p = wire('pages')->get("template=property, name=$id"); } else { $p = new Page(); $p->template = 'property'; $p->parent = wire('pages')->get('/properties/'); $p->name = $id; } $p->of(false); $p->title = $property->address->display; $intDatabase = (int)$property->attributes()->database; if(array_key_exists($intDatabase, $database)) { $p->type = $database[$intDatabase]; $database = $database[$intDatabase]; } /*** CONTENT ***/ $text = ""; foreach($property->paragraphs->paragraph as $paragraph) { $text .= "<p>"; if($paragraph->name->length > 0) $text .= "<strong>$paragraph->name</strong><br>"; if($paragraph->dimensions->metric->length > 0) $dimensions = $paragraph->dimensions->metric; if($paragraph->dimensions->imperial->length > 0) $dimensions .= $paragraph->dimensions->imperial; if($paragraph->dimensions->mixed->length > 0) $dimensions = $paragraph->dimensions->mixed; $text .= $dimensions ? "<em>$dimensions</em><br>" : ""; $text .= "$paragraph->text</p>"; } $p->content = $text; $bullets = "<ul>"; foreach ($property->bullets->bullet as $bullet) { $bullets .= "<li>$bullet</li>"; } $bullets .= "</ul>"; $p->info->bullets = $bullets; $p->info->excerpt = $property->description; /*** ADDRESS ***/ $p->address->name = $property->address->name; $p->address->street = $property->address->street; $p->address->town = $property->address->town; $p->address->postcode = $property->address->postcode; $p->address->locality = $property->address->locality; $p->address->county = $property->address->county; $p->address->custom = $property->address->custom_location; $p->map->lat = (float)$property->latitude; $p->map->lng = (float)$property->longitude; $p->map->pitch = (float)$property->streetview->pov_pitch; $p->map->heading = (float)$property->streetview->pov_heading; /*** DETAILS ***/ $p->property->type = $property->type; $status = (int)$property->web_status + 1; if($database=="For Sale") $p->sale_status = $status; else if($database=="To Rent") $p->let_status = $status; else if($database=="Commercial") { if($property->price->attributes()->rent == '') $p->sale_status = $status; else $p->let_status = $status; } else $p->sale_status = $status; $p->property->area = $property->area->max; $p->property->area_unit = $property->area->attributes()->unit; $p->property->landarea = $property->landarea->area; $p->property->landarea_unit = $property->landarea->attributes()->unit; $p->property->custom_status = $property->custom_status; $intLetType = (int)$property->rm_let_type_id; if(array_key_exists($intLetType, $letType)) $p->property->let_type = $letType[$intLetType]; $intFurnished = (int)$property->furnished; if(array_key_exists($intFurnished, $furnished)) $p->property->furnished = $furnished[$intFurnished]; $p->bedrooms = (int)$property->bedrooms; $p->receptions = (int)$property->receptions; $p->bathrooms = (int)$property->bathrooms; $p->parking = (int)$property->parking; /*** PRICE ***/ $p->price = $property->price; $p->prices->rent_price = $property->price->attributes()->rent; $p->prices->currency = $property->price->attributes()->currency; $p->prices->price_qualifier = $property->price->attributes()->qualifier; $intQualifier = (int)$property->rm_qualifier; if(array_key_exists($intQualifier,$qualifier)) $p->prices->qualifier = $qualifier[$intQualifier]; $p->prices->service_charge = $property->service_charge; $p->prices->rateable_value = $property->rateable_value; $p->prices->let_bond = $property->let_bond; $p->prices->ground_rent = html_entity_decode($property->groundrent); $p->prices->premium = $property->premium; $p->prices->fees = $property->rentalfees ." ". $property->lettingsfee; /*** DATA ***/ $p->branch = wire('pages')->get("template=branch, name=".$property->attributes()->branchid); $p->dates->updated = strtotime((string)$changed); $p->dates->added = strtotime((string)$property->uploaded); $p->dates->available = strtotime((string)$property->available); $p->save(); /*** MEDIA ***/ if($p->images->count()) $p->images->removeAll(); if($p->floorplans->count()) $p->floorplans->removeAll(); if($p->pdfs->count()) $p->pdfs->removeAll(); if($p->epc->count()) $p->epc->removeAll(); foreach($property->files->file as $file) { $type = (int)$file->attributes()->type; $url = (string)$file->url; if($type == "0") $p->images->add($url); if($type == "2") $p->floorplans->add($url); if($type == "7") $p->pdfs->add($url); if($type == "9") $p->epc->add($url); } $p->save(); Often this will only return 1-2 properties as it only get's the updated one. However the website will come to a crunch when this function is fired. Is there anything I can do to speed this up?
-
Thanks for your input Rudy, I personally haven't had chance to use it, I've just heard very good things. Doing some more research, I can see the implementation being quite problematic. Especially since the licence has seemed to have changed and I can't see any mention of open source projects.
-
As many of you may know, Redactor can be included in open source projects, given that a licence is purchased. Redactor is regarded as one of the best WYSIWYG editors available. The company I work for Peter & Paul has kindly mentioned donating a licence to the project as we love ProcessWire here and use it for every project, big or small. However, I just thought I would check peoples interest and mostly @ryan's take on Redactor 2 - which also powers the WYSIWYG editor on Craft CMS. And whether he sees a fit for such software in the project.
-
I keep getting the following error - [InstagramFeed]: No user '' was found. However it's working fine.
-
Hello DL7, Excellent that you are considering ProcessWire, it's an amazing piece of Software. All of this is possible without custom coding, it's all built into the CMF API. I can't say I've had much experience with custom database tables however I do know that ProcessWire has an API to deal with that too: https://processwire.com/api/ref/database/ Thanks, Tom
-
You can do it this way: .ratio { display: block; position: relative; height: 0; } .ratio__content { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } .ratio--map { padding-bottom: 36.75%; } Then in your HTML add: <div class="col-xs-6 featured-block"> <div class="box location-map"> <a href="/contact-us/" class="ratio ratio--map"><img src="assets/img/map-resp.jpg" class="ratio__content"></a> </div> </div> EDIT: Just realised exactly what you want. Setting it as the background image to the div it should be fine.
-
Same place you would any other website, in the <head> part of your website. You will likely find this in /site/templates/ Thanks, Tom
- 9 replies
-
- 4
-
-
- google analytics
- ad roll
-
(and 2 more)
Tagged with:
-
This might be a silly question, however it's easy to overlook the obvious sometimes. Do you have a max upload set to the field settings?
-
Great work everyone! PW3 looks great!
-
Doesn't work for PW3.0.24
-
How are you defining the number of an image? Does ProcessWire ever know what image 001 is and 020 is for example.
-
1) Because of security reasons showing the current page ID isn't a good idea. However I'm confused behind the idea of replacing /designers/name-of-designer? It's human readable so it makes complete sense to leave it. 2) Make sure you have the field type set to multi language too. Installing the multi language module activates some fieldtypes. 3) I don't have much experience with multi language - but I do believe that urls can be translated too using the name field. 4) It's incredibly easy to define sizes in ProcessWire - simply do $page->image->size(300,300)->url - the important part is ->size(width,height). 5) You can using something like imagick to put in the watermark using a module. It's incredibly easy to do - https://processwire.com/api/modules/
-
Forgot password code results in page timeout
Tom. replied to OrganizedFellow's topic in General Support
Is a mod_security being hit? -
I'm trying to order a search by two ways: 1) Does this contain the search string? If so display first. (The rest is based on the geolocated postal code) 2) The user chosen order (price etc.) To do this, I have done the following: $properties = $pages->find("template=property$selector"); if($locality) { foreach($properties as $property) { if($property->is("address~=$locality")) $property->nearby = 1; else $property->nearby = 0; } } $properties = $properties->find("sort=-nearby, sort=$sort_order, limit=25"); $pagination = $properties->renderPager(array("nextItemLabel" => "Next <i class='icon-right'></i>","previousItemLabel" => "<i class='icon-left'></i> Prev")); However, $pagination is not working in this example. I've tried both ->find and ->filter. $pagination seems to be ignoring this, nor is the limit taking place. Is there an easier way of doing this? EDIT: The following works, however I would very much like to know if there is a way to do this in a singular selector? I worry about performance issues when not limiting the results from MySQL. $limit = 24; $start = ($input->pageNum - 1) * $limit; $properties = $properties->find("sort=-nearby, sort=$sort_order, start=$start, limit=$limit"); $properties->setStart($start); $properties->setLimit($limit); $pagination = $properties->renderPager(array("nextItemLabel" => "Next <i class='icon-right'></i>","previousItemLabel" => "<i class='icon-left'></i> Prev"));
-
Thank you Ryan, and thank you for providing such awesome software open source. It makes many projects like this and more possible.