[ Index ] |
|
Code source de CMS made simple 1.0.5 |
1 <?php 2 3 echo '<p>Converting templates using headtags... '; 4 5 $query = "SELECT c.template_id, t.template_content FROM ".cms_db_prefix()."content c INNER JOIN ".cms_db_prefix()."content_props p ON p.content_id = c.content_id INNER JOIN ".cms_db_prefix()."templates t ON t.template_id = c.template_id WHERE p.prop_name = 'headtags' AND p.content IS NOT NULL AND p.content NOT LIKE ''"; 6 $result = $db->Execute($query); 7 8 if ($result && $result->RecordCount() > 0) 9 { 10 while ($row = $result->FetchRow()) 11 { 12 $templatetxt = $row['template_content']; 13 if (function_exists('str_ireplace')) 14 { 15 $templatetxt = str_ireplace('</head>', "{content block='headtags' wysiwyg='false'}\n</head>", $templatetxt); 16 } 17 else 18 { 19 $templatetxt = eregi_replace('<\/head>', "{content block='headtags' wysiwyg='false'}\n</head>", $templatetxt); 20 } 21 $time = $db->DBTimeStamp(time()); 22 $query = 'UPDATE ' . cms_db_prefix() . 'templates SET template_content = ?, modified_date = '.$time.' WHERE template_id = ?'; 23 $db->Execute($query, array($templatetxt, $row['template_id'])); 24 } 25 } 26 27 echo '[done]</p>'; 28 29 echo '<p>Updating schema version... '; 30 31 $query = 'UPDATE ' . cms_db_prefix() . 'version SET version = 13'; 32 $db->Execute($query); 33 34 echo '[done]</p>'; 35 36 # vim:ts=4 sw=4 noet 37 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Tue Apr 3 18:50:37 2007 | par Balluche grâce à PHPXref 0.7 |