Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2004-09-27 16:19:29

mattwebb
Member
From: Australia (but im in London)
Registered: 2004-06-16
Posts: 17
Website

Changing Post owner

Hi Again

Does anybody know how i can change the “article creator” on a lot of articles.

EG: Ive made a site for a guy and ported all of his articles from his old site by cutting and pasting them all. Hard work.. but no other way this time.

So now the creator is me… but i want the editor person to only have “copy writer” permissions, and so i need the articles to have their name as the creator, so that they can edit them again.

How can i do this ?

Matt


Dont worry… The flash site is being re-developed with txp !

Offline

#2 2004-09-27 16:24:30

Dean
Founder (Gone, but not forgotten)
From: Languedoc
Registered: 2004-02-14
Posts: 235
Website

Re: Changing Post owner

Not directly in Txp just yet: this is coming as part of the forwantofabetterword Power editing features.

In the meantime, in phpmyadmin or some other mysql front end:

update textpattern set AuthorID = 'newauthid' where AuthorID = 'oldauthid';

Or, if you know the range of articles IDs they should be assigned ownsership to:

update textpattern set AuthorID = 'newauthid' where AuthorID = 'oldauthid' and ID between lowID and highID;


text*

Offline

#3 2004-09-28 07:53:06

mattwebb
Member
From: Australia (but im in London)
Registered: 2004-06-16
Posts: 17
Website

Re: Changing Post owner

ok thanks !, That would be a really nice feature to have available. But for now this will do fine.

Cheers !

Matt


Dont worry… The flash site is being re-developed with txp !

Offline

#4 2005-12-14 20:29:20

denyerec
New Member
From: United Kingdom
Registered: 2005-09-08
Posts: 2
Website

Re: Changing Post owner

If anyone has to change ownership of an article for a database that they don’t have phpmyadmin or some other mysql front end access to:
(in my case the customers host created the database but wouldn’t allow phpMyAdmin access)

Write a plugin to do it for you kind of like this:
step 1:

<code>function change_owner() { if ($cool = safe_update(‘textpattern’,‘AuthorID = \‘newAuthId\’‘,‘AuthorID = \‘OldAuthId\’ ‘)) { echo ‘<strong>success</strong>’; } else { echo ‘<strong>failure</strong>’; } return;
}</code>

I paste the code into the very excellent j|g TXP Plug-In Generator save and activate the plugin.

step 2:
Stick this tag on any page so that your little plugin is called <code><txp:change_owner /></code> I placed mine as the first tag on the default page.

step 3:
View the page you stuck the tag in, if the DB query worked you should see ‘success’ if not ‘failure’.
Note: This will change all the articles, my situation was very specific and similar to Matt Webb. If you need to change specific articles, change:

<code>safe_update(‘textpattern’,‘AuthorID = \‘newAuthId\’‘,‘AuthorID = \‘OldAuthId\’ ‘)</code>

to

<code>safe_update(‘textpattern’,‘AuthorID = \‘newAuthId\’‘,‘AuthorID = \‘OldAuthId\’ AND ID = article_ID ‘)</code>

or use <code>…‘AND ID between lowID and highID’</code> as posted above by Dean. You can find the article ID by viewing the HTML source on the articles page, you’ll see something like <code><a href=”?event=article&#38;step=edit&#38;ID=8”>Article Title</a></code> the bit you want is the number after ID=.

I hope this helps,
Regards
Marcel and Den

Last edited by denyerec (2005-12-14 22:03:00)

Offline

#5 2005-12-14 20:54:31

RenJonsin
Member
From: Tarpon Springs, FL USA
Registered: 2005-02-06
Posts: 103
Website

Re: Changing Post owner

Here’s an admin plugin that works well for me – ajw_admin_workflow

Offline

Board footer

Powered by FluxBB