您好我使用的是Osclass脚本,并且在我的项目帖子页面上发布按钮有问题!
列表位置:发布按钮需要为未注册的用户隐藏,并为注册用户显示。
如何在注销时更改此代码以隐藏?
<?php if(!osc_is_web_user_logged_in() ) { ?>
发布商信息:需要为未注册的用户显示发布按钮,并为注册用户隐藏。为此,我使用此代码,看起来效果很好!
<?php if(!osc_is_web_user_logged_in() ) { ?>
<fieldset>
<h2>
<strong><?php _e("Publisher Information", 'ctg_housing'); ?></strong>
</h2>
<div class="item-post-user-name item-post-columns">
<label class="control-label" for="contactName">
<span class="required_fields">*</span>
<?php _e('Name', 'ctg_housing'); ?>
</label>
<?php ItemForm::contact_name_text(); ?>
</div>
<div class="item-post-user-email item-post-columns">
<label class="control-label" for="contactEmail">
<span class="required_fields">*</span>
<?php _e('E-mail', 'ctg_housing'); ?>
</label>
<?php ItemForm::contact_email_text(); ?>
</div>
<div class="clearfix"></div>
<div id="submit-button" class="item-post-button text-center">
<button type="submit" class="small button_radius">
<?php if($edit) { _e("Update Listing", 'ctg_housing'); } else { _e("Publish Listing", 'ctg_housing'); } ?>
</button>
</div>
</fieldset>
<?php } ?>
由于
答案 0 :(得分:0)
在这里解答了答案!
<?php if( osc_is_web_user_logged_in() ) { ?>
<fieldset>
<h2>
<strong><?php _e('Listing Location', 'ctg_housing'); ?></strong>
</h2>
<?php $aCountries = Country::newInstance()->listAll(); ?>
<?php $TwoCountry = false ; if(count($aCountries) > 1 ) { $TwoCountry = true ; ?>
<div class="item-post-country">
<label class="control-label" for="country">
<span class="required_fields">* </span>
<?php _e('Country', 'ctg_housing'); ?>
</label>
<?php ItemForm::country_select(osc_get_countries()); ?>
</div>
<?php } else { ?>
<input type="hidden" name="countryId" id="countryId" value="<?php echo ctg_country_id(); ?>" />
<?php } ?>
<div class="item-post-province">
<label class="control-label" for="region">
<span class="required_fields">* </span>
<?php _e('Province', 'ctg_housing'); ?>
</label>
<?php ItemForm::region_select(osc_get_regions()); ?>
</div>
<div class="item-post-region">
<label class="control-label" for="city">
<span class="required_fields">* </span>
<?php _e('Region', 'ctg_housing'); ?>
</label>
<?php ItemForm::city_select(osc_get_cities()); ?>
</div>
<div class="clearfix"></div>
<div id="submit-button" class="item-post-button text-center">
<button type="submit" class="small button_radius">
<?php if($edit) { _e("Update Listing", 'ctg_housing'); } else { _e("Publish Listing", 'ctg_housing'); } ?>
</button>
</div>
</fieldset>
<?php } else { ?>
<fieldset>
<h2>
<strong><?php _e('Listing Location', 'ctg_housing'); ?></strong>
</h2>
<?php $aCountries = Country::newInstance()->listAll(); ?>
<?php $TwoCountry = false ; if(count($aCountries) > 1 ) { $TwoCountry = true ; ?>
<div class="item-post-country">
<label class="control-label" for="country">
<span class="required_fields">* </span>
<?php _e('Country', 'ctg_housing'); ?>
</label>
<?php ItemForm::country_select(osc_get_countries()); ?>
</div>
<?php } else { ?>
<input type="hidden" name="countryId" id="countryId" value="<?php echo ctg_country_id(); ?>" />
<?php } ?>
<div class="item-post-province">
<label class="control-label" for="region">
<span class="required_fields">* </span>
<?php _e('Province', 'ctg_housing'); ?>
</label>
<?php ItemForm::region_select(osc_get_regions()); ?>
</div>
<div class="item-post-region">
<label class="control-label" for="city">
<span class="required_fields">* </span>
<?php _e('Region', 'ctg_housing'); ?>
</label>
<?php ItemForm::city_select(osc_get_cities()); ?>
</div>
</fieldset>
<fieldset>
<h2>
<strong><?php _e("Publisher Information", 'ctg_housing'); ?></strong>
</h2>
<div class="item-post-user-name item-post-columns">
<label class="control-label" for="contactName">
<span class="required_fields">*</span>
<?php _e('Name', 'ctg_housing'); ?>
</label>
<?php ItemForm::contact_name_text(); ?>
</div>
<div class="item-post-user-email item-post-columns">
<label class="control-label" for="contactEmail">
<span class="required_fields">*</span>
<?php _e('E-mail', 'ctg_housing'); ?>
</label>
<?php ItemForm::contact_email_text(); ?>
</div>
<div class="clearfix"></div>
<div id="submit-button" class="item-post-button text-center">
<button type="submit" class="small button_radius">
<?php if($edit) { _e("Update Listing", 'ctg_housing'); } else { _e("Publish Listing", 'ctg_housing'); } ?>
</button>
</div>
</fieldset>
<?php } ?>
&#13;