Add data-md5 attributes as on 4chan

This commit is contained in:
BkPHcgQL3V 2014-10-22 07:11:38 +00:00
parent d398a49fc6
commit f295d77f2d
2 changed files with 5 additions and 0 deletions

View File

@ -29,6 +29,9 @@ function load_twig() {
));
$twig->addExtension(new Twig_Extensions_Extension_Tinyboard());
$twig->addExtension(new Twig_Extensions_Extension_I18n());
$twig->addFilter(new Twig_SimpleFilter('hex2bin', 'hex2bin'));
$twig->addFilter(new Twig_SimpleFilter('base64_encode', 'base64_encode'));
}
function Element($templateFile, array $options) {

View File

@ -21,6 +21,7 @@
{% endif %}
"
style="width:{{ post.thumbwidth }}px;height:{{ post.thumbheight }}px"
data-md5="{{ post.hash|hex2bin|base64_encode }}"
>
</video>
{% else %}
@ -40,6 +41,7 @@
{% endif %}
"
style="width:{{ post.thumbwidth }}px;height:{{ post.thumbheight }}px" alt=""
data-md5="{{ post.hash|hex2bin|base64_encode }}"
/>
{% endif %}
</a>