服务生 月光骑士 发布于6月21日 服务生 分享 发布于6月21日 查看文件 SVG 模板 组件 根据配置,此附加组件需要网络服务器 URL 重写支持! 允许将 SVG(可缩放矢量图形)图像存储为模板。 这将在 XF 根目录中创建一个新的 svg.php 文件。 生成指向 SVG 模板的链接; 代码: {{ getSvgUrl('tempate.svg') }} 在 Board 信息下,如果设置了“使用完整的友好 URL”(useFriendlyUrls),则生成的 URL 为: 代码: /data/svg/<style_id>/<langauge_id>/<style_last_modified>/<templateName>.svg 否则 代码: svg.php?svg=<templateName>&s=<style_id>&l=<langauge_id>&d=<style_last_modified> Nginx URL 重写配置 代码: location ^~ /data/svg/ { access_log off; rewrite ^/data/svg/([^/]+)/([^/]+)/([^/]+)/([^\.]+).svg$ /svg.php?svg=$4&s=$1&l=$2&d=$3$args last; return 403; } Apache URL 重写配置 在最终数据/参考之前添加规则; 代码: RewriteRule ^data/svg/([^/]+)/([^/]+)/([^/]+)/([^\.]+).svg$ svg.php?svg=$4&s=$1&l=$2&d=$3 [B,NC,L,QSA] 即,应该看起来类似于; 代码: # If you are having problems with the rewrite rules, remove the "#" from the # line that begins "RewriteBase" below. You will also have to change the path # of the rewrite to reflect the path to your XenForo installation. #RewriteBase /xenforo RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^data/svg/([^/]+)/([^/]+)/([^/]+)/([^\.]+).svg$ svg.php?svg=$4&s=$1&l=$2&d=$3 [B,NC,L,QSA] RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L] RewriteRule ^.*$ index.php [NC,L] 贡献功能或错误修复 请通过“更多信息”链接创建一个 Github Pull 请求。 提交者 月光骑士 提交于 2022年06月21日 类别 XenForo 引用 奖杯和奖牌 意见的链接 分享到其他站点 更多分享选项…
推荐的帖子