Пример #1
0
function admin_insert_c_image($upfile_obj, $filename)
{
    if ($upfile_obj && is_uploaded_file($upfile_obj['tmp_name']) && db_image_insert_c_image2($filename, $upfile_obj['tmp_name']) > 0) {
        return $filename;
    }
    return false;
}
Пример #2
0
function _do_insert_c_image($filename, $filepath)
{
    return db_image_insert_c_image2($filename, $filepath);
}
Пример #3
0
/**
 * スキンファイルから画像をDB登録(no_imageをデフォルトに戻す)
 */
function db_insert_c_image4skin_filename($skinname, $skintheme = OPENPNE_SKIN_THEME)
{
    if (!$skinname || preg_match('/[^\\.\\w]/', $skinname)) {
        return false;
    }
    $ext = 'gif';
    $filename = $skinname . '.' . $ext;
    if (!$skintheme || preg_match('/[^\\.\\w]/', $skintheme)) {
        $skintheme = 'default';
    }
    $path = sprintf('%s/skin/%s/img/%s', OPENPNE_PUBLIC_HTML_DIR, $skintheme, $filename);
    if (!is_readable($path)) {
        $path = sprintf('%s/skin/default/img/%s', OPENPNE_PUBLIC_HTML_DIR, $filename);
    }
    $filename = sprintf('skin_default_%s_%s.%s', $skinname, time(), $ext);
    $res = db_image_insert_c_image2($filename, $path);
    return db_replace_c_skin_filename($skinname, $filename);
}
Пример #4
0
function image_insert_c_image($upfile_obj, $filename, $c_member_id = 0)
{
    if (!$upfile_obj) {
        return false;
    }
    $filepath = $upfile_obj['tmp_name'];
    $path_parts = pathinfo($upfile_obj['name']);
    $ext = $path_parts['extension'];
    $ext = strtolower($ext);
    $filename = $filename . '_' . time() . '.' . $ext;
    if (!db_image_insert_c_image2($filename, $filepath, $c_member_id)) {
        return false;
    }
    return $filename;
}