Example #1
0
function format_entry($r)
{
    if (!is_array($r)) {
        return;
    }
    extract($r);
    if (!$time) {
        list($date, $time) = explode(' ', $date);
    }
    list($hour, $minute, $second) = explode(':', $time);
    list($year, $month, $day) = explode('-', $date);
    $timestamp = timezone_mktime($timezone, $hour, $minute, $second, $month, $day, $year);
    $data = handle_content($data, $contenttype);
    $date_f = format_date($timestamp, $timezone);
    $time_f = format_time($timestamp, $timezone);
    if ($date and $time) {
        $n = get_message_sum("{$date} {$time}");
        $messages = get_messages(array("entrydate = '{$date} {$time}'", "entryuser = '******'", 'messages.messageid = entrymessages.messageid'), 'entrymessages');
    }
    if (defined("JOURNAL_USECSS")) {
        return "<div class='journal'" . ($friend ? "" : " id='" . JOURNAL_USERNAME . "'") . "><div class='date'>{$date_f}</div>" . row_to_td($r) . "</div><div class='messages'>" . (is_array($messages) ? format_messages($messages) : "") . "</div>";
    } else {
        return "<table><tr><td><h1>{$date_f}</h1></td>" . "<th>{$subject}</th>" . "<td align='right'><h1>{$time_f}</h1></td></tr>" . "<tr><td colspan='3'>{$data}</td></tr></table>" . (is_array($messages) ? format_messages($messages) : "");
    }
}
Example #2
0
}
foreach ($posts->get_items($start, $length) as $item) {
    $cat = $item->get_categories();
    $cat = $cat[0]->term;
    if ($pages == 1 && $cat == $_GET['page'] || $pages == 0 || $cat == '' && $_GET['page'] == 'home') {
        ?>
	<div class="layer">
		<div class="layer-content">
       
			<h2><?php 
        echo $item->get_title();
        ?>
</h2>
     		
          	<?php 
        echo handle_content($item);
        ?>
            
			<p><small>Posted on <?php 
        echo $item->get_date('j M Y, g:i a');
        ?>
</small></p>
            
		</div>
	</div>
	<?php 
    }
}
?>
	
 
Example #3
0
function tapatalk_push_pm()
{
    global $user_info, $smcFunc, $boardurl, $modSettings, $context;
    $sent_recipients = !empty($context['send_log']) && !empty($context['send_log']['sent']) ? array_keys($context['send_log']['sent']) : array();
    if (isset($sent_recipients) && !empty($sent_recipients) && isset($_POST['subject'])) {
        $timestr = time();
        $id_pm_req = $smcFunc['db_query']('', '
            SELECT p.id_pm, p.body, p.msgtime
            FROM {db_prefix}personal_messages p
            WHERE p.msgtime > {int:msgtime_l} AND p.msgtime < {int:msgtime_h} AND p.id_member_from = {int:send_userid} ', array('msgtime_l' => $timestr - 10, 'msgtime_h' => $timestr + 10, 'send_userid' => $user_info['id']));
        $id_pm = $smcFunc['db_fetch_assoc']($id_pm_req);
        if ($id_pm_req) {
            $smcFunc['db_free_result']($id_pm_req);
        }
        if ($id_pm) {
            $ttp_data = array('type' => 'pm', 'id' => $id_pm['id_pm'], 'title' => tt_push_clean($_POST['subject']), 'author' => tt_push_clean($user_info['name']), 'authorid' => $user_info['id'], 'author_postcount' => $user_info['posts'], 'dateline' => $id_pm['msgtime']);
            $request = $smcFunc['db_query']('', '
                SELECT tu.userid
                FROM {db_prefix}tapatalk_users tu
                WHERE tu.userid IN ({array_int:recipient_to})', array('recipient_to' => $sent_recipients));
            $userids = '';
            while ($row = $smcFunc['db_fetch_assoc']($request)) {
                if ($row['userid'] == $user_info['id']) {
                    continue;
                }
                $userids = empty($userids) ? $row['userid'] : $userids . ',' . $row['userid'];
                $ttp_data['userid'] = $row['userid'];
                store_as_alert($ttp_data);
            }
            $ttp_data['userid'] = $userids;
            if (isset($modSettings['tp_push_notifications']) && $modSettings['tp_push_notifications'] == 1) {
                $ttp_data['content'] = handle_content($id_pm['body']);
            }
            tt_do_post_request($ttp_data);
        }
    }
}