熱門: 免費試用, 常見問題, 內(nèi)容管理, 商品管理, 備案類型流程指導(dǎo), 如何安裝, 重新安裝, 如何更換模板 , 忘記網(wǎng)站密碼
留言模板布局主要分三部分,頁頭/頁中/頁底。
{template 'header.html'}
留言板鏈接遞增引用
{url('guestbook')}
留言框引用部分
<?php if(hasflash()) { ?> <?php echo showflash(); ?> <?php } ?> //留言框提示信息 <form method="post" action="" name="frmGuestbookSubmit" id="frmGuestbookSubmit" class="form_message"> <div class="form-group"> <label for="{lang('contactname')}">{lang('contactname')}</label> {form::input('nickname',get('username'))}// </div> <div class="form-group"> <label for="{lang('guesttel')}">{lang('guesttel')}</label> {form::input('guesttel',get('guesttel'))} </div> {if config::get('mobilechk_enable') && config::get('mobilechk_login')} <script src="{$base_url}/js/mobilechk.js"></script> <div class="blank10"></div> <input id="btm_sendMobileCode" onclick="sendMobileCode($('#tel').val());" type="button" value="{lang('please_enter_the_phone_verification_code')}" /> <input type='text' id="mobilenum"tabindex="4" placeholder="{lang('send_cell_phone_verification_code')}"name="mobilenum" /> <div class="blank10"></div> {/if} <div class="form-group"> <label for="{lang('guestemail')}">{lang('guestemail')}</label> {form::input('guestemail',get('guestemail'))} </div> <div class="form-group"> <label for="{lang('guestqq')}">{lang('guestqq')}</label> {form::input('guestqq',get('guestqq'))} </div> {loop $field $f} <?php $name=$f['name']; if($name==$primary_key) continue; ?> <div class="form-group"> <label for="{$name|lang}">{$name|lang}</label> {form::getform($name,@$form,$field,@$data)} </div> {/loop} {if config::get('verifycode')=='1'} <div class="balnk10"></div> <input type='text' id="verify"tabindex="3"name="verify" />{verify()} <div class="balnk10"></div> {/if} {if config::get('verifycode')=='2'} <div class="balnk10"></div> <div id="verifycode_embed"></div> <script src="http://api.geetest.com/get.php"></script> <script> var loadGeetest = function(config) { window.gt_captcha_obj = new window.Geetest({ gt : config.gt, challenge : config.challenge, product : 'float', offline : !config.success }); gt_captcha_obj.appendTo("#verifycode_embed"); }; $.ajax({ url : '{url('tool/geetest')}', type : "get", dataType : 'JSON', success : function(result) { //console.log(result); loadGeetest(result) } }); </script> {/if} <div class="blank60"></div> <button class="btn btn-primary" type="submit" name="submit" value="{lang('submit_on')}">{lang('submit_on')} <span class="badge">Guestbook</span></button> </form>
留言列表引用
{loop $data $d} <div id="comm_content"></div> <p>{$d['content']}</p> {if $d['reply']}<dd class="admin_reply"> {lang('adminreply')}: {$d['reply']} </dd> {/if} <p><strong>{$d['username']}</strong><span>{sdate($comment['adddate'],'Y-m-d H:i')}</span></p> </div> {/loop} <div class="pages"> <?php echo pagination::html($record_count); ?>//留言列表分頁 </div>
留言框必須引用JS部分
<script type="text/javascript"> <!-- function isMobile(mobile){ return /^1([0-9]+){5,}$/g.test(mobile); } var sec = 30; var o_dsq = null; function senddjs(){ sec--; $('#btm_sendMobileCode').val(sec+lang('seconds_after_you_can_re_send')); if(sec == 0){ clearInterval(o_dsq); $('#btm_sendMobileCode').val(lang('resend_the_checksum')); $('#btm_sendMobileCode').attr('disabled',false); sec = 30; } } function sendMobileCode(mobile){ if(isMobile(mobile)){ $('#btm_sendMobileCode').attr('disabled',true); $.post("{url('tool/smscode')}",{'mobile':mobile},function(data){ alert(data); },'text'); o_dsq = setInterval("senddjs()",1000); }else{ alert("{lang('phone_number_format_is_wrong')}"); $('#guesttele').focus(); } } $(function(){ $('#frmGuestbookSubmit').submit(function(e) { if($('#nickname').val() == ''){ alert("{lang('please_enter_your_user_name')}"); $('#nickname').focus(); return false; } if($('#guesttel').val() == ''){ alert({lang('p_m_content')}); $('#guesttel').focus(); return false; } {if config::get('mobilechk_enable') && config::get('mobilechk_guestbook')} if($('#mobilenum').val() == ''){ alert("{lang('cell_phone_parity_error')}"); $('#mobilenum').focus(); return false; } {/if} if($('#guestemail').val() == ''){ alert("lang('please_fill_in_the_mailbox')"); $('#guestemail').focus(); return false; } if($('#title').val() == ''){ alert("{lang('please_enter_the_title')}"); $('#title').focus(); return false; } if($('#content').val() == ''){ alert("lang('p_content')"); $('#content').focus(); return false; } {if config::get('verifycode')} //if($('#verify').val() == ''){ if(!verify::checkGee()){ alert("{lang('please_enter_code')}"); $('#verify').focus(); return false; } {/if} }); }); //--> </script>
{template 'footer.html'}
用 CmsEasy 助您「輕松搭建」企業(yè)官網(wǎng)。