Jump to content

davo

Members
  • Content Count

    283
  • Joined

  • Last visited

Everything posted by davo

  1. davo

    Hi Pete, I remember you talking years ago about a hotel booking module. Did you ever progress this? 

  2. I gave the upgrade to 3 a go today, but i'm hitting a couple of problems. I have a functions file but when it is called from in a template I get this error: Error: Call to undefined function wire() (line 155 of /var/www/vhosts/dudmc.com/httpdocs/site/templates/myfunctionlib.inc) Do I have to amend anything to make this work again?
  3. Hi I'm about to prepare to do an upgrade from ProcessWire 2.8.33 to 3.0.39. Has anyone experience any complications or issues that I should be aware of? Davo
  4. davo

    www. rewrite

    I do indeed. I've sorted it now though. I adjusted the preferred domain in plesk. I don't think the server can have mod rewrite installed
  5. Hi, I have a site running PW 2.8. I moved it to a new server and (possibly foolishly) did the 2.8 upgrade at the same time. Now, all the pages are no longer using the www prefix which has screwed with search engine indexing somewhat. I don't know if it's the way the host file was created on the server or because i have over written the htaccess file. I though that on the .htaccess file I could uncomment the following two lines to prepend www but when i do this i'm getting a 500 error: # ------------------------------------------------------------------------
  6. After a week of testing in 2.8 this appears resolved. I suspect a bug in 2.7 .3 thanks for the help
  7. Adrian, I think the upgrade to 2.8 may have sorted it. I'll keep testing tomorrow but first impressions looks good. ta
  8. That's what I tried. But i get this complaint back when viewing the page: Error: Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column '_sort_parent_title.title' in 'order clause' (in /var/www/vhosts/dudmc.com/httpdocs/wire/core/PageFinder.php line 298)#0 [internal function]: PageFinder->___find(Object(Selectors), Array)#1 /var/www/vhosts/dudmc.com/httpdocs/wire/core/Wire.php(398): call_user_func_array(Array, Array)#2 /var/www/vhosts/dudmc.com/httpdocs/wire/core/Wire.php(333): Wire->runHooks('find', Array)#3 /var/www/vhosts/dudmc.com/httpdocs/wire/core/Pages.
  9. Thanks Adrian, Are there any issues with upgrading to 2.8? I couldn't easily find what the name space issue is. How do you mean adding the sort to the selector? I already have one sort there and can't seem to add parent.title
  10. I've been using a function for some time now which sorts an array by the title of a linked page 'DMC_country_represented' title but then should reorder it by the parent page title to group the pages together. Recently the order is no longer working and a couple of the list items are out of alphabetical order. The only thing i'm aware of recently that has changed is a core upgrade to 2.7.2. Any advice welcome please. function dmc_list($names){ $dmcs = wire('pages')->find("template=dmc, DMC_represented=1, sort=DMC_country_represented"); $dmcs-&g
  11. Thanks Alxndre' So didn't actually do the app programming myself, but I what I did have to do know my own site structure well and then learn how that related to the real database structure behind processwire; which for a novice like me wasn't instantly obvious. I'm sure there's far more technical ways of interpreting the schema, but the way I like to think of it is processwire makes virtual tables of the real sql tables.I then had to explain all the structures to the developer who i have to admit is far more proficient at databases than I! The app is build for iOS and android. The iOS can
  12. So a while ago I started a thread about using an existing processwire as the back end for a mobile app. There was some discussion about how viable it was, but i've been working with another developer and we've started to get somewhere. This iOS app https://appsto.re/gb/mtaH_.i uses http://www.dudmc.com/ as the back end. It's not perfect but we're pretty pleased so far.
  13. Thanks guys. I'll do some research into each of those methods and see what I can do. It's only for a prototype to prove the concept so authentication isn't a real issue... The model is likely to go to a bespoke developer once proved. Cheers
  14. Have a read of this: http://www.w3schools.com/html/default.asp Then use php to output some of those statements like this. just try creating a file named mypage.php with the following content: <? php echo "<h1>The title of the page is....</h1>; echo $page->title ; ?> You'll then need to apply in processwire that template to a page you make.
  15. We're doing a rapid development project as a proto type using an android app and processwire as the back end. In essense the app captures some data and then needs to send it to a server. It will be a short list of strings and integers along with an image. Both the app and the backend database have been built to show the concept but just to tidy things up we're looking at showing the data moving from one to the other. Does anyone have any simple ideas? I've thought about using the email to page module by getting the app to send the data to an email address along with the image and then allo
  16. got there in the end <?php /** * Search template * */ $out = ''; if($q = $sanitizer->selectorValue($input->get->q)) { // Send our sanitized query 'q' variable to the whitelist where it will be // picked up and echoed in the search box by the head.inc file. $input->whitelist('q', $q); // Search the title, body and country fields for our query text. // Limit the results to 50 pages. // Exclude results that use the 'admin' template. // load my directed search results table $q = htmlentities($q); $keywords = preg_split("/[\s-]+/", $q); $selector = ''; /
  17. ok, I've worked on this and found a more hybrid solution. I've created a list of search terms and corresponding results. I test the search term to see if it matches any of the pre determined search terms and if it does it creates the selector. If it doesn't it continues with the organic search. The part I've got stuck with is when someone inserts an ampersand. It breaks the page resulting in this: and yet the ajax request processes it fine? any ideas please. <?php /** * Search template * */ $out = ''; if($q = $sanitizer->selectorValue($input->get->q)) { /
  18. where do you mean to express that? I can't get it to filter
  19. I have a number of pages brought back in the array and I want to test to see if each any one of the pages in the array has a certain field with content. I could probably loop through the array but seem to remember if there was a simpler method. I've tried the below which doesn't work: $showcases = $pages->find("template=dmc_update_link, DMC_select=$pageid, parent=1209"); $countshowcases = count($showcases); if (($countshowcases > 0) && ($showcases->DMC_update_doc !=="")) { echo " <a data-toggle='collapse' data-parent='#accordion' href='#collapsefour' class='li
  20. Hi Steve, just to clarify what's going on I'll explain my scenario. Searching normally works just fine. A while ago though I changed the search operator to ~= as %= just brought back too many irrelevant results eg Oman inside rOMANian. Using my lesson from Dave p I understand that even having split Sri Lanka, Sri is under the three letter limit of SQL, presumably to exclude ands and is etc. Although rather crass my method of the simple "if this" then force the result should actually work for me. I'll probably eventually build this into an array either kept hard in the code or a set of p
  21. I'm afraid I may have cheated and taken the easy option with this due to the unwanted to results... $keywords = preg_split("/[\s-]+/", $q); $selector = ''; foreach($keywords as $kw){ if ($q == "sri lanka") { $selector= "id=1330,"; }else{ $selector .= "Meta_keywords|DMCcontact_Country|DMCcontact_Address_2|DMC_Email~=$kw, ";} } $selector .= "template=dmc, limit=50"; // echo $selector; $matches = $pages->find($selector); Thank you for your help Pete. At the moment there is only one country that had this split short word issue, but if there are more I may have t
  22. It was almost there i think. The debug output was this: Meta_keywords|DMCcontact_Country|DMCcontact_Address_2|DMC_Email~=sri, Meta_keywords|DMCcontact_Country|DMCcontact_Address_2|DMC_Email~=lanka, template=dmc, limit=50 and yet, it didn't return the sri lanka page?
  23. Thank you, but this was how I used to have it set up. The problem then was searching Oman also brought back rOmania.
  24. I'm using the following line to search for articles: $matches = $pages->find("Meta_keywords|DMCcontact_Country|DMCcontact_Address_2|DMC_Email~=$q, template=dmc, limit=50"); but, where a user searches for something like 'Sri Lanka', it doesn't recognise the two words. One of the fields it searches is the keyword field, so it wouldn't be a problem if I put a hypen or something in like the 'Sri-Lanka' as long as the user could type 'sri lanka'. Any suggestions how i could make this happen?
×
×
  • Create New...