Jump to content

Soma

Moderators
  • Posts

    6,798
  • Joined

  • Last visited

  • Days Won

    158

Everything posted by Soma

  1. Welcome tron1000. If you put stuff in /wire/ core it will get overwritten if you update PW. Custom stuff and plugins belong to the /site/ or /site/modules folder. I guess it's that php files aren't allowed to be accessed inside site or wire folder and blocked by htaccess. In TinyMCE you have a configuration field you can install plugin from within a folder outside. Look for example this thread http://processwire.com/talk/topic/1655-add-bramus-cssextras-plugin-to-tinymce-inputfield/
  2. There is, the parent option add classes to all parents.
  3. And good old Soma has even a module for it: https://gist.github.com/somatonic/2311994
  4. Yes. Then go to the template of those pages and enter name as the alternative list label under advanced tab.
  5. You can't call children on page array only for single pages. Ou and those invisible pages seem to have no title.
  6. Why does it have no effect. I can set it here in config.php.
  7. It must be either the file isn't there or permission problem. The php copy() fails, and I get the same error when give a file that doesn't exist.
  8. Looks like the slash is too much. Config urls return already a trailing slash.
  9. Don't use PW translation for static text on front-end. I highly encourage to use some php vars or yaml to translate. So you can have de.yaml with suche: "Suche" suchen: "suchen" suchresultat: "Suchresultat" suchbegriff_eingeben: "Bitte geben Sie einen Suchbegriff ein." treffer_gefunden: "{s} hat {c} Treffer ergeben:" keine_treffer: "Keine Resultate gefunden" ... And a script in the header that loads and parses the file depending on the language. Example from one of my sites using symphony yaml class: require_once($config->paths->root . "site/libs/yaml/sfYaml.php"); require_once($config->paths->root . "site/libs/yaml/sfYamlParser.php"); // instance a parser object $yaml = new sfYamlParser(); // parse language file $txt = $yaml->parse(file_get_contents($config->paths->root . "site/languages/" . $lang . ".yaml")); Now you can have localized text echo $txt['suche'];
  10. I'm sure that's a facepalm issue. Any modules installed? Custom scripts that mess with page view?
  11. Yeah they're the new hardcore splatter movies, lot's of blood and guts.
  12. Thanks for the report, I added a execution time to 120 seconds.
  13. You could use the config options for page secure files... $config->pagefileSecure = true; $config->pagefileSecurePathPrefix = '-'; and make unpublished pages and their files will not be accessible via url. So you could create child pages under the users page with a file field, and leave those pages unpublished. The assets directory will be prefixed with "-" which is restricted by htaccess. But then you can use a passthru script to send the file to the user if certain requirements are given using wireSendFile(); So for example construct the download link to the file like this on a page the user can see. <a href="/download.php?user=1007&file=filename.pdf">Download file</a> and in download.php with something like this for the passthru and user check // bootstrap PW include("./index.php"); // make sure user is logged in if(wire("user")->isLoggedin()){ $file = $_GET['file']; $userid = $_GET['user']; $userpage = wire("pages")->get(wire("user")->id); if($userpage->id != $userid) die("no access"); // make sure it's the user if($filepage = $userpage->child("include=all")){ // since page is unpublished we add include all // get the file from the page $filename = $filepage->images->get($file)->filename; if(!$filename) die("download not found"); // send file to browser wireSendFile($filename, array('exit' => true)); } else { die("no user page found"); } } else { wire("session")->redirect("/somepage/"); }
  14. I think you found a bug, that variable is nowhere defined. It won't really show up unless a duplicate is found and it would at max throw a warning, but still works.
  15. If you use PW form API, it will get validated if you call processInput() $form->processInput($input->post); I think the CSRF doesn't get reset if the CSRF was valid, but you can do it manually with $session->CSRF->resetToken(); after validating the form. Or if you do manual form and not use InputfieldForm you can generate and validate the token $session->CSRF->validate(); // will throw exeption if invalid And get the token name and value with it respective methods $session->CSRF->getTokenName(); // name for input hidden $session->CSRF->getTokenValue(); // token value Also the trick renobird mentioned is also very good to prevent double click submission errors. Of course you can still use redirect method and as you may found the $notices errors and messages are transported through redirects.
  16. I implement the PW CSRF token in my forms so a resubmit will result in a error message.
  17. Those permission hooks are in PagePermissions.module, and they're defined using hooks, so there's no methods ___viewable.
  18. Yeah this is the module from that thread. Yes it's for page-view, but I just thought it could be extended for page-edit too... as mentioned in the thread that it's a start. Yeah another way of doing, but it would be nice to have one that does it all, instead of many that only do partial.
  19. Thanks for sharing pogidude. Are you ware of this module? http://processwire.com/talk/topic/371-page-specific-permissions/?p=2787. This might would have been a good starting point for this module.
  20. Just use isset($input->post->list)
  21. You can use ModulesManager to download/install modules already. I have no idea what this error is about, looks like some server configuration issue?
  22. Thanks diogo for testing. Then it seems you also run into a problem with permission locally. If it didn't rename the htaccess file when manually copying PW files it's because apache user and your local user are not the same (along these lines). I think I experience the same, but I changed some permission for apache to run as my user and it also works manually now. Edti: I just updated the script to also remove the zip and script when everything is done.
  23. ProcessWire Online Installer Since there's now a shortcut to download latest stable PW http://grab.pw , I created a simple helper PHP script you can upload to your server to download and extract a new PW installation. Upload this php file to the server where you want to install latest ProcessWire Go to the browser and call this script. It will download and extract ProcessWire files. Once done successfully it will redirect to the installer. Downloaded zip the grabpw.php will be removed. If anything fails, make sure permission are correct on server and you remove files manually in case. I tested this on my local XAMPP (Mac) install and on some of my account on a ISP. Also I took some methods to download and extract files from my ModulesManager which seems to be "reliable" so far. Download The script can be found on github: https://github.com/somatonic/PWOnlineInstaller Why Just because it's cool. There's many ways to accomplish this task if you have ssh access for example using shell. Just wanted to have this alternative and maybe people find this useful too. @ryan. Do you think you could provide an latest dev shortcut url too?
×
×
  • Create New...