Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by biber

  1. Some years ago I built a site with the help of the 'Image extra'-module. After some problems I decided to change to the modern way with a field-images-template. Now I want to copy the contents of that old Image-extra-field to my new fields. Is there a way to do that for all images at once?
  2. Hi @adrian, thanks for your fast reply. I will try out this in the next days. Tonight it's time for bed.
  3. I deleted an amount of files in the database (via phpMyAdmin). After that I was able to edit the page again. Thank you for your help, I am still learning ... Now I created some subpages to avoid this trouble again. Is there an easy way to move some images from the parent page to the subpages (preferred complete with title, description, etc.)
  4. maybe, its a problem with the image-extra module?
  5. Hi @kongondo, now the images are deleted, but the page 'meine Heimat' still shows the name of the deleted images.
  6. save $p seems not to be the correct syntax???
  7. Hi @kongondo, I have modified your script like this: <?php include('./_head.php'); // include header markup ?> <?php if($user->isSuperuser()) { $p = $pages->get(1029); // delete some images based on some condition foreach ($p->images as $img) { if($img->filesize<300000) continue;# if some condition met, skip deleting this image echo $img->name.'wird gelöscht<br>'; $p->images->delete($img); } // if deleting all #$p->images->deleteAll(); }?> <?php include('./_foot.php'); // include footer markup ?> and saved as a template 'loeschen'. Then I created a Page 'Bilderloeschen' based on this template, but without any further content. If I call this page it shows me "imagename wird gelöscht", but after that all images are still there. Can you tell me, what is missing here? Thank you in advance Günter
  8. Hi @kongondo, I'm still a beginner, so it takes time to come along. But I will try to use your script tomorrow. Thanks a lot Günter
  9. Thanks for Your replys. @adrian: Debug mode is enabled, but none of the logs shows any error. I don't think, I have the right to increase PHP memory. @kongondo: Yes, I think about dividing this page into smaller pieces. But how can I delete an amount of images without the edit-funktion on my backend? As I described, deleting files in the directory >site >assets >files >1029 by FTP does not help.
  10. Hi, I'm running the site http://malabu.de with a number of picture galleries. I can edit all pages (add and remove pictures, etc.) but the one called "meine Heimat". If I try to edit it, I get an 'Internal Server Error'. This page contains about 300 images, about 500k up to 8M big. Maybe, this is too much, but how can I get rid of the surplus files? I tried to delete some of the images in the directory >site >assets >files >1029, but this did not help. Any ideas?
  11. Before I came to PW, I wrote my websites in simple text-editors, finally with notepad++, which is a great help even for HTML, CSS and PHP. So I'm familiar with HTML-tags and CSS-syntax. I like to keep things simple to realize fast loading and good care. Therefor I did not yet use any framework or even a WYSIWYG-generator. And that is why I like PW: I have the freedom to write and control my own code. But I'm shure, I have to learn much more about all the convenience this program can give to me. Thanks to You all.
  12. @szabesz : Thanks for the hints. I looked at the several alternatives, maybe I will use it later. For now I have changed the content of the 'Pflanzenhof'- and 'Gartengestaltung'-pages so that the visitors see 'real' content. This seems to be better. If now all visitors with current mobiles are able to see an error-free site I will be satisfied.
  13. If I do it without a logo on top, the page comes as I expect it. Especially in the mobile version it may be a little bit confusing to see the same menu one below the other, but is that a big mistake? @szabesz: The off-canvas menu uses javascript, which I tried to avoid.
  14. Hi and thank you again, yes, @Klenkes, you are right, this was my simple solution to hide the menu. I've tried some methodes to solve that menu open/close problem, but for I use only pure html and css, I did not find another good example yet. For me it sounds logical: I want to go to the next page - click on Menu - the long menu appears - I choose a page - the menu vanishes again. @dragan: I know about that issue, but did not find the reason yet. All other links work OK, but the top links 'Pflanzenhof' and 'Gartengestaltung' should lead to the part of the menu belonging to that part of the nursery. For that I use the following code, slightly modified from the main menu: <?php include("./_head.php"); ?> <div id='haupt'> <ul> <?php echo '<img src="'.$page->logo->width(300)->url.'" alt="'.$page->logo->caption.'" title="'.$page->logo->caption.'">'; // top navigation consists of homepage and its visible children $grouppage = $page; $children = $grouppage->children(); /** * Recursive traverse and visit every child in a sub-tree of Pages. * * @param Page $parent root Page from which to traverse * @param callable $enter function to call upon visiting a child Page * @param callable|null $exit function to call after visiting a child Page (and all of it's children) */ function map(Page $parent, $enter, $exit=null) { foreach ($parent->children() as $child) { call_user_func($enter, $child); if ($child->numChildren > 0) { map($child, $enter, $exit); } if ($exit) { call_user_func($exit, $child); } } } map( $grouppage , function(Page $page) { echo '<li><a class="men" href="' . $page->url . '">' . $page->menutitle . '</a>'; if ($page->numChildren > 0) { echo '<ul>'; } } , function(Page $page) { echo '</li>'; if ($page->numChildren > 0) { echo '</ul>'; } } ); ?> </ul> </div> I am still learning and am very glad to have the friendly help from you all.
  15. @Klenkes: Thanks for your fast reply. I know, malabu.de is not yet mobile-ready, I'm working on converting it to a flexbox-design. This will still take some time because I'm just a hobby-webdesigner.
  16. Hi, I've tried to test my sites http://bielenberg-soerup.de and http://malabu.de on different hardware. Because I dont have any apple-equipment I used some websites, which promise to show the content on IPhone and Co (http://www.responsimulator.com, http://mobiletest.me). But none showed my pages. In general they seem to work, I tested it with my old site http://bielenberg.hostingkunde.de. Is there anyone with real equipment, who can tell me, if the pages are shown correctly?
  17. @blynx: thanks a lot, I've used your second version and it works like a charm.
  18. Hi, I've built a site for my wife (malabu.de), which is already published. But there are still some things i want to work on. For not disturbing regular guests I would like to have a subdomain like dev.malabu. de which leads me to the same site, but with my own (experimental) CSS. Is there a way to do this?
  19. @adrian: with the modification of pmarki's code (see above) works as expected.
  20. @pmarki: Thanks for that hint, it could have been happened ... But I used a different browser to visit the page as a guest. I found another reason, why your code did not work for me - you wrote: if($session->get('visit_counter_flag') === 0 && !$user->isSuperuser())... as long as a page is not requested yet, there is no 'visit_counter_flag' with the value '0'. I changed '===' to '==' and the counter works. What I have now is a counter that increases when a guest visits the first page of his session. It could be interesting to 1. merge the counters of the single pages to get the number of all visits. 2. count the visit of the second, third ... page within the session. So I had two values: 1. Number of visitors 2. Number of visits of every page. Because I am still a beginner in PHP, I dont know how to realize it.
  21. I will try it tomorrow, thanks and good night.
  22. Hi adrian, thanks for your reply. Yes, I changed visitCounter to siteviews in my code. And I also found a 'field_siteviews' in the database, but it contained no lines even if I visited the site as a guest. But still no output ...
  23. I have added a file site/ready.php and filled it with pmarki's code, modified with LostKobrakai's line. Then I added a field 'siteviews' to all my templates and put this into the '_foot.php': echo '<br>Besucher: '.$session->siteviews; I also tried '$page->siteviews' and ' $pages->siteviews', but the field still remains empty. Is it necessary to include the site/ready.php? And if, how do I do this? I'm still a beginner in PW and PHP.
  24. Hi thanks for Your fast replys. Now I removed the field from the '_foot'-template and added it to the main templates and the error does not appear anymore. But now the counter increases with every page call. I want to count the sessions independently the called pages. I think, this is, what you, @pmarki tries to tell me. But where do I put this line?
  • Create New...