0

感谢您提出我的问题,我对 codeigniter 有疑问,我使用 php 页面作为整个网站的基本模板。

在该模板中,我在页面顶部有一个 div,带有不同的标志来选择成语。

出于某种原因,它只适用于一个页面,而不适用于其他页面。

这是我的模板

<?php
if (!function_exists("cortar_string")) {

    function cortar_string($cadena)
    {
        return substr( $cadena, 0, 50 );
    }

}
if (!function_exists("muestra_mes")) {

    function muestra_mes($mes)
    {
        $r = "";
        switch($mes)
        {
            case 1:
                $r = "Enero<br/>January";
                break;
            case 2:
                $r = "Febrero<br/>February";
                break;
            case 3:
                $r = "Marzo<br/>March";
                break;  
            case 4:
                $r = "Abril<br/>April";
                break;
            case 5:
                $r = "Mayo<br/>May";
                break;
            case 6:
                $r = "Junio<br/>June";
                break;
            case 7:
                $r = "Julio<br/>July";
                break;
            case 8:
                $r = "Agosto<br/>August";
                break;
            case 9:
                $r = "Septiembre<br/>September";
                break;
            case 10:
                $r = "Octubre<br/>October";
                break;
            case 11:
                $r = "Noviembre<br/>November";
                break;
            case 12:
                $r = "Diciembre<br/>December";
                break;
        }
        return $r;  
    }
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="robots" content="index, follow" />
    <meta name="keywords" content="soporte tecnico, laptop, pc, caracas, grupo soporte tecnico gl, soporte tecnico caracas, informatica, telecomunicaciones, gts, tecnología, ti, it, servicios, igs, campus tecnologicos, continuidad de negocios, comunicaciones integradas, arquitectura y estrategia de ti, mantenimiento y soporte tecnico, middleware, seguridad, privacidad, servidores, data center, outsourcing, almacenamiento de datos, Diseño de Paginas web, aplicaciones web, Venezuela, Maracaibo, Zulia, COL, Cabimas, Ojeda, San Francisco, tecnología, computación, laptops, equipos, computadoras, servicio, sistemas, tecnico, biometrico" />
    <meta property="og:title" content="<?php echo $titulo; ?>"/>
    <meta property="og:type" content="info" />
    <meta property="og:description" content="Sitio de Servicios y Soluciones en Computación, desarrollo de sistemas de información, sitios web, y aplicaciones web. Asesorias en Informática, Soporte técnico Preventivo y Correctivo.">
    <meta name="description" content="Sitio de Servicios y Soluciones en Computación, desarrollo de sistemas de información, sitios web, y aplicaciones web. Asesorias en Informática, Soporte técnico Preventivo y Correctivo." />
    <meta property="og:image" content="http://i47.photobucket.com/albums/f195/warbandit69/TarjetaRicardo1-1.jpg"/>
  <title><?php echo $titulo; ?></title>
  <meta charset="utf-8">
  <link rel="stylesheet" href="<?php echo base_url(); ?>/css/reset.css" type="text/css" media="all">
  <link rel="stylesheet" href="<?php echo base_url(); ?>/css/style.css" type="text/css" media="all">
  <script type="text/javascript" src="<?php echo base_url(); ?>/js/jquery-1.4.2.min.js" ></script>
  <script type="text/javascript" src="<?php echo base_url(); ?>/js/cufon-yui.js"></script>
  <script type="text/javascript" src="<?php echo base_url(); ?>/js/Humanst521_BT_400.font.js"></script>
  <script type="text/javascript" src="<?php echo base_url(); ?>/js/Humanst521_Lt_BT_400.font.js"></script>
    <script type="text/javascript" src="<?php echo base_url(); ?>/js/roundabout.js"></script>
  <script type="text/javascript" src="<?php echo base_url(); ?>/js/roundabout_shapes.js"></script>
  <script type="text/javascript" src="<?php echo base_url(); ?>/js/gallery_init.js"></script>
  <script type="text/javascript" src="<?php echo base_url(); ?>/js/cufon-replace.js"></script>
  <script type="text/javascript" src="<?php echo base_url(); ?>/js/loopedslider.min.js"></script>
  <div id="fb-root"></div>
<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/es_LA/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>
  <!--[if lt IE 7]>
    <link rel="stylesheet" href="css/ie/ie6.css" type="text/css" media="all">
  <![endif]-->
  <!--[if lt IE 9]>
    <script type="text/javascript" src="js/html5.js"></script>
    <script type="text/javascript" src="js/IE9.js"></script>
  <![endif]-->


    <!-- Add mousewheel plugin (this is optional) -->
    <script type="text/javascript" src="<?php echo base_url(); ?>/js/jquery.mousewheel-3.0.6.pack.js"></script>

    <!-- Add fancyBox main JS and CSS files -->
    <script type="text/javascript" src="<?php echo base_url(); ?>/source/jquery.fancybox.js?v=2.1.5"></script>
    <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>/source/jquery.fancybox.css?v=2.1.5" media="screen" />

    <!-- Add Button helper (this is optional) -->
    <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>/source/helpers/jquery.fancybox-buttons.css?v=1.0.5" />
    <script type="text/javascript" src="<?php echo base_url(); ?>/source/helpers/jquery.fancybox-buttons.js?v=1.0.5"></script>

    <!-- Add Thumbnail helper (this is optional) -->
    <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>/source/helpers/jquery.fancybox-thumbs.css?v=1.0.7" />
    <script type="text/javascript" src="<?php echo base_url(); ?>/source/helpers/jquery.fancybox-thumbs.js?v=1.0.7"></script>

    <!-- Add Media helper (this is optional) -->
    <script type="text/javascript" src="<?php echo base_url(); ?>/source/helpers/jquery.fancybox-media.js?v=1.0.6"></script>

    <script type="text/javascript">
        $(document).ready(function() {
            /*
             *  Simple image gallery. Uses default settings
             */

            $('.fancybox').fancybox();

            /*
             *  Different effects
             */

            // Change title type, overlay closing speed
            $(".fancybox-effects-a").fancybox({
                helpers: {
                    title : {
                        type : 'outside'
                    },
                    overlay : {
                        speedOut : 0
                    }
                }
            });

            // Disable opening and closing animations, change title type
            $(".fancybox-effects-b").fancybox({
                openEffect  : 'none',
                closeEffect : 'none',

                helpers : {
                    title : {
                        type : 'over'
                    }
                }
            });

            // Set custom style, close if clicked, change title type and overlay color
            $(".fancybox-effects-c").fancybox({
                wrapCSS    : 'fancybox-custom',
                closeClick : true,

                openEffect : 'none',

                helpers : {
                    title : {
                        type : 'inside'
                    },
                    overlay : {
                        css : {
                            'background' : 'rgba(238,238,238,0.85)'
                        }
                    }
                }
            });

            // Remove padding, set opening and closing animations, close if clicked and disable overlay
            $(".fancybox-effects-d").fancybox({
                padding: 0,

                openEffect : 'elastic',
                openSpeed  : 150,

                closeEffect : 'elastic',
                closeSpeed  : 150,

                closeClick : true,

                helpers : {
                    overlay : null
                }
            });

            /*
             *  Button helper. Disable animations, hide close button, change title type and content
             */

            $('.fancybox-buttons').fancybox({
                openEffect  : 'none',
                closeEffect : 'none',

                prevEffect : 'none',
                nextEffect : 'none',

                closeBtn  : false,

                helpers : {
                    title : {
                        type : 'inside'
                    },
                    buttons : {}
                },

                afterLoad : function() {
                    this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : '');
                }
            });


            /*
             *  Thumbnail helper. Disable animations, hide close button, arrows and slide to next gallery item if clicked
             */

            $('.fancybox-thumbs').fancybox({
                prevEffect : 'none',
                nextEffect : 'none',

                closeBtn  : false,
                arrows    : false,
                nextClick : true,

                helpers : {
                    thumbs : {
                        width  : 50,
                        height : 50
                    }
                }
            });

            /*
             *  Media helper. Group items, disable animations, hide arrows, enable media and button helpers.
            */
            $('.fancybox-media')
                .attr('rel', 'media-gallery')
                .fancybox({
                    openEffect : 'none',
                    closeEffect : 'none',
                    prevEffect : 'none',
                    nextEffect : 'none',

                    arrows : false,
                    helpers : {
                        media : {},
                        buttons : {}
                    }
                });

            /*
             *  Open manually
             */

            $("#fancybox-manual-a").click(function() {
                $.fancybox.open('1_b.jpg');
            });

            $("#fancybox-manual-b").click(function() {
                $.fancybox.open({
                    href : 'iframe.html',
                    type : 'iframe',
                    padding : 5
                });
            });

            $("#fancybox-manual-c").click(function() {
                $.fancybox.open([
                    {
                        href : '1_b.jpg',
                        title : 'My title'
                    }, {
                        href : '2_b.jpg',
                        title : '2nd title'
                    }, {
                        href : '3_b.jpg'
                    }
                ], {
                    helpers : {
                        thumbs : {
                            width: 75,
                            height: 50
                        }
                    }
                });
            });


        });
    </script>
    <style type="text/css">
        .fancybox-custom .fancybox-skin {
            box-shadow: 0 0 50px #222;
        }


    </style>
</head>

<body>
<!-- header -->
<section id="preheader">
    <div class="menu_lateral">
        <center>
        <?php $a = base_url(); 
        $a1 = explode("//",$a);
        //print_r($a1);
        $a2 = explode("/",$a1[1]);
        $web = $a2[0];
        ?>
        <a href="<?php echo base_url(); ?>"><img src="<?php echo base_url(); ?>/images/flags/Venezuela-32.png" alt="Español Venezuela" /></a>&nbsp;
        <a href="<?php echo base_url(); ?>"><img src="<?php echo base_url(); ?>/images/flags/Colombia-32.png" alt="Español Colombia" /></a>&nbsp;
        <a href="<?php echo base_url(); ?>"><img src="<?php echo base_url(); ?>/images/flags/Spain-32.png" alt="Español España" /></a>&nbsp;
        <a href="<?php echo base_url(); ?>"><img src="<?php echo base_url(); ?>/images/flags/Argentina-32.png" alt="Español Argentina" /></a>&nbsp;
        <a href="<?php echo base_url(); ?>"><img src="<?php echo base_url(); ?>/images/flags/Chile-32.png" alt="Español Chile" /></a>&nbsp;
        <a href="<?php echo base_url(); ?>"><img src="<?php echo base_url(); ?>/images/flags/Mexico-32.png" alt="Español Mexico" /></a>&nbsp;
        <a href="<?php echo base_url(); ?>"><img src="<?php echo base_url(); ?>/images/flags/Panama-32.png" alt="Español Panama" /></a>&nbsp;
        <a href="http://translate.google.co.ve/translate?sl=auto&tl=pt&js=n&prev=_t&hl=es-419&ie=UTF-8&u=http%3A%2F%2F<?php echo $web; ?>%2F&act=url" ><img src="<?php echo base_url(); ?>/images/flags/Brazil-32.png" alt="Portugues Brasil" /></a>&nbsp;
        <a href="http://translate.google.co.ve/translate?sl=auto&tl=pt&js=n&prev=_t&hl=es-419&ie=UTF-8&u=http%3A%2F%2F<?php echo $web; ?>%2F&act=url" ><img src="<?php echo base_url(); ?>/images/flags/Portugal-32.png" alt="Portugues Portugal" /></a>&nbsp;
        <a href="http://translate.google.co.ve/translate?sl=auto&tl=en&js=n&prev=_t&hl=es-419&ie=UTF-8&u=http%3A%2F%2F<?php echo $web; ?>%2F&act=url" ><img src="<?php echo base_url(); ?>/images/flags/United-States-32.png" alt="Ingles Estados Unidos USA" /></a>&nbsp;
        <a href="http://translate.google.co.ve/translate?sl=auto&tl=en&js=n&prev=_t&hl=es-419&ie=UTF-8&u=http%3A%2F%2F<?php echo $web; ?>%2F&act=url" ><img src="<?php echo base_url(); ?>/images/flags/United Kingdom_32.png" alt="England" /></a>&nbsp;
        </center>
  </div>
  </section>
  <header>



    <div class="container">
        <h1><a href="<?php echo base_url(); ?>">Soluciones R&iacute;os</a></h1>
      <nav>
        <ul>
        <li>
            <?php 
          if ($seleccion=="inicio") {
            echo anchor("welcome/index","Bienvenido", array("class" => "current"));  
          }
          else
          {
            echo anchor("welcome/index","Bienvenido");  
          }
            ?> 
        </li>
          <li><?php 
          if ($seleccion=="sobre") {
            echo anchor("welcome/sobre","Sobre Mi", array("class" => "current"));  
          }
          else
          {
            echo anchor("welcome/sobre","Sobre Mi");  
          }
            ?>      
            </li>
          <li>
          <?php 
          if ($seleccion=="servicios") {
            echo anchor("welcome/servicios","Servicios", array("class" => "current"));  
          }
          else
          {
            echo anchor("welcome/servicios","Servicios");  
          }
            ?>
          </li>
          <li>
          <?php 
          if ($seleccion=="productos") {
            echo anchor("welcome/productos","Productos", array("class" => "current"));  
          }
          else
          {
            echo anchor("welcome/productos","Productos");  
          }
            ?>
          </li>
          <li>
          <?php
          if ($seleccion=="contacto") {
            echo anchor("welcome/contacto","Contacto", array("class" => "current"));  
          }
          else
          {
            echo anchor("welcome/contacto","Contacto");  
          }
          ?>
          </li>
          <li>
          <?php
          if ($seleccion=="mapa") {
            echo anchor("welcome/mapa","Mapa", array("class" => "current"));  
          }
          else
          {
            echo anchor("welcome/mapa","Mapa");  
          }
          ?>
          </li>
        </ul>
      </nav>
    </div>
    </header>
  <!-- #gallery -->
  <section id="gallery">
    <div class="container">
        <?php 
        if (isset($proyectos))  {
            $this->load->view($proyectos); 
        }
        ?>
    </div>
  </section>
  <!-- /#gallery -->
  <?php $this->load->view($main_content); ?>
  <!-- footer -->
  <footer>
    <div class="container">
        <div class="wrapper">
        <div class="fleft"><div><a href="http://twitter.com/ricardojriosr" class="twitter-follow-button">Sigueme @ricardojriosr </a>&nbsp;&nbsp;<div class="fb-like" data-href="https://www.facebook.com/pages/Ricardo-R%C3%ADos/285721804823546?ref=hl#" data-width="450" data-layout="button_count" data-show-faces="true" data-send="true"></div></div></div>
        <div class="fright"><script type="text/javascript">
  (function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  })();
</script>



&nbsp;<a rel="nofollow" href="mailto:ricardojriosr@gmail.com" target="_blank">ricardojriosr@gmail.com</a> &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; +58 414-6518896 &nbsp;&nbsp; <u>Skype</u>: ricardojriosr83
      </div>
    </div>
  </footer>
  <script type="text/javascript"> Cufon.now(); </script>
</body>
</html>

这是我的网站

PD:你可以在我网页的源代码中看到 CSS,谢谢

4

0 回答 0