{"id":3323,"date":"2016-11-04T06:05:05","date_gmt":"2016-11-04T06:05:05","guid":{"rendered":"http:\/\/musilda.cz\/?p=3323"},"modified":"2016-11-04T06:05:05","modified_gmt":"2016-11-04T06:05:05","slug":"presunout-clanky-fotografie-bloggeru-wordpressu","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/presunout-clanky-fotografie-bloggeru-wordpressu\/","title":{"rendered":"Jak p\u0159esunout \u010dl\u00e1nky a fotografie z Bloggeru do WordPressu"},"content":{"rendered":"

M\u00e1te blog na Bloggeru a chcete jej p\u0159esunout na vlastn\u00ed web, b\u011b\u017e\u00edc\u00ed na WordPressu? Zd\u00e1nliv\u011b ban\u00e1ln\u00ed \u00fakol v sob\u011b skr\u00fdv\u00e1 n\u011bkolik probl\u00e9m\u016f. Proto si uk\u00e1\u017eeme, jak p\u0159esunout \u010dl\u00e1nky, obr\u00e1zky a odstran\u00edme probl\u00e9my, jen\u017e vzniknou po importu.<\/p>\n

Budu vych\u00e1zet z toho, \u017ee ji\u017e m\u00e1te na Bloggeru obsah k p\u0159esunut\u00ed a zvl\u00e1dli jste instalaci WordPressu<\/a>.<\/p>\n

Export obsahu z Bloggeru<\/strong><\/h2>\n

Prvn\u00edm krokem mus\u00ed b\u00fdt export obsahu z blogu. P\u0159ihla\u0161te se tedy do administrace va\u0161eho \u00fa\u010dtu a v menu, najd\u011bte Nastaven\u00ed -> Jin\u00e9<\/strong><\/p>\n

\"blogger-1\"<\/a><\/p>\n

Na horn\u00edm okraji zobrazen\u00e9 str\u00e1nky, najdete tla\u010d\u00edtko Z\u00e1lohovat obsah<\/strong>:<\/p>\n

\"blogger-2\"<\/a><\/p>\n

 <\/p>\n

T\u00edm si st\u00e1hnete xml soubor, pomoc\u00ed n\u011bj\u017e naimportujeme obsah do WordPressu.<\/p>\n

Import do nainstalovan\u00e9ho WordPressu<\/strong><\/h2>\n

P\u0159ihla\u0161te se do va\u0161\u00ed instalace a v postrann\u00edm menu, najd\u011bte polo\u017eku N\u00e1stroje -> Import<\/strong><\/p>\n

\"blogger-3\"<\/a><\/p>\n

 <\/p>\n

Jak vid\u00edte, WordPress m\u00e1 plugin, jen\u017e v\u00e1m umo\u017en\u00ed importovat obsah z Bloggeru.<\/p>\n

Klikn\u011bte na instalovat a a\u017e se text odkazu zm\u011bn\u00ed na importovat, klikn\u011bte na n\u011bj znovu.<\/p>\n

Objev\u00ed se v\u00e1m n\u00e1sleduj\u00edc\u00ed formul\u00e1\u0159:<\/p>\n

\"blogger-4\"<\/a><\/p>\n

Po kliknut\u00ed na Vybrat soubor<\/strong>, vyberte xml soubor, jen\u017e jste z\u00edskali z Bloggeru.<\/p>\n

Pak sta\u010d\u00ed kliknout na Nahr\u00e1t soubor<\/strong> a importovat. Samoz\u0159ejm\u011b, \u017ee pokud m\u00e1te n\u00edzk\u00fd memory limit, m\u016f\u017ee se st\u00e1t, \u017ee budete import opakovat n\u011bkolikr\u00e1t.<\/p>\n

Po skon\u010den\u00ed, m\u00e1te na va\u0161em nov\u00e9m webu, kompletn\u00ed obsah z Bloggeru.<\/p>\n

Bohu\u017eel je zde jedno velk\u00e9 ale! Nebo dv\u011b.<\/strong><\/h2>\n

Obr\u00e1zky<\/strong><\/h3>\n

Ty se nemus\u00ed st\u00e1hnout do m\u00e9di\u00ed v\u0161echna a nav\u00edc ze zku\u0161enosti v\u00edm, \u017ee v obsahu z\u016fst\u00e1vaj\u00ed odkazy na p\u016fvodn\u00ed soubory – 7.bp.blogspot.com\/-DiEP5rUyWBg\/V_6WxPNj3qI\/AAAAAAAAGbo\/wZcIDUHs7.jpg<\/p>\n

Koment\u00e1\u0159e<\/strong><\/h3>\n

Plugin pro import, nezachov\u00e1v\u00e1 hierarchii koment\u00e1\u0159\u016f.<\/p>\n

Opravy \u0161patn\u011b naimportovan\u00fdch obr\u00e1zk\u016f<\/strong><\/h2>\n

Na\u0161t\u011bst\u00ed je v WordPressu na v\u0161echno plugin. T\u00edm pluginem je Cache images<\/a>, jen\u017e v\u00e1m z intern\u00edch obr\u00e1zk\u016f ud\u011bl\u00e1 extern\u00ed. Sice nen\u00ed ji\u017e n\u011bjakou dobu aktualizovan\u00fd, ale funguje perfektn\u011b.<\/p>\n

V seznamu plugin\u016f, po jeho instalaci, nejdete odkaz na scanov\u00e1n\u00ed:<\/p>\n

\"blogger-5\"<\/a><\/p>\n

 <\/p>\n

Pak ji\u017e jen sta\u010d\u00ed kliknout na jedno z tla\u010d\u00edtek a plugin oprav\u00ed v\u0161e co pot\u0159ebujete. Rozd\u00edl mezi dv\u011bma tla\u010d\u00edtky je v tom, \u017ee prvn\u00ed hled\u00e1 jen obr\u00e1zky a druh\u00fd jen obr\u00e1zky, jen\u017e jsou obalen\u00e9 odkazem.<\/p>\n

\"blogger-6\"<\/a><\/p>\n

 <\/p>\n

J\u00e1 jsem se nakonec rozhodl pro prvn\u00ed mo\u017enost a v\u0161echny obr\u00e1zky v odkazu:<\/p>\n

<a href=\"http:\/\/blogger.com\/obrazek.jpg\"><img src=\"http:\/\/myweb.com\/obrazek.jpg\" \/><\/a><\/pre>\n

jsem n\u00e1sledn\u011b opravil pomoc\u00ed regul\u00e1rn\u00edho v\u00fdrazu.<\/p>\n

 <\/p>\n

Oprava hierarchie koment\u00e1\u0159\u016f<\/strong><\/h2>\n

P\u0159esto\u017ee, je tento postup na konci n\u00e1vodu, mus\u00edte jej ud\u011blat hned, je\u0161t\u011b ne\u017e za\u010dnete importovat do WordPressu!<\/p>\n

Kdo byl nedo\u010dkav\u00fd a nedo\u010detl a\u017e sem, m\u016f\u017ee za\u010d\u00edt znovu.<\/p>\n

St\u00e1hn\u011bte si plugin Blogger Importer a v souboru comment-entry.php, p\u0159idejte za \u0159\u00e1dek 63:<\/p>\n

add_comment_meta($comment_id, 'blogger_internal', $this->self, true);<\/pre>\n

nov\u00fd \u0159\u00e1dek:<\/p>\n

add_comment_meta($comment_id, 'related', $this->related, true);<\/pre>\n

Kdyby jste si otev\u0159eli vyexportovan\u00e9 xmlko, zjist\u00edte, \u017ee export koment\u00e1\u0159\u016f, obsahuje i informaci o rodi\u010dovsk\u00e9m koment\u00e1\u0159i. Ta je ozna\u010dena jako related.<\/p>\n

P\u0159esto\u017ee, \u017ee ji plugin p\u0159i parsov\u00e1n\u00ed na\u010d\u00edt\u00e1, p\u0159i importu ji neulo\u017e\u00ed<\/strong>. Proto to mus\u00edme ud\u011blat my.<\/p>\n

M\u00e1me tedy naimportovan\u00e9 koment\u00e1\u0159e a u ka\u017ed\u00e9ho child koment\u00e1\u0159e, ulo\u017eenou informaci o rodi\u010dovsk\u00e9m koment\u00e1\u0159i.<\/p>\n

Nyn\u00ed tedy projdeme v\u0161echny koment\u00e1\u0159e a nastav\u00edme jim parent id, kter\u00e9 pou\u017e\u00edv\u00e1 WordPress.<\/p>\n

Tento postup pou\u017eijte, pouze pokud v\u00edte, co d\u011bl\u00e1te, jinak si nechte pomoci va\u0161\u00edm program\u00e1torem.<\/strong><\/p>\n

global $wpdb;\n   $comments = $wpdb->get_results(\"SELECT * FROM \".$wpdb->prefix.\"comments\");\n   foreach( $comments as $item ){\n      $related = $wpdb->get_results(\"SELECT meta_value FROM \".$wpdb->prefix.\"commentmeta WHERE comment_id = '\".$item->comment_ID.\"' AND meta_key = 'related'\");\n      if(!empty($related[0]->meta_value)){\n\n          $parent = $wpdb->get_results(\"SELECT comment_id FROM \".$wpdb->prefix.\"commentmeta WHERE meta_value = '\".$related[0]->meta_value.\"' AND meta_key = 'blogger_internal'\");\n\n          $data = array( 'comment_parent' => $parent[0]->comment_id );\n          $result = $wpdb->update($wpdb->prefix.'comments', $data, array('comment_ID' => $item->comment_ID) );\n\n      }\n   }\n<\/pre>\n

K\u00f3d sta\u010d\u00ed spustit jen jednou a se\u0159ad\u00ed v\u00e1m v\u0161echny koment\u00e1\u0159e do hierarchie.<\/p>\n

Na z\u00e1v\u011br si nastavte trval\u00e9 odkazy, aby odpov\u00eddaly tvaru, pou\u017e\u00edvan\u00e9m na Bloggeru, aby jste nep\u0159i\u0161li o n\u00e1v\u0161t\u011bvnost.<\/p>\n

P\u0159esun je dokon\u010den a m\u016f\u017eete pokra\u010dovat v blogov\u00e1n\u00ed.<\/p>\n","protected":false},"excerpt":{"rendered":"

M\u00e1te blog na Bloggeru a chcete jej p\u0159esunout na vlastn\u00ed web, b\u011b\u017e\u00edc\u00ed na WordPressu? Zd\u00e1nliv\u011b ban\u00e1ln\u00ed \u00fakol v sob\u011b skr\u00fdv\u00e1 n\u011bkolik probl\u00e9m\u016f. Proto si uk\u00e1\u017eeme, jak p\u0159esunout \u010dl\u00e1nky, obr\u00e1zky a odstran\u00edme probl\u00e9my, jen\u017e vzniknou po importu. Budu vych\u00e1zet z toho, \u017ee ji\u017e m\u00e1te na Bloggeru obsah k p\u0159esunut\u00ed a zvl\u00e1dli jste instalaci WordPressu. Export obsahu<\/p>\n","protected":false},"author":1,"featured_media":3324,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,21],"tags":[87,460],"class_list":["post-3323","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-navody","category-stredne-pokrocily","tag-blogger","tag-wordpress-2"],"_links":{"self":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/3323"}],"collection":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/comments?post=3323"}],"version-history":[{"count":0,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/3323\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media\/3324"}],"wp:attachment":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media?parent=3323"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/categories?post=3323"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/tags?post=3323"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}