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.


It's your lucky day - Where to configure this message?

Login / Search

 [ Join | More ]
 Add topic 
Posted
Item has a rating of 5 (Liked by sholzy)  
Rating:
#83285 (In Topic #17328)
Avatar

Fan in action

Testing the points system and gave myself some points a few times.
And suddenly I got this message:

It's your lucky day; you have received 25 free points for your generosity towards others.

I cannot find where to modify this or add more like this.
I've checked the points admin page where you set the points for doing things and this is not present.

Can I create more of these types of conditional messages?
This would be fantastic

:wub:
Back to the top
 
Posted
Rating:
#83287
Avatar

Try putting the word "generosity" into the search box in the Admin Zone (top right).

Should point you to the language string.

I think there are some config options to control the number of points and chance value, but it's not possible to set up multiple.


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
Item has a rating of 5 (Liked by JeanLiked by sholzy)  
Rating:
#83289
Avatar

Fan in action

ok that helped me find the tempcode and from there a search of the soruce code lead me to

site/pages/modules/points.php

Code

               // Randomised gifts
               if (mt_rand(0,4)==1)
               {
                  $message=do_lang_tempcode('PR_LUCKY');
                  $_current_gift=point_info($viewer_member);
                  $current_gift=array_key_exists('points_gained_given',$_current_gift)?$_current_gift['points_gained_given']:0;
                  $GLOBALS['FORUM_DRIVER']->set_custom_field($viewer_member,'points_gained_given',$current_gift+25);
               } else $message=do_lang_tempcode('PR_NORMAL');

This is excellent, now I can modify the randomness and value received.

 :wub:
Back to the top
 
Posted
Item has a rating of 5 (Liked by JeanLiked by sholzy)  
Rating:
#83293
Avatar

Hmm, okay actually that is hard coded in that code, not options like I thought.

Well you can change that code if you like, changing 25 (25 points) and 4 (1 in 5 [0-4] chance) as appropriate.
Just make sure to save as site/pages/modules_custom/points.php so your changes aren't lost when upgrading.

'PR_LUCKY' is the language string.


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: