HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


"Import" posts into a Forum by Hand...

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#68728 (In Topic #14590)
Avatar

Well-settled

Hi,
I wrote a small bot to browse through RSS channells in order to fetch posts for our users. So far this all works flawless and i am about to release the code for it, but there is one minor point i would like to ask about. When i wrote my topics with ocf_make_topic and ocf_make_post the Forum is, of course, not refreshed. For that i have to go to through the maintainance admin options.
Is there a way of doing this programmatically?
Back to the top
 
Posted
Rating:
#68735
Avatar

I think one of the option to one of these functions specifies to update the caching.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#68761
Avatar

Well-settled

Thanks for the hint - though it shuld have been obvious.

For those interestered:

Code

require_code('view_modes');

$todo[0] = "blocks";
$todo[1] = "ocf_topics";
$todo[2] = "ocf";

$messages=ocportal_cleanup($todo);
Back to the top
 
Posted
Rating:
#68787
Avatar

Here's ocf_make_post…

Code

function ocf_make_post($topic_id,$title,$post,$skip_sig=0,$is_starter=false,$validated=NULL,$is_emphasised=0,$poster_name_if_guest=NULL,$ip_address=NULL,$time=NULL,$poster=NULL,$intended_solely_for=NULL,$last_edit_time=NULL,$last_edit_by=NULL,$check_permissions=true,$update_cacheing=true,$forum_id=NULL,$support_attachments=true,$topic_title='',$sunk=0,$id=NULL,$anonymous=false,$skip_post_checks=false,$is_pt=false)

I just meant make sure $update_cacheing is set to true.

I think that's all we do.

The parameter can be set to false for things that mass-create content, like the importer, to make it run faster.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#68874
Avatar

Well-settled

ohh.. thats a much nicer way to do it. i totally misread the description and didnt see the parameter… *blushes*
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: