所以我有以下代码:
// the loop
$countId = 0;
$dateOnce = '';
foreach ($postDates as $post):
if (substr($post->post_date, 0, 7) != $dateOnce) {
echo'
<div class="checkbox">
<label for="filterByPostDate-' . $countId . '">
<input type="checkbox" id="filterByPostDate-' . substr($post->post_date, 0, 7) . '" class="postDateFilters postDateFilterCb-' . $countId . '" name="filterByPostDate-' . $countId . '" value="' . substr($post->post_date, 0, 7) . '" '; if (isset($_SESSION["filterByPostDate"])) { $key = array_search(substr($post->post_date, 0, 7), $_SESSION["filterByPostDate"]); } else { $key = false; } if($key !== false) { echo 'checked'; …Run Code Online (Sandbox Code Playgroud) 因此,我正在尝试为在iis上运行的wordpress网站添加.webp图像支持。
现在图片已存在于服务器上,文件名正确,但是当我尝试通过浏览器中的url地址加载图片时,出现404错误。
404-找不到文件或目录。您正在寻找的资源可能已被删除,名称已更改或暂时不可用。
有人知道我可以解决这个问题吗?
我尝试添加,<add extension=".webp" policy="CacheUntilChange" kernelCachePolicy="DontCache" />但这不起作用,因为它与缓存有关。
我可以在某些地方允许访问某些文件类型吗?
我是否可能需要允许文件类型通过防火墙?
我对使用IIS还是很陌生,所以有点迷路了。
干杯
不知道我哪里出错了,但看起来很简单。我正在尝试检测 webp 支持。
因此,我访问了现代化网站并检查了 webp 选项,然后下载了脚本。
我已经使用 WordPress 函数文件添加了脚本,并确认它正在前端加载。
然后在脚本加载后,我使用以下代码来检测是否支持 webp:
/*
* Check webp support
*/
if (Modernizr.webp) {
alert('webp supported');
} else {
alert('webp not supported');
}
Run Code Online (Sandbox Code Playgroud)
唉,我没有收到任何警报消息。
开发工具控制台中也没有错误消息。
有谁知道怎么回事。
干杯
我想知道如何完成PHP
query = rtrim($query, '& ');
Run Code Online (Sandbox Code Playgroud)
在C#ASP .NET MVC中
我已经尝试过,Strings.RTrim("string")但是没有用。
也尝试过,query = query.Trim(query, "&");但是给我错误。
另外,msdn在Visual Basic中为rtrim提供了代码,这无济于事。
从代码看,如果在&字符后找到空白,似乎是在修剪空白。
有人知道如何复制php命令吗?干杯
所以我在 chrome 的网站上进行了审计,谷歌说我应该使用被动事件侦听器。
我查看了代码并确定它来自 wordpress 表情符号集成:
<script type="text/javascript">/*<![CDATA[*/window._wpemojiSettings={"baseUrl":"https:\/\/s.w.org\/images\/core\/emoji\/2.3\/72x72\/","ext":".png","svgUrl":"https:\/\/s.w.org\/images\/core\/emoji\/2.3\/svg\/","svgExt":".svg","source":{"concatemoji":"https:\/\/mysite.com.au\/blog\/wp-includes\/js\/wp-emoji-release.min.js?ver=371b19f5ae5bed67ef4d578bd7a19944"}};!function(a,b,c){function d(a){var b,c,d,e,f=String.fromCharCode;if(!k||!k.fillText)return!1;switch(k.clearRect(0,0,j.width,j.height),k.textBaseline="top",k.font="600 32px Arial",a){case"flag":return k.fillText(f(55356,56826,55356,56819),0,0),b=j.toDataURL(),k.clearRect(0,0,j.width,j.height),k.fillText(f(55356,56826,8203,55356,56819),0,0),c=j.toDataURL(),b===c&&(k.clearRect(0,0,j.width,j.height),k.fillText(f(55356,57332,56128,56423,56128,56418,56128,56421,56128,56430,56128,56423,56128,56447),0,0),b=j.toDataURL(),k.clearRect(0,0,j.width,j.height),k.fillText(f(55356,57332,8203,56128,56423,8203,56128,56418,8203,56128,56421,8203,56128,56430,8203,56128,56423,8203,56128,56447),0,0),c=j.toDataURL(),b!==c);case"emoji4":return k.fillText(f(55358,56794,8205,9794,65039),0,0),d=j.toDataURL(),k.clearRect(0,0,j.width,j.height),k.fillText(f(55358,56794,8203,9794,65039),0,0),e=j.toDataURL(),d!==e}return!1}function e(a){var c=b.createElement("script");c.src=a,c.defer=c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var f,g,h,i,j=b.createElement("canvas"),k=j.getContext&&j.getContext("2d");for(i=Array("flag","emoji4"),c.supports={everything:!0,everythingExceptFlag:!0},h=0;h<i.length;h++)c.supports[i[h]]=d(i[h]),c.supports.everything=c.supports.everything&&c.supports[i[h]],"flag"!==i[h]&&(c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&c.supports[i[h]]);c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&!c.supports.flag,c.DOMReady=!1,c.readyCallback=function(){c.DOMReady=!0},c.supports.everything||(g=function(){c.readyCallback()},b.addEventListener?(b.addEventListener("DOMContentLoaded",g,!1),a.addEventListener("load",g,!1)):(a.attachEvent("onload",g),b.attachEvent("onreadystatechange",function(){"complete"===b.readyState&&c.readyCallback()})),f=c.source||{},f.concatemoji?e(f.concatemoji):f.wpemoji&&f.twemoji&&(e(f.twemoji),e(f.wpemoji)))}(window,document,window._wpemojiSettings);/*]]>*/</script> <style type="text/css">img.wp-smiley,img.emoji{display:inline !important;border:none !important;box-shadow:none !important;height:1em !important;width:1em !important;margin:0 .07em !important;vertical-align:-0.1em !important;background:none !important;padding:0 !important}</style> <script type='text/javascript'>var onepress_js_settings={"onepress_disable_animation":"","onepress_disable_sticky_header":"1","onepress_vertical_align_menu":"","hero_animation":"flipInX","hero_speed":"5000","hero_fade":"750","hero_duration":"5000","is_home":"","gallery_enable":"1"};</script> <script type='text/javascript'>var wtilp={"ajax_url":"https:\/\/www.snowys.com.au\/blog\/wp-admin\/admin-ajax.php"};</script>
Run Code Online (Sandbox Code Playgroud)
现在我想保持对 wordpress 的表情符号支持,但我想添加被动侦听器以获得更好的可用性,我该怎么做。
我想在这个链接中删除它并手动添加它,但我认为这不是一个好主意。
我正在尝试从该msdn 资源概述的 Web 配置文件中提取数据。
这是我的代码:
System.Configuration.Configuration activeCampaignApiSetting1 =
System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(null);
if (activeCampaignApiSetting1.AppSettings.Settings.Count > 0) {
System.Configuration.KeyValueConfigurationElement activeCampaignApiKeySetting =
activeCampaignApiSetting1.AppSettings.Settings["ActiveCampaignApiKey"];
if (activeCampaignApiKeySetting != null) {
activeCampaignApiKey = activeCampaignApiKeySetting.Value;
}
System.Configuration.KeyValueConfigurationElement activeCamapignApiUrlSetting =
activeCampaignApiSetting1.AppSettings.Settings["ActiveCampaignApiUrl"];
if (activeCamapignApiUrlSetting != null) {
activeCampaignApiUrl = activeCamapignApiUrlSetting.Value;
}
}
Run Code Online (Sandbox Code Playgroud)
当我尝试实例化此类时:
var acs = new Acs(activeCampaignApiKey, activeCampaignApiUrl);
Run Code Online (Sandbox Code Playgroud)
它抛出一个异常,告诉我这些值是空白的。
Web 配置文件中的值如下:
<add key="ActiveCampaignApiKey" value="apikey_removed" />
<add key="ActiveCampaignApiUrl" value="apiurl_removed" />
Run Code Online (Sandbox Code Playgroud)
有人知道我哪里可能出错吗?干杯