dlen

Members
  • Content Count

    25
  • Joined

  • Last visited

Community Reputation

6 Neutral

About dlen

  • Rank
    Jr. Member

Profile Information

  • Gender
    Male
  • Location
    Berlin
  • Interests
    Meditation, Climate Change

Recent Profile Visitors

987 profile views
  1. dlen

    I had a vicious [] operator not supported for strings (line 133 ….) - problem, after casually upgrading the module. I could not access the backend anymore. I had PHP 5.6 running and tried out 7.0 and 7.1 without success. Then in my desperation I resolved to fiddling the module code (I have pretty weak PHP knowledge). In simplecontactform.module, line 133 , I changed foreach (self::$additionalFields as $f) $allFieldsExtended[] = $f; to foreach (self::$additionalFields as $f) $allFieldsExtended = (array)$f; and at least I was again able to keep on working. But I don't know, whether the module is working fine now, as I have my contact form without module. Might help some poor guy one day...
  2. With this script a strange problem appears: (solution below) When loading first, i.e. with $session->secondvisit nonexistent and setting $user->language to 'de' (in my case), the menu is correctly shown in german the language menu correctly shows the german link as active but the content is shown in the english version the url in the address field does not show the /de characteristic for the german content tree One remark, of which i do not know the importance: the site is redirected to a subdirectory. The URL ist http://agustin-rivas.com. If someone has seen this before and can give a clue, i'll be grateful. -------------------------------------------------------------------------------------------------------- solution --------------------------------------------------------------------------------------------------------- It was a timing problem. I had put the above function into the main template php file, which is executed a f t e r the php files for the different page templates. So the content variables were filled with the $user->language still not correctly set. Moving the function code to the _init.php file, which is executed b e f o r e the page template php files, solved the problem. Took me 2 hrs to figure it out believe it or not...
  3. You are probably right, may be I (or somebody else) adds something to it. For the time beeing i don't see i have the resources for it.
  4. Hi there, I got a template with a field of type "file" in it. If the client did load a file up, a download link is shown - otherwise nothing. The templates name is "termin" and the fields name is "termininfo". middlecontent is some string that collects the HTML. My method to find out, whether a file has been uploaded, is the following: if ($termin->termininfo) $middlecontent .= "<a href='{$termin->termininfo->url}' target='_blank'>INFO</a>\n"; else $middlecontent .= "<a class='hidden'></a>"; My question is, why in some cases, which i cannot really reproduce, the condition $termin->termininfo is false, although a file has been uploaded. This occurs only in a fresh dataset, where no file has been uploaded previously. Maybe there is a better way to check for the existence of the uploaded file. cheers...
  5. An updated version with some more features /** * A recursive menu containing home. * If no root page is given, site root will be taken. * If and only if the second parameter is given, only pages will be included, that have a custom field of type "checkbox", * and the latter has to be checked. This field is the parameter to be given. Example with field "in_main_menu": * * selectiveMenu(null, $fields->in_main_menu); * * All submenu <ul>s get class "submenu". * All <li>s in the direttissima upwards of the page shown - except home - get the class "current". * All menu items, that have the template name 'no_content' do not have a link to their content, but act merely as switches * to their subpages. This template must have also the selector field, if the parameter is given. * * Intended to be used without arguments, i.e. "selectiveMenu();" , i.e. always starting with site root. * * @param Page root page of the menu * @param Field menu_selector_field pages with this "checkbox" field in their template set to "checked" are represented * @param string menu_id The id the outermost ul - tag gets. * @return string */ function selectiveMenu(Page $root = null, Field $menu_selector_field = null, $menu_id = null) { $shownPage = wire('page'); if(is_null($root)) $root = wire('pages')->get('/'); $level = count($root->parents); $ul_class_string = (($level > 0) ? "class='submenu'" : ""); $ul_id_string = ($menu_id ? "id='$menu_id'" : ""); $out = "\n<ul {$ul_class_string} {$ul_id_string}>"; $parents = $shownPage->parents; $items = $root->children; if ($level == 0) $items->prepend($root); foreach( $items as $item) { if ($item->$menu_selector_field || !$menu_selector_field) { $s = ''; $li_class_string = ( ( $parents->has($item) && $item !== $root ) || $item === $shownPage ? "class='current'" : "" ); if($item->numChildren(true) && $item !== $root) { $s = str_replace("\n", "\n\t\t", selectiveMenu($item, $menu_selector_field)); } $href_attr = ( $item == $root || $item->template->name != 'no_content' ? "href='$item->url'" : "" ); $out .= "\n\t<li {$li_class_string}>\n\t\t<a $href_attr>{$item->title}</a>$s\n\t</li>"; } } $out .= "\n</ul>"; return $out; }
  6. dlen

    Hi, I found a possible cause for the issue when tampering with my own menu function and running into the very same problem. In line 351 of MarkupMenuBuilder.module if($p->numChildren) $hasNativeChildren = 1;// has children to add is the function numChildren used. This function counts in default mode also hidden children. To make it count only visible children, it has to be used with a parameter: if($p->numChildren(true)) $hasNativeChildren = 1;// has children to add I tried it and it seems to work!
  7. dlen

    Ah, ok. I'll attach all files i think could be relevant. if you want more, just drop a line. It's the "newsletter" item, which has the empty ul.
  8. dlen

    Thanks for your answer. I can indeed make the empty ul make disappear by setting 'include_children' => 0 in the options. But then, also those items, which shall have their submenu, don't have one. Also, i can switch on an unintended empty ul in another menu, when i set include_children to 1 there.
  9. Hi there, actually I found a solution but I'd like to know, whether there's a better way. PW is installed in a subdirectory /pw/. In root there's the site in pure HTML, which I set up first and then integrated it into PW. Images, CSS and other resources are in subdirectories on the same level as /pw/. Now, as the PW version runs flawlessly, I redirected the domain to the subdirectory, where PW took over. I did this with the provider admin panel, not with some .htaccess in the root directory. The result was, that, with the server replacing all "domain.tld" strings with "domain.tld/pw", all queries to resources ran not to "domain.tld/img/..." but to "domain.tld/pw/img/..." , which gave of course the 500 error. The solution was, to simply copy all resource directories, like /styles, /js, /images &c. into /pw. The more experienced may have a better card in their sleeves? I am interested.
  10. dlen

    Hi, I got a problem, which makes me scratch my head a lot. I have a menu item with two children, which are 'hidden', but not 'unpublished'. (A newsletter opt in page with landing pages for the double-opt-in-process.) The menu generated looks like this (just the last 3 items): <li> <a href='/pw/de/impressum/'>Impressum</a> </li> <li> <a href='/pw/de/kontakt/'>Kontakt</a> </li> <li class="current"> <a href='/pw/de/newsletter/'>Newsletter</a> <ul class="submenu"> </ul> </li> As one can see, there is an empty ul in the last li. This causes some trouble with some jQuery - mobile - navigation generator. What is puzzling me is, that in a second menu, which just contains this last 3 items (a footer in the non-mobile version) this ul does not appear. I could not find any differences in the menu settings. FYI: runs otherwise smoohtly on pw 3.08 dev.
  11. Actually, people also hire jimdo specialists to take away even this light and - relatively - easy kind of work from them. And i can understand this - they just want to focus on their business and outsource any distraction, or they are still afraid of computers (yes, these people exist). jsww&c have one advantage - they act in a self controlled environment. Pay a little more per month, but no fighting with low RAM, register_globals - settings and the like.
  12. Hi there, I noticed, that one can easily import images from other pages into a textarea field in the backend, while the images field only allows for upload from the local machine. Correct me if i am wrong. Is there a possibility to copy images from another page, e.g. a special image repository page, into an image - type field from the backend, for the average page editor? Thanks for your thoughts.
  13. Hi there, the title says it mostly. I admit I am a bit afraid of the webwork market drying out, because everybody just goes to jsww&c. and sets up his/her site in an hour. And those tools become more sophisticated by the week. Opinions and informations??
  14. Hi there, in an image gallery with the following code foreach ($page->bilder as $bild) { $thumbnail = $bild->size($page->thumbnail_size,$page->thumbnail_size); ... a JS gallery function broke down with the error message: "unitegallery.min.js:6 Uncaught Error: Can't get image size - image not inited." I looked into the /assets/files/nnnn/ folder and found 5 images (of about 16 or so) having api - generated version with only 42 Bytes. 4 of them had the string "....0x0.jpg" in their filename, but the 5th had an unsuspicious filename. They were all generated within the same second, according to their timestamp. In the backend, they could neither be opened nor deleted. Via FTP they could be deleted. This fixed the problem with the gallery. In the /logs/exceptions.txt I found lines like leute_im_boot.0x0.jpg - not a recognized image (in /wire/core/ImageSizer.php line 257) In the errors log I did not find anything apparently related. Did anybody observe something similar? cheers - - -
  15. I find it a little hard to get together the documentation for the $languages - object. Maybe just me.