-
Posts
4,077 -
Joined
-
Last visited
-
Days Won
87
Everything posted by horst
-
I would upgrade not all at once (PHP, MySQL, PW) and not in such big steps (PHP 5.3 => PHP 7). But you don't need to update PW in small steps. I would (and have done by myself several times) let the site (copy?) on a server with PHP 5.3 and only change the wire folder with 2.7 stable and also the 2.7 index.php and the 2.7 htaccess file. Before that, backup the DB!! After that, goto the admin and login. If there are errors, just reload the page 3-5 times and go to modules and do a refresh. After that, everything core related should be up to date. But you may run into some issues with third party modules or with body fields in your site. AFAIR, PW 2.3 uses not the CKEditor. Your body fields, if any, will throw errors or warnings. If you have those fields, I would do one intermediate step: before upgrading, I would load ckeditor as site module into the PW 2.3 installation. Then bind all textarea fields to it, instead to the older editor. Do another DB backup! and then go ahead and change wire to PW 2.7. After your site is running properly on PW 2.7, PHP 5.3 and the older MySQL, change the PHP version and the mysql.
-
Making a loading more link which displays more results with AJAX
horst replied to Orkun's topic in General Support
I have used it only one times. If it is of any help, I can paste in some code snippets here from that site. But it isn't an infinite only solution, it is bundled together with masonry. http://joerg-hempel.com/archiv/ JS parts: // JS in every page that uses infinite scrolling <script type='text/javascript'> var gLoaded = 0; var gMaxPages = 12; var gTriggerPageThreshold = 100; var gPaginationHistory = false; // switch on / off URI updating for pages: example.com/path/page2 | /page3 | page4 var gContainer = '#albums'; var gItemSelector = 'article.album'; var gColumnWidth = 228; // 48 var gGutter = 12; // 12 $(document).ready(function() { // make it visible if JS is supported $('div.ias_msg').css('display','block'); starteMasonry(); starteIAS(); }); </script> in an external JS file I have the functions for Masonry and IAS: function starteIAS() { jQuery.ias({ container : gContainer, item : gItemSelector, pagination : '.pagination', next : 'a.next-album', loader : "<img src='/site/templates/styles/images/loader.gif' />", thresholdMargin : -9, triggerPageThreshold : gTriggerPageThreshold, history : gPaginationHistory, noneleft : "<div class='ias_msg noneleft'><p>no more items available</p></div>", onLoadItems : function(items) { // HNLOG console.log('IAS onLoadItems (' + gTriggerPageThreshold + ')'); var newElems = $(items).show().css({ opacity:0 }); newElems.imagesLoaded(function(){ $('#albums').masonry('appended', newElems); newElems.animate({ opacity:1 }); }); $('#albums').masonry('reloadItems'); return true; } }); } function starteMasonry() { var items = $(gContainer + ' ' + gItemSelector).show().css({opacity:0}); $(gContainer).masonry({ itemSelector : gItemSelector, isOriginLeft : true, isOriginTop : true, columnWidth : gColumnWidth, gutter : gGutter, isAnimated : true, // !Modernizr.csstransitions isFitWidth : true }); items.animate({opacity:1}); } The PHP looks like: // calculate current amounts $limit = 100; $max = $pages->find("$pSelector,limit=2")->getTotal(); $cur = $input->pageNum; $next = ($cur * $limit) < $max ? $cur + 1 : 1; $prev = $cur > 1 ? $cur - 1 : 0; $start = $cur < 2 ? '0' : strval($limit * ($cur -1)); // echo prev-next links for pagination (only next is required, prev isn't used !!) $pagination = "<div style='display:none' class='pagination'>"; // hide it !! //if($prev > 0) $pagination .= " <a href='{$archivURL}page{$prev}'>prev</a> |"; if($next > 1) { if(isset($nextPageUrl)) { $pagination .= " <a class='next-album' href='{$nextPageUrl}page{$next}'>next</a> "; } else { $pagination .= " <a class='next-album' href='{$archivURL}page{$next}'>next</a> "; } } $pagination .= "</div>\n"; echo $pagination; // Hinweis zum scrollen echo "<div class='ias_msg scrolldown".($cur)."'><p>scroll down to get more items</p></div>"; // get PageArray $albums = $pages->find("$pSelector, limit=$limit, start=$start, sort=sort"); // output albums with thumbnail and infos foreach($albums as $album) { // ... render items } Using IAS, you even don't need to check for ajax request or not. just send the whole page, with header and body. The script knows the selectors and pick up the needed content and add it to the dom, after the last renderd from previuos request. Easy! -
Making a loading more link which displays more results with AJAX
horst replied to Orkun's topic in General Support
You may use one of those ready to use JS Libraries for Infinite Scrolling you can found on the net. One that I know and have used myself is IAS. In PW you must use pagination as you explained above, also have to render the NEXT button, but with display:none in CSS to make it invisible. The JS-Script will pick it up and loads the next portion when the user scrolls down. -
For me, I can click on the logo, I can click on Admin in the bread crumb and I can doubleclick on Pages to move directly to the Tree.
-
Hhm, this is right, in general. - But, if you use FTP from within a php script, you can use it for deploying. To execute scripts, you can A) upload individual scripts to the server (via FTP). and after upload, you can trigger the execution via HTTP. Accessing DBs also is easy. I have used php for a long time for syncing files on live and local servers. Scanning local project directory and collect last-modified + crc32 checksums, than do the same on the live server. - Hhm, I found an old script, - tested it and - surprise - it is still running! (I will upload some screenshots.) It originally was created in that times when webdev often was writing and deploying static html files, or maybe some php files but without a CMS, etc. (around 1998/99, for me) So, this is only in the context of historical interest.
-
Another hint is, if you have already unsorted images in your pages, to use this very nice snippet from @lostkobrakai (in ready.php): https://processwire.com/talk/topic/11069-sorting-images-in-backend/
-
You also can enable zip upload for imagefields! That has the nice side efect that the images are also alphabetically sorted. (What they are most often not when asynchron single uploading)
-
In witch scope does dompdf use them? (class internal? global?) Also if your module does its work on the admin side, it can be that you use autoload with it? If yes, it is called very early. You should thouroughly check if the $user and $page from dompdf and pw does not interfere.
- 16 replies
-
- 1
-
- memory
- allocation
-
(and 2 more)
Tagged with:
-
It is a certificate that doesn't match. This has not directly to do with the module but with the server (certificate). An expected IP (52.19.6.114) doesn't match. The IP (52.19.6.114) is mapped to the hostname "ec2-52-19-6-114.eu-west-1.compute.amazonaws.com" and the hostname (email-smtp.eu-west-1.amazonaws.com) resolves to IP "52.30.192.168". So this is something that you need to sort out with the hosting company.
-
additionally you could/should set $config->debug = true; in the site/config.php. So, maybe it isn't of help in this case.
- 16 replies
-
- 1
-
- memory
- allocation
-
(and 2 more)
Tagged with:
-
Hi, it is just an example. I use module SPEX, that provides delayed output and a lot more. With it I call the files like this: $spex->addScript('scripts/jquery.min.js'); $spex->addScript($myMainJSfile); $spex->addStyle('styles/main.less'); It is similar to the regular use of $config->scripts->add( $config->urls->templates . $myMainJSfile );
-
Hi @driedstr and welcome to the forums. If you are sure it is this line when start building $config, it can be worth to have a look what you put into your site/config.php ?? Have you put customized stuff / settings into it?
- 16 replies
-
- 3
-
- memory
- allocation
-
(and 2 more)
Tagged with:
-
Hi @totoff, it depends on what tasks I want apply to a site. If it only rely on template files, css and js files, I switch from regular to dev-files. Means, I use a little abstraction layer for including my files like this: $myMainJSfile = "scripts/main.js"; $myMainCSSfile = "styles/main.css"; When working on a live site, I use something like this: if($user->isSuperuser()) { $config->debug = true; $myMainJSfile = "scripts/main.dev.js"; $myMainCSSfile = "styles/main.dev.css"; } else { $myMainJSfile = "scripts/main.js"; $myMainCSSfile = "styles/main.css"; } When working on templatefiles, I put in the top of the template file a few lines of code: if($user->isSuperuser()) { include("./nameOfMyTemplateFile.dev.php"); return; } This switches to a dev version of the template file and returns directly after including it. (The code of the original isn't executed). This is a basic description. Depending on how you have organized your site, there is a lot room for improvements, go into depth, make it a more granular system. But you get the idea. If I need to alter the DB too, I use a separate site/config.dev.php too. YOu can read about it here, scroll down to the end: "Maintaining a separate development configuration file". (I duplicate the DB to a dev-version and connect to it for development)
-
@alan: WOW! What a great find. You are right. I have checked this and yes, on the site I thought it would working together, it also bypasses SMTP as you described it. @justb3a: please can you fix this with one of the next releases?
-
I use it on one site with wiremailSMTP and it works. But I haven't used it together with Mandrill. I think you use a recent or latest version of SCF? (earlier version hasn't supported wiremail()) You may check in the headers of your emails for the User-Agent, e.g. ProcessWire/WireMail or ProcessWire/WireMailSMTP or ...
-
It uses it out of the box, mean: you haven't to do anything in regard of SCF. SCF uses wiremail(), - and if you have installed and setup wiremailSMTP, it is used instead of the basic wiremail, which uses the PHP mail function.
-
Install to server subdirectory path not working with PW 2.7?
horst replied to nixsofar's topic in Getting Started
@nixsofar: Do you speak from the exact same server in regard of the 2.6 and 2.7 installs? And what's about to install the 2.6, and after checking and seeing it's running, just upload the complete wire folder and subfolders from 2.7 to, e.g. wire-27. After upload is complete, rename wire to wire-26 and wire-27 to wire. Besides the complete wire folder you also have to switch the index.php. That's all. (the htaccess hasn't any changes between this two versions and can stay as is). Does this work? -
I struggled with this too in the past. A while ago, I switched to use The IntlDateFormatter class like, for example: $fmt = datefmt_create( 'de-DE', IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'Europe/Berlin', IntlDateFormatter::GREGORIAN, 'MMMM Y' ); // format doesn't use PHP style, but ISO-Format! see: http://framework.zend.com/manual/1.12/en/zend.date.constants.html#zend.date.constants.selfdefinedformats $datum = is_numeric($page->getUnformatted('datum')) ? datefmt_format($fmt, $page->getUnformatted('datum')) : ''; And welcome to the forums, @Klenkes. (?)
-
Congrats! (and take all the time you can get for beeing with the baby)
-
If the script says the service is down, this only mean that it couldn't connect to the target server. So, when on the website server the outgoing request is blocked (firewall), this would also result in the same error message. If you have email / smtp accounts on other servers, e.g. gmail, hotmail or what ever, I suggest try to connect to them via the test script and see if it is possible. And good luck!
-
It also has zooming functionality. You only have to use big enough images. Maybe you can test it with a smaller browser window and then double click into the image or click the magnifier icon. That panning and zooming is especially useful on mobiles, but can also be used on desktops. It also supports fullscreen mode. Have I allready said that I lo.., - ah yes, I had. PS: but it has not such a multi-stage zooming functionality like open seadragon.
-
what I love these days is photoswipe 4! But it's not a single image viewer, it's a slideshow player. But the best I know of. It comes standalone (for performance!), has inbuilt support for mobiles, including sending smaller images to those devices, full support for mouse, keyboard and touchscreens, etc. As I said, I love it. I use it on my site.
-
Besides all the good and valuable points here mentioned, but for the moment: what's about to crop the images automatically for oputput in the lightbox to e.g. 400 x 600. If I would need minimum dimensions 400 x 600 or 600 x 400, I would set both min fields to 600 and then, depending on the ratio, crop / resize the images to the exact dimensions, 400x600 or 600x400. And yes, I know, it depends on the clients if they are able to check the result of uploaded images on the frontend.
-
When you tried with the Thunderbird, was it on the same machine as the website is? Or the other way round: have you tried this settings and testconnection from an install on your localhost? If not, you also have to check if the server where your site is hosted has no outgoing firewall restrictions that get in your way. If the install is on an online machine, you can use the php library here in the spoiler. I often use this for quick checks on hosting machines to see if I'm able to reach other machines, ports, services from there. It is a pure PHP lib to ping severs on specified ports with defined transports.
-
Thanks for the info and the module! I will try it out when I have a bit more time. So, you influence filesizes with specifying the quality level (0-100). You can set it sitewide in the config.php (default is 90) or you can pass it individually in an options array everywhere on API level. Is the last file in your screenshot created via GD, and what setting for quality have you used?