D
D
Dex7772015-09-14 10:30:19
Python
Dex777, 2015-09-14 10:30:19

How to put a slider on a site based on Kohana?

Hello, I had no business with Kohana before, I need to make a slider on the main page of the site, now it’s just a static image, I still can’t figure out where exactly to write the slider code . There is an index.php file with the code
in the site hosting in the application/views folder :

<div class="content">
       <div class="kolge">
           <div class="cont-center">
               <div class="logo1"><img src="<? echo URL::base(true,true) ?>css/images/logo1.png"/></div>
               <div class="indeximg"><img src="<? echo URL::base(true,true) ?>css/images/indeximg-j.png"/></div>
               <div class="news">
                   <div class="slides">
                        <ul>
                          <? echo $news; ?>
                            <!--<li>
                                <div>
                                    <span id="sl1">Ümumi keyfiyyət</span>
                                    <span id="sl2">Lorem Ipsum, dizgi ve baskı asendüstrisində</span>
                                    <span id="sl2">kullanılan Ipsum<img src="<? echo URL::base(true,true) ?>css/images/slide1.png"/></span>
                                </div>
                            </li>
                            <li>
                                <div>
                                    <span id="sl1">Общее</span>
                                    <span id="sl2">Lorem Ipsum, dizgi ve baskı asendüstrisində</span>
                                    <span id="sl2"><img src="<? echo URL::base(true,true) ?>css/images/slide2.png"/>kullanılan Ipsum</span>
                                </div>
                            </li>
                            <li>
                                <div>
                                    <span id="sl1">Metanol tərkib</span>
                                    <span id="sl2">Lorem Ipsum, dizgi ve baskı asendüstrisində</span>
                                    <span id="sl2"><img src="<? echo URL::base(true,true) ?>css/images/slide2.png"/>kullanılan Ipsum</span>
                                </div>
                            </li>-->
                            
                        </ul>
                   </div>
               
               </div>
           </div>
           <div class="footer">
                    <div class="cont-center">
                       <div class="studio">
                           <span>© Copyright <a target="_blank" href="https://www.yoursite.com">STUDIO</a> studio</span>
                       </div>
                    </div>
           </div>
       </div>
    </div>

There is also a template.php file with code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
        <title><? echo $title ?></title>      
        
        <meta name="keywords" content="<? echo $keyw; ?>" />
        <meta name="description" content="<? echo $desc; ?>" />
  
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
        <link rel="icon" href="<? echo URL::base(true,true) ?>favicon.ico"  type="image/x-icon" />
    <link rel="stylesheet" href="<? echo URL::base(true,true) ?>css/jquery.superbox.css" type="text/css" media="all" />
    <link href="<? echo URL::base(true,true) ?>css/slider.css" rel="stylesheet" type="text/css"/>            
  <link rel="stylesheet" href="<? echo URL::base(true,true) ?>css/style.css" type="text/css" media="screen, projection" />
   
    <script type="text/javascript" src="<? echo URL::base(true,true) ?>js/jquery-1.9.1.min.js"></script>  
    <script type="text/javascript" src="<? echo URL::base(true,true) ?>js/1.3.2.min.js"></script>
    <script type="text/javascript" src="<? echo URL::base(true,true) ?>js/jquery.superbox.js"></script>
    <script src="<? echo URL::base(true,true) ?>js/slider.js"></script>
    
    
    
</head>
 <script type="text/javascript">
    $(function(){
      $.superbox.settings = {
        closeTxt: "Close",
        loadTxt: "Loading...",
        nextTxt: "Next",
        prevTxt: "Previous"
      };
      $.superbox();
    });
  </script>
    <style type="text/css">
    #superbox-overlay{background:#e0e4cc;}
    #superbox-container .loading{width:32px;height:32px;margin:0 auto;text-indent:-9999px;background:url(styles/loader.gif) no-repeat 0 0;}
    #superbox .close a{float:right;padding:0 5px;line-height:20px;background:#333;cursor:pointer;}
    #superbox .close a span{color:#fff;}
    #superbox .nextprev a{float:left;margin-right:5px;padding:0 5px;line-height:20px;background:#333;cursor:pointer;color:#fff;}
    #superbox .nextprev .disabled{background:#ccc;cursor:default;}
  </style>
<body>

  <div class="header">
    <div class="head-center">
        <div class="lang">
        <? echo $langbar; ?>
        </div>
        <div class="menu">
        <? echo $menubar; ?>
        </div>
        <div class="social">
           <a id="face" href="https://www.facebook.com" target="_blank"></a>
           <a id="twit" href="#"></a>
        </div>
    </div>
    </div>
    <? echo $container;?>
    
    <script type="text/javascript">
        var url='<?  echo URL::base(true,true); ?>';
     </script>
        
    <script src="<? echo URL::base(true,true) ?>js/jquery.form.js"></script>        
    <script src="<? echo URL::base(true,true) ?>js/custom.js"></script>
        
  </body>

</html>

Answer the question

In order to leave comments, you need to log in

3 answer(s)
H
h0w4rd, 2019-04-15
@h0w4rd

Searches for regular expression text, from the "canonicalize" function You can play around with it
at regex101.com and see what it can find.

I
Igor Belyaev, 2015-09-14
@ib2

Well, it's not about kohana. I don't know where exactly you need to insert the slider, but everything is done in the same way as with regular html.
1. We connect the js script
2. Вставляем слайдер в страницу. Что-то вроде:
3. Инициализация слайдера. Что-то вроде:
Могу только добавить, что в вашем примере скрипты подключаются через <?php echo URL::base(true, true); ?>. Данная конструкция просто возвращает адрес сайта.
Файл template.php - это простой layout, в который вставляются остальные страницы. В нем подключайте js-скрипты, css-стили и т.д.
Файл index.php, как я понял - это и есть шаблон главной страницы, вот в него и вставляйте слайдер.

D
Dex777, 2015-09-16
@Dex777

Here are the instructions for connecting the slider itself:

<!-- 1. Link to jQuery (1.8 or later), -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <!-- 33 KB -->

<!-- fotorama.css & fotorama.js. -->
<link  href="http://cdnjs.cloudflare.com/ajax/libs/fotorama/4.6.4/fotorama.css" rel="stylesheet"> <!-- 3 KB -->
<script src="http://cdnjs.cloudflare.com/ajax/libs/fotorama/4.6.4/fotorama.js"></script> <!-- 16 KB -->

<!-- 2. Add images to <div class="fotorama"></div>. -->
<div class="fotorama">
  <img src="http://s.fotorama.io/1.jpg">
  <img src="http://s.fotorama.io/2.jpg">
</div>

<!-- 3. Enjoy! -->

how do i make a link here
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js">
?
something like
<?php echo URL::base(true, true); ?http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js>
?
in template.php is now linked like this
<script type="text/javascript" src="<? echo URL::base(true,true) ?>js/1.3.2.min.js"></script>

but there seems to be a version below the required
one, is it possible to download the library itself and just throw it in the same directory in which version 1.3.2 is now?
And please tell me what to prescribe where given the instructions for the slider

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question