当前位置: 首页>>代码示例>>PHP>>正文


PHP GeographPage::fetch方法代码示例

本文整理汇总了PHP中GeographPage::fetch方法的典型用法代码示例。如果您正苦于以下问题:PHP GeographPage::fetch方法的具体用法?PHP GeographPage::fetch怎么用?PHP GeographPage::fetch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GeographPage的用法示例。


在下文中一共展示了GeographPage::fetch方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: sprintf

 if (strlen($msg) == 0) {
     $ok = false;
     $errors['msg'] = $MESSAGES['ecard']['empty_message'];
 }
 $smarty->assign_by_ref('errors', $errors);
 $smarty->assign_by_ref('msg', html_entity_decode($msg));
 //will be re-htmlentities'ed when output
 $smarty->assign_by_ref('charset', $CONF['mail_charset']);
 $smarty->assign_by_ref('contactmail', $CONF['abuse_email']);
 $enc_from_name = mb_encode_mimeheader($from_name, $CONF['mail_charset'], $CONF['mail_transferencoding']);
 $enc_to_name = mb_encode_mimeheader($to_name, $CONF['mail_charset'], $CONF['mail_transferencoding']);
 //still ok?
 if ($ok && !isset($_POST['edit'])) {
     //build message and send it...
     $smarty->assign_by_ref('htmlmsg', nl2br($msg));
     $body = $smarty->fetch('email_ecard.tpl');
     $subject = sprintf($MESSAGES['ecard']['mail_subject'], $from_name);
     $encsubject = mb_encode_mimeheader($CONF['mail_subjectprefix'] . $subject, $CONF['mail_charset'], $CONF['mail_transferencoding']);
     if (isset($_POST['preview'])) {
         preg_match_all('/(<!DOCTYPE.*<\\/HTML>)/s', $body, $matches);
         print $MESSAGES['ecard']['preview_title'];
         print "<form method=\"post\">";
         foreach ($_POST as $name => $value) {
             if ($name != 'preview') {
                 print "<input type=\"hidden\" name=\"{$name}\" value=\"" . htmlentities($value) . "\">";
             }
         }
         printf($MESSAGES['ecard']['preview_html'], $to_email, $subject);
         $html = preg_replace("/=[\n\r]+/s", "\n", $matches[1][0]);
         $html = preg_replace("/=(\\w{2})/e", 'chr(hexdec("$1"))', $html);
         print $html;
开发者ID:s-a-r-id,项目名称:geograph-project,代码行数:31,代码来源:ecard.php

示例2: die

if (strlen($msg) == 0) {
    $ok = false;
    $errors['msg'] = "Please enter a message to send";
}
if (isSpam($msg)) {
    $ok = false;
    $errors['msg'] = "Sorry, this looks like spam";
}
if (!$ok) {
    die("ERROR: " . implode('. ', $errors));
}
$smarty->assign_by_ref('msg', $msg);
$smarty->assign_by_ref('contactmail', $CONF['abuse_email']);
$enc_from_name = mb_encode_mimeheader($from_name, $CONF['mail_charset'], $CONF['mail_transferencoding']);
$smarty->assign('http_host', "{$_SERVER['HTTP_HOST']} on behalf of {$domain}");
$body = $smarty->fetch('email_usermsg.tpl');
$subject = "{$from_name} contacting you via {$domain}";
$encsubject = mb_encode_mimeheader($CONF['mail_subjectprefix'] . $subject, $CONF['mail_charset'], $CONF['mail_transferencoding']);
$ip = getRemoteIP();
$hostname = trim(`hostname -f`);
$received = "Received: from [{$ip}]" . " by {$hostname} " . "with HTTP;" . strftime("%d %b %Y %H:%M:%S -0000", time()) . "\n";
if (!empty($_REQUEST['client_ip']) && preg_match("/^[\\w\\.]+\$/", $_REQUEST['client_ip'])) {
    $received .= "Received: from [{$_REQUEST['client_ip']}]" . " by [{$id}] " . "with HTTP;" . strftime("%d %b %Y %H:%M:%S -0000", empty($_REQUEST['timestamp']) ? time() : intval($_REQUEST['timestamp'])) . "\n";
}
$mime = "MIME-Version: 1.0\n" . "Content-Type: text/plain; charset={$CONF['mail_charset']}\n" . "Content-Disposition: inline\n" . "Content-Transfer-Encoding: 8bit";
$from = "From: {$enc_from_name} <{$from_email}>\n";
$geofrom = "From: Geograph <{$CONF['mail_from']}>\n";
$envfrom = is_null($CONF['mail_envelopefrom']) ? null : "-f {$CONF['mail_envelopefrom']}";
if (preg_match('/(DORMANT|geograph\\.org\\.uk|geograph\\.co\\.uk|dev\\.null|deleted|localhost|127\\.0\\.0\\.1)/', $recipient->email)) {
    $email = $CONF['contact_email'];
    $body = "Sent as Geograph doesn't hold email address for this user [id {$recipient->user_id}]\n\n--\n\n" . $body;
开发者ID:s-a-r-id,项目名称:geograph-project,代码行数:31,代码来源:usermsg_api.php

示例3: GridSquare

        $square = new GridSquare();
        $grid_ok = $square->setGridRef($gridref);
        if ($grid_ok) {
            //find a possible place within 25km
            $smarty->assign('place', $square->findNearestPlace(75000));
            if ($square->imagecount) {
                //todo use smarty caching
                //what style should we use?
                $style = $USER->getStyle();
                $smarty->assign('maincontentclass', 'content_photo' . $style);
                $smarty->assign('backgroundcolor', $style);
                $images = $square->getImages();
                $smarty->assign_by_ref('images', $images);
            }
            $smarty->assign('gridref', $gridref);
            $gridThumbs = $smarty->fetch("_discuss_gridref_cell.tpl");
        }
    }
}
$numRows = $topicData[5];
$topicDesc = 0;
$topic_reverse = '';
$srt = 'ASC';
if (isset($themeDesc) and in_array($topic, $themeDesc)) {
    $topicDesc = 1;
    $topic_reverse = "<img src=\"{$static_url}/img/topic_reverse.gif\" align=middle border=0 alt=\"\">&nbsp;";
    $srt = 'DESC';
}
if ($page == -1 and $topicDesc == 0) {
    $page = pageChk($page, $numRows, $viewmaxreplys);
} elseif ($page == -1 and $topicDesc == 1) {
开发者ID:s-a-r-id,项目名称:geograph-project,代码行数:31,代码来源:bb_func_vthread.php


注:本文中的GeographPage::fetch方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。