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, which is now in beta. ocPortal 9 will be 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.


bug: config 'make whisper promenant' ...

Login / Search

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

Community saint

As it is, with stock v9.02 files, the above option does not do what it is supposed to do.   (from what I understand)…

In forum/pages/modules/topics, it uses this code to 'check' and see if it is on or off and thus put the whisper box up on screen:

Code (php)

if (ocf_may_make_private_topic())
{  
  if (($_intended_solely_for!='') || (get_value('no_inline_pp_advertise')=='1'))
        $specialisation->attach(form_input_username(do_lang_tempcode('WHISPER'),do_lang_tempcode('DESCRIPTION_WHISPER'),'intended_solely_for',$_intended_solely_for,false));
}
 

I don't know what get_value is, but I know get_option get's the value of config options.   And it appears this option is now tied to 'overt_whisper_suggestion'.  So I changed the code to the below.  It appears to be properly showing the whisper box (or not) now..

Code (php)

if (ocf_may_make_private_topic())
{  
  if (($_intended_solely_for!='') || (get_option('overt_whisper_suggestion')=='1'))
    $specialisation->attach(form_input_username(do_lang_tempcode('WHISPER'),do_lang_tempcode('DESCRIPTION_WHISPER'),'intended_solely_for',$_intended_solely_for,false));
}
 


Paul
Back to the top
 
Posted
Rating:
#91747
Avatar

get_value is for hidden options, set with set_value.

This isn't a bug, but your approach may be good to unify the official option (which affects the topicview module) with this (which affects the posting screens). I'll add a note to the relevant tracker issue.


Last edit: by Chris Graham


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
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 ocPortal whenever you see the opportunity.
  • 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 ocPortal 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:
#91750
Avatar

Community saint

Yeah, seems to make more sense to go straight to the option than to throw in extra stuff.  I did a search for the code, 'no_inline_pp_advertise' is only found in  topic.php and ocf_topicview.php …
 
And never with a set_value, so not sure how it got set.   Even in the latter, you can find this code:

Code (php)

        if ((array_key_exists('may_pt_members',$topic_info)) && ($may_reply) && ($_postdetails['poster']!=get_member()) && ($_postdetails['poster']!=$GLOBALS['OCF_DRIVER']->get_guest_id()) && (ocf_may_whisper($_postdetails['poster'])) && (get_option('overt_whisper_suggestion')=='1'))
        {
                $whisper_type=(get_value('no_inline_pp_advertise')==='1')?'new_pt':'whisper';

I changed this as well..
 




Paul
Back to the top
 
Posted
Rating:
#91755
Avatar

Hidden values get set manually, there is no UI. We add them as we see them useful, because adding a proper option means we have to reversion the config in the database and write new language strings for translation, and it also affects performance as there are too many config options defined now (the whole thing needs reengineering).


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
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 ocPortal whenever you see the opportunity.
  • 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 ocPortal 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
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: