Jump to content

biber

Members
  • Posts

    93
  • Joined

  • Last visited

Everything posted by biber

  1. Thanks @ngrmm, I have read the announcement about the new custom field option. My problem is: I have a site with about 1500 images with more or less text in ImageExtraFields. This is stored all together in one field 'filedata' as shown in my first post. Now I want to separate this content and put it into fields 'caption', 'description', 'textarea', which are existing in the database, but empty. Here a screenshot of the database structure:
  2. Hi, I have built a simple website based on image-galleries some years ago. (malabu.de) To add descriptions I used the ImageExtraModule by just3be. In the database I can see, that some of the data are collected in the field 'filedata' in the table field_images, while the fields 'caption', 'description', 'textarea' stay empty. It looks like {"_109":{"data":"ehemalige Post","data1015":""},"_108":"schon lange gibt es hier kein Postamt mehr","_110":"S\u00f6rup","_111":"einhundertelf","_112":"2024-02-17 00:00:00"} very confusing. I would prefer to get the content seperated into the standard fields like 'caption', 'description', 'textarea'
  3. Thanks to @netcarver and @da² @da²: Including namespace solved my problem. Additional I had to learn to put this to the first line and to close it by ?>
  4. Hi, I copied my website malabu.de on a local LAMP-server which runs PHP 8.2.7 and got the following Fatal Error: As I am not very familiar with PHP I do not know, how to fix it. This is my _head.php-file: <!DOCTYPE html> <html lang="de"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title><?php echo $page->title; ?></title> <meta name="description" content="<?php echo $page->summary; ?>" /> <link rel="stylesheet" type="text/css" href="<?php echo $config->urls->templates?>styles/malabu.css" /> </head> <body> <!-- navigation --> <div id="menu"> <h1 class="titel"><a href="/">malabu.de</a></h1> <nav id="nav"> <ul> <?php // top navigation consists of homepage and its visible children $homepage = $pages->get('/'); $children = $homepage->children(); // make 'home' the first item in the navigation $children->prepend($homepage); /** * 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 visit(Page $parent, $enter, $exit=null) { foreach ($parent->children() as $child) { call_user_func($enter, $child); if ($child->numChildren > 0) { visit($child, $enter, $exit); } if ($exit) { call_user_func($exit, $child); } } } visit( $pages->get('/') , function(Page $page) { echo '<li><a class="men" href="' . $page->url . '">' . $page->title . '</a>'; if ($page->numChildren > 0) { echo '<ul>'; } } , function(Page $page) { echo '</li>'; if ($page->numChildren > 0) { echo '</ul>'; } } ); // output an "Edit" link if this page happens to be editable by the current user if($page->editable()) { echo '<li><a class="men" href="'.$page->editURL.'">Edit</a></li>'; } ?> <!-- öffne Mailformular --> <li><a class="men" href="mailto:info@malabu.de"><img src="<?php echo $config->urls->templates?>styles/brief.gif" width="25" height="15" alt="info@malabu.de" title="schreib mir"> </a></li> <!-- search form <form class='search' action='<?php //echo $pages->get('template=search')->url; ?>' method='get'> <input type='text' name='q' placeholder='Search' value='' /> <button type='submit' name='submit'>Search</button> </form> --> </ul> </nav> </div> _head.php
  5. Hi @LMD this saved my day! Thanks a lot.
  6. Hi, I played around with my Mysql-database and because I did not remember that database-password, I entered a new one. After that my website throws an 'Internal server error'. Any help?
  7. @BillH Hi BillH, now your script does exactly what it is made for. Everything works fine, and I have learned more about PHP. Thanks a lot!
  8. @BillH Sorry, but I am not very familiar with php-programming, so I didn't find the right place where to add your patch to your convert-script. Would you be so kind to post the whole script? Günter
  9. @BillH Thanks again for your help, I will try your suggestion immediately. kind regards Günter
  10. @netcarver I asked my webhoster: scripts are limited at 300 seconds, but my script stops at less than 60 seconds. So I addet set_time_limit(300); ignore_user_abort(0); to my script, but this did not change anything. Greetings Günter
  11. Hi BillH, thank You for the great help. Now the script runs, but unfortunately it stops after doing half of its job
  12. Hi BillH, now I added your script to one of my templates and called it with my browser. As long as I leave the saves commented out it runs as desired, but if I try to save the changes it comes up with an "Internal Server Error"
  13. 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?
  14. Hi @adrian, thanks for your fast reply. I will try out this in the next days. Tonight it's time for bed.
  15. 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.)
  16. maybe, its a problem with the image-extra module?
  17. Hi @kongondo, now the images are deleted, but the page 'meine Heimat' still shows the name of the deleted images.
  18. save $p seems not to be the correct syntax???
  19. 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
  20. 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
  21. 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.
  22. 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?
  23. 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.
×
×
  • Create New...