我如何修复这个未定义的变量 [英] How I Can Repair This Undefined Variable

查看:73
本文介绍了我如何修复这个未定义的变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我在其他主机上迁移我的网站,迁移后我的类别表出现问题。问题写:注意:未定义的变量:位于第1行的/home/zuklezve/public_html/vqmod/vqcache/vq2-catalog_view_theme_theme_free_template_module_category.tpl中的位置注意:未定义的变量:/ home / zuklezve / public_html / vqmod / vqcache / vq2-catalog_view_theme_theme_free_template_module_category中的位置。 1号线上的tpl



vq2-catalog_view_theme_theme_free_template_module_category.tpl



 < span class =code-summarycomment><?  php     if    ($ position     =   =  'content_top'         $ position    < span class =code-keyword> =   =  'content_bottom')    {    >  
< div class = >
< div class = box-head ing > <? php echo $ heading_title; > < / div >
< div class = box-content >
< div class = box-product >
<? php foreach ($ categories as $ category) { >
< div >
<? php if ($ category ['thumb']) { >
< div class = image style = text-align:center >
< a href = <?php echo $ category ['href']; ?> > < img src = <?php echo $ category ['thumb']; ?> alt = <?php echo $ category ['name']; ?> / > < / a >
< / div >
<? php } >
< div style = text-align:center & gt; < a href = <?php echo $ category [ 'HREF']; ?> > <? php echo < span class =code-summarycomment> $ category ['name']; > < / a > < / div >
< / div >
<? php } >
< / div > ;
< / div >
< / div >
<? php } else { &g t;
< script type = text / javascript >
$(document).ready(function(){
$(。act-cat)。toggle (
function(){
$(this).next('。level-2-cat')。slideToggle(slow),{
duration:'slow',
easing:'easeOutBounce'
};
},
function(){
$(this).next('。level-2-cat')。slideToggle(slow),{
duration:'慢',
宽松:'easeOutBounce'
};
}
);
$('。box-category li')。last()。addClass('last');

});

< / script >

< div class = 框类别 >
< div class = box-heading > <? php echo $ heading_title; > < / div >
< div class = box-content >

< div class = box-category >
< ul >
&l t;? php foreach ($ categories as $ category) { >
<? php if ($ category ['category_id'] = = $ category_id) { >
< li class = active >
<? php } < span class =code-summarycomment> else
{ >
< < span class =code-leadattribute> li >
<? php } >
<? php if ($ category ['category_id'] = = $ category_id) { >
< a href = <?php echo $ category ['href']; ?> class = 有效 > <? php echo $ category ['name']; > < / a >
<? php } els e { >
< < span class =code-leadattribute> a href = <?php echo $ category ['href']; ?> > <? php echo < span class =code-summarycomment> $ category ['name']; > < / a >
<? php } >
<? PHP if ($ category ['children']) { > < span class = act-cat < span class =code-keyword>> < / span >
< ul class = level-2-cat >
<? php foreach ($ category ['children'] as $ child) { >
<? php if ($ child ['category_id'] = = $ child_id ) { >
< < span class =code-leadattribute> li class = 有效 >
<? php } else { >
< li >
<? php } >
<? php if ($ child ['category_id'] = = $ child_id) { >
< a < span class =code-attribute> href = <?php echo $ child ['href ]; ?> class = 有效 > <? php echo $ child ['name']; > < / a >
<? php } el se { >
< < span class =code-leadattribute> a href = <?php echo $ child ['href']; ?> > <? php echo < span class =code-summarycomment> $ child ['name']; > < / a >
<? php } >
< /立 <跨度class =code-keyword>>
<? php } >
< / ul >
<? php } >
< / li >
<? php } >
< / ul >
< / div >
< / div >
< / div >
<? php } >

解决方案

position = = 'content_top'


position = = content_bottom) { >
< < span class =code-leadattribute> div class = >
< div class = box-heading > ; <? php echo


heading_title; > < / div >
< div class = box-content >
< div = box-product >
<? php foreach

Hello, I migrate my website in other host, after migrate i have o problem up my category table. Problem write: Notice: Undefined variable: position in /home/zuklezve/public_html/vqmod/vqcache/vq2-catalog_view_theme_theme_free_template_module_category.tpl on line 1Notice: Undefined variable: position in /home/zuklezve/public_html/vqmod/vqcache/vq2-catalog_view_theme_theme_free_template_module_category.tpl on line 1

vq2-catalog_view_theme_theme_free_template_module_category.tpl

<?php if ($position == 'content_top'  or $position == 'content_bottom') { ?>
<div class="box">
  <div class="box-heading"><?php echo $heading_title; ?></div>
  <div class="box-content">
    <div class="box-product">
      <?php foreach ($categories as $category) { ?>
        <div>
                  <?php if ($category['thumb']) { ?>
                <div class="image" style="text-align: center">
                    <a href="<?php echo $category['href']; ?>"><img src="<?php echo $category['thumb']; ?>" alt="<?php echo $category['name']; ?>" /></a>
                </div>
          <?php } ?>
                <div style="text-align: center"><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a></div>
        </div>
      <?php } ?>
    </div>
  </div>
</div>
<?php } else { ?>
<script type="text/javascript">
    $(document).ready(function(){
       $(".act-cat").toggle(
                function() {
                     $(this).next('.level-2-cat').slideToggle("slow"),{
                        duration: 'slow',
                        easing: 'easeOutBounce'
                    };
                },
                function() {
                     $(this).next('.level-2-cat').slideToggle("slow"),{
                        duration: 'slow',
                        easing: 'easeOutBounce'
                    };
                }
            );
        $('.box-category li').last().addClass('last');

    });

</script>

<div class="box category">
  <div class="box-heading"><?php echo $heading_title; ?></div>
  <div class="box-content">

    <div class="box-category">
      <ul>
        <?php foreach ($categories as $category) { ?>
        <?php if ($category['category_id'] == $category_id) { ?>
        <li class="active">
        <?php } else { ?>
        <li>
        <?php } ?>
          <?php if ($category['category_id'] == $category_id) { ?>
          <a href="<?php echo $category['href']; ?>" class="active"><?php echo $category['name']; ?></a>
          <?php } else { ?>
          <a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
          <?php } ?>
          <?php if ($category['children']) { ?><span  class="act-cat"></span>
          <ul class="level-2-cat">
            <?php foreach ($category['children'] as $child) { ?>
            <?php if ($child['category_id'] == $child_id) { ?>
            <li class="active">
            <?php } else { ?>
            <li>
            <?php } ?>
              <?php if ($child['category_id'] == $child_id) { ?>
              <a href="<?php echo $child['href']; ?>" class="active"><?php echo $child['name']; ?></a>
              <?php } else { ?>
              <a href="<?php echo $child['href']; ?>"><?php echo $child['name']; ?></a>
              <?php } ?>
            </li>
            <?php } ?>
          </ul>
          <?php } ?>
        </li>
        <?php } ?>
      </ul>
    </div>
  </div>
</div>
<?php } ?>

解决方案

position == 'content_top' or


position == 'content_bottom') { ?> <div class="box"> <div class="box-heading"><?php echo


heading_title; ?></div> <div class="box-content"> <div class="box-product"> <?php foreach (


这篇关于我如何修复这个未定义的变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆