Jump to content

sww

Members
  • Content Count

    18
  • Joined

  • Last visited

Community Reputation

2 Neutral

About sww

  • Rank
    Jr. Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. hi, i did a relaunch of a website and the content team decided to change the structure, some of the titles … and urls. so lots of dead links out there. if the title/name of the pages would stay the same, no problem. i could look for pages->get(name=xxx) and throw a redirect to the new structure. but since titles/names changed i am bit lost here. there isn't a method like: pages->get(name% or *=xxx) right? the old system was a complete different one. so i cannot work with ids here.
  2. Because I want to display connected pages on my site by the order of that list … and make it easier for my client to re-order. new = on top = common sense. Thanks for the hint. I was thinking the same this morning. I'll check.
  3. Hey, is there a way pages will be added at the top of the list? When I add connected pages directly through the dropdown it works when altering the asmSelect js. It should also add new pages to the top that has been assigned in the background.
  4. hey there, set it up like this: basic-page: -created, -modified but when i modify a page nothing changes. the most recent created page stays on top. (modified gets ignored). am i missing something? also: how to reflect the page listing on my frontend? -created AND -modified wouldn't work. cheers
  5. Nope … ~= is even more restrictive … it needs the exact word. so typing "someb" … wouldn't give me anything. The fields I am searching need to have something like "ignore punctuation optional".
  6. Hey there, i am trying to add a kind of "intelligent" search. Is there any way to ignore punctuation and extra chars. e.g. When I type "somebody elses" that I still get the result "SOMEBODY ELSE´S CAR, 2005" The problem is the extra ´ … if I don't type it I don't get the result. So far I am using %=query (which isn't enough, I know) So the idea would be something like that: $selector = "sanitize(title|text)%=$q, limit=50"; I know, it's not gonna work like that … just to illustrate. Best, Stefan
  7. Hi there, I set up the Image Extra Fields + multilang support. UNF the second language is not showing when switching to the other page language. It always displays the default language. Custom field name is "img_title"; Trying to output the field like this: <?=$page->images->first()->img_title;?>
  8. @Soma yeah, just figured it out. stupid me … was thinking to complicated. thx anyway!
  9. Hey there, is there really no way to turn the OR logic into an AND logic when selecting pages by (e.g.) tags? so instead of $pages->find("template=exhibitions, tags=foo|bar") something like $pages->find("template=exhibitions, tags=foo&&bar") so the pages needs to have all requested tags, not just any of them. Thanks, Stefan
  10. @tpr @kongondo thanks again. but i took a second thought on that. for my purpose it's better the visitor gets a designed pdf having all the images in place instead of getting them as single files to their download folder. so i ended up using the fpdf library … works like a charm.
  11. tried full path too … thanks … will try it out asap.
  12. Hey there, i am knocking my brain out here … I am trying to generate a zip file based on image paths coming from a url parameter. Ended up using the zipArchive standard like this way: https://itsolutionstuff.com/post/php-how-to-create-zip-file-and-download-using-ziparchive-example.html. Also tried this method https://processwire.com/api/ref/wire-file-tools/zip/ before … UNF without any luck on both methods. All I am getting is a zip file with zero bytes. No errors appear. I think the file isn't even been created in the first place and it is just downloading the defined zip file coming from $fileName Here is my code: <?php $lb_images = "[".htmlentities($_GET['images'])."]"; // $lb_images = ['/site/assets/files/1062/image-1.jpg','/site/assets/files/1062/image-2.jpg','/site/assets/files/1062/image-3.jpg', ...] function createZip($files_ = array(), $destination = '', $overwrite = false) { if(file_exists($destination) && !$overwrite) { return false; } $validFiles = []; if(is_array($files_)) { foreach($files_ as $file) { if(file_exists($file)) { $validFiles[] = $file; } } } if(count($validFiles)) { $zip = new ZipArchive(); if($zip->open($destination,$overwrite ? ZIPARCHIVE::OVERWRITE : ZIPARCHIVE::CREATE) !== true) { return false; } foreach($validFiles as $file) { $zip->addFile($file,$file); } $zip->close(); return file_exists($destination); }else{ return false; } } $fileName = 'my_zip_'.time().'.zip'; $files_to_zip = $lb_images; $result = createZip($files_to_zip, $fileName); header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename=' . $fileName); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-Control: must-revalidate'); header('Pragma: public'); header('Content-Length: ' . filesize($fileName)); ob_clean(); flush(); readfile($fileName); exit; ?>
×
×
  • Create New...