Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
user_revision
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
user_revision
Commits
fb7636af
Commit
fb7636af
authored
14 years ago
by
Jelle
Browse files
Options
Downloads
Patches
Plain Diff
picture support added for user revisions
parent
1203d6cf
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
user_revision.module
+8
-1
8 additions, 1 deletion
user_revision.module
with
8 additions
and
1 deletion
user_revision.module
+
8
−
1
View file @
fb7636af
...
...
@@ -119,7 +119,6 @@ class UserRevisionController extends UserController {
unset
(
$fields
[
'timestamp'
]);
$query
->
addField
(
'revision'
,
'timestamp'
,
'revision_timestamp'
);
$query
->
addField
(
'revision'
,
'authorid'
,
'revision_uid'
);
$query
->
addField
(
'revision'
,
'ip'
,
'revision_ip'
);
$fields
[
'uid'
][
'table'
]
=
'base'
;
return
$query
;
}
...
...
@@ -261,6 +260,10 @@ function user_revision_user_load($uid, $vid = NULL, $reset = FALSE) {
if
(
isset
(
$vid
))
{
$conditions
=
(
isset
(
$vid
)
?
array
(
'vid'
=>
$vid
)
:
array
());
$users
=
user_load_multiple
(
array
(
$uid
),
$conditions
,
$reset
);
foreach
(
$users
as
$key
=>
$user
){
$file
->
fid
=
db_query
(
"SELECT picture FROM
{
user_revision
}
WHERE vid = :vid"
,
array
(
':vid'
=>
$vid
))
->
fetchField
();
$users
[
$key
]
->
picture
=
file_load
(
$file
->
fid
);
}
return
reset
(
$users
);
}
}
...
...
@@ -295,6 +298,8 @@ function user_revision_user_delete($account) {
* Save record to the database.
*/
function
_user_save_revision
(
&
$edit
,
$update
=
NULL
)
{
$picture
=
$edit
[
'picture'
];
$edit
[
'picture'
]
=
$picture
->
fid
;
// add timestamp and author
if
(
isset
(
$update
))
{
$res
=
drupal_write_record
(
'user_revision'
,
$edit
,
$update
);
...
...
@@ -302,6 +307,8 @@ function _user_save_revision(&$edit, $update = NULL) {
else
{
$res
=
drupal_write_record
(
'user_revision'
,
$edit
);
}
file_usage_add
(
$picture
,
'user_revision'
,
'user'
,
$edit
[
'vid'
]);
$edit
[
'picture'
]
=
$picture
;
// pass new vid to user_save?
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment