Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/451.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 在WordPress中对上传的mp3文件进行编码_Php_Javascript_Wordpress - Fatal编程技术网

Php 在WordPress中对上传的mp3文件进行编码

Php 在WordPress中对上传的mp3文件进行编码,php,javascript,wordpress,Php,Javascript,Wordpress,有没有办法对我在WordPress网站上附加的每个MP3文件进行编码? 这是转到源代码时代码的外观: <ol class='songs'><li><a href='http://localhost/wordpress/wp-content/uploads/2011/10/f1678576.mp3' title='Song Title'>Artist - Song</a></li></ol> <pre><c

有没有办法对我在WordPress网站上附加的每个MP3文件进行编码? 这是转到源代码时代码的外观:

<ol class='songs'><li><a href='http://localhost/wordpress/wp-content/uploads/2011/10/f1678576.mp3' title='Song Title'>Artist - Song</a></li></ol>
<pre><code><script type='text/javascript'>_wpaudio.enc['wpaudio-5019e1ff1c9da'] = '\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0075\u0072\u006c\u002e\u0074\u006f\u002f\u0079\u006f\u0075\u0072\u002e\u006d\u0070\u0033';</script><a id='wpaudio-5019e1ff1c9da' class='wpaudio wpaudio-enc' href='#'>Artist - Song</a></code></pre>
  • PHP代码:

    if ($attachments) {
            echo "<ol class='songs'>";
            foreach ($attachments as $attachment) {
            echo "<li>";
                echo wp_get_attachment_link($attachment->ID);
                echo "</li>";
            }
            echo "</ol>";
        }
    
    if($attachments){
    回声“;
    foreach($attachments作为$attachment){
    回声“
  • ”; echo wp\u get\u attachment\u链接($attachment->ID); 回声“
  • ”; } 回声“; }
    我看到了WPaudio,但不知道如何实现它。以下是WPaudio代码的外观:

    \u wpaudo.enc['wpaudo-5019e1ff1c9da']='\u0068\u0074\u0074\u0074\u0070\u003a\u002f\u002f\u002f\u002f\u0072\u006c\u002e\u0074\u006f\u002f\u0079\u006f\u0075\u0072\u002e\u006d\u0070\u0033'
    

    如果您有任何建议,请随时表达。谢谢。

    如果您想这样做,WPAudio的安装看起来相当简单。。。在一天结束时,当您可以使用其他播放器时,您将花费大量精力通过编码来隐藏文件名


    如果你想成为一个偏执狂,不妨使用SoundCloud之类的服务

    为什么需要编码?要对文件名进行编码吗?是的。因为当你深入研究源代码的时候。只需单击一下,您就会得到文件。:)但是,即使你编码,他们仍然可以得到文件,你看到的是你得到的,记住的?你真的想在每个页面中嵌入几兆字节*4左右的编码开销,扼杀任何可缓存性的希望吗?你的网站的url是什么,这样我就可以在它增加我的带宽账单之前把它列入黑名单?在WPaudio代码中,没有.mp3文件。那是我的问题。我想隐藏源代码中的.mp3内容。