function cache_image($imageurl = '', $name) { $imagename = $name . '.' . get_image_extension($imageurl); if (file_exists('./tmp/' . $imagename)) { return 'tmp/' . $imagename; } $image = file_get_contents_curl($imageurl); file_put_contents('tmp/' . $imagename, $image); return 'tmp/' . $imagename; }
$conn->osc_dbExec($qry); $item_count++; } osc_add_flash_ok_message($item_count . ' Cover Photo(s) Denied ', 'admin'); header('Location:' . osc_admin_render_plugin_url($file)); } break; case 'delete': $user_ids = Params::getParam('chk'); $count = count($user_ids); if ($count > 0) { $item_count = 0; foreach ($user_ids as $user_id) { $conn = getConnection(); $qry = 'DELETE FROM ' . DB_TABLE_PREFIX . 't_cover_photo WHERE user_id = ' . $user_id; $img_path = osc_plugins_path() . 'cover_photo/images/profile' . $user_id . get_image_extension($user_id); unlink($img_path); $conn->osc_dbExec($qry); $item_count++; } osc_add_flash_ok_message($item_count . ' Cover Photo(s) Deleted ', 'admin'); header('Location:' . osc_admin_render_plugin_url($file)); } break; } break; } if (Params::getParam('start') == '') { $start = 0; } else { $start = Params::getParam('start');