franctic-aerobic

Members
  • Content count

    94
  • Joined

  • Last visited

Community Reputation

23 Excellent

About franctic-aerobic

  • Rank
    Full Member

Contact Methods

  • Website URL
    https://www.asbjornness.no/

Recent Profile Visitors

1,979 profile views
  1. I got the following error in my error logs, and am trying to find the source of error. Has anyone experienced this error before? guest /http404/ Error: Exception: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '41-0' for key 'PRIMARY' (in /home/vidnokts/public_html/wire/core/FieldtypeMulti.php line 295)
  2. VID (https://www.vid.no/) is searching for a Norwegian-speaking developer for development of all kinds: Updates, tweaks, possible major updates, as an adviser, and more. There are no concrete plans for new big projects as of this moment, but we're always taking our website a step further. So development of any size could and will arise. It is therefore important that you are open for development of all kinds. Some facts: We use GitHub. We stay updated with latest version of core and modules. We are fans of UIkit. We are interested in new ideas, more effective ways to work and think details are important. Send a message if you are interested. Got some projects you are proud of? Send us a link in your message as well!
  3. I'd like to see HTML5 attributes for hyperlinks, such as download, media and ping, when editing links in ProcessWire (with CKEditor) . Download is the one I'm using myself, but I'm mentioning the other ones as well. More information at New HTML5 Attributes for Hyperlinks: download, media, and ping.
  4. This will be a one-way sync (as I mentioned in my second post in this thread). The data will only be updated in the Directus database. No editing on these data will be done in ProcessWire. Also said, but in other words: When the data is imported (to ProcessWire) and kept updated/synced, I will be able to use the ProcessWire API to handle the data as per today. Meaning no extensive recoding of templates and so.
  5. I still have the need for ProcessWire to create a page for each item in Directus database. And be able to update the title if the item changes. And also I would prefer to keep working with the ProcessWire API, because of the way the end point for this import («person pages») is integrated with the rest of the website.
  6. The one-off task was rather easy, and I have managed this using the php sdk as you mention. But I'm not sure about how to go further, setting up a continuous synchronization. One-way, from Directus to ProcessWire. I'm new to this way of thinking (working with APIs). Should I use «cron jobs» of some sort? Or rely on Directus «pushing» when something is updated? Any good ideas are welcomed. Maybe this post could also be a heads up to others who are new to this …
  7. Has anyone integrated Directus with ProcessWire? I have a database in Directus that I want to sync with ProcessWire (create/update/delete pages). But I don't not know where to start. It might be possible with ProcessWire's API in some way?
  8. I've only ever seen ?s=1 back-end when saving before, not front-end when clicking Save + View.
  9. When clicking on Save + View , the system adds ?s=1&c=0 on the end of the URL. Is that related to some changes in 3.0.60?
  10. Thank you, @abdus, your solution worked. So it buys me some time to figure out what happened with my initial setup.
  11. I have a webpage that I (think have) worked well with translation of dates based on a setlocale() code in a _init.php file until now. The page is in Norwegian (default) and English (english). But the date shown front end is now only in English. I have a multi-language textfield (locale) where I input nb_NO and en_US, and then I use the follow code in _init.php: $homepage = $pages->get('/'); // For change of language, set default language switch($user->language->name) { case 'default': setlocale (LC_ALL, $homepage->locale); break; } To check what is output, I used this: echo setlocale(LC_ALL, 0); And it only outputs C both on the Norwegian and English page. (It should output nb_NO and en_US). I have the same setup on another page, at least I think so, but something must be different. I also tried changing the locale, and editing LanguageSupport.module, removing the setlocale() code from above, with no luck. I check both in development (MAMP) and on my production server. I use ProcessWire 3.0.59 (live) and 3.0.60 (development). There could be other code I have that messes this up. But I hope this could shine som light. My question is: What decides the locale and how could I fix the «C»?
  12. A couple of days ago my site went down for about 3–4 hours, due to what Cpanal calls EPf faults. There was over 300.000+ faults in total over the span of a few hours, resulting in a 508 error. I talked to my shared host support, which did not say anything about attacks or high traffic (this is a low traffic site on a decent shared host solution). But they said that the problem was the .htaccess file. Thing is, I've been using the same .htaccess file for months. Being said, I updated the file to a «out of the box» ProcessWire file with a few uncomments, and htaccess files from other installations of mine, but it did not seem to work stopping the 508. I ended up with a htaccess file from another installation, with the ProCache code implemented. And just when I removed that part, the page started working again. It might be coincidental, that it was just some processes that stopped or services that restartet. I don't know. What I do know is that ProCache was mostly turned off on my templates, which I have later turned on. All in all, I don't exactly know what the problem was, or what the solution could be. I'm hoping ProCache will work. If it even could help solve such a problem. What I am actually asking is, have anybody else had this problem? (Attacks, bad coding, cache turned off …?) Could ProDevTools shine a light on the issue if the webpage shows 508 due to a high number of faults? (Sorry for the messy post by the way, a lot of unstructured thoughts.)
  13. Here is my solution for large sitemaps containing thousands upon thousands of pages, without the trouble of timeouts and such. I'm currently running this on website with 170.000+ pages. Relying only upon the ProcessWire API. Just a sidenote: I have no actual need to add all my pages to a sitemap … The keywords here are sitemap index, sitemap and ProcessWire's page numbers. Two templates: sitemap-index.php sitemap-xml.php (with page numbers activated) The structure of mine is this: sitemap-index.php is domain.com/sitemap/ sitemap-xml.php is domain.com/sitemap/sitemap/ And the code for each of them: sitemap-index.php <?php namespace ProcessWire; $out = '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . '<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'; $templates = "basic-page|blog-post|tag"; $key = $pages->count("template=$templates"); $limit = 200; $pageNum = ceil($key/ $limit); $post = $pages->get("template=sitemap-xml"); $i = 1; while($pageNum >= $i){ $out .= "\n<sitemap>" . "\n\t<loc>" . $post->httpUrl . "page$i/</loc>" . "\n\t<lastmod>" . date("Y-m-d", $post->modified) . "</lastmod>" . "\n</sitemap>"; $i = $i + 1; } $out .= "\n</sitemapindex>"; header("Content-Type: text/xml"); echo $out; ?> sitemap-xml.php <?php namespace ProcessWire; $out = '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'; $pageArray = $pages->find("template=basic-page|blog-post|tag, limit=200"); foreach ($pageArray as $post) { $out .= "\n<url>" . "\n\t<loc>" . $post->httpUrl . "</loc>" . "\n\t<lastmod>" . date("Y-m-d", $post->modified) . "</lastmod>" . "\n</url>"; } $out .= "\n</urlset>"; header("Content-Type: text/xml"); echo $out; ?>
  14. Now that Google is closing down the paid service Google Site Search, and only the free ad version of their search will be available within a year, I have started looking around. It seems that DuckDuckGo has an API that delivers data as JSON. Has anyone used this with ProcessWire and have some code and guidance to offer? Such as listing the results, open for pagination and any other tricks?
  15. Is there a way to append $rss->itemLinkField = ''; ? For use with campaign url or other tracking methods. E.g. such as this: $rss->itemLinkField = 'httpUrl' . '?utm_source=RSS_Feed&utm_medium=RSS&utm_campaign=RSS_Syndication'; Except that this wont work … I have also tried: $rss->itemLinkField = 'httpUrl'; $rss->itemLinkField .= '?utm_source=RSS_Feed&utm_medium=RSS&utm_campaign=RSS_Syndication'; Just to show what is not working, and what I am trying to achieve.