Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

9 Neutral

About Sten

  • Rank
    Jr. Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi Regesh, Do you have the latest version of ProcessWire ? Did you try to install a previous version ?
  2. Thank you Tarkvsg, I will try. Eventually I reinstalled my PW.
  3. In fact my root page has a server error and my others are blank.
  4. Hell, Although I use a config on an other of my sites that works well. An error 500 is driving me nuts. Coul someone have a look on my config server { listen 80; server_name attente.xyz; rewrite ^ https://$server_name$request_uri? permanent; } server { listen 443 ssl; server_name attente.xyz; ssl_certificate /etc/letsencrypt/live/krouus.company/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/krouus.company/privkey.pem; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Activer le ciphers et mettre ceux autorisés (je vous laisse faire de plus amples recherches pour ça ;) ) ssl_prefer_server_ciphers on; ssl_ciphers 'DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-CAMELLIA256-SHA:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-CAMELLIA128-SHA:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES128-SHA256'; ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; # La fameuse clé générée en dernier ssl_dhparam /etc/nginx/dhparam.pem; # Ajout d'une règle http add_header Strict-Transport-Security "max-age=31536000;"; root /var/www/attente.xyz/html; index index.php index.html index.htm; location / { # try_files $uri $uri/ /index.php?it=$uri&$args; try_files $uri /index.php$is_args$args; fastcgi_pass unix:/run/php/php7.0-fpm.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_intercept_errors on; fastcgi_ignore_client_abort off; fastcgi_connect_timeout 60; fastcgi_send_timeout 180; fastcgi_read_timeout 180; fastcgi_buffers 4 256k; fastcgi_buffer_size 128k; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k; } location ~ \.php$ { #try_files $uri =404; include snippets/fastcgi-php.conf; include /etc/nginx/fastcgi_params; fastcgi_pass unix:/run/php/php7.0-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # .htaccess 10. fastcgi_param HTTP_MOD_REWRITE On; fastcgi_param X-Real-IP $remote_addr; fastcgi_param X-Forwarded-For $remote_addr; fastcgi_param Host $host; } location ~* \.(?:css|gif|htc|ico|js|jpe?g|png|swf|svg|ttf|eot|woff|less|pdf)$ { #expires max; log_not_found off; ## No need to bleed constant updates. Send the all shebang in one ## fell swoop. tcp_nodelay off; ## Set the OS file cache. open_file_cache max=1000 inactive=120s; open_file_cache_valid 45s; open_file_cache_min_uses 2; open_file_cache_errors off; valid_referers attente.xyz; ##ajout ProcessWire expires 24h; #log_not_found off; access_log off; try_files $uri /index.php?it=$uri&$args; } # .htaccess 8.1 charset utf-8; # .htaccess 3. location = /favicon.ico { log_not_found off; access_log off; } location = /robots.txt { log_not_found off; access_log off; } # .htaccess 4. # add_header X-Frame-Options SAMEORIGIN always; # Set by ProcessWire core add_header X-XSS-Protection "1; mode=block"; # add_header X-Content-Type-Options "nosniff"; # ----------------------------------------------------------------------------------------------- # .htaccess 5. # ----------------------------------------------------------------------------------------------- # Block access to ProcessWire system files location ~ \.(inc|info|info\.json|module|sh|sql)$ { deny all; } # Block access to composer files location ~ composer\.(json|lock)$ { deny all; } # Block access to any file or directory that begins with a period (except well-known) location ~ (^|/)\.(?!well-known)|^\..*$ { deny all; } # ----------------------------------------------------------------------------------------------- # .htaccess 15. # ----------------------------------------------------------------------------------------------- # Block access to protected assets directories location ~ ^/(site|site-[^/]+)/assets/(cache|logs|backups|sessions|config|install|tmp)($|/.*$) { deny all; } # Block acceess to the /site/install/ directory location ~ ^/(site|site-[^/]+)/install($|/.*$) { deny all; } # Block dirs in /site/assets/ dirs that start with a hyphen location ~ ^/(site|site-[^/]+)/assets.*/-.+/.* { deny all; } # Block access to /wire/config.php, /site/config.php, /site/config-dev.php, and /wire/index.config.php location ~ ^/(wire|site|site-[^/]+)/(config|index\.config|config-dev)\.php$ { deny all; } # Block access to any PHP-based files in /templates-admin/ location ~ ^/(wire|site|site-[^/]+)/templates-admin($|/|/.*\.(php|html?|tpl|inc))$ { deny all; } # Block access to any PHP or markup files in /site/templates/ location ~ ^/(site|site-[^/]+)/templates($|/|/.*\.(php|html?|tpl|inc))$ { deny all; } # Block access to any PHP files in /site/assets/ location ~ ^/(site|site-[^/]+)/assets($|/|/.*\.php)$ { deny all; } # Block access to any PHP files in core or core module directories location ~ ^/wire/(core|modules)/.*\.(php|inc|tpl|module)$ { deny all; } # Block access to any PHP files in /site/modules/ location ~ ^/(site|site-[^/]+)/modules/.*\.(php|inc|tpl|module)$ { deny all; } # Block access to any software identifying txt files location ~ ^/(COPYRIGHT|INSTALL|README|htaccess)\.(txt|md)$ { deny all; } # Block all http access to the default/uninstalled site-default directory location ~ ^/site-default/ { deny all; } } Thank you for any hunch.
  5. Thank you very Much BitPoet for your help, I was able to solve adding check_access=0 in my selector. Great!
  6. What I don't understand is that the field is displayed anyway with the right data (each language has a number) but displaying the b tag.
  7. Hi BitPoet, Here is my code $texte=""; $leslangues=array(1=>"fr", 2=>"de",3=>"en",4=>"es",5=>"he",6=>"it",7=>"pt",8=>"ru"); foreach ($leslangues as $langue => $langue_str){ $element = $pages->find("template=clef, langue=$langue, limit=1, sort=-id")->first()->title; $nombre=(int) filter_var($element, FILTER_SANITIZE_NUMBER_INT); if (!$nombre){ $nombre=1; } $texte.="<b>$langue_str</b> : $nombre, "; unset($nombre); } $texte=rtrim(rtrim($texte),","); return $texte; Thank you for your help.
  8. On the module FieldtypeRuntimeMarkup I have error according to roles. As superuser I don't have any error but as contributor I have trying to Get property on non-object and the html code in the field is displayed as source. The line pointed at is this one protected function renderMarkup(Page $page, Field $field) { //if code field is empty return early if(!$field->runtimeFields) return; //locally scope $pages to eval() $pages = $this->wire('pages'); ------> $str = eval($field->runtimeFields); //since we are dealing with custom PHP code but also want to make sure that only markup is returned //if eval() returns anything other than a string or an integer, we throw an error (e.g. if an object or array is returned) if (is_string($str) || is_int($str)) return $str; //we need to check if we are in admin. Otherwise with an error, in the frontend the name of the the Fieldtype is returned if we echo out the field elseif($this->wire('process')->className() == 'ProcessPageEdit') return $this->error($this->_('Only strings and integers should be returned by your custom code! $ } Thank you
  9. Hello, An administrator on my last site has created a page with the template "home" by error and now this page is homepage and I can't find the real one. Could someone help me ? Thank you
  10. Arjen Thank you very much for your answer. I will change my templates structure.
  11. Hello, I have some difficulties to understand extends. How send variables through extends ? like here, may i send {{ page.title }} or {{langue_str}} to base.twig ? Base.twig is my main template with headers, footers... that extends each page. {% extends 'base.twig' %} {% block content %} <div id="titres"> <div id="titre">{{ page.title }} {{ lang }}</div> </div> <div class="hr"></div> <br> {{ include('engagement.twig') }} {{ include('lettre.twig') }} {{ intro_derniers_textes }}<br /><ul> {% for texte in derniers_textes %} <li><a href="{{ texte.url }}{{langue_str}}/">{{ texte.title }}</a></li> {% endfor %} </ul> {% endblock %} Thank you
  12. Hi, I solved my problem, it was a regex problem in the template.
  13. Hi, I allowed urlSegments in my config and for the template I use in this case. My page doesn't give data outside title and name. This is my template : GNU nano 2.7.4 File: liste.php <?php namespace ProcessWire; if (preg_match('/^[a-z]{2}$/',$input->urlSegment1)){ $langue=array_search($input->urlSegment1, $toutesleslangues); $elements = $pages->find("template=enseignement, langue=$langue, sort=-id"); } elseif(in_array($input->urlSegment1,$cats_slug) AND preg_match('/^[a-z]{2}$/',$input->urlSegment2)){ $langue=array_search($input->urlSegment2, $toutesleslangues); $categorie=array_search($input->urlSegment1, $cats_slug); $elements = $pages->find("template=enseignement, cat=$categorie, langue=$langue, sort=-id"); } else { // throw a 404 throw new Wire404Exception(); } $langue_str=$toutesleslangues[$langue]; include_once "../langues/".$langue_str.".php"; $cat=${"cats_".$langue_str}[$page->cat]; $view->set("posts",$elements); ?> I use twig. My page works with one urlSegment works but not with two. With two, it is a 404 page. I tested every value. I don't see what goes bad. This page displays a list of urls. Thank you for any help.
  14. @Robin S. Great I'll look at it soon. Thank you Robin, I would not have done anything without your help.
  • Create New...