gpt4 book ai didi

php - Drupal 7 中用户的图片存储在哪里?

转载 作者:可可西里 更新时间:2023-11-01 00:16:20 25 4
gpt4 key购买 nike

我正在使用 SelectQuery 对象来检索和显示用户列表,但我不知道从哪里获取用户的图片。

users 表有一个名为 picture 的列,但其中的数据只是一个整数。图片是否存储在某处的 blob 字段中,或者是否存在指向另一个表中图片的链接?

最佳答案

图像文件本身(通常)存储在 /sites/default/files 中的某处。对该图像的引用存储在 file_managed 表中,users 表中的 picture 列包含 fid图片的(文件 ID)。

你可以像这样加载文件对象:

$file = file_load($fid);

然后像这样获取图像的输出:

$image = theme('image', array('path' => $file->uri, 'alt' => 'Alt text'));

关于php - Drupal 7 中用户的图片存储在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8432955/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com