= 0 ? $_G['forum_thread']['replies'] : 0; if($_G['page'] > @ceil(($_G['forum_thread']['replies'] + 1) / $_G['ppp'])) { $content = ''; } elseif($postlist) { if(!function_exists('mobileoem_template')) { include_once DISCUZ_ROOT.'./source/plugin/mobileoem/discuzcode.func.php'; } $variable = array(); foreach($GLOBALS['aimgs'] as $pid => $aids) { foreach($aids as $aid) { $_url = parse_url($postlist[$pid]['attachments'][$aid]['url']); $variable['imagelist'][$aid] = (!$postlist[$pid]['attachments'][$aid]['remote'] && !$_url['scheme'] ? $_G['siteurl'] : '').$postlist[$pid]['attachments'][$aid]['url'].$postlist[$pid]['attachments'][$aid]['attachment']; if(strexists($postlist[$pid]['message'], '[attach]'.$aid.'[/attach]')) { $postlist[$pid]['message'] = str_replace('[attach]'.$aid.'[/attach]', mobileoem_parseimg($postlist[$pid]['attachments'][$aid]['width'], 0, $variable['imagelist'][$aid]), $postlist[$pid]['message']); } else { $postlist[$pid]['message'] .= '

'.mobileoem_parseimg($postlist[$pid]['attachments'][$aid]['width'], 0, $variable['imagelist'][$aid]); } } } foreach($postlist as $pid => $post) { if($post['attachlist']) { foreach($post['attachlist'] as $aid) { $aidencode = packaids($postlist[$pid]['attachments'][$aid]); $_code = parseurl('/forum.php?mod=attachment&aid='.$aidencode, $postlist[$pid]['attachments'][$aid]['filename'], 0); if(strexists($postlist[$pid]['message'], '[attach]'.$aid.'[/attach]')) { $postlist[$pid]['message'] = str_replace('[attach]'.$aid.'[/attach]', $_code, $postlist[$pid]['message']); } else { $postlist[$pid]['message'] .= '

'.$_code; } } } $postlist[$pid]['message'] = preg_replace("/\[attach\]\d+\[\/attach\]/i", '', $postlist[$pid]['message']); } $get = $_GET; unset($get['page'], $get['debug']); $nexturl = http_build_query($get); include mobileoem_template('forum/viewthread'); if(!empty($_GET['debug'])) { exit; } $content = ob_get_contents(); ob_end_clean(); } $variable['forumname'] = $forum['name']; $variable['datatype'] = $_G['page'] == 1 ? 0 : 1; $variable['webview_page'] = $content; $variable['ppp'] = $_G['ppp']; $variable['posts'] = count($postlist); $variable['page'] = $_G['page']; if($_G['forum_discuzcode']['passwordauthor']) { $variable['passwordpid'] = array_keys($_G['forum_discuzcode']['passwordauthor']); } mobile_core::result(mobile_core::variable($variable)); } } ?>