Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
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
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
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
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&step=edit&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
Re: Changing Post owner
Here’s an admin plugin that works well for me – ajw_admin_workflow
Offline
Pages: 1