Search

I would like to add gravatar-support in my comments-DS on my website, but to do this I need a md5-hashed version of the e-mail-field. To do this I have to manually edit my 'data.comments.php', but I don't know how.

I tried to "debug" $result in the grab() function but it was way to complicated for me to edit myself, but at least I think it's somewhere there I should edit.

Can anyone help me?

The DS: http://www.purrito.net/tmp/data.comments.phps

Does this extension help?

Almost, but if I understand correctly that extension hashes the value written in that field in the section, without saving the "unhashed" text.

Currently there is no way to manipulate the data once it is in the main page SimpleXML object, however this is set to change with Rev 6 using DOMDocument instead.

For now, you have 2 options. The line where all the magic happens, I.E. where the XML representing your comment is appended to the page XML, is the appendFormattedElement() function of /symphony/lib/toolkit/fields/field.input.php. You can either change that to also add the MD5 hash, or duplicate the input field file, renaming the class and file, to create a new field that does specifically what you are after: adding the hash of value to the XML.

Hack

$wrapper->appendChild(new XMLElement($this->get('element_name'), ($encode ? General::sanitize($value) : $value), array('handle' => $data['handle'], 'hash' => md5($value))));

Hope that helps.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details