This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
muratneciparcan10366
to get the path, you have to take piece of the letters of disk_name, 'storage\app\uploads\public\first 3 letters of filename\second 3 letters of filename\3rd 3 letters of filename\filename.jpg' Code;
use Backend\Models\User;
function onStart()
{
$this['posts'] = Db::table('muratneciparcan_wall_')
->join('users', 'muratneciparcan_wall_.user_id', '=', 'users.id')
->join('system_files', 'users.id', '=', 'system_files.attachment_id')
->select('muratneciparcan_wall_.*', 'users.*', 'system_files.*')->where('attachment_type', '=', 'RainLab\User\Models\User')->orderBy('muratneciparcan_wall_.id','desc')->get();
$i = 0;
foreach ($this['posts'] as $j) {
$arrays[] = $this['posts'];
$arrays[1][$i] = substr($this['posts'][$i]->disk_name, 0, 3);
$arrays[2][$i] = substr($this['posts'][$i]->disk_name, 3, 3);
$arrays[3][$i] = substr($this['posts'][$i]->disk_name, 6, 3);
$i++;
}
$this['content'] = $arrays;
}
it can be used in front end side like this; content[1][loop.index]
Last updated
1-1 of 1