function pa_log_script_execution_time($at_start = FALSE) { global $pa_page_render_start; if (!isset(PA::$config->perf_log)) { return; } $post = array(); foreach ($_POST as $k => $v) { $post[] = urlencode($k) . "=" . urlencode($v); } $status_map = array(0 => "NORMAL", 1 => "ABORTED", 2 => "TIMEOUT", 3 => "ABORTED+TIMEOUT"); if ($at_start) { $msg = sprintf("%d\tstart\t%s\t%s\t%s\t%s\t%s\thttp://%s\t%s\t%s\t%s\t%s\n", posix_getpid(), PA::datetime(time(), 'long', 'short'), $_SERVER['REMOTE_ADDR'], @$_SERVER['HTTP_X_FORWARDED_FOR'], $status_map[connection_status()], $_SERVER['REQUEST_METHOD'], $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], $_SERVER['HTTP_USER_AGENT'], implode("&", $post), @$_SESSION['user']['id'], @$_SESSION['user']['name']); } else { $msg = sprintf("%d\t%.2f\n", posix_getpid(), microtime(TRUE) - $pa_page_render_start); } error_log($msg, 3, PA::$config->perf_log); }
echo uihelper_resize_mk_img($post->user->picture, 35, 35, "images/default.png", 'alt="Picture of the forum owner."'); ?> </a> </div> <div> <a href="<?php echo $forums_url . "&thread_id={$thread_id}&post_id={$post_id}#p_{$post_id}"; ?> "><?php echo $post->get_title(24); ?> </a><br /> by: <a href="<?php echo PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $post->user->user_id; ?> "><?php echo $post->user->login_name; ?> </a> <p class="post_date"><?php echo PA::datetime(strtotime($post->get_created_at()), 'long', 'short'); ?> </p> </div> </div> <?php } ?> </div> </div>
function pageLoadGroup($group) { $access = $group->access_type; $skip_group_modules = FALSE; $is_admin = FALSE; if ($group->access_type == $group->ACCESS_PRIVATE) { if (PA::$login_uid) { //if private group if (GROUP::member_exists($group->collection_id, PA::$login_uid)) { $skip_group_modules = FALSE; } else { // haha no way for non member of group $skip_group_modules = TRUE; } } else { //haha no way for anonymous user $skip_group_modules = TRUE; } $access_type = 'Private'; } else { $access_type = 'Public'; } if ($group->reg_type == $group->REG_OPEN) { $access_type .= ' Open'; } else { $access_type .= ' Moderated'; } if (Group::is_admin((int) $group->collection_id, (int) PA::$login_uid)) { $is_admin = TRUE; } $members = $group->get_members($cnt = FALSE, 5, 1, 'created', 'DESC', FALSE); $group_details = array(); $group_details['collection_id'] = $group->collection_id; $group_details['type'] = $group->type; $group_details['author_id'] = $group->author_id; $user = new User(); $user->load((int) $group->author_id); $login_name = $user->login_name; $first_name = $user->first_name; $last_name = $user->last_name; $group_details['author_name'] = $login_name; $group_details['author_picture'] = $user->picture; $group_details['title'] = $group->title; $group_details['description'] = $group->description; $group_details['is_active'] = $group->is_active; $group_details['picture'] = $group->picture; $group_details['desktop_picture'] = @$group->desktop_picture; $group_details['created'] = PA::datetime($group->created, 'long', 'short'); // date("F d, Y h:i A", $group->created); $group_details['changed'] = $group->changed; $group_details['category_id'] = $group->category_id; $cat_obj = new Category(); $cat_obj->set_category_id($group->category_id); $cat_obj->load(); $cat_name = stripslashes($cat_obj->name); $cat_description = stripslashes($cat_obj->description); $group_details['category_name'] = $cat_name; $group_details['category_description'] = $cat_description; $group_details['members'] = Group::get_member_count($group->collection_id); $group_details['access_type'] = $access_type; $group_details['is_admin'] = $is_admin; //////////////////get details of group EOF if (is_array($members)) { $count = count($members); foreach ($members as $member) { $count_relations = Relation::get_relations($member['user_id'], APPROVED, PA::$network_info->network_id); $user = new User(); $user->load((int) $member['user_id']); $login_name = $user->login_name; $user_picture = $user->picture; $users_data[] = array('user_id' => $member['user_id'], 'picture' => $user_picture, 'login_name' => $login_name, 'no_of_relations' => count($count_relations)); } $final_array = array('users_data' => $users_data, 'total_users' => $count); } $users = $final_array; $is_member = Group::member_exists((int) $group->collection_id, (int) PA::$login_uid) ? TRUE : FALSE; $group_details['is_member'] = $is_member; $group_details['skip_group_modules'] = $skip_group_modules; $group_details['users'] = $users; return $group_details; }
/** * gives the date format for invitations. * @param int timestamp. */ function invitation_date($timestamp) { // return date("F d, Y H:i:s", $timestamp); return PA::datetime($timestamp, 'long', 'short'); }
<?php echo "<a href=\"" . PA::$url . PA_ROUTE_USER_PUBLIC . '/' . "{$ranked_user->user_id}\">" . uihelper_resize_mk_user_img($ranked_user->picture, 35, 35, "alt=\"{$ranked_user->display_name}\"") . "</a>"; ?> </td> <td class="ranking_name"> <a href="<?php echo PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $ranked_user->user_id; ?> "><?php echo $ranked_user->display_name; ?> </a> </td> <td class="ranking_date"> <?php echo !empty($ranked_user->last_activity) ? PA::datetime($ranked_user->last_activity, 'long', 'short') : __("unknown"); ?> </td> <td class="ranking_points"> <?php echo $ranked_user->ranking_points; ?> </td> <td class="ranking_stars"> <img src="<?php echo PA::$theme_url . '/images/' . $ranked_user->ranking_stars . '_star.gif'; ?> " alt="star" /> </td> </tr> <tr class="activities_ranking_row activities_ranking_<?php
$group_details['collection_id'] = $group->collection_id; $group_details['type'] = $group->type; $group_details['author_id'] = $group->author_id; $user = new User(); $user->load((int) $group->author_id); $first_name = $user->first_name; $last_name = $user->last_name; $login_name = $user->login_name; $group_details['author_name'] = $login_name; $group_details['author_picture'] = $user->picture; $group_details['title'] = $group->title; $group_details['description'] = $group->description; $group_details['is_active'] = $group->is_active; $group_details['picture'] = $group->picture; $group_details['desktop_picture'] = @$group->desktop_picture; $group_details['created'] = PA::datetime($group->created, 'long', 'short'); //date("F d, Y h:i A", $group->created); $group_details['changed'] = $group->changed; $group_details['category_id'] = $group->category_id; $cat_obj = new Category(); $cat_obj->set_category_id($group->category_id); $cat_obj->load(); $cat_name = stripslashes($cat_obj->name); $cat_description = stripslashes($cat_obj->description); $group_details['category_name'] = $cat_name; $group_details['category_description'] = $cat_description; $group_details['members'] = Group::get_member_count($gid); $group_details['access_type'] = $access_type; $group_details['is_admin'] = $is_admin; //////////////////get details of group EOF if (is_array($members)) {
/** * loads array of all content, that are supposed to be moderated * for network operator control, network content management * @access public * @param array params * @param array conditions * @return array content */ public static function load_all_content_for_moderation($params = NULL, $conditions = NULL) { Logger::log("Enter: Content::load_all_content_for_moderation() | Args: \$params = {$params}, \$conditions = {$conditions}"); $sql = "SELECT CT.name AS content_name, C.content_id, C.collection_id, C.title, C.body, C.type, C.author_id, C.changed, C.created, C.is_active FROM {contents} AS C, {content_types} AS CT WHERE 1 AND CT.type_id = C.type"; if (is_array($conditions)) { foreach ($conditions as $field_name => $field_value) { if (substr($field_name, 0, 1) == '!') { $sql = $sql . ' AND ' . substr($field_name, 1) . ' != ' . $field_value; } else { $sql = $sql . ' AND ' . $field_name . ' = ' . $field_value; } } } //paging variables if set $sort_by = isset($params['sort_by']) ? $params['sort_by'] : 'created'; $direction = isset($params['direction']) ? $params['direction'] : 'DESC'; $order_by = ' ORDER BY ' . $sort_by . ' ' . $direction; if (isset($params['page']) && isset($params['show']) && !isset($params['cnt'])) { $start = ($params['page'] - 1) * $params['show']; $limit = ' LIMIT ' . $start . ',' . $params['show']; } else { $limit = ""; } $sql = $sql . $order_by . $limit; $res = Dal::query($sql); if ($params['cnt']) { if ($res->numRows() > 0) { return $res->numRows(); } } $content_data = array(); // preparing array, that is to be returned if ($res->numRows()) { $i = 0; while ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) { try { $author = new User(); $author->load((int) $row['author_id']); if ($row['collection_id'] != -1) { $var = new ContentCollection(); $var->load((int) $row['collection_id']); $collection['title'] = $var->title; $collection['type'] = $var->type; } else { $collection = array(); } $content_data[$i] = array('content_id' => $row['content_id'], 'title' => $row['title'], 'body' => $row['body'], 'author_id' => $row['author_id'], 'type' => $row['content_name'], 'changed' => $row['changed'], 'created' => PA::datetime($row['created'], 'long', 'long'), 'author_name' => $author->display_name, 'content_type_id' => $row['type'], 'parent_info' => $collection, 'is_active' => $row['is_active'], 'type_name' => isset($row['name']) ? $row['name'] : ''); $i++; } catch (PAException $e) { // } } } Logger::log("Exit: Content::load_all_content_for_moderation()"); return $content_data; }
public function generate_group_links() { $group_info = NULL; // Retrive the group details $group_data = ContentCollection::load_collection($this->gid, NULL); $group_info['members'] = Group::get_member_count($this->gid); // Loading the Group owner $user = new User(); $user->load((int) $group_data->author_id); $group_info->created = PA::datetime($group->created, 'long', 'short'); //date("F d, Y h:i A", $group_data->created); $group_info->author_picture = $user->picture; $group_info->author_name = $user->login_name; $group_info->author_id = $group_data->author_id; $group_info->category_name = $group_data->category_name; $group_info->access_type = $group_data->reg_type == $group_data->REG_OPEN ? ' Open' : ' Moderated'; unset($user); unset($group_data); return $group_info; }
*/ ?> <h2><?= __("Event") ?>: <? echo _out($ed['event_title']); ?></h2> <div class="field_event" style="height:90px;"> <b><?=__("Event Banner")?></b><br /> <?php if (!empty($ed['banner'])) { ?> <?php echo uihelper_resize_mk_img($ed['banner'], 430, 80, NULL, 'alt="Current Event Banner"', RESIZE_FIT); ?> <? } ?> </div> <div class="field_event"> <b><?= __("Starts") ?></b>: <?=PA::datetime($ed['start_time'])?> </div> <div class="field_event"> <b><?= __("Ends") ?></b>: <?=PA::datetime($ed['end_time'])?> </div> <div class="field_event"> <b><?= __("Venue") ?>:</b>:<br /> <? echo _out($ed['event_venue']); ?> </div> <div class="field_event"> <b><?= __("Description") ?>:</b>:<br /> <? echo _out($ed['event_description']); ?> </div> <? if ($may_edit) { ?> <div class="button_position"> <input type="submit" name="edit" value="<?= __("Edit") ?>">
<td class="post_odd"> <div class='forum_post'> <?php echo $thread->get_content(); ?> </div> </td> </tr> <tr> <td class="post_date" width="<?php echo $avatar_size['width']; ?> "> <div class="smallfont"> <?php echo PA::datetime($thread->get_created_at(), 'long', 'short'); ?> </div> </td> <td class="buttons_panel" align="right"> <?php if (PA::$login_uid == $thread->get_user_id() && !($thread_status & PaForumThread::_locked)) { ?> <a href="<?php echo $forums_url . "&thread_id=" . $thread->get_id() . "&mode=thread" . "&action=edit"; ?> "> <img src="<?php echo $theme_url . "/images/buttons/" . PA::$language . "/modify.gif"; ?> " alt="modify" class="forum_buttons"/>
public function month($date, $event_assocs = NULL, $may_edit = false) { $calendar_url = $this->calendar_url; $self_url = $this->self_url; $range = Calendar::range($date, 'month'); $days = Calendar::days($range, $event_assocs); $today_ts = mktime(0, 0, 0, date("m"), date("d"), date("Y")); $thism_ts = $days[0]['date_ts']; // find on which day this month starts $first_week_day = date('w', $thism_ts); // header with Month and Year $html = "<ul class=\"" . $this->display_mode . "\">\n"; $html .= "<li class=\"calendarcell header\">\n"; $prevm_ts = mktime(0, 0, 0, date("m", $thism_ts) - 1, 1, date("Y", $thism_ts)); $nextm_ts = mktime(0, 0, 0, date("m", $thism_ts) + 1, 1, date("Y", $thism_ts)); $html .= "<a class=\"month-prev\" href=\"{$self_url}&date=" . date("Y-m-d", $prevm_ts) . "#calendar\" title=\"" . date("F Y", $prevm_ts) . "\"><</a>"; $html .= "<a name=\"calendar\" class=\"month-next\" href=\"{$self_url}&date=" . date("Y-m-d", $nextm_ts) . "#calendar\" title=\"" . date("F Y", $nextm_ts) . "\">></a>"; $html .= date("F Y", $thism_ts); $html .= "</li>\n"; // render dayheaders $fd = $this->first_day_of_week; $ld = $fd + 7; for ($i = $fd; $i < $ld; $i++) { if ($i > 6) { $d = $i - 7; } else { $d = $i; } $html .= "<li class=\"calendarcell dayheader\">\n"; $html .= $this->week_days[$d]; $html .= "</li>\n"; } $grid_count = 0; // render empty days at start of month if required if ($first_week_day < $fd) { $ed = 7 - $first_week_day; } else { $ed = $first_week_day; } for ($i = $fd; $i < $ed; $i++) { $html .= "<li class=\"calendarcell\"> </li>\n"; $grid_count++; } // render actual days $cnt = count($days); $last_week_day = 0; for ($i = 0; $i < $cnt; $i++) { $events = $days[$i]['events']; $event_cnt = count($events); $html .= "<li class=\"calendarcell"; // mark today as special if ($days[$i]['date_ts'] == $today_ts) { $html .= " today"; } if ($event_cnt) { $html .= " hasevents"; } else { $html .= " noevents"; } $html .= "\">\n"; $html .= "<span class=\"daynumber\">"; $html .= date("d", $days[$i]['date_ts']); $html .= "</span>"; $html .= "<div class=\"hovertip\">"; // . "$event_cnt Events for " // . date("D jS", $days[$i]['date_ts']) if ($event_cnt) { $html .= "<ul class=\"eventlist\">\n"; foreach ($events as $n => $assoc) { $html .= "<li>"; if ($may_edit) { $html .= "<a href=\"{$calendar_url}&display_event=" . $assoc->event_id . "\">"; } $html .= "<b>" . _out($assoc->event_title); $html .= "</b><br /> on "; $html .= PA::date($assoc->start_time); if ($may_edit) { $html .= "</a>"; } $html .= "</li>\n"; } $html .= "</ul>\n"; } if ($may_edit) { // create link $html .= "<a class=\"create-event\" href=\"{$calendar_url}&date=" . date("Y-m-d", $days[$i]['date_ts']) . "\">New</a>"; } $html .= "</div>"; $html .= "</li>\n"; $grid_count++; } // render empty days at end of month if required for ($i = $grid_count; $i < 42; $i++) { $html .= "<li class=\"calendarcell\"> </li>\n"; } // add just the events for the list view foreach ($event_assocs as $i => $assoc) { $html .= '<li class="listview calendarcell">'; $cid = Event::get_cid_from_eid((int) $assoc->event_id); $html .= "<a href=\"" . PA::$url . PA_ROUTE_PERMALINK . "&cid=" . $cid . "\">"; $html .= "<b>" . _out($assoc->event_title); $html .= "</b></a><br /> starts "; $html .= PA::datetime($assoc->start_time); $html .= "<br /> ends "; $html .= PA::datetime($assoc->end_time); if ($may_edit) { $html .= " <a href=\"{$calendar_url}&display_event=" . $assoc->event_id . "\">"; $html .= __('Edit'); $html .= "</a>"; } $html .= '</li>'; } $html .= "<li class=\"calendarcell header\">"; if ($may_edit) { // edit link $html .= "<b><a class=\"goto-edit\" href=\"{$calendar_url}\">" . __("Edit") . "</a></b> "; } $html .= __("Display as") . ":\n"; $html .= "<a href=# class=\"list-style\">" . __("List") . "</a>"; $html .= "<a href=# class=\"calendar-style\">" . __("Calendar") . "</a>"; $html .= "</li>\n"; $html .= "</ul>\n"; return $html; }
</div> <div class="field_event"> <b><?php echo __("Starts"); ?> </b>: <?php echo PA::datetime($ed['start_time']); ?> </div> <div class="field_event"> <b><?php echo __("Ends"); ?> </b>: <?php echo PA::datetime($ed['end_time']); ?> </div> <div class="field_event"> <b><?php echo __("Venue"); ?> :</b>:<br /> <? echo _out($ed['event_venue']); ?> </div> <div class="field_event"> <b><?php echo __("Description"); ?>
echo $folder_name; ?> "> <input type="hidden" name="index_id[]" value="<?php echo $message_details['index_id']; ?> "> </form> </div> <div id="message_body"> <ul> <li><b><?php echo __("Date:"); ?> </b><?php echo PA::datetime($message_details['sent_time'], 'long', 'short'); // date("d M Y h:i:s ",$message_details['sent_time']) ?> </li> <li><b><?php echo __("From:"); ?> </b><?php echo $message_details['sender_name']; ?> </li> <li><b><?php echo __("To:"); ?> </b> <?php
echo $comment['name']; ?> </a> <?php } ?> </td> <td class="message"> <?php echo nl2br(stripslashes($comment['comment'])); ?> <div class="post_info"><a href="#comment_<?php echo $comment['comment_id']; ?> "><?php echo PA::datetime($comment['created']); ?> </a> <?php $params = array('comment_info' => array('user_id' => $comment['user_id'], 'content_id' => $comment['content_id']), 'permissions' => 'delete_comment'); echo '</div>'; if (!empty(PA::$login_uid)) { echo '<div id="buttonbar"><ul>'; if (PermissionsHandler::can_user(PA::$login_uid, $params)) { echo '<li><a href="' . PA::$url . '/deletecomment.php?comment_id=' . $comment['comment_id'] . '" onclick="return confirm_delete(\'Are you sure you want to delete this comment ? \');">Delete</a></li>'; } if (PermissionsHandler::can_user(PA::$login_uid, $param_array) && $comment['user_id'] != PA::$login_uid) { echo '<li><a href="javascript: return void();" onclick = showhide_block("report_abuse_div_' . $comment['comment_id'] . '"); >Report abuse </a></li>'; } echo '</ul></div>'; }