Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2009-11-22 07:46:20

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,532
Website GitHub Twitter

Re: jmd_csv: Batch-import articles from a CSV

Hi Karl

In the image there is title, body,excerpt, section;

I use Title, Excerpt,.. The first letter must be uppercase (i think), try if it works!

Cheers

Offline

#26 2009-12-14 14:43:43

HAC
Member
From: Vietnam
Registered: 2009-06-05
Posts: 33
Website

Re: jmd_csv: Batch-import articles from a CSV

works like a charm! thank you very much for your great import script!

Offline

#27 2009-12-16 09:41:45

HAC
Member
From: Vietnam
Registered: 2009-06-05
Posts: 33
Website

Re: jmd_csv: Batch-import articles from a CSV

i have a question. what will happen if there are two or more duplicated articles in .csv?

Offline

#28 2009-12-16 09:53:41

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: jmd_csv: Batch-import articles from a CSV

HAC wrote:

i have a question. what will happen if there are two or more duplicated articles in .csv?

As in dublicated content? Then there will be multiple articles with same content.

Offline

#29 2009-12-16 10:08:07

HAC
Member
From: Vietnam
Registered: 2009-06-05
Posts: 33
Website

Re: jmd_csv: Batch-import articles from a CSV

When we add new article manually in txp! we will get this message Article posted. The same URL-only title is used by 2 different articles. when we try to add another article with the same URL-only title

so i wonder if there is a way to prevent duplicated articles with URL-only title?!

Offline

#30 2009-12-16 10:17:30

HAC
Member
From: Vietnam
Registered: 2009-06-05
Posts: 33
Website

Re: jmd_csv: Batch-import articles from a CSV

function check_url_title($url_title)
	{
		// Check for blank or previously used identical url-titles
		if (strlen($url_title) === 0)
		{
			return gTxt('url_title_is_blank');
		}
		else
		{
			$url_title_count = safe_count('textpattern', "url_title = '$url_title'");
			if ($url_title_count > 1)
			{
				return gTxt('url_title_is_multiple', array('{count}' => $url_title_count));
			}
		}
		return '';
	}

finally, i found the one i need in txp_article.php
i’ll try to modify the script to fit my need! _

Last edited by HAC (2009-12-16 10:19:57)

Offline

#31 2010-08-25 19:52:15

Jaro
Member
From: S/F
Registered: 2004-11-18
Posts: 89

Re: jmd_csv: Batch-import articles from a CSV

Would it be difficult to modify the plugin to include keywords import?

Offline

#32 2010-08-25 20:04:02

Jaro
Member
From: S/F
Registered: 2004-11-18
Posts: 89

Re: jmd_csv: Batch-import articles from a CSV

Jaro wrote:

Would it be difficult to modify the plugin to include keywords import?

Nevermind. I just tried the import and the keywords are imported although it’s not mentioned in the plugin documentation. Great stuff!

Offline

#33 2010-08-25 23:31:43

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: jmd_csv: Batch-import articles from a CSV

I had a bunch of events that I brought in with jmd_csv. They all needed specific timestamps, which are currently unsupported, so here is my workaround.

  1. put a timestamp in an unused custom field then
  2. run this sql to replace the exiting timestamp with the new one.
UPDATE `textpattern` SET `Posted` = `custom_1`;
UPDATE `textpattern` SET `custom_1` = NULL;

worked pretty well.

Last edited by mrdale (2010-08-25 23:32:22)

Offline

#34 2010-11-02 03:25:46

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: jmd_csv: Batch-import articles from a CSV

with the Posted – I just commented out these line:

/* 
feed_time=now(),
Posted=now(),
LastMod=now(), 
*/

And added it to the csv headers – works perfectly :)

(apart from the fact that all my articles are to be to be posted in 2031 because I got the date wrong :) )

Offline

#35 2010-11-02 15:38:28

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: jmd_csv: Batch-import articles from a CSV

cool, can you post your csv header and one line just for the hell of it

Offline

#36 2010-11-03 00:25:51

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: jmd_csv: Batch-import articles from a CSV

Sure – Here you go

The format date is fixed on this one, I didn’t put a time stamp, but you can.

Let me know if it works.

Offline

Board footer

Powered by FluxBB