• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP html2txt函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: RunModule

 function RunModule()
 {
     if (isset($_GET['adv']) && (!isset($_GET['q']) && !isset(self::$types[$_GET['adv']]))) {
         // if we're using advanced search
         $_GET['q'] = $_REQUEST['q'] = $_GET['adv'];
         $_GET['adv'] = $_REQUEST['adv'] = '';
     }
     $query = isset($_GET['q']) ? $_GET['q'] : '';
     $adv = isset($_GET['adv']) ? $_GET['adv'] : '';
     echo '<h1>Search</h1>';
     $this->OutputForm();
     echo '<p>Search Results for ' . $query . '</p>';
     $scores = self::RunSearch($query, $adv);
     foreach ($scores as $row) {
         $score = $row[0];
         $module = $row[1];
         $pkVal = $row[2];
         $info = $row[3];
         $obj = utopia::GetInstance($module);
         $data = $obj->LookupRecord($pkVal);
         $url = $obj->GetURL($pkVal);
         $title = word_trim(html2txt($data[$info[1]]), 10, true);
         $desc = word_trim(html2txt($data[$info[2]]), 30, true);
         echo '<div class="searchResult"><a href="' . $url . '">' . $title . '</a><div>' . $desc . '</div></div>';
     }
 }
开发者ID:OptimalInternet,项目名称:uCore,代码行数:26,代码来源:search.php


示例2: fetch_thread_replies

 public function fetch_thread_replies($count, $tid)
 {
     require_once libfile('function/discuzcode');
     require_once './source/plugin/singcere_waterfall/singcere_waterfall.func.php';
     $list = array();
     $query = DB::query("SELECT * FROM %t WHERE first != 1 AND tid = %d AND invisible >= 0 ORDER BY dateline DESC LIMIT 0, %d", array('forum_post', $tid, $count));
     while (($result = DB::fetch($query)) != false) {
         preg_match_all("/\\[attach\\](\\d+)\\[\\/attach\\]/i", $result['message'], $matchaids);
         $attachs = parseattach($result['tid'], $result['pid'], $matchaids, $result['message'], $skipaids);
         $k = $result['message'] = preg_replace("/\\[attach\\](\\d+)\\[\\/attach\\]/ ", "\$attachs[\\1]", $result['message']);
         eval("\$k=\"{$k}\";");
         $k = discuzcode($k, FALSE, FALSE);
         $result['message'] = $k;
         $result['message'] = html2txt($result['message']);
         $list[] = $result;
     }
     return $list;
 }
开发者ID:zhzhchwin,项目名称:Js-practics,代码行数:18,代码来源:table_dx.php


示例3: find

 public function find($page = 1)
 {
     $limit = 10;
     $vdata = array('status' => 0, 'msg' => '未输入关键词!');
     if ($str = $this->input->get('w')) {
         // 元个数大于5
         if (mstrlen($str) > 5) {
             $str = get_str_tags(html2txt($str));
         }
         if ($data = $this->model->find_list($str, $limit, $limit * ($page - 1))) {
             $vdata = $data;
             $vdata['status'] = 1;
             $vdata['msg'] = "获取数据共" . $vdata['count'] . "条";
             //分页
             $this->load->library('pagination');
             $this->pagination->initialize(page_config($limit, $vdata['count'], site_url('tags/find/')));
             $vdata['pages'] = $this->pagination->create_links();
         }
     }
     $this->output->set_content_type('application/json')->set_output(json_encode($vdata));
 }
开发者ID:PoppyLi,项目名称:PCMS,代码行数:21,代码来源:tags.php


示例4: search_output

function search_output()
{
    global $db, $opt;
    global $distance_unit, $startat, $count, $sql, $sqlLimit;
    $encoding = 'UTF-8';
    $xmlLine = "\t<cache>\n\t\t<name><![CDATA[{cachename}]]></name>\n\t\t<owner id=\"{ownerid}\"><![CDATA[{owner}]]></owner>\n\t\t<id>{cacheid}</id>\n\t\t<waypoint>{waypoint}</waypoint>\n\t\t<hidden>{time}</hidden>\n\t\t<status id=\"{statusid}\">{status}</status>\n\t\t<lon value=\"{lonvalue}\">{lon}</lon>\n\t\t<lat value=\"{latvalue}\">{lat}</lat>\n\t\t<distance unit=\"" . $distance_unit . "\">{distance}</distance>\n\t\t<type id=\"{typeid}\">{type}</type>\n\t\t<difficulty>{difficulty}</difficulty>\n\t\t<terrain>{terrain}</terrain>\n\t\t<size id=\"{sizeid}\">{container}</size>\n\t\t<country id=\"{countryid}\">{country}</country>\n\t\t<link><![CDATA[" . $opt['page']['default_absolute_url'] . "viewcache.php?wp={waypoint}]]></link>\n\t\t<desc><![CDATA[{shortdesc}]]></desc>\n\t\t<hints><![CDATA[{hints}]]></hints>\n\t</cache>\n";
    // create temporary table
    sql_temp_table_slave('searchtmp');
    sql_slave('CREATE TEMPORARY TABLE &searchtmp SELECT SQL_BUFFER_RESULT SQL_CALC_FOUND_ROWS ' . $sql . $sqlLimit);
    $resultcount = sql_value_slave('SELECT FOUND_ROWS()', 0);
    $rsCount = sql_slave('SELECT COUNT(*) `count` FROM &searchtmp');
    $rCount = sql_fetch_array($rsCount);
    mysql_free_result($rsCount);
    // start output
    if (!$db['debug']) {
        header("Content-type: application/xml; charset=" . $encoding);
        //header("Content-Disposition: attachment; filename=" . $sFilebasename . ".txt");
        echo "<?xml version=\"1.0\" encoding=\"" . $encoding . "\"?>\n";
        echo "<result>\n";
        echo "\t<docinfo>\n";
        echo "\t\t<results>" . $rCount['count'] . "</results>\n";
        echo "\t\t<startat>" . $startat . "</startat>\n";
        echo "\t\t<perpage>" . $count . "</perpage>\n";
        echo "\t\t<total>" . $resultcount . "</total>\n";
        echo "\t</docinfo>\n";
    }
    $rs = sql_slave("SELECT &searchtmp.`cache_id` `cacheid`,\n                    &searchtmp.`longitude` `longitude`,\n                    &searchtmp.`latitude` `latitude`,\n                    `caches`.`wp_oc` `waypoint`,\n                    `caches`.`date_hidden` `date_hidden`,\n                    `caches`.`name` `name`,\n                    `caches`.`country` `countrycode`,\n                    `caches`.`terrain` `terrain`,\n                    `caches`.`difficulty` `difficulty`,\n                    `caches`.`desc_languages` `desc_languages`,\n                    `cache_size`.`name` `size`,\n                    `cache_size`.`id` `size_id`,\n                    `cache_type`.`name` `type`,\n                    `cache_type`.`id` `type_id`,\n                    `cache_status`.`name` `status`,\n                    `cache_status`.`id` `status_id`,\n                    `user`.`username` `username`,\n                    `user`.`user_id` `user_id`,\n                    `cache_desc`.`desc` `desc`,\n                    `cache_desc`.`short_desc` `short_desc`,\n                    `cache_desc`.`hint` `hint`,\n                    `cache_desc`.`desc_html` `html`,\n                    &searchtmp.`distance` `distance`,\n                    `sys_trans_text`.`text` `country`\n         FROM &searchtmp\n         INNER JOIN `caches` ON &searchtmp.`cache_id`=`caches`.`cache_id`\n         INNER JOIN `user` ON &searchtmp.`user_id`=`user`.`user_id`\n         INNER JOIN `cache_desc`\n             ON `caches`.`cache_id`=`cache_desc`.`cache_id` \n             AND `caches`.`default_desclang`=`cache_desc`.`language`\n         INNER JOIN `cache_type` ON `caches`.`type`=`cache_type`.`id`\n         INNER JOIN `cache_status` ON `caches`.`status`=`cache_status`.`id`\n         INNER JOIN `cache_size` ON `caches`.`size`=`cache_size`.`id`\n         LEFT JOIN `countries` ON `countries`.`short`=`caches`.`country`\n         LEFT JOIN `sys_trans_text` ON `sys_trans_text`.`trans_id`=`countries`.`trans_id`\n         AND `sys_trans_text`.`lang`='&1'", $opt['template']['locale']);
    while ($r = sql_fetch_array($rs)) {
        if (strlen($r['desc_languages']) > 2) {
            $r = get_locale_desc($r);
        }
        $thisline = $xmlLine;
        $lat = sprintf('%01.5f', $r['latitude']);
        $thisline = str_replace('{lat}', help_latToDegreeStr($lat), $thisline);
        $thisline = str_replace('{latvalue}', $lat, $thisline);
        $lon = sprintf('%01.5f', $r['longitude']);
        $thisline = str_replace('{lon}', help_lonToDegreeStr($lon), $thisline);
        $thisline = str_replace('{lonvalue}', $lon, $thisline);
        $time = date('d.m.Y', strtotime($r['date_hidden']));
        $thisline = str_replace('{time}', $time, $thisline);
        $thisline = str_replace('{waypoint}', $r['waypoint'], $thisline);
        $thisline = str_replace('{cacheid}', $r['cacheid'], $thisline);
        $thisline = str_replace('{cachename}', filterevilchars($r['name']), $thisline);
        $thisline = str_replace('{country}', text_xmlentities($r['country']), $thisline);
        $thisline = str_replace('{countryid}', $r['country'], $thisline);
        if ($r['hint'] == '') {
            $thisline = str_replace('{hints}', '', $thisline);
        } else {
            $thisline = str_replace('{hints}', str_rot13_gc(decodeEntities(filterevilchars(strip_tags($r['hint'])))), $thisline);
        }
        $thisline = str_replace('{shortdesc}', filterevilchars($r['short_desc']), $thisline);
        if ($r['html'] == 0) {
            $thisline = str_replace('{htmlwarn}', '', $thisline);
            $thisline = str_replace('{desc}', filterevilchars(strip_tags($r['desc'])), $thisline);
        } else {
            $thisline = str_replace('{htmlwarn}', ' (Text converted from HTML)', $thisline);
            $thisline = str_replace('{desc}', html2txt(filterevilchars($r['desc'])), $thisline);
        }
        $thisline = str_replace('{type}', $r['type'], $thisline);
        $thisline = str_replace('{typeid}', $r['type_id'], $thisline);
        $thisline = str_replace('{container}', $r['size'], $thisline);
        $thisline = str_replace('{sizeid}', $r['size_id'], $thisline);
        $thisline = str_replace('{status}', $r['status'], $thisline);
        $thisline = str_replace('{statusid}', $r['status_id'], $thisline);
        $difficulty = sprintf('%01.1f', $r['difficulty'] / 2);
        $thisline = str_replace('{difficulty}', $difficulty, $thisline);
        $terrain = sprintf('%01.1f', $r['terrain'] / 2);
        $thisline = str_replace('{terrain}', $terrain, $thisline);
        $thisline = str_replace('{owner}', filterevilchars($r['username']), $thisline);
        $thisline = str_replace('{ownerid}', filterevilchars($r['user_id']), $thisline);
        $thisline = str_replace('{distance}', text_xmlentities(sprintf("%01.1f", $r['distance'])), $thisline);
        $thisline = lf2crlf($thisline);
        if (!$db['debug']) {
            echo $thisline;
        }
    }
    mysql_free_result($rs);
    sql_drop_temp_table_slave('searchtmp');
    if (!$db['debug']) {
        echo "</result>\n";
    }
}
开发者ID:kirstenko,项目名称:oc-server3,代码行数:82,代码来源:search.xml.inc.php


示例5: array

                }
                $page['page'][$i]['souspage'][$j]['image_url'] = "";
                $page['page'][$i]['souspage'][$j]['image_largeur'] = "";
                $page['page'][$i]['souspage'][$j]['image_hauteur'] = "";
                $page['page'][$i]['souspage'][$j]['vignette_url'] = "";
                $page['page'][$i]['souspage'][$j]['vignette_largeur'] = "";
                $page['page'][$i]['souspage'][$j]['vignette_hauteur'] = "";
                $j++;
            }
        } else {
            $page['page'][$i]['souspage'] = array();
        }
        /* on recupere les infos de la premiere page pour les balises meta */
        if ($i == "0") {
            $page['meta_description'] = html2txt($ligne['page_summary']);
            $page['meta_keyword'] = html2txt($ligne['page_title'] . " " . $ligne['page_summary']);
            $page['meta_date'] = $ligne['page_date_edit'];
        }
        $i++;
    }
}
sql_free_result($res_page);
sql_close($sgbd);
if ($right_user['add_information']) {
    $page['link_add'] = convert_url("index.php?r=" . $lang['general']['idurl_information'] . "&v1=form_page");
} else {
    $page['link_add'] = "";
}
$_SESSION['menu_information'] = $page['page'];
$page['L_add'] = $lang['information']['add_page'];
$page['L_title'] = $lang['information']['information'];
开发者ID:jkreska,项目名称:test1,代码行数:31,代码来源:page_list.php


示例6: PageCodeOutbox

function PageCodeOutbox()
{
    global $memberID;
    global $dir;
    global $site;
    global $tmpl;
    global $date_format;
    $query = "\r\n\t\tSELECT\r\n\t\t\t`Messages`.`ID`,\r\n\t\t\tUNIX_TIMESTAMP( `Date` ) AS `timestamp`,\r\n\t\t\tDATE_FORMAT(`Date`, '{$date_format}') AS `Date`,\r\n\t\t\t`Recipient`,\r\n\t\t\t`Profiles`.`NickName` AS `RecipientNickName`,\r\n\t\t\t`Subject`,\r\n\t\t\t`New`\r\n\t\tFROM `Messages`\r\n\t\tLEFT JOIN `Profiles` ON\r\n\t\t\t`Profiles`.`ID` = `Recipient`\r\n\t\tWHERE `Sender` = {$memberID}\r\n\t\tORDER BY `Date` DESC\r\n\t\t";
    $rMsgs = db_res($query);
    if (!mysql_num_rows($rMsgs)) {
        return '<div class="no_result"><div>' . _t("_No messages in Outbox") . '</div></div>';
    }
    // --- get template and replace headers ---
    $aReplace = array();
    $aReplace['mailbox_header_img'] = '<img src="' . getTemplateIcon('outbox.gif') . '" class="mailbox_header_img" />';
    //$aReplace['summary'] = _t(
    $aReplace['flag'] = _t('_Flag');
    $aReplace['from'] = _t('_Recipient');
    $aReplace['date'] = _t('_Date');
    $aReplace['subject'] = _t('_Subject');
    $aReplace['click_to_sort'] = _t('_Click to sort');
    $aReplace['actions_l'] = '';
    $aReplace['actions'] = '';
    $ret = file_get_contents("{$dir['root']}templates/tmpl_{$tmpl}/mail_box.html");
    foreach ($aReplace as $key => $val) {
        $ret = str_replace("__{$key}__", $val, $ret);
    }
    $aMyTmpl = preg_split("/\\{\\/?InsertRows\\}/", $ret);
    $tmplRow = $aMyTmpl[1];
    $ret = "{$aMyTmpl[0]}{InsertRows /}{$aMyTmpl[2]}";
    $InsertRows = '';
    $tr_class = 'odd';
    while ($aMsg = mysql_fetch_assoc($rMsgs)) {
        $sSubject = process_line_output(html2txt($aMsg['Subject']));
        $aReplace = array();
        $aReplace['tr_class'] = $tr_class;
        $aReplace['new_add'] = $aMsg['New'] ? 'new' : '';
        $aReplace['ID'] = $aMsg['ID'];
        $aReplace['CheckBox'] = '';
        $aReplace['Flag'] = '<img class="mailbox_flag_img" src="' . getTemplateIcon($aMsg['New'] ? 'not_readed.gif' : 'readed.gif') . '" title="' . _t($aMsg['New'] ? '_Not Readed' : '_Readed') . '" />';
        $aReplace['From'] = "<!--{$aMsg['RecipientNickName']}--> <a href=\"{$site['url']}{$aMsg['RecipientNickName']}\">{$aMsg['RecipientNickName']}</a>";
        $aReplace['Date'] = "<!--{$aMsg['timestamp']}--> {$aMsg['Date']}";
        $aReplace['Subject'] = "<!--{$sSubject}--> <a href=\"{$site['url']}messages_outbox.php?message={$aMsg['ID']}\">{$sSubject}</a>";
        $sInsertRow = $tmplRow;
        foreach ($aReplace as $key => $val) {
            $sInsertRow = str_replace("{{$key}}", $val, $sInsertRow);
        }
        $sInsertRows .= $sInsertRow;
        $tr_class = $tr_class == 'odd' ? 'even' : 'odd';
    }
    $ret = str_replace("{InsertRows /}", $sInsertRows, $ret);
    return $ret;
}
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:53,代码来源:mail.php


示例7: sendMail

/**
 * Send email function
 *
 * @param string $sRecipientEmail		- Email where email should be send
 * @param string $sMailSubject			- subject of the message
 * @param string $sMailBody				- Body of the message
 * @param integer $iRecipientID			- ID of recipient profile
 * @param array $aPlus					- Array of additional information
 *
 *
 * @return boolean 						- trie if message was send
 * 										- false if not
 */
function sendMail($sRecipientEmail, $sMailSubject, $sMailBody, $iRecipientID = 0, $aPlus = array(), $sEmailFlag = 'html', $isDisableAlert = false, $bForceSend = false)
{
    global $site;
    if (!$sRecipientEmail || preg_match('/\\(2\\)$/', $sRecipientEmail)) {
        return false;
    }
    if ($iRecipientID) {
        $aRecipientInfo = getProfileInfo($iRecipientID);
    }
    // don't send mail to the user if he/she decided to not receive any site's notifications, unless it is critical emails (like email confirmation)
    if (!$bForceSend) {
        $aRealRecipient = $GLOBALS['MySQL']->getRow("SELECT * FROM `Profiles` WHERE `Email`='" . process_db_input($sRecipientEmail, BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION) . "' LIMIT 1");
        if ($aRealRecipient && 1 != $aRealRecipient['EmailNotify']) {
            return true;
        }
    }
    $sEmailNotify = isset($GLOBALS['site']['email_notify']) ? $GLOBALS['site']['email_notify'] : getParam('site_email_notify');
    $sSiteTitle = isset($GLOBALS['site']['title']) ? $GLOBALS['site']['title'] : getParam('site_title');
    $sMailHeader = "From: =?UTF-8?B?" . base64_encode($sSiteTitle) . "?= <{$sEmailNotify}>";
    $sMailParameters = "-f{$sEmailNotify}";
    if ($aPlus || $iRecipientID) {
        if (!is_array($aPlus)) {
            $aPlus = array();
        }
        bx_import('BxDolEmailTemplates');
        $oEmailTemplates = new BxDolEmailTemplates();
        $sMailSubject = $oEmailTemplates->parseContent($sMailSubject, $aPlus, $iRecipientID);
        $sMailBody = $oEmailTemplates->parseContent($sMailBody, $aPlus, $iRecipientID);
    }
    $sMailSubject = '=?UTF-8?B?' . base64_encode($sMailSubject) . '?=';
    $sMailHeader = "MIME-Version: 1.0\r\n" . $sMailHeader;
    if (!$isDisableAlert && 'on' == getParam('bx_smtp_on')) {
        return BxDolService::call('smtpmailer', 'send', array($sRecipientEmail, $sMailSubject, $sMailBody, $sMailHeader, $sMailParameters, 'html' == $sEmailFlag, $aRecipientInfo));
    }
    if ('html' == $sEmailFlag) {
        $sMailHeader = "Content-type: text/html; charset=UTF-8\r\n" . $sMailHeader;
        $iSendingResult = mail($sRecipientEmail, $sMailSubject, $sMailBody, $sMailHeader, $sMailParameters);
    } else {
        $sMailHeader = "Content-type: text/plain; charset=UTF-8\r\n" . $sMailHeader;
        $sMailBody = html2txt($sMailBody);
        $iSendingResult = mail($sRecipientEmail, $sMailSubject, html2txt($sMailBody), $sMailHeader, $sMailParameters);
    }
    if (!$isDisableAlert) {
        //--- create system event
        bx_import('BxDolAlerts');
        $aAlertData = array('email' => $sRecipientEmail, 'subject' => $sMailSubject, 'body' => $sMailBody, 'header' => $sMailHeader, 'params' => $sMailParameters, 'html' => 'html' == $sEmailFlag ? true : false);
        $oZ = new BxDolAlerts('profile', 'send_mail', $aRecipientInfo['ID'], '', $aAlertData);
        $oZ->alert();
    }
    return $iSendingResult;
}
开发者ID:blas-dmx,项目名称:dolphin.pro,代码行数:64,代码来源:utils.inc.php


示例8: urldecode

<?php

/**
 * YoutubeGallery for Joomla!
 * @version 4.3.6
 * @author Ivan Komlev< <[email protected]>
 * @link http://www.joomlaboat.com
 * @GNU General Public License
 **/
// No direct access to this file
//defined('_JEXEC') or die('Restricted access');
//require_once(JPATH_SITE.DS.'components'.DS.'com_youtubegallery'.DS.'includes'.DS.'misc.php');
$videofile = urldecode($_GET['videofile']);
$videofile = html2txt($videofile);
//YouTubeGalleryMisc::
$videofile = '../../../' . $videofile;
if (!file_exists($videofile)) {
    echo 'File not found.';
    die;
}
require_once 'flv4php/FLV.php';
$flv = new FLV($videofile);
echo $flv->getFlvThumb();
function html2txt($document)
{
    $search = array('@<script[^>]*?>.*?</script>@si', '@<[\\/\\!]*?[^<>]*?>@si', '@<style[^>]*?>.*?</style>@siU', '@<![\\s\\S]*?--[ \\t\\n\\r]*>@');
    $text = preg_replace($search, '', $document);
    return $text;
}
开发者ID:brenot,项目名称:forumdesenvolvimento,代码行数:29,代码来源:flvthumbnail.php


示例9: limit_words

function limit_words($string, $word_limit)
{
    $words = explode(' ', $string);
    $toremove = array('—', '“', '"', ',', '.', '-', '?', '•', ',', '.', ':', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '-', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '.', ';', '{', '}', '[', ']', '|', '/', '<', '>', '+', '=');
    $words = str_replace($toremove, "", $words);
    $words = preg_replace('/[\\r\\n\\t\\s]+/s', ' ', $words);
    $words = html2txt($words);
    return implode(' ', array_splice($words, 0, $word_limit));
}
开发者ID:j0rg3m414,项目名称:centerar,代码行数:9,代码来源:datso.functions.php


示例10: array

$page['value_text'] = "";
$page['value_id'] = "";
$page['value_topic'] = "";
$page['erreur'] = array();
$page['form_action'] = convert_url("index.php?r=" . $lang['general']['idurl_forum'] . "&v1=" . $forum['forum_idurl']);
/* modification ou add */
if (isset($_POST) and !empty($_POST)) {
    /* we format datas */
    $_POST['title'] = format_txt($_POST['title']);
    $_POST['text'] = trim($_POST['text']);
    /* verification des infos */
    if (!isset($_POST['title']) or $_POST['title'] == "") {
        $page['erreur'][$nb_erreur]['message'] = $lang['forum']['E_empty_title'];
        $nb_erreur++;
    }
    if (!isset($_POST['text']) or trim(html2txt($_POST['text'])) == "") {
        $page['erreur'][$nb_erreur]['message'] = $lang['forum']['E_empty_message'];
        $nb_erreur++;
    }
    /* we format datas */
    if (isset($_SESSION['session_member_id']) and !empty($_SESSION['session_member_id'])) {
        $_POST['member'] = $_SESSION['session_member_id'];
    } else {
        $_POST['member'] = 0;
    }
    $_POST['forum'] = $forum['forum_id'];
    $_POST['ip'] = $_SERVER['REMOTE_ADDR'];
    if (!isset($_POST['topic']) or $_POST['topic'] == "") {
        $_POST['topic'] = "0";
    }
    # the field email must not be filled in otherwise it mey be a spam robot
开发者ID:jkreska,项目名称:test1,代码行数:31,代码来源:topic_list.php


示例11: txtAlfabetico

function txtAlfabetico()
{
    $txt = ucfirst(LABEL_Titulo) . ': ' . $_SESSION["CFGTitulo"] . "\r\n";
    $txt .= ucfirst(LABEL_Autor) . ': ' . $_SESSION["CFGAutor"] . "\r\n";
    $txt .= ucfirst(LABEL_Keywords) . ': ' . $_SESSION["CFGKeywords"] . "\r\n";
    $txt .= ucfirst(LABEL_Cobertura) . ': ' . $_SESSION["CFGCobertura"] . "\r\n";
    $txt .= LABEL_URI . ': ' . $_SESSION["CFGURL"] . "\r\n";
    $txt .= ucfirst(LABEL_Version) . ': ' . $_SESSION["CFGVersion"] . "\r\n";
    $txt .= "__________________________________________________________________________\r\n";
    //Lista de todos los términos
    $sql = SQLlistaTemas();
    while ($arrayTema = mysqli_fetch_array($sql[datos])) {
        #Mantener vivo el navegador
        $time_now = time();
        if ($time_start >= $time_now + 10) {
            $time_start = $time_now;
            header('X-pmaPing: Pong');
        }
        // Diferenciar entre términos preferidos y términos no preferidos o referencias
        if ($arrayTema[t_relacion]) {
            //Remisiones de equivalencias y no preferidos
            $sqlNoPreferidos = SQLterminosValidosUF($arrayTema[id]);
            while ($arrayNoPreferidos = mysqli_fetch_array($sqlNoPreferidos[datos])) {
                $acronimo = arrayReplace(array("4", "5", "7", "8"), array(USE_termino, EQ_acronimo, EQP_acronimo, NEQ_acronimo), $arrayNoPreferidos[t_relacion]);
                $referencia_mapeo = $arrayNoPreferidos[vocabulario_id] !== '1' ? ' (' . $arrayNoPreferidos[titulo] . ' / ' . $arrayNoPreferidos[idioma] . ')' : '' . "\r\n";
                $txt .= "\n" . $arrayTema[tema] . $referencia_mapeo;
                $txt .= '	' . $acronimo . ': ' . $arrayNoPreferidos[tema_pref] . "\r\n";
            }
        } else {
            // Si es preferido: mostar notas y relaciones
            $txt .= "\n" . $arrayTema[tema] . "\r\n";
            $txt .= LABEL_fecha_creacion . ': ' . $arrayTema[cuando] . "\r\n";
            if ($arrayTema[cuando_final] > $arrayTema[cuando]) {
                $txt .= LABEL_fecha_modificacion . ': ' . $arrayTema[cuando_final] . "\r\n";
            }
            //Notas
            $sqlNotas = SQLdatosTerminoNotas($arrayTema[id], array("NB", "NH", "NA", "NC"));
            while ($arrayNotas = mysqli_fetch_array($sqlNotas[datos])) {
                $acronimo = arrayReplace(array("NB", "NH", "NA", "NC"), array(NB_acronimo, NH_acronimo, NA_acronimo, NC_acronimo), $arrayNotas[tipo_nota]);
                $txt .= '	' . $acronimo . ': ' . html2txt($arrayNotas[nota]) . "\r\n";
            }
            //Relaciones
            $sqlRelaciones = SQLverTerminoRelaciones($arrayTema[id]);
            $arrayRelacionesVisibles = array("2", "3", "4");
            // TG/TE/UP /TR
            while ($arrayRelaciones = mysqli_fetch_array($sqlRelaciones[datos])) {
                if (in_array($arrayRelaciones[t_relacion], $arrayRelacionesVisibles)) {
                    $acronimo = arrayReplace($arrayRelacionesVisibles, array(TR_acronimo, TG_acronimo, UP_acronimo), $arrayRelaciones[t_relacion]);
                    $txt .= '	' . $acronimo . ': ' . $arrayRelaciones[tema] . "\r\n";
                }
            }
            //Terminos especificos
            $SQLTerminosE = SQLverTerminosE($arrayTema[id]);
            while ($arrayTE = mysqli_fetch_array($SQLTerminosE[datos])) {
                $txt .= '	' . TE_acronimo . ': ' . $arrayTE[tema] . "\r\n";
            }
        }
    }
    $filname = string2url($_SESSION[CFGTitulo] . ' ' . MENU_ListaAbc) . '.txt';
    return sendFile("{$txt}", "{$filname}");
}
开发者ID:jpgil,项目名称:tematres-mirror,代码行数:61,代码来源:fun.admin.php


示例12: preg_replace

     $title = preg_replace('/[^(\\x20-\\x7F)]*/', '', trim(strip_tags($matches[0][0])));
 } else {
     $title = '';
 }
 // Turns out PHP has a function for extracting meta tags for us, the only
 // catch is that it works on files, so we fake a file by creating one using
 // base64 encode and string concaternation
 $tmp = get_meta_tags("data://{$mime};base64," . base64_encode($content));
 if (isset($tmp['description'])) {
     $desc = preg_replace('/[^(\\x20-\\x7F)]*/', '', trim($tmp['description']));
 } else {
     $desc = '';
 }
 // This is the rest of the content. We try to clean it somewhat using
 // the custom function html2text which works 90% of the tiem
 $content = preg_replace('/[^(\\x20-\\x7F)]*/', '', trim(strip_tags(html2txt($content))));
 // If values arent set lets try to set them here. Start with desc
 // using content and then try the title using desc
 if ($desc == '' && $content != '') {
     $desc = substr($content, 0, 200) . '...';
 }
 if ($title == '' && $desc != '') {
     $title = substr($desc, 0, 50) . '...';
 }
 $count++;
 // If we dont have a title, then we dont have desc or content
 // so lets not add it to the index
 if ($title != '') {
     $toindex[] = array($url, $title, $desc, $rank);
     echo 'INDEXING ' . $count . "\r\n";
 } else {
开发者ID:Ramaniks,项目名称:Phindex,代码行数:31,代码来源:add.php


示例13: Answers_Info

 function Answers_Info($user_data)
 {
     $arr = $user_data['parameters']['res'];
     $res = '<table class="data">' . "\n";
     $p = $this->Problems_AllById($user_data['contest_id']);
     $tasks = $user_data['parameters']['tasks'];
     $opened = false;
     $n = count($arr);
     $i = 0;
     while ($i < $n) {
         $m = min(10, $n - $i);
         $res .= '  <tr>' . "\n    ";
         for ($j = 0; $j < $m; $j++) {
             $pr = $p[$tasks[$i]['problem_id']];
             $res .= '<th><span title="' . htmlspecialchars(html2txt($pr['description'])) . '">' . ($i + 1) . '</span></th>';
             $i++;
         }
         for ($j = $m; $j < 10; $j++) {
             $res .= '<td class="void"></td>';
         }
         $res .= '  </tr>' . "\n";
         $i -= $m;
         $res .= '  <tr>' . "\n    ";
         for ($j = 0; $j < $m; $j++) {
             $title = '';
             $pr = $p[$tasks[$i]['problem_id']];
             if (!$arr[$i]) {
                 $lib = new $pr['settings']['anstype']();
                 $title = htmlspecialchars('Ответ участника: ' . $lib->GetUserAnswerText($pr, $user_data['parameters']['user_answers'][$i], $i));
                 $title .= htmlspecialchars(' | Верный ответ: ' . $lib->GetCorrectAnswerText($pr));
             }
             $res .= '<td' . ($arr[$i] ? ' style="background: #cfc"' : '') . '>' . ($arr[$i] ? '+' : '<span title="' . $title . '">-</span>') . '</td>';
             $i++;
         }
         for ($j = $m; $j < 10; $j++) {
             $res .= '<td class="void"></td>';
         }
         $res .= '  </tr>' . "\n";
     }
     $res .= '</table>' . "\n";
     return $res;
 }
开发者ID:Nazg-Gul,项目名称:e-marsa,代码行数:42,代码来源:02CGMTesting.php


示例14: txt4term

function txt4term($tema_id, $params = array())
{
    $arrayTema = ARRAYverTerminoBasico($tema_id);
    $txt .= "\n" . $arrayTema[tema] . "\r\n";
    $label_target_vocabulary = '';
    $txt .= $params["includeCreatedDate"] == 1 ? LABEL_fecha_creacion . ': ' . $arrayTema[cuando] . "\r\n" : '';
    if ($arrayTema[cuando_final] > $arrayTema[cuando] && $params["includeModDate"] == 1) {
        $txt .= LABEL_fecha_modificacion . ': ' . $arrayTema[cuando_final] . "\r\n";
    }
    //Notas
    $sqlNotas = SQLdatosTerminoNotas($arrayTema[tema_id]);
    while ($arrayNotas = $sqlNotas->FetchRow()) {
        $arrayNotas[label_tipo_nota] = in_array($arrayNotas[ntype_id], array(8, 9, 10, 11, 15)) ? arrayReplace(array(8, 9, 10, 11, 15), array(LABEL_NA, LABEL_NH, LABEL_NB, LABEL_NP, LABEL_NC), $arrayNotas[ntype_id]) : $arrayNotas[ntype_code];
        if ($arrayNotas[tipo_nota] !== 'NP' && in_array($arrayNotas[tipo_nota], $params["includeNote"])) {
            $txt .= '	' . $arrayNotas[label_tipo_nota] . ': ' . html2txt($arrayNotas[nota]) . "\r\n";
        }
    }
    //Relaciones
    $sqlRelaciones = SQLverTerminoRelaciones($arrayTema[tema_id]);
    $arrayRelacionesVisibles = array(2, 3, 4, 5, 6, 7);
    // TG/TE/UP/TR
    while ($arrayRelaciones = $sqlRelaciones->FetchRow()) {
        if (in_array($arrayRelaciones[t_relacion], $arrayRelacionesVisibles)) {
            $acronimo = arrayReplace($arrayRelacionesVisibles, array(TR_acronimo, TG_acronimo, UP_acronimo, EQP_acronimo, EQ_acronimo, NEQ_acronimo), $arrayRelaciones[t_relacion]);
            if (in_array($arrayRelaciones[t_relacion], array(5, 6, 7))) {
                //términos equivalentes .. se concatenan después de los TE/NT
                $label_target_vocabulary .= '	' . $acronimo . ': ' . $arrayRelaciones[tema] . ' (' . $arrayRelaciones[titulo] . ')' . "\r\n";
            } else {
                $txt .= '	' . $acronimo . $arrayRelaciones[rr_code] . ': ' . $arrayRelaciones[tema] . "\r\n";
            }
        }
    }
    //Terminos especificos
    $SQLTerminosE = SQLverTerminosE($arrayTema[tema_id]);
    while ($arrayTE = $SQLTerminosE->FetchRow()) {
        $txt .= '	' . TE_acronimo . $arrayTE[rr_code] . ': ' . $arrayTE[tema] . "\r\n";
    }
    $txt .= $label_target_vocabulary;
    //Terminos equivalentes web services
    $SQLtargetTerms = SQLtargetTerms($arrayTema[tema_id]);
    while ($arrayTT = $SQLtargetTerms->FetchRow()) {
        $txt .= '	' . FixEncoding(ucfirst($arrayTT[tvocab_label])) . ': ' . FixEncoding($arrayTT[tterm_string]) . "\r\n";
    }
    return $txt;
}
开发者ID:kodizant,项目名称:TemaTres-Vocabulary-Server,代码行数:45,代码来源:fun.admin.php


示例15: test_ppt

 function test_ppt()
 {
     global $CONF;
     //don't run test if utility not on this machine
     if ($this->extractor->supported_formats['.ppt']['supported']) {
         $filename = $CONF['path_test'] . 'data/test.ppt';
         $content = "\n" . $filename . "\n&nbsp;\nCreated with pptHtml\n\n";
         //not happy with this - this is a watermark this version of ppthtml inserts
         $r = $this->extractor->extract($filename);
         $this->assertEqual($content, html2txt($r));
     }
 }
开发者ID:bufvc,项目名称:bufvc-potnia-framework,代码行数:12,代码来源:testTextExtractor.php


示例16: do_meta_tag

function do_meta_tag($arrayTermino = "")
{
    global $CFG;
    //Si hay algún tema de proveniente de algún proceso
    global $tema;
    if (secure_data($tema, "digit")) {
        //Si hay tema_id desde GET o PORS
        $tema_id = $_POST[tema] ? $_POST[tema] : $_GET[tema];
        //Si hay tema_id desde algún proceso
        $tema_id = $tema ? $tema : $tema_id;
    }
    if (secure_data($tema_id, "digit")) {
        $ARRAYdatosTermino = ARRAYverDatosTermino(secure_data($tema_id, "digit"));
        $sub_title = '; ' . xmlentities($ARRAYdatosTermino[titTema]);
        $ver_sub_title = xmlentities($ARRAYdatosTermino[titTema]) . ' - ';
        $relMeta = '<link rel="Dublin Core metadata" type="application/xml" href="xml.php?dcTema=' . $ARRAYdatosTermino[idTema] . '" title="Dublin Core ' . xmlentities($datosTermino[titTema]) . '" />';
        $relMeta .= '<link rel="MADS metadata" type="application/xml" href="xml.php?madsTema=' . $ARRAYdatosTermino[idTema] . '" title="MADS ' . xmlentities($datosTermino[titTema]) . '" />';
        $relMeta .= '<link rel="Zthes metadata" type="application/xml" href="xml.php?zthesTema=' . $ARRAYdatosTermino[idTema] . '" title="Zthes ' . xmlentities($datosTermino[titTema]) . '" />';
        $relMeta .= '<link rel="Skos metadata" type="application/rdf+xml" href="xml.php?skosTema=' . $ARRAYdatosTermino[idTema] . '" title="Skos Core ' . xmlentities($datosTermino[titTema]) . '" />';
        $relMeta .= '<link rel="TopicMap metadata" type="application/xml" href="xml.php?xtmTema=' . $ARRAYdatosTermino[idTema] . '" title="TopicMap ' . xmlentities($datosTermino[titTema]) . '" />';
    } elseif (secure_data($_GET[letra], "alnum")) {
        $sub_title = '; ' . MSG_ResultLetra . ' ' . xmlentities($_REQUEST[letra]);
        $ver_sub_title = ' :: ' . MENU_ListaAbc . ': ' . xmlentities($_REQUEST[letra]);
    }
    $meta_tag = '<title>' . xmlentities($ver_sub_title . ' ' . $_SESSION[CFGTitulo]) . '</title>';
    /*
     * Error en verificación
    	$meta_tag.='<meta http-equiv="content-language" content="'.LANG.'" />';
    */
    $meta_tag .= '<meta http-equiv="content-type" content="application/xhtml+xml; charset=' . $CFG["_CHAR_ENCODE"] . '" />';
    $meta_tag .= '<meta name="generator" content="' . xmlentities($_SESSION[CFGVersion]) . '" />';
    $meta_tag .= '<meta name="description" content="' . html2txt($ver_sub_title . $_SESSION[CFGCobertura]) . '" />';
    $meta_tag .= '<meta name="keywords" content="' . xmlentities($_SESSION[CFGKeywords] . $sub_title) . '" />';
    $meta_tag .= '<meta name="author" content="' . xmlentities($_SESSION[CFGAutor]) . '" />';
    $meta_tag .= '<meta name="Creation_Date" content="' . $_SESSION[CFGCreacion] . '" />';
    $meta_tag .= '<meta name="robots" content="index, follow" />';
    $meta_tag .= '<meta name="revisit-after" content="15 days" />';
    //$meta_tag.='<!-- Dublin Core -->';
    $meta_tag .= '<meta name="DC.Title"        content="' . xmlentities($ver_sub_title . ' ' . $_SESSION[CFGTitulo]) . '" />';
    $meta_tag .= '<meta name="DC.Creator"      content="' . xmlentities($_SESSION[CFGAutor]) . '" />';
    $meta_tag .= '<meta name="DC.Subject"      content="' . xmlentities($_SESSION[CFGKeywords] . $sub_title) . '" />';
    $meta_tag .= '<meta name="DC.Description"  content="' . html2txt($ver_sub_title . $_SESSION[CFGCobertura], true) . '" />';
    $meta_tag .= '<meta name="DC.Publisher"    content="' . xmlentities($_SESSION[CFGAutor]) . '" />';
    $meta_tag .= '<meta name="DC.Date"         content="' . $_SESSION[CFGCreacion] . '" />';
    $meta_tag .= '<meta name="DC.Language"     content="' . LANG . '" />';
    $meta_tag .= '<link rel="' . MENU_Inicio . '" href="' . $_SESSION[CFGURL] . 'index.php" title="' . MENU_Inicio . '" />';
    $meta_tag .= '<link rel="' . MENU_ListaSis . '" href="' . $_SESSION[CFGURL] . 'index.php" title="' . MENU_ListaSis . '" />';
    $meta_tag .= '<link rel="' . MENU_ListaAbc . '" href="' . $_SESSION[CFGURL] . 'index.php?letra=?" title="' . MENU_ListaAbc . '" />';
    $meta_tag .= '<link rel="' . MENU_Sobre . '" href="' . $_SESSION[CFGURL] . 'sobre.php" title="' . MENU_Sobre . '" />';
    $meta_tag .= '<link rel="rss" type="application/rss+xml" href="xml.php?rss=true" title="RSS ' . xmlentities($_SESSION[CFGTitulo]) . '" />';
    $meta_tag .= '<link rel="alternate" type="application/rss+xml" href="xml.php?rss=true" title="RSS ' . xmlentities($_SESSION[CFGTitulo]) . '" />';
    $meta_tag .= $relMeta;
    return array("metadata" => $meta_tag, "arraydata" => $ARRAYdatosTermino);
}
开发者ID:jpgil,项目名称:tematres-mirror,代码行数:54,代码来源:fun.xml.php


示例17: ob_get_contents

    $tpl->display("string:" . $tploutput);
}
$smarty_output = ob_get_contents();
//接收快取頁面
ob_end_clean();
//--檔案授權參數
$_SESSION['file_auth']['jones_demo'] = '1';
$_SESSION["fileauth_array"]['jones_demo'] = array();
$_SESSION["fileauth_time_array"]['jones_demo'] = array();
//--seo處理
if (extension_loaded('zlib')) {
    ob_start('ob_gzhandler');
}
header('Last-Modified: ' . gmdate('D, d M Y') . ' 00:00:00' . ' GMT', true, 200);
//--最後頁面編輯時間
header('Date: ' . gmdate('D, d M Y H:i:s') . ' GMT', true, 200);
header('Expires: ' . gmdate('D, d M Y H:i:s', mktime(0, 0, 0, 1, 1, 1998)) . ' GMT', true, 200);
//--快取時間
echo html2txt($smarty_output);
ob_end_flush();
$conn->close();
unset($design);
unset($mail);
unset($tpl);
unset($conn);
function html2txt($document)
{
    $search = array('/<!--(.*)-->/Uis', '/\\/\\*(.*)\\*\\//');
    $text = preg_replace($search, '', $document);
    return $text;
}
开发者ID:Jonesyei,项目名称:modelphp,代码行数:31,代码来源:index.php


示例18: sql_free_result

sql_free_result($res_sous_page);
sql_close($sgbd);
# modification
$page['link_edit'] = "";
$page['link_delete'] = "";
if ($right_user['edit_information']) {
    $page['link_edit'] = convert_url("index.php?r=" . $lang['general']['idurl_information'] . "&v1=form_page&v2=" . $page['page_id']);
}
if ($right_user['delete_information']) {
    $page['link_delete'] = convert_url("index.php?r=" . $lang['general']['idurl_information'] . "&v1=page_list&v2=delete&v3=" . $page['page_id']);
}
/* add de la visit */
$var['id'] = $page['page_id'];
$sql_visit = sql_replace($sql[ 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP html2unicode函数代码示例发布时间:2022-05-15
下一篇:
PHP html2text函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap