當前位置: 首頁>>代碼示例>>PHP>>正文


PHP zen_get_word_count函數代碼示例

本文整理匯總了PHP中zen_get_word_count函數的典型用法代碼示例。如果您正苦於以下問題:PHP zen_get_word_count函數的具體用法?PHP zen_get_word_count怎麽用?PHP zen_get_word_count使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了zen_get_word_count函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: stripslashes

         if (str_replace('txt_', '', $key) == $products_options_names->fields['products_options_id']) {
             //                  if ((str_replace('txt_', '', $key) == $products_options_names->fields['products_options_id'] and $value == $products_options->fields['products_options_values_id'])) {
             $tmp_html = '<input type="text" name ="id[' . TEXT_PREFIX . $products_options_names->fields['products_options_id'] . ']" size="' . $products_options_names->fields['products_options_size'] . '" maxlength="' . $products_options_names->fields['products_options_length'] . '" value="' . stripslashes($value) . '" />  ';
             $tmp_html .= $products_options_details;
             break;
         }
     }
 } else {
     $tmp_value = $gBitCustomer->mCart->contents[$_GET['products_id']]['attributes_values'][$products_options_names->fields['products_options_id']];
     $tmp_html = '<input type="text" name ="id[' . TEXT_PREFIX . $products_options_names->fields['products_options_id'] . ']" size="' . $products_options_names->fields['products_options_size'] . '" maxlength="' . $products_options_names->fields['products_options_length'] . '" value="' . htmlspecialchars($tmp_value) . '" />  ';
     $tmp_html .= $products_options_details;
     $tmp_word_cnt_string = '';
     // calculate word charges
     $tmp_word_cnt = 0;
     $tmp_word_cnt_string = $gBitCustomer->mCart->contents[$_GET['products_id']]['attributes_values'][$products_options_names->fields['products_options_id']];
     $tmp_word_cnt = zen_get_word_count($tmp_word_cnt_string, $products_options->fields['attributes_price_words_free']);
     $tmp_word_price = zen_get_word_count_price($tmp_word_cnt_string, $products_options->fields['attributes_price_words_free'], $products_options->fields['attributes_price_words']);
     if ($products_options->fields['attributes_price_words'] != 0) {
         $tmp_html .= TEXT_PER_WORD . $currencies->display_price($products_options->fields['attributes_price_words'], zen_get_tax_rate($product_info->fields['products_tax_class_id'])) . ($products_options->fields['attributes_price_words_free'] != 0 ? TEXT_WORDS_FREE . $products_options->fields['attributes_price_words_free'] : '');
     }
     if ($tmp_word_cnt != 0 and $tmp_word_price != 0) {
         $tmp_word_price = $currencies->display_price($tmp_word_price, zen_get_tax_rate($product_info->fields['products_tax_class_id']));
         $tmp_html = $tmp_html . '<br />' . TEXT_CHARGES_WORD . ' ' . $tmp_word_cnt . ' = ' . $tmp_word_price;
     }
     // calculate letter charges
     $tmp_letters_cnt = 0;
     $tmp_letters_cnt_string = $gBitCustomer->mCart->contents[$_GET['products_id']]['attributes_values'][$products_options_names->fields['products_options_id']];
     $tmp_letters_cnt = zen_get_letters_count($tmp_letters_cnt_string, $products_options->fields['attributes_price_letters_free']);
     $tmp_letters_price = zen_get_letters_count_price($tmp_letters_cnt_string, $products_options->fields['attributes_price_letters_free'], $products_options->fields['attributes_price_letters']);
     if ($products_options->fields['attributes_price_letters'] != 0) {
         $tmp_html .= TEXT_PER_LETTER . $currencies->display_price($products_options->fields['attributes_price_letters'], zen_get_tax_rate($product_info->fields['products_tax_class_id'])) . ($products_options->fields['attributes_price_letters_free'] != 0 ? TEXT_LETTERS_FREE . $products_options->fields['attributes_price_letters_free'] : '');
開發者ID:bitweaver,項目名稱:commerce,代碼行數:31,代碼來源:main_template_vars_attributes.php

示例2: zen_get_word_count_price

function zen_get_word_count_price($string, $free = 0, $price)
{
    $word_count = zen_get_word_count($string, $free);
    if ($word_count >= 1) {
        return $word_count * $price;
    } else {
        return 0;
    }
}
開發者ID:severnaya99,項目名稱:Sg-2010,代碼行數:9,代碼來源:functions_prices.php

示例3: getProductOptions


//.........這裏部分代碼省略.........
                                     $tmp_attributes_image .= '<td class="smallText" align="center" valign="top">' . zen_image(DIR_WS_IMAGES . $vals['attributes_image']) . (PRODUCT_IMAGES_ATTRIBUTES_NAMES == '1' ? '<br />' . $vals['products_options_values_name'] : '') . (!empty($products_options_details_noname) ? '<br />' . $products_options_details_noname : '') . '<br />' . zen_draw_checkbox_field('id[' . $this->mOptions[$optionsId]['products_options_id'] . '][' . $products_options_value_id . ']', $products_options_value_id, $selected_attribute, $vals['attributes_html_attrib']) . '</td>';
                                 } else {
                                     $tmp_attributes_image .= '<td class="smallText" align="center" valign="top">' . $vals['products_options_values_name'] . (!empty($products_options_details_noname) ? '<br />' . $products_options_details_noname : '') . '<br />' . zen_draw_checkbox_field('id[' . $this->mOptions[$optionsId]['products_options_id'] . '][' . $products_options_value_id . ']', $products_options_value_id, $selected_attribute, $vals['attributes_html_attrib']) . '</td>';
                                 }
                                 break;
                             case '5':
                                 $tmp_attributes_image_row++;
                                 if ($tmp_attributes_image_row > $this->mOptions[$optionsId]['products_options_images_per_row']) {
                                     $tmp_attributes_image .= '</tr><tr>';
                                     $tmp_attributes_image_row = 1;
                                 }
                                 if (!empty($vals['attributes_image'])) {
                                     $tmp_attributes_image .= '<td class="smallText" align="center" valign="top">' . zen_draw_checkbox_field('id[' . $this->mOptions[$optionsId]['products_options_id'] . '][' . $products_options_value_id . ']', $products_options_value_id, $selected_attribute, $vals['attributes_html_attrib'], zen_image(DIR_WS_IMAGES . $vals['attributes_image']) . (PRODUCT_IMAGES_ATTRIBUTES_NAMES == '1' ? '<br />' . $vals['products_options_values_name'] : '')) . (!empty($products_options_details_noname) ? '<br />' . $products_options_details_noname : '') . '</td>';
                                 } else {
                                     $tmp_attributes_image .= '<td class="smallText" align="center" valign="top">' . zen_draw_checkbox_field('id[' . $this->mOptions[$optionsId]['products_options_id'] . '][' . $products_options_value_id . ']', $products_options_value_id, $selected_attribute, $vals['attributes_html_attrib'], $vals['products_options_values_name'] . ($products_options_details_noname != '' ? $products_options_details_noname : '')) . '</td>';
                                 }
                                 break;
                             case '0':
                             default:
                                 $tmp_checkbox .= zen_draw_checkbox_field('id[' . $this->mOptions[$optionsId]['products_options_id'] . '][' . $products_options_value_id . ']', $products_options_value_id, $selected_attribute, $vals['attributes_html_attrib'], $products_options_details);
                                 break;
                         }
                     }
                     // =-=-=-=-=-=-=-=-=-=-= text
                     if ($this->mOptions[$optionsId]['products_options_type'] == PRODUCTS_OPTIONS_TYPE_TEXT) {
                         if (is_object($pCart)) {
                             $tmp_value = $pCart->contents[$this->mProductsId]['attributes_values'][$this->mOptions[$optionsId]['products_options_id']];
                             $tmp_html = '<input type="text" name ="id[' . TEXT_PREFIX . $this->mOptions[$optionsId]['products_options_id'] . ']" size="' . $this->mOptions[$optionsId]['products_options_size'] . '" maxlength="' . $this->mOptions[$optionsId]['products_options_length'] . '" value="' . htmlspecialchars($tmp_value) . '" />	';
                             $tmp_html .= $products_options_details;
                             $tmp_word_cnt_string = '';
                             // calculate word charges
                             $tmp_word_cnt = 0;
                             $tmp_word_cnt_string = $pCart->contents[$this->mProductsId]['attributes_values'][$this->mOptions[$optionsId]['products_options_id']];
                             $tmp_word_cnt = zen_get_word_count($tmp_word_cnt_string, $vals['attributes_price_words_free']);
                             $tmp_word_price = zen_get_word_count_price($tmp_word_cnt_string, $vals['attributes_price_words_free'], $vals['attributes_price_words']);
                             if ($vals['attributes_price_words'] != 0) {
                                 $tmp_html .= TEXT_PER_WORD . $currencies->display_price($vals['attributes_price_words'], zen_get_tax_rate($this->mInfo['products_tax_class_id'])) . ($vals['attributes_price_words_free'] != 0 ? TEXT_WORDS_FREE . $vals['attributes_price_words_free'] : '');
                             }
                             if ($tmp_word_cnt != 0 and $tmp_word_price != 0) {
                                 $tmp_word_price = $currencies->display_price($tmp_word_price, zen_get_tax_rate($this->mInfo['products_tax_class_id']));
                                 $tmp_html = $tmp_html . '<br />' . TEXT_CHARGES_WORD . ' ' . $tmp_word_cnt . ' = ' . $tmp_word_price;
                             }
                             // calculate letter charges
                             $tmp_letters_cnt = 0;
                             $tmp_letters_cnt_string = $pCart->contents[$this->mProductsId]['attributes_values'][$this->mOptions[$optionsId]['products_options_id']];
                             $tmp_letters_cnt = zen_get_letters_count($tmp_letters_cnt_string, $vals['attributes_price_letters_free']);
                             $tmp_letters_price = zen_get_letters_count_price($tmp_letters_cnt_string, $vals['attributes_price_letters_free'], $vals['attributes_price_letters']);
                             if ($vals['attributes_price_letters'] != 0) {
                                 $tmp_html .= TEXT_PER_LETTER . $currencies->display_price($vals['attributes_price_letters'], zen_get_tax_rate($this->mInfo['products_tax_class_id'])) . ($vals['attributes_price_letters_free'] != 0 ? TEXT_LETTERS_FREE . $vals['attributes_price_letters_free'] : '');
                             }
                             if ($tmp_letters_cnt != 0 and $tmp_letters_price != 0) {
                                 $tmp_letters_price = $currencies->display_price($tmp_letters_price, zen_get_tax_rate($this->mInfo['products_tax_class_id']));
                                 $tmp_html = $tmp_html . '<br />' . TEXT_CHARGES_LETTERS . ' ' . $tmp_letters_cnt . ' = ' . $tmp_letters_price;
                             }
                         } else {
                             $tmp_html = '<input class="form-control" type="text" name ="id[' . TEXT_PREFIX . $this->mOptions[$optionsId]['products_options_id'] . ']" size="' . $this->mOptions[$optionsId]['products_options_size'] . '" maxlength="' . $this->mOptions[$optionsId]['products_options_length'] . '" />';
                             $tmp_html .= $products_options_details;
                         }
                     }
                     // =-=-=-=-=-=-=-=-=-=-= file uploads
                     if (is_object($pCart) && $this->mOptions[$optionsId]['products_options_type'] == PRODUCTS_OPTIONS_TYPE_FILE) {
                         $number_of_uploads++;
                         $tmp_html = '<input type="file" name="id[' . TEXT_PREFIX . $this->mOptions[$optionsId]['products_options_id'] . ']" /><br />' . $pCart->contents[$this->mProductsId]['attributes_values'][$this->mOptions[$optionsId]['products_options_id']] . zen_draw_hidden_field(UPLOAD_PREFIX . $number_of_uploads, $this->mOptions[$optionsId]['products_options_id']) . zen_draw_hidden_field(TEXT_PREFIX . UPLOAD_PREFIX . $number_of_uploads, $pCart->contents[$this->mProductsId]['attributes_values'][$this->mOptions[$optionsId]['products_options_id']]);
                         $tmp_html .= $products_options_details;
                     }
                     // collect attribute image if it exists and to draw in table below
開發者ID:bitweaver,項目名稱:commerce,代碼行數:67,代碼來源:CommerceProduct.php


注:本文中的zen_get_word_count函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。