Jump to content

Promote Posts to Articles


Adriano Faria

Recommended Posts

Does this replicate the old "Promote to article" functions of 3x?

I have a database. They create forum threads.

In 3x I would then promote the forum thread to an article.

The comments were the same, in effect all three were linked.

The  "Copy to Database" doesn't work like that, it makes a separate article to the forum topic. Very messy.

Link to comment
Share on other sites

It creates an article in Pages but does creates an identical post on the forum, like in 3x.  I just go and "hide" that post.  I guess I could delete it as well.  There might be a setting or toggle that stops the post... I haven't used it enough to know my around it.

Link to comment
Share on other sites

Just now, Phil Lilley said:

I have to correct myself and at the same time ask a question.

I have not found a way to hide the promoted article from news feeds.  Am I missing it somewhere or can it be done?

It shows up in everybody's Unread Content and it's annoying because it's a duplicate post.

Phil, the plugin does what it should do: it will create a new article based on a topic/post. That's all.

Link to comment
Share on other sites

  • 2 months later...

Type:  template_promoteToArticle

Message:  OutOfRangeException::0 

IPB v4.2.5 - test install on local machine.  Fresh install with a few posts / categories.

BACKTRACE

#0 /home/nginx/domains/website/public/system/Theme/Theme.php(824) : eval()'d code(12464): IPS\Patterns\_ActiveRecord::load('')
#1 /home/nginx/domains/website/public/system/Theme/SandboxedTemplate.php(56): IPS\Theme\class_core_global_plugins->promoteToArticle(Object(IPS\forums\Topic\Post))
#2 /home/nginx/domains/website/public/system/Theme/Theme.php(824) : eval()'d code(1625): IPS\Theme\_SandboxedTemplate->__call('promoteToArticl...', Array)
#3 /home/nginx/domains/website/public/system/Theme/Theme.php(871) : eval()'d code(29): IPS\Theme\class_forums_front_topics->post(Object(IPS\forums\Topic), Object(IPS\forums\Topic\Post), 'topic_comment', 'forums', 'forums', 'forums_Topic')
#4 /home/nginx/domains/website/public/system/Theme/SandboxedTemplate.php(56): IPS\Theme\hook264->post(Object(IPS\forums\Topic), Object(IPS\forums\Topic\Post), 'topic_comment', 'forums', 'forums', 'forums_Topic')
#5 /home/nginx/domains/website/public/system/Theme/Theme.php(824) : eval()'d code(2195): IPS\Theme\_SandboxedTemplate->__call('post', Array)
#6 /home/nginx/domains/website/public/system/Theme/SandboxedTemplate.php(56): IPS\Theme\class_forums_front_topics->postContainer(Object(IPS\forums\Topic), Object(IPS\forums\Topic\Post), Array, '')
#7 /home/nginx/domains/website/public/system/Theme/Theme.php(824) : eval()'d code(4581): IPS\Theme\_SandboxedTemplate->__call('postContainer', Array)
#8 /home/nginx/domains/website/public/system/Theme/SandboxedTemplate.php(56): IPS\Theme\class_forums_front_topics->topic(Object(IPS\forums\Topic), Array, NULL, Array, NULL, NULL, Array)
#9 /home/nginx/domains/website/public/applications/forums/modules/front/forums/topic.php(408): IPS\Theme\_SandboxedTemplate->__call('topic', Array)
#10 /home/nginx/domains/website/public/init.php(448) : eval()'d code(16): IPS\forums\modules\front\forums\_topic->manage()
#11 [internal function]: IPS\forums\modules\front\forums\forumblocks_hook_topiccontroller->manage()
#12 /home/nginx/domains/website/public/init.php(448) : eval()'d code(26): call_user_func_array('parent::manage', Array)
#13 /home/nginx/domains/website/public/system/Dispatcher/Controller.php(96): IPS\forums\modules\front\forums\hook75->manage()
#14 /home/nginx/domains/website/public/system/Content/Controller.php(50): IPS\Dispatcher\_Controller->execute()
#15 /home/nginx/domains/website/public/applications/forums/modules/front/forums/topic.php(39): IPS\Content\_Controller->execute()
#16 /home/nginx/domains/website/public/system/Dispatcher/Dispatcher.php(146): IPS\forums\modules\front\forums\_topic->execute()
#17 /home/nginx/domains/website/public/index.php(12): IPS\_Dispatcher->run()
#18 {main}

I also added a test database and in the plug-in settings no database is showing up - the list is blank.

59e831d949f49_Screenshotfrom2017-10-1901-02-07.thumb.png.2488de449bb524bf750718a52def0932.png

 

Thanks!

 

Link to comment
Share on other sites

  • 4 weeks later...

Excellent work Adriano, for one more time thanks a lot !

Suggestions.... (or extra plugins)

- to add an option to transfer specific replies too as comments in article (for those who want to close/delete the main topic in forums)

- to add an option to merge 2+ topics (or replies) to 1 article

- the option to merge 2 articles in 1

 

Link to comment
Share on other sites

  • 8 months later...

Very weird error after updating my forum to 4.3.x. This plugin still works, unless the database you're posting the article into is displayed on the main page of your site.

So you can use the database and promote a post to that article on any page. But if you set that page as the folder default, when you try to promote you receive a popup simply saying 'Something went wrong.'

Just a very odd thing.

Link to comment
Share on other sites

  • 2 weeks later...
  • 5 months later...
  • 1 month later...

I"m getting

INSERT INTO `ipb2core_follow` ( `follow_id`, `follow_app`, `follow_area`, `follow_rel_id`, `follow_member_id`, `follow_is_anon`, `follow_added`, `follow_notify_do`, `follow_notify_meta`, `follow_notify_freq`, `follow_notify_sent`, `follow_visible` ) VALUES ( 'ee23ad9f338567a0e391bc8917f35e8b', 'cms', 'records1', 5690, 51, 0, 1553278435, 1, '', 'daily', 0, 1 )
IPS\Db\Exception: Duplicate entry 'ee23ad9f338567a0e391bc8917f35e8b' for key 'PRIMARY' (1062)
#0 /home/ddowdell/public_html/cheersandgears.com/system/Db/Db.php(936): IPS\_Db->preparedQuery('/*IPS\\Content\\_...', Array)
#1 /home/ddowdell/public_html/cheersandgears.com/system/Content/Item.php(441): IPS\_Db->insert('core_follow', Array)
#2 /home/ddowdell/public_html/cheersandgears.com/applications/cms/sources/Records/Records.php(2242): IPS\Content\_Item::createFromForm(Array, Object(IPS\cms\Categories1), true)
#3 /home/ddowdell/public_html/cheersandgears.com/system/Content/Item.php(112): IPS\cms\_Records::createFromForm(Array, Object(IPS\cms\Categories1))
#4 /home/ddowdell/public_html/cheersandgears.com/applications/cms/modules/front/database/category.php(562): IPS\Content\_Item::create(Object(IPS\cms\Categories1))
#5 /home/ddowdell/public_html/cheersandgears.com/system/Dispatcher/Controller.php(85): IPS\cms\modules\front\database\_category->form()
#6 /home/ddowdell/public_html/cheersandgears.com/applications/cms/sources/Databases/Dispatcher.php(347): IPS\Dispatcher\_Controller->execute()
#7 /home/ddowdell/public_html/cheersandgears.com/applications/cms/widgets/Database.php(128): IPS\cms\Databases\_Dispatcher->run()
#8 /home/ddowdell/public_html/cheersandgears.com/applications/cms/sources/Pages/Page.php(1281): IPS\cms\widgets\_Database->render()
#9 /home/ddowdell/public_html/cheersandgears.com/applications/cms/sources/Pages/Page.php(2210): IPS\cms\Pages\_Page->getWidgets()
#10 /home/ddowdell/public_html/cheersandgears.com/applications/cms/modules/front/pages/page.php(216): IPS\cms\Pages\_Page->output()
#11 /home/ddowdell/public_html/cheersandgears.com/system/Dispatcher/Controller.php(85): IPS\cms\modules\front\pages\_page->__call('form', Array)
#12 /home/ddowdell/public_html/cheersandgears.com/applications/cms/modules/front/pages/page.php(33): IPS\Dispatcher\_Controller->execute()
#13 /home/ddowdell/public_html/cheersandgears.com/system/Dispatcher/Dispatcher.php(152): IPS\cms\modules\front\pages\_page->execute()
#14 /home/ddowdell/public_html/cheersandgears.com/index.php(13): IPS\_Dispatcher->run()
#15 {main}

When I try to submit the final post into the DB 

Edit:  If I turn off "Add followers from source topic in article?" it works properly. 

Edited by CheersnGears
Link to comment
Share on other sites

1 minute ago, Adriano Faria said:

Are you trying to promote same topic/post more than once ? It should not get the error anyway.

Disable the setting to follow the article and try again.

I got the error on the very first try.   Now I have 3 copies of the article in my DB and I don't know which one to delete. 

Link to comment
Share on other sites

Just tested and got the same if I enable Notify me of replies in the article post screen. You don't need to do that if you're enable to add topic followers in the article on the plugin settings. That's the problem.

For now, you can either:

  • disable the setting to follow
  • NOT enable the follow in the article post screen

I will release a version to fix it.

Edited by Adriano Faria
Link to comment
Share on other sites

2 minutes ago, Adriano Faria said:

Just tested and got the same if I enable Notify me of replies in the article post screen. You don't need to do that if you're enable to add topic followers in the article on the plugin settings. That's the problem.

For now, you can either:

  • disable the setting to follow
  • NOT enable the follow in the article post screen

I will release a version to fix it.

You rock, thank you!

Link to comment
Share on other sites

  • 3 weeks later...
On 3/23/2019 at 10:36 PM, Adriano Faria said:

What's New in Version 1.2.1:

  • Script optimization to avoid error (follow article)

After upgrading to 1.2.1, this plugin causes editing records to stop working. With the plugin enabled, if I try and edit a record, I get this error: "2T257/3"

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...