The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#6
|
|||
|
|||
![]()
Well I got a direct response from a vB developer with some information for creating articles via own code. Also i got a code example by an user of vbulletin-germany.org.
Code Example (provided by Andreas http://www.vbulletin-germany.org/sho...96&postcount=4, modified by me): Code:
<?php define('VB_AREA', 'API'); require('./includes/init.php'); require_once(DIR . '/includes/class_bootstrap_framework.php'); vB_Bootstrap_Framework::init(); function create_article($sectionid, $title, $pagetext, $userid, $categoryid = '', $datestamp = '', $description = '', $htmltitle = '') { global $db; if (empty($htmltitle)) $htmltitle = $title; if (empty($categoryid)) $categoryid = 41; $nodedm = new vBCMS_DM_Article(); $nodedm->info['skip_verify_pagetext'] = true; $nodedm->set('contenttypeid', vB_Types::instance()->getContentTypeID('vBCms_Article')); $nodedm->set('parentnode', $sectionid); $nodedm->set('publicpreview', 1); $nodedm->set('comments_enabled', 1); $nodedm->set('pagetext', $pagetext); $nodedm->set('title', $title); $nodedm->set('html_title', $htmltitle); $nodedm->set('description', $description); $nodedm->set('userid', $userid); $nodedm->set('url', vB_Friendly_Url::clean_entities($title)); $nodeid = $nodedm->save(); if (empty($nodeid)) { return false; } else { $db->query_write("INSERT INTO ". TABLE_PREFIX . "cms_nodecategory (nodeid, categoryid) values (" . $nodeid . ", $categoryid) "); $db->query_write("UPDATE " . TABLE_PREFIX . "cms_node SET new = 0 WHERE nodeid = $nodeid"); if(empty($datestamp) OR $datestamp < 946681200) // if datestamp is empty or before 01.01.2000 { $datestamp = TIMENOW - vBCms_ContentManager::getTimeOffset(vB::$vbulletin->userinfo, false); // use current datestamp } $db->query_write("UPDATE " . TABLE_PREFIX . "cms_node set setpublish = 1, publishdate = $datestamp WHERE nodeid = $nodeid"); } return $nodeid; } echo create_article(113, 'Headline', 'article text', 1); ?> Quote:
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|