Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/05/2016 in all areas

  1. The CSV format is so simple you can easily create a template to generate the right output. As an example: <?php header('Content-Type: text/csv'); header('Content-Disposition: attachment; filename="export.csv"'); $items = $pages->find("template=basic_page"); echo "title,url" . PHP_EOL; foreach($items as $item) { echo "\"$item->title\",\"$item->url\"" . PHP_EOL; }
    5 points
  2. Hi guys! I'm really happy to finally showcase this website in the forum. It's the website of a Porto based Digital Animation Studio. A bunch of talented folks, really. This is a heavily animated/scripted/ajaxed website, that makes use of CSS animations, transitions, transforms, HTML5 audio API, and so on and so on. I spent actually more time debugging than constructing it. Unfortunately, we didn't manage to kill all the bugs before the launching, so you might experience some along the way. We even had to give up on Safari (Damn buggy piece of software !!), and advice the user to use another modern browser. But we think it's still well worth it This is also the first website we developed but didn't design. The design is from the excellent The Royal Studio, from Porto. You might know some of their illustration work for the Adobe online tutorials. --- Enough talk, here is the link http://www.aimcreativestudios.com/ (No safari, please, you'll regret it) Hope you guys like it!
    3 points
  3. @POWERFULHORSE, if you have Imagick installed on your server you can try a slightly modified version (below) of the function I introduced in this post. // ImageMagick effects function imagickal($imagePath, $format, $method, array $arguments) { $path_parts = pathinfo($imagePath); $dirname = $path_parts['dirname'] . '/'; $filename = $path_parts['filename']; $mod = $method . '-' . implode($arguments, '-'); $mod = wire('sanitizer')->filename($mod, true); $savename = "{$dirname}{$filename}_{$mod}.{$format}"; if (!file_exists($_SERVER['DOCUMENT_ROOT'] . $savename)) { $image = new Imagick($_SERVER['DOCUMENT_ROOT'] . $imagePath); call_user_func_array([$image, $method], $arguments); $image->setImageFormat($format); $image->writeImage($_SERVER['DOCUMENT_ROOT'] . $savename); } return $savename; } I tested it as follows... $orig = "/site/templates/images/transparent.png"; $after = imagickal($orig, 'png', 'negateImage', [false]); echo "<img src='$orig'>"; echo "<img src='$after'>"; ...and the results...
    3 points
  4. i had this problem some days ago and wrote a simple script on both websites. both online on different domains: export on old website: <?php $export = false; if($export AND $input->get->export == 'blogitems') { echo "<?xml version='1.0' ?>"; echo '<pages>'; $parent = $pages->get('/blog'); $results = $parent->children(); //$results = $pages->find('id=3198'); // ohne pic //$results = $pages->find('id=3204'); // mit pic foreach($results as $p): $p->of(false); ?> <page> <title><?= $p->title ?></title> <date><?= $p->blog_date ?: $p->created ?></date> <featured>1</featured> <pic><?= $p->main_slider_coverpic->first()->httpUrl ?: '' ?></pic> <body><?= $p->body ?></body> <images><?php foreach($p->images as $image) { echo '<image>' . $image->httpUrl . '</image>'; } ?></images> <files><?php foreach($p->files as $file) { echo '<file>' . $file->httpUrl . '</file>'; } ?></files> <gallery><?php foreach($p->gallery as $image) { echo '<image>' . $image->httpUrl . '</image>'; } ?></gallery> </page> <?php endforeach; echo '</pages>'; die(); } and then the import: <?php $import = false; if($import AND $input->get->import == 'blogitems') { $items = simplexml_load_file('https://www.your-old-website.com/?export=blogitems'); foreach($items as $page) { $p = new Page(); $p->template = 'blogitem'; $p->parent = '/news'; $p->title = $page->title; $p->name = $sanitizer->pageNameUTF8($page->title, true); while($pages->find('parent='.$p->parent.',name='.$p->name)->count() > 0) $p->name .= '-1'; $p->date = $page->date; $p->featured = $page->featured; // get body html and remove root node // $p->body = substr($page->body->asXML(), 6, -7); // ###### update: it's better to use base64_encode($page->body) in your export and then base64_decode($page->body) in your import ##### $p->save(); // add images if(strlen($page->pic)) $p->pic->add((string)$page->pic); foreach($page->images->image as $image) $p->images->add((string)$image); foreach($page->files->file as $file) $p->files->add((string)$file); foreach($page->gallery->image as $image) $p->gallery->add((string)$image); $p->save(); echo 'new page <a href="' . $p->editUrl . '" target="_blank">' . $p->path . '</a><br>'; } die(); } of course that is not bulletproof but it's really simple and you can do whatever you want (export junks by adding start=0, limit=10 or the like to your selector) you can also try adrians batch child editor. or csv importer. but for me the example above worked like a charm ps: try it with limit=1 for testing
    2 points
  5. Thoughts on the new manager page?
    2 points
  6. I am used to deploy Vesta on the latest stable Debian (currently Jessie). No issue detected on my side during the installation and setup, everything is coherent. Configuration of new virtual host is setup in one click, same for user access and database. The only drawback is about the DNS, some knowledges is required to get working with (as always and each CP), but not required at all to run websites. Really, using it once is like adopting it.
    2 points
  7. Thanks, I'll see if this whether it break anything. Here is the final UI for the roles. The asm selector went to the upper right corner of the submodule, having it below the label as before occupied too much space (almost doubled the upper fieldset height). It's not entirely consistent in FF-Chrome-IE but differences are mainly cosmetic so I don't tweak it more. Unfortunately the AOS page loads a bit slower because JS needs to change parent of 20+ asmFields which I'm afraid I can't optimize, but it's not that bad. Restriction are not applied so far but I hope it's only a matter of removing submodules from the enabledSubmodules array. But I feel that there will be exceptions here and there, as always
    2 points
  8. To export pages as CSV file this module could be useful to you: BatchChildEditor
    2 points
  9. Not sure I'm following the exact requirement here, but AdminThemeReno is responsive on mobile, and accessing these features is pretty easy via a tap on the applicable item in the page tree...
    2 points
  10. For those needing to temporarily disable the module, I've added the ability to do so in 1.5.43.
    2 points
  11. Hi @Karl_T and @mel47 - I am very sorry for the lack of response here. I have been low on time lately and spending most of it on TracyDebugger. @mel47 - I'll look into the html tags being lost on import - any chance you could PM me the file you are trying to import? @Karl_T - I know what the issues will be - just need to set myself up with a PHP7 testing environment and track them all down. I'll see what I can do about getting both of these taken care of this week. Thanks for your patience.
    2 points
  12. Croppable Image 3 for PW 3.0.20+ Module Version 1.2.0 Sponsored by http://dreikon.de/, many thanks Timo & Niko! You can get it in the modules directory! Please refer to the readme on github for instructions. - + - + - + - + - + - + - + - + - + - NEWS - 2020/03/19 - + - + - + - + - + - + - + - + - + - There is a new Version in the pipe, that supports WebP too: - + - + - + - + - + - + - + - + - + - NEWS - 2020/03/19 - + - + - + - + - + - + - + - + - + - ------------------------------------------------------------------------- Updating from prior versions: Updating from Croppable Image 3 with versions prior to 1.1.7, please do this as a one time step: In the PW Admin, go to side -> modules -> new, use "install via ClassName" and use CroppableImage3 for the Module Class Name. This will update your existing CroppableImage3 module sub directory, even if it is called a new install. After that, the module will be recogniced by the PW updater module, what makes it a lot easier on further updates. ------------------------------------------------------------------------- For updating from the legacy Thumbnail / CropImage to CroppableImage3 read on here. -------------------------------------------------------------------------
    1 point
  13. Adrian, I think the upgrade to 2.8 may have sorted it. I'll keep testing tomorrow but first impressions looks good. ta
    1 point
  14. Can a user theoretically sign up for a project but not sign up for any phases or events? If not then I suggest that the user only signs up for events, and this implicitly also attaches them to phases and projects by virtue of the page hierarchy above event pages. Users are pages, so each event has a Page field that stores all the users that have signed up for that event.
    1 point
  15. Just short from mobile... Search the forum (viaGoogle) for structure content kongondo... there is a great topic on this kind of problems. And search for usage of page fields as connector of your data. For me at the first impression you have to separate three things. Projects - can have several phases, users, events Phases - related to the project connected users and events Events - related to phases, users and projects The user template have multiple page selector for projects, phases and events of a user.... Best regards mr-fan
    1 point
  16. You're a genius @Robin S. Thank you!
    1 point
  17. For the long headlines I may add a truncate option, with the entire text visible on hover (simple title). This is not nice but it's better than having the whole title invisible when it's pushed downwards. The problem is that the fixed header has fixed height, and some other fixed elements are dependent on this height, eg. notices, tabs, etc. So truncate would be the easiest/safest way of solving this I guess.
    1 point
  18. I can't use global compile flag, because some of the includes have to be compiled and some not. I expected that //FileCompiler=0 would make FileCompiler to completely ignore the file, now it fails trying to create a directory with the invalid name on windows.
    1 point
  19. "C:/inetpub/wwwroot/pf/site/assets/cache/FileCompiler/C:/PHP/adodb5/" ? Does not look like a valid path. Anyway, why not include __DIR__ . '/adodb.inc.php'; ?
    1 point
  20. Yes, works fine on 2.9.2.
    1 point
  21. Yeah - sounds like it must have been an error in the code you typed. Just to clarify - you are back on 2.9.2 now and it's working fine in 2.9.2?
    1 point
  22. Well, not sure what's going on. Now it works fine, though I updated to 2.92 and then reverted to 2.87. Works fine here anyways I got 'Error in DumpsRecorderPanel...' text in the panel itself. Maybe what I was about to dump was so dumb that it would need a DumbsRecorder instead
    1 point
  23. How to reproduce this? I wasn't able to when setting a CKEditor field to be ajax-loaded. Plus have you tried it without AOS? If this happens to AOS enabled only, could you narrow it down to any submodule? I have a few updates under the hood in my dev version but I don't think any of them would have fixed this.
    1 point
  24. I am using it, VestaCP is very easy to setup and use. If you want an access on my test server let me know, as I dont remember if they have a demo online.
    1 point
  25. I have this error alert problem with a site as well. I have narrowed the issue down to the following circumstances: The front end templates use Bootstrap but have no modal popups The problem only occurs when logged in as an admin The problem only occurs on pages that are 4th in the page hierarchy, ie: + Home ++ Blog +++ Category ++++ Blog article (error alert occurs on this page) For example: http://www.mysite.com.au/blog/categories/my-article/ It's not a showstopper on this site but is annoying. Site uses: - ProcessWire 3.0+ - PHP 5.6 HTH tracking down the cause.
    1 point
  26. Thanks! When the number of the settings go high it's better to apply some UI tweaks to make it more readable. Most of them are CSS only, others have a bit of Js but they would be usable without Js too. I'll remove the greyed out check boxes, lets see how it goes.
    1 point
  27. Hi again, Ok, the console panel in the latest version of Tracy now works fine. When I initially coded it I was using GET not POST (I don't even remember why, but obviously a bad idea), but it meant I needed to base64 encode everything which was breaking the UTF8 of your content. Even though I switched to POST even before I released it, I never removed the base64. I could have recoded it as utf8 which actually does work, but I think the right thing to do is simply remove the base64 encoding, which has also made the console much snappier. Anyway, you will notice that the first time you open the console (after upgrading to the latest version) that the contents will be base64. After that you should be fine. Please let me know if there are any other issues along these lines or any other situations where you feel you can't trust the console panel. PS Sorry for the time everyone spent on this!
    1 point
  28. I'm happy to announce that we are back on Processwire this morning. @Jonathan Lahijani contacted me based on this post and took on the daunting task of redeveloping / designing our site and has done an amazing job. I'm very pleased with the results. We have a few tweaks to do here and there but functionally, it's more than I was hoping for. Jonathan will be doing a full write up on the process here within the next couple of weeks but for now I just wanted to let everyone know and get some feedback on the new site. Also, HUGE thanks to @Jonathan Lahijani for doing such an amazing job. ~Mike
    1 point
  29. What have you done Adrian!?!? TBH I was surprised that those lived so long. They always made me smile
    1 point
  30. That's correct! This is one more example on how things grow in our community: we work together to make it as good as we can. Someone come up with a good solution for a partial thing. This a) directly help others, it b) inspires other users to new / other solutions, and this, in the end, makes working with our beloved PW a little more better again. And, in this case, (ALIF and Tracy): from now on, everytime when I will use Tracy, I will have the feeling that a little part of my work is into it.
    1 point
  31. When I need a calculated field that will be used for sorting, I like to add a hidden (or regular, doesn't matter) field to the template to store the calculated value. The value gets automatically calculated on page save. A hook like this in your /site/templates/admin.php can do the work for you: $pages->addHook('saveReady', function($event) { $pages = $event->object; $page = $event->arguments(0); if($page->template == 'rider') { $miles = 0; foreach($page->rides as $ride) { $miles += $ride->miles; } $page->miles_ridden = $miles; } }); Then when it comes to sorting, you just sort on your calculated field: miles_ridden. If you are adding this to an existing PW installation, then you'd need to establish the initial values for each rider's miles_ridden. This could be done with a quick bootstrapped script: /setup-riders.php <pre><?php include("./index.php"); foreach(wire("pages")->find("template=rider") as $rider) { $rider->save(); echo "$rider->name: $rider->miles_ridden miles ridden\n"; } Then you'd just load domain.com/setup-riders.php in your web browser, and then delete the file when done.
    1 point
×
×
  • Create New...