File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -280,8 +280,12 @@ public static function push($arr=array()){
280
280
array_push ($ arr ['tags ' ], $ arr ['folder ' ]);
281
281
array_push ($ arr ['tags ' ], $ ext );
282
282
283
+ if (!isset ($ arr ['author ' ])){
284
+ $ user = User::info ();
285
+ $ arr ['author ' ] = $ user ->status ?$ user ->data [0 ]['id ' ]:0 ;
286
+ }
287
+
283
288
Module::import ("Query " );
284
- $ user = User::info ();
285
289
$ q = Query::set ('library ' ,array (
286
290
'data ' => array (
287
291
'name ' => $ filename ,
@@ -290,7 +294,7 @@ public static function push($arr=array()){
290
294
'extension ' => $ ext ,
291
295
'size ' => File::format (filesize ($ file ['original ' ])),
292
296
'tags ' => implode (", " , $ arr ['tags ' ]),
293
- 'author ' => $ user -> data [ 0 ][ ' id ' ],
297
+ 'author ' => $ arr [ ' author ' ],
294
298
// 'taxonomy' => isset($arr['taxonomy'])?$arr['taxonomy']:''
295
299
)
296
300
));
You can’t perform that action at this time.
0 commit comments