Jump to content

Frank Vèssia

Members
  • Posts

    601
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Frank Vèssia

  1. I've noticed a strange behaviour when moving a page with children in another position. After this operation if a click on the page PW shows me the children twice, duplicated, click again and PW shows me the correct list until I refresh the page, then all return good. I got two screenshots, my countries page shows me countries two times. It's not a big problem but i think it's good to solve this little issue.
  2. we replied at the same time... ;D
  3. maybe i can use $user->hasRole with an if statement and if true show the content...
  4. I need to grant access only to a part of a page and hidden to guest another part like a product page with the price visible only to registered users. It's possible to make this? Now i can only menage access to whole page.
  5. ok, done manually, thanks.
  6. this is the result: RootPath:/home/hdps/domains/disinibiti.com/public_html/racconti-erotici NewRootPath:/home/hdps/domains/disinibiti.com/public_html/racconti-erotici HTTP_HOST:www.disinibiti.com DOCUMENT_ROOT:/var/www/hdps/domains/disinibiti.com/public_html RootURL:cconti-erotici/ rootURL is cutted in the same server i have other PW sites and all work good.
  7. mmm..having some troubles in a subdir with - separator like /sub-dir/. PW cuts my subdir name in /b-dir/ with many errors...
  8. It seems there is nothing strange in what you want, simply you have to create the right template for this page and arrage you images and descriptions like the example, images is PW can have description fields.
  9. Before install...i hope the xml skip the hidden pages..right?
  10. fine thanks
  11. Situations with visible emails can be various, especially when your page is not public and only a user group can access, but there are a lot of other cases, not all the websites are similar...however i will use the custom code for this scope, thanks
  12. It's possible to install and run PW on a subdir like www.domain.com/subdir/ ?
  13. looks interesting...maybe you can share your module.. ;D For making this i'm using a template with the code inside, but everytime i update the site i need to call that page for generating sitemap or other xml feed.
  14. Is there a way to access to 'email' field when pw render a comment? 'commentHeader' => 'Posted by {cite} on {created}', i tried to add {email} in the code...
  15. this is a good idea, thanks...
  16. it's the same , the www part tell only using always the www domain to avoid duplicated contents but other behavior remain the same
  17. Done. ################################################################################################# # START PROCESSWIRE HTACCESS DIRECTIVES ################################################################################################# Options -Indexes Options +FollowSymLinks RewriteEngine On RewriteCond %{http_host} ^soddisfa [NC] RewriteRule ^(.*)$ http://www.soddisfa.com/$1 [R=301,L] Redirect /6-amicizie.html http://www.soddisfa.com/amicizie/ # ----------------------------------------------------------------------------------------------- # Access Restrictions: Keep web users out of ProcessWire system files # ----------------------------------------------------------------------------------------------- RewriteCond %{REQUEST_URI} (^|/)\.htaccess$ [NC,OR] RewriteCond %{REQUEST_URI} (^|/)site/assets/(cache|logs|backups|sessions|config|install)($|/.*$) [OR] RewriteCond %{REQUEST_URI} (^|/)site/install($|/.*$) [OR] RewriteCond %{REQUEST_URI} (^|/)(wire|site)/templates-admin($|/|/.*\.(php|html?|tpl|inc))$ [OR] RewriteCond %{REQUEST_URI} (^|/)site/templates($|/|/.*\.(php|html?|tpl|inc))$ [OR] RewriteCond %{REQUEST_URI} (^|/)site/assets($|/|/.*\.php)$ [OR] RewriteCond %{REQUEST_URI} (^|/)wire/(core|modules)/.*\.(php|inc|tpl|module)$ [OR] RewriteCond %{REQUEST_URI} (^|/)site/modules/.*\.(php|inc|tpl|module)$ [OR] RewriteCond %{REQUEST_URI} (^|/)(COPYRIGHT|INSTALL|README|htaccess)\.txt$ RewriteCond %{REQUEST_URI} (^|/)site-default/ RewriteRule ^.*$ - [F,L] # ----------------------------------------------------------------------------------------------- # Ensure that the URL follows the name-format specification required by ProcessWire # ----------------------------------------------------------------------------------------------- RewriteCond %{REQUEST_URI} "^[-_.a-zA-Z0-9/]*$" # ----------------------------------------------------------------------------------------------- # If the request is for a file or directory that physically exists on the server, # then don't give control to ProcessWire, and instead load the file # ----------------------------------------------------------------------------------------------- RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # ----------------------------------------------------------------------------------------------- # Pass control to ProcessWire if all the above directives allow us to this point. # ----------------------------------------------------------------------------------------------- RewriteRule ^(.*)$ index.php?it=$1 [L,QSA] ################################################################################################# # END PROCESSWIRE HTACCESS DIRECTIVES ################################################################################################# I'm not expert of htaccess code maybe some PW code here fails the redirect...
  18. I recreated a site using PW and i need to redirect some old urls to new but the rediret directive in .htaccess file is not working good, PW send me to 404 page and the url became www.mysite.com/new-page/?it=old-page.html
  19. @Ryan You are right but i'm fighting with my seo expert and he is also right about little improvements...He knows his job and in many years of work with him i have to admin that the results talk...look at this forum url... maybe some people don't like .html but if i can have little advantages from mr. G, i like too. About selectors, i will use the .html only to "final" pages, i mean pages that will never have children and that i will never use for selectors so this is not a problem like can be for categories (in my case).
  20. Good solution adding .html in the page name...
  21. That's great because i have lots of categories..thx
  22. Thanks for the suggests... hidden_path is the name of the folder where i store images. I save this parameters as a field in my page and when i displays it i know where the images are. Regarding the error i've found right now. I'm feel and idiot....it's the uppercase field Email....when the code checks mandatory fields before saving the page i wrote email and not Email... Sorry for this post.
  23. This is good..but it could be better when i choose "No" for this setting to add a custom end like .html o whatelse instead of a / ;D
  24. mmm, my last post with whole template has disappeared...but if a try to reply i can see it in replies queue...
  25. Mmmm, i tried to change the submit name with no luck.. This is my template, divided in two files, the code that save the page and the form included. insert-ad.php <?php $code = md5(uniqid(rand(), true)); $code = substr($code, 0, 10); require_once('functions.php'); if($input->post->submit_annuncio) { // create a new Page instance $p = new Page(); // set the template and parent (required) $p->template = $templates->get("annuncio"); $categoria = $input->post->categoria; $p->parent = $pages->get("/".$categoria."/"); // populate the page's fields with sanitized data // the page will sanitize it's own data, but this way no assumptions are made $p->hidden_path = $sanitizer->text($input->post->hidden_path); $p->title = $sanitizer->text($input->post->title); $p->nome = $sanitizer->text($input->post->nome); $p->Email = $sanitizer->email($input->post->Email); $p->citta = $sanitizer->text($input->post->citta); $provincia = $input->post->provincia; $p->provincia = $pages->get("/annunci/".$provincia."/"); $p->categoria = $pages->get("/".$categoria."/"); $p->testo = $sanitizer->textarea($input->post->testo); // PW2 requires a unique name field for pages with the same parent // make the name unique by combining the current timestamp with title $p->name = $sanitizer->pageName(rand(0,900)."-".tagliaUrl($p->title,50)); /* $p2 = new page(); $p2->template = $templates->get("citta"); $p2->parent = $input->post->provincia; $p2->title = $sanitizer->text($input->post->citta); $p2->name = $sanitizer->pageName(time() . $input->post->citta);*/ if($p->title && $p->email && $p->citta) { // our required fields are populated, so save the page // you might want to email it here too $p->save(); //$p2->save(); echo "<h2>Grazie, il tuo annunci é stato inserito.</h2>"; } else { // they missed a required field echo "<p class='error'>Errori nel form. Compila tutti i campi.</p>"; } } else { ?> <!DOCTYPE html> <html lang="it"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title><?php echo $page->get("headline|title"); ?></title> <meta name="description" content="<?php echo $page->summary; ?>" /> <meta name="robots" content="noindex, nofollow" /> <link rel="stylesheet" type="text/css" href="<?php echo $config->urls->templates?>styles/main.css" /> <!--[if IE]> <link rel="stylesheet" type="text/css" href="<?php echo $config->urls->templates?>styles/ie.css" /> <![endif]--> <script type="text/javascript" src="<?php echo $config->urls->templates?>scripts/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="<?php echo $config->urls->templates?>scripts/main.js"></script> <script type="text/javascript" src="<?php echo $config->urls->templates?>scripts/jquery.validate.min.js"></script> <script type="text/javascript" src="<?php echo $config->urls->templates?>scripts/jquery.metadata.js"></script> <script type="text/javascript"> function gotopage(page){ window.location = page; } </script> <link href="/uploadify/uploadify.css" type="text/css" rel="stylesheet" /> <script type="text/javascript" src="/uploadify/swfobject.js"></script> <script type="text/javascript" src="/uploadify/jquery.uploadify.v2.1.4.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#file_upload').uploadify({ 'uploader' : '/uploadify/uploadify.swf', 'script' : '/uploadify/uploadify.php', 'cancelImg' : '/uploadify/cancel.png', 'folder' : '/photos/', 'buttonImg' : '/uploadify/button.jpg', 'width' : 135, 'fileExt' : '*.jpg;*.jpeg', 'multi' : true, 'queueSizeLimit' : 3, 'sizeLimit' : 307200, 'auto' : false, 'scriptData' : {'title':'<?=$code?>'}, 'onQueueFull' : function (event,queueSizeLimit) { alert("Non puoi inserire altre immagini"); return false; }, 'onAllComplete' : function(event,data) { alert('Immagini caricate. Ora clicca su Inserisci Annuncio'); } }); $("#form_annuncio").validate({ rules: { email: { required: true, email: true } }, messages: { email: "Inserisci una email valida" } }); $.metadata.setType("attr", "validate"); }); </script> </head> <body> <div id="container"> <div id="header"><a href="/"><img src="/site/templates/styles/images/logo.png" /></a></div> <? include('sidebar.inc'); ?> <div id="main"> <h2>Inserisci un annuncio gratuito</h2> <?php include("./nuovo-annuncio.inc"); ?> </div> <div id="clear"></div> </div><!-- container --> <div id="footer"> <div id="inside">© 2010-2011 MF Network s.r.o.</div> </div> </body> </html> <? } ?> nuovo-annuncio.inc <form action='/inserisci-annuncio/' method='post' id="form_annuncio" name="form_annuncio" enctype="multipart/form-data"> <input type="hidden" name="hidden_path" value="<?=$code?>" /> <p> <label id="etichetta">Nome</label> <input type='text' name='nome' class="required" /> </p> <p> <label id="etichetta">E-Mail</label> <input type='email' name='Email' id='Email' class="required" /> </p> <p> <label id="etichetta">Provincia</label> <?php $province = $pages->get("/annunci/")->children("sort=provincia_regione"); echo "<select name='provincia'><option value=''>Scegli la tua Provincia</option>"; $regione = ""; foreach($province as $provincia) { if ($regione == $provincia->provincia_regione){ echo "<option value='{$provincia->name}'> {$provincia->title}</option>"; }else{ echo "<option value='' disabled style='background-color:#dcdcc3;text-transform:uppercase'>{$provincia->provincia_regione}</option>"; echo "<option value='{$provincia->name}'> {$provincia->title}</option>"; } $regione = $provincia->provincia_regione; } echo "</select>"; ?> </p> <p> <label id="etichetta">Cittá</label> <input type='text' name='citta' class="required" /> </p> <p> <label id="etichetta">Categoria</label> <select name="categoria"> <? foreach ($pages->find("template=categoria") as $categoria) echo "<option value='{$categoria->name}'>{$categoria->title}</option>"; ?> </select> </p> <p> <label id="etichetta">Titolo</label> <input type="text" name='title' id="title" style="width:300px" class="required" /> </p> <p> <label id="etichetta">Annuncio</label> <textarea name='testo' cols="60" rows="6" class="required"></textarea> </p> <p> <label id="etichetta">Immagini</label> <div style="width:390px;float:left"><strong>Puoi inserire fino a 3 immagini .jpg di massimo 300 kb l'una.<br />Clicca sul bottone arancione per scegliere le tue immagini, dopo clicca su Carica Immagini.<br /></strong> <input type="file" id="file_upload" name="file_upload" /> <a class="carica" href="javascript:$('#file_upload').uploadifyUpload();">Carica Immagini</a> </div><div style="clear:both"></div> </p> <p> <input type='submit' name='submit_annuncio' value='Inserisci Annuncio' /> </p> </form>
×
×
  • Create New...