Jump to content


  • Posts

  • Joined

  • Last visited

Posts posted by k07n

  1. Hi! Really sorry if this is not right place for this but:

    After 2.5.18 update I started getting error:

    Exception: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '41-0' for key 'PRIMARY' (in /www/wire/core/FieldtypeMulti.php line 261)

    Any advice how to fix it?

  2. Check for "Strip Tags" option on the Input tab in your field.

    upd: sorry, I'm wrong here, strip tags will remove BR completely.

    It is looks like you choose HTML Entity Encoder in Text Formatters and it replace 



    • Like 3
  3. All the dealers news shops maps WOW.

    How many people fill the content ? :)

    So it works really fast. It Will be interesting to take a look on the site structure for the amount of content.

    For Example how many differen templates do you use ? With / Without template files.

    Whats initialized in the settings? Which method do you use for the output for the content. There are a lot of different examples here and there but it's especially interesting for such a huge project. Which way you have chosen. :)

    I am not experienced programmer, so there are nothing interesting or new in my structure or templates. There are 12 templates with files and about 20 without.

    Basic-page, for example (really basic, but structure is similar to others):

    <!DOCTYPE html>
    <html lang="ru" class="no-js">
      <?php include("./_head.php"); ?>
        <?php include("./_topbar.php"); ?>
        <?php include("./_sidebar.php"); ?>  
        <div class="wrapper white">
          <div class="row">
            <div class="small-12 columns">
              <header class="page-header">
                <h1><?php echo $page->get('headline|title'); ?></h1>
          <div class="row content">
            <div class="medium-12 columns">
              <?php echo $page->body;?>
        <?php include("./_footer.php"); ?>

    Dealers map structure:







    So, there are 630 shops for now in 1112 cities (I have imported cities, so more than half are empty now). 

    Product catalog has 278 items and same structure.

    And something about 100 pages with docs and "We are bla-bla-bla pages".


    Very nice, and very fast. Are you using ProCache on the entire site?


    • Like 1
  4. Thanks, guys, for the great explanation. It's very helpful.

    But I think now why am I wanted to throw 404 to the simple get parameter? I have to check for IDs which I want to redirect and just leave others alone  without any redirections. Am I right?


    It was not very good idea. Search engines don't like when several addresses show page with same content.

  5. Hi, horst!

    After updating PW to the latest dev yesterday, i've getting this on pimLoad():

    Fatal error: Exception: You do not have permission to execute this module - ProcessCropImage (in D:\OpenServer\domains\5520.pro\wire\core\Modules.php line 717)
    #0 D:\OpenServer\domains\5520.pro\wire\core\Modules.php(668): Modules->getModule('ProcessCropImag...')
    #1 D:\OpenServer\domains\5520.pro\site\modules\PageImageManipulator\ImageManipulator.class.php(254): Modules->get('ProcessCropImag...')
    #2 D:\OpenServer\domains\5520.pro\site\modules\PageImageManipulator\PageImageManipulator.module(185): ImageManipulator->__construct(Object(Pageimage), Array, false)
    #3 D:\OpenServer\domains\5520.pro\wire\core\Wire.php(381): PageImageManipulator->getPageImageManipulator(Object(HookEvent))
    #4 D:\OpenServer\domains\5520.pro\wire\core\Wire.php(317): Wire->runHooks('pimLoad', Array)
    #5 D:\OpenServer\domains\5520.pro\site\templates\docs-product.php(12): Wire->__call('pimLoad', Array) #6 D:\OpenServer\domains\5520.pro\site\templates\docs-product.php(12): Pageimage->pimLoad('test')
    #7 D:\OpenServer\domains\5520.pro\wire\core\TemplateFile in D:\OpenServer\domains\5520.pro\index.php on line 220

    any suggestions?

  6. share my nginx config part for this:

    server {
      # all your stuff here
      error_page 404 /index.php?id=/http404/;
      # bla-bla-bla config
      # add this before location / {...}
      location ~ [^-_.a-zA-Z0-9/~] {
        try_files $uri $uri/ =404;

    working fine for me

    • Like 1
  7. if (count($u->avatar)){                // if user HAS an avatar image
        $avatar_thumb .= "this is a test"; // do this
    else { // else do this, but user has not an avatar, so you don't see image or text in both cases 
       $avatar_thumb .= "<img class='img-rounded img-responsive' src='{$thumb->url}'' alt='{$thumb->description}'' />";  

    so in your code you need ... (ooh.. I'm typing too slow) what adrian said.

  8. else {
      $avatar_thumb .= "<img class='img-rounded img-responsive' src='{$u->avatar->url}' alt='{$u->avatar->description}' />";  



    $u = $users->get($user);
    if( $ava = $u->avatar ) {
    	$avatar_thumb = "<img class='img-rounded img-responsive' src='{$ava->url}' alt='{$ava->description}' />";
    } else {
    	$avatar_thumb = "this is a test";


  9. A 404 exception will interrupt the render process and render the 404 page instead of the requested one along with a 404 header and url stays the same. So the render of the 404 page in the background calls the _init.php again.

    When using the prepend file _init.php you always have to keep in mind that it's called on every $page->render() (you might also do manually in a template to render another page). Depending what you do in the _init.php it may cause trouble cause it's called multiple times for a request.

    Thanks, guys, for the great explanation. It's very helpful.

    But I think now why am I wanted to throw 404 to the simple get parameter? I have to check for IDs which I want to redirect and just leave others alone  without any redirections. Am I right?

  10. Edit: you could, probably, also do this in your home template, right? Assuming that old URL's were always "/?id=*", they should always end up on your home page and that should work just as well.. or even better? :)

    You right, just one template needed! Dumb me ^_^.


  11. Hi!

    I rebuilding site from another CMS and need to redirect some old pages to new ones.

    Old scheme of urls is site.com/index.php?id=123

    I have this in _init.php:

    $id = (int)$input->get->id;
    if ($id > 0) {
      $redirect_page = wire('pages')->get("parent=/tools/old2new/, template=old2new-redirect, name=$id");
      if ($redirect_page instanceof NullPage) {
        throw new Wire404Exception();
      } else {
        $url = $redirect_page->redirect_to->url . $redirect_page->param; 

    So, Wire404Exception() -- throw me this:

    Fatal error: Exception: (in \www\site\templates\_init.php line 21) #0 \www\wire\core\TemplateFile.php(139): require() #1 [internal function]: TemplateFile->___render() #2 \www\wire\core\Wire.php(359): call_user_func_array(Array, Array) #3 \www\wire\core\Wire.php(317): Wire->runHooks('render', Array) #4 \www\wire\modules\PageRender.module(337): Wire->__call('render', Array) #5 \www\wire\modules\PageRender.module(337): TemplateFile->render() #6 [internal function]: PageRender->___renderPage(Object(HookEvent)) #7 \www\wire\core\Wire.php(359): call_user_func_array(Array, Array) #8 \www\wire\core\Wire.php(317): Wire->runHooks('renderPage', Array) #9 \www\wire\core\Wire.php(381): Wire->__call('renderPage', Array) #10 \www\wire\core\Wire.php(381): PageRender->renderPage(O in \www\index.php on line 216

    But if I use exception from another template it working fine and render 404 page. 

    Please help to fix it and maybe some suggestion to "redirect" code?

  12. (Those who watched "House MD" might hear "Teardrop" in its opening titles)

    And the Paradise Circus from Heligoland is the opening for Luther (SUPERB crime drama, sorry for second offtop :) )


    The main goal of landing pages is the 'BUY ME' button, which my site have not, lol. We have B2B strategy, and I working right now to convince my bosses to be `closer to client` and sell online (lots of troubles in fact %)).
    So I planning add `product microdata` in future (now it's useless because where is no price on site), buy some adwords and I think it will be ok for SEO (hate SEO, arrrggghh).
  13. One minor thing to mention about owlcarousel is the lack of circular slides. I prefer carousels which continues after the last slide.

    what's realy great about the owlcarousel is the fine-tuning between different screen widths. This could save you a lot of custom JS.

    When I'm in a hurry with a project I will consider owlcarousel.

    Agree. And the second one - it doesn't have built in "lightbox" feature. So, if I don't need to scroll multiple slides, I'll stay on fotorama.

  14. Hi!

    Here is my second work on PW: one page promo site for super mega cool strut mounts (some car stuff).
    - ProcessWire 2.3.7
    - multilingual; // pm me, if there are funny/wierd mistakes, please
    - scroll-scroll;
    - animated gif reincarnation;
    - about 50 times of Massive Attack - Heligoland in process.
    Thanks all of you, you guys are rock!
    • Like 13
  15. Hi!

    I have found some mistakes on your site in russian.

    1. In the main menu you need to change "Чаевые" to "Советы" (multiple meanings of the word, "чаевые" - this is what you give to the waiter)

    2. H1 home-top-header - change "коттеджей в Финляндии" to "Коттеджи в Финляндии"

    3. In the first selectbox "целая Финляндия" to "Вся Финляндия"

    4. Main menu "Add your cottage" will be "Добавьте свой коттедж" or "Добавить коттедж"

    If I find more, I'll let you know.

    • Like 1
  • Create New...