if ($job == 'store' && !$pinged || $job == 'restore' && $resend != 1 || $job == 'restore' && !$pinged) { catchsuccess($finishok, array("{$backtowhere}|" . get_entry_url($currentid, $blogalias), $backtoaddnew)); } else { if ($htmlstat == 1) { $excerpt = tb_convert($content); } else { $excerpt = tb_no_quote($content); } $ping_show = @explode(' ', $pinged); for ($i = 0; $i < count($ping_show); $i++) { $ping_urls .= "<input type='hidden' name='pingurl[]' value='{$ping_show[$i]}'>"; } $ping_url_show = @implode('<br>', $ping_show); $form = "<div align=center><form action='admin.php?go=edit_sendtb' method='post'><input type='hidden' name='title' value=\"{$title}\"><input type='hidden' name='excerpt' value=\"{$excerpt}\"><input type='hidden' name='blog_name' value=\"{$config['blogname']}\"><input type='hidden' name='url' value='{$config['blogurl']}/" . get_entry_url($currentid, $blogalias) . "'>{$ping_urls}<input type='submit' value='{$lna[310]}' class='formbutton'> <input type='button' value='{$lna[311]}' onclick='window.location=(\"" . get_entry_url($currentid, $blogalias) . "\");' class='formbutton'></form></div>"; $t = new template(); $t->showtips($lna[312], $lna[313] . $ping_url_show . "<br><br>{$lna[314]}<br><br>" . $form, "{$backtowhere}|" . get_entry_url($currentid, $blogalias)); } } if ($job == 'sendtb') { checkpermission('EditEntry'); acceptrequest('title,excerpt,url,blog_name,pingurl'); if (!is_array($pingurl)) { catcherror($lna[315]); } plugin_runphp('trackbacksending'); @header("Content-Type: text/html; charset=utf-8"); $url = str_replace('{host}', $_SERVER['HTTP_HOST'], $url); foreach ($pingurl as $durl) { $result = sendping($durl, $title, $excerpt, $url, $blog_name); if (!$result) { $showp .= "<b>{$lna[316]}</b>{$durl} ; <b>{$lna[317]}</b>{$lna[318]}";
function output($entry, $way = 'excerpt', $contentonly = false) { global $mbcon, $section_body, $permission, $adminlist, $userdetail, $config, $categories, $weather, $t, $section_bodys, $part, $page, $template, $lnc, $tptvalue, $flset; if (!@is_a($t, 'template')) { $t = new template(); } $entrytitle = "<a href=\"" . getlink_entry($entry['blogid'], $entry['blogalias']) . "#title\">{$entry['title']}</a>"; if ($entry['sticky'] == 1 || $entry['sticky'] == 2) { $entrytitle = "[{$lnc[33]}] " . $entrytitle; } $entrydate = zhgmdate("{$mbcon['timeformat']}", $entry['pubtime'] + 3600 * $config['timezone']); $todaydate = zhgmdate("{$mbcon['timeformat']}", time() + 3600 * $config['timezone']); $entrytime = gmdate('H:i', $entry['pubtime'] + 3600 * $config['timezone']); list($entrydatey, $entrydatem, $entrydated) = explode('/', gmdate('Y/n/j', $entry['pubtime'] + 3600 * $config['timezone'])); $entrydatemnamefull = gmdate('F', $entry['pubtime'] + 3600 * $config['timezone']); $entrydatemnameshort = gmdate('M', $entry['pubtime'] + 3600 * $config['timezone']); $time0 = time() + 3600 * $config['timezone']; //获取当前时间戳 $today0am = strtotime(date('Y-m-d', $time0)); //获取今天凌晨的时间戳 $yesterday0am = strtotime(date('Y-m-d', strtotime('-1 day', $time0))); //获取昨天凌晨的时间戳 $tdbfy0am = strtotime(date('Y-m-d', strtotime('-2 day', $time0))); //获取前天凌晨的时间戳 $time1 = $entry['pubtime'] + 3600 * $config['timezone']; //帖子发布时间 $tc = time() - $entry['pubtime']; //相对时间间隔 if ($entrydatey < date('Y', time())) { $entrydater = "日期:" . $entrydatey . " 年 " . $entrydatem . " 月 " . $entrydated . " 日"; } elseif ($time1 < $tdbfy0am) { $entrydater = "日期:" . $entrydatem . " 月 " . $entrydated . " 日" . " × " . $entrydatey . " 年"; } elseif ($time1 < $yesterday0am && $time1 > $tdbfy0am) { $entrydater = "前天发布 " . $entrytime; } elseif ($time1 < $today0am && $time1 > $yesterday0am) { $entrydater = "昨天发布 " . $entrytime; } elseif ($tc > 60 * 60) { $entrydater = floor($tc / (60 * 60)) . " 小时前发布"; } elseif ($tc > 60) { $entrydater = floor($tc / 60) . " 分钟前发布"; } else { $entrydater = "刚刚发布"; } $tmp = $entry['authorid']; $entryauthor = $adminlist[$tmp]; $entryauthor = "<a href=\"" . getlink_user($tmp) . "\" >{$entryauthor}</a>"; if ($flset['tags'] != 1 && $entry['tags'] && $entry['tags'] != '>') { $entry['tags'] = trim($entry['tags'], '>'); $taginfo = @explode('>', $entry['tags']); foreach ($taginfo as $eachtag) { $eachtag_encoded = urlencode(urlencode($eachtag)); if ($mbcon['tagunderlinetospace'] == 1) { $eachtag = str_replace('_', ' ', $eachtag); } $urlref = getlink_tags($eachtag_encoded); $taginfos[] = "{$eachtag}"; } $alltags = @implode(' ', $taginfos); if ($way == 'viewentry') { $tptvalue['additionalkeywords'] = strip_tags(@implode(',', $taginfos)) . ','; } $iftags = "block"; $tags = "<div class='box-title'>Tags: </div>"; } else { $iftags = "none"; } $tmp = $entry['category']; if ($mbcon['extendcategory'] == 1 && $categories[$tmp]['parentcate'] != -1) { $tmp_parent = $categories[$tmp]['parentcate']; $outurl = getlink_category($tmp_parent); $entrycate = ""; } else { $tmp_parent = ''; $entrycate = ''; } $outurl = getlink_category($entry['category']); $entrycate .= "<a href=\"{$outurl}\" title=\"{$lnc[34]} {$categories[$tmp]['catename']}\">{$categories[$tmp]['catename']}</a>"; $entrycatealias = "{$categories[$tmp]['cateurlname']}"; $entrycateicon = $categories[$tmp]['cateicon'] ? "<img src=\"{$categories[$tmp]['cateicon']}\" alt=\"\" style=\"margin:3px 1px -4px 0px;\"/> " : ''; $entryviews = "<a href=\"" . getlink_entry($entry['blogid'], $entry['blogalias']) . "\">{$lnc[35]}({$entry['views']})</a>"; if ($entry['property'] == 1) { //Locked $entrycomment = "{$lnc['36']}"; } else { $entrycomment = "<a href=\"" . getlink_entry($entry['blogid'], $entry['blogalias']) . "#reply\" title=\"{$lnc[37]}\">{$entry['replies']} {$lnc['38']}</a>"; } if ($flset['weather'] != 1 && $entry['weather']) { $tmp = $entry['weather']; $entryicon = "<img src=\"{$weather[$tmp]['image']}\" alt=\"{$weather[$tmp]['text']}\" title=\"{$weather[$tmp]['text']}\"/>"; } else { $entryicon = ''; } if ($flset['star'] != 1) { $entrystar = "<span id=\"starid{$entry['blogid']}\">"; $entrystar .= $permission['AddEntry'] == 1 ? $entry['starred'] % 2 == 1 ? "<a href=\"javascript: dostar('{$entry['blogid']}');\"><img src=\"{$template['moreimages']}/others/starred.gif\" alt=\"\" title=\"{$lnc[39]}\" border=\"0\"/></a>" : "<a href=\"javascript: dostar('{$entry['blogid']}');\"><img src=\"{$template['moreimages']}/others/unstarred.gif\" alt=\"\" title=\"{$lnc[40]}\" border=\"0\"/></a>" : ($entry['starred'] % 2 == 1 ? "<img src=\"{$template['moreimages']}/others/starred.gif\" alt=\"\" title=\"{$lnc[39]}\" border=\"0\"/>" : "<img src=\"{$template['moreimages']}/others/unstarred.gif\" alt=\"\" title=\"{$lnc[40]}\" border=\"0\"/>"); $entrystar .= "</span>"; } if ($permission['EditEntry'] != 1) { $ifadmin = ''; } else { $adminbar = "<div id=\"admin{$entry['blogid']}\" style=\"display: none;\" class=\"textbox-adminbar\"><br/><strong>{$lnc[41]}</strong><a href=\"admin.php?go=edit_edit_{$entry['blogid']}\">{$lnc[42]}</a> | <a href=\"javascript: showdelblog('{$entry['blogid']}');\">{$lnc[43]}</a> | <a href=\"javascript: comfirmurl('admin.php?go=entry_ae_noreply&tid={$entry['blogid']}');\">{$lnc[44]}</a> | <a href=\"javascript: comfirmurl('admin.php?go=entry_ae_notb&tid={$entry['blogid']}');\">{$lnc[45]}</a><br/><strong>{$lnc[46]}</strong><a href=\"admin.php?go=entry_ae_lock&tid={$entry['blogid']}\">{$lnc[47]}</a> | <a href=\"admin.php?go=entry_ae_unlock&tid={$entry['blogid']}\">{$lnc[48]}</a> | <a href=\"admin.php?go=entry_ae_sticky1&tid={$entry['blogid']}\">{$lnc[49]}</a> | <a href=\"admin.php?go=entry_ae_sticky2&tid={$entry['blogid']}\">{$lnc[50]}</a> | <a href=\"admin.php?go=entry_ae_sticky0&tid={$entry['blogid']}\">{$lnc[51]}</a><br/><strong>{$lnc[52]}</strong><a href=\"javascript: comfirmurl('admin.php?go=entry_ae_noread&tid={$entry['blogid']}');\">{$lnc[53]}</a> | <a href=\"admin.php?go=entry_ae_recountrep&tid={$entry['blogid']}\">{$lnc[54]}</a> | <a href=\"admin.php?go=entry_ae_recounttb&tid={$entry['blogid']}\">{$lnc[55]}</a></div>"; $ifadmin = "<span>{$entry['views']} 次阅读 × <a href=\"admin.php?go=edit_edit_{$entry['blogid']}\">{$lnc[42]}</a></span>"; $adminlink = "<a href='javascript: showhidediv(\"admin{$entry['blogid']}\");'>{$lnc[56]}</a>"; } $tbauthentic = tbcertificate($entry['blogid'], $entry['pubtime']); if ($mbcon['allowtrackback'] == 1) { $entrytburl = "{$config['blogurl']}/tb.php?t={$entry['blogid']}&extra={$tbauthentic}"; $entrytburl2 = $mbcon['tburljs'] == 1 ? "<span id='tbb{$entry['blogid']}'></span>" : $entrytburl; $tbb = $entry['property'] == 0 ? "<strong>{$lnc[57]}</strong> {$entrytburl2}" : "<strong>{$lnc[58]}</strong>"; if ($mbcon['tburlexpire'] == 1) { $tbb .= "<br/>{$lnc[289]}"; } $tbbar = "<div id=\"tb{$entry['blogid']}\" style=\"display: none;\" class=\"textbox-tburl\">{$tbb}</div>"; $tbonclick = $mbcon['tburljs'] == 1 ? "showhidediv(\"tb{$entry['blogid']}\"); if (document.getElementById(\"tbb{$entry['blogid']}\")) document.getElementById(\"tbb{$entry['blogid']}\").innerHTML=decodetburl(\"" . encodetburl($entrytburl) . "\", {$mbcon['tburlmath']}, {$entry['blogid']});" : "showhidediv(\"tb{$entry['blogid']}\");"; } else { $tbbar = "<div id=\"tb{$entry['blogid']}\" style=\"display: none;\" class=\"textbox-tburl\"><strong>{$lnc[282]}</strong></div>"; $entrytburl = $lnc[282]; $tbonclick = "showhidediv(\"tb{$entry['blogid']}\");"; } $entrytb = "<a href='javascript: void(0);' title=\"{$lnc[59]}\" onclick='{$tbonclick}'>{$lnc[60]}({$entry['tbs']})</a>"; $entrytbnumwithlink = "<a href='javascript: void(0);' title=\"{$lnc[59]}\" onclick='{$tbonclick}'>{$entry['tbs']}</a>"; if ($way == 'excerpt' || $way == 'viewentry') { if ($entry['blogpsw'] && $permission['SeeAllProtectedEntry'] != 1 && $userdetail['userid'] != $entry['authorid'] && !$contentonly && $_COOKIE["entrypassword{$entry['blogid']}"] != $entry['blogpsw']) { //Password protected entry $entry['content'] = "<div id='protectedentry{$entry['blogid']}'><div class=\"quote\"><div class=\"quote-title\">{$lnc[294]}</div><div class=\"quote-content\"><form action=\"javascript: getprotectedblog({$entry['blogid']}, '{$way}');\" method='post'>{$lnc[296]}<br/>{$lnc[133]} <input type='password' name='entrypsw' id='entrypsw{$entry['blogid']}' class='text' /> <input type='submit' value='{$lnc[25]}' class='button'/></form></div></div></div>"; $aprotectedone = 1; } else { if ($way == 'excerpt') { if ($entry['entrysummary']) { $entry['content'] = $entry['entrysummary']; $notfinish = 1; } else { $entry['content'] = str_replace('[newpage]', '[separator]', $entry['content']); if (strstr($entry['content'], '[separator]')) { @(list($entry['content']) = @explode('[separator]', $entry['content'])); $notfinish = 1; } } } else { $entry['content'] = preg_replace("/\\[separator\\]/", "<a name=\"entrymore\"></a>", $entry['content'], 1); $entry['content'] = @str_replace('[separator]', '', $entry['content']); } if ($way == 'viewentry') { if (strstr($entry['content'], '[newpage]')) { $entrycontent_tmp = @explode('[newpage]', $entry['content']); $entry['content'] = $entrycontent_tmp[$part - 1]; $totalvolume = count($entrycontent_tmp); $outurl = getlink_entry($entry['blogid'], $entry['blogalias'], $page, '%s'); $pageway = 1; $innerpage = $this->make_innerpagebar($part, $outurl, $totalvolume, $pageway); $entry['content'] .= $t->set('entryadditional', array('readmore' => $innerpage)); } else { checkPageValidity($part, 1); } } } if ($way == 'viewentry' && $mbcon['showtoolbar'] == '1') { //Toolbar $toolbarplus = $mbcon['txtdown'] == '1' ? " <a href=\"read.php?save_{$entry['blogid']}\"><img src=\"{$mbcon['images']}/toolbar_save.gif\" alt='' title=\"{$lnc[66]}\" border='0'/></a>" : ''; $toolbar = "<img src=\"{$mbcon['images']}/toolbar_fontsize.gif\" alt='' title=\"{$lnc[61]}\" border='0'/> <a href=\"javascript: doZoom(16);\">{$lnc[62]}</a> | <a href=\"javascript: doZoom(14);\">{$lnc[63]}</a> | <a href=\"javascript: doZoom(12);\">{$lnc[64]}</a> <a href=\"feed.php?go=entry_{$entry['blogid']}\"><img src=\"{$mbcon['images']}/toolbar_rss.gif\" alt='' title=\"{$lnc[65]}\" border='0'/></a>{$toolbarplus}"; } $entrycontent = $this->getcontent($entry['content'], $entry['htmlstat'], $entry['ubbstat'], $entry['emotstat'], 1); $entrycontent = $this->keep_htmlcode_matches($entrycontent); if ($notfinish == 1) { $entrycontent .= $t->set('entryadditional', array('readmore' => "<a class=\"item-btn\" href=\"" . get_entry_url($entry['blogid'], $entry['blogalias']) . "#title\" title=\"阅读全文\"><img src=\"http://anyway-web.b0.upaiyun.com/images/info.svg\" class=\"svg\"/> 查看详情</a>")); } if ($way == 'viewentry') { //Load plugin: entryend $entrycontent .= plugin_get('entrycontentend'); $adminbar .= plugin_get('entryend'); } if ($contentonly) { //Content Only Mode return $entrycontent; } if ($entry['previousid'] != '') { $previousentryexist = 'inline'; $previousentrytitle = $entry['previoustitle']; $previousentryurl = getlink_entry($entry['previousid'], $entry['previousblogalias']); $previous = "<div class=\"next-entry\"><div class=\"inner\"><a href=\"{$previousentryurl}#title\" title=\"上一期节目: {$entry['previoustitle']}\" onclick=\"_hmt.push(['_trackEvent', 'nav', 'previous-post', '{$entry['previoustitle']}'])\">上一期节目:<br /><span>{$entry['previoustitle']}</span></a></div></div>"; } else { $previousentryexist = 'none'; } if ($entry['nextid'] != '') { $nextentryexist = 'inline'; $nextentrytitle = $entry['nextid']; $nextentryurl = getlink_entry($entry['nextid'], $entry['nextblogalias']); $next = "<a href=\"{$nextentryurl}\" title=\"{$lnc[70]} {$entry['nexttitle']}\"><img src=\"{$mbcon['images']}/toolbar_next.gif\" alt='' border='0'/>{$entry['nexttitle']}</a>"; } else { $nextentryexist = 'none'; } if ($entry['editorid'] && $mbcon['showeditor'] == '1') { $tmp = $entry['editorid']; $editby = "<br/>{$lnc[29]} {$adminlist[$tmp]} {$lnc[30]}"; $editby .= zhgmdate("{$mbcon['timeformat']} H:i", $entry['edittime'] + 3600 * $config['timezone']); } } if ($entry['sticky'] == 2 && $way == 'excerpt') { $way = 'excerptontop'; $topid = "top_{$entry['blogid']}"; } //Episode Number if ($entry['originsrc']) { $entrysourcewithlink = "<span>{$entry['originsrc']}</span>"; } //Play Audio if ($entry['comefrom']) { $playaudio = "<a onclick=\"_hmt.push(['_trackEvent', 'audio', 'play', 'Nº {$entry['originsrc']}'])\" target=\"blank\" class=\"item-btn\" href=\"{$entry['comefrom']}\" title=\"立即播放第 {$entry['originsrc']} 节目\"><img src=\"http://anyway-web.b0.upaiyun.com/images/play.svg\"/> 立即收听</a>"; } else { $playaudio = ""; } //Hosts Name if ($entry['pinged']) { $hostsname = "<span class=\"item-text item-meta-hosts\">{$entry['pinged']}</span>"; } //Start Template $section_bodys[] = $t->set($way, array('entryid' => $entry['blogid'], 'entryicon' => $entryicon, 'entrytitle' => $entrytitle, 'entrydate' => $entrydate, 'entrytime' => $entrytime, 'entryauthor' => $entryauthor, 'entrycontent' => $entrycontent, 'iftags' => $iftags, 'tags' => $tags, 'alltags' => $alltags, 'entrycate' => $entrycate, 'entrycateicon' => $entrycateicon, 'entrycomment' => $entrycomment, 'entrytb' => $entrytb, 'entrycatealias' => $entrycatealias, 'entryviews' => $entryviews, 'ifadmin' => $ifadmin, 'adminbar' => $adminbar, 'tbbar' => $tbbar, 'previous' => $previous, 'next' => $next, 'ifedited' => $editby, 'toolbar' => $toolbar, 'topid' => $topid, 'entrystar' => $entrystar, 'entrytitletext' => $entry['title'], 'entryrelurl' => get_entry_url($entry['blogid'], $entry['blogalias']), 'entryabsurl' => "{$config['blogurl']}/" . get_entry_url($entry['blogid'], $entry['blogalias']), 'entrydatey' => $entrydatey, 'entrydatem' => $entrydatem, 'entrydater' => $entrydater, 'todaydate' => $todaydate, 'entrydated' => $entrydated, 'entrycommentnum' => $entry['replies'], 'entrytbnum' => $entry['tbs'], 'entryviewsnum' => $entry['views'], 'entrytbnumwithlink' => $entrytbnumwithlink, 'entrytburl' => $entrytburl, 'previousentryexist' => $previousentryexist, 'previousentrytitle' => $previousentrytitle, 'previousentryurl' => $previousentryurl, 'nextentryexist' => $nextentryexist, 'nextentrytitle' => $nextentrytitle, 'nextentryurl' => $nextentryurl, 'entrydatemnamefull' => $entrydatemnamefull, 'entrydatemnameshort' => $entrydatemnameshort, 'entrysourcewithlink' => $entrysourcewithlink, 'pinged' => $pinged, 'playaudio' => $playaudio, 'hostsname' => $hostsname, 'entrysource' => $entry['comefrom'], 'entrysourcelink' => $entry['originsrc'], 'adminlink' => $adminlink)); }