Jump to content

horst

PW-Moderators
  • Posts

    4,077
  • Joined

  • Last visited

  • Days Won

    87

Everything posted by horst

  1. Oh, really? Please, can you show me a example? (original | GD | and maybe one with imageMagick)
  2. I would use ProCache. It is highly configurable and lightning fast. In fact it serves static html pages. No DB and no PHP-interpreter are involved in serving this pages.
  3. Hi, I use a search with MySQL like operator: $matches = $pages->find("{$suchFelder}%=$q, limit=$limit"); My $suchFelder are: 'body|headline|pagefield.title' When searching for a phrase like schmidt+meier the result contains matches with the phrase if it is in body or headline, but not if it is in pagefield.title. Why isn't it consistent? Why doesn't it find them in pagefield.title? If I do a search only for schmidt it returns all matches, including that from pagefield.title. If this is a bug, I'm also interested in a (quick) workaround. I need this to work properly for a live site!
  4. I'm not sure if I understand right, but may be you can use PageImageManipulator for that? $img = $images->first(); $url = $img->pimLoad('myprefix')->canvas(150, 150, array(255,255,255,1), 'c', 0)->pimSave()->url;
  5. No, in the module folder only modules should be. You can store them outside of PW: webroot |-customscripts |-site |-wire and you can include them with include_once() or require_once() in the site/config.php if you like. This way your functions are available in PW where ever you need them. You can access all of PWs API variables and methods in your custom functions through the wire() function: $pagearray = wire('pages')->find('mySuperDuperSelectorValue'); $homepage = wire('pages')->get(1); $homepage = wire('pages')->get('/'); $session = wire('session'); if( ! isset($session->myCustomArray['myCustomKey']) ) { $session->redirect('/'); } Please refer to the API: http://processwire.com/api/include/ for more info
  6. @Soma: I use same approach in site/config.php but use it like that: $config->dbHost = 'MyComputersName'==getenv('COMPUTERNAME') ? 'example.com' : 'localhost'; The systems environment variable "COMPUTERNAME" is set on (every) Windows, but if it is set on a *nix system it will have a different value. This way it works in terminal too.
  7. @Radek: on windows one can check if virtualhosts are configured right with calling httpd.exe -S directly, (not restarting the service). This gives a screen like: VirtualHost configuration: 10.10.30.50:80 is a NameVirtualHost default server kawobi.local (W:/Apache2/conf/extra/httpd-vhosts.conf:49) port 80 namevhost kawobi.local (W:/Apache2/conf/extra/httpd-vhosts.conf:49) port 80 namevhost pw1.kawobi.local (W:/Apache2/conf/extra/httpd-vhosts.conf:70) port 80 namevhost pw2.kawobi.local (W:/Apache2/conf/extra/httpd-vhosts.conf:87) port 80 namevhost pw3.kawobi.local (W:/Apache2/conf/extra/httpd-vhosts.conf:104) port 80 namevhost pw4.kawobi.local (W:/Apache2/conf/extra/httpd-vhosts.conf:189) port 80 namevhost pw5.kawobi.local (W:/Apache2/conf/extra/httpd-vhosts.conf:206) port 80 namevhost pw6.kawobi.local (W:/Apache2/conf/extra/httpd-vhosts.conf:223) port 80 namevhost pw7.kawobi.local (W:/Apache2/conf/extra/httpd-vhosts.conf:240) port 80 namevhost pw8.kawobi.local (W:/Apache2/conf/extra/httpd-vhosts.conf:257) port 80 namevhost pw9.kawobi.local (W:/Apache2/conf/extra/httpd-vhosts.conf:274) Syntax OK Maybe it helps troubleshooting to go step by step. Also @BFD: have you updated your hosts file??
  8. I find this useful. And I have searched the core code (wire) and found only three function calls: https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/core/shutdown.php#L73 https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Process/ProcessForgotPassword.module#L166 https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Fieldtype/FieldtypeComments/FieldtypeComments.module#L290 It could be replaced by a hookable function called pwMail() or something like that. public function ___pwMail($to, $subject, $message, $additional_headers=null, $additional_parameters=null) { return @mail($to, $subject, $message, $additional_headers, $additional_parameters); }
  9. The reason could be that, at the point when you use $session->login() (in your template-file ?) the variable $user already is populated. And it can't be changed automagically when you do a call to $session->login(). You may use something like: $u = $session->login($username,$pass); // try to login a user if($u) { // if login was successful $u holds a user object $user = $u; // repopuplate the $user variable with the new user } // .. and then the rest of your code : if( $user->isLoggedIn() ) {
  10. Hi Philipp, I was interested in the service since the first day, and I'm interested in the service today. - But there were some concerns I have asked for via email: does the service keep IPTC? This one is mandatory for my colleagues photo-archive with 35.000+ images. You advice to use a default quality setting of 100% with PW in the config.php for all images. That makes sense, but if the service is down for any reason, including expired licence key, you pass through uncompressed images (100% quality == 0% compression). You have no fallback in the service / system. (And if you add a fallback, please don't try to guess which quality-setting they may like for their images, ask them. - Means: make it configurable!) I don't want only one potential client who visits the site have to wait. Not only one. Instead of sending images to the service and back and let the visitor wait until all is finished, you better pass through the local fallback and trigger the service in the background. This is much faster at first request and equal at second request. But much better is to create the images when uploading new images to the site. This way only the owner and or coworkers have to wait, but no vistitors / potential clients. To find potential clients you need some reputation: which sites already use the service? What's about the feedback of some satisfied customers? I really would use your service together with that colleagues site, but actually the service is in an early beta state. There is need for optimizations. PS: I'm still waiting for emails about progress. Got only one directly after mine, (IPTC = ok maybe we can do; fallback = oh, we haven't thought of that) but nothing more then.
  11. If you need a version that works with iframes to load urls, look at this one: http://thecancerus.com/akmodal-simplest-alternative-to-thickbox/
  12. what's about: echo (int) $user->id === (int) $l->createdUser->id; ?? EDIT: deleted first content because have read the lowercase char "L" as a number one (1).
  13. hey renobird, I'm not sure if someone including Ryan could give a proper answer to that, but searching for enhancements with PHP 5.3.8 or looking only to the fixes between 5.3.3 and 5.3.8 http://php.net/releases/5_3_4.php http://php.net/releases/5_3_5.php http://php.net/releases/5_3_6.php http://php.net/releases/5_3_7.php http://php.net/releases/5_3_8.php are good points to rethink about upgrading PHP. Otherwise you just have to try, I think. EDIT: Ok, while writing my answer, Ryans answer came in, and he can give a proper answer! (I haven't thought)
  14. Ryan, unfortunately it doesn't work. (have flushed the DB) My url is and the resulting code in DB is video_id = oUdcc7fYlp8?rel=0 embed_code = <iframe width="640" height="360" src="http://www.youtube.com/embed/oUdcc7fYlp8?feature=oembed" frameborder="0" allowfullscreen></iframe> The rel=0 doesn't make it into the embedded code. ??
  15. I'm not sure if this is what you are looking for, but I use HeidiSQL on my Desktop to manage all MySQL-DBs. It is possible to transfer complete Data or only selected tables from one DB to another on the fly with just a few clicks. Really quick and simple. (It is native for Windows or for Mac/Linux/*nix via Wine, or from a VirtualBox with a Win-Image)
  16. https://www.google.de/search?q=site:modules.processwire.com+custom+filename+upload EDIT: Oh, shit, it tooks me to long to google it! Adrian was faster!
  17. @Ryan: fantastic Module. I have used it the first time now on a site for a colleague. There is one thing I want to ask if it could be possible: With the param rel=0 added to the $embedCode $queryString (e.g. ?feature=oembed&rel=0) the video gets reset to the first frame of it after playing, - instead of displaying a lot of thumbs to other videos. On some pages / sites it looks much better this way. Can this be added to the module? (maybe as option, or default?)
  18. Why do you not ftp-upload the archive and bootstrap PW? You write a script (php-file) e.g. named "pw-archive-import.php" and put it in the root of your webpage (where you have pw index.php). I use this very often like that, (with some security in it): <?php // define userroles that are allowed to work with this script, like: superuser|editor|author $userRolesSelector = 'superuser'; // bootstrap PW require_once(dirname(__FILE__) . '/index.php'); // check user-account if( ! wire('user')->hasRole($userRolesSelector)) { header('HTTP/1.1 403 Forbidden'); exit(1); } WIth this example you first have to login into PW as a superuser and than call the URL to the importer-script with your browser to lets having fun. Than you can hardcode the path to your archive-data-file or pass it via a Getvar to the script, read / prepare the data and start to create and/or fill pages: // get your file, read it into an array $archiveData and start to import it: // here some (pseudo/example)code set_time_limit( intval(60 * 10) ); // give it 10 minutes, you may also increase this echo "<pre>\n"; foreach($archiveData as $data) { // check if a page with that id/title already exists $page = wire('pages')->get($data['your-page-uid']); if(0<$page->id) { // this page exist already, if we only want to import new pages, we skip echo "- page already exists: {$page->id}\n"; continue; } // we have to create a new page echo "+ create new page for {$data['your-page-uid']}\n"; $page = new Page(); $page->template = 'your-template-name-here'; $page->parent = wire('pages')->get(' ... your selector to match the parent-page of the new pages you create here ... '); // ->get only returns a single page, (->find returns a page-array) $page->title = $data['title']; // add all data to the fields you have to // don't forget to validate and/or sanitize the data if not have done already! .... // save the page $page->save(); // and optionally unload from memory wire('pages')->uncache($page); } Here are some links to bootstrap scripts / posts: http://processwire.com/talk/topic/4905-does-this-image-import-pseudocode-look-ok/ http://processwire.com/talk/topic/4437-delete-orphaned-filesimages-from-siteassetsfiles/#entry43687
  19. Hi, I have search results that I do not understand. It could be that a plus-sign is entered into the searchfield, for example: a+m Architekten When using $sanitizer->selectorValue the plus-sign is stripped, therefor I try using $sanitizer->text, but it doesn't match. The query looks like: $suchFelder = 'headline|beschreibung|stichworte|architekt.title|kategorien.title'; $q = $sanitizer->text($input->get->q); $input->whitelist('q', $q); $matches = $pages->find("{$suchFelder}%=$q, limit=50"); But it should match with architekt.title. Other queries, without a plus-sign, do find all pages/records: a-z Architekten ABB BRT Atelier Markgraph
  20. Hi Sanyaissues, slkwrm already gave you correct answer, but it looks to me that there is a little misunderstandig (not sure, but could be). I think slkwrm suggested that you have organized your csv-file something like that: Product one, /category/xxx/, /brands/zz1/, "This is the brand one" Product one, /category/xxx/, /brands/zz2/, "This is the brand two" Product two, /category/yyy/, /brands/zz3/, "This is the brand three" Product two, /category/yyy/, /brands/zz4/, "This is the brand four" Product three, /category/zzz/, /brands/zz5/, "This is the brand five" But seems it is bit different: Product one, /category/xxx/, /brands/zz1/, "This is the brand one", /brands/zz3/, "Description 3" Product two, /category/yyy/, /brands/zz2/, "This is the brand two", /brands/zz4/, "Description 4", /brands/zz5/, "Description 5" Product three, /category/nnn/, /brands/zz7/, "Custom description 7" You have to iterate over the lines of your csv file add a new page, add title and category and when coming to the brands you can add the first repeater-item as you showed above. If you have more than one (looks like it can differ), you should save the page! and after that iterate over the brands and foreach you have to add it and to save the page, (I think) $productPage->title = $title; $productPage->category = $categoryName; $repeater = $productPage->items->getNew(); $repeater->brand = $brandName; $repeater->description = $description; $productPage->save(); // check / get your brands foreach($myBrands as $brand) { $repeater = $productPage->items->getNew(); $repeater->brand = $brand['name']; $repeater->description = $brand['description']; $productPage->save(); } Don't know if this is an elegant way, but should work (haven't tested) . >> Please refer to the api: http://processwire.com/api/fieldtypes/repeaters/ look after "Using the API to add or remove repeater items"
  21. http://processwire.com/talk/topic/4371-resize-image-to-long-edge-value/
  22. have core tab too ------ Have found a very minor issue with responsiveness of the theme regarding the PW-logo: inner width = 768 - 1 row for Topmenu & Logo is visible inner width = 767 - 1 row for Topmenu & but Logo is hidden inner width = 485 - 2 rows for Topmenu & but Logo is hidden inner width = 479 - 2 rows for Topmenu & and Logo is visible again! Is this intended behave or should the Logo be constantly visible?
  23. @Ryan, ProcessWire 2.3.14 on Win7 with FF26 & IE10 are the same: No Core-Tab, but found "Autocomplete" in the Source: No JS-Messages in the Console. EDIT: oh, sorry, - it wasn't InputfieldAutocomplete, it was PageAutoComplete InputfieldAutocomplete not found in source
  24. Hi Stefan, about the Sanitizer & Pagename: have you simply added new lines with äöü? or did you change the default existing ones (that belong to a nordic language and translate ä = a, ö = o, ü = u)? the other one I'm not sure, but I always use pagefields like that: marke.title=Masita|Kempa
×
×
  • Create New...