Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
fenzhan_zsb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esf
fenzhan_zsb
Commits
049b9a56
Commit
049b9a56
authored
Aug 11, 2020
by
zhangkuanguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
芜湖上传图片
parent
32fdb8dd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
1 deletion
+34
-1
pic_model.php
new_admincp/applications/zsb/models/pic_model.php
+25
-0
pic_inc.php
new_admincp/applications/zsb/views/nj/pic_inc.php
+9
-1
No files found.
new_admincp/applications/zsb/models/pic_model.php
View file @
049b9a56
...
...
@@ -1048,4 +1048,28 @@ class Pic_model extends MY_Model {
$this
->
db
->
where
(
'id'
,
$id
);
return
$this
->
db
->
get
(
$this
->
_insert_temp_tablename
)
->
row_array
();
}
public
function
pic_format
(
$image_path
,
$format
=
''
){
if
(
!
empty
(
$image_path
)
&&
preg_match
(
'/\.com\/[A-Z]{1}[0-9]{2}\//'
,
$image_path
))
{
preg_match
(
'/_([0-9]+)x([0-9]+)/'
,
$image_path
,
$match
);
//先把问号后的内容全部去掉
$strrpos1
=
strpos
(
$image_path
,
'?'
);
if
(
$strrpos1
!=
FALSE
){
$image_path
=
substr
(
$image_path
,
0
,
$strrpos1
);
}
if
(
$match
)
{
$strrpos
=
strpos
(
$image_path
,
$match
[
0
]);
$picNameArr
=
explode
(
'.'
,
substr
(
$image_path
,
$strrpos
));
$image_path
=
substr
(
$image_path
,
0
,
$strrpos
);
if
(
$format
){
$image_path
.=
$format
.
'.'
.
$picNameArr
[
1
];
}
else
{
$image_path
.=
'.'
.
$picNameArr
[
1
];
}
}
return
$image_path
;
}
return
$image_path
;
}
}
\ No newline at end of file
new_admincp/applications/zsb/views/nj/pic_inc.php
View file @
049b9a56
...
...
@@ -173,12 +173,20 @@ foreach($arr_sort as $key=>$sort) { ?>
<?php
if
(
$bolHasHouse
)
{
$this
->
load
->
model
(
'pic_model'
);
$pic1
=
empty
(
$house_detail
[
'pic1'
])
?
''
:
$house_detail
[
'pic1'
];
if
(
$pic1
){
$pic1
=
$this
->
pic_model
->
pic_format
(
$pic1
);
}
foreach
(
$house_detail
[
'house_pic'
.
$key
]
as
$k
=>
$v
){
$title
=
$v
[
'title'
]
==
''
?
'图片描述30字'
:
$v
[
'title'
];
if
(
!
isset
(
$house_detail
[
'pic1'
]))
{
$house_detail
[
'pic1'
]
=
''
;
}
$pic_format
=
$this
->
pic_model
->
pic_format
(
$v
[
'filename'
]);
?>
<div
style=
""
class=
"mItem"
>
<div
class=
"mItemInner"
id=
"yyyyyy"
>
...
...
@@ -188,7 +196,7 @@ foreach($arr_sort as $key=>$sort) { ?>
<input
type=
"hidden"
name=
"p_sort[]"
value=
"
<?=
$v
[
'sort'
]
?>
"
class=
"psort"
>
<div
class=
"funM"
></div>
<div
class=
"funMtext"
>
<label><input
type=
"radio"
onclick=
"setIndexPic(this);"
value=
"
<?=
$v
[
'filename'
]
?>
"
class=
"input_r"
name=
"jsPicPreviewList"
<?php
if
(
$
house_detail
[
'pic1'
]
==
$v
[
'filename'
]
&&
$isfaceimg
){
$isfaceimg
=
false
;
?>
checked
<?php
}
?>
>
封面
</label>
<label><input
type=
"radio"
onclick=
"setIndexPic(this);"
value=
"
<?=
$v
[
'filename'
]
?>
"
class=
"input_r"
name=
"jsPicPreviewList"
<?php
if
(
$
pic1
==
$pic_format
){
?>
checked
<?php
}
?>
>
封面
</label>
<a
class=
"bigPicLin"
style=
"bottom:84px;"
target=
"_balnk"
href=
"
<?
echo
str_replace
(
'/thumb'
,
''
,
$v
[
'filename'
]);
?>
"
title=
"查看大图"
>
查看大图
</a>
<div
class=
"delBtn"
id=
"
<?=
$v
[
'sort'
]
?>
"
imageSrc=
'
<?=
$v
[
'filename'
]
?>
'
title=
"删除"
onclick=
"setPicDel(
<?=
$v
[
'id'
]
?>
);"
></div>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment