.
Code: Select all
<?php
require_once("include.php");
$content =" Please note that users of Microsoft Windows XP with Service Pack 2 will need to unblock this page in order to see the menu. The reason for this is due to the fact that the menu has been written in JavaScript. This feature is considered unsafe when used locally and Service Pack 2 now blocks this by default for your safety. This only happens when you run the menu on a local machine, live use on the Internet will not be affected.";
$end = 100;
$max_c=0;$max_h=0;$max_l=0;$max_s=0;$i=0;$parent=1;
global $gCms;
$db =&$gCms->db;
while ($i < $end)
{
$ok =false;$tmp=0;
$i++;
echo 'Content - Number '.$i.' is running :';
$max_c++;
echo 'Content no: '.$max_c.'<br />';
$type='content';$tmp=$max_c;
$propname='content_en';
$addcontent='Content Number'.$max_c.'<br />'.$content;
$owner=1;$templateid=1;$active=1;$cachable=1;$lasteditby=1;
$mname=$type.$tmp;$malias=$mname;$menutext=$mname;$order=$i+4;
$hierarchy='00001.'.str_repeat('0',5-strlen($order)).$order;
$newid = $db->GenID(cms_db_prefix()."content_seq");
$query = "INSERT INTO ".$config["db_prefix"]."content (content_id, content_name, content_alias, type, owner_id, parent_id, template_id, item_order, hierarchy, active, default_content, show_in_menu, cachable, menu_text, collapsed, markup, last_modified_by, create_date, modified_date) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
$dbresult = $db->Execute($query, array(
$newid,
$mname,
$malias,
strtolower($type),
$owner,
1,
1,
$order,
$hierarchy,
1,
0,
1,
1,
$menutext,
0,
'html',
1,
$db->DBTimeStamp(time()),
$db->DBTimeStamp(time())
));
$query = "INSERT INTO ".cms_db_prefix()."content_props (content_id, type, prop_name, param1, param2, param3, content) VALUES (?,?,?,?,?,?,?)";
$dbresult = $db->Execute($query, array($newid,'string',$propname,'','','',$addcontent,));
}
?>
Haven't tried yet if it works with current cmsms version ...