upgrade_forum_data.php

来自「GForge 3.0 协作开发平台 支持CVS, mailing lists, 」· PHP 代码 · 共 55 行

PHP
55
字号
<?php//// SourceForge: Breaking Down the Barriers to Open Source Development// Copyright 1999-2000 (c) The SourceForge Crew// http://sourceforge.net//// $Id: upgrade_forum_data.php,v 1.1 2000/12/08 18:18:30 tperdue Exp $exit;/*	One time use script	calculates and updates the has_followups flag in the forums*/require ('pre.php');    session_require(array('group'=>'1','admin_flags'=>'A'));//get all the tasks$result=db_query("SELECT msg_id FROM forum ORDER BY msg_id ASC",10000,$z);$rows=db_numrows($result);echo db_error();echo "\nRows: $rows\n";flush();for ($i=0; $i<$rows; $i++) {	//echo "\n".db_result($result,$i,'msg_id')."\n";	/*		//insert a default bug dependency	*/	$res2=db_query("SELECT count(*) FROM forum WHERE is_followup_to='". db_result($result,$i,'msg_id') ."'");	$rows2=db_numrows($res2);	if (db_result($res2,0,0) < 1) {		// don't do anything		$counter2++;		//echo db_error();	} else {		$counter++;		db_query ("UPDATE forum SET has_followups='1' WHERE msg_id='". db_result($result,$i,'msg_id') ."'");	}}echo "\n\nUpdated: $counter";echo "\n\nSkipped: $counter2";flush();?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?