Commit 86a4b105 authored by Liang Ding's avatar Liang Ding

Fix #11992

parent 86d48e90
...@@ -57,7 +57,7 @@ import org.json.JSONObject; ...@@ -57,7 +57,7 @@ import org.json.JSONObject;
* B3log Solo servlet listener. * B3log Solo servlet listener.
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.1.0.4, Oct 16, 2014 * @version 1.2.0.4, Jan 12, 2015
* @since 0.3.1 * @since 0.3.1
*/ */
public final class SoloServletListener extends AbstractServletListener { public final class SoloServletListener extends AbstractServletListener {
...@@ -86,11 +86,16 @@ public final class SoloServletListener extends AbstractServletListener { ...@@ -86,11 +86,16 @@ public final class SoloServletListener extends AbstractServletListener {
* B3log Rhythm address. * B3log Rhythm address.
*/ */
public static final String B3LOG_RHYTHM_SERVE_PATH; public static final String B3LOG_RHYTHM_SERVE_PATH;
/** /**
* B3log Symphony address. * B3log Symphony address.
*/ */
public static final String B3LOG_SYMPHONY_SERVE_PATH; public static final String B3LOG_SYMPHONY_SERVE_PATH;
/**
* Favicon API.
*/
public static final String FAVICON_API;
/** /**
* Bean manager. * Bean manager.
...@@ -102,6 +107,7 @@ public final class SoloServletListener extends AbstractServletListener { ...@@ -102,6 +107,7 @@ public final class SoloServletListener extends AbstractServletListener {
B3LOG_RHYTHM_SERVE_PATH = b3log.getString("rhythm.servePath"); B3LOG_RHYTHM_SERVE_PATH = b3log.getString("rhythm.servePath");
B3LOG_SYMPHONY_SERVE_PATH = b3log.getString("symphony.servePath"); B3LOG_SYMPHONY_SERVE_PATH = b3log.getString("symphony.servePath");
FAVICON_API = b3log.getString("faviconAPI");
} }
@Override @Override
......
...@@ -21,7 +21,7 @@ package org.b3log.solo.model; ...@@ -21,7 +21,7 @@ package org.b3log.solo.model;
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="mailto:dongxu.wang@acm.org">Dongxu Wang</a> * @author <a href="mailto:dongxu.wang@acm.org">Dongxu Wang</a>
* @version 1.0.5.1, Jul 2, 2013 * @version 1.1.5.1, Jan 12, 2015
* @since 0.3.1 * @since 0.3.1
*/ */
public final class Common { public final class Common {
...@@ -175,6 +175,11 @@ public final class Common { ...@@ -175,6 +175,11 @@ public final class Common {
* Key of is logged in. * Key of is logged in.
*/ */
public static final String IS_LOGGED_IN = "isLoggedIn"; public static final String IS_LOGGED_IN = "isLoggedIn";
/**
* Key of favicon API.
*/
public static final String FAVICON_API = "faviconAPI";
/** /**
* Key of is mobile request. * Key of is mobile request.
......
...@@ -617,6 +617,7 @@ public class Filler { ...@@ -617,6 +617,7 @@ public class Filler {
dataModel.put(Preference.META_DESCRIPTION, preference.getString(Preference.META_DESCRIPTION)); dataModel.put(Preference.META_DESCRIPTION, preference.getString(Preference.META_DESCRIPTION));
dataModel.put(Common.YEAR, String.valueOf(Calendar.getInstance().get(Calendar.YEAR))); dataModel.put(Common.YEAR, String.valueOf(Calendar.getInstance().get(Calendar.YEAR)));
dataModel.put(Common.IS_LOGGED_IN, null != userQueryService.getCurrentUser(request)); dataModel.put(Common.IS_LOGGED_IN, null != userQueryService.getCurrentUser(request));
dataModel.put(Common.FAVICON_API, SoloServletListener.FAVICON_API);
final String noticeBoard = preference.getString(Preference.NOTICE_BOARD); final String noticeBoard = preference.getString(Preference.NOTICE_BOARD);
......
...@@ -22,3 +22,5 @@ ...@@ -22,3 +22,5 @@
rhythm.servePath=http://rhythm.b3log.org:80 rhythm.servePath=http://rhythm.b3log.org:80
symphony.servePath=http://symphony.b3log.org:80 symphony.servePath=http://symphony.b3log.org:80
faviconAPI=http://api.byi.pw/favicon?url=
\ No newline at end of file
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<li> <li>
<a rel="friend" href="${link.linkAddress}" alt="${link.linkTitle}" target="_blank"> <a rel="friend" href="${link.linkAddress}" alt="${link.linkTitle}" target="_blank">
<img alt="${link.linkTitle}" <img alt="${link.linkTitle}"
src="http://www.google.com/s2/u/0/favicons?domain=<#list link.linkAddress?split('/') as x><#if x_index=2>${x}<#break></#if></#list>" /></a> src="${faviconAPI}<#list link.linkAddress?split('/') as x><#if x_index=2>${x}<#break></#if></#list>" /></a>
<a rel="friend" href="${link.linkAddress}" title="${link.linkDescription}" target="_blank">${link.linkTitle} <a rel="friend" href="${link.linkAddress}" title="${link.linkDescription}" target="_blank">${link.linkTitle}
</a> </a>
</li> </li>
......
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
<li> <li>
<a rel="friend" href="${link.linkAddress}" title="${link.linkTitle}" target="_blank"> <a rel="friend" href="${link.linkAddress}" title="${link.linkTitle}" target="_blank">
<img alt="${link.linkTitle}" <img alt="${link.linkTitle}"
src="http://www.google.com/s2/u/0/favicons?domain=<#list link.linkAddress?split('/') as x><#if x_index=2>${x}<#break></#if></#list>" /></a> src="${faviconAPI}<#list link.linkAddress?split('/') as x><#if x_index=2>${x}<#break></#if></#list>" /></a>
<a rel="friend" href="${link.linkAddress}" title="${link.linkTitle}" target="_blank">${link.linkTitle} <a rel="friend" href="${link.linkAddress}" title="${link.linkTitle}" target="_blank">${link.linkTitle}
</a> </a>
<#-- ${link.linkDescription} --> <#-- ${link.linkDescription} -->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment