public function getAction() { if (empty($_SERVER['HTTP_X_REQUESTED_WITH'])) { error404(); } $model = new ChatModel(); $dialog = ''; $userList = ''; $lastMessageID = getSession('chat_lmid', false); $chatList = $model->getChatMessages('chat', 'ASC', $lastMessageID); if ($chatList) { foreach ($chatList as $value) { $msg = ' ' . $value['message']; if (strpos($msg, Request::getParam('user')->nickname) !== false) { $color = ' chat_your_msg'; } else { $color = false; } $dialog .= '<div class="chat_message' . $color . '">' . '<div class="chat_img"><a href="' . url($value['uid']) . '" target="_blank"><img src="' . getAvatar($value['uid'], 's') . '"></a></div>' . '<div class="chat_text">' . '<div><span class="chat_nickname" onclick="chatNickname(\'' . $value['uName'] . '\');">' . $value['uName'] . '</span> <span class="chat_time">' . printTime($value['time']) . '</span></div>' . '<div>' . $value['message'] . '</div>' . '</div>' . '</div>'; setSession('chat_lmid', $value['id']); } } unset($chatList); /* if (time()%5 == 0 OR getSession('chat_ses') == 0) { $listUserOnline = $model->getUserOnline(); $countUser = 0; while ($list = mysqli_fetch_object($listUserOnline)) { $userList .= '<li><a href="' . url($list->id) . '" target="_blank"><span>' . $list->nickname . '</span><span class="level-icon">' . $list->level . '</span></a></li>'; $countUser++; } $response['userList'] = $userList; $response['countUser'] = $countUser; } */ $response['error'] = 0; if ($dialog) { $response['target_a']['#dialog'] = $dialog; } setSession('chat_ses', 1); echo json_encode($response); exit; }
<div class="chatMain"> <div class="chatBody" id="dialog"> <?php // $list = array_reverse((array)$this->list); if ($list) { foreach ($list as $value) { $msg = ' ' . $value['message']; if (strpos($msg, Request::getParam('user')->nickname) !== false) { $color = ' chat_your_msg'; } else { $color = false; } echo '<div class="chat_message' . $color . '">' . '<div class="chat_img"><a href="' . url($value['uid']) . '" target="_blank"><img src="' . getAvatar($value['uid'], 's') . '"></a></div>' . '<div class="chat_text">' . '<div><span class="chat_nickname" onclick="chatNickname(\'' . $value['uName'] . '\');">' . $value['uName'] . '</span> <span class="chat_time">' . printTime($value['time']) . '</span></div>' . '<div>' . $value['message'] . '</div>' . '</div>' . '</div>'; setSession('chat_lmid', $value['id']); } } ?> </div> <script> var height = winH()-450; if (height < 400)
<div class="box"> <h1>{L:GUESTS_TITLE}</h1> <?php echo '<div>24h: ' . $this->online24h . '</div>'; echo '<div>Google: ' . $this->google->num_rows . '</div>'; echo '<div>Bing: ' . $this->bing->num_rows . '</div>'; echo '<hr/>'; echo '<table class="case-table">' . '<tr>' . '<th>{L:GUESTS_IP}</th>' . '<th>{L:GUESTS_BROWSER}</th>' . '<th>{L:GUESTS_REFERER}</th>' . '<th>{L:GUESTS_COUNT}</th>' . '<th>{L:GUESTS_TIME}</th>' . '</tr>'; while ($list = mysqli_fetch_object($this->list)) { echo '<tr>' . '<td>' . $list->ip . '</td>' . '<td>' . $list->browser . '</td>' . '<td>' . $list->referer . '</td>' . '<td>' . $list->count . '</td>' . '<td>' . printTime($list->time) . '</td>' . '</tr>'; } echo '</table>'; ?> </div>
public function get_chatAction() { if (empty($_SERVER['HTTP_X_REQUESTED_WITH'])) { error404(); } $model = new ProfileModel(); $dialog = ''; $mid = post('mid', 'int'); $sesMID = getSession('match_' . $mid, false); if ($mid == $sesMID) { $lastMessageID = getSession('match_chat_lid' . $sesMID, false); $listMessage = $model->getChatMessages($sesMID, $lastMessageID); while ($list = mysqli_fetch_object($listMessage)) { $value = (array) $list; $dialog .= '<div class="chat_message">' . '<div class="chat_img"><a href="' . url($value['uid']) . '" target="_blank"><img src="' . getAvatar($value['uid'], 's') . '"></a></div>' . '<div class="chat_text">' . '<div><span class="chat_nickname" onclick="chatNickname(\'' . $value['uName'] . '\');">' . $value['uName'] . '</span> <span class="chat_time">' . printTime($value['time']) . '</span></div>' . '<div>' . $value['message'] . '</div>' . '</div>' . '</div>'; setSession('match_chat_lid' . $sesMID, $list->id); } unset($list); $response['error'] = 0; $response['target_a']['#dialog'] = $dialog; } echo json_encode($response); exit; }
<div class="box_right"> <?php if ($this->rightList->num_rows > 0) { while ($list = mysqli_fetch_object($this->rightList)) { $count = false; if ($list->uid1 == Request::getParam('user')->id) { $user = $list->uid2; if ($list->countMsg1 > 0) { $count = '<div class="mail_count">+' . $list->countMsg1 . '</div>'; } } else { $user = $list->uid1; if ($list->countMsg2 > 0) { $count = '<div class="mail_count">+' . $list->countMsg2 . '</div>'; } } echo '<div class="mail_box mail_link">' . '<a href="{URL:mail' . $user . '}"></a>' . $count . '<div class="mail_image"><img src="' . getAvatar($user, 's') . '"></div>' . '<div class="mail_name">' . $list->nickname . '</div>' . '<div class="mail_msg"><span class="mail_time">' . printTime($list->time) . '</span></div>' . '</div>'; } } else { echo '{L:INDEX_NO_DIALOGS}'; } ?> </div>
<div class="box"> <h1>{L:USERSTAT_TITLE}</h1> <?php echo '<div>{L:USERSTAT_USERS} ({L:USERSTAT_USERS_ALL} / {L:USERSTAT_USERS_24H} / {L:USERSTAT_USERS_ON}): ' . $this->count . ' / ' . $this->count24h . ' / ' . $this->list->num_rows . '</div><hr/>'; echo '<table class="case-table">' . '<tr>' . '<th>{L:USERSTAT_NICKNAME}</th>' . '<th>{L:USERSTAT_ELO}</th>' . '<th>{L:USERSTAT_WINS}</th>' . '<th>{L:USERSTAT_LOSSES}</th>' . '<th style="width: 60px;">{L:USERSTAT_TIME}</th>' . '</tr>'; while ($list = mysqli_fetch_object($this->list)) { echo '<tr>' . '<td><a href="{URL:' . $list->id . '}">' . $list->nickname . '</a></td>' . '<td>' . $list->elo . '</td>' . '<td>' . $list->wins . '</td>' . '<td>' . $list->losses . '</td>' . '<td>' . printTime($list->dateLast, "H:i:s") . '</td>' . '</tr>'; } echo '</table>'; ?> </div>
fclose($fp); */ // /* $fp = fopen("@db_s_{$a}.sql", "r"); $query_search .= fread($fp, filesize("@db_s_{$a}.sql")); fclose($fp); // */ } echo "입력중...<br />"; flush(); checkTime("query"); //mysql_query($query_board) or die(mysql_error()); mysql_query($query_search) or die(mysql_error()); checkTime("query"); echo "all complete!!"; printTime(1); exit; ?> <?php exit; iss($_GET['start']); def($start, $_GET['start']); def($start, 1); $count = 50000; $start_num = 16000000 - ($start - 1) * $count; if ($start_num == 16000000) { $query_board = "INSERT INTO m_board_test (num, title, ment, category, tag) VALUES ";
<a class="btn" href="{URL:profile/read_all_notice}" style="float: right;">{L:NOTICE_READ_ALL}</a> <h1>{L:NOTICE_TITLE}</h1> <table class="case-table"> <tr> <th style="width: 150px;">{L:NOTICE_TIME}</th> <th>{L:NOTICE_MESSAGE}</th> <th style="width: 150px;">{L:NOTICE_ACTION}</th> </tr> <?php while ($list = mysqli_fetch_object($this->list)) { echo '<tr ' . ($list->read == 0 ? 'class="gray"' : '') . '>' . '<td style="font-size: 12px;">' . printTime($list->time, "H:i / m.d.Y") . '</td>' . '<td style="font-size: 12px;">' . reFilter($list->text) . '</td>' . '<td>'; if ($list->read == 0) { echo '<div id="nt' . $list->id . '"><div class="btn" onclick="' . ajaxLoad(url('profile', 'read_notice'), 'read_notice', 'id:' . $list->id) . ' delClass(this);">{L:NOTICE_READ}</div></div>'; } else { echo '-'; } echo '</td>'; echo '</tr>'; } ?> </table> <?php echo '<div class="pagin">' . Pagination::printPagination() . '</div>';
$subject->select($info['subject']); ?> </select><br><br> <label for="duration">Duration:</label><br><br> <select name="minutes"> <?php $minutes = (int) ($info['duration'] / 60); printTime($minutes); ?> </select>: <select name="seconds"> <?php $seconds = (int) ($info['duration'] % 60); printTime($seconds); ?> </select> (minutes:seconds) <br><br> <label for="comments">Comments:</label><br><br> <textarea id="comments" type="text" name="comments"><?php echo $info['comments']; ?> </textarea><br><br> <label for="mail">E-mail:</label><br><br> <input type="text" id="mail" name="mail" value="<?php echo $info2['mail']; ?>
if ($this->profile->iSport) { echo '<div class="profileRowInfo">' . Lang::translate('INDEX_FAVORITES_SPORT') . ': ' . $this->profile->iSport . '</div>'; } echo '</div>'; echo '<div class="pHr"></div>'; echo '<div class="pr_block left">'; // Referral echo '<div class="pTitle">' . Lang::translate('INDEX_INVITE') . '</div>'; echo '<div class="profileRowInfo">' . Lang::translate('INDEX_REFERRAL') . ': ' . $this->ref_count . '</div>'; // Reg code if (Request::getParam('user')->id && Request::getParam('user')->id == $this->profile->id) { echo '<div><a onclick="' . ajaxLoad(url('profile', 'regcode'), 'reg_code') . '">' . Lang::translate('INDEX_GET_REG_CODE') . '</a>: <span id="reg_code"></span></div>'; } echo '</div>'; echo '<div class="pr_block right">'; // Info echo '<div class="pTitle">' . Lang::translate('INDEX_INFO') . '</div>'; echo '<div class="profileRowInfo">' . Lang::translate('INDEX_LAST_VISIT') . ': ' . printTime($this->profile->dateLast) . '</div>'; echo '<div class="profileRowInfo">' . Lang::translate('INDEX_DATE_REG') . ': ' . printTime($this->profile->dateReg) . '</div>'; echo '</div>'; echo '<div class="pHr"></div>'; echo '<div class="merits">'; if ($this->profile->steamid) { echo '<div><img src="' . _SITEDIR_ . 'public/images/img/steamverie.jpg" title=""></div>'; } if ($this->profile->role != 'guest' && $this->profile->role != 'claim') { echo '<div><img src="' . _SITEDIR_ . 'public/images/img/verifieduser.jpg" title=""></div>'; } echo '</div>'; echo '</div>'; echo '<div class="clear"></div>';
<button type="submit" name="litter" class="button">GO!</button> </form> </div> <?php print '<div id="profile">'; print getProfilePic($get['user_id'], '150px'); print '<br>'; print '<h2>' . $get['f_name'] . ' ' . $get['l_name'] . '</h2>'; print '<h3> ' . $get['username'] . '</h3>'; isOnline($get['active']); if (!$get['active']) { print '<p>(Last here: ' . printTime($get['last_in']) . ')</p>'; } /* FOLLOW */ $following = getFollowing($get['user_id']); $followers = getFollowers($get['user_id']); if ($sess['user_id'] !== $get['user_id']) { if (checkFollowing($sess['user_id'], $get['user_id'])) { print '<form method="POST"> <input type="hidden" name="id" value="' . $get['user_id'] . '"> <button type="submit" name="unfollow" class="button">Unfollow</button> </form>'; } else { print '<form method="POST"> <input type="hidden" name="id" value="' . $get['user_id'] . '"> <button type="submit" name="follow" class="button">Follow</button> </form>';
function getPagesDetailsZoom($categoryAsked = '') { $this->objects['category'] = new ArchiveTable('category'); $this->objects['page'] = new ArchiveTable('page'); $this->objects['file'] = new ArchiveTable('file'); $this->objects['vars_name'] = new ArchiveTable('vars_name'); $this->objects['vars_value'] = new ArchiveTable('vars_value'); $nbVis = $this->getContent('nb_vis'); // printDebug($all); exit; if ($this->archive->periodType === DB_ARCHIVES_PERIOD_DAY) { $nbLast = 15; } else { $nbLast = 3; } $archives = $this->getLastArchives($nbLast, 1, DATE_NORMAL); printTime('beg 1 of pages details'); $i = 0; // load "pure" pages array foreach ($archives as $dateToDisplay => $archive) { printTime('foreach' . ++$i . ' of pages details'); $o_data = new DataModel($archive, $this->request); $displayInfo[] = $dateToDisplay; printTime('before uz' . $i . ' of pages details'); if (STORE_PAG_ARRAY_IN_FILE) { $file = INCLUDE_PATH . "/datas/archives/" . $o_data->infoSerialized['idarchives'] . ".dat"; if (!is_readable($file)) { saveConfigFile($file, unserialize($o_data->infoSerialized['vis_pag_grp']), 'visPagGrp'); } if (is_readable($file)) { $visPagGrp = array(); require_once $file; $array = $visPagGrp; } } else { $visPagGrp = array(); if (!is_null($o_data->infoSerialized['vis_pag_grp'])) { $visPagGrp = $o_data->getContent('vis_pag_grp'); } } //var_dump($visPagGrp);exit; $a_all[] = $visPagGrp; printTime('after uz' . $i . ' of pages details'); $headerInfo[] = array('nb_pag' => $o_data->getContent('nb_pag'), 'nb_uniq_pag' => $o_data->getContent('nb_uniq_pag'), 'nb_max_pag' => $o_data->getContent('nb_max_pag')); //printDebug($headerInfo); } printTime('beg 2 of pages details'); foreach ($a_all as $j => $all) { if (empty($categoryAsked)) { $a_infosDay[$j] = $all; $level = 0; } else { $categoryAsked = (string) $categoryAsked; //print("Zoom cate '$categoryAsked' <br>"); //print($categoryAsked[2]); $detailsCategory = explode(">", $categoryAsked); //printDebug($detailsCategory); $level = sizeof($detailsCategory); //print("level : $level <br>"); $array = $this->getPagesDetailsZoomArrayLevel($all, $level, $detailsCategory); $a_infosDay[$j] = $array; } } printTime('mid of pages details'); // list asked category if ($level != 0) { $categoryAsked .= '>'; } // var_dump($categoryAsked); // var_dump($a_infosDay[0]); $return = array(); if (is_array($a_infosDay[0])) { //var_dump($a_infosDay[0]); foreach ($a_infosDay[0] as $currentId => $info) { // page or file or category, but not total if ($currentId != 'p_pmv_sum' && $currentId != 'f_pmv_sum') { $id = ''; $parentId = ''; $data = ''; $sum = 0; $sumN1 = 0; $sumN2 = 0; $percentN1 = 0; $percentN2 = 0; $type = ''; $entry = 0; $sumtime = 0; $exit = 0; $singlepage = 0; $a_vars = array(); // category if (substr($currentId, 0, 1) === 'c') { $type = 'category'; $entry = @$info['p_pmv_sum'][ARRAY_INDEX_ENTRYPAGE]; $exit = @$info['p_pmv_sum'][ARRAY_INDEX_EXITPAGE]; $sum = @$info['p_pmv_sum'][ARRAY_INDEX_COUNT] + @$info['f_pmv_sum'][ARRAY_INDEX_COUNT]; $sumtime = @$info['p_pmv_sum'][ARRAY_INDEX_TIME_TOTAL]; $singlepage = @$info['p_pmv_sum'][ARRAY_INDEX_PAGES_VISIT_ONEPAGE]; $allInfoInGroup = $this->getPagesDetailsZoomArrayLevel($a_infosDay[0], 1, array($currentId)); //var_dump($allInfoInGroup);exit; //$a_vars = $this->getVarIdToName($a_infosDay[0]['p_pmv_sum'][ARRAY_INDEX_VARS]); $a_vars = $this->getVarIdToName(@$allInfoInGroup['p_pmv_sum'][ARRAY_INDEX_VARS]); //var_dump($a_vars); if (isset($a_infosDay[1][$currentId]['p_pmv_sum'][ARRAY_INDEX_COUNT])) { $sumN1 = $a_infosDay[1][$currentId]['p_pmv_sum'][ARRAY_INDEX_COUNT] + @$a_infosDay[1][$currentId]['f_pmv_sum'][ARRAY_INDEX_COUNT]; } $percentN1 = $this->getDiffPercent($sum, $sumN1); if (isset($a_infosDay[2][$currentId]['p_pmv_sum'][ARRAY_INDEX_COUNT])) { $sumN2 = $a_infosDay[2][$currentId]['p_pmv_sum'][ARRAY_INDEX_COUNT] + @$a_infosDay[2][$currentId]['f_pmv_sum'][ARRAY_INDEX_COUNT]; } $percentN2 = $this->getDiffPercent($sum, $sumN2); $id = $categoryAsked . $currentId; if ($level != 0) { $parentId = substr($categoryAsked, 0, strlen($categoryAsked) - 1); } else { $parentId = "root"; } $data = @$info[ARRAY_INDEX_IDCATEGORY]; //if($data != -1) // $toLoad['category'][] = $data; } else { if (substr($currentId, 0, 1) === 'p') { //print("pages = ".$currentId); $type = 'page'; $id = $currentId; //printDebug($info); if (!isset($info[ARRAY_INDEX_COUNT])) { $info[ARRAY_INDEX_COUNT] = 0; } $sum = @$info[ARRAY_INDEX_COUNT]; $entry = @$info[ARRAY_INDEX_ENTRYPAGE]; $exit = @$info[ARRAY_INDEX_EXITPAGE]; $sumtime = @$info[ARRAY_INDEX_TIME_TOTAL]; $singlepage = @$info[ARRAY_INDEX_PAGES_VISIT_ONEPAGE]; if (isset($info[ARRAY_INDEX_VARS])) { $a_vars = $this->getVarIdToName($info[ARRAY_INDEX_VARS]); } // Period-1 if (isset($a_infosDay[1][$currentId][ARRAY_INDEX_COUNT])) { $sumN1 = $a_infosDay[1][$currentId][ARRAY_INDEX_COUNT]; } $percentN1 = $this->getDiffPercent($sum, $sumN1); // Period -2 if (isset($a_infosDay[2][$currentId][ARRAY_INDEX_COUNT])) { $sumN2 = $a_infosDay[2][$currentId][ARRAY_INDEX_COUNT]; } $percentN2 = $this->getDiffPercent($sum, $sumN2); // Name if (!isset($info[ARRAY_INDEX_IDPAGE])) { //print("Problem, please report this error message :"); //var_dump($info); $data = -1; } else { $data = $info[ARRAY_INDEX_IDPAGE]; } //print("$data : ".$sumtime . "<br>"); } else { if (substr($currentId, 0, 1) === 'f') { $type = 'file'; $id = $currentId; $sum = $info[ARRAY_INDEX_COUNT]; // Period-1 //print("idfile=$currentId<br>"); if (isset($a_infosDay[1][$currentId][ARRAY_INDEX_COUNT])) { $sumN1 = $a_infosDay[1][$currentId][ARRAY_INDEX_COUNT]; } $percentN1 = $this->getDiffPercent($sum, $sumN1); // Period -2 if (isset($a_infosDay[2][$currentId][ARRAY_INDEX_COUNT])) { $sumN2 = $a_infosDay[2][$currentId][ARRAY_INDEX_COUNT]; } $percentN2 = $this->getDiffPercent($sum, $sumN2); // Name $data = $info[ARRAY_INDEX_IDPAGE]; } else { // this is related to the ARRAY_INDEX_IDCATEGORY //print("Whats that? Report it to phpmyvisites forums: "); //print($currentId); } } } if (!empty($data) && !empty($type) && $sum > 0) { $return[] = array('type' => $type, 'sum' => $sum, 'sumn1' => $sumN1, 'sumn2' => $sumN2, 'percentn1' => $percentN1, 'percentn2' => $percentN2, 'data' => $data, 'id' => $id, 'parentid' => $parentId, 'entry' => $entry, 'exit' => $exit, 'sumtime' => $sumtime, 'avgtime' => round($sumtime / $sum), 'exitrate' => 100 * $exit / $sum, 'singlepage' => $singlepage, 'vars' => $a_vars); } } } printTime('end of pages details'); $GLOBALS['sorting_index'] = 'sum'; uasort($return, "sortingDataInfo"); return array($displayInfo, $return, $headerInfo); } return false; }
/** * Big job, assign all vars... * Too much vars, those tasks should be splitted into more atomic methods * * @param object o_site * @param object o_data * @param object request * * @return void */ function processDatas(&$o_site, &$o_data, $request = null) { $ctrl =& ApplicationController::getInstance(); if (is_null($request)) { $o_request =& $ctrl->getRequest(); } else { $o_request =& $request; } $o_lang =& $ctrl->getLang(); if (!is_a($o_data, "DataModel")) { //trigger_error("\$o_data is not an object DataModel! Maybe its because this is not a //ViewModule and so you don't really need DataModel, you have to do without it..."); } printTime('Begin Smarty display'); /* * @todo , extact this from method!! */ $ajax_views = array("common/data_array_details.tpl", "common/data_array_interest.tpl", "common/data_array.tpl"); // Add path to theme $this->assign("PMV_THEME", $this->template_dir[0]); $this->assign("PMV_THEME_DEFAULT", $this->template_dir[1]); $this->assign("PMV_STAT_ID_SITE", PMV_STAT_ID_SITE); $this->assign("PMV_STAT_SAVE_USER", PMV_STAT_SAVE_USER); // case we load a subtemplate with AJAX if (in_array($this->template, $ajax_views)) { $this->mainTemplate = $this->template; } elseif ($o_request->isCategoryZoom()) { $this->mainTemplate = "common/viewpages_details.tpl"; // printDebug($this->get_template_vars( "zoom")); $t = $this->get_template_vars("zoomsorted"); //printDebug($t); $this->assign("zoom", $t); } else { // case there are no visit for this period if (is_a($o_data, "DataModel") && $o_request->getModuleName() !== 'view_sites_summary' && $o_data->getContent('nb_vis') == 0) { $this->setTemplate("common/error.tpl"); if ($o_request->getModuleName() !== 'view_visits_rss') { $this->assign("error_message_bis", sprintf($GLOBALS['lang']['generique_help_novisits'], "<a href='index.php?mod=admin_site_javascript_code'>", "</a>")); } } // assign period, used in pages table to print the period text $this->assign("period", $o_request->getPeriod()); if (is_a($o_site, 'Site')) { // compute and assign calendar $o_dasked = new Date($o_request->getDate()); $o_minDay = $o_site->getMinDay(); if ($o_dasked->getTimestamp() < $o_minDay->getTimestamp()) { $s_dateAsked = $o_minDay->get(); } else { $s_dateAsked = $o_dasked->get(); } $a_calendar = getTemplateArrayCalendar($o_minDay, $s_dateAsked, $o_request->getPeriod()); $this->assign("calendar", $a_calendar); // first day letters for calendar first line if (!defined('MONDAY_FIRST') || MONDAY_FIRST == 'yes') { $dayFirstLetter = $GLOBALS['lang']['calendrier_jours']; } else { for ($i = 0; $i < 7; $i++) { $dayFirstLetter[$i == 6 ? 0 : $i + 1] = $GLOBALS['lang']['calendrier_jours'][$i]; } ksort($dayFirstLetter); } $this->assign("day_first_letter", $dayFirstLetter); // litteral date for display below the menu $this->assign("date_litteral", getLiteralDate($o_request->getPeriod(), $s_dateAsked)); $this->assign("date_ask", $s_dateAsked); // months info for SELECT months generation $months_info = getTemplateArrayMonth($o_site->getMinDay(), $o_request); $this->assign("months_available", $months_info[0]); $this->assign("month_selected", $months_info[1]); // sites info for SELECT sites generation $this->assign("sites_view_available", $o_site->getAllowedSites('view')); $this->assign("sites_admin_available", $o_site->getAllowedSites('admin')); $this->assign("site_selected", $o_request->getSiteId(false)); $this->assign("site_selected_name", $o_site->getName()); // pdf list $pdfConf = new PdfConfigDb($o_request->getSiteId(false), true); $this->assign("site_pdf_list", $pdfConf->getListPdf()); } // langs info for SELECT langs generation $this->assign("langs_available", $o_lang->getArrayLangs()); $this->assign("lang_selected", $o_lang->getFileName()); // require menu definition and assign for menu display $menu = array(); if (is_file(INCLUDE_PATH . '/themes/' . THEME . '/datas/MenuDefinition.php')) { require INCLUDE_PATH . '/themes/' . THEME . '/datas/MenuDefinition.php'; } else { require INCLUDE_PATH . '/themes/' . THEME_DEFAULT . '/datas/MenuDefinition.php'; } //require INCLUDE_PATH . "/core/include/MenuDefinition.php"; // Add plugin menus $installedPlugin = new PmvConfig("plugin.php", false); foreach ($installedPlugin->content as $key => $value) { // Load lang for plugin if (isset($value['langPath']) && $value['langPath'] != "") { Lang::addPluginLangFile($key . "/" . $value['langPath'], $value['defaultLang']); } if ($value['type'] == "menu") { // Set plugin in menu list $menuModName = $value['menuModName']; for ($i = 0; $i < count($menu); $i++) { if ($menu[$i]['modname'] == $menuModName) { $menu[$i]['plugins'][$key] = $value; } } } } $this->assign("menu", $menu); // To select menu $this->assign("page", $o_request->getModuleName()); } // interest sorting info if (is_a($o_data, "DataModel")) { //printDebug($o_request->getArrayInfoSort( $o_data->arraySumInfo)); $this->assign("info_sort", $o_request->getArrayInfoSort($o_data->arraySumInfo)); } /** * display a previous assigned template variable */ //printDebug($this->get_template_vars( "countries")); // url with main variables $this->assign("url", $o_request->getUrl()); // current exact url $this->assign("url_current", $o_request->getCurrentUrl()); // url without offset info $this->assign("url_offset", $o_request->getUrl('offset')); // url without interest info $this->assign("url_a_int_sort", $o_request->getUrl('a_int_sort')); $this->assign("url_a_exit_sort", $o_request->getUrl('a_exit_sort')); $this->assign("url_a_entry_sort", $o_request->getUrl('a_entry_sort')); // url without module $this->assign("url_mod", $o_request->getUrl(array('mod', 'a_int_sort'))); // url without site $this->assign("url_site", $o_request->getUrl('site')); // url without date $this->assign("url_date", $o_request->getUrl('date')); // url without period $this->assign("url_period", $o_request->getUrl('period')); // url without lang // $this->assign("url_lang", Request::getCurrentCompleteUrl()); $this->assign("url_lang", $o_request->getUrl('lang')); // url without mod & site, used for summary SELECT choice (because we change mod=viewsummary and site=-1) $this->assign("url_mod_site", $o_request->getUrl(array('mod', 'a_int_sort', 'site'))); $this->assign("url_pages_details", $o_request->getUrl('mod_sort_means_details')); // if there is an "error" message to print in red if (isset($GLOBALS['content_message_tpl'])) { // assign the message $this->assign("content_message", $GLOBALS['content_message_tpl']); // and the content template, error.tpl which will print in red the message $this->setTemplate('common/error.tpl'); } // assign an header message (archive ok, archive temp, etc.) $this->assign("header_message", $GLOBALS['header_message_tpl']); // assign an error header message $this->assign("header_error_message", $GLOBALS['header_error_message_tpl']); // assign text direction info (rtl, ltr) $this->assign("dir", $GLOBALS['lang']['text_dir']); // assign footer info //$time = getMicrotime()-$GLOBALS['time_start']; //$this->assign("generation_time", $time); //$this->assign("query_count", $GLOBALS['query_count']); // image dir //$this->assign("img_dir", DIR_IMG_THEMES); $this->assign("img_dir", $this->template_dir . "images/"); // links for the documentation $this->assign("link_doc", array(HREF_DOC_OPEN, HREF_DOC_CLOSE)); // phpmyvisites version to print in meta and footer $this->assign("PHPMV_VERSION", PHPMV_VERSION); $this->assign("PHP_VERSION_NEEDED", PHP_VERSION_NEEDED); $this->assign("PARAM_URL_NEWSLETTER", PARAM_URL_NEWSLETTER); $this->assign("PARAM_URL_PARTNER", PARAM_URL_PARTNER); //should we include internal stats in the application footer if (defined('INTERNAL_STATS') && INTERNAL_STATS == 1) { $this->assign('internal_stats', true); } $user =& User::getInstance(); $this->assign('user_alias', $user->getAlias()); $this->assign('user_login', $user->getLogin()); $this->assign('user_is_su', $user->suPermission); $this->assign('user_is_admin_site', $user->isSiteAllowedAdmin($o_request->getSiteId(false))); $this->assign("rss_hash", $user->getRssHash()); $this->assign('a_link_phpmv', array('<a class="bleu" link="web statistics" href="http://www.phpmyvisites.us/">', '</a>')); $this->assign("contentpage", $this->template); printTime('After Smarty pre computing'); }
<?php /* * phpMyVisites : website statistics and audience measurements * Copyright (C) 2002 - 2006 * http://www.phpmyvisites.net/ * phpMyVisites is free software (license GNU/GPL) * Authors : phpMyVisites team */ // $Id: index.php 220 2007-06-27 10:01:07Z matthieu_ $ define('INCLUDE_PATH', '.'); define('PLUGINS_PATH', INCLUDE_PATH . "/plugins/"); // For profiling, XDEBUG 2.x generates .out to be analysed with KcacheGrind or WinCacheGrind @set_time_limit(0); @error_reporting(E_ALL); require_once INCLUDE_PATH . '/core/include/PmvConfig.class.php'; require_once INCLUDE_PATH . '/core/include/ApplicationController.php'; ApplicationController::init(); if (Request::moduleIsNotAStrangeModule()) { printTime('EOF', PRINT_TIME); }
<input type="text" name="comment" value="' . $post['username'] . '"> <input type="submit" name="postComment" value="Reply" class="button"> </form> </div>'; /*END REPLY_FORM*/ print '<br></div>'; $comments = getComment($post['post_id']); if (!empty($comments)) { print '<div class="postit"><ul>'; foreach ($comments as $comments) { print '<li>'; /*DELETE_BUTTON*/ if ($sess['user_id'] == $comments['user_id']) { print '<div class="del_post">'; print '<form method="POST" action="#' . $post['post_id'] . '"> <input type="hidden" name="post_id" value="' . $comments['post_id'] . '"> <button type="submit" name="del_comment"><img src="img/trashicon.png"></button> </form>'; print '</div>'; } /*END DELETE_BUTTON*/ /*COMMENT*/ print '<h3> ' . atLink($comments['username']) . ':</h3>'; print '<p>' . atLink($comments['post']) . '</p>'; print '<p class="time_stamp">' . printTime($comments['time_stamp']) . '</p>'; print '</li>'; } print '</ul></div> <div class="clearfix"></div>'; } } }
function printForumHtmlRow($file, $label, $values, $odd) { if ($odd) { fprintf($file, '<tr style="background-color: #EEE;">'); } else { fprintf($file, '<tr>'); } fprintf($file, "<td>" . $label . "</td>" . "<td>" . $values['logins'] . "</td>" . "<td>" . printTime($values['soloTime']) . "</td>" . "<td>" . printTime($values['groupTime']) . "</td>" . "<td>" . $values['meetingCount'] . "</td>" . "</tr>\n"); }
<h1>NEWS</h1> <?php if ($this->newsList) { echo '<h1>{L:MAIN_TITLE}</h1>'; echo '<div>'; while ($news = mysqli_fetch_object($this->newsList)) { $length = mb_strlen($news->text); if ($length > 300) { $text = mb_substr($news->text, 0, 300) . '...'; } else { $text = $news->text; } echo '<div class="news">' . '<div class="lnName"><a href="{URL:main/read/' . $news->id . '}">' . $news->name . '</a> <span>/ ' . printTime($news->time, "m.d.Y") . '</span></div>' . '<div>' . $text . '</div>' . '<div class="lnInfo">' . '<div class="lnNote">' . '</div>'; if (is_file(_SYSDIR_ . 'public/news/' . $news->id . '.png')) { echo '<div><img src="' . _SITEDIR_ . 'public/news/' . $news->id . '.png" height="300"></div>'; } echo '</div>' . '</div>'; } echo '</div>'; echo '<div class="pagin">' . Pagination::printPagination() . '</div>'; } else { echo '<h1>' . $this->news->name . '</h1>'; echo '<div class="news">' . '{L:MAIN_DATE}: <span>' . printTime($this->news->time, "m.d.Y") . '</span>' . '<div>' . $this->news->text . '</div>'; if (is_file(_SYSDIR_ . 'public/news/' . $this->news->id . '.png')) { echo '<div><img src="' . _SITEDIR_ . 'public/news/' . $this->news->id . '.png" height="300"></div>'; } echo '</div>'; }
public function search_usersAction() { if (empty($_SERVER['HTTP_X_REQUESTED_WITH'])) { error404(); } $model = new AdminModel(); $response['target_h']['#listing'] = ''; $response['error'] = 0; $uid = post('__uid', 'int'); $nickname = post('__nickname'); $steamid = post('__steamid', 'int'); $role = post('__role'); $page = post('page'); $count = $model->countSearchUsers($uid, $nickname, $steamid, $role); Pagination::calculate($page, 10, $count); $result = $model->searchUsers($uid, $nickname, $steamid, $role, Pagination::$start, Pagination::$end); while ($list = mysqli_fetch_object($result)) { if ($list->role == 'ban' && ($list->banRange == '0' or $list->banRange + $list->banDate > time())) { if ($list->banRange == '0') { $banTime = '(' . Lang::translate('USERS_BAN_FOREVER') . ')'; } else { $banTime = '(' . Lang::translate('USERS_BAN_TO') . ' ' . printTime($list->banRange + $list->banDate, "H:i / m.d.Y") . ')'; } $banned = '<div class="usersBanned">' . Lang::translate('USERS_BANNED') . ' ' . $banTime . '</div>'; $banned .= '<div class="usersReason">' . $list->banComment . '</div>'; } else { $banned = ''; } if ($list->role == 'moder' or $list->role == 'admin') { $role = ' <span class="usersRole">(' . $list->role . ')</span>'; } else { $role = ''; } if ($list->role == 'user' or $list->role == 'claim') { $btn = '<dib class="usersBtn btn" onclick="' . ajaxLoad(url('admin', 'ban'), 'process', 'id:' . $list->id . '|height:\'+winH()+\'|width:\'+winW()+\'', 'openPopup') . '">' . Lang::translate('USERS_BAN') . '</dib>'; } else { $btn = ''; } $response['target_h']['#listing'] .= '<div class="usersRow">' . '<div class="usersImage"><a href="' . url($list->id) . '" target="_blank"><img src="' . getAvatar($list->id, 'm') . '"></a></div>' . '<div class="usersInfo">' . '<div class="usersName"><a href="' . url($list->id) . '">' . $list->nickname . '</a><span class="level-icon">' . $list->level . '</span> <span>ID:' . $list->id . '</span>' . $role . '</div>' . '<div class="usersRes"></div>' . '<div class="usersAction">' . '<div class="usersActionEl">' . $banned . $btn . '</div>' . '</div>' . '</div>' . '</div>'; } $ajaxPag['href'] = '#'; $ajaxPag['url'] = url('admin', 'search_users'); $ajaxPag['permit'] = 'process'; $ajaxPag['fields'] = '#uid!|#nickname!|#steamid!|#role!|'; $response['target_h']['#listing'] .= '<div class="pagin">' . Pagination::ajaxPagination(2, 'span', $ajaxPag) . '</div>'; echo json_encode($response); exit; }
<?php $subject = new subject(); $subject->select(); ?> </select><br><br> <label for="duration">Duration:</label><br><br> <select name="minutes"> <?php printTime(); ?> </select>: <select name="seconds"> <?php printTime(); ?> </select> (minutes:seconds) <br><br> <label for="comments">Comments:</label><br><br> <textarea id="comments" type="text" name="comments"></textarea><br><br> <label for="mail">E-mail:</label><br><br> <input type="text" id="mail" name="mail" /> <input type="button" value="Check" onclick="checkMail(mail.value)"/><br><br> <script type="text/javascript"> $(document).ready(function() { $('#customer').hide(); //$('#button').hide();
public function getAction() { if (empty($_SERVER['HTTP_X_REQUESTED_WITH'])) { error404(); } $model = new MailModel(); $hash = post('__hash'); $dialog = getSession($hash); $messages = ''; if (!$dialog['did']) { $response['error'] = 'There is no dialogue'; echo json_encode($response); exit; } $data['countMsg' . $dialog['pos']] = '0'; $model->update('dialog', $data, "`id` = '" . $dialog['did'] . "'"); $lastMessageID = getSession('mail_last_message' . $dialog['did'], false); $mailList = $model->getMessages($dialog['did'], 'ASC', $lastMessageID); if ($mailList) { foreach ($mailList as $value) { //$objVal = (object)$value; $messages .= '<div class="chat_message">' . '<div class="chat_img"><a href="' . url($value['uid']) . '" target="_blank"><img src="' . getAvatar($value['uid'], 's') . '"></a></div>' . '<div class="chat_text">' . '<div><span class="chat_nickname">' . $value['name'] . '</span> <span class="chat_time">' . printTime($value['time']) . '</span></div>' . '<div>' . $value['message'] . '</div>' . '</div>' . '</div>'; setSession('mail_last_message' . $dialog['did'], $value['id']); } } unset($chatList); $response['error'] = 0; $response['target_a']['#dialog'] = $messages; echo json_encode($response); exit; }