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

PHP shorten函数代码示例

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

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



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

示例1: ajax_qsearch

/**
 * Searches for matching pagenames
 *
 * @author Andreas Gohr <[email protected]>
 */
function ajax_qsearch()
{
    global $conf;
    global $lang;
    $query = cleanID($_POST['q']);
    if (empty($query)) {
        $query = cleanID($_GET['q']);
    }
    if (empty($query)) {
        return;
    }
    require_once DOKU_INC . 'inc/html.php';
    require_once DOKU_INC . 'inc/fulltext.php';
    $data = array();
    $data = ft_pageLookup($query);
    if (!count($data)) {
        return;
    }
    print '<strong>' . $lang['quickhits'] . '</strong>';
    print '<ul>';
    foreach ($data as $id) {
        print '<li>';
        $ns = getNS($id);
        if ($ns) {
            $name = shorten(noNS($id), ' (' . $ns . ')', 30);
        } else {
            $name = $id;
        }
        print html_wikilink(':' . $id, $name);
        print '</li>';
    }
    print '</ul>';
}
开发者ID:jalemanyf,项目名称:wsnlocalizationscala,代码行数:38,代码来源:ajax.php


示例2: ajax_qsearch

/**
 * Searches for matching pagenames
 *
 * @author Andreas Gohr <[email protected]>
 */
function ajax_qsearch()
{
    global $conf;
    global $lang;
    $query = $_POST['q'];
    if (empty($query)) {
        $query = $_GET['q'];
    }
    if (empty($query)) {
        return;
    }
    $data = ft_pageLookup($query, true, useHeading('navigation'));
    if (!count($data)) {
        return;
    }
    print '<strong>' . $lang['quickhits'] . '</strong>';
    print '<ul>';
    foreach ($data as $id => $title) {
        if (useHeading('navigation')) {
            $name = $title;
        } else {
            $ns = getNS($id);
            if ($ns) {
                $name = shorten(noNS($id), ' (' . $ns . ')', 30);
            } else {
                $name = $id;
            }
        }
        echo '<li>' . html_wikilink(':' . $id, $name) . '</li>';
    }
    print '</ul>';
}
开发者ID:stretchyboy,项目名称:dokuwiki,代码行数:37,代码来源:ajax.php


示例3: get_text_for_indexing_ppt

/**
* @param object $resource
* @uses $CFG
*/
function get_text_for_indexing_ppt(&$resource, $directfile = '')
{
    global $CFG;
    $indextext = null;
    // SECURITY : do not allow non admin execute anything on system !!
    if (!has_capability('moodle/site:doanything', get_context_instance(CONTEXT_SYSTEM))) {
        return;
    }
    if ($directfile == '') {
        $text = implode('', file("{$CFG->dataroot}/{$resource->course}/{$resource->reference}"));
    } else {
        $text = implode('', file("{$CFG->dataroot}/{$directfile}"));
    }
    $remains = $text;
    $fragments = array();
    while (preg_match('/\\x00\\x9F\\x0F\\x04.{9}(......)(.*)/s', $remains, $matches)) {
        $unpacked = unpack("ncode/Llength", $matches[1]);
        $sequencecode = $unpacked['code'];
        $length = $unpacked['length'];
        // print "length : ".$length." ; segment type : ".sprintf("%x", $sequencecode)."<br/>";
        $followup = $matches[2];
        // local system encoding sequence
        if ($sequencecode == 0xa80f) {
            $aFragment = substr($followup, 0, $length);
            $remains = substr($followup, $length);
            $fragments[] = $aFragment;
        } elseif ($sequencecode == 0xa00f) {
            $aFragment = substr($followup, 0, $length);
            // $aFragment = mb_convert_encoding($aFragment, 'UTF-16', 'UTF-8');
            $aFragment = preg_replace('/\\xA0\\x00\\x19\\x20/s', "'", $aFragment);
            // some quotes
            $aFragment = preg_replace('/\\x00/s', "", $aFragment);
            $remains = substr($followup, $length);
            $fragments[] = $aFragment;
        } else {
            $remains = $followup;
        }
    }
    $indextext = implode(' ', $fragments);
    $indextext = preg_replace('/\\x19\\x20/', "'", $indextext);
    // some quotes
    $indextext = preg_replace('/\\x09/', '', $indextext);
    // some extra chars
    $indextext = preg_replace('/\\x0D/', "\n", $indextext);
    // some quotes
    $indextext = preg_replace('/\\x0A/', "\n", $indextext);
    // some quotes
    $indextextprint = implode('<hr/>', $fragments);
    // debug code
    // $logppt = fopen("C:/php5/logs/pptlog", "w");
    // fwrite($logppt, $indextext);
    // fclose($logppt);
    if (!empty($CFG->block_search_limit_index_body)) {
        $indextext = shorten($text, $CFG->block_search_limit_index_body);
    }
    $indextext = mb_convert_encoding($indextext, 'UTF8', 'auto');
    return $indextext;
}
开发者ID:arshanam,项目名称:Moodle-ITScholars-LMS,代码行数:62,代码来源:physical_ppt.php


示例4: search

 /**
  * Search
  *
  * Performs the search and stores results
  *
  * @param string $query
  */
 function search($query = '', $page = 0)
 {
     $this->CI->load->helper('shorten');
     // content search
     $content_types = unserialize(setting('search_content_types'));
     if (!empty($content_types)) {
         $this->CI->load->model('publish/content_model');
         $this->CI->load->model('publish/content_type_model');
         $this->CI->load->model('custom_fields_model');
         foreach ($content_types as $type => $summary_field) {
             $content = $this->CI->content_model->get_contents(array('keyword' => $query, 'type' => $type, 'sort' => 'relevance', 'sort_dir' => 'DESC', 'limit' => '50'));
             if (!empty($content)) {
                 foreach ($content as $item) {
                     // prep summary field
                     if (!empty($summary_field)) {
                         $item['summary'] = shorten(strip_tags($item[$summary_field]), setting('search_trim'), TRUE);
                     }
                     $item['result_type'] = 'content';
                     $this->content_results[$item['id']] = $item;
                     $this->relevance_keys['content|' . $item['id']] = $item['relevance'];
                 }
             }
         }
     }
     // product search
     if (setting('search_products') == '1' and module_installed('store')) {
         $this->CI->load->model('store/products_model');
         $products = $this->CI->products_model->get_products(array('keyword' => $query, 'sort' => 'relevance', 'sort_dir' => 'DESC', 'limit' => '50'));
         if (!empty($products)) {
             foreach ($products as $product) {
                 // prep summary field
                 $product['summary'] = shorten(strip_tags($product['description']), setting('search_trim'), TRUE);
                 $product['result_type'] = 'product';
                 $this->product_results[$product['id']] = $product;
                 $this->relevance_keys['product|' . $product['id']] = $product['relevance'];
             }
         }
     }
     // sort results
     arsort($this->relevance_keys);
     // put together final results array
     foreach ($this->relevance_keys as $item => $relevance) {
         list($type, $id) = explode('|', $item);
         if ($type == 'content') {
             $this->results[] = $this->content_results[$id];
         } elseif ($type == 'product') {
             $this->results[] = $this->product_results[$id];
         }
     }
     // how many total results?
     $this->total_results = count($this->results);
     if ($this->total_results == 0) {
         return array();
     }
     // grab the segment of the array corresponding to our page
     return array_slice($this->results, $page * $this->results_per_page, $this->results_per_page);
 }
开发者ID:Rotron,项目名称:hero,代码行数:64,代码来源:search_results.php


示例5: do_print

function do_print($row_in)
{
    global $today, $today_ref, $line_ctr, $units_str, $severities;
    if (empty($today)) {
        $today_ref = date("z", $row_in['problemstart']);
        $today = substr(format_date($row_in['problemstart']), 0, 5);
    } else {
        if (!($today_ref == date("z", $row_in['problemstart']))) {
            // date change?
            $today_ref = date("z", $row_in['problemstart']);
            $today = substr(format_date($row_in['problemstart']), 0, 5);
        }
    }
    $def_city = get_variable('def_city');
    $def_st = get_variable('def_st');
    print "<TR CLASS= ''>\n";
    print "<TD>{$today}</TD>\n";
    //		Date -
    $problemstart = format_date($row_in['problemstart']);
    $problemstart_sh = short_ts($problemstart);
    print "<TD onMouseover=\"Tip('{$problemstart}');\" onmouseout='UnTip();'>{$problemstart_sh}</TD>\n";
    //		start
    $problemend = format_date($row_in['problemend']);
    $problemend_sh = short_ts($problemend);
    print "<TD onMouseover=\"Tip('{$problemend}');\" onmouseout='UnTip();'>{$problemend_sh}</TD>\n";
    //		end
    $elapsed = my_date_diff($row_in['problemstart'], $row_in['problemend']);
    print "<TD>{$elapsed}</TD>\n";
    //		Ending time
    print "<TD ALIGN='center'>{$severities[$row_in['severity']]}</TD>\n";
    $scope = $row_in['tick_scope'];
    $scope_sh = shorten($row_in['tick_scope'], 20);
    print "<TD onMouseover=\"Tip('{$scope}');\" onmouseout='UnTip();'>{$scope_sh}</TD>\n";
    //		Call type
    $comment = $row_in['comments'];
    $short_comment = shorten($row_in['comments'], 50);
    print "<TD onMouseover=\"Tip('{$comment}');\" onMouseout='UnTip();'>{$short_comment}</TD>\n";
    //		Comments/Disposition
    $facility = $row_in['facy_name'];
    $facility_sh = shorten($row_in['facy_name'], 16);
    print "<TD onMouseover=\"Tip('{$facility}');\" onmouseout='UnTip();'>{$facility_sh}</TD>\n";
    //		Facility
    $city = $row_in['tick_city'] == $def_city ? "" : ", {$row_in['tick_city']}";
    $st = $row_in['tick_state'] == $def_st ? "" : ", {$row_in['tick_state']}";
    $addr = "{$row_in['tick_street']}{$city}{$st}";
    $addr_sh = shorten($row_in['tick_street'] . $city . $st, 20);
    print "<TD onMouseover=\"Tip('{$addr}');\" onMouseout='UnTip();'>{$addr_sh}</TD>\n";
    //		Street addr
    print "<TD>{$units_str}</TD>\n";
    //		Units responding
    print "</TR>\n\n";
    $line_ctr++;
}
开发者ID:sharedgeo,项目名称:TicketsCAD-SharedGeo-Dev,代码行数:53,代码来源:daily_rpt.php


示例6: register

 /** {@inheritdoc} */
 public function register()
 {
     if (empty($this->provides)) {
         return;
     }
     foreach ($this->provides as $v) {
         if (false !== strpos($v, '\\')) {
             $this->container->add($v);
             if (false === stripos($v, '\\events\\')) {
                 $this->container->add(shorten($v), $v);
             }
         }
     }
 }
开发者ID:ntd1712,项目名称:common,代码行数:15,代码来源:AbstractLeagueServiceProvider.php


示例7: get_text_for_indexing_txt

/**
* Global Search Engine for Moodle
* add-on 1.8+ : Valery Fremaux [[email protected]] 
* 2007/08/02
*
* this is a format handler for getting text out of a proprietary binary format 
* so it can be indexed by Lucene search engine
*/
function get_text_for_indexing_txt(&$resource)
{
    global $CFG, $USER;
    // SECURITY : do not allow non admin execute anything on system !!
    if (!isadmin($USER->id)) {
        return;
    }
    // just try to get text empirically from ppt binary flow
    $text = implode('', file("{$CFG->dataroot}/{$resource->course}/{$resource->reference}"));
    if (!empty($CFG->block_search_limit_index_body)) {
        $text = shorten($text, $CFG->block_search_limit_index_body);
    }
    return $text;
}
开发者ID:BackupTheBerlios,项目名称:samouk-svn,代码行数:22,代码来源:physical_txt.php


示例8: get_text_for_indexing_xml

/**
* Global Search Engine for Moodle
* add-on 1.8+ : Valery Fremaux [[email protected]] 
* 2007/08/02
*
* this is a format handler for getting text out of a proprietary binary format 
* so it can be indexed by Lucene search engine
*/
function get_text_for_indexing_xml(&$resource)
{
    global $CFG, $USER;
    // SECURITY : do not allow non admin execute anything on system !!
    if (!isadmin($USER->id)) {
        return;
    }
    // just get text
    $text = implode('', file("{$CFG->dataroot}/{$resource->course}/({$resource->reference})"));
    // filter out all xml tags
    $text = preg_replace("/<[^>]*>/", ' ', $text);
    if (!empty($CFG->block_search_limit_index_body)) {
        $text = shorten($text, $CFG->block_search_limit_index_body);
    }
    return $text;
}
开发者ID:BackupTheBerlios,项目名称:samouk-svn,代码行数:24,代码来源:physical_xml.php


示例9: ajax_qsearch

/**
 * Searches for matching pagenames
 *
 * @author Andreas Gohr <[email protected]>
 */
function ajax_qsearch()
{
    global $lang;
    global $INPUT;
    $maxnumbersuggestions = 50;
    $query = $INPUT->post->str('q');
    if (empty($query)) {
        $query = $INPUT->get->str('q');
    }
    if (empty($query)) {
        return;
    }
    $query = urldecode($query);
    $data = ft_pageLookup($query, true, useHeading('navigation'));
    if (!count($data)) {
        return;
    }
    print '<strong>' . $lang['quickhits'] . '</strong>';
    print '<ul>';
    $counter = 0;
    foreach ($data as $id => $title) {
        if (useHeading('navigation')) {
            $name = $title;
        } else {
            $ns = getNS($id);
            if ($ns) {
                /* Displays the Header of the Namespace-Page or of namespace:start as the Name of the NS */
                $ns_name = p_get_first_heading(getNS($id));
                if (!$ns_name) {
                    $ns_name = p_get_first_heading(getNS($id) . ':start');
                }
                $name = shorten(' [' . $ns_name . ']', 30);
            } else {
                $name = $id;
            }
        }
        echo '<li>' . html_wikilink(':' . $id, $name) . '</li>';
        $counter++;
        if ($counter > $maxnumbersuggestions) {
            echo '<li>...</li>';
            break;
        }
    }
    print '</ul>';
}
开发者ID:s-blu,项目名称:dokuwiki,代码行数:50,代码来源:ajax.php


示例10: get_text_for_indexing_txt

/**
* @param object $resource
* @uses $CFG
*/
function get_text_for_indexing_txt(&$resource, $directfile = '')
{
    global $CFG;
    // SECURITY : do not allow non admin execute anything on system !!
    if (!has_capability('moodle/site:doanything', get_context_instance(CONTEXT_SYSTEM))) {
        return;
    }
    // just try to get text empirically from ppt binary flow
    if ($directfile == '') {
        $text = implode('', file("{$CFG->dataroot}/{$resource->course}/{$resource->reference}"));
    } else {
        $text = implode('', file("{$CFG->dataroot}/{$directfile}"));
    }
    if (!empty($CFG->block_search_limit_index_body)) {
        $text = shorten($text, $CFG->block_search_limit_index_body);
    }
    return $text;
}
开发者ID:kai707,项目名称:ITSA-backup,代码行数:22,代码来源:physical_txt.php


示例11: index

 function index()
 {
     $this->navigation->PageTitle('Transactions');
     $this->load->model('cp/dataset', 'dataset');
     // prepare gateway select
     $this->load->model('gateway_model');
     $gateways = $this->gateway_model->GetGateways($this->user->Get('client_id'));
     // we're gonna short gateway names
     $this->load->helper('shorten');
     $gateway_options = array();
     $gateway_values = array();
     if (is_array($gateways) && count($gateways)) {
         foreach ($gateways as $gateway) {
             $gateway_options[$gateway['id']] = $gateway['gateway'];
             $gateway_values[$gateway['id']] = shorten($gateway['gateway'], 15);
         }
     }
     // now get deleted gateways and add them in so that, when viewing the
     // transactions table, we have names for each gateway in this array
     $gateways = $this->gateway_model->GetGateways($this->user->Get('client_id'), array('deleted' => '1'));
     if (!empty($gateways)) {
         foreach ($gateways as $gateway) {
             $gateway['gateway_short'] = shorten($gateway['gateway'], 15);
             $gateway_values[$gateway['id']] = $gateway['gateway_short'];
         }
     }
     $columns = array(array('name' => 'ID #', 'sort_column' => 'id', 'type' => 'id', 'width' => '10%', 'filter' => 'id'), array('name' => 'Status', 'sort_column' => 'status', 'type' => 'select', 'options' => array('1' => 'ok', '2' => 'refunded', '0' => 'failed', '3' => 'failed-repeat'), 'width' => '4%', 'filter' => 'status'), array('name' => 'Date', 'sort_column' => 'timestamp', 'type' => 'date', 'width' => '20%', 'filter' => 'timestamp', 'field_start_date' => 'start_date', 'field_end_date' => 'end_date'), array('name' => 'Amount', 'sort_column' => 'amount', 'type' => 'text', 'width' => '10%', 'filter' => 'amount'), array('name' => 'Customer Name', 'sort_column' => 'customers.last_name', 'type' => 'text', 'width' => '20%', 'filter' => 'customer_last_name'), array('name' => 'Card', 'sort_column' => 'card_last_four', 'type' => 'text', 'width' => '10%', 'filter' => 'card_last_four'), array('name' => 'Gateway', 'type' => 'select', 'width' => '10%', 'options' => $gateway_options, 'filter' => 'gateway_id'), array('name' => 'Recurring', 'width' => '10%', 'type' => 'text', 'filter' => 'recurring_id'));
     // set total rows by hand to reduce database load
     $result = $this->db->select('COUNT(order_id) AS total_rows', FALSE)->from('orders')->where('client_id', $this->user->Get('client_id'))->get();
     $this->dataset->total_rows((int) $result->row()->total_rows);
     if ($this->dataset->total_rows > 5000) {
         // we're going to have a memory error with this much data
         $this->dataset->use_total_rows();
     }
     $this->dataset->Initialize('charge_model', 'GetCharges', $columns);
     $this->load->model('charge_model');
     // get total charges
     $total_amount = $this->charge_model->GetTotalAmount($this->user->Get('client_id'), $this->dataset->params);
     // sidebar
     $this->navigation->SidebarButton('Recurring Charges', 'transactions/all_recurring');
     $this->navigation->SidebarButton('New Charge', 'transactions/create');
     $data = array('total_amount' => $total_amount, 'gateways' => $gateway_values);
     $this->load->view(branded_view('cp/transactions.php'), $data);
 }
开发者ID:carriercomm,项目名称:opengateway,代码行数:44,代码来源:transactions.php


示例12: get_text_for_indexing_xml

/**
* @param object $resource
* @uses $CFG
*/
function get_text_for_indexing_xml(&$resource, $directfile = '')
{
    global $CFG;
    // SECURITY : do not allow non admin execute anything on system !!
    if (!has_capability('moodle/site:doanything', get_context_instance(CONTEXT_SYSTEM))) {
        return;
    }
    // just get text
    if ($directfile == '') {
        $text = implode('', file("{$CFG->dataroot}/{$resource->course}/{$resource->reference}"));
    } else {
        $text = implode('', file("{$CFG->dataroot}/{$directfile}"));
    }
    // filter out all xml tags
    $text = preg_replace("/<[^>]*>/", ' ', $text);
    if (!empty($CFG->block_search_limit_index_body)) {
        $text = shorten($text, $CFG->block_search_limit_index_body);
    }
    return $text;
}
开发者ID:kai707,项目名称:ITSA-backup,代码行数:24,代码来源:physical_xml.php


示例13: get_text_for_indexing_htm

/**
* @param object $resource
* @uses $CFG
*/
function get_text_for_indexing_htm(&$resource, $directfile = '')
{
    global $CFG;
    // SECURITY : do not allow non admin execute anything on system !!
    if (!has_capability('moodle/site:doanything', get_context_instance(CONTEXT_SYSTEM))) {
        return;
    }
    // just get text
    if ($directfile == '') {
        $text = implode('', file("{$CFG->dataroot}/{$resource->course}/{$resource->reference}"));
    } else {
        $text = implode('', file("{$CFG->dataroot}/{$directfile}"));
    }
    // extract keywords and other interesting meta information and put it back as real content for indexing
    if (preg_match('/(.*)<meta ([^>]*)>(.*)/is', $text, $matches)) {
        $prefix = $matches[1];
        $meta_attributes = $matches[2];
        $suffix = $matches[3];
        if (preg_match('/name="(keywords|description)"/i', $meta_attributes)) {
            preg_match('/content="([^"]+)"/i', $meta_attributes, $matches);
            $text = $prefix . ' ' . $matches[1] . ' ' . $suffix;
        }
    }
    // brutally filters all html tags
    $text = preg_replace("/<[^>]*>/", '', $text);
    $text = preg_replace("/<!--[^>]*-->/", '', $text);
    $text = html_entity_decode($text, ENT_COMPAT, 'UTF-8');
    $text = mb_convert_encoding($text, 'UTF-8', 'auto');
    /*
    * debug code for tracing input
    echo "<hr/>";
    $FILE = fopen("filetrace.log", 'w');
    fwrite($FILE, $text);
    fclose($FILE);
    echo "<hr/>";
    */
    if (!empty($CFG->block_search_limit_index_body)) {
        $text = shorten($text, $CFG->block_search_limit_index_body);
    }
    return $text;
}
开发者ID:kai707,项目名称:ITSA-backup,代码行数:45,代码来源:physical_htm.php


示例14: __toString

 /** @return string */
 public function __toString()
 {
     return str_replace('Entity', '', shorten(get_class($this)));
 }
开发者ID:ntd1712,项目名称:common,代码行数:5,代码来源:AbstractBaseObject.php


示例15: popup_ticket


//.........这里部分代码省略.........

function createfacMarker(fac_point, fac_name, id, fac_icon) {
	var fac_marker = new GMarker(fac_point, fac_icon);
	// Show this markers index in the info window when it is clicked
	var fac_html = fac_name;
	fmarkers[id] = fac_marker;
	GEvent.addListener(fac_marker, "click", function() {fac_marker.openInfoWindowHtml(fac_html);});
	return fac_marker;
}

<?php 
    $query_fac = "SELECT *,UNIX_TIMESTAMP(updated) AS updated, `{$GLOBALS['mysql_prefix']}facilities`.id AS fac_id, `{$GLOBALS['mysql_prefix']}facilities`.description AS facility_description, `{$GLOBALS['mysql_prefix']}fac_types`.name AS fac_type_name, `{$GLOBALS['mysql_prefix']}facilities`.name AS facility_name FROM `{$GLOBALS['mysql_prefix']}facilities` LEFT JOIN `{$GLOBALS['mysql_prefix']}fac_types` ON `{$GLOBALS['mysql_prefix']}facilities`.type = `{$GLOBALS['mysql_prefix']}fac_types`.id LEFT JOIN `{$GLOBALS['mysql_prefix']}fac_status` ON `{$GLOBALS['mysql_prefix']}facilities`.status_id = `{$GLOBALS['mysql_prefix']}fac_status`.id ORDER BY `{$GLOBALS['mysql_prefix']}facilities`.type ASC";
    $result_fac = mysql_query($query_fac) or do_error($query_fac, 'mysql query failed', mysql_error(), basename(__FILE__), __LINE__);
    while ($row_fac = mysql_fetch_array($result_fac)) {
        $eols = array("\r\n", "\n", "\r");
        // all flavors of eol
        while ($row_fac = stripslashes_deep(mysql_fetch_array($result_fac))) {
            //
            $fac_name = $row_fac['facility_name'];
            //	10/8/09
            $fac_temp = explode("/", $fac_name);
            $fac_index = substr($fac_temp[count($fac_temp) - 1], -6, strlen($fac_temp[count($fac_temp) - 1]));
            // 3/19/11
            print "\t\tvar fac_sym = '{$fac_index}';\n";
            // for sidebar and icon 10/8/09
            $fac_id = $row_fac['id'];
            $fac_type = $row_fac['icon'];
            $f_disp_name = $row_fac['facility_name'];
            //	10/8/09
            $f_disp_temp = explode("/", $f_disp_name);
            $facility_display_name = $f_disp_temp[0];
            if (my_is_float($row_fac['lat']) && my_is_float($row_fac['lng'])) {
                $fac_tab_1 = "<TABLE CLASS='infowin'  width='{$iw_width}' >";
                $fac_tab_1 .= "<TR CLASS='even'><TD COLSPAN=2 ALIGN='center'><B>" . addslashes(shorten($facility_display_name, 48)) . "</B></TD></TR>";
                $fac_tab_1 .= "<TR CLASS='odd'><TD COLSPAN=2 ALIGN='center'><B>" . addslashes(shorten($row_fac['fac_type_name'], 48)) . "</B></TD></TR>";
                $fac_tab_1 .= "<TR CLASS='even'><TD ALIGN='right'>Description:&nbsp;</TD><TD ALIGN='left'>" . addslashes(str_replace($eols, " ", $row_fac['facility_description'])) . "</TD></TR>";
                $fac_tab_1 .= "<TR CLASS='odd'><TD ALIGN='right'>Status:&nbsp;</TD><TD ALIGN='left'>" . addslashes($row_fac['status_val']) . " </TD></TR>";
                $fac_tab_1 .= "<TR CLASS='even'><TD ALIGN='right'>Contact:&nbsp;</TD><TD ALIGN='left'>" . addslashes($row_fac['contact_name']) . "&nbsp;&nbsp;&nbsp;Email: " . addslashes($row_fac['contact_email']) . "</TD></TR>";
                $fac_tab_1 .= "<TR CLASS='odd'><TD ALIGN='right'>Phone:&nbsp;</TD><TD ALIGN='left'>" . addslashes($row_fac['contact_phone']) . " </TD></TR>";
                $fac_tab_1 .= "<TR CLASS='even'><TD ALIGN='right'>As of:&nbsp;</TD><TD ALIGN='left'>" . format_date($row_fac['updated']) . "</TD></TR>";
                $fac_tab_1 .= "</TABLE>";
                $fac_tab_2 = "<TABLE CLASS='infowin'  width='{$iw_width}' >";
                $fac_tab_2 .= "<TR CLASS='odd'><TD ALIGN='right'>Security contact:&nbsp;</TD><TD ALIGN='left'>" . addslashes($row_fac['security_contact']) . " </TD></TR>";
                $fac_tab_2 .= "<TR CLASS='even'><TD ALIGN='right'>Security email:&nbsp;</TD><TD ALIGN='left'>" . addslashes($row_fac['security_email']) . " </TD></TR>";
                $fac_tab_2 .= "<TR CLASS='odd'><TD ALIGN='right'>Security phone:&nbsp;</TD><TD ALIGN='left'>" . addslashes($row_fac['security_phone']) . " </TD></TR>";
                $fac_tab_2 .= "<TR CLASS='even'><TD ALIGN='right'>Access rules:&nbsp;</TD><TD ALIGN='left'>" . addslashes(str_replace($eols, " ", $row_fac['access_rules'])) . "</TD></TR>";
                $fac_tab_2 .= "<TR CLASS='odd'><TD ALIGN='right'>Security reqs:&nbsp;</TD><TD ALIGN='left'>" . addslashes(str_replace($eols, " ", $row_fac['security_reqs'])) . "</TD></TR>";
                $fac_tab_2 .= "<TR CLASS='even'><TD ALIGN='right'>Opening hours:&nbsp;</TD><TD ALIGN='left'>" . addslashes(str_replace($eols, " ", $row_fac['opening_hours'])) . "</TD></TR>";
                $fac_tab_2 .= "<TR CLASS='odd'><TD ALIGN='right'>Prim pager:&nbsp;</TD><TD ALIGN='left'>" . addslashes($row_fac['pager_p']) . " </TD></TR>";
                $fac_tab_2 .= "<TR CLASS='even'><TD ALIGN='right'>Sec pager:&nbsp;</TD><TD ALIGN='left'>" . addslashes($row_fac['pager_s']) . " </TD></TR>";
                $fac_tab_2 .= "</TABLE>";
                ?>
//			var fac_sym = (g+1).toString();
			var myfacinfoTabs = [
				new GInfoWindowTab("<?php 
                print nl2brr(addslashes(shorten($row_fac['facility_name'], 10)));
                ?>
", "<?php 
                print $fac_tab_1;
                ?>
"),
				new GInfoWindowTab("More ...", "<?php 
                print str_replace($eols, " ", $fac_tab_2);
                ?>
")
				];
开发者ID:sharedgeo,项目名称:TicketsCAD-SharedGeo-Dev,代码行数:67,代码来源:functions_major.inc.php


示例16: _linklist_makeSelect

function _linklist_makeSelect($mode, $data, $default = '')
{
    global $member;
    $arr = array();
    $str = '';
    $arr_def = (array) $default;
    $size = '';
    $multiple = '';
    switch ($mode) {
        case 'bid[]':
            $size = 'size="3"';
            $multiple = 'multiple="multiple"';
            $arr =& $data;
            if (count($arr) < 2) {
                //set default
                $arr_def = array_keys($arr);
            }
            if (!$member->isAdmin() and count($arr_def) == 1 and empty($arr_def[0])) {
                $arr_def[0] = array_shift(array_keys($arr));
            }
            break;
        case 'gid':
        case 'sortkey':
            //alphabet (group)
            $arr =& $data;
            break;
        case 'blogselected':
            if ($data == 0 or !preg_match("/^[0-9,]+\$/", $data)) {
                //hidden
                $arr[0] = 'ALL';
            } else {
                //get blogname from ids
                $query = sprintf("SELECT bnumber, bname FROM %s " . "WHERE bnumber IN (%s) ORDER BY bnumber", sql_table('blog'), $data);
                $res = sql_query($query);
                while ($row = mysql_fetch_assoc($res)) {
                    $arr[$row['bnumber']] = shorten($row['bname'], 15, '..');
                }
            }
            break;
    }
    $str .= <<<OUT
<select name="{$mode}" {$size} {$multiple}>
OUT;
    foreach ($arr as $key => $val) {
        $selected = in_array($key, $arr_def) ? 'selected="selected"' : '';
        if ($mode == 'bid[]') {
            $val = "{$key}:{$val}";
        }
        $str .= <<<OUT
<option value="{$key}" {$selected}>{$val}</option>
OUT;
    }
    $str .= "</select>";
    return $str;
}
开发者ID:NucleusCMS,项目名称:NP_LinkList,代码行数:55,代码来源:functions.php


示例17: list_facilities


//.........这里部分代码省略.........
        // 2/8/10
        $the_text_color = $GLOBALS['FACY_TYPES_TEXT'][$row['icon']];
        // 2/8/10
        $the_on_click = my_is_float($row['lat']) ? " onClick = myclick({$i}); " : " onClick = myclick_nm({$row['unit_id']}); ";
        //	3/15/11
        $got_point = FALSE;
        print "\n\t\tvar i={$i};\n";
        if (is_guest()) {
            $toedit = $tomail = $toroute = "";
        } else {
            $toedit = "&nbsp;&nbsp;&nbsp;&nbsp;<A HREF='{$_SESSION['facilitiesfile']}?func=responder&edit=true&id=" . $row['id'] . "'><U>Edit</U></A>";
            $tomail = "&nbsp;&nbsp;&nbsp;&nbsp;<SPAN onClick = 'do_mail_in_win({$row['id']})'><U><B>Email</B></U></SPAN>";
            $toroute = "&nbsp;<A HREF='{$_SESSION['facroutesfile']}?fac_id=" . $row['id'] . "'><U>Route To Facility</U></A>";
        }
        $temp = $row['status_id'];
        $the_status = array_key_exists($temp, $status_vals) ? $status_vals[$temp] : "??";
        $temp_type = $row['type'];
        $the_type = array_key_exists($temp_type, $type_vals) ? $type_vals[$temp_type] : "??";
        if (!$got_point && my_is_float($row['lat'])) {
            if ($row['lat'] == 0.999999 && $row['lng'] == 0.999999) {
                echo "\t\tvar point = new GLatLng(" . get_variable('def_lat') . ", " . get_variable('def_lng') . ");\n";
            } else {
                echo "\t\tvar point = new GLatLng(" . $row['lat'] . ", " . $row['lng'] . ");\n";
            }
            $got_point = TRUE;
        }
        $update_error = strtotime('now - 6 hours');
        // set the time for silent setting
        $index = $row['icon_str'];
        // name
        $display_name = $name = htmlentities($row['name'], ENT_QUOTES);
        $handle = htmlentities($row['handle'], ENT_QUOTES);
        // 7/7/11
        $sidebar_line = "&nbsp;&nbsp;<TD WIDTH='15%' TITLE = '{$row['handle']}' {$the_on_click}><U><SPAN STYLE='background-color:{$the_bg_color};  opacity: .7; color:{$the_text_color};'>" . addslashes(shorten($handle, 15)) . "</SPAN></U></TD>";
        //	6/10/11
        $sidebar_line .= "<TD WIDTH='40%' TITLE = '" . addslashes($name) . "' {$the_on_click}><U><SPAN STYLE='background-color:{$the_bg_color};  opacity: .7; color:{$the_text_color};'><NOBR>" . addslashes(shorten($name, 24)) . "</NOBR></SPAN></U></TD><TD WIDTH='15%'>{$the_type}</TD>";
        $sidebar_line .= "<TD WIDTH='20%' CLASS='td_data' TITLE = '" . addslashes($the_status) . "'> " . get_status_sel($row['id'], $row['status_id'], 'f') . "</TD>";
        //	3/15/11
        // as of
        $strike = $strike_end = "";
        $the_time = $row['updated'];
        $the_class = "";
        $strike = $strike_end = "";
        $sidebar_line .= "<TD WIDTH='20%' CLASS='{$the_class}'> {$strike} <NOBR>" . format_sb_date($the_time) . "</NOBR> {$strike_end}</TD>";
        // tab 1
        if (my_is_float($row['lat'])) {
            // position data?
            $temptype = $u_types[$row['type']];
            $the_type = $temptype[0];
            $tab_1 = "<TABLE CLASS='infowin' width='{$iw_width}'>";
            $tab_1 .= "<TR CLASS='even'><TD COLSPAN=2 ALIGN='center'><B>" . addslashes(shorten($display_name, 48)) . "</B> - " . $the_type . "</TD></TR>";
            $tab_1 .= "<TR CLASS='odd'><TD ALIGN='right'>Description:&nbsp;</TD><TD ALIGN='left'>" . addslashes(shorten(str_replace($eols, " ", $row['description']), 32)) . "</TD></TR>";
            $tab_1 .= "<TR CLASS='even'><TD ALIGN='right'>Status:&nbsp;</TD><TD ALIGN='left'>" . $the_status . " </TD></TR>";
            $tab_1 .= "<TR CLASS='odd'><TD ALIGN='right'>Contact:&nbsp;</TD><TD ALIGN='left'>" . addslashes($row['contact_name']) . " Via: " . addslashes($row['contact_email']) . "</TD></TR>";
            $tab_1 .= "<TR CLASS='even'><TD ALIGN='right'>As of:&nbsp;</TD><TD ALIGN='left'>" . format_date($row['updated']) . "</TD></TR>";
            $tab_1 .= "<TR CLASS='odd'><TD COLSPAN=2 ALIGN='center'>" . $toedit . $tomail . "&nbsp;&nbsp;<A HREF='{$_SESSION['facilitiesfile']}?func=responder&view=true&id=" . $row['id'] . "'><U>View</U></A></TD></TR>";
            // 08/8/02
            $tab_1 .= "</TABLE>";
            $tab_2 = "<TABLE CLASS='infowin' width='{$iw_width}' ALIGN = 'center' >";
            $tab_2 .= "<TR CLASS='odd'><TD ALIGN='right' STYLE= 'width:50%'>Security contact:&nbsp;</TD><TD ALIGN='left' STYLE= 'width:50%'>" . addslashes($row['security_contact']) . " </TD></TR>";
            $tab_2 .= "<TR CLASS='even'><TD ALIGN='right'>Security email:&nbsp;</TD><TD ALIGN='left'>" . addslashes($row['security_email']) . " </TD></TR>";
            $tab_2 .= "<TR CLASS='odd'><TD ALIGN='right'>Security phone:&nbsp;</TD><TD ALIGN='left'>" . addslashes($row['security_phone']) . " </TD></TR>";
            $tab_2 .= "<TR CLASS='even'><TD ALIGN='right'>" . get_text("Access rules") . ":&nbsp;</TD><TD ALIGN='left'>" . addslashes(str_replace($eols, " ", $row['access_rules'])) . "</TD></TR>";
            $tab_2 .= "<TR CLASS='odd'><TD ALIGN='right'>Security reqs:&nbsp;</TD><TD ALIGN='left'>" . addslashes(str_replace($eols, " ", $row['security_reqs'])) . "</TD></TR>";
            $tab_2 .= "<TR CLASS='even'><TD ALIGN='right'>Opening hours:&nbsp;</TD><TD ALIGN='left'>" . addslashes(str_replace($eols, " ", $row['opening_hours'])) . "</TD></TR>";
            $tab_2 .= "<TR CLASS='odd'><TD ALIGN='right'>Prim pager:&nbsp;</TD><TD ALIGN='left'>" . addslashes($row['pager_p']) . " </TD></TR>";
开发者ID:sharedgeo,项目名称:TicketsCAD-SharedGeo-Dev,代码行数:67,代码来源:facilities.php


示例18: tpl_content


//.........这里部分代码省略.........
	</div><div class="formbottom"><div class="formbottomi"></div></div></div>
</form>
<br/>

<?php 
    if ($page['pagination']) {
        ?>

<table class="list">
<thead>
<tr class="header">
<th>
	<?php 
        echo getlocal("notifications.head.to");
        ?>
</th><th>
	<?php 
        echo getlocal("notifications.head.subj");
        ?>
</th><th>
	<?php 
        echo getlocal("notifications.head.msg");
        ?>
</th><th>
	<?php 
        echo getlocal("notifications.head.time");
        ?>
</th>
</tr>
</thead>
<tbody>
<?php 
        if ($page['pagination.items']) {
            foreach ($page['pagination.items'] as $b) {
                ?>
	<tr>
	<td class="notlast">
		<a href="<?php 
                echo $webimroot;
                ?>
/operator/notification.php?id=<?php 
                echo $b['id'];
                ?>
" target="_blank" onclick="this.newWindow = window.open('<?php 
                echo $webimroot;
                ?>
/operator/notification.php?id=<?php 
                echo $b['id'];
                ?>
', '', 'toolbar=0,scrollbars=1,location=0,status=1,menubar=0,width=720,height=520,resizable=1');this.newWindow.focus();this.newWindow.opener=window;return false;" class="<?php 
                echo $b['vckind'] == 'xmpp' ? 'xmpp' : 'mail';
                ?>
">
   			<?php 
                echo htmlspecialchars(shorten(topage($b['vcto']), 30));
                ?>
   		</a>
	</td>
	<td class="notlast">
		<?php 
                echo htmlspecialchars(shorten(topage($b['vcsubject']), 30));
                ?>
	</td>
	<td class="notlast">
		<?php 
                echo htmlspecialchars(shorten(topage($b['tmessage']), 30));
                ?>
	</td>
	<td>
   		<?php 
                echo date_to_text($b['created']);
                ?>
	</td>
	</tr>
<?php 
            }
        } else {
            ?>
	<tr>
	<td colspan="4">
		<?php 
            echo getlocal("tag.pagination.no_items.elements");
            ?>
	</td>
	</tr>
<?php 
        }
        ?>
</tbody>
</table>
<?php 
        if ($page['pagination.items']) {
            echo "<br/>";
            echo generate_pagination($page['pagination']);
        }
    }
    ?>

<?php 
}
开发者ID:paulcn,项目名称:mibew,代码行数:101,代码来源:notifications.php


示例19:


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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