public function profile_page($username) { if (!$this->ion_auth->username_check($username)) { redirect('errors/page_missing', 'refresh'); } $this->load->helper('slug'); $this->load->library('pagination'); //cached DB call $user = $this->cache->model('User_model', 'get_user_info', array($username), 300); // keep for 5 minutes $this->data['username'] = $user->username; $this->data['user'] = $user; //pagination // if ($this->ion_auth->logged_in() && $this->ion_auth->user()->row()->username == $this->uri->segment('2')) { $sWhere = array('user_id' => $user->id, 'status' => 'published'); } else { $sWhere = array('user_id' => $user->id, 'status' => 'published', 'visibility' => 'public'); } $config['total_rows'] = $this->cache->model('Song_model', 'song_count', array($sWhere), 120); $config['per_page'] = 20; $config['base_url'] = base_url('u/' . $username); $page = $this->uri->segment(3) ? $this->uri->segment(3) : 0; $this->data['songs'] = $this->cache->model('Song_model', 'get_songs_where', array($sWhere, $config['per_page'], 'song_id DESC', $page), 120); // keep for 2 minutes $this->pagination->initialize($config); $this->data['pagination'] = $this->pagination->create_links(); $results = 'Showing ' . $this->pagination->cur_page * $this->pagination->per_page . ' of ' . $this->pagination->total_rows; $this->data['result_nums'] = $results; $this->data['meta_name'] = array('description' => 'Songs uploaded by ' . $username . '. ' . $this->lang->line('meta_description'), 'twitter:card' => "summary_large_image", 'twitter:domain' => base_url('u/' . $username), 'twitter:site' => $this->lang->line('meta_twitter'), 'twitter:title' => $username . "'s Profile | " . $this->lang->line('meta_title'), 'twitter:creator' => '@' . $user->twitter_handle, 'twitter:description' => $username . "'s profile. Singles and Mixtapes uploaded by " . $username, 'twitter:image:src' => user_img($username)); $this->data['meta_prop'] = array('og:title' => $username . "'s Profile | " . $this->lang->line('meta_title'), 'og:url' => base_url('u/' . $username), 'og:site_name' => 'hiphopVIP', 'og:description' => $username . "'s profile. Singles and Mixtapes uploaded by " . $username); $this->data['title'] = $user->username . "'s Stream | " . $this->lang->line('meta_title'); $this->_render('user/profile_page', $this->data); }
</h2> <?php include 'includes/form_recados.php'; ?> <?php $solicitacoes = DB::getConn()->prepare('SELECT * FROM `amizade` WHERE para=? ANd `status`=0'); $solicitacoes->execute(array($idDaSessao)); $dadosamizade = DB::getConn()->prepare('SELECT `nome`,`sobrenome` FROM `usuarios` WHERE `id`=? LIMIT 1'); if ($solicitacoes->rowcount() > 0) { echo '<div id="busca">'; $link = '<a href="php/amizade.php?ac='; echo '<ul>'; while ($resmeuamigo = $solicitacoes->fetch(PDO::FETCH_ASSOC)) { $dadosamizade->execute(array($resmeuamigo['de'])); $asdadosamizade = $dadosamizade->fetch(PDO::FETCH_ASSOC); echo '<li><span><img src="uploads/usuarios/' . user_img($asdadsoamizade['imagem']) . '" /></span> <h2><a href="perfil.php?uid=' . $asdadsoamizade['id'] . '">' . $asdadsoamizade['nome'] . ' ' . $asdadsoamizade['sobrenome'] . ' </a></h2> Olá ' . $asdadsoamizade['nome'] . ' quer ser seu amigo ' . $link . 'aceitar|' . $resmeuamigo['id'] . '">aceitar</a> ' . $link . 'remover|' . $resmeuamigo['de'] . '|' . $idDaSessao . '|' . $resmeuamigo['id'] . '">recusar</a></li>'; } echo '</ul>'; echo '</div>'; } ?> </div><!--blocos--> </div><!--center--> <div class="right"> <?php include 'includes/amigos.php';
<div class="profile"> <img src="<?php echo user_img($user->username); ?> " class="img-circle"> <?php if ($this->ion_auth->logged_in() && $this->ion_auth->user()->row()->id === $user->id) { ?> <a href="<?php echo base_url('auth/edit_account'); ?> " class="btn btn-warning btn-xs" style="margin-top:-50px;margin-left:21px;">Change Image</a> <?php } ?> <p><?php echo $user->username; ?> <?php if ($this->ion_auth->in_group('verified', $user->id)) { ?> <span class="glyphicon glyphicon-ok verified-large"></span> <?php } ?> </p> </div> <?php
?> </div> </div> <div class="row" style="margin:5px"> <div class="col-md-12 col-lg-12"><strong>Profile Picture</strong><br /> <?php echo form_upload($profile_img_form); ?> </div> </div> <div class="row" style="margin:5px"> <div class="col-md-12 col-lg-12"> <img src="<?php echo user_img($this->ion_auth->user()->row()->username); ?> " style="width:150px; height:150px"> </div> </div> <a href="<?php echo base_url('auth'); ?> " type="button" id="cancel-btn" class="btn btn-danger">Cancel</a> <input type="submit" name="submit" id="submit" value="Update" class="btn btn-danger"> <?php echo form_close(); ?> </div>
<aside class="main-sidebar"> <!-- sidebar: style can be found in sidebar.less --> <section class="sidebar"> <!-- Sidebar user panel --> <div class="user-panel"> <div class="pull-left image"> <img src="<?php user_img($user['image']); ?> " class="img-circle" alt="User Image"> </div> <div class="pull-left info"> <p><?php echo $user['name']; ?> </p> <small><?php echo usertype($user['type']); ?> </small> </div> </div> <!-- sidebar menu: : style can be found in sidebar.less --> <ul class="sidebar-menu"> <li class="header">MAIN NAVIGATION</li> <li class="active treeview"> <a href="#"> <i class="fa fa-dashboard"></i> <span>Dashboard</span> <i class="fa fa-angle-left pull-right"></i> </a>
<!-- Publicidade --> <div class="blocos" id="publicidade"> <iframe width="300" height="250" src="http://www.youtube.com/embed/mx2ZOdKSd90" frameborder="0" allowfullscreen></iframe> </div><!--blocos--><!--Fim Publicidade --> <div class="blocos" id="meus-amigos"> <?php $list_amigos = Amizade::list_amigos($idExtrangeiro); ?> <!--Aqui mostra a quantidade de amigos --> <span>Meus amigos(<?php echo $list_amigos['num']; ?> ) <a href="#">Todos</a></span> <ul> <?php if ($list_amigos['num'] > 0) { //Aqui eu mostro os meus amigos foreach ($list_amigos['dados'] as $resAmigos) { echo '<li><a href="perfil.php?uid=' . $resAmigos[0] . '"><img width="50" height="50" src="uploads/usuarios/' . user_img($resAmigos[3]) . '" alt="" title="' . $resAmigos[1] . ' ' . $resAmigos[2] . '" /></a></li>'; } } else { echo 'Você não tem amigos'; } ?> </ul> </div><!--blocos--> <img width="" height="" src="uploads/usuarios/">
<?php foreach ($following as $key => $f) { ?> <li> <div class="listEntry" style="margin-bottom:15px"> <div class="col-sm-12 col-md-12 col-lg-12" style="margin-left:-20px;"> <a href="<?php echo base_url('u/' . $f->username); ?> "title="View <?php echo $f->username; ?> 's Profile"> <img src="<?php echo user_img($f->username, 150); ?> " width="64px" height='64px'><span class="followUserName"><?php echo $f->username; ?> </span></a> </div> </div> </li> <?php } ?> <?php } else { if ($this->ion_auth->logged_in() && $this->ion_auth->user()->row()->username === $username) { ?>
$idExists->execute(array($idExtrangeiro)); if ($idExists->rowCount() == 0) { header('Location: ./'); } $dados = $objLogin->getDados($idExtrangeiro); if (is_null($dados)) { header('Location: ./'); exit; } else { extract($dados, EXTR_PREFIX_ALL, 'user'); } function user_img($img) { return ($img != '' and file_exists('uploads/usuarios/' . $img)) ? $img : 'default.png'; } $user_imagem = user_img($user_imagem); $user_fullname = $user_nome . ' ' . $user_sobrenome; ?> <!DOCTYPE HTML> <html lang="pt-br"> <head> <meta charset="utf-8" /> <title>Ser Social - Home</title> <link rel="stylesheet" media="screen" href="estilos/template.css" type="text/css" /> <script type="text/javascript" src="js/jquery.js"></script> </head> <body> <?php if (isset($_GET['perfil']) and $_GET['perfil'] == 'CROP') {