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


PHP smilies函数代码示例

本文整理汇总了PHP中smilies函数的典型用法代码示例。如果您正苦于以下问题:PHP smilies函数的具体用法?PHP smilies怎么用?PHP smilies使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: get

 function get()
 {
     $status = strip_tags($_REQUEST['status']);
     $room_id = intval(\App::$data['chat']['room_id']);
     $stopped = x($_REQUEST, 'stopped') && intval($_REQUEST['stopped']) ? true : false;
     if ($status && $room_id) {
         $x = q("select channel_address from channel where channel_id = %d limit 1", intval(\App::$data['chat']['uid']));
         $r = q("update chatpresence set cp_status = '%s', cp_last = '%s' where cp_room = %d and cp_xchan = '%s' and cp_client = '%s'", dbesc($status), dbesc(datetime_convert()), intval($room_id), dbesc(get_observer_hash()), dbesc($_SERVER['REMOTE_ADDR']));
         goaway(z_root() . '/chat/' . $x[0]['channel_address'] . '/' . $room_id);
     }
     if (!$stopped) {
         $lastseen = intval($_REQUEST['last']);
         $ret = array('success' => false);
         $sql_extra = permissions_sql(\App::$data['chat']['uid']);
         $r = q("select * from chatroom where cr_uid = %d and cr_id = %d {$sql_extra}", intval(\App::$data['chat']['uid']), intval(\App::$data['chat']['room_id']));
         if (!$r) {
             json_return_and_die($ret);
         }
         $inroom = array();
         $r = q("select * from chatpresence left join xchan on xchan_hash = cp_xchan where cp_room = %d order by xchan_name", intval(\App::$data['chat']['room_id']));
         if ($r) {
             foreach ($r as $rr) {
                 switch ($rr['cp_status']) {
                     case 'away':
                         $status = t('Away');
                         $status_class = 'away';
                         break;
                     case 'online':
                     default:
                         $status = t('Online');
                         $status_class = 'online';
                         break;
                 }
                 $inroom[] = array('img' => zid($rr['xchan_photo_m']), 'img_type' => $rr['xchan_photo_mimetype'], 'name' => $rr['xchan_name'], 'status' => $status, 'status_class' => $status_class);
             }
         }
         $chats = array();
         $r = q("select * from chat left join xchan on chat_xchan = xchan_hash where chat_room = %d and chat_id > %d order by created", intval(\App::$data['chat']['room_id']), intval($lastseen));
         if ($r) {
             foreach ($r as $rr) {
                 $chats[] = array('id' => $rr['chat_id'], 'img' => zid($rr['xchan_photo_m']), 'img_type' => $rr['xchan_photo_mimetype'], 'name' => $rr['xchan_name'], 'isotime' => datetime_convert('UTC', date_default_timezone_get(), $rr['created'], 'c'), 'localtime' => datetime_convert('UTC', date_default_timezone_get(), $rr['created'], 'r'), 'text' => smilies(bbcode($rr['chat_text'])), 'self' => get_observer_hash() == $rr['chat_xchan'] ? 'self' : '');
             }
         }
     }
     $r = q("update chatpresence set cp_last = '%s' where cp_room = %d and cp_xchan = '%s' and cp_client = '%s'", dbesc(datetime_convert()), intval(\App::$data['chat']['room_id']), dbesc(get_observer_hash()), dbesc($_SERVER['REMOTE_ADDR']));
     $ret['success'] = true;
     if (!$stopped) {
         $ret['inroom'] = $inroom;
         $ret['chats'] = $chats;
     }
     json_return_and_die($ret);
 }
开发者ID:anmol26s,项目名称:hubzilla-yunohost,代码行数:52,代码来源:Chatsvc.php

示例2: get

 function get()
 {
     if (\App::$argv[1] === "json") {
         $tmp = list_smilies();
         $results = array();
         for ($i = 0; $i < count($tmp['texts']); $i++) {
             $results[] = array('text' => $tmp['texts'][$i], 'icon' => $tmp['icons'][$i]);
         }
         json_return_and_die($results);
     } else {
         return smilies('', true);
     }
 }
开发者ID:BlaBlaNet,项目名称:hubzilla,代码行数:13,代码来源:Smilies.php

示例3: message_content

function message_content(&$a)
{
    $o = '';
    nav_set_selected('messages');
    if (!local_channel()) {
        notice(t('Permission denied.') . EOL);
        return login();
    }
    $channel = $a->get_channel();
    head_set_icon($channel['xchan_photo_s']);
    $cipher = get_pconfig(local_channel(), 'system', 'default_cipher');
    if (!$cipher) {
        $cipher = 'aes256';
    }
    $tpl = get_markup_template('mail_head.tpl');
    $header = replace_macros($tpl, array('$messages' => t('Messages'), '$tab_content' => $tab_content));
    if (argc() == 3 && argv(1) === 'dropconv') {
        if (!intval(argv(2))) {
            return;
        }
        $cmd = argv(1);
        $r = private_messages_drop(local_channel(), argv(2), true);
        if ($r) {
            info(t('Conversation removed.') . EOL);
        }
        goaway($a->get_baseurl(true) . '/message');
    }
    if (argc() == 1) {
        // list messages
        $o .= $header;
        // private_messages_list() can do other more complicated stuff, for now keep it simple
        $r = private_messages_list(local_channel(), '', $a->pager['start'], $a->pager['itemspage']);
        if (!$r) {
            info(t('No messages.') . EOL);
            return $o;
        }
        $tpl = get_markup_template('mail_list.tpl');
        foreach ($r as $rr) {
            $o .= replace_macros($tpl, array('$id' => $rr['id'], '$from_name' => $rr['from']['xchan_name'], '$from_url' => chanlink_hash($rr['from_xchan']), '$from_photo' => $rr['from']['xchan_photo_s'], '$to_name' => $rr['to']['xchan_name'], '$to_url' => chanlink_hash($rr['to_xchan']), '$to_photo' => $rr['to']['xchan_photo_s'], '$subject' => $rr['seen'] ? $rr['title'] : '<strong>' . $rr['title'] . '</strong>', '$delete' => t('Delete conversation'), '$body' => smilies(bbcode($rr['body'])), '$date' => datetime_convert('UTC', date_default_timezone_get(), $rr['created'], t('D, d M Y - g:i A')), '$seen' => $rr['seen']));
        }
        $o .= alt_pager($a, count($r));
        return $o;
    }
}
开发者ID:redmatrix,项目名称:red,代码行数:44,代码来源:message.php

示例4: prepare_text

/**
 * @brief Given a text string, convert from bbcode to html and add smilie icons.
 *
 * @param string $text
 * @param sting $content_type
 * @return string
 */
function prepare_text($text, $content_type = 'text/bbcode', $cache = false)
{
    switch ($content_type) {
        case 'text/plain':
            $s = escape_tags($text);
            break;
        case 'text/html':
            $s = $text;
            break;
        case 'text/markdown':
            require_once 'library/markdown.php';
            $s = Markdown($text);
            break;
        case 'application/x-pdl':
            $s = escape_tags($text);
            break;
            // No security checking is done here at display time - so we need to verify
            // that the author is allowed to use PHP before storing. We also cannot allow
            // importation of PHP text bodies from other sites. Therefore this content
            // type is only valid for web pages (and profile details).
            // It may be possible to provide a PHP message body which is evaluated on the
            // sender's site before sending it elsewhere. In that case we will have a
            // different content-type here.
        // No security checking is done here at display time - so we need to verify
        // that the author is allowed to use PHP before storing. We also cannot allow
        // importation of PHP text bodies from other sites. Therefore this content
        // type is only valid for web pages (and profile details).
        // It may be possible to provide a PHP message body which is evaluated on the
        // sender's site before sending it elsewhere. In that case we will have a
        // different content-type here.
        case 'application/x-php':
            ob_start();
            eval($text);
            $s = ob_get_contents();
            ob_end_clean();
            break;
        case 'text/bbcode':
        case '':
        default:
            require_once 'include/bbcode.php';
            if (stristr($text, '[nosmile]')) {
                $s = bbcode($text, false, true, $cache);
            } else {
                $s = smilies(bbcode($text, false, true, $cache));
            }
            $s = zidify_links($s);
            break;
    }
    //logger('prepare_text: ' . $s);
    return $s;
}
开发者ID:23n,项目名称:hubzilla,代码行数:58,代码来源:text.php

示例5: prepare_page

function prepare_page($item)
{
    $a = get_app();
    $naked = get_pconfig($item['uid'], 'system', 'nakedpage') ? 1 : 0;
    $observer = $a->get_observer();
    //240 chars is the longest we can have before we start hitting problems with suhosin sites
    $preview = substr(urlencode($item['body']), 0, 240);
    $link = z_root() . '/' . $a->cmd;
    if (array_key_exists('webpage', $a->layout) && array_key_exists('authored', $a->layout['webpage'])) {
        if ($a->layout['webpage']['authored'] === 'none') {
            $naked = 1;
        }
        // ... other possible options
    }
    // prepare_body calls unobscure() as a side effect. Do it here so that
    // the template will get passed an unobscured title.
    $body = prepare_body($item, true);
    $tpl = get_pconfig($item['uid'], 'system', 'pagetemplate');
    if (!$tpl) {
        $tpl = 'page_display.tpl';
    }
    return replace_macros(get_markup_template($tpl), array('$author' => $naked ? '' : $item['author']['xchan_name'], '$auth_url' => $naked ? '' : zid($item['author']['xchan_url']), '$date' => $naked ? '' : datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'Y-m-d H:i'), '$title' => smilies(bbcode($item['title'])), '$body' => $body, '$preview' => $preview, '$link' => $link));
}
开发者ID:redmatrix,项目名称:red,代码行数:23,代码来源:conversation.php

示例6: trim

         }
         $wert[5] = trim($wert[5]);
         if (!empty($wert[5])) {
             $wert[5] = "<a href=\"" . $wert[5] . "\" target=\"_blank\"><img src=\"guestbook/images/home.gif\" alt=\"Homepage\" border=\"0\" hspace=\"2\"></a>";
         }
         if (!empty($wert[7])) {
             $wert[7] = _kommentar . $wert[7];
         }
         if (empty($wert[7])) {
             $wert[7] = "";
         }
         if ($enumbruch) {
             $wert[6] = umbrucheinfuegen($wert[6], $umbruch);
         }
         if ($ensmilies) {
             $wert[6] = smilies($wert[6], $smilies);
         }
         if (empty($wert[8])) {
             $wert[8] = "";
         }
         $text6_mit_br = str_replace("\n", "<br>", $wert[6]);
         $text7_mit_br = str_replace("\n", "<br>", $wert[7]);
         if ($wert[8] != "1") {
             $table .= templateschreiben("guestbook/templates/tabelle.tpl", array("NAME" => $wert[2], "EMAIL" => $wert[3], "ICQ" => $wert[4], "HP" => $wert[5], "CONTENT" => $text6_mit_br, "COMMENT" => $text7_mit_br, "DATE" => date("d.m.Y", $wert[0]), "TIME" => date("H:i", $wert[0]), "NUMBER" => $eintr_anzahl - $i));
         }
         if ($i == $eintr_proseite + $start - 1) {
             break;
         }
     }
     $i++;
 }
开发者ID:64kbytes,项目名称:stayinba,代码行数:31,代码来源:gb.php

示例7: prepare_text

 /**
  * Given a text string, convert from bbcode to html and add smilie icons.
  *
  * @param string $text
  * @return string
  */
 function prepare_text($text)
 {
     require_once 'include/bbcode.php';
     if (stristr($text, '[nosmile]')) {
         $s = bbcode($text);
     } else {
         $s = smilies(bbcode($text));
     }
     return trim($s);
 }
开发者ID:jzacman,项目名称:friendica,代码行数:16,代码来源:text.php

示例8: formattext

function formattext ($text, $smilies, $smiliespath, $myBoardCodeTags, $html) {
	if($html == 'txt0' OR $html == 'com0' ) {
	$text = htmlspecialchars($text);
	$text = str_replace('&lt;br&gt;','<br>',$text);
	$text = str_replace('&lt;br /&gt;','<br />',$text);
	}

	$text = Filter_myBoardCodeTags($text, $myBoardCodeTags);
	if ($smilies == 'yes') $text = smilies($smiliespath,$text);
	return $text;
}
开发者ID:Juuro,项目名称:Dreamapp-Website,代码行数:11,代码来源:functions.inc.php

示例9: mail_content

function mail_content(&$a)
{
    $o = '';
    nav_set_selected('messages');
    if (!local_user()) {
        notice(t('Permission denied.') . EOL);
        return login();
    }
    $channel = $a->get_channel();
    head_set_icon($channel['xchan_photo_s']);
    $cipher = get_pconfig(local_user(), 'system', 'default_cipher');
    if (!$cipher) {
        $cipher = 'aes256';
    }
    $tpl = get_markup_template('mail_head.tpl');
    $header = replace_macros($tpl, array('$messages' => t('Messages'), '$tab_content' => $tab_content));
    if (argc() == 3 && argv(1) === 'drop') {
        if (!intval(argv(2))) {
            return;
        }
        $cmd = argv(1);
        $r = private_messages_drop(local_user(), argv(2));
        if ($r) {
            info(t('Message deleted.') . EOL);
        }
        goaway($a->get_baseurl(true) . '/message');
    }
    if (argc() == 3 && argv(1) === 'recall') {
        if (!intval(argv(2))) {
            return;
        }
        $cmd = argv(1);
        $r = q("update mail set mail_flags = mail_flags | %d where id = %d and channel_id = %d limit 1", intval(MAIL_RECALLED), intval(argv(2)), intval(local_user()));
        proc_run('php', 'include/notifier.php', 'mail', intval(argv(2)));
        if ($r) {
            info(t('Message recalled.') . EOL);
        }
        goaway($a->get_baseurl(true) . '/message');
    }
    if (argc() > 1 && argv(1) === 'new') {
        $o .= $header;
        $plaintext = true;
        $tpl = get_markup_template('msg-header.tpl');
        $a->page['htmlhead'] .= replace_macros($tpl, array('$baseurl' => $a->get_baseurl(true), '$editselect' => $plaintext ? 'none' : '/(profile-jot-text|prvmail-text)/', '$nickname' => $channel['channel_address'], '$linkurl' => t('Please enter a link URL:'), '$expireswhen' => t('Expires YYYY-MM-DD HH:MM')));
        $preselect = isset($a->argv[2]) ? array($a->argv[2]) : false;
        $prename = $preurl = $preid = '';
        if (x($_REQUEST, 'hash')) {
            $r = q("select abook.*, xchan.* from abook left join xchan on abook_xchan = xchan_hash\n\t\t\t\twhere abook_channel = %d and abook_xchan = '%s' limit 1", intval(local_user()), dbesc($_REQUEST['hash']));
            if ($r) {
                $prename = $r[0]['xchan_name'];
                $preurl = $r[0]['xchan_url'];
                $preid = $r[0]['abook_id'];
                $preselect = array($preid);
            }
        }
        if ($preselect) {
            $r = q("select abook.*, xchan.* from abook left join xchan on abook_xchan = xchan_hash\n\t\t\t\twhere abook_channel = %d and abook_id = %d limit 1", intval(local_user()), intval(argv(2)));
            if ($r) {
                $prename = $r[0]['xchan_name'];
                $preurl = $r[0]['xchan_url'];
                $preid = $r[0]['abook_id'];
            }
        }
        $prefill = $preselect ? $prename : '';
        if (!$prefill) {
            if (array_key_exists('to', $_REQUEST)) {
                $prefill = $_REQUEST['to'];
            }
        }
        // the ugly select box
        $select = contact_select('messageto', 'message-to-select', $preselect, 4, true, false, false, 10);
        $tpl = get_markup_template('prv_message.tpl');
        $o .= replace_macros($tpl, array('$header' => t('Send Private Message'), '$to' => t('To:'), '$showinputs' => 'true', '$prefill' => $prefill, '$autocomp' => $autocomp, '$preid' => $preid, '$subject' => t('Subject:'), '$subjtxt' => x($_REQUEST, 'subject') ? strip_tags($_REQUEST['subject']) : '', '$text' => x($_REQUEST, 'body') ? htmlspecialchars($_REQUEST['body'], ENT_COMPAT, 'UTF-8') : '', '$readonly' => '', '$yourmessage' => t('Your message:'), '$select' => $select, '$parent' => '', '$upload' => t('Upload photo'), '$attach' => t('Attach file'), '$insert' => t('Insert web link'), '$wait' => t('Please wait'), '$submit' => t('Send'), '$defexpire' => '', '$feature_expire' => feature_enabled(local_user(), 'content_expire') ? true : false, '$expires' => t('Set expiration date'), '$feature_encrypt' => feature_enabled(local_user(), 'content_encrypt') ? true : false, '$encrypt' => t('Encrypt text'), '$cipher' => $cipher));
        return $o;
    }
    if (argc() > 1 && intval(argv(1))) {
        $o .= $header;
        $plaintext = true;
        //		if( local_user() && feature_enabled(local_user(),'richtext') )
        //			$plaintext = false;
        $messages = private_messages_fetch_conversation(local_user(), argv(1), true);
        if (!$messages) {
            info(t('Message not found.') . EOL);
            return $o;
        }
        if ($messages[0]['to_xchan'] === $channel['channel_hash']) {
            $a->poi = $messages[0]['from'];
        } else {
            $a->poi = $messages[0]['to'];
        }
        //		require_once('include/Contact.php');
        //		$a->set_widget('mail_conversant',vcard_from_xchan($a->poi,$get_observer_hash,'mail'));
        $tpl = get_markup_template('msg-header.tpl');
        $a->page['htmlhead'] .= replace_macros($tpl, array('$nickname' => $channel['channel_addr'], '$baseurl' => $a->get_baseurl(true), '$editselect' => $plaintext ? 'none' : '/(profile-jot-text|prvmail-text)/', '$linkurl' => t('Please enter a link URL:'), '$expireswhen' => t('Expires YYYY-MM-DD HH:MM')));
        $mails = array();
        $seen = 0;
        $unknown = false;
        foreach ($messages as $message) {
            $s = theme_attachments($message);
            $mails[] = array('id' => $message['id'], 'from_name' => $message['from']['xchan_name'], 'from_url' => chanlink_hash($message['from_xchan']), 'from_photo' => $message['from']['xchan_photo_m'], 'to_name' => $message['to']['xchan_name'], 'to_url' => chanlink_hash($message['to_xchan']), 'to_photo' => $message['to']['xchan_photo_m'], 'subject' => $message['title'], 'body' => smilies(bbcode($message['body']) . $s), 'delete' => t('Delete message'), 'recall' => t('Recall message'), 'can_recall' => $channel['channel_hash'] == $message['from_xchan'] ? true : false, 'is_recalled' => $message['mail_flags'] & MAIL_RECALLED ? t('Message has been recalled.') : '', 'date' => datetime_convert('UTC', date_default_timezone_get(), $message['created'], 'D, d M Y - g:i A'));
//.........这里部分代码省略.........
开发者ID:Mauru,项目名称:red,代码行数:101,代码来源:mail.php

示例10: confirm

            ?>
" >   
                                                                                                                                <button name="delete_from_view_sent" onclick="return confirm('Do you confirm to delete messages ?');" class="btn blue reply-btn">
                                                                                                                                <i class="fa fa-trash-o"></i> Delete </button>
                                                                                                                            </form>   
                                                                                                                            <?php 
        }
        ?>
                                                                                                                    </div>
                                                                                                            </div>
                                                                                                    </div>
                                                                                            </div>
                                                                                            <div class="inbox-view">
                                                                                                    <p>
                                                                                                        <?php 
        echo smilies($message["msg"]["message"]);
        ?>
    
                                                                                                    </p>

                                                                                            </div>
                                                                                            <hr>
                                                                                            <div class="form-horizontal" id="replyform" style="display:none;">
                                                                                                <form method="post" action="">
                                                                                                    
                                                                                                <div class="form-group">
                                                                                                    <label class="col-sm-2 control-label">Send to:</label>
                                                                                                    <div class="senderm col-sm-10">
                                                                                                        <a href="viewprofile.php?<?php 
        echo $message["to"]["username"];
        ?>
开发者ID:supriyadas,项目名称:machprinciplenew,代码行数:31,代码来源:messages.php

示例11: writepublicChat

function writepublicChat($gameID){

        global $_SESSION, $MSG_LANG,$db,$db_prefix;

        $p = mysql_query("SELECT p.*, c.*, UNIX_TIMESTAMP(c.stamp) AS stamp from {$db_prefix}chat c
                               LEFT JOIN {$db_prefix}players p ON p.player_id = c.from_id
                          order BY c.stamp DESC LIMIT 15");
        $chat = "";

        while($row = mysql_fetch_array($p))
        {
            if ($_SESSION['playerID'] == $row['from_id'])
                $cor="#0000FF";
            else
                $cor="brown";

            $zeit = $row['stamp'];
            $msg = strip_tags($row['message'], '<a><b><i><u>');
            $msg = stripslashes($msg);
            $msg = smilies($msg);

            if ($row['from_id'] == 0) {

                $row['username'] = "Chat";

                 $msg = str_replace("event-enter", $MSG_LANG["entersthechat"], $msg);
                 $msg = str_replace("event-leave", $MSG_LANG["leavesthechat"], $msg);
                 $msg = "<b>" . $msg . "</b>";
            }
            $chat .= "<font size=-10><font color=$cor><B>$row[username]</B>:</font><font color=green><br> " . $msg . "</font> <i><font size=-10><font color=silver>" . $zeit . "</font></font></i><BR>";
        }
       return $chat;
}
开发者ID:BackupTheBerlios,项目名称:freechess-svn,代码行数:33,代码来源:gui.php

示例12: message_content


//.........这里部分代码省略.........
            $a->set_pager_total($r[0]['total']);
        }
        $r = q("SELECT max(`mail`.`created`) AS `mailcreated`, min(`mail`.`seen`) AS `mailseen`,\n\t\t\t`mail`.* , `contact`.`name`, `contact`.`url`, `contact`.`thumb` , `contact`.`network`,\n\t\t\tcount( * ) as count\n\t\t\tFROM `mail` LEFT JOIN `contact` ON `mail`.`contact-id` = `contact`.`id`\n\t\t\tWHERE `mail`.`uid` = %d GROUP BY `parent-uri` ORDER BY `mailcreated` DESC  LIMIT %d , %d ", intval(local_user()), intval($a->pager['start']), intval($a->pager['itemspage']));
        if (!count($r)) {
            info(t('No messages.') . EOL);
            return $o;
        }
        $tpl = get_markup_template('mail_list.tpl');
        foreach ($r as $rr) {
            if ($rr['unknown']) {
                $partecipants = sprintf(t("Unknown sender - %s"), $rr['from-name']);
            } elseif (link_compare($rr['from-url'], $myprofile)) {
                $partecipants = sprintf(t("You and %s"), $rr['name']);
            } else {
                $partecipants = sprintf(t("%s and You"), $rr['from-name']);
            }
            if ($a->theme['template_engine'] === 'internal') {
                $subject_e = template_escape($rr['mailseen'] ? $rr['title'] : '<strong>' . $rr['title'] . '</strong>');
                $body_e = template_escape($rr['body']);
                $to_name_e = template_escape($rr['name']);
            } else {
                $subject_e = $rr['mailseen'] ? $rr['title'] : '<strong>' . $rr['title'] . '</strong>';
                $body_e = $rr['body'];
                $to_name_e = $rr['name'];
            }
            $o .= replace_macros($tpl, array('$id' => $rr['id'], '$from_name' => $partecipants, '$from_url' => $rr['network'] === NETWORK_DFRN ? $a->get_baseurl(true) . '/redir/' . $rr['contact-id'] : $rr['url'], '$sparkle' => ' sparkle', '$from_photo' => $rr['thumb'] ? $rr['thumb'] : $rr['from-photo'], '$subject' => $subject_e, '$delete' => t('Delete conversation'), '$body' => $body_e, '$to_name' => $to_name_e, '$date' => datetime_convert('UTC', date_default_timezone_get(), $rr['mailcreated'], t('D, d M Y - g:i A')), '$ago' => relative_date($rr['mailcreated']), '$seen' => $rr['mailseen'], '$count' => sprintf(tt('%d message', '%d messages', $rr['count']), $rr['count'])));
        }
        $o .= paginate($a);
        return $o;
    }
    if ($a->argc > 1 && intval($a->argv[1])) {
        $o .= $header;
        $plaintext = true;
        if (local_user() && feature_enabled(local_user(), 'richtext')) {
            $plaintext = false;
        }
        $r = q("SELECT `mail`.*, `contact`.`name`, `contact`.`url`, `contact`.`thumb`\n\t\t\tFROM `mail` LEFT JOIN `contact` ON `mail`.`contact-id` = `contact`.`id`\n\t\t\tWHERE `mail`.`uid` = %d AND `mail`.`id` = %d LIMIT 1", intval(local_user()), intval($a->argv[1]));
        if (count($r)) {
            $contact_id = $r[0]['contact-id'];
            $convid = $r[0]['convid'];
            $sql_extra = sprintf(" and `mail`.`parent-uri` = '%s' ", dbesc($r[0]['parent-uri']));
            if ($convid) {
                $sql_extra = sprintf(" and ( `mail`.`parent-uri` = '%s' OR `mail`.`convid` = '%d' ) ", dbesc($r[0]['parent-uri']), intval($convid));
            }
            $messages = q("SELECT `mail`.*, `contact`.`name`, `contact`.`url`, `contact`.`thumb`\n\t\t\t\tFROM `mail` LEFT JOIN `contact` ON `mail`.`contact-id` = `contact`.`id`\n\t\t\t\tWHERE `mail`.`uid` = %d {$sql_extra} ORDER BY `mail`.`created` ASC", intval(local_user()));
        }
        if (!count($messages)) {
            notice(t('Message not available.') . EOL);
            return $o;
        }
        $r = q("UPDATE `mail` SET `seen` = 1 WHERE `parent-uri` = '%s' AND `uid` = %d", dbesc($r[0]['parent-uri']), intval(local_user()));
        require_once "include/bbcode.php";
        $tpl = get_markup_template('msg-header.tpl');
        $a->page['htmlhead'] .= replace_macros($tpl, array('$baseurl' => $a->get_baseurl(true), '$editselect' => $plaintext ? 'none' : '/(profile-jot-text|prvmail-text)/', '$nickname' => $a->user['nickname'], '$linkurl' => t('Please enter a link URL:')));
        $tpl = get_markup_template('msg-end.tpl');
        $a->page['end'] .= replace_macros($tpl, array('$baseurl' => $a->get_baseurl(true), '$editselect' => $plaintext ? 'none' : '/(profile-jot-text|prvmail-text)/', '$nickname' => $a->user['nickname'], '$linkurl' => t('Please enter a link URL:')));
        $mails = array();
        $seen = 0;
        $unknown = false;
        foreach ($messages as $message) {
            if ($message['unknown']) {
                $unknown = true;
            }
            if ($message['from-url'] == $myprofile) {
                $from_url = $myprofile;
                $sparkle = '';
            } else {
                $from_url = $a->get_baseurl(true) . '/redir/' . $message['contact-id'];
                $sparkle = ' sparkle';
            }
            $extracted = item_extract_images($message['body']);
            if ($extracted['images']) {
                $message['body'] = item_redir_and_replace_images($extracted['body'], $extracted['images'], $message['contact-id']);
            }
            if ($a->theme['template_engine'] === 'internal') {
                $from_name_e = template_escape($message['from-name']);
                $subject_e = template_escape($message['title']);
                $body_e = template_escape(smilies(bbcode($message['body'])));
                $to_name_e = template_escape($message['name']);
            } else {
                $from_name_e = $message['from-name'];
                $subject_e = $message['title'];
                $body_e = smilies(bbcode($message['body']));
                $to_name_e = $message['name'];
            }
            $mails[] = array('id' => $message['id'], 'from_name' => $from_name_e, 'from_url' => $from_url, 'sparkle' => $sparkle, 'from_photo' => $message['from-photo'], 'subject' => $subject_e, 'body' => $body_e, 'delete' => t('Delete message'), 'to_name' => $to_name_e, 'date' => datetime_convert('UTC', date_default_timezone_get(), $message['created'], 'D, d M Y - g:i A'), 'ago' => relative_date($message['created']));
            $seen = $message['seen'];
        }
        $select = $message['name'] . '<input type="hidden" name="messageto" value="' . $contact_id . '" />';
        $parent = '<input type="hidden" name="replyto" value="' . $message['parent-uri'] . '" />';
        $tpl = get_markup_template('mail_display.tpl');
        if ($a->theme['template_engine'] === 'internal') {
            $subjtxt_e = template_escape($message['title']);
        } else {
            $subjtxt_e = $message['title'];
        }
        $o = replace_macros($tpl, array('$thread_id' => $a->argv[1], '$thread_subject' => $message['title'], '$thread_seen' => $seen, '$delete' => t('Delete conversation'), '$canreply' => $unknown ? false : '1', '$unknown_text' => t("No secure communications available. You <strong>may</strong> be able to respond from the sender's profile page."), '$mails' => $mails, '$header' => t('Send Reply'), '$to' => t('To:'), '$showinputs' => '', '$subject' => t('Subject:'), '$subjtxt' => $subjtxt_e, '$readonly' => ' readonly="readonly" style="background: #BBBBBB;" ', '$yourmessage' => t('Your message:'), '$text' => '', '$select' => $select, '$parent' => $parent, '$upload' => t('Upload photo'), '$insert' => t('Insert web link'), '$submit' => t('Submit'), '$wait' => t('Please wait')));
        return $o;
    }
}
开发者ID:ZerGabriel,项目名称:friendica,代码行数:101,代码来源:message.php

示例13: display

            $i = 0;
            $page .= "</tr>\n";
        }
    }
    if ($i != 0) {
        $page .= "</tr>\n";
    }
    //Cierra los dos tables
    $page .= "</table>\n</td>\n</tr>\n<tr>\n<td class=\"c\" align=\"center\">";
    $page .= "<a href=\"javascript:window.close();\">Cerrar Ventana</a>\n";
    $page .= "</td>\n</tr>\n</table>\n</td>\n</tr>\n</table>";
    display($page, 'Emoticons', false);
    die;
}
/*
  Foro!!!
*/
if (isset($f) && isset($new) && is_numeric($f) && $new == "thread") {
    newthread($f);
} elseif (isset($t) && isset($new) && is_numeric($t) && $new == "reply") {
    reply($t);
} elseif (isset($f) && is_numeric($f)) {
    showtopic($f);
} elseif (isset($t) && is_numeric($t)) {
    showthread($t);
} elseif (isset($mode) && $mode == 'smilies') {
    smilies();
} else {
    showcategories();
}
// Created by Perberos. All rights reversed (C) 2006
开发者ID:sonicmaster,项目名称:RPG,代码行数:31,代码来源:forum.php

示例14: smilies_content

function smilies_content(&$a)
{
    return smilies('', true);
}
开发者ID:ZerGabriel,项目名称:friendica,代码行数:4,代码来源:smilies.php

示例15: message_content


//.........这里部分代码省略.........
        if ($cmd === 'drop') {
            $r = q("DELETE FROM `mail` WHERE `id` = %d AND `uid` = %d LIMIT 1", intval($a->argv[2]), intval(local_user()));
            if ($r) {
                info(t('Message deleted.') . EOL);
            }
            goaway($a->get_baseurl() . '/message');
        } else {
            $r = q("SELECT `parent-uri`,`convid` FROM `mail` WHERE `id` = %d AND `uid` = %d LIMIT 1", intval($a->argv[2]), intval(local_user()));
            if (count($r)) {
                $parent = $r[0]['parent-uri'];
                $convid = $r[0]['convid'];
                $r = q("DELETE FROM `mail` WHERE `parent-uri` = '%s' AND `uid` = %d ", dbesc($parent), intval(local_user()));
                // remove diaspora conversation pointer
                // Actually if we do this, we can never receive another reply to that conversation,
                // as we will never again have the info we need to re-create it.
                // We'll just have to orphan it.
                //if($convid) {
                //	q("delete from conv where id = %d limit 1",
                //		intval($convid)
                //	);
                //}
                if ($r) {
                    info(t('Conversation removed.') . EOL);
                }
            }
            goaway($a->get_baseurl() . '/message');
        }
    }
    if ($a->argc > 1 && $a->argv[1] === 'new') {
        $o .= $header;
        $tpl = get_markup_template('msg-header.tpl');
        $a->page['htmlhead'] .= replace_macros($tpl, array('$baseurl' => $a->get_baseurl(), '$nickname' => $a->user['nickname'], '$linkurl' => t('Please enter a link URL:')));
        $preselect = isset($a->argv[2]) ? array($a->argv[2]) : false;
        $select = contact_select('messageto', 'message-to-select', $preselect, 4, true);
        $tpl = get_markup_template('prv_message.tpl');
        $o .= replace_macros($tpl, array('$header' => t('Send Private Message'), '$to' => t('To:'), '$subject' => t('Subject:'), '$subjtxt' => '', '$readonly' => '', '$yourmessage' => t('Your message:'), '$select' => $select, '$parent' => '', '$upload' => t('Upload photo'), '$insert' => t('Insert web link'), '$wait' => t('Please wait')));
        return $o;
    }
    if ($a->argc == 1 || $a->argc == 2 && $a->argv[1] === 'sent') {
        $o .= $header;
        if ($a->argc == 2) {
            $eq = '=';
        } else {
            $eq = '!=';
        }
        // or this.
        $r = q("SELECT count(*) AS `total` FROM `mail` \n\t\t\tWHERE `mail`.`uid` = %d AND `from-url` {$eq} '%s' GROUP BY `parent-uri` ORDER BY `created` DESC", intval(local_user()), dbesc($myprofile));
        if (count($r)) {
            $a->set_pager_total($r[0]['total']);
        }
        $r = q("SELECT max(`mail`.`created`) AS `mailcreated`, min(`mail`.`seen`) AS `mailseen`, \n\t\t\t`mail`.* , `contact`.`name`, `contact`.`url`, `contact`.`thumb` \n\t\t\tFROM `mail` LEFT JOIN `contact` ON `mail`.`contact-id` = `contact`.`id` \n\t\t\tWHERE `mail`.`uid` = %d AND `from-url` {$eq} '%s' GROUP BY `parent-uri` ORDER BY `created` DESC  LIMIT %d , %d ", intval(local_user()), dbesc($myprofile), intval($a->pager['start']), intval($a->pager['itemspage']));
        if (!count($r)) {
            info(t('No messages.') . EOL);
            return $o;
        }
        $tpl = get_markup_template('mail_list.tpl');
        foreach ($r as $rr) {
            $o .= replace_macros($tpl, array('$id' => $rr['id'], '$from_name' => $rr['from-name'], '$from_url' => $rr['network'] === NETWORK_DFRN ? $a->get_baseurl() . '/redir/' . $rr['contact-id'] : $rr['url'], '$sparkle' => ' sparkle', '$from_photo' => $rr['thumb'], '$subject' => template_escape($rr['mailseen'] ? $rr['title'] : '<strong>' . $rr['title'] . '</strong>'), '$delete' => t('Delete conversation'), '$body' => template_escape($rr['body']), '$to_name' => template_escape($rr['name']), '$date' => datetime_convert('UTC', date_default_timezone_get(), $rr['mailcreated'], t('D, d M Y - g:i A'))));
        }
        $o .= paginate($a);
        return $o;
    }
    if ($a->argc > 1 && intval($a->argv[1])) {
        $o .= $header;
        $r = q("SELECT `mail`.*, `contact`.`name`, `contact`.`url`, `contact`.`thumb` \n\t\t\tFROM `mail` LEFT JOIN `contact` ON `mail`.`contact-id` = `contact`.`id` \n\t\t\tWHERE `mail`.`uid` = %d AND `mail`.`id` = %d LIMIT 1", intval(local_user()), intval($a->argv[1]));
        if (count($r)) {
            $contact_id = $r[0]['contact-id'];
            $convid = $r[0]['convid'];
            $sql_extra = sprintf(" and `mail`.`parent-uri` = '%s' ", dbesc($r[0]['parent-uri']));
            if ($convid) {
                $sql_extra = sprintf(" and ( `mail`.`parent-uri` = '%s' OR `mail`.`convid` = '%d' ) ", dbesc($r[0]['parent-uri']), intval($convid));
            }
            $messages = q("SELECT `mail`.*, `contact`.`name`, `contact`.`url`, `contact`.`thumb` \n\t\t\t\tFROM `mail` LEFT JOIN `contact` ON `mail`.`contact-id` = `contact`.`id` \n\t\t\t\tWHERE `mail`.`uid` = %d {$sql_extra} ORDER BY `mail`.`created` ASC", intval(local_user()));
        }
        if (!count($messages)) {
            notice(t('Message not available.') . EOL);
            return $o;
        }
        $r = q("UPDATE `mail` SET `seen` = 1 WHERE `parent-uri` = '%s' AND `uid` = %d", dbesc($r[0]['parent-uri']), intval(local_user()));
        require_once "include/bbcode.php";
        $tpl = get_markup_template('msg-header.tpl');
        $a->page['htmlhead'] .= replace_macros($tpl, array('$nickname' => $a->user['nickname'], '$baseurl' => $a->get_baseurl()));
        $tpl = get_markup_template('mail_conv.tpl');
        foreach ($messages as $message) {
            if ($message['from-url'] == $myprofile) {
                $from_url = $myprofile;
                $sparkle = '';
            } else {
                $from_url = $a->get_baseurl() . '/redir/' . $message['contact-id'];
                $sparkle = ' sparkle';
            }
            $o .= replace_macros($tpl, array('$id' => $message['id'], '$from_name' => template_escape($message['from-name']), '$from_url' => $from_url, '$sparkle' => $sparkle, '$from_photo' => $message['from-photo'], '$subject' => template_escape($message['title']), '$body' => template_escape(smilies(bbcode($message['body']))), '$delete' => t('Delete message'), '$to_name' => template_escape($message['name']), '$date' => datetime_convert('UTC', date_default_timezone_get(), $message['created'], 'D, d M Y - g:i A')));
        }
        $select = $message['name'] . '<input type="hidden" name="messageto" value="' . $contact_id . '" />';
        $parent = '<input type="hidden" name="replyto" value="' . $message['parent-uri'] . '" />';
        $tpl = get_markup_template('prv_message.tpl');
        $o .= replace_macros($tpl, array('$header' => t('Send Reply'), '$to' => t('To:'), '$subject' => t('Subject:'), '$subjtxt' => template_escape($message['title']), '$readonly' => ' readonly="readonly" style="background: #BBBBBB;" ', '$yourmessage' => t('Your message:'), '$select' => $select, '$parent' => $parent, '$upload' => t('Upload photo'), '$insert' => t('Insert web link'), '$wait' => t('Please wait')));
        return $o;
    }
}
开发者ID:nextgensh,项目名称:friendica,代码行数:101,代码来源:message.php


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