📄 wfdownloads_v2.0.2.php
字号:
$xoopsDB -> query("INSERT INTO " . $xoopsDB -> prefix("wfdownloads_mimetypes") . " VALUES (119, 'wvx', 'video/x-ms-wvx', 'Windows Media Redirector', 1, 0)"); $xoopsDB -> query("INSERT INTO " . $xoopsDB -> prefix("wfdownloads_mimetypes") . " VALUES (120, 'wm', 'video/x-ms-wm', 'Windows Media A/V File', 1, 0)"); $xoopsDB -> query("INSERT INTO " . $xoopsDB -> prefix("wfdownloads_mimetypes") . " VALUES (121, 'wmx', 'video/x-ms-wmx', 'Windows Media Player A/V Shortcut', 1, 0)"); $xoopsDB -> query("INSERT INTO " . $xoopsDB -> prefix("wfdownloads_mimetypes") . " VALUES (122, 'ice', 'x-conference-xcooltalk', 'Cooltalk Audio', 1, 0)"); $result = $xoopsDB -> query("INSERT INTO " . $xoopsDB -> prefix("wfdownloads_mimetypes") . " VALUES (123, 'rar', 'application/octet-stream', 'WinRAR Compressed Archive', 1, 0)"); if (!$result) { $error[] = "<b>Error:</b> Could <span style='color:#ff0000;font-weight:bold'>not import</span> table data for table <b>$table</b>!"; } else { $output[] = "<b>Success:</b> Table <b>$table</b> data was <span style='color:#FF0000;font-weight:bold'>imported</span> Successfully"; } $table_array = array("mydownloads_broken" => "wfdownloads_broken", "mydownloads_cat" => "wfdownloads_cat", "mydownloads_downloads" => "wfdownloads_downloads", "mydownloads_indexpage" => "wfdownloads_indexpage", "mydownloads_mod" => "wfdownloads_mod", "mydownloads_reviews" => "wfdownloads_reviews", "mydownloads_votedata" => "wfdownloads_votedata", ); // $result = $xoopsDB->queryF("ALTER TABLE " . $xoopsDB->prefix("mydownloads_reviews") . " RENAME TO " . $xoopsDB->prefix("wfdownloads_reviews") . " "); foreach ($table_array as $table1 => $table2) { $result = $xoopsDB -> queryF("ALTER TABLE " . $xoopsDB -> prefix(trim($table1)) . " COPY TO " . $xoopsDB -> prefix(trim($table2)) . " "); if (!$result) { $error[] = "<b>Error:</b> Could <span style='color:#ff0000;font-weight:bold'>not rename</span> table $table1 to table <b>$table2</b>!"; } else { $output[] = "<b>Success:</b> Table <b>$table1</b> was <span style='color:#FF0000;font-weight:bold'>renamed</span> to $table2 Successfully"; } unset($result); } $result = $xoopsDB -> queryF("ALTER TABLE " . $xoopsDB -> prefix("wfdownloads_cat") . " ADD summary text NOT NULL AFTER description"); $result = $xoopsDB -> queryF("ALTER TABLE " . $xoopsDB -> prefix("wfdownloads_cat") . " ADD total int(11) NOT NULL default '0' AFTER description"); $result = $xoopsDB -> queryF("ALTER TABLE " . $xoopsDB -> prefix("wfdownloads_cat") . " ADD nohtml int(1) NOT NULL default '0'"); $result = $xoopsDB -> queryF("ALTER TABLE " . $xoopsDB -> prefix("wfdownloads_cat") . " ADD nosmiley int(1) NOT NULL default '0'"); $result = $xoopsDB -> queryF("ALTER TABLE " . $xoopsDB -> prefix("wfdownloads_cat") . " ADD noxcodes int(1) NOT NULL default '0'"); $result = $xoopsDB -> queryF("ALTER TABLE " . $xoopsDB -> prefix("wfdownloads_cat") . " ADD noimages int(1) NOT NULL default '0'"); $result = $xoopsDB -> queryF("ALTER TABLE " . $xoopsDB -> prefix("wfdownloads_cat") . " ADD nobreak int(1) NOT NULL default '1'"); $result = $xoopsDB -> queryF("ALTER TABLE " . $xoopsDB -> prefix("wfdownloads_cat") . " ADD weight int(11) NOT NULL default '0'"); $result = $xoopsDB -> queryF("ALTER TABLE " . $xoopsDB -> prefix("wfdownloads_downloads") . " CHANGE url url varchar(255) NOT NULL default ''"); $result = $xoopsDB -> queryF("ALTER TABLE " . $xoopsDB -> prefix("wfdownloads_downloads") . " CHANGE logourl screenshot varchar(255) NOT NULL default ''"); $result = $xoopsDB -> queryF("ALTER TABLE " . $xoopsDB -> prefix("wfdownloads_downloads") . " ADD description text NOT NULL AFTER offline"); $result = $xoopsDB -> queryF("ALTER TABLE " . $xoopsDB -> prefix("wfdownloads_downloads") . " ADD publisher text NOT NULL AFTER submitter"); $result = $xoopsDB -> queryF("ALTER TABLE " . $xoopsDB -> prefix("wfdownloads_downloads") . " ADD ipaddress varchar(120) NOT NULL default '0'"); $result = $xoopsDB -> queryF("ALTER TABLE " . $xoopsDB -> prefix("wfdownloads_downloads") . " ADD notifypub int(1) NOT NULL default '0'"); $result = $xoopsDB -> queryF("ALTER TABLE " . $xoopsDB -> prefix("wfdownloads_mod") . " CHANGE title title varchar(255) NOT NULL default ''"); $result = $xoopsDB -> queryF("ALTER TABLE " . $xoopsDB -> prefix("wfdownloads_mod") . " CHANGE url url varchar(255) NOT NULL default ''"); $result = $xoopsDB -> queryF("ALTER TABLE " . $xoopsDB -> prefix("wfdownloads_mod") . " CHANGE logourl screenshot varchar(255) NOT NULL default ''"); $result = $xoopsDB -> queryF("ALTER TABLE " . $xoopsDB -> prefix("wfdownloads_mod") . " CHANGE homepage homepage varchar(255) NOT NULL default ''"); $result = $xoopsDB -> queryF("ALTER TABLE " . $xoopsDB -> prefix("wfdownloads_mod") . " ADD publisher text NOT NULL AFTER submitter"); $sql = "SELECT * FROM " . $xoopsDB -> prefix('mydownloads_text') . "" ; $result2 = $xoopsDB -> query($sql); while ($arr = $xoopsDB -> fetchArray($result2)) { $xoopsDB -> queryF("UPDATE " . $xoopsDB -> prefix("wfdownloads_downloads") . " SET description = '" . $arr['description'] . "' WHERE lid = " . $arr['lid'] . ""); } $result = $xoopsDB -> queryF("DROP TABLE " . $xoopsDB -> prefix("mydownloads_text") . " "); echo "<p>...Updating</p>\n"; if (count($error)) { foreach($error as $err) { echo $err . "<br>"; } } if (count($output)) { echo "<p><span style='color:#0000FF;font-weight:bold'>There where updates made to your database. <br />Any questions? Please contact the support team at the <br><h4><a href='http://wfsections.xoops2.com'>WF-Section website</a></h4></span></p>\n"; foreach($output as $nonerr) { echo $nonerr . "<br>"; } } echo "<p><span><a href=''>Finish updating Module</a></span></p>\n";?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -