pony 大佬有话说 :
Chevereto问题请教
Chevereto问题请教
https://01.urlnode.com/2020/03/02/_20200302132535.png
首页的这个数据统计
是怎么做到的呢?
我见很多图床都有这个
但是我自己安装后
后台并没有这个功能选项
如果是自己邪路的代码
那么代码是什么呢?
求大佬帮助
pony 大佬有话说 :
求教啊
有木有大佬知道怎么搞…
英梨梨 大佬有话说 :
后台能看到吧,将后台那个代码复制过来就行了
auto8624 大佬有话说 :
上传与分享您的照片
安享图床-高速稳定的图片上传、相册和外链服务
全球CDN加速, 最大单张支持 10 MB, 支持批量上传
本站启用自动检测技术, 禁止上传**/**/**/黑产等违法图片
一经发现, 立即删除该用户/IP下所有图片, 并永久封IP
pony 大佬有话说 :
英梨梨 大佬有话说 : 2020-3-2 13:34
后台能看到吧,将后台那个代码复制过来就行了
不知道怎么弄啊
Tcp80 大佬有话说 :
那我就不知道了奥
朔朔 大佬有话说 :
1、保存为count.php
<?php
error_reporting(0);
$con = mysql_connect("localhost", "数据库用户名", "数据库密码");
if (!$con)
{
die(‘Could not connect: ‘ . mysql_error());
}
$db_selected = mysql_select_db("tu",$con);
$sql = "SELECT * FROM chv_images";
$result = mysql_query($sql,$con);
echo mysql_num_rows($result);
mysql_close($con);
?>
2、放在app/themes/Peafowl/views/index.php文件中的合适位置
<?php
$data = file_get_contents(‘https://网站域名/count.php’);
?>
<p>本站已托管图片 <?php echo $data ?> 张</p>
朔朔 大佬有话说 :
唯一的缺点就是没有逗号
tomcb 大佬有话说 :
/app/themes/Peafowl/views/index.php
这里直接加代码
<div id="home-cover" data-content="follow-scroll-opacity">
<?php GRenderinclude_theme_file(‘snippets/homepage_cover_slideshow’); ?>
<div id="home-cover-content" class="c20 fluid-column center-box padding-left-10 padding-right-10">
<?php CHVRendershow_banner(‘home_before_title’, (function_exists(‘get_list’) ? get_list()->sfw : true)); ?>
<h1><?php echo CHVgetSetting(‘homepage_title_html’) ?: _s(‘Upload and share your images.’); ?></h1>
<h1>本站共托管 <?php
$stats = CHVStat::getTotals();
echo $stats[‘images’] > 999999 ? $stats[‘images’] : number_format($stats[‘images’]); // Will output the total n° images
?> 张图片</h1>