Skip to content

Commit 6b9bdcb

Browse files
committed
CodeIgniter-Blog v2.2.2 Fix pagination display exception of diaries
1 parent 58af5b9 commit 6b9bdcb

6 files changed

Lines changed: 30 additions & 34 deletions

File tree

application/controllers/Home.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function diaries()
4545
{
4646
$config['base_url'] = 'http://cc.com:89/home/diaries';
4747
$config['total_rows'] = $this->db->get("diaries")->num_rows();
48-
$config['per_page'] = 8;
48+
$config['per_page'] = 5;
4949
$config['num_links'] = 100;
5050
$this->pagination->initialize($config);
5151

application/controllers/admin/Admin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public function diaries()
117117
{
118118
$config['base_url'] = 'http://cc.com:89/admin/admin/diaries';
119119
$config['total_rows'] = $this->db->get("diaries")->num_rows();
120-
$config['per_page'] = 8;
120+
$config['per_page'] = 5;
121121
$config['num_links'] = 100;
122122
$this->pagination->initialize($config);
123123

application/views/admin/diaries.php

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,21 @@
4646
<div class="wz_text">当前位置:首页><h1>个人日记</h1></div>
4747
</div>
4848
<div class="rj_content">
49-
<!--时光-->
49+
<!--时光--><?php if (isset($rows)) { foreach ($rows as $row):?>
5050
<div class="shiguang animated bounceIn">
51-
<?php if (isset($rows)) { foreach ($rows as $row):?>
52-
<div class="left sg_ico">
53-
<img src="<?php echo base_url(); ?>static/images/my_1.jpg" width="120" height="120" alt="日记图标"/>
54-
</div>
55-
<div class="right sg_text">
56-
<img src="<?php echo base_url(); ?>static/images/left.png" width="13" height="16" alt="左图标"/>
57-
<?php echo $row['content']?><br/><br/>
58-
<?php echo $row['date']?>
59-
<a><?php echo anchor('admin/admin/edit_diaries/'.$row['id'],'更新日记')?></a>
60-
<a><?php echo anchor('admin/admin/delete_diaries/'.$row['id'],'删除日记')?></a>
61-
</div>
62-
<div class="clear"></div>
63-
<?php endforeach;}?><br />&nbsp&nbsp
64-
<font color="blue" size="4"><?php echo $this->pagination->create_links();?></font>
51+
<div class="left sg_ico">
52+
<img src="<?php echo base_url(); ?>static/images/my_1.jpg" width="120" height="120" alt="日记图标"/>
53+
</div>
54+
<div class="right sg_text">
55+
<?php echo $row['content']?>
56+
</div>
57+
<a style="padding-left: 3%"><?php echo $row['date']?></a>
58+
<a style="padding-left: 45%;"><?php echo anchor('admin/admin/edit_diaries/'.$row['id'],'更新日记')?></a>
59+
<a style="padding-left: 5%;"><?php echo anchor('admin/admin/delete_diaries/'.$row['id'],'删除日记')?></a>
60+
<div class="clear"></div>
6561
</div>
66-
<!--时光 end-->
62+
<!--时光 end--><?php endforeach;}?>&nbsp&nbsp
63+
<font color="blue" size="5"><?echo $this->pagination->create_links();?></font>
6764
</div>
6865
</div>
6966
<!--end left -->

application/views/diaries.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,22 @@
4747
<div class="wz_text">当前位置:首页><h1>个人日记</h1></div>
4848
</div>
4949
<div class="rj_content">
50-
<!--时光-->
50+
<!--时光--><?php if (isset($rows)) { foreach ($rows as $row):?>
5151
<div class="shiguang animated bounceIn">
52-
<?php if (isset($rows)) { foreach ($rows as $row):?>
5352
<div class="left sg_ico">
54-
<img src="<?php echo base_url(); ?>static/images/my_1.jpg" width="120" height="120" alt="日记图标"/>
53+
<img src="<?php echo base_url(); ?>static/images/my_1.jpg" width="125" height="125" alt="日记图标"/>
5554
</div>
5655
<div class="right sg_text">
57-
<img src="<?php echo base_url(); ?>static/images/left.png" width="13" height="16" alt="左图标"/>
58-
<?php echo $row['content']?><br/><br/>
59-
<?php echo $row['date']?>
56+
<?php echo $row['content']?>
6057
</div>
58+
<a style="padding-left: 3%"><?php echo $row['date']?></a>
59+
<a href="#" style="padding-left: 56%;">
60+
<?php //echo anchor('home/article/'.$row->id,'阅读原文','class="ReadMore"')?>阅读原文
61+
</a>
6162
<div class="clear"></div>
62-
<?php endforeach;}?><br />&nbsp&nbsp
63-
<font color="blue" size="4"><?php echo $this->pagination->create_links();?></font>
6463
</div>
65-
<!--时光 end-->
64+
<!--时光 end--><?php endforeach;}?>&nbsp&nbsp
65+
<font color="blue" size="5"><?php echo $this->pagination->create_links();?></font>
6666
</div>
6767
</div>
6868
<!--end left -->

static/css/index.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ img{display:block;border:0px;}
4949
.wz dl dd .dd_text_2 .fl a{color:#1D1718;}
5050
.wz dl dd .dd_text_2 .yd{display:block;width:110px;height:30px;text-align:center;margin-top:3px;}
5151
.wz dl dd .dd_text_2 .yd .ReadMore{color:#F55522;display:block;width:80px;height:22px;line-height:22px;
52-
text-align:center;padddding:2px 5px;border:1px solid #AC9696;border-radius:2px;}
52+
ttext-align:center;padddding:2px 5px;border:1px solid #AC9696;border-radius:2px;}
5353
.wz dl dd .dd_text_2 .yd a:hover{color:#f36;}
5454
/*left end*/
5555
/*right*/

static/css/style.css

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,15 @@ img{display:block;border:0px;}
3838
.dateview {position:absolute;left:785px;top:15px;width:125px;line-height:35px;background:#5EA51B;border-radius:0 30px;text-align:center;
3939
color:#fff;font-weight:bold;font-size:14px; }
4040
/*日记*/
41-
#content #riji{width:730px;background:#fff;border:1px solid #E0DFDF;}
41+
#content #riji{width:730px;height: 100%;background:#fff;border:1px solid #E0DFDF;}
4242
#riji .rj_content{width:710px;margin-top:10px;padding:0 10px;background:#fff;padding-bottom:10px;}
43-
.rj_content .shiguang{width:710px;height:145px;}
44-
.rj_content .shiguang .sg_ico{width:120px;height:145px; background:url("../images/line_bg.jpg") 60px 0px repeat-y;
43+
.rj_content .shiguang{width:710px;height:220px;}
44+
.rj_content .shiguang .sg_ico{width:125px;height:220px; background:url("../images/line_bg.jpg") 60px 0px repeat-y;
4545
filter:Alpha(opacity=80);-moz-opacity: 0.8; opacity: 0.8;}
46-
.rj_content .shiguang .sg_ico img{border-radius:60px;margin-top:10px;}
47-
.rj_content .shiguang .sg_text{width:530px;height:100px;background:#fff;border:1px solid #E0DFDF;
46+
.rj_content .shiguang .sg_ico img{border-radius:60px;margin-top:40px;}
47+
.rj_content .shiguang .sg_text{width: 530px;height: 140px;overflow: hidden;line-height: 30px;background:#fff;border:1px solid #E0DFDF;
4848
filter:Alpha(opacity=80);-moz-opacity: 0.8; opacity: 0.8;
4949
margin:10px 10px 0px 10px;position:relative;border-radius:5px;padding:10px;color:#4F4F4F;}
50-
.rj_content .shiguang .sg_text img{position:absolute;top:40px;left:-14px;z-index:1;}
5150
/*相册*/
5251
#content_xc{width:990px;margin:5px auto; background:#fff;}
5352
#content_xc .weizi{width:990px;height:30px;line-height:30px; background:url("../images/weizi.png") 7px 5px no-repeat; background-color:#fff;

0 commit comments

Comments
 (0)