"><?php echo htmlspecialchars($topic['title']); ?> </a> </td> <td> <?php echo profil_url($topic['username'], $topic['user'], $topic['color']); ?> </td> <td><?php echo $topic['nbPost'] - 1; ?> </td> <td class="dateMP"><?php echo madate($topic['lastDate']); ?> </td> </tr> <?php } ?> </table> </div> <br /> <h1>Nouveau sujet</h1> <form id="addComment" action="<?php echo site_url('addTopic'); ?>
function loadLastPages() { $lastPagesViewed = $this->db->select('v.user,v.url,v.title,v.date,v.time,u.username,u.color')->join('users u', 'u.id = v.user')->order_by('v.id desc')->limit(100)->get('visites v')->result_array(); echo '<table class="table">'; foreach ($lastPagesViewed as $page) { echo '<tr> <td class="linkMP" style="padding-left:10px"> <a href="' . $page['url'] . '">' . htmlspecialchars($page['title']) . '</a> </td> <td style="width:140px"> ' . profil_url($page['username'], $page['user'], $page['color']) . ' </td> <td style="width:120px" class="dateMP">' . madate($page['date']) . '</td> <td style="width:40px">' . ($page['time'] == null ? '-' : $page['time'] . 's') . '</td> </tr>'; } echo '</table>'; }
?> <ul class="classic"> <?php foreach ($news as $actu) { ?> <li> <a href="<?php echo site_url($actu['url']); ?> "><?php echo htmlspecialchars($actu['title']); ?> </a> <span><?php echo madate($actu['date']); ?> </span> </li> <?php } ?> </ul> <div style="clear:both"></div> <?php echo $this->pagination->create_links(); ?> </div>
<td class="linkMP" style="padding-left:10px;"> <a href="<?php echo $page['referrer']; ?> "><?php echo $page['keywords']; ?> </a> </td> <td style="width:140px"> <?php echo profil_url($page['username'], $page['user'], $page['color']); ?> </td> <td style="width:120px" class="dateMP"><?php echo madate($page['date']); ?> </td> </tr> <?php } ?> </table> </div> </div> <script> $('#formInterval').on('submit', loadStats); function loadStats()
<?php if ($infos['group'] == 4) { echo '<span style="color:#4169e1">Webmaster</span>'; } ?> - <?php echo $infos['online'] == 1 ? '<span style="color:green">Connecté</span>' : '<span style="color:red">Hors ligne</span>'; ?> <br /> Inscrit <?php echo madate($infos['registerDate']); ?> <br /> Dernier passage <?php echo madate($infos['lastDate']); ?> </div> <?php $file_headers = @get_headers('http://mypsn.eu.playstation.com/psn/profile/' . $infos['idPSN'] . '.png'); if ($file_headers[0] == 'HTTP/1.1 404 Not Found') { $exists = false; } else { $exists = true; } if (trim($infos['idPSN']) != '' && $exists) { echo '<img style="margin:0;position:absolute;right:-15px;top:35px" src="http://mypsn.eu.playstation.com/psn/profile/' . $infos['idPSN'] . '.png" />'; } ?>
if ($nbCommentaires == 0) { echo 'Aucun commentaire, soyez le premier !'; } elseif ($nbCommentaires == 1) { echo 'Un seul commentaire'; } else { echo $nbCommentaires . ' commentaires'; } echo '</h1>'; } echo '<br />'; echo $this->pagination->create_links(); foreach ($commentaires as $commentaire) { echo '<div idComm="' . $commentaire['id'] . '" class="commentaire">'; echo '<div class="commAvatar">' . avatar_url($commentaire['user']) . '</div>'; echo '<div class="commPseudo">' . profil_url($commentaire['username'], $commentaire['user'], $commentaire['color']); echo ' <span class="commTime">' . madate($commentaire['date']) . '</span>'; echo '<div class="commActions">'; if ($this->session->userdata('group') >= 2) { echo '<a class="commSuppr" href="' . site_url('commSuppr/' . $commentaire['id']) . '">' . img('mini_delete.png') . ' Supprimer</a>'; } if ($commentaire['user'] == $this->session->userdata('id')) { echo '<a class="commEdit" href="' . site_url('editComm/' . $commentaire['id']) . '">' . img('editComm.png') . ' Edition</a>'; } echo '</div>'; echo '</div>'; echo '<p>' . montexte($commentaire['message']) . '</p>'; echo '</div>'; } echo $this->pagination->create_links(); echo '<script>'; echo 'url="' . $url . '";';
?> v<?php echo $history['editFromVersion']; ?> <span class="tiny">></span> v<?php echo $history['version']; ?> <span class="tiny" style="float:right"> <?php echo profil_url($history['username'], $history['user'], $history['color']); ?> <?php echo madate($history['editDate']); ?> <?php echo colorNb($history['linesModified'], '(', ' ligne' . ($history['linesModified'] > 1 ? 's' : '') . ' | '); ?> <?php echo colorNb($history['sizeModified'], '', ' octet' . ($history['sizeModified'] > 1 ? 's' : '') . ')'); ?> </span> </div> <?php } ?> </div>
?> "><?php echo $comment['categorie']; ?> <span>></span> <?php echo htmlspecialchars($comment['title']); ?> </a> <?php echo avatar_url($comment['user'], true); ?> <span><?php echo profil_url($comment['username'], $comment['user'], $comment['color']); ?> <?php echo madate($comment['date']); ?> </span> <p><?php echo character_limiter(montextepreview($comment['message']), 110); ?> </p> <div style="clear:both"></div> </div> <?php } ?> </div> </div> <?php
function doSearch() { if (trim($_POST['keywords']) == '' || $_POST['keywords'] == 'Mots clefs de votre recherche') { return; } $keywords = $_POST['keywords']; $array_keywords = explode(' ', $keywords); $typeSearch = $_POST['typeSearch']; $title = $_POST['title']; @($cat1 = $_POST['cat1']); @($cat2 = $_POST['cat2']); $sondage = $_POST['sondage']; $sort = $_POST['sort']; $author = trim($_POST['author']); if ($this->session->userdata('lastSearch') != $keywords) { $this->db->insert('search', array('user' => $this->session->userdata('id'), 'site' => $this->contents->getIdSite(), 'keywords' => $keywords, 'date' => date('Y-m-d H:i:s'))); $this->session->set_userdata('lastSearch', $keywords); } if (!is_array($cat1)) { $cat1 = array(); } // contenu if ($_POST['where'] == 1) { //requete $this->db->select('c.id,c.idCreation,c.title,c.date,c.editDate,c.url,c.content,ct.name')->join('sites s', 's.id = c.site')->join('content_types ct', 'ct.id = c.type')->where('c.isCurrent', 1)->where_in('c.type', $cat1); if ($typeSearch == 1) { if ($title == 1) { $this->db->like('c.title', $keywords); } else { $this->db->like('c.content', $keywords); } } else { if ($title == 1) { foreach ($array_keywords as $keyword) { $this->db->like('c.title', $keyword); } } else { foreach ($array_keywords as $keyword) { $this->db->like('c.content', $keyword); } } } $res = $this->db->get('contents c')->result_array(); foreach ($res as $key => $line) { $res[$key]['timestamp'] = datetime2timestamp($line['editDate']); $res[$key]['occurence'] = 0; if ($typeSearch == 1) { $res[$key]['occurence'] += countWord($keywords, $line['title']); $res[$key]['occurence'] += countWord($keywords, $line['content']); } else { foreach ($array_keywords as $keyword) { $res[$key]['occurence'] += countWord($keyword, $line['title']); $res[$key]['occurence'] += countWord($keyword, $line['content']); } } } if ($sort == 1) { usort($res, 'sortByOccurence'); } else { usort($res, 'sortByTimestamp'); } //affichage des resultats echo '<h1>' . count($res) . ' résultats</h1>'; echo '<ul class="classic">'; foreach ($res as $line) { echo '<li><a href="' . $line['url'] . '" class="resultContent">[' . $line['name'] . '] ' . htmlspecialchars($line['title']) . '</a>'; echo '<span>' . $line['occurence'] . ' occurence' . ($line['occurence'] > 1 ? 's' : '') . ' - édité ' . madate($line['editDate']) . '</span>'; echo '</li>'; } echo '<ul>'; // var_dump($res); // echo $this->db->last_query(); } }
<div class="contentCenter"> <h1><?php echo $title; ?> </h1> <div class="infosContent"> Page créée <strong><?php echo madate($infos['date']); ?> </strong> <?php if ($infos['editDate'] != $infos['date']) { ?> et éditée <strong><?php echo madate($infos['editDate']); ?> </strong> <?php } ?> <br /> Contributeurs : <?php foreach ($contributs as $user) { ?> <?php echo profil_url($user['username'], $user['user'], $user['color']); ?>
<div style="text-align:center"> <input type="submit" class="btn" value="Valider" /> </div> <br /> </form> </td> <td style="text-align:center"> <?php foreach ($dons as $don) { ?> <div class="lineDon"><?php echo htmlspecialchars($don['name']); ?> <span><?php echo madate($don['date']); ?> </span></div> <?php } ?> </td> </tr> </table> <script> $('#pays').on('change', function() { var pays = $(this).val(); if(pays == '') return;
public function listMsg($page = null) { $this->load->model('chatboxs'); if ($page == null) { $mgs = $this->chatboxs->getMsg(); $mgs = array_reverse($mgs, true); } else { $mgs = $this->chatboxs->getHistory($page); } $json = array(); $lastUser = false; foreach ($mgs as $msg) { //si c'est un message privé //qu'on la pas envoyé //et qu'on n'est pas le destinataire => continue // if($msg['toUser'] != null && $msg['user'] != $this->session->userdata('id') && $msg['toUser'] != $this->session->userdata('id')) // continue; $json[$msg['id']] = '<div style="display:none" class="message" id="msgTchatbox' . $msg['id'] . '">'; if ($this->session->userdata('group') >= 2 && $page == null) { $json[$msg['id']] .= '<a class="deleteMsg" href="' . site_url('deleteMsg/' . $msg['id']) . '">' . img('mini_delete.png') . '</a>'; } if ($msg['isDeleted'] == 1 && $page == null) { $json[$msg['id']] .= 'removedByAdmin'; } else { $isMp = false; // pseudo du click message privée if ($msg['toUser'] == $this->session->userdata('id')) { $mpUsername = $msg['username']; $isMp = true; } elseif ($msg['toUser'] != null && $msg['user'] == $this->session->userdata('id')) { $mpUsername = $msg['username2']; $isMp = true; } else { $mpUsername = $msg['username']; } if ($isMp) { $testWith = $msg['username'] . '@' . $msg['username2']; } else { $testWith = $msg['username']; } if ($lastUser != $testWith) { $lastUser = $testWith; $json[$msg['id']] .= '<div class="author">'; // bouton MP if ($page == null) { $json[$msg['id']] .= '<a class="mpMsg" username="******" nohref>' . img('mp.png') . '</a>'; } // personne qui a envoyé le message $json[$msg['id']] .= profil_url($msg['username'], $msg['user'], $msg['color']); // si c'est un MP, on affiche a qui if ($isMp) { $json[$msg['id']] .= '@' . profil_url($msg['username2'], $msg['toUser'], $msg['color2']); } //date if ($page == null) { $json[$msg['id']] .= ' <span class="time">' . date('G\\hi', datetime2timestamp($msg['date'])) . '</span></div>'; } else { $json[$msg['id']] .= ' <span class="time">' . madate($msg['date']) . '</span></div>'; } } // on affiche le message if ($isMp) { $style = 'color:#006600'; } else { $style = ''; } $json[$msg['id']] .= '<span style="' . $style . '"">' . montexte($msg['message'], true, false) . '</span>'; } $json[$msg['id']] .= '</div>'; } echo json_encode($json); }