-
Posts
4,085 -
Joined
-
Last visited
-
Days Won
87
Everything posted by horst
-
Here is a snippet that I have used to quickly determine changes of defined fields: public function getModifiedStamps($tablenames) { $tablenameDefaults = array('field_title', 'field_headline', 'field_somename'); $tablenames = array_merge($tablenameDefaults, $tablenames); $stamps = array(); foreach($tablenames as $tablename) { $r = wire('db')->query("SHOW TABLE STATUS LIKE '$tablename'"); $row = $r->fetch_assoc(); $stamps[$tablename] = strtotime($row['Update_time']); #$stamps['s_'.$tablename] = date('d.m.Y H:i:s', strtotime($row['Update_time'])); }
-
Sounds good! I've bookmarked this post for later use / remembering.
-
clarifying: The buggy GD lib is in PHP 5.5.9 and 5.5.10, not in PW. But after we have noticed that those buggy PHP versions out, we have added a fix to PW. --- It would be good to have a system like you mentioned, but actually I cannot understand how this should function. I don't think that it is practical to request a page with every PW pageload if debug is true. (to much traffic) It could be something in the admin, a link that one could click manually, once a problem was encountered. Also I have thought of a little module that can assist with things like this by collecting server information for the user.
-
This has a buggy GD library. You have a PW version 2.4.1 ?? If so, you should try it with the latest dev version of PW, 2.4.2. This has a fix in it. >> https://github.com/ryancramerdesign/ProcessWire/pull/436 and here: https://github.com/ryancramerdesign/ProcessWire/pull/440
-
PHP 5.5.9 or 5.5.10 ?? Or what version is this running on?
-
Yes, if you have created the a role for press, you must assign him to it! I have explained an approach without a special role "press", just with a user. But it is pretty fine to use a role.
-
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.