Canada biz
<?php //将CCK数据库字段读出赋值给变量 $company=$node->field_company[0]['view'];
$address=$node->field_address[0]['view']; $city=$node->field_city[0]['view']; $province=$node->field_province[0]['view']; $postcode=$node->field_postcode[0]['view'];
$phone=$node->field_phone[0]['view']; $fax=$node->field_fax[0]['view'];
$sic_code=$node->field_sic_code[0]['view']; $sic_description=$node->field_sic_description[0]['view'];
$first_name=$node->field_first_name[0]['view']; $last_name=$node->field_last_name[0]['view']; $title=$node->field_title[0]['view'];
$employees=$node->field_employees[0]['view']; $sales=$node->field_sales[0]['view'];
$credit_rating=$node->field_credit_rating[0]['view'];
//计算
$country=t("Canada"); $country_display="$country";
$company_display="$company";
if ($address==NULL) {
$address_display=$location;
} else {
$address_display="$address";
}
if ($city==NULL) {
$city_display=$city;
} else {
$city_breadcrumb=l($city,'category/city/'.str_replace(' ','_',$city));
$city_display="$city_breadcrumb";
}
if ($province==NULL) {
$province_display=$province;
} else {
$province_breadcrumb=l($province,'category/province/'.$province);
$province_display="$province_breadcrumb";
}
if ($postcode==NULL) {
$postcode_display=$postcode;
} else {
$postcode_display="$postcode";
}
if ($phone==NULL) {
$phone_display=$phone;
} else {
$areacode=substr($phone,0,3);
$number1=substr($phone,3,3);
$number2=substr($phone,6);
$phone_display="$phone , $areacode-$number1-$number2 , ($areacode)$number1-$number2";
}
if ($fax==NULL) {
$fax_display=$fax;
} else {
$faxareacode=substr($fax,0,3);
$faxnumber1=substr($fax,3,3);
$faxnumber2=substr($fax,6);
$fax_display="$fax , $faxareacode-$faxnumber1-$faxnumber2 , ($faxareacode)$faxnumber1-$faxnumber2";
}
$contact_display=trim("$first_name $last_name"); if ($contact_display==" ") {
$contact_display=NULL;
} else {
$contact_display="$contact_display";
}
$title_display=$title;
$sic_description=str_replace('&','&',$sic_description); if ($sic_description==NULL) {
$sic_description_display=$sic_description; $sic_code_display=$sic_code; $keyword="$country t('Business Directory')";
} else {
$sic_description_display=l($sic_description,'category/sic_description/'.str_replace(' ','_',$sic_description)); $sic_code_display=l($sic_code,'category/sic_description/'.str_replace(' ','_',$sic_description)); $keyword=$sic_description;
} $sic_description=str_replace('&','&',$sic_description); $keyword=str_replace('&','&',$keyword);
$employees_display=$employees; $sales_display=$sales; $credit_rating_display=$credit_rating;
$space=" ";
$map_address="$address, $city, $province $postcode"; $map_address=trim($map_address); $map_address=trim($map_address,","); $map_address=trim($map_address); $map_address="$map_address, $country";
$description=t('!company is a !country company in !map_address, belongs to !sic_description industry.',array('!company'=>$company,'!country'=>$country,'!map_address'=>$map_address,'!sic_description'=>$sic_description)); $company_information_label=t('Company Information'); $company_label=t('Company'); $employees_label=t('Employees'); $sales_label=t('Sales'); $credit_rating_label=t('Credit Rating'); $industry_category_label=t('Industry Category'); $SIC_code_label=t('SIC Code'); $SIC_description_label=t('SIC Description'); $Buy_Full_Data_label=t('Buy Full Data'); $canada_sale_label=t('Buy Canada Business Directory Full Data'); $canada_sale_inter_label=t('Buy Canada International Purchasers'); $canada_sale_list_label=t('Buy Canada Foreign Buyers List'); $contact_info_label=t('Contact Info'); $address_label=t('Address'); $city_label=t('City'); $province_label=t('Province'); $postcode_label=t('Postcode');
$country_label=t('Country'); $contact_label=t('Contact'); $title_label=t('Title'); $fax_label=t('Fax'); $phone_label=t('Phone'); $international_call_lable=t('International Call'); $country_code_label=t('Country Code'); $online_map_label=t('Online Map'); $keyword_lable=t('Keyword');
$map_description=t("This is online map of !company address “!map_address”. You may use button to move and zoom in / out.
The map information is for reference only. If you find 'Can not find' or error address, please submit another address using the form in the map, then search again.",array('!company '=>$company,'!map_address'=>$map_address));
//添加Meta数据
$meta_keywords="$company, $address, $city, $province, $sic_description, $country ".t('business directory library'); $meta_description=t("!company is a !country company in !map_address, belongs to !sic_description industry. Its first_name method and company information is as below.",array('!company'=>$company,'!country'=>$country,'!map_address'=>$map_address,'!sic_description'=>$sic_description));
drupal_set_html_head( " <meta name='keywords' content='$meta_keywords' /> <meta name='description' content='$meta_description' /> ");
// Set Page Title drupal_set_title("$company");
// Set Breadcrumbs $breadcrumb = array(); $breadcrumb[] = l(t('Home'), '<front>'); $breadcrumb[] = $province_breadcrumb; $breadcrumb[] = $city_breadcrumb; $breadcrumb[] = $sic_description_display; $breadcrumb[] = $company; drupal_set_breadcrumb($breadcrumb);
//计算变量结束,后面开始显示
if (substr($_SERVER['REQUEST_URI'],0,3)=='/m/') { $output="
<script type='text/javascript'> googletag.cmd.push(function() { googletag.display('div-gpt-ad-1338173872999-3'); }); </script>
$description
<fieldset class='fieldgroup group-information'> <legend style='font-size:18px;'>$company_information_label</legend>
$space $company_display
$space $employees_display
$space $sales_display
<script type='text/javascript'> googletag.cmd.push(function() { googletag.display('div-gpt-ad-1338173872999-1'); }); </script>
</fieldset>
<fieldset class='fieldgroup group-industry'> <legend style='font-size:18px;'>$industry_category_label</legend>
$space $sic_code_display
$space $sic_description_display
- <a href='http://sale.mingluji.com/node/438'>$canada_sale_label</a>
- <a href='http://sale.mingluji.com/node/383'>$canada_sale_inter_label</a>
- <a href='http://sale.mingluji.com/node/253'>$canada_sale_list_label</a>
<script type='text/javascript'> googletag.cmd.push(function() { googletag.display('div-gpt-ad-1338173872999-2'); }); </script>
</fieldset>
<fieldset class='fieldgroup group-information'> <legend style='font-size:18px;'>$contact_info_label</legend>
$space $address_display
$space $city_display
$space $province_display
$space $postcode_display
$space $country_display
$space $contact_display
$space $title_display
$space $phone_display
$space $fax_display
$space $country $country_code_label: +1
<script type='text/javascript'> googletag.cmd.push(function() { googletag.display('div-gpt-ad-1338173872999-0'); }); </script>
</fieldset>
"; } else { $output="
<script type='text/javascript'>
GA_googleFillSlot('minglujiTop728x15');
</script>
$description
<fieldset class='fieldgroup group-information'> <legend style='font-size:18px;'>$company_information_label</legend>
<tbody style='width:100%; border:none;'> </tbody>
<script type='text/javascript'> GA_googleFillSlot('minglujiLeft336x280'); </script> |
$company_label:
$space $company_display $employees_label:
$space $employees_display $sales_label:
$space $sales_display |
</fieldset>
<fieldset class='fieldgroup group-industry'> <legend style='font-size:18px;'>$industry_category_label</legend>
<tbody style='width:100%; border:none;'> </tbody>
$SIC_code_label:
$space $sic_code_display $SIC_description_label:
$space $sic_description_display $Buy_Full_Data_label:
|
$keyword_lable: <input id='keyword' name='keyword' style='width:320px; font-size:12px;' type='text' value='$keyword' onkeydown='enterIn(event);' /> <input name='Button' onclick='init()' type='button' style='font-size:12px; ' value='Search' /> <script type='text/javascript'> function enterIn(evt){ var evt=evt?evt:(window.event?window.event:null); if (evt.keyCode==13){ init(); } } </script> <script src='http://www.google.com/jsapi' type='text/javascript'> </script> <script type='text/javascript' charset='utf-8'> google.load('ads.search', '2'); </script> <script type='text/javascript' charset='utf-8'> function init(){ var keyword = document.getElementById('keyword').value; var pageOptions = { 'pubId' : 'pub-9094871827609791', 'query' : keyword } var adblock1 = { 'container' : 'adblock1', 'number' : 6, 'width' : 'auto', 'lines' : 2, 'fontFamily' : 'arial', 'fontSizeTitle' : '14px', 'fontSizeDescription' : '14px', 'fontSizeDomainLink' : '14px', 'colorText' : '#000000', 'colorTitleLink' : '#0000ff', 'colorDomainLink' : '#008000', 'colorBackground' : '#ffffff', 'hl' : 'en', 'channel':'2772452284+2276877911', 'linkTarget':'_blank' }; var adblock2 = { 'container' : 'adblock2', 'number' : 6, 'width' : 'auto', 'lines' : 2, 'fontFamily' : 'arial', 'fontSizeTitle' : '14px', 'fontSizeDescription' : '14px', 'fontSizeDomainLink' : '14px', 'colorText' : '#000000', 'colorTitleLink' : '#0000ff', 'colorDomainLink' : '#008000', 'colorBackground' : '#ffffff', 'hl' : 'en', 'channel':'2772452284+2276877911', 'linkTarget':'_blank' }; new google.ads.search.Ads(pageOptions, adblock1, adblock2); //document.getElementById('keyword').focus(); document.getElementById('keyword').select(); } init(); </script> |
</fieldset>
<fieldset class='fieldgroup group-information'> <legend style='font-size:18px;'>$contact_info_label</legend>
<tbody style='width:100%; border:none;'> </tbody>
<script type='text/javascript'> GA_googleFillSlot('minglujiRight336x280'); </script> |
$address_label:
$space $address_display $city_label:
$space $city_display $province_label:
$space $province_display $postcode_label:
$space $postcode_display $country_label:
$space $country_display $contact_label:
$space $contact_display $title_label:
$space $title_display $phone_label:
$space $phone_display $fax_label:
$space $fax_display $international_call_lable:
$space $country $country_code_label: +1 |
</fieldset>
<fieldset class='fieldgroup group-map'> <legend style='font-size:18px;'>$online_map_label</legend>
<tbody style='width:100%; border:none;'> </tbody>
$map_description
Loading, Please Wait...
$input_address_label: <input id='address' type='text' value= style='width:450px;' /> <input type='button' value='$search_label' onclick='codeAddress()' /> <script type='text/javascript'> GA_googleFillSlot('minglujiBottom728x90'); </script> |
</fieldset>
"; } print $output;
?>