Jump to content

maxf5

Members
  • Posts

    143
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by maxf5

  1. @abdus sorry, doesn't help in this case.. It only happens with installed modules. Could there be issues with following? $config->dbCache = true; $config->sessionChallenge = true; $config->sessionFingerprint = true;
  2. Hey guys, whenever i install a new modul it works but when i want to go in the settings of the module i get an error: ProcessWire 3.0.72
  3. It's been a while and i share my first results: 1) Make some pages with FieldtypeMapMarker 2) Build a form with an input for the Zipcode/PLZ and a select for the radius. 3) upload the .tab file in your template (german zipcodes) tomorrow i will make the styling and getting the distance between plz and results and render the google maps. code: define("OGDB_LOCAL_DATA_FILE","./PLZ.tab"); function plztolatlong($plz) { $fileData = @file_get_contents(OGDB_LOCAL_DATA_FILE); if ( $fileData == FALSE ) { die("ABBRUCH: konnte Daten nicht laden (".OGDB_LOCAL_DATA_FILE.")\n"); } $fileData = explode("\n",$fileData); for ( $i=1; $i < count($fileData); $i++ ) { $fileRow = explode("\t",$fileData[$i]); if ( $plz == $fileRow[1] ) { $origin_lon = $fileRow[2]; $origin_lat = $fileRow[3]; $city = $fileRow[4]; } }; $out['lat'] = $origin_lat; $out['lon'] = $origin_lon; $out['city'] = $city; return $out; } $distance = $input->post->radius; // Get distance $plz = $input->post->plz; // Get PLZ $getlatlng = plztolatlong($plz); // plz to lat and long $lat = $getlatlng['lat']; // just for test reasons later $lng = $getlatlng['lon']; // just for test reasons later echo "<pre>"; print_r($getlatlng); echo "</pre>"; echo "LAT: " . $lat . "<br />"; echo "LONG: " . $lng . "<br />"; $radius = 6371; // earth's radius in km = ~6371 // latitude boundaries $maxlat = $lat + rad2deg($distance / $radius); $maxlat = str_replace(',', '.', $maxlat); $minlat = $lat - rad2deg($distance / $radius); $minlat = str_replace(',', '.', $minlat); // longitude boundaries (longitude gets smaller when latitude increases) $maxlng = $lng + rad2deg($distance / $radius / cos(deg2rad($lat))); $maxlng = str_replace(',', '.', $maxlng); $minlng = $lng - rad2deg($distance / $radius / cos(deg2rad($lat))); $minlng = str_replace(',', '.', $minlng); $q = "template=filialen, mapfield.lat>=$minlat, mapfield.lat<=$maxlat, mapfield.lng>=$minlng, mapfield.lng<=$maxlng"; $results = $pages->find($q); echo "<h2>Ergebnisse</h2>"; foreach($results as $r) { echo "<h3>{$r->title}</h3>"; echo "<p>{$r->mapfield->adress}</p>"; echo "<p>{$r->filial_tel}</p>"; echo "<p>{$r->filial_mail}</p>"; echo "<p>{$r->filial_www}</p>"; } echo $ff; FILES: PLZ.tab
  4. Hey PW fanatics, i have various images which are getting cropped with the $image->size(); function in the template. Some gradients are looking crappy, so that i want all images on the website to get re-sized again. Is there a simple way to do this?
  5. I had the same discussions when i joined a new agency and when we started to make a relaunch of one of our sites. They all wanted Typo3 or WP, but fortunately i could convince them to use ProcessWire and i was happy as f*ck. You save at least 50% of time when building functions with the awesome PW API comparing to other CMS. You can use PW for small and large sites, where other CMS would be a total overkill. I experienced that so called big CMS with ~100 Sites have a loading time of > 4 seconds (even with caching, gzip, css + js compression, .. ). From one to endless languages or PW Sites with > 100.000 subsites shared in the forum, theres no limit in my opinion. After 2 years of developing with PW, it was the best decision of my life switching from Typo3 and WP. Just warn your Co-Workers working with PW is addictive and they'll never come back
  6. thanks for everything @abdus ! I merged the database of the crashed one with the backup db. After some trys it worked again : ) I still don't know how did that happen, added three fields to a template in the backend -> Reno crashed -> Default Admin Theme worked for 5 seconds -> then these errors. It was a PW 3.0.71 installation. Well, hope won't happen in future.
  7. Hey @abdus, my files (/wire and /templates) are fine. I duplicated the files on a local xampp with a database clone of the site 1 week ago. Then it works fine. If I import the live-version database, i have the same problem. So something crashed inside the db.. permissions/page-rights or languages.
  8. So it seems that no default language is set? I deleted my cookies to logout from the admin: now i have no permissions to view the backend..
  9. Hey, i just added some fields to a template. After long loading time suddenly the backend changed from "Reno" to the default admin theme without a cause. I went back to the tree view and suddenly all i can see is attached: I worked 2 weeks on the site. Everything was fine..
  10. This rules, Robin! i am using it for a similar case where the select field in the repeater should be highlighted if selected. (later on three highlights are shown in a teaser) if($p->techhighlight == 1) { $fieldset->addClass('is-highlight'); }
  11. hey guys, try: // replace 38 with the id of the user role, here 38 = superuser $items = $users->find("roles!=38"); foreach ($items as $i) { // returns guest, superuser excluded echo $i->name; } you will find the role-id in the url when you edit Admin > Access > Roles > guest, superuser, login-facebook,...
  12. exclude all users which have the role "facebook-login". $users->find("roles!=login-facebook"); transposed digits (Zahlendreher)
  13. Is there any solution to make MarkUpRegions work when you have your general markup in prepended or appended files, @ryan ? I am really excited about this feature and cant use it so far
  14. thank you all, guys! I think i will now find a way to make it work. I will post my solution here when its finished. (will make the radius search at the end of templating).
  15. alternative method: BLOG - CAT1 POST POST - CAT2 POST POST NEWS - CAT1 POST POST - CAT2 POST POST
  16. These topics are in Dev Talk But it's not a bad idea at all to make a section called "Frontend & PW", where people can share snippets about rendering a multi-level-nav for UIKIT and so on.
  17. Why don't you make a "Select Options" field inside the Posts and determine the category there.
  18. I would use a Page Reference field in this case. then you can use: $r->reference->title; $r->reference->url;
  19. Wont something like this work for you? <?php $sections = $pages->get("/page1")->children; foreach ($sections as $s) { $type = $s->template; switch ($type) { case "template2": $out .= "<h2>{$s->title}</h2>"; $out .= "<p>{$s->text}</p>"; break; case "template3": $out .= "<h2>{$s->title}</h2>"; $out .= "<img src='{$s->img}'>"; break; } } echo $out; ?>
  20. Hey guys, i am planning a "radius search" for branches (in Germany). Within a form the user inserts his postal code and choose from one of the distance (20km, 50km, 100km) and gets all the branches in his radius. The branches are saved as pages with the fieldtype MapMarker, where you have latitude and longitude. ( http://modules.processwire.com/modules/fieldtype-map-marker/ ) did somebody did something similar in the past? I am just asking, before i will spend the whole weekend in front of the pc
  21. @szabesz , yes.. some problem with <pw-region> in _main.php <pw-region id="something"> ... </pw-region> in basic-page.php <p pw-append="something"> 12123123123 </p> and you get: Settings: $config->useMarkupRegions = true;$config->prependTemplateFile = '_main.php'; ProcessWire 3.0.69 PHP VERSION 7.0.18
  22. is there still a bug? Same problem here on Processwire 3.0.69 $config->useMarkupRegions = true; $config->prependTemplateFile = '_main.php'; in _main.php <?php namespace ProcessWire; include_once("./_init.php"); ?> .... <region id="dummy"> <h1><?php echo $title; ?></h1> <?php echo $teaser; echo $content; ?> </region> in basic-page.php <?php namespace ProcessWire; ?> <p pw-prepend="dummy"> 123 </p> Voila:
  23. Holy shit, it works! thank you so much. And sorry for the long questions, i shoud have learned other template strategys earlier. I will share my codes when its all finished for people who are interested. I built some kind of page/grid-builder with uikit and PageTables. Will now look at Page Table Extended.
  24. Hey @evan, thanks for your time and patience. My content-blocks aren't stored as subpage on the particular page. I collect them in an unpublished page (called Views, due to menu reasons). Is there a chance to search in the content of the blocks referring to the linked page? This will of course return the one unpublished page where all blocks are stored (Views) <?php $q = $sanitizer->text($input->get->q); $input->whitelist('q', $q); $q = $sanitizer->selectorValue($q); //selector normal content $selector = "title|headline|summary~=$q, limit=50"; // selector content blocks $views_query = [ 'template=Text|ParallaxBanner', // Template 'textfield|parallaxtext*="'.$q.'"' // Fields ]; if($user->isLoggedin()) $selector .= ", has_parent!=2"; // normal pages $matches = $pages->find($selector); // Find parent pages of content blocks $views_results = new PageArray(); foreach ($pages->find( implode(', ', $views_query) ) as $p) { $views_results->add($p->parent); } // Combine results $matches->import($views_results); ?>
  25. I was testing out that solution @evan Works pretty well so far. I put the range slider to each template block to set the grid widths for desktop, tablet and mobilephones. Atm working on the output of the grids and cols. There are a few question i have in mind. 1) My website has a search engine, so how you can search in those blocks? I think you can just use field.subfield but not field.subfield.subsubfield as selector. Like my PageTable field is called views. $selector = "title|views.accordion.textarea"; $results = $pages->find($selector); 2) PageTable extended would be kickass, but i am using blank templates without PHP Files. Rendering wont work as far as i read the docs.
×
×
  • Create New...