EmlogPro获取微语(笔记)
EmlogPro获取微语(笔记)
实现效果 完整代码 先在模板文件添加 <?php //获取微语 function twitter_all(){ $DB=MySql::getInstance(); $query=$DB->query("select * from ".DB_PREFIX."twitter order by id desc"); echo "<div class='twitter-box'>"; while($row = $DB->fetch_array($query)){ echo "<div class='twitter-item'> <div class='twitter-time'>".$row["content"]."</div> <div class='twitter-title'>-".date('y-n-j',$row["date"])."</div> </div>"; } echo "</div>"; } ?> 在你需要展示的地方调用 <?php twitter_all() ?> 样式 可忽略 .twitter-item { /* background: #E4EBF5; box-shadow: 1px 1px 2px #999da4, -1px -1px 2px #ffffff; */ padding: 5px; display: flex; justify-content: space-between; } .twitter-box { width: 70%; } .twitter-title { font-weight: 300; font-size: 13px; } .twitter-item .twitter-time::before { padding: 3px 6px; color: #fff; border-radius: 5px; margin: 0px 5px; font-size: 10px; } .twitter-item:nth-child(1) .twitter-time::before { background-color: #4cb4e7; content: "1"; } .twitter-item:nth-child(2) .twitter-time::before { background-color: #9bc272; content: "2"; } .twitter-item:nth-child(3) .twitter-time::before { background-color: #f6d6ff; content: "3"; } .twitter-item:nth-child(4) .twitter-time::before { background-color: #ffebcc; content: "4"; } .twitter-item:nth-child(5) .twitter-time::before { background-color: #aed3f4; content: "5"; } .twitter-item:nth-child(6) .twitter-time::before { background-color: #c0c0c0; content: "6"; } .twitter-time { font-weight: 300; word-break: break-all; font-size: 14px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; transition: 2s; width: 80%; margin: 0px 5px; border-bottom: 1px #d0cbcb dashed; } .twitter-timee { font-weight: 300; word-break: break-all; font-size: 14px; text-indent: 2em; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 20; -webkit-box-orient: vertical; transition: 2s; min-height: 42px; } .jindu { height: 100px; width: 15px; background: #E4EBF5; border-radius: 5px; padding: 5px; margin: 10px; box-shadow: inset 1px 1px 2px #999da4, inset -1px -1px 2px #ffffff; display: flex; align-items: flex-end; } .jindu-box, .jindu-title-box { display: flex; justify-content: space-around; } .jindu-item { width: 10px } .jindu-color { background-color: red; opacity: 0.5; } .jindu:nth-child(2) .jindu-color { background-color: green; opacity: 0.5; } .jindu:nth-child(3) .jindu-color { background-color: blue; opacity: 0.5; } .jindu:nth-child(4) .jindu-color { background-color: orange; opacity: 0.5; } .jindu-title { font-size: 14px; font-weight: 300; } .sj-tj { display: flex; width: 30%; flex-direction: column; border-left: 0.1px #c7c7c7 solid; justify-content: center; } .all-box { display: flex; } .bj-box { margin: 10px 0px; } @media (max-width:576px) { .bj-box { margin: 10px 10px; } .twitter-box { width: 100%; } .sj-tj { display: none; } } @media (max-width:768px) { .bj-box { margin: 10px 10px; } .twitter-box { width: 100%; } .sj-tj { display: none; } }
 2022-5-27
PHP图片上传案例
PHP图片上传案例
今天在写个人主页的时候发现后台无法上传图片,然后自己写了一个图片上传,简单记录一下代码。
 2022-4-22
PHP判断类型
PHP判断类型
判断类型 is_bool();//判断是否为布尔型 is_float(); //判断是否为浮点型 is_int(); //判断是否为整型 is_numeric(); //判断是否为数值型 is_string(); //判断是否为字符串 is_array(); //判断是否为数组 is_object(); //判断是否为对象 implode 使用一个字符串将数组变成字符串 $array = array('lastname', 'email', 'phone'); $comma_separated = implode( "," , $array ); echo $comma_separated ; // lastname,email,phone explode — 使用一个字符串分割另一个字符串,返回一个数组 实例 //示例 <?php // 示例 1 $pizza = "piece1 piece2 piece3 piece4 piece5 piece6" ; $pieces = explode ( " " , $pizza ); echo $pieces [0]; // piece1 echo $pieces [1]; // piece2 // 示例 2 $data = "foo:*:1023:1000::/home/foo:/bin/sh" ; list( $user , $pass , $uid , $gid , $gecos , $home , $shell ) = explode ( ":" , $data ); echo $user ; // foo echo $pass ; // * ?> 转载于:https://www.cnblogs.com/studycollect/p/11308526.html
 2021-9-12
     跳转到第 页,共 1 页

Theme By Brief 鄂ICP备19010459号

站长统计 sitemap

首页

分类

友链

登录