We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22619
    • 101 Posts
    Небольшой сниппет по добавлению аваторов к комментариям Jot (Gravatar.com)
    Создаем снипет Gravatar с содержимым
    <?php
    $email = (isset($email))? $email : false;							// user e-mail
    $size = (isset($size))? $size : "90";							// size of image
    $default = (isset($default))? $default : false;  					// image_url(http://...) | identicon | monsterid | wavatar
    $rating = (isset($rating))? $rating : "g";							// rating g, pg, r, or x
    		$out = 'http://www.gravatar.com/avatar/';
    		if (!empty($email)) $out .= md5(strtolower($email));
    		$out .= '?s='.$size;
    		if (!empty($default)) $out .= '&d=' . urlencode($default);
    		$out .= '&r=' . $rating;
    
    return $out;
    ?>


    Добавляем возможность вводить e-mail в Jot:
    [!Jot? &docid=`17` &customfields=`email`!]


    В шаблон комментария:
    <img src="[[Gravatar? &size=`86`  &default=`[(site_url)]images/User.png` &email=`[+comment.custom.email:esc+]`]]" width="86px" height="86px">


    В шаблон формы:
    <label for="">E-mail:</label><input name="email" type="text" value="[+form.field.custom.email:esc+]"/> *will not published<br>

      • 22619
      • 101 Posts
      А если б репозитарии поискал, не пришлось бы и писать grin