dz.gg 短网址系统优化修改代码合集

dz.gg 短网址系统优化修改代码合集


正在查看 5 个帖子:1-5 (共 5 个帖子)
  • 作者
    帖子
  • 诗语
    管理员
    • 文章数量: 5,858
    @feibisi
    楼主

    dz.gg 短网址系统优化修改代码合集,方便后续用户自行升级和个性化修改;

    这是我去年做的一个项目,一直都没怎么用,所以就想干脆开源吧,分享出来,但是工作很多做好了页面就没时间更新代码了,

    现在发现找短网址系统的都是到了我们这里,但是没得下载,这几天思绪比较乱,

    咨询客服的用户也比较多就又花了些时间进行了升级,预计最迟就这几天发布。

    1、让后台的 favicon 显示正常

    大致在 /includes/functions-infos.php 文件的 224行

    /**
     * Return favicon URL
     *
     */
    function yourls_get_favicon_url( $url ) {
    	return yourls_match_current_protocol( 'https://www.google.com/s2/favicons?domain=' . yourls_get_domain( $url, false ) );
    }
    /**
     * Return favicon URL
     *
     */
    function yourls_get_favicon_url( $url ) {
    	return yourls_match_current_protocol( 'https://api.byi.pw/favicon/?url=' . yourls_get_domain( $url, false ) );
    }
    诗语
    管理员
    • 文章数量: 5,858
    @feibisi
    楼主

    原文丢失,这又是一段一段的从新写上来;

    2、替换后台 Google 图表显示

    大致在 includes/functions-html.php 文件的 116 行

    <script type="text/javascript" src="https://www.google.com/jsapi"></script>

    替换为

    <script type="text/javascript" src="https://ajax.lug.ustc.edu.cn/jsapi"></script>

    方法不完美,将就着用吧

    诗语
    管理员
    • 文章数量: 5,858
    @feibisi
    楼主
    此回复已被标记为私有,🔒 仅楼主及管理员可见。
    诗语
    管理员
    • 文章数量: 5,858
    @feibisi
    楼主

    3、替换分享框为国内服务

    大致在 includes/functions-html.php 文件的 398 行

    		<div id="sharebox" class="share">
    			<?php echo $share_title; ?>
    			<div id="tweet">
    				<span id="charcount" class="hide-if-no-js"><?php echo $count; ?></span>
    				<textarea id="tweet_body"><?php echo $share; ?></textarea>
    			</div>
    			<p id="share_links"><?php yourls_e( 'Share with' ); ?> 
    				<a id="share_tw" href="https://twitter.com/home?status=<?php echo $_share; ?>" title="<?php yourls_e( 'Tweet this!' ); ?>" onclick="share('tw');return false">Twitter</a>
    				<a id="share_fb" href="https://www.facebook.com/share.php?u=<?php echo $_url; ?>" title="<?php yourls_e( 'Share on Facebook' ); ?>" onclick="share('fb');return false;">Facebook</a>
    				<?php
    				yourls_do_action( 'share_links', $longurl, $shorturl, $title, $text );
    				// Note: on the main admin page, there are no parameters passed to the sharebox when it's drawn.
    				?>
    			</p>
    		</div>

    替换为

    		<div id="sharebox" class="share">
    			<?php echo $share_title; ?>
    			<div id="tweet">
    				<span id="charcount" class="hide-if-no-js"><?php echo $count; ?></span>
    				<textarea id="tweet_body"><?php echo $share; ?></textarea>
    			</div>
    <div class="bdsharebuttonbox"><a href="#" class="bds_more" data-cmd="more">  分享到:</a><a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间">空间  </a><a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博">微博  </a><a href="#" class="bds_tieba" data-cmd="tieba" title="分享到百度贴吧">贴吧  </a> <a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信">微信</a></div>
    		</div>

    使用百度分享替换。

    诗语
    管理员
    • 文章数量: 5,858
    @feibisi
    楼主

    补充下记得加上 百度分享 js 代码不然不会显示。

    	<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"2","bdSize":"16"},"share":{"bdSize":16}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='https://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
    
正在查看 5 个帖子:1-5 (共 5 个帖子)
  • 话题「dz.gg 短网址系统优化修改代码合集」已关闭,不接受新回复。

未找到对应子版块?请直接在 [疑难杂症] 版块中发帖提问。

收藏纪念品


有奖活动

参与论坛社区问答,有机会获赠文派瓦普(Wapuu.com)手办模型。

话题信息

商业系统