Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by dragan

  1. Yes, absolutely. What I just noticed: After hitting "save", normally I get redirected to /page/edit/?id=1018&s=1 This doesn't happen anymore. it's always just /page/edit/?id=1018# Why isn't the &s=1 not appended anymore? o_O
  2. Here are the headers from Firefox in the attachment. Does anybody see something strange? o_O
  3. The only thing that Firefox debugger finds, is: Error: TypeError: e is null /wire/modules/Jquery/JqueryCore/JqueryCore.js?v=183 line: 2
  4. I have noticed a strange thing ever since upgrading to or installing 2.3.8. Whenever I edit a page and press "save", the page doesn't reload. It just shows a blank screen with the current URL, e.g. http://www.mydomain.com/pw/admin/page/edit/?id=1061 The edits ARE saved - that's not the problem. Just the blank screen. I have to manually get back or hit reload / F5 in the browser. I've tried switching from Chrome to Firefox. I've also tried switching to the old admin theme - no luck. Clearing browser cache: same thing. To clarify: This happens when editing / creating / saving pages, and e.g. using the batcher module. Editing fields and templates behaves normally. Is this a known bug? I noticed this behaviour now in three sites, all running on 2.3.8.
  5. @Xeto: Using custom image-sizes (cropping / resizing) is very well documented and easy. Adding a lightbox / fancybox / shadowbox CSS + JS in your header, and adding the necessary rel=[foo] in your templates is easy too. Tags / archive / blog functionality: There's an excellent Blog Profile you can install. Also, there's a date archiver module already out there.
  6. @houseofdeadleg: Thanks for the info. Unfortunately, I didn't know about this. Will try to implement that asap.
  7. Bienvenu au forum icietla There are probably many workarounds for that scenario. You could create a checkbox inputfield, and check the value in your head or init.php template. If that checkbox is checked, you could do a redirect to the other language. if($page->redirectLang == 1) { $user->language = "en"; $session->redirect($page->url); } (untested)
  8. Thanks. I installed it now on a live server, but now I get still no infos at all, and in addition: Error: Call to a member function render() on a non-object (line 19 of /home/foo/public_html/site/templates/map.php) line 19 = echo $map->render($page, 'map'); // straight from the Module docs / example Also, in page edit mode, I still see "Geocode OFF" below the map - or "N/A". To add to all these oddities, the address never gets saved. When I re-edit the page, the address is gone. PW 2.3.8, Google Chrome, PHP 5.4.12
  9. I've installed this module for the first time locally, on PW 2.3.8 dev. The backend looks fine - except a notice at the bottom: Geocode OFF Anybody knows why? In my map template, I have just this: // head: <script type='text/javascript' src='https://maps.googleapis.com/maps/api/js?sensor=false'></script> // body: <?php echo $page->marker->address . '<hr>'; // outputs the address you entered echo $page->marker->lat . '<hr>'; // outputs the latitude echo $page->marker->lng . '<hr>'; // outputs the longitude $map = $modules->get('MarkupGoogleMap'); echo $map->render($page, 'map'); ?> What I actually see in the rendered frontend, is just this: <div id='mgmap1' class='MarkupGoogleMap' style='width: 100%; height: 300px;'></div><script type='text/javascript'>if(typeof google === 'undefined' || typeof google.maps === 'undefined') { alert('MarkupGoogleMap Error: Please add the maps.googleapis.com script in your document head.'); } else { var mgmap1 = new MarkupGoogleMap(); mgmap1.setOption('zoom', 18); mgmap1.setOption('mapTypeId', google.maps.MapTypeId.HYBRID); mgmap1.init('mgmap1', 0.000000, 0.000000); mgmap1.addMarker(0.000000, 0.000000, '/path/to/google-map-test/', 'Google Map Test', ''); }</script> No map is shown, no address or lat/lng are shown either. Is it necessary to add your own GM API key somewhere? Is it known to simply not work from localhost / Or do I have to change the GM JS URL or add parameters? (v3)? Thanks in advance for tips and pointers.
  10. A small PW-based site for a Swiss photographer has just left the door: http://www.nicolasaebi.ch/ Nothing too fancy here. A couple of gallery-pages, using mainly isotope and fancybox. Responsive. Minimal.
  11. Oh, that's absolutely lovely. I searched the PW forum and Google, but that module didn't show up in results. Thanks!
  12. Did you try http://www.php.net/manual/en/phardata.extractto.php ? On my host, this seems to be enabled, i.e. I see it listed when I do phpinfo(). Seems to be pretty easy to use. Example I found somewhere: // decompress from gz $p = new PharData('files.tar.gz'); $p->decompress(); // creates files.tar // unarchive from the tar $phar = new PharData('files.tar'); $phar->extractTo('new_dir');
  13. OK, so I found the dev $log API already here: https://github.com/ryancramerdesign/ProcessWire/blob/dev/wire/core/WireLog.php And I found out to use $user = $this->wire('user')->name; The 14 useless empty lines were caused by stupidly naming the function the same as the module itself, d'oh. The only remaining question now is to list fine-grained infos about the edited fields (mainly text, but file- and edits in image-fields would be useful too - at least new uploads and deletes). I don't need "old content before save" and "new content after save" - just knowing which fields were edited would be awesome.
  14. I'd like to write a simple module: Creating a log that lists page-edits, i.e. which user has edited which page and when. Write each new entry to a new line in a text file in site/assets/logs/edits.txt. Simple enough. Following the Helloworld.module example, I came up with this: public function init() { // add a hook after the $pages->save, to issue a notice every time a page is saved $this->pages->addHookAfter('save', $this, 'logEdits'); } public function logEdits($event) { $page = $event->arguments[0]; $logFile = '/home/foobar/public_html/site/assets/logs/edits.txt'; $fh = fopen($logFile, 'a'); $now = date("Y.m.d H:i:s"); $stringData = "{$page->path}\t{$page->url}\t{$page->title}\t$now\n"; fwrite($fh, $stringData); fclose($fh); } It works - somewhat. I'm confused though why I get 15 lines on each page save(). I get 10 empty lines, then /de/medienecho/ /de/medienecho/ Medienecho 2013.12.08 15:17:23 then another four empty lines. Should I be using something else than $this->pages->addHookAfter('save') ? Does anybody know why I get 14 empty lines instead of just the right one, once? o_O Also, if I wanted to a) list the username and b) list each edited field how would I go about that? I saw on the roadmap for 2.4 that a new $log API will be available, but I'm curious if I could write something now already without it. The var $user->name is always empty. How do I access that from inside a module function? Sorry, but I'm totally new to writing modules and using hooks...
  15. Not sure I understand. You can simply re-upload a new site/config.php file to the server, from a fresh PW installation, i.e. edit lines 219-223: $config->dbHost = 'localhost'; $config->dbName = 'foo'; $config->dbUser = 'bar'; $config->dbPass = 'asdfasdfasdf'; $config->dbPort = '3306';
  16. Have a look at the $config stuff here: http://cheatsheet.processwire.com/ (e.g. $config->httpHost)
  17. I recently wrote a tiny little frontend template script for querying a product catalogue, to get JSON results back (i.e. not a module - have just discovered the module and this forum thread today). It's supposed to feed an iOS app, sooner or later. As expected from working with PW, it was all easy and straightforward. Since my site in querstion is also using multilang features (4 languages, PW 2.3.2 version), I simply query german language data via domain.com/de/API/?foo=bar?etc.etc. and french data with domain.com/fr/API/?foo=bar?etc.etc. But it would be relatively easy to output all four languages with the same "web service" URL, if really needed. I guess something like this should be all that's needed: $user->language = $languages->get("en"); // the following selector query will return english $user->language = $languages->get("fr"); // the following selector query will return french $user->language = $languages->get("default"); // the following selector query will return default lang. And if you only want to use ONE service page URL, and decide to just get ONE language back, simply use another GET param (〈=en) and a switch / if-else statement in your code.
  18. fwiw, you can also just use two input fields (publish_start / end), and keep the pages hidden by default. All you need to do then, is adjust the selector when listing events / pages include=hidden / or include=all. (i.e. not using lazycron).
  19. URL: http://bourneweb.com/|{gzip} Infektion: JS:HideMe-J [Trj] Is all I see with Avast (can't even look at the HTML source code...)
  20. I'm sure that would be easy to do, e.g. in a "readme" file. But generally speaking, just have a look at the template file(s), and all the include / require files, and that should give you a good overview of "what happens where".
  21. This is a bit ambiguous. Do you want to create a new page for each CSV import? Or do you want to update existing pages (= update fields for already existing PW pages)?
  22. I'm not aware of some plug-and-play frontend examples*, but it's definitely possible. http://php.net/manual/en/function.fgetcsv.php If you're familiar with the PW API, then creating pages, or updating existing pages / fields should not be too complex. * there's the excellent "import from CSV" module, but that only runs from within the PW backend. http://modules.processwire.com/modules/import-pages-csv/
  23. I'd try to clear the browser cache (and logout/login again), and/or update to latest stable version, and/or run some sort of browser dev tool to see possible JS errors / warnings. (and maybe even trying to access the backend with a different browser altogether)
  24. dragan

    Pet Peeves

    What are your personal pet peeves, when it comes to general web / online / digital stuff? I'm gonna start with one of my most-hated "features": lazy loading technique taken too far (as in "load images / assets only when the user scrolls down") The general idea behind it was certainly fine and noble: Load + show additional content only if the user decides to scroll further down a page, otherwise hide that content. Avoid having to wait for content loading that I might - or might not - be interested in. Problem is, that some site-owners not just use, but abuse that method. Case in point: Flickr. It's almost impossible to reach the footer links / menu, because the page keeps loading new pics forever. You may see the footer for a split second, but it disappears again, when addtl. content loads. What's wrong with using pagination? Is that too "old-school"? Making it hard for visitors to reach a certain navigation section is certainly not "best practise", or user-friendly. Some sites have simply exaggerated it to the point, where I'd rather see a "skip intro" button (and that's saying something!). So, what's your favorite pet peeve, when it comes to websites, apps et al?
  25. You can save variables to the page array easily (without having to create input fields first). $page->setOutputFormatting(false); $page->food = array('apple','banana','orange','grape','pasta','sandwich','bread','coffee'); $page->save(); $page->setOutputFormatting(true); echo "<b>Shopping List:</b><br>"; foreach($page->food as $f) { echo "$f <br>"; } You should be able to call such a var from any other tpl / page then, as if it was a tpl-field: $foo = $pages->get(345)->varname. Maybe that way you can store these calculated values for further use in the list?
  • Create New...