/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
- # We clean up the file, too
+ static function pivotGet($keyCol, $keyVals, $otherCols)
+ {
+ return Memcached_DataObject::pivotGet('Avatar', $keyCol, $keyVals, $otherCols);
+ }
+
+ // We clean up the file, too
function delete()
{
}
}
- function &pkeyGet($kv)
+ function pkeyGet($kv)
{
return Memcached_DataObject::pkeyGet('Avatar', $kv);
}
- // where should the avatar go for this user?
-
+ /**
+ * Where should the avatar go for this user?
+ */
static function filename($id, $extension, $size=null, $extra=null)
{
if ($size) {
$server = common_config('site', 'server');
}
- // XXX: protocol
+ $ssl = common_config('avatar', 'ssl');
+
+ if (is_null($ssl)) { // null -> guess
+ if (common_config('site', 'ssl') == 'always' &&
+ !common_config('avatar', 'server')) {
+ $ssl = true;
+ } else {
+ $ssl = false;
+ }
+ }
+
+ $protocol = ($ssl) ? 'https' : 'http';
- return 'http://'.$server.$path.$filename;
+ return $protocol.'://'.$server.$path.$filename;
}
function displayUrl()
{
$server = common_config('avatar', 'server');
- if ($server) {
+ if ($server && !empty($this->filename)) {
return Avatar::url($this->filename);
} else {
return $this->url;