Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-03-14 18:02:18

coopersita
Member
Registered: 2005-09-28
Posts: 68
Website

Automate article entries

Hi,

I know I probably shouldn’t be doing this, but I’m willing to take the risk… I’ll understand if I get a lecture for asking this.

I have a client that wants me to input over a 100 entries (it’s a portfolio site). All the entries are the same. The only thing that changes is that each entry uses a different image (no text).

I want to create a script in php to automatically generate the entries (write directly into the textpattern table of the database). I did something similar to enter all the images (one per entry), and it worked incredibly well. My only problem is that I see that the textpattern table has a column for uid, which seems to be encrypted.

My question is, does anyone know if that encryption is done by the database or textpattern?

I’ll admit it, I’m lazy, but making a 100 entries seems so daunting, especially when a small script can do it in a second.

Offline

#2 2007-03-14 18:18:42

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

Re: Automate article entries

Why don’t you just use the caption field of the image, then use a gallery scenario that presents the caption field in a way that you’d like?

Save you about 1/2 the time.

Offline

#3 2007-03-14 18:36:26

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Automate article entries

‘uid’ is just a random md5 string, so as long as it’s unique and it resembles the other uids, it should be fine. Looking at the code, it’s mainly used as a unique identifier in atom/RSS feeds.

Offline

#4 2007-03-14 19:31:29

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Automate article entries

mrdale wrote:

Why don’t you just use the caption field of the image, then use a gallery scenario that presents the caption field in a way that you’d like?

Save you about 1/2 the time.

If you use the caption field, you can give it a default value in the database and you’re done.

Offline

#5 2007-03-14 20:43:41

coopersita
Member
Registered: 2005-09-28
Posts: 68
Website

Re: Automate article entries

thanks Ruud,

I was able to make my script, and it worked beautifully.

The only problem is they all have the same entry date and time, but it’s no big deal. I can live with it.

mrdale, Els:

The problem (unless I misunderstood what you where trying to say), is that I’d still would have had to go to the Write tab and manually make over 100 entries. Even if it’s just entering the image id, and clicking save, it’s still a hundred times…

Also, it’s a one time thing. From now on, the owner of the site can enter images and entries one at a time. It’s just getting the site with the initial content that was daunting.

Thanks all

Offline

Board footer

Powered by FluxBB