Advertisement
Guest User

Untitled

a guest
Dec 20th, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.41 KB | None | 0 0
  1. Severity: Warning
  2.  
  3. Message: Missing argument 1 for Vijesti::kategorija()
  4.  
  5. Filename: controllers/vijesti.php
  6.  
  7. Line Number: 12
  8.  
  9. Severity: Notice
  10.  
  11. Message: Undefined variable: cat_name
  12.  
  13. Filename: controllers/vijesti.php
  14.  
  15. Line Number: 13
  16.  
  17. Severity: Warning
  18.  
  19. Message: Cannot modify header information - headers already sent by (output started at C:wampwwwci_cms_ytsystemcoreExceptions.php:185)
  20.  
  21. Filename: libraries/Session.php
  22.  
  23. Line Number: 688
  24.  
  25. <?php
  26. class Vijest extends CI_Model{
  27.  
  28. function get_news_by_name($cat_name,$num=20,$start=0){
  29. $sql="SELECT * FROM posts WHERE post_cat_name=? ORDER BY post_date DESC LIMIT $start,$num";
  30. $array=array($cat_name);
  31. $this->session->set_userdata('term',$cat_name);
  32. $query=$this->db->query($sql,$array);
  33. return $query->result_array();
  34. }
  35. function get_post($slug){
  36. $query=$this->db->query("SELECT * FROM posts WHERE slug='$slug'");
  37. return $query->result_array();
  38. }
  39. function get_posts_count(){
  40. $query=$this->db->query("SELECT post_id FROM posts");
  41. return $query->num_rows();
  42. }
  43.  
  44. }
  45.  
  46. ?>
  47.  
  48. <?php
  49. class Vijesti extends CI_Controller{
  50. function __construct(){
  51. parent::__construct();
  52.  
  53. $this->load->model('vijest');
  54. $this->load->model('home_model');
  55. $this->load->library('pagination');
  56. }
  57.  
  58.  
  59. function kategorija($cat_name){
  60. $data['vijesti']=$this->vijest->get_news_by_name($cat_name,1,0);
  61. $data1['navigation']=$this->home_model->get_cats_nav();
  62. $data3['sidebar_news']=$this->home_model->sidebar_news();
  63. $config['base_url']=base_url().'vijesti/kategorija/';
  64. $config['total_rows']=$this->vijest->get_posts_count();
  65. $config['per_page']=1;
  66. $config['full_tag_open'] = '<ul class="pagination">';
  67. $config['full_tag_close'] = '</ul>';
  68. $config['prev_link'] = '<';
  69. $config['prev_tag_open'] = '<li>';
  70. $config['prev_tag_close'] = '</li>';
  71. $config['next_link'] = '>';
  72. $config['next_tag_open'] = '<li>';
  73. $config['next_tag_close'] = '</li>';
  74. $config['cur_tag_open'] = '<li class="active"><a href="#"><span class="sr-only">(current)</span>';
  75. $config['cur_tag_close'] = '</a></li>';
  76. $config['num_tag_open'] = '<li>';
  77. $config['num_tag_close'] = '</li>';
  78.  
  79. $config['first_tag_open'] = '<li>';
  80. $config['first_tag_close'] = '</li>';
  81. $config['last_tag_open'] = '<li>';
  82. $config['last_tag_close'] = '</li>';
  83. $this->pagination->initialize($config);
  84. $data['pages']=$this->pagination->create_links();
  85.  
  86. $this->load->view('header',$data1);
  87. $this->load->view('vijesti_po_kategoriji',$data);
  88. $this->load->view('footer',$data3);
  89.  
  90. }
  91.  
  92.  
  93.  
  94. function vijest($slug){
  95. $data1['navigation']=$this->home_model->get_cats_nav();
  96. $data2['vijest']=$this->vijest->get_post($slug);
  97. $data3['sidebar_news']=$this->home_model->sidebar_news();
  98. $this->load->view('header',$data1);
  99. $this->load->view('vijest_pojedinacno',$data2);
  100. $this->load->view('footer',$data3);
  101. }
  102. }
  103.  
  104. ?>
  105.  
  106. <!DOCTYPE html>
  107. <html>
  108. <head>
  109. <meta charset="UTF-8">
  110. <title>News</title>
  111. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  112. <link href="<?php echo base_url('assets/css/bootstrap.min.css');?>" rel="stylesheet">
  113. <script src="<?php echo base_url('assets/js/bootstrap.min.js');?>"></script>
  114. <script src="<?php echo base_url('assets/js/jquery.js');?>"></script>
  115. <link rel="stylesheet" href="<?php echo base_url('assets/css/mojstil.css');?>">
  116. </head>
  117. <body>
  118. <div class="sadrzaj">
  119. <div class="head">
  120. <a href="<?=base_url()?>home/index"><img id="logo" src="<?=base_url()?>assets/img/admalogo.png" alt="logo" /></a>
  121. </div>
  122. <div class="navbarr">
  123. <ul id="menuu">
  124. <li><a href="<?=base_url()?>home/index">Home</a></li>
  125. <?php
  126. foreach($navigation as $nav){
  127. ?>
  128. <li><a href="<?=base_url()?>vijesti/kategorija/<?=$nav['cat_title']?>"><?=$nav['cat_title']?></a></li>
  129. <?php
  130.  
  131. }
  132.  
  133. ?>
  134. </ul>
  135.  
  136. </div>
  137.  
  138. <div class="post_area">
  139. <?php
  140. foreach($vijesti as $row){
  141. ?>
  142. <h2><a class="ltitle" href="<?=base_url()?>vijesti/vijest/<?=$row['slug']?>"><?=$row['post_title']?></a></h2>
  143. <span><i>Author:</i>&nbsp;<b><?=$row['post_author']?></b>&nbsp; &nbsp;<b><?=$row['post_date']?></b></span>
  144. <img src="<?=base_url()?>news_images/<?=$row['post_image']?>" width="100" height="100" alt="title_image" />
  145. <div><?=substr($row['post_content'],0,300)?><a class="rmlink" href="<?=base_url()?>vijesti/vijest/<?=$row['slug']?>">Read more</a></div><br>
  146. <?php
  147. }
  148. echo $pages;
  149. ?>
  150.  
  151. </div>
  152.  
  153. <div class="sidebarr">
  154. <h4>Recent news</h4>
  155. <?php
  156. foreach($sidebar_news as $sn){
  157. ?>
  158. <div class="recent_posts" data-link="<?=base_url()?>vijesti/vijest/<?=$sn['slug']?>">
  159. <img src="<?=base_url()?>news_images/<?=$sn['post_image']?>" width="60" height="60" /><p><?=$sn['post_title']?></p>
  160.  
  161. <div style='clear:both'></div>
  162. </div>
  163. <?php
  164. }
  165. ?>
  166. <h4>Subscribe</h4>
  167. <div class="pretplatite_se">
  168. <input type="text" placeholder="Email"><br><br>
  169. <input type="submit" value="Subscribe" id="pretplata">
  170. </div>
  171. <h4>Follow us</h4>
  172. <div class="pratite_nas">
  173. <img src="<?=base_url()?>assets/img/facebook.png" width="100" height="100"/>
  174. <img src="<?=base_url()?>assets/img/twitter.png" width="100" height="100"/>
  175. </div>
  176. </div>
  177. <div class="footer_area">
  178. Copyright &copy; <?php echo date("Y",time());?>
  179. </div>
  180. </div>
  181. </body>
  182. </html>
  183.  
  184. $config['base_url']=base_url().'vijesti/kategorija/'.$cat_name;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement