Jump to content

desbest

Members
  • Posts

    117
  • Joined

  • Last visited

Posts posted by desbest

  1. Two words: quality control

    Too many cooks spoil the broth

    20 chefs all working on the same soup, makes a crappy soup

    Someone has to to be the ringleader to perform quality control on every pull request, rather than to just add it in because "it works and a net positive feature set"

    Unless you want it to be like other open source projects, where anything and everything gets added in, just because it works and provides a net positive for the feature set, like [[[----insert other CMS here ----]]]  ??‍♀️

    • Like 2
    • Yes the 404 page appears in the page list and it is published
    • No I don't use basic-page template, I use a template I made called error404. Changing the template back to basic-page doesn't work.
    • No I have not modified any core code in processwire. The only file I modified was site/config.php

    Also turning on debug mode doesn't help

    Any other ideas?

  2. On 6/23/2020 at 8:59 PM, desbest said:

    Padloper 2 will not support the current ‘any page can be a product’ paradigm. Technically, products will still be pages. However, all products will utilise the same Padloper template. These will be in

    Quote

    What does this mean? What's the reason for the change?

    On 6/24/2020 at 8:33 AM, diogo said:

    @desbest The answers to your questions are on that very same post:

    Quote

    Padloper 2 will be a major release that incorporates a new, central backend shop for Padloper. This will be a new process module that pulls from the existing parts of Padloper (data models, etc) into one interface (more on this below). This version will also be extensible in the frontend, allowing for the plugging in of a new, optional, commercial frontend shop (full featured shop profile).

    and

    Quote

    A new backend interface will be the major visual difference between the existing Padloper and Padloper 2. It goes beyond visual differences though. The new backend will be the single gateway for managing all shop-related features, both current and new ones.

     

     

    Sorry but I'm not quite sure what this means.

    Can someone explain the difference of the old system of every page can be a product, and the new system of it not being that way and only pages with the padloper template can be a product?

    But people can decide what fields belong to each template, and with different types of products, it doesn't make sense to have the same template (ie. padloper) for each product.

    What are the advantages and disadvantages of the two?

    Can someone explain the difference of this further to me?

  3. Which PayPal API will be supported? Will it support PayPal IPN? I like PayPal IPN.

    Which Stripe API will be supported? Will it support Stripe Checkout or Stripe Payments? Will it support stripe.js v2 or v3 with elements?

    Will it use the embeddable stripe form that looks like this?

     

    embeddable stripe form.png

  4. On 9/3/2018 at 4:35 PM, kongondo said:

    Padloper 2 will not support the current ‘any page can be a product’ paradigm. Technically, products will still be pages. However, all products will utilise the same Padloper template. These will be invisible to the shop users themselves (e.g., hidden in admin tree). Only superusers will have full control of the Padloper system stuff.

    What does this mean? What's the reason for the change?

     

  5. I've made my own redirect template for redirecting url's like http://hostingz.org/indicho

    I think this redirect template is conflicting with the error 404 page.
     

    <?php
    
    function bot_detected() {
    
      return (
        isset($_SERVER['HTTP_USER_AGENT'])
        && preg_match('/bot|crawl|slurp|spider/i', $_SERVER['HTTP_USER_AGENT'])
      );
    }
    
    if (bot_detected() === true){
        //echo "is a bot";
    } else {
        //echo "not a bot";
        $hitcount = $page->views;
        $newhitcount = $page->views +1;
        //add 1 to the view counter
        $daview = $pages->get($page->id);
        $daview->of(false);
        $daview->views = $newhitcount;
        $daview->save();
        //save the higher value onto the link page
    }
    
    $session->redirect($page->daurl);
    //redirect to link
    
    ?>

    and there's _init.php
     

    <?php
    
    $pages->addHookBefore('Page::path', function($event) {
      $page = $event->object;
      if($page->template == 'post') {// template used by 'post-a'
        // ensure that pages with template 'post' live off the root rather than '/posts/'
        $event->replace = true;
        $event->return = "/$page->name/";
      }
    });
    
    ?>

     

  6. My error pages do not show on my website. [see here]
    My web browser Firefox shows this error

    Quote

    The page isn't redirecting properly

    An error occurred during a connection to hostingz.org.

     This problem can sometimes be caused by disabling or refusing to accept cookies.

     

    I have no PHP on the error404.php template.

    What is going on, and how do I fix it?

  7. Hello I'm having trouble figuring out how to use the code above to run a hook before an error 404 exception, for when a template file is run with due to $config->prependTemplateFile before any template file runs.

    <?php
    //wire()->addHookBefore('Page::path', function($event) { @note: this or below, both work.
    $pages->addHookBefore('ProcessPageView::pageNotFound', function($event) {
      echo "<h1>hello</h1>";
      $page = $event->object;
      if($page->template == 'LinkShortener') {// template used by 'post-a'
        $dapath = str_replace("/", "", $_SERVER[REQUEST_URI]);
          $redirectTo = $pages->find("template=LinkShortener,name=$dapath")->first();
          header("Location: $redirectTo->full_path");
      }
    });

    The text hello does not display for an error 404.

    What is going on?

  8. Hello after the late reply,

    I can't use that example of redirecting a URL with query strings to a static page, because the pages I would like to use URL rewriting for are not static pages, they are dynamically generated based on what is inside the query string.

    See below for examples.

    Cryptocurrency comparison: BVC vs Changelly // Binance vs Changelly

    Forex comparison:  IC Markets vs AvaTrade  // EasyMarkets vs AvaTrade

    Note the query string in the URL. I would like to rewrite the URL based on the query string, of which the content of the page is dynamically generated based on the query string.

  9. I've read all three threads and have these comments.

    The pages on my website I want to write have a query string on the end, so I would like to rewrite the URL so instead of the URL saying /broker/?choice1=1206&choice2=1207&mode=cryptocurrency it instead says /compare/local-bitcoins-vs-cex-io ,so that means that the threads Virtual Parents and Hide Parent Page From URL are not suitable for my needs.

    That leaves me with Routing and Rewriting URLs left to read. The only relevant post in the thread is this one, and I have followed those instructions (see first post above) and the route isn't created and the URL does not rewrite.

    What is going on?

  10. Hello I checked, and I'm not calling my hook too late, because I put exit(); on runfirst.php, nothing displayed when running my website in the web browser. runfirst.php is running before every other template file runs.

    I tried the code in hooks.php and it doesn't work.

    I made a quick modification to what hooks.php to the page below, and it doesn't work.

    wire()->addHookBefore('Page::path', function($event) {
      $page = $event->object;
      $event->replace = true;
      $event->return = "/x/$page->name/";
    }); 

    mod_rewrite is enabled and the URL of every page in my Processwire website isn't being rewritten.

    I'm using Processwire 3.0.99

    What is going on that isn't allowing me to rewrite the URL in Processwire?

  11. I can't get rewriting the URL to work on processwire.

    Below is my following code in runfirst.php template file that runs before any other template as defined in the config file with $config->prependTemplateFile = 'runfirst.php';

    <?php
    //url rewrite
    
    // https://processwire.com/talk/topic/1799-routes-and-rewriting-urls/
    function segmentUrl(HookEvent $event){
        $url = $event->return; // requested url
        $segment = "/page/";
        if(strpos($url,$segment) == 0){
            $event->return = str_replace(rtrim($segment,'/'),'/article/',$url);
        }
    }
    
    
    // https://processwire.com/talk/topic/2984-controlling-page-url-structure/
    function hookPagePath(HookEvent $e) {
     $page = $e->object;
     // if($page->template == 'article') $e->return = "/article/$page->name/";
     $e->return = "/article/$page->name/";
    }
    
    // $wire->addHookAfter('Page::path', null, 'segmentUrl');
    // $pages->addHookAfter('Page::path', null, 'hookPagePath');
    ?>

    It doesn't matter which ->addHookAfter command I use, the page still does not rewrite. I have enabled URL segments on the template for the web page I am running.

    What is going on and how do I fix it?

×
×
  • Create New...