HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS. ocPortal 9 is superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


[RESOLVED] v7.0.1 - Custom comcode tag problem on "about me" page

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#90841 (In Topic #18335)
Avatar

Community saint

When I add a custom comcode tag (specifically to embed a youtube video) in the "about me" field of a profile, the contents of the tag are escaped and will therefore not render correctly. The same tag, in say a signature, renders fine.

Also, I get notifications when someone edits their signature, avatar etc. but not when they edit the "about me" text. Is this still the case in v8/9? If not, is this by design?


Last edit: by temp1024

Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
Back to the top
 
Posted
Rating:
#90847
Avatar

This sounds familiar as an old bug but I can't remember the details off-hand. Look in OCF_MEMBER_PROFILE_SCREEN.tpl and see if you can locate this code:

Code


                           <tr>
                              <th class="de_th">
                                 {NAME*}:
                              </th>

                              <td>
                                 <span{+START,IF,{$EQ,{NAME},{!SPECIAL_CPF__ocp_fullname}}} class="fn given-name"{+END}>
                                    {+START,IF_EMPTY,{ENCRYPTED_VALUE}}
                                       {$PREG_REPLACE,\|,\,,{$PREG_REPLACE,\n,<br />,{VALUE}}}

If the {$PREG_REPLACE,\|,\,,{$PREG_REPLACE,\n,<br />,{VALUE}}} bit actually has a '*' in it on yours, try removing it.

The CPFs get to the templates from this code in site/pages/modules/members.php:

Code


      foreach ($_custom_fields as $name=>$value)
      {
         $encrypted_value='';
         if (is_data_encrypted($value))
         {
            $encrypted_value=remove_magic_encryption_marker($value);
         }
         elseif ((is_string($value)) && (substr($value,0,7)=='http://'))
         {
            $_value=hyperlink($value,$value,true,true);
            $value=$_value->evaluate();
         } elseif (is_integer($value))
         {
            $value=escape_html(integer_format($value));
         } else
         {
            if (!is_object($value)) $value=escape_html($value);
         }

         if (((!is_object($value)) && ($value!='')) || ((is_object($value)) && (!$value->is_empty())))
         {
            $custom_fields[]=array('NAME'=>$name,'VALUE'=>$value,'ENCRYPTED_VALUE'=>$encrypted_value);
            if ($name==do_lang('KEYWORDS')) $GLOBALS['SEO_KEYWORDS']=is_object($value)?$value->evaluate():$value;
            if ($name==do_lang('DESCRIPTION')) $GLOBALS['SEO_DESCRIPTION']=is_object($value)?$value->evaluate():$value;
         }
      }
No escaping should happen because if (!is_object($value)) $value=escape_html($value); should not run for a lump of Tempcode (which is an object).

$_custom_fields ultimately comes from sources/ocf_members.php:

Code


      if (($field_to_show['cf_type']=='short_trans') || ($field_to_show['cf_type']=='long_trans'))
      {
         if ((is_null($member_value)) || ($member_value==0)) $member_value=''; else $member_value=get_translated_tempcode($member_value,$GLOBALS['FORUM_DB']); // This is meant to be '' for blank, not new ocp_tempcode()
         if ((is_object($member_value)) && ($member_value->is_empty())) $member_value='';
      }



Become a fan of Composr on Facebook or add me as a friend. Add me on on Twitter. Support me on Patreon
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#90848
Avatar

Also, I get notifications when someone edits their signature, avatar etc. but not when they edit the "about me" text. Is this still the case in v8/9? If not, is this by design?

By design. v8+ can monitor specific action log entries if more notifications are desired.


Become a fan of Composr on Facebook or add me as a friend. Add me on on Twitter. Support me on Patreon
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#90849
Avatar

Community saint

Thanks for the pointers Chris :thumbs: .

Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
Back to the top
 
Posted
Rating:
#90853
Avatar

Community saint

Woops, I miss read the output :$.

It wasn't escaping it, it was replacing replacing \n with <br />. So:

Code

{$PREG_REPLACE,\|,\,,{$PREG_REPLACE,\n,<br />,{VALUE}}}
is the problem. Replacing that with just:

Code

{VALUE}
fixes it.

Although:

Code

{$PREG_REPLACE,\|,\,,{VALUE}}
Will also work (because I don't have any |'s in my comcode output, I won't use it as I can't see a special case need to convert |'s to ,'s .

Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: