perform attach_upgrade()
This commit is contained in:
		| @@ -121,6 +121,9 @@ class Cron { | |||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
|  | 		require_once('include/attach.php'); | ||||||
|  | 		attach_upgrade(); | ||||||
|  |  | ||||||
| 		$abandon_days = intval(get_config('system','account_abandon_days')); | 		$abandon_days = intval(get_config('system','account_abandon_days')); | ||||||
| 		if($abandon_days < 1) | 		if($abandon_days < 1) | ||||||
| 			$abandon_days = 0; | 			$abandon_days = 0; | ||||||
|   | |||||||
| @@ -2320,3 +2320,26 @@ function attach_syspaths($channel_id,$attach_hash) { | |||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | function attach_upgrade() { | ||||||
|  |  | ||||||
|  | 	$r = q("select id, uid, hash from attach where os_path = '' and display_path = '' limit 100"); | ||||||
|  | 	if($r) { | ||||||
|  | 		foreach($r as $rv) { | ||||||
|  | 			$x = attach_syspaths($rv['uid'],$rv['hash']); | ||||||
|  | 			if($x) { | ||||||
|  | 				$w = q("update attach set os_path = '%s', display_path = '%s' where id = %d", | ||||||
|  | 					dbesc($x['os_path']), | ||||||
|  | 					dbesc($x['path']), | ||||||
|  | 					intval($rv['id']) | ||||||
|  | 				); | ||||||
|  | 				$y = q("update photo set os_path = '%s', display_path = '%s' where uid = %d and resource_id = '%s'", | ||||||
|  | 					dbesc($x['os_path']), | ||||||
|  | 					dbesc($x['path']), | ||||||
|  | 					intval($rv['uid']), | ||||||
|  | 					dbesc($rv['hash']) | ||||||
|  | 				); | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  | } | ||||||
		Reference in New Issue
	
	Block a user