Jump to content

Soma

Moderators
  • Posts

    6,808
  • Joined

  • Last visited

  • Days Won

    159

Everything posted by Soma

  1. Soma

    Hello Everyone..

    Welcome Billy! If you're looking for a forum this might be a choice http://fluxbb.org/ easy and lightweight software. There's no real forum module for PW (yet except the one from apeisa) but it's also because there's many good out there full featured.
  2. Do I miss something obvious? If so I'm sorry Ryan. Any abstractation can be reverted. If you really want or need to just run a script that converts it back the same way PageLinkAbstractor does.
  3. You'll have to get access to the form builder support forum. This is recently a post by Ryan on a recent update.
  4. Sorry, was a lttle longer edit after first post.
  5. Of course it doesn't get the result because the first url is wrong... that's what Ryan mentioned, you have a /data/ folder inside assets? Which is missing in the first url /site/assets/list-details.json http://mysite.com/site/assets/data/list-details.json So it should be then: /site/assets/data/list-details.json which will work fine. To go further if you want to make it always have the correct url even if you move PW folder to a subfolder you would use the $config->urls->assets in front of data folder. $filepath = $config->urls->assets . "data/list-details.json"; If you want to have it in your JScript as a variable you could use a json object to have access to it in js. Somewhere in your pages html <head> before your angular js script: <?php $jsconfig = array('assets' => $config->urls->assets); ?> <script> var config = <?php echo json_encode($jsconfig);?>; </script> Then use it in your angularjs like this: $http.get( config.assets + 'data/list-details.json').success(.... PW is using this same technique in the admin.
  6. Maybe simpler to do this: if($page->is("name=slideshow18|slideshow28|slideshow38|slideshow88")){ // page has one if the names } Or if it doesn't matter what number if($page->is("name^=slideshow")){ // page name starts with slideshow }
  7. The best way is to avoid having PW in subfolder and on root on production. Search replace the sql dump is maybe most simple. And there's also this module http://processwire.com/talk/topic/236-module-page-link-abstractor/
  8. Soma

    Karena Savannah Cramer

    .. what hook did you use? ;-)
  9. Have you deleted the sessions? What PW version? Any modules installed?
  10. You could use hashs //set window.location.hash = someid; // get hash = window.location.hash; and use $(window).on("hashchange", function(e){ var hash = window.location.hash; // do what you need }); BBQ might a little overkill for your needs, but you could use the simple hashchange implementation plugin of it.
  11. I have to disagree with Ryan. It wouldn't be a problem to switch back from a module like this if really needed. The slight overhead isnt really something to worry about for what you get in return.
  12. ProfileExporter doesn't work with languages as it was created before language support. Make sure all files get transfered, empty the session folder and cache folder. You might want to install a fresh PW on the server, then transfer the needed site files and db.
  13. Soma

    Karena Savannah Cramer

    Congratulations and all the best for you and your family!
  14. What does it say on top? Modules found on modules.processwire.com (160) Where does it stop? What modules are listed? Also is there a ModulesManager.cache file? It loads the list from this file and writes it when you refresh. I can install Thumbnails just fine and everything works normal.
  15. You can generate name, value and validate CSRF in PW like this $csrf_name = $session->CSRF->getTokenName(); $csrf_value = $session->CSRF->getTokenValue(); echo "<input type='hidden' name='$csrf_name' value='$csrf_value'/>"; And validate it with if($session->CSRF->validate()){ // valid }
  16. Also wanted to add that you don't sanitize values or check them except the email (but you're not validating it in php), so anyone can inject something directly submitting to the submit.php... // Send all form submissions through ProcessWire sanitization $email = $sanitizer->email($input->post->email); $username = $input->post->username; $password = $input->post->password; $provincia = $input->post->provincia; $genere = $input->post->genere; $orientamento = $input->post->orientamento; $annuncio = $input->post->annuncio; Validation just with jquery.validate isn't sufficient to make a secure form. And it just get a little (lot) more complicated.. Also you're not having a CSRF attack prevention with your form.
  17. Ok, but now that's a completely different story using validate and post the form using AJAX and form.serialize... This might be of interest http://stackoverflow.com/questions/4545081/how-do-to-file-upload-using-jquery-serialization Still your error handling isn't going to work. You'll have to return some readable error handling like json encoded php array, then read the data on success in the ajax function. ... // if errors return them to the js ajax request if(count($errors) { $errors['error'] = true; echo json_encode($errors); } This will return something like this: {"error":true,"upload":"no upload"} then in the js ... success: function(data) { if(data.errors){ // do something to show the errors in data returned by php script $('ul#errors').append($("<li>"+data.upload+"</li>")); else { // no error occured } }, ...
  18. ... Beer Pee videos and films ... get it?
  19. Taking your code just as is (commenting out the page creation/saving) the upload works for me. I'm not sure where it's failing for you. Does the uploads folder really get created and is writable? Is upload and post max size enough for the file you trying to upload? If the file is too big it won't do anything and just fail silently is possible. Also noticed some things in your code. I am not sure why you have two files for form and php ? And in the form action just "./"? I've put both scripts in one file form.php in the root and changed the include of index.php and the action to action=""; You also have if(!count($files)) { $u->error("Sorry, but you need to add a photo!"); return false; } The $u->error(...) will never show up as you're not using the PW way of creating the form with InputfieldForm. So you would need to handle the errors yourself. Something like this: $errors = array(); if(!count($files)) { $errors['upload'] = "Sorry, but you need to add a photo!"; } Then check before creating and saving page: if(empty($errors)){ //... do stuff } Also you have those return false; return true; in the code... Those will prevent the code from going futher and you won't have a chance to output the form again and show some errors. Just stick with a way to create a errors array and fill in, then before the form output you check for errors and ouptut them.
  20. http://processwire.com/api/modules/markup-pager-nav/
  21. Maybe like this? $ts = $page->getUnformatted("datefield");
  22. Good idea I also have need for it, and fun to make module so there you go (not exactly easy): A first version of ImageMinSize Adds a min dimension setting (under Input tab) to image fields. If requirements doesn't meet it throws error and deletes images. To have it meet exact dimension, you can simply set min and max dimensions to same values. Edit: The module has now its home http://processwire.com/talk/topic/4091-imageminsize/
  23. And here's the proof https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/core/DatabaseQuerySelectFulltext.php#L30 Damn if I knew first where to look at
  24. It's not a db thing, hence your direct query is working, it somewhere hidden in the page finder I guess If you do a $title = "Sabine MeyerAcademy Of St Martin-In-The-FieldsKenneth Sillito"; $p = $pages->get("title=$title"); foreach($db->getQueryLog() as $l) echo $l . "<hr>"; You'll see the queries PW does on the request: ... SELECT pages.id,pages.parent_id,pages.templates_id FROM `pages` JOIN field_title AS field_title ON field_title.pages_id=pages.id AND (((field_title.data='Sabine MeyerAcademy Of St Martin-In-The-FieldsKenn' ) )) ... Or install my ChromePhp Logger module and see it in the js console
  25. Your too fast. Thwt makes sense why $= isnt working. Because it gets strpped off...
×
×
  • Create New...