-
Posts
4,077 -
Joined
-
Last visited
-
Days Won
87
Everything posted by horst
-
Welcome to the forums, sins7ven. This is much more comfortable and and it's simple! (I will reply more here in a few minutes, just have to do a phone call.) ------ EDIT: There are different possibilities, you can go with creating a role and a template and only allow access to pages with that template if user has a this special role. Or you could do it on template basis, what I would prefer in this situation. Because you need to build / provide a frontend login form for the press users. (I don't would send them to the backend) How to do it via template: create a new template file press.php and put it into the templates folder of your site profile in admin create a new template "press" by selecting the templatefile create a new user "press" and assign him only the guest-user create a new page "press" in PW, set it to "hidden", (you should upload all downloadable stuff to this page only!) now you have to edit your templatefile press.php as following: At first you need to check if the page is requested by a logged in user. If yes, you may check which user / which role he has, if you have different ones. But I assume you only have stuff and press and nothing more actually. // check if user is logged in if(!$user->isLoggedIn()) { // present him a login form with fields for username, password and a hidden field called "presslogin" // send the form via post ... return; // end with execution here } if($input->post->presslogin) { // a user try to login $user = $sanitizer->username( $input->post->username ); $pass = strval(strip_tags($input->post->password)); $u = $session->login($user, $pass); // try to login with the posted credentials and save result temporary in variable $u if($u) $user = $u; // if it was successfull, override the current user with the temporary one // last check if user is logged in now if(!user->isLoggedin()) { // present him the login form or what ever you like ... // and stop exeuting this page return; } } // user is already logged in, following the stuff for presenting the download listings .... If you need to check for specific users, it could be like: if(!$user->hasRole('superuser|editor') { // or if(!$user->name == 'press') { How to build a simple login form and how to use the $session->login() etc could be found here in the forums, in the API and useful is the cheatsheet.
-
.(`'`)----(`'`)----(`'`)----(`'`)----(`'`). | '.' '.' '.' '.' '.' | | | | | | | | This is a nice horse | | I like it, Martijn | | | | | | | '(`'`)----(`'`)----(`'`)----(`'`)----(`'`)' '.' '.' '.' '.' '.'
-
just use some of this: { and } after the foreach! if you ommit them, only the next one following line is interpreted as code of the foreach loop. (in your second example the echo-statement) foreach($x as $y) { ... ... }
-
One approache can be to use 1) jQuery.get to pull your new data from the server you need to send it to a server php script together with a unique ID for the album / tracklist you want the data. 2) your server php script first should validate the sended ID, and if valid it should prepare the data and send back to the caller in your desired format. (JSON or ready to use HTML, or what ever) 3) select an animation from jQuery if you like, for example slide in or any other, and use it to set and display the new content of your TrackListing I'm not very familiar with JS, but all jQuery stuff you need is basic and covered on there api site. With the php / processwire script I can try to answer further questions if you have any.
-
Welcome Argos. You hit the nail on top!
-
@n0sleeves: the searchable / sortable frontend Database could be jquery.datatables. In the modules section also is a module for it, but don't know if it is ready to use for front end. Did you know that their is a siteprofile for mp3 files that has a lot stuff with artist, album, genre, song. It is meant as a toolbox for songs / tracks and only comes with some usage examples. Maybe you can build your site on top of it? Or look at it and only take some parts from it.
-
Module with many include files always default language
horst replied to Raymond Geerts's topic in Multi-Language Support
@Raymond: just a thought: have you tried to " // Include all language variables @include_once (dirname(__FILE__) . '/language.inc');" in function ready() instead init()? -
buchstabensup.pe or better the english equivalent, if there is any ??
-
and photoshop has it too, at least since Version 5, (5, not CS5) Artists from Circus Roncalli, - 2007 in Cologne or Dortmund
-
And for pages that should be public but excluded for robots, you can use: http://www.robotstxt.org/meta.html
-
This post explain how I have solved an issue with serverside sniffing and ProCache. https://processwire.com/talk/topic/5349-how-can-i-bypass-the-cache-for-mobile-and-tablet-devices/#entry51544 (I came up to use clientside sniffing, but maybe you can use a combination of serverside and clientside, if you really need) For me it was the best solution to have (only) one cached file for all devices.
-
there is a module: https://processwire.com/talk/topic/4758-release-pagetree-add-new-child-reverse-on-top/ ------ Attention: It is pretty fine to install it before starting a new branch. If you want to install it in a site for an already existing branch, you 1) have to move / rename your existing branch, 2) create a new (empty) branch with the original name 3) move your childpages into the new branch 4) remove the renamed (and now empty) parent page
-
ProcessImageMinimize - Image compression service (commercial)
horst replied to Philipp's topic in Modules/Plugins
Philipp this is great news. The service really has expanded. Many improvements are in. -
Oh, another one! It is very disadvantageous to use the param "quality" for the quality / compression of jpegs and the compression of pngs because there is no quality setting for pngs. (Pngs are lossless)! I don't use pngs myself because of their lack of supporting common metadata. And therefor I haven't realized how disadvantageous the current handling is. We definitely need to regulate this independently: a) different settings, one for quality (jpegs) and one for the png compression, OR B) we only use quality for jpegs and set the compression level for pngs hardcoded to 9 (highest compression). <= Why not? Is there any reason why someone want to send the exact same visual quality with larger amount of data? ---------- EDIT: Its unbelievable: http://images.pw.nogajski.de/image-sizer-core/formats/quality-vs-compression/
-
There is also Ryans explanations with complete code examples here: https://processwire.com/talk/topic/3987-cmscritic-development-case-study/ But this isn't of any help if you only get a XML-dump of the posts
-
Module: AIOM+ (All In One Minify) for CSS, LESS, JS and HTML
horst replied to David Karich's topic in Modules/Plugins
@Stefan: unfortunately I don't know the AIOM well. It was just a thought. I would think one mostly need the $config->urls->something if one have to provide a link to the clients browser and need the $config->paths->something mostly to tell a php-script / function where to grap the file(s) in filesystem for preprocessing something. -
Module: AIOM+ (All In One Minify) for CSS, LESS, JS and HTML
horst replied to David Karich's topic in Modules/Plugins
EDIT: Ah, you have it in the first line: // _init.php $jsPath = $config->urls->templates . 'styles/js/'; try it with changed this to: // _init.php $jsPath = $config->paths->templates . 'styles/js/'; ------------- I don't know if it needs the fullpath or only a url, but you are definietly provide the url and not the fullpath: $fullPath = $jsPath . $file; // = /proseeswire/site/assets/... I would do a quick try with: $_SERVER['DOCUMENT_ROOT'] . $jsPath . $file; If this succeeds, I would change the "$_SERVER['DOCUMENT_ROOT'] . $jsPath" to some PW $config-var (e.g. $config->paths ...) -
Uploaded version 0.1.7 to github - added handling for gamma correction when gamma reading seems to be not available. With some versions of Imagick the function getImageGamma() returns 0 for all images. Don't know why, but have changed the code to asume a Gamma of 2.2 in those cases.
-
Uploaded a new Siteprofile, including the latest ProcessWire 2.4.2 from todays dev branch. The profile include tests for ImageSizer and ImagickResizer for the following categories: cms crop formats gamma scale sharpen others The module for extending the images naming scheme (PageimageNamingScheme) is included too.
-
No, I'm currently not using Images Manager with this. I'm working with the pure basics (ImagesSizer, ImagickResizer, Pageimage, PageimageNamingScheme) and try to test against all issues that was reported in the past I can remember. And if it isn't allready fixed, provide a fix or report it to Ryan.
-
@robinc: I have added the code with get and set gamma to the module. But it doesn't work every time. I have had it in the code before and than have removed it again, because it seems not to work consistent over different IM-versions and I have read that going into 16bit depth mode will do that internally. But now with coming to test it, I must see it doesn't do it as promised. So, on my local machine (ImageMagick 6.8.8-4 Q16) applying gamma correction works as expected, but on a live account (ImageMagick 6.6.9-7 Q16) it do not! I have played around with the point where to call it, but nothing changes. We need to do more testing, - if it gets a value from the image or not and that like. --- In a post above you have said that you are interested in interpolation methods for upscaling, so if I personally would try to avoid this, it sounds interesting for others. If you like, we can put a check into the code just before it comes to resizing. When it detects that it should and is allowed to upscale, we can use other methods for it. Can you provide some lines to this. PS: If I find the time I will update the site profile this evening. --- EDIT: I have found out that on my online account (ImageMagick 6.6.9-7 Q16) the function getImageGamma() returns 0 for all images. Don't know why, but have changed the code to asume a Gamma of 2.2 in those cases. We have to observe these further.
-
@soma: it is right that this should be called only once, regardless if it need to correct one or both dimensions. I have send a pull request for it. But I think this has nothing to do with the issues I have encountered that the ImagickResizer is called two times, because I have not had set any max-dimensions and also fileAdded isn't invoked when calling size, width, height on pageimages. It is invoked by file adding / uploading, as you have to deal with with your fantastic Images Manager. (yep, have read about the break with the newest dev branch)
-
@robinc: which version of ImagickResizer do you use? Above in a code comment from you I have seen v 0.0.5 which is a very early version. regarding to gamma correction with GD in imagesizer: Out there in the wild you can find images with gamma 2.2 and gamma 1.8, (mostly), therefor I have set it to 2.0, because there is no way to detect it with GD. Normally with IMagick using the 16bit colordepth should linearize the gamma setting internally. Manually doing this shouldn't be needed. But I will test this. I have updated my testset and already found some interesting behave. And the gamma test will be the next --- @adrian: I have updated it to version 0.1.5 - And yes, you has set it to singular at the beginning of the project. This was right, but stupid me has changed it.
-
@robinc: Great! Thank you. That was it. Now it is called only once. I have updated it on Github. And now it is open for regular testing. Actual version is 0.1.4