<?php
/*
* Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
- * Copyright (C) 2002-2009 The Nucleus Group
+ * Copyright (C) 2002-2012 The Nucleus Group
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
*/
/**
* @license http://nucleuscms.org/license.txt GNU General Public License
- * @copyright Copyright (C) 2002-2009 The Nucleus Group
- * @version $Id: upgrade0.96.php 1546 2011-06-30 15:36:25Z ftruscot $
+ * @copyright Copyright (C) 2002-2012 The Nucleus Group
+ * @version $Id: upgrade0.96.php 1809 2012-05-01 14:48:30Z sakamocchi $
*/
function upgrade_do96() {
// 6. add 'imagepopup' skincontents in skin 'default'
$query = 'SELECT sdnumber FROM '.sql_table('skin_desc')." WHERE sdname='default'";
- $res = sql_query($query);
- $obj = mysql_fetch_object($res);
- $skinid = $obj->sdnumber;
- $query = 'INSERT INTO '.sql_table('skin')." VALUES (" . $skinid . ", 'imagepopup', '<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n <title><%imagetext%></title>\r\n <style type=\"text/css\">\r\n img { border: none; }\r\n </style>\r\n</head>\r\n<body>\r\n <a href=\"javascript:window.close();\"><%image%></a>\r\n</body>\r\n</html>');";
+ $res = DB::getValue($query);
+ $query = 'INSERT INTO '.sql_table('skin')." VALUES (" . $res . ", 'imagepopup', '<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n <title><%imagetext%></title>\r\n <style type=\"text/css\">\r\n img { border: none; }\r\n </style>\r\n</head>\r\n<body>\r\n <a href=\"javascript:window.close();\"><%image%></a>\r\n</body>\r\n</html>');";
upgrade_query("Adding 'imagepopup' skinparts",$query);
// 7. add POPUP_CODE, MEDIA_CODE, IMAGE_CODE to ALL templates
$query = 'SELECT tdnumber FROM '.sql_table('template_desc');
- $res = sql_query($query); // get all template ids
- while ($obj = mysql_fetch_object($res)) {
- $tid = $obj->tdnumber; // template id
+ $res = DB::getResult($query); // get all template ids
+ foreach ( $res as $row ) {
+ $tid = $row['tdnumber']; // template id
$query = 'INSERT INTO '.sql_table('template')." VALUES ($tid, 'POPUP_CODE', '<%popuplink%>');";
$query2 = 'INSERT INTO '.sql_table('template')." VALUES ($tid, 'MEDIA_CODE', '<%media%>');";