daily gadgets, computers, and electronic news
15/05
2005

How to Combine CA-Credits with Random Words Plugin

Sponsored Links

Couple days ago, Ozh released a nice plugin called Random Words. This useful multi-purpose plugin is used to display random text (not words actually :p ) from a specified list. You can use it to display random quotes, random verse, random image, etc.

On Random Words post, RaynerTheApe commented on how to combine Random Words with my CA-Credits plugin. I think it’s a nice idea, although CA-Credits itself already support random credit displayed :p

So here’s how you do it (assumed that both plugins already installed):

  1. Create list for CA-Credits from Options - Random Words. Basically, you only need to create 2 list, one to replace $before parameter and another for $after parameter. But if you like, go ahead and also make a list for $zero, $one, and $more parameter. I named the list ‘credits_before‘, ‘credits_after‘, ‘credits_zero‘, and so on.

    Sample for ‘credits_before‘ list:
    Hello
    Hi
    Greetings
    Ahoi
    Hola
    Excellent

    Sample for ‘credits_after‘ list:
    . Thanks for leaving comment!
    . Thank you very much.
    . Please leave your comment too!

    Notice that you can also insert CA-Credits specific pseudo-keyword on Random Words list.
  2. Now replace your CA-Credits function call, with:

    [php]< ?php ca_credits_custom( wp_ozh_randomwords('credits_before',0) . ' ', wp_ozh_randomwords('credits_after',0) . ' ', ', ', ', and ', 3, 40, '%name%’, wp_ozh_randomwords(’credits_zero’,0) . ‘ ‘, wp_ozh_randomwords(’credits_one’,0) . ‘ ‘, wp_ozh_randomwords(’credits_more’,0) . ‘ ‘); ?>[/php]

    If your CA-Credits version is less than v1.0 , simply replace ca_credits_custom() with ca_credits(). Also, if you only specify ‘credits_before’ and ‘credits_after’ list, just enter the first 2 parameter and ignore the rest.
  3. Done! :))

Hope it helps :d

How to Combine CA-Credits with Random Words Plugin is written by cosa and posted under Crack & Hack, WordPress , , , , . If you like it, you might consider subscribing to our feed or receive our latest posts via email. Or else, you could also bookmark it to your favourite social bookmark sites. Further information about this article can be found .

2 Comments (leave yours)

No comments yet.

Leave a comment