<?PHP class avatarGalery extends punController { public function index() { $content = ''; $avatars = avatarGalery::load_model('avatarModels'); $users = $avatars->get_users_with_avatars(); IF(isset($users[0])) { foreach($users as $res) { IF(is_file('img/avatars/'.$res['id'].'.png')) { $res['img'] = 'img/avatars/'.$res['id'].'.png'; } elseIF(is_file('img/avatars/'.$res['id'].'.gif')) { $res['img'] = 'img/avatars/'.$res['id'].'.gif'; } elseIF(is_file('img/avatars/'.$res['id'].'.jpg')) { $res['img'] = 'img/avatars/'.$res['id'].'.jpg'; } $content .= avatarGalery::render_template('Dane użytkownika: '.$res['username'], avatarGalery::load_view('avatar', $res)); $content .= '<br />'; } } return $content; } }
|