Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
[Help] Creating & importing posts with a texteditor
I know that this is not a ‘normal’ case but … I’m working on a site that a friend started in 1998 with a lot of contents, mostly texts that are stored in TXT files. He was thinking to publish ALL that texts (not a few!) through Textpattern, one by one, but Im “almost” sure that all that work could be easier creating and importing an SQL file with the right format, for example, this is how a post looks in his database:
<br />
<code>INSERT INTO `textpattern` VALUES (1, ’2006-01-03 11:20:00’, ‘textpattern’, ’2006-01-03 11:20:00’, ‘username’, ‘A title’, ‘’, ‘Lorem ipsum dolor sit amet, consectetuer adipiscing elit.’,</code>
<code> ‘<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>\n\n\n ‘, ‘’, ‘\n\n\n ‘, ‘’, ‘thecategory’, ‘’, 1, ‘Comments’, 1, 4, 1, 1, ‘thesection’, ‘’, ‘’, ‘a-title’, ‘’, ‘’, ‘’, ‘’, ‘’, ‘’, ‘’, ‘’, ‘’, ‘’, ‘becfea8fd42901304463b23701198f28’, ’2006-01-03’);</code>
<br />
it’s not difficult to understand each piece of this, the only part that I don’t know ‘How’ to generate is the large UID code! (becfea8fd42901304463b23701198f28)
It could be dangerous to leave the UID blank?
or there’s anything to do with this?
Thx in advance
Offline
Offline
Re: [Help] Creating & importing posts with a texteditor
Thank you! That means I can use something like this:
<code><?php
// generate a random uid
$randomid = md5(uniqid(rand(), true));
echo “.$randomid.”;
?></code>
<br />
to generate that UID, great!
Offline
#4 2006-01-17 07:19:16
- SCuM
- New Member
- Registered: 2006-01-09
- Posts: 2
Re: [Help] Creating & importing posts with a texteditor
Can you do that? What was the purpose of the field if you can just put any old thing in it? I am in the same boat, I need to export and tweak my db from my old CMS so I can import into TextPattern and I had the same questions about the UID. Do any other tables refer to it?
I imported a single story and left it blank and all seemed to work fine, but then again, I am so new at TextPattern that I probably would not know if it was broken. :)
SCuM
Last edited by SCuM (2006-01-17 07:20:25)
Offline