I imported my blog from wordpress into jekyll, but the permanent links are inconsistent. Here's one example:
my post (full file)
wordpress_url: http://fabiopereira.me/blog/2011/10/19/tw-ssc-deep-sea-fishing/
date: '2011-10-19 05:09:57 +1100'
date_gmt: '2011-10-19 12:09:57 +1100'
is generating the link
blog/2011/10/18/tw-ssc-deep-sea-fishing/
The problem is the date
Instead of 2011/10/19/ in the url, it's generating 2011/10/18/
For reference
my jekyll _config.yml
permalink: /blog/:year/:month/:day/:title
timezone: Asia/Sydney # eg. Asia/Kathmandu
locale: en_AU # eg. en_us
Any help is appreciated, thanks.
I don't know think this post is on-topic for Stack Overflow, and should probably be migrated to SuperUser or somewhere more appropriate.
Nevertheless, I see two possible problems:
date_gmt
Your post file contains both date and date_gmt. I'm not sure you want to set both. You probably only want to read date_gmt, rather than writing it.
Even if you do write it, you probably want to make sure your date_gmt doesn't have a local time offset (in your example above, it has the same +11 offset that your date has).
Timezone
I suspect that Jekyll doesn't complain when you set a timezone that doesn't exist. I suspect you'll get the same results with "Fiction/Utopia" as you do for "Asia/Sydney" (which I don't think is one of the standard locations in the database). Try "Australia/Sydney" instead (or maybe "Pacific/Sydney", I'm on mobile and I don't have the list to hand right now).
Good luck!
Related
Got an unusual problem that started recently and wonder if anyone has any ideas why it's happening and how to stop it.
Some of my products are getting an underscore added to the url when selected which, naturally, results in a 404 error. It's consistent - either an underscore gets added or it doesn't. It doesn't seem to be related to the GUID or the post_name in the wp_posts table. It also doesn't matter if you call it using the URL or the post ID so the following:-
Bad index.php?page_id=1075707 the-john-rutter-christmas-piano-album-2 https://website-name.com/product/the-john-rutter-christmas-piano-album-2/
Good index.php?page_id=1087442 the-john-rutter-piano-album https://website-name.com/product/the-john-rutter-piano-album/
Bad index.php?page_id=1159681 parable-for-harpsichord https://website-name.com/product/parable-for-harpsichord/
Good index.php?page_id=1159684 jesu-meine-freude-2 https://website-name.com/product/jesu-meine-freude-2/
Bad here meaning that the URL appears with an underscore such as
https://website-name.com/product/parable-for-harpsichord_/
I've also tried this with every single plugin, except WooCommerce, de-activated and with my functions.php disabled. No difference.
I've tried using the URLs as given above, C&P or typed in manually and by directly referencing the post ID (as shown).
This has only recently started and I'm at a bit of a loss here. I don't know how widespread this problem is either since I've over 120,000 products and can't check them all by hand. Fortunately, this isn't live yet.
Any suggestions or ideas here would help me.
There appears to be a hidden character at the end of the post_name field. Deleting and recreating the field got rid of the problem.
I moved a WordrPress website from one server and domain to another, but into the database I still have the old paths and I want to update them to the new values. The real problem is that the content I need to change is serialized, so I cannot do a global find and replace like:
http://my-old-domain.com/ replaced with http://my-newest-domain.com because I have to replace things like this:
s:755:\"<img class=\"size-medium\" src=\"http://my-old-domain.com/esthetique/wp-content/uploads/2019/01/logo-fundal-300x64.png\" ...
to
s:755:\"<img class=\"size-medium\" src=\"http://my-newest-domain.com/esthetique/wp-content/uploads/2019/01/logo-fundal-300x64.png\" ...
newest has 6 characters while old had 3 characters, so all the s:... part needs to be increased with 3. I could do this manually, but there are 1470 places where this needs to be changed and the s:... part takes different values.
Can you please advise if there is an easy way to do this? I cannot change by hand all of them. Thanks!
You can use many popular search and replace plugin to change you domain linked path. For ex -Search & Replace
I have a Drupal 7 website that is running apachesolr search and is using faceting through the facetapi module.
When I use the facets to narrow my searches, everything works perfectly and I can see the filters being added to the search URL, so I can copy them as links (ready-made narrowed searches) elsewhere on the site.
Here is an example of how the apachesolr URL looks after I select several facets/filters:
search_url/search_keyword?f[0]=im_field_tag_term1%3A1&f[1]=im_field_tag_term2%3A100
Where the 'search_keyword' portion is the text I'm searching for and the '%3A' is just the url encoded ':' (colon).
Knowing this format, I can create any number of ready-made searches by creating the correct format for the URL. Perfect!
However, these filters are always ANDed, the same way they are when using the facet interface. Does anyone know if there is a syntax I can use, specifically in the search URL, to OR my filters/facets? Meaning, to make it such that the result is all entries that contains EITHER of the two filters?
Thanks in advance for any help or pointers in the right direction!
New edit:
I do know how to OR terms within the same vocabulary through the URL, I'm just wondering how to do it for terms in different vocabularies. ;-)
You can write a filter query that looks like:
fq=field1:value1 OR field2:value2
Alternatively you can use localparams to specify the query operator:
fq={!q.op=OR}field1:value1 field2:value2
As far as I know, there's not any easier way to do this. There is, in fact, an rather old bug asking for a way to OR the fq parameters...
I finally found a way to do this in Drupal
Enable the fq parameter setting.
Go to admin/config/search/apachesolr/[your_search_page]/core_search/edit or just navigate to the settings of the search page you're trying to modify
Check the 'Allow user input using the URL' setting
URL Syntax
Add the following at the end of the URL: ?fq=tid:(16 OR 38), where 16 and 38 are the term ids
I just bought an extension for Magento, once I checked the files I saw that some are encrpyted in a really weird way, never saw that before and from some of the function names and includes it looks like at some places it gets content from external files...
Anyways, i would like to be able to decode this to see if the extension does anything malicious or not. I paid $300 for it and I'm a little bit worried to put that in my shop if I don't know that the extension is clean.
The code in the encrypted files looks like this:
if (isset ($††††††††††††††††††††††->Items->Item)){if (is_array($††††††††††††††††††††††->Items->Item)){$†††††††††††††††††††††††=$††††††††††††††††††††††->Items->Item;}else {$†††††††††††††††††††††††=array ($††††††††††††††††††††††->Items->Item);}}else {return array (0,0);}self::_getExistingsProducts(chr(97).chr(109).chr(97).chr(122).chr(111).chr(110).chr(105).chr(109).chr(112).chr(111).chr(114).chr(116).chr(98).chr(111).chr(111).chr(107).chr(115));$††††††††††††††††††††††††=array ();$†††††††††††††††††††††††††=array ();foreach ($††††††††††††††††††††††† as $††††††††††††††††††††††††††=>$††††††††††††††){$†††††††††††††††††††††††††††=array (chr(97).chr(115).chr(105).chr(110)=>$††††††††††††††->ASIN,chr(115).chr(107).chr(117)=>self::_getProductSku($††††[chr(115).chr(107).chr(117)],$††††††††††††††),);if (in_array($†††††††††††††††††††††††††††[chr(97).chr(115).chr(105).chr(110)],$††††††††††††††††††††††††)|| in_array($†††††††††††††††††††††††††††[chr(115).chr(107).chr(117)],$†††††††††††††††††††††††††)|| self::_existsProduct($†††††††††††††††††††††††††††,true)){$††††††††††††††††††++ ;continue ;}try {$††††††††††††††††††††††††[]=$†††††††††††††††††††††††††††[chr(97).chr(115).chr(105).chr(110)];$†††††††††††††††††††††††††[]=$†††††††††††††††††††††††††††[chr(115).chr(107).chr(117)];$††††††††††††††††††††††††††††[]=$††††[chr(108).chr(111).chr(99).chr(97).chr(108)];$††††††††††††††††††††††††††††[]=$†††††††††††††††††††††††††††[chr(97).chr(115).chr(105).chr(110)];$††††††††††††††††††††††††††††[]=$†††††††††††††††††††††††††††[chr(115).chr(107).chr(117)];$††††††††††††††††††††††††††††[]=self::getProductCategories($††††††††††††††,true);$††††††††††††††††††††††††††††[]=isset ($††††††††††††††->ItemAttributes->Title)?$††††††††††††††->ItemAttributes->Title:$††††††††††††††->ASIN;$††††††††††††††††††††††††††††[]=self::_getImagesCount($††††††††††††††);$††††††††††††††††††††††††††††[]=$††††††††††††††->DetailPageURL;list ($†††††††††††††††††††††††††††††,$††††††††††††††††††††††††††††††,$†††††††††††††††††††††††††††††††,$††††††††††††††††††††††††††††††††,$†††††††††††††††††††††††††††††††††)=WP_Amazonimportproducts_Model_Amazonoffer::getOfferInfo($††††††††††††††,$††††[chr(100).chr(101).chr(102).chr(97).chr(117).chr(108).chr(116).chr(80).chr(114).chr(105).chr(99).chr(101)]);$††††††††††††††††††††††††††††[]=$†††††††††††††††††††††††††††††;$††††††††††††††††††††††††††††[]=floatval($††††[chr(100).chr(101).chr(102).chr(97).chr(117).chr(108).chr(116).chr(80).chr(114).chr(105).chr(99).chr(101).chr(80).chr(108).chr(117).chr(115).chr(80).chr(101).chr(114).chr(99).chr(101).chr(110).chr(116)]);$††††††††††††††††††††††††††††[]=floatval($††††[chr(100).chr(101).chr(102).chr(97).chr(117).chr(108).chr(116).chr(80).chr(114).chr(105).chr(99).chr(101).chr(80).chr(108).chr(117).chr(115).chr(85).chr(110).chr(105).chr(116)]);$††††††††††††††††††††††††††††[]=$††††††††††††††††††††††††††††††;$††††††††††††††††††††††††††††[]=$†††††††††††††††††††††††††††††††;$††††††††††††††††††††††††††††[]=$††††††††††††††††††††††††††††††††;$††††††††††††††††††††††††††††[]=$†††††††††††††††††††††††††††††††††;$††††††††††††††††††††††††††††[]=self::_getProductDetail($††††††††††††††);$††††††††††††††††††††††††††††[]=serialize($††††††††††††††);$††††††††††††††††††††††††††††[]=$††††††††††††††††††††;$††††††††††††††††††††††††††††[]=0;$††††††††††††††††††††††††††††[]=date(chr(89).chr(45).chr(109).chr(45).chr(100).chr(32).chr(72).chr(58).chr(105).chr(58).chr(115));$††††††††††††††††††††††††††††[]=$††††[chr(100).chr(101).chr(102).chr(97).chr(117).chr(108).chr(116).chr(80).chr(114).chr(105).chr(99).chr(101)];$††††††††††††††††††††††††††††[]=$††††[chr(100).chr(101).chr(102).chr(97).chr(117).chr(108).chr(116).chr(67).chr(111).chr(110).chr(100).chr(105).chr(116).chr(105).chr(111).chr(110)];$†††††††††††++ ;}catch (Exception $†††††††††††††††††){Mage::helper(chr(97).chr(109).chr(97).chr(122).chr(111).chr(110).chr(105).chr(109).chr(112).chr(111).chr(114).chr(116).chr(112).chr(114).chr(111).chr(100).chr(117).chr(99).chr(116).chr(115))->{"\x6c\x6f\x67"}($†††††††††††††††††->{"\x67\x65\x74\x4d\x65\x73\x73\x61\x67\x65"}(),chr(71).chr(101).chr(116).chr(32).chr(66).chr(111).chr(111).chr(107).chr(32).chr(73).chr(110).chr(102).chr(111).chr(32).chr(102).chr(114).chr(111).chr(109).chr(32).chr(65).chr(109).chr(97).chr(122).chr(111).chr(110).chr(32).chr(65).chr(80).chr(73).chr(44).chr(32).chr(82).chr(101).chr(115).chr(112).chr(111).chr(110).chr(115).chr(101).chr(32).chr(69).chr(114).chr(114).chr(111).chr(114),chr(105).chr(109).chr(112).chr(111).chr(114).chr(116));}}
This is only a small excerpt from one of the encrypted files, and I'm looking for a way to display the code unencoded so I can check it. Sorry for the format, I am still trying to figure out how to format huge blocks of code correctly, maybe someone is nice enough to edit it for me?
Well, you will have to work with find-and-replace tools. Firstly you get the result of a php function call (php -r "echo chr(107)") and then replace all occurrences of chr(107) to the result ("k"). Than replace "\x67\x65\x74\x4d\x65\x73\x73\x61\x67\x65" (php -r 'echo "\x67\x65\x74\x4d\x65\x73\x73\x61\x67\x65";'). Than replace all †-variables in methods to human-readable names.
I just think about that, easy to do in non cms site, but in wordpress site... i like to know YOUR approach to that problem
I have a BIG site (200 pages)... and at a lot of place, the info#something.com, the 000-000-0000 telephone and send your check to 123 easy street, Canada...
all that email, telephone, and address... should reside in one place (a post or a var) and when you need to insert it you should used the short code [tel] or [email].... but how...
is there a plusgin that can define var, or a tutorial to do that... do you only have to change it ONE for the whole site..
Any idea is welcome.... now, find and remplace is my friend !...
thanks in advance
You could try the Custom Config plugin:
http://wordpress.org/extend/plugins/custom-configs/
It will allow you to create custom global variables that are contained within the CMS (otherwise you'd be declaring these variables within the template config).
Usage to output a variable onto the page would be something like:
<?=get_config('myVariable','default')?>