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


PHP Fields::showFields方法代码示例

本文整理汇总了PHP中Fields::showFields方法的典型用法代码示例。如果您正苦于以下问题:PHP Fields::showFields方法的具体用法?PHP Fields::showFields怎么用?PHP Fields::showFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Fields的用法示例。


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

示例1: ShowCompany

 public function ShowCompany($id, array $options = array(), Company &$comp = null)
 {
     $default_options = array();
     $options = array_merge($default_options, $options);
     $company = array();
     if ($comp) {
         $c =& $comp;
     } else {
         $c =& $this->companies[$id];
     }
     if ($this->use_country) {
         $company['{company_country}'] = $c->country_name;
         $this->tpl->SetBlock('country');
     }
     if ($this->use_city) {
         $company['{company_city}'] = $c->city_name;
         $this->tpl->SetBlock('city');
     }
     if ($c->logo_url) {
         $this->tpl->SetBlock('logo');
         $company['{logo_url}'] = $c->logo_url;
     }
     if ($c->description) {
         $company['{company_description}'] = $c->description;
         $this->tpl->SetBlock('company_description');
     }
     if ($c->date_register != '0000-00-00') {
         $company['{date_register}'] = $c->date_register;
         $this->tpl->SetBlock('date_register');
     }
     $company['{name}'] = $c->name;
     $company['{company_type}'] = $c->company_type;
     $company['{OPF}'] = $c->OPF;
     $company['{company_url}'] = $this->GetCompanyURL($c->company_id, $c->alt_name);
     $company['{contact_person}'] = $c->contact_person;
     $company['{phone}'] = $c->phone;
     $company['{site}'] = $c->site;
     $company['{email}'] = $c->email;
     $company['{address}'] = $c->address;
     $company['{company_add_date}'] = $c->add_date;
     $this->initXFields(XFIELDS_COMPANY);
     foreach ($this->xfields->showFields($c->xfields) as $fid => $field) {
         if ($field['value']) {
             $company["{xfield_{$fid}_title}"] = $field['title'];
             $company["{xfield_{$fid}_descr}"] = $field['description'];
             $company["{xfield_{$fid}_value}"] = $field['value'];
             $company['{xfields}'] .= $field['title'] . ": " . $field['value'] . "<br />";
             $this->tpl->SetBlock('xfield_' . $fid);
         }
     }
     return $company;
 }
开发者ID:dautushenka,项目名称:Job_Centre,代码行数:52,代码来源:JobUser.php

示例2: ShowAuto


//.........这里部分代码省略.........
     $set_array["{id}"] = $id;
     $set_array["{author}"] = $this->autos[$id]['author'];
     $set_array["{cars_of_author}"] = $this->tpl->GetUrl(array('author' => urlencode($this->autos[$id]['author'])), array(), array(), array(), array("use_alt_url" => false, "clear" => 1));
     $set_array["{auto_url}"] = $this->tpl->GetUrl(array("action" => 'auto', "id" => $id));
     $set_array['{checkbox}'] = $this->tpl->InputCheckbox('selected_auto[]', $id);
     $set_array['{compare}'] = "<img src=\"{THEME}/car-market/images/compare_unchecked.gif\" class=\"compare\" id=\"{$id}\" title=\"{$this->lang['compare_title']}\" />";
     $set_array['{send_mail}'] = "<a href=\"{$set_array['{auto_url}']}\" title=\"{$this->lang['mail_title']}\" class=\"mail_friend\" ><img src=\"{THEME}/car-market/images/mail.gif\" /></a>";
     $set_array['[print]'] = "<a target=\"_blank\" class=\"print-link\" href=\"" . $this->GetPrintUrl($id) . "\" title=\"{$this->lang['print_auto']}\" >";
     $set_array['[/print]'] = "</a>";
     if ($this->config['general_mod_rewrite']) {
         $set_array["{author_url}"] = $GLOBALS['config']['http_home_url'] . "/user/" . urlencode($this->autos[$id]['author']) . "/";
     } else {
         $set_array["{author_url}"] = $GLOBALS['PHP_SELF'] . "?subaction=userinfo&user=" . urlencode($this->autos[$id]['author']) . "/";
     }
     if ($this->autos[$id]['email']) {
         $set_array['[email]'] = "<a href=\"{$set_array['{auto_url}']}\" title=\"{$this->lang['auto_email_author']}\" OnClick=\"auto_email_send('{$id}');return false;\" >";
         $set_array['[/email]'] = "</a>";
     }
     if ($this->autos[$id]['photo']) {
         $set_array["{isset_photo}"] = $this->lang['isset_photo'];
     }
     if ($options['show_photo'] && !empty($this->autos[$id]['photos'][0]['id'])) {
         $this->tpl->SetBlock('exist_photo');
         $this->tpl->OpenRow('row_photo');
         $i = 1;
         foreach ($this->autos[$id]['photos'] as $photo) {
             if (file_exists(UPLOAD_DIR . $photo['model_id'] . "/" . $photo['image_name'])) {
                 $photo_one = "<img src=\"" . UPLOAD_URL . $photo['model_id'] . "/thumbs/{$photo['image_name']}\" alt=\"{$this->autos[$id]['mark_name']} {$this->autos[$id]['model_name']} photo {$i}\" >";
                 $set_array["{photo_{$i}}"] = "<a class=\"go_big_photo\" href=\"" . UPLOAD_URL . $photo['model_id'] . "/{$photo['image_name']}\" title=\"{$this->autos[$id]['mark_name']} {$this->autos[$id]['model_name']}\" >" . $photo_one . "</a>";
                 $this->tpl->SetRow(array("{photo}" => "<a class=\"lightbox\" href=\"" . UPLOAD_URL . $photo['model_id'] . "/{$photo['image_name']}\" >" . $photo_one . "</a>"), 'row_photo');
                 if ($photo['id'] == $this->autos[$id]['photo']) {
                     $set_array["{big_photo}"] = "<span id=\"big_photo\"><img src=\"" . UPLOAD_URL . $photo['model_id'] . "/{$photo['image_name']}\" alt=\"{$this->autos[$id]['mark_name']} {$this->autos[$id]['model_name']} photo {$i}\" ></span>";
                     $set_array["{photo}"] = "<a class=\"go_big_photo\" href=\"" . UPLOAD_URL . $photo['model_id'] . "/{$photo['image_name']}\" title=\"{$this->autos[$id]['mark_name']} {$this->autos[$id]['model_name']}\" >" . $photo_one . "</a>";
                 }
                 $i++;
             }
         }
         $this->tpl->CloseRow('row_photo');
     } elseif (empty($this->autos[$id]['photos'][0]['id'])) {
         $set_array["{photo}"] = "<img src=\"{THEME}/car-market/images/no_photo.jpg\" alt=\"{$this->autos[$id]['mark_name']} {$this->autos[$id]['model_name']}\" >";
     }
     if (MODER) {
         if (!$this->autos[$id]['allow_site'] && ($this->autos[$id]['exp_date'] > $this->base->timer->cur_time || !$this->autos[$id]['exp_date'])) {
             $set_array['{moder_class}'] = 'moder_new_auto id' . $id;
         } elseif (!$this->autos[$id]['allow_site'] && $this->autos[$id]['exp_date'] < $this->base->timer->cur_time) {
             $set_array['{moder_class}'] = 'moder_old_auto id' . $id;
         } else {
             $set_array['{moder_class}'] = 'id' . $id;
         }
     } else {
         $set_array['{moder_class}'] = 'id' . $id;
     }
     if ($options['show_edit']) {
         if (MODER) {
             $this->tpl->SetBlock('moder')->SetBlock('allow_del');
             $set_array["[edit]"] = "<a id=\"link_admin-{$id}\" onClick=\"dropdownmenu(this, event, ShowMenu('{$id}', '" . ($this->autos[$id]['allow_site'] ? 0 : 1) . "'), '170px');return false;\" target=\"_blank\" href=\"" . $GLOBALS['config']['http_home_url'] . "?do=" . $this->config['general_name_module'] . "&action=edit&id={$id}\">";
             $set_array["[/edit]"] = "</a>";
             $info = '';
             if ($this->autos[$id]['exp_date']) {
                 $info .= $this->lang['exp_date_site_admin'] . " " . date("d.m.Y H:i", $this->autos[$id]['exp_date']) . ";";
             }
             if ($this->autos[$id]['allow_block']) {
                 if ($this->autos[$id]['block_date']) {
                     $info .= " " . $this->lang['block_date_site_admin'] . " " . date("d.m.Y H:i", $this->autos[$id]['block_date']);
                 } else {
                     $info .= " " . $this->lang['block_date_site_admin'] . " " . $this->lang['block_date_unlim'];
                 }
             }
             if ($info) {
                 $set_array["{info}"] = $info;
             }
         } else {
             if (in_array($this->member['group'], $this->config['user_int_allow_edit']) && ($this->member['id'] && $this->member['id'] == $this->autos[$id]['author_id'] || $this->guest_session && $this->guest_session == $this->autos[$id]['guest_session'])) {
                 $set_array["[edit]"] = "<a target=\"_blank\" id=\"link_admin-{$id}\" href=\"" . $GLOBALS['config']['http_home_url'] . "?do=" . $this->config['general_name_module'] . "&action=edit&id={$id}\">";
                 $set_array["[/edit]"] = "</a>";
             }
             if (in_array($this->member['group'], $this->config['user_int_allow_del']) && ($this->member['id'] && $this->member['id'] == $this->autos[$id]['author_id'] || $this->guest_session && $this->guest_session == $this->autos[$id]['guest_session'])) {
                 $this->tpl->SetBlock('allow_del');
             }
         }
     }
     $set_array['{xfields}'] = '';
     foreach ($this->xfields->showFields($this->autos[$id]['xfields']) as $fid => $field) {
         if ($field['value']) {
             $set_array["{xfield_{$fid}_title}"] = $field['title'];
             $set_array["{xfield_{$fid}_descr}"] = $field['description'];
             $set_array["{xfield_{$fid}_value}"] = $field['value'];
             $set_array['{xfields}'] .= $field['title'] . ": " . $field['value'] . "<br />";
             $this->tpl->SetBlock('xfield_' . $fid);
         }
     }
     if ($this->autos[$id]['allow_site']) {
         $set_array['{status}'] = $this->lang['status_on_site'];
     } elseif (!$this->autos[$id]['exp_date'] || $this->autos[$id]['exp_date'] > $this->base->timer->cur_time) {
         $set_array['{status}'] = $this->lang['status_on_moder'];
     } else {
         $set_array['{status}'] = $this->lang['status_old'];
     }
     return $set_array;
 }
开发者ID:dautushenka,项目名称:car-market,代码行数:101,代码来源:CarMarketUser.php


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