Jump to content

neildaemond

Members
  • Posts

    134
  • Joined

  • Last visited

Posts posted by neildaemond

  1. I just had an interesting issue. I suspect that the web host did something with apache which caused a short timeframe in which the "index.php" file was served instead of the PHP generated output.

    Firefox found the correct response when it was available(or didn't ever receive the index.php file) , but Chrome and Edge seemed to cache the index.php file. When I tried the link via Chrome thereafter, the index.php would just download with the filename "download".

    After clearing the cache and cookies, it was fine. but it took some time, worrying, and convo with support before I concluded that I had received an index.php and cached it.

    Now, I'm wondering if there is anything I can do to fix the issue for anyone else affected by the issue other than telling them "clear your cache and cookies".

     

    Anyone ever have similar experiences? Should we have a statement like:

    Header("Cache-Control: max-age=3000, must-revalidate");

    in our default index.php file?

    Cheers,

  2. I use the terminal client weechat.  After finding a nice little site https://tilde.club , use their ssh login and have weechat open with a screen all the time. I've just connected weechat-android to it which is a nice irc client for the mobile which ssh relays into the originally running weechat client.

    However, it only keeps history while logged on.. and what that tilde.club server restarts, I have to reconnect 😞 . I'm looking for a way to keep history during those restarts.

  3. I recently joined #processwire on freenode and plan to hangout there. I hope others who want to try IRC or are already use it will join as well :)

    I found that everyone has their preferred communication channels and there isn't really a need to make everyone conform to one official one. Of course, using the less popular option means that you're not entitled to receive all the newest updates unless someone relays it. Processwire's newsletter already works quite well for me in that regard.

  4. I'm I was (solution below) experiencing the same as below on PW 2.5.2, after installing via softaculus(which uses minimal site profile) on a cpanel based hosting:

    Currently I'm trying to get this to work, but I'm seriously questioning if I'm using this right. What I initially thought that had to do the following steps:

    1) Make sure all the traffic from www.seconddomain.com points to the home directory of the www.maindomain.com. (checked)
    2) Install the module and make sure that www.seconddomain.com is added to the textarea. (checked)
    3) Create a new page with the template 'home' with the title matching the domain - in this case www.seconddomain.com. Status of the page is published and hidden. (checked)

    Then I thought I have to add another page to make this work:

    4) Create a page with a template underneath the 'second' homepage called 'Testpage'. Status of the page is published.

    I can reach the page using the following URL:
     

    http://www.maindomain.com/www.seconddomain.com/testpage/
    But I can't reach the page using this URL:

    http://www.seconddomain.com/testpage/
    Things I've noticed

    1. When I try to reach www.seconddomain.com it displays a 404 error. (see below).
     

    except,

    When I try to reach www.seconddomain.com it displays as if I'm using www.maindomain.com

    Also, http://www.seconddomain.com/www.seconddomain.com/ redirects to http://www.seconddomain.com/

    SOLVED: needed to add www.seconddomain.com to $config->httpHosts in /site/config.php

    • Like 2
  5. p.s.

    at the bottom, just above </body> </html> you have a </script> tag that I can not trace back

    in the <script></script> stack. I wonder: does it have some closing function like something

    similar that is done in css with tricks like this: <div style="clear:both;"> </div> ?

    I still see an extra "</script>"  tag at the bottom right before the </body> ... I saw it by viewing the source in the browser and it's there on all pages.

    It's probably some extra markup in your foot.inc file... if you kept using those files.

  6. It's been a while since I first made this site, and there has been some updates

    The old site design which I first posted about was kept on

    corporate.ccw-global.com

    and I've done bootstrap based redesigns (UI focused) for

    www.ccw-global.com

    and

    hk.ccw-global.com

    Processwire has allowed or content writer to plant focused article/blog feeds and maintatin a SEO friendly URL structure. Article feeds are like those found on:

    http://hk.ccw-global.com/specialist-insurance/specialist-articles/

    http://hk.ccw-global.com/health-insurance/resources/articles/

    We've been able to upload TONS of pages, and keep them well organized with PW's nice backend and were able to use custom fields extensively to allow content writers to insert proper meta-data. Very happy with how it's working for us.


    Almost forgot, we added muli-language capability on http://www.ccw-global.com/es/ :)

    • Like 2
  7. sorry to highjack the thread but WOW, multi-language urls have come a long ways since I've last implemented the hacked urlsegment detection version we used to have... do links in the content switch to the appropriate language url automatically?

    Alice, I think that diogo was saying how instead of creating two branches of pages, you could use multi-language fields and urls in your pages to give them multi-language capability. This will result in much less overhead of creating duplicate pages... but, slightly less flexible if you wish to have different content based on the language (which doesn't seem to be te case). If all your pages are going to be translated, I recomend using multi-language fields and urls.

    • Like 1
  8. I'm seeing an issue with importing Chinese.

    I have a column which is importing Chinese text. However, only the rows which contained an English letter in it will import. The imported field will omit the initial Chinese, then start with the English segment, then the rest of the Chinese will follow as expected.

  9. hey guys, I tried putting the following code into /site/modules/SetPublishDate.module

     

    /**
    *
    * "Set Publish Date" module
    *
    */
    
    class SetPublishDate extends WireData implements Module {
    
    /**
             * getModuleInfo is a module required by all modules to tell ProcessWire about them
             *
             * @return array
             *
             */
    public static function getModuleInfo() {
    
             return array(
    
                     'title' => 'Set Publish Date',
                     'version' => 001,
                     'summary' => 'your summary',
                     'singular' => true,
                     'autoload' => true
                     );
    }
    
    /**
             * Initialize the module
             *
             * ProcessWire calls this when the module is loaded. For 'autoload' modules, this will be called
             * when ProcessWire's API is ready. As a result, this is a good place to attach hooks.
             *
             */
    public function init() {
    
             // add a hook after the $pages->save
             $this->pages->addHookAfter('save', $this, 'afterSave');
    
    }
    
    public function afterSave($event) {
        // get page object saved
        $page = $event->argumentsByName('page');
    
        // only on pages that have a publish_date field
        if(!$page->template->hasField('publish_date')) return;
    
        if($page->is(Page::statusUnpublished)) {
            // if unpublished, empty the field if not empty already
            if(!$page->publish_date) return;
            $page->publish_date = '';
            $page->save('publish_date');
        } else if(!$page->publish_date) {
            // if page (published) and field not populated, add current timestamp
            $page->publish_date = time();
            $page->save('publish_date');
        }
    }
    
    }
    
    

    However, in the module section it will detect the module but then shows as  version 0.0.0 and summary 'inactive'

    after pressing 'install', if get these errors:

    /** * * "Set Publish Date" module * */ class SetPublishDate extends WireData implements Module { /** * getModuleInfo is a module required by all modules to tell ProcessWire about them * * @return array * */ public static function getModuleInfo() { return array( 'title' => 'Set Publish Date', 'version' => 001, 'summary' => 'your summary', 'singular' => true, 'autoload' => true ); } /** * Initialize the module * * ProcessWire calls this when the module is loaded. For 'autoload' modules, this will be called * when ProcessWire's API is ready. As a result, this is a good place to attach hooks. * */ public function init() { // add a hook after the $pages->save $this->pages->addHookAfter('save', $this, 'afterSave'); } public function afterSave($event) { // get page object saved $page = $event->argumentsByName('page'); // only on pages that have a publish_date field if(!$page->template->hasField('publish_date')) return; if($page->is(Page::statusUnpublished)) { // if unpublished, empty the field if not empty already if(!$page->publish_date) return; $page->publish_date = ''; $page->save('publish_date'); } else if(!$page->publish_date) { // if page (published) and field not populated, add current timestamp $page->publish_date = time(); $page->save('publish_date'); } } }
    
    Error Class 'SetPublishDate' not found (line 437 of /var/www/xxxx/wire/core/Modules.php)
    
    This error message was shown because you are logged in as a Superuser. Error has been logged. 
    

    Any ideas? I'm using PW2.2.9

    EDIT (SOLVED) -> I left out the "<?php" at the beginning of the file.

  10. Thanks for the responses and good Idea Ryan, I'll try that if I have those kind of migration issues. I ended up upgrading my staging and dev server settings so that I don't need to work on sub-directories. It was a change I had been wanting to make :)

    with virtual hosts on my staging server, the urls now look like "cilentname.mydomain.com" instead of "mydomain.com/clientname/"

    For development within my own network, I updated my dev machine's /etc/resolve.conf so that the url "clientname" will resolve to the dev server ip. Again, setting up virtual hosts on my dev machine.

    I feel much more confident adding links into content with the new setup and don't feel obligated to rely on pageLinkAbstractor too much :)

  11. i've used "Example 3: Display a different language based on URL pre-segment" from the guide to make a site multi-language capable..

    my language gateway looks like:

    <?php 
    
        $user->language = $languages->get($page->name);
        $path = '/';
        foreach($input->urlSegments as $segment) {
        $path .= $segment . '/';
        }
        $mypage = $pages->get($path);
        if(!$mypage->id || !$mypage->viewable()) throw new Wire404Exception();
    
    //replace local navigation links
        $out = $mypage->render();
        $regex = '{(<a [^>]*href=["\']' . $config->urls->root .')(["\']';
        $topnav = $page->parent->children();
        foreach($topnav as $p) $regex .= "|" . $p->name;
        $regex .= ")}";
        $out = preg_replace($regex, '$1' . $page->name . '/$2', $out);
    
        echo $out; 
    
    

    the regex works quite well for everything else, but but kind of skews up on the 'blog/news' page which uses pagination.

    besides the fact that the pagination links end up as 'site.com/blog/blog/page2' instead of 'site.com/blog/page2', even when manually entering 'site.com/blog/page2', 4040 error is thrown.

    I'm guessing that things go bad here:

        $mypage = $pages->get($path);
        if(!$mypage->id || !$mypage->viewable()) throw new Wire404Exception();
    

    since  "path/to/page/page2" will not not return a page. Also, removing the "throw new 404" line, I end up with a blank page.

    Any suggestions?

    Thanks,

  12. It seems that there may be an issue with using Page Link Abstracter module with TextAreaLanguage.

    Whether I'm using a rich-text editor (i tried both TinyMCE and CKEditor) or plaintext field which contains a link or image, the above error msg in OP is shown and the page doesn't save.

    This only applied to the 'default' language, as I was able to save links and images in the language specific sections.

    After disabling the Page Link Abstracter for the field in question, there were no more errors.

    Unfortunately, I’m building my page under a sub-directory so being able to use page link abstracter will be nice.

  13. If I try to add a link or image into any part of a the 'default' box in a textareaLanguage field I get the following error when trying to save the page:

    Error: Call to a member function getLanguageValue() on a non-object (line 363 of /var/www/ctw/wire/modules/LanguageSupport/LanguageSupportFields.module)
     

    I've just recently changed a few textarea fields into textareaLanguage fields, then changed their options to use TinyMCE. I also have Page Link Abstractor enabled under the "Convert root URLs and page URLs: Prevents broken links when linked pages are moved" mode.

    I think I've used this same configuration before without a problem.... Does anyone know how to rectify this?

    Thanks,

  14. I've once had weird 'unexplainable' login issues caused by those seo tools that some web hosts provide in their control panel. It was a while ago, but I think they installed some folders(maybe they were invisible ones) to the web root. After deleting them, and doing away with those tools the login problem cleared up.

    Edit (added more):

    It screwed me up because after signing up for those services, the functionality 'kicked in' at some random later time, making it hard to make the connection.

  15. Hi,

    Sometimes when I try to change a page's template, I get this error thrown up by apache upon clicking 'save' :

    Not Found

     

    The requested URL /subdir_my_project_is_in/pw_admin/page/edit/saveTemplate was not found on this server.

     

    Additionally, a 401 Authorization Required
    error was encountered while trying to use an ErrorDocument to handle the request.

     

    Usually I just delete the page and add a new one with the same name, but this time I'm trying to change the '404 Page Not Found' page's template and am hesitant bc I'm not 100% sure how it's being reffered to.

    Could this be a problem with how my PHP is configured? or related to the fact that my website is at subdirectory (/var/www/project/) instead of the web root (/var/www/)?

    Thanks

×
×
  • Create New...