WordPress.org

Ready to get started?Download WordPress

Forums

Progress Bar
automated changes to progress value (8 posts)

  1. jczarniak
    Member
    Posted 2 years ago #

    Hi - great plugin, thanks.

    I am using it for a non-profit that raises money for poverty-stricken communities in Africa. (Here's the page.).

    Do you have any suggestions on how to automate the updating of the "progress" value without changing it manually? As money is donated, it will be a pain to login into wordpress several times per day to change the shortcode value manually. i was thinking i could use an <img> to insert different length .gifs of the progress bar, but the progress bars are all CSS, not .gifs, correct?

    Any other ideas?

    thanks,
    Jeff

    http://wordpress.org/extend/plugins/progress-bar/

  2. Chris Reynolds
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Jeff --

    Sorry, I didn't see this come in which is why the lack of response. Automatically updating progress would require more PHP coding to pull in the progress dynamically from somewhere. And if we're pulling it in dynamically, it needs to be someplace that applies to everyone, right? so this plugin is still useful for the general public. So, if I wanted to, for example, have a progress bar for donations to PayPal, I'd need to have access to your PayPal account to get that value and then do some basic math to compare the total amounts donated vs. the goal. This gets into much more complexity than this progress bar plugin was originally intended. There are other plugins that do that sort of thing much better and are better suited for it, a great one is IgnitionDeck.

    Hope that helps!

  3. dr_figs
    Member
    Posted 1 year ago #

    HI Chris,

    I want to use the bar in the same way that jeff.
    I did all the math that u are talking with the php and at the end i have a variable $percentage that indicates the percentage of amount raised. Can u tell me how can I use the shortcut to print this variable
    I tried:
    echo do_shortcode('[wppb progress="$percentage" option=animated-candystripe percent=inside]');
    and
    echo do_shortcode('[wppb progress=$percentage option=animated-candystripe percent=inside]');
    ...but it seems that the shorcut does not like that option

    Thanks,
    Jordi

  4. Chris Reynolds
    Member
    Plugin Author

    Posted 1 year ago #

    Your PHP in both examples are off. You're a bit closer in the first one because " quotes allow you to echo a variable, but the whole thing is wrapped in a single ' which doesn't. Try this:

    echo do_shortcode( "[wppb progress=$percentage option=animated-candystripe percent=inside]" );

  5. dr_figs
    Member
    Posted 1 year ago #

    yeahhh,
    That works perfectly!!
    Thanks so much!

  6. Chris Reynolds
    Member
    Plugin Author

    Posted 1 year ago #

    np. mind sharing your code so others can potentially use it?

  7. yukiko-kawa
    Member
    Posted 1 year ago #

    I have a idea!
    I use a plugin with this code:
    [custom-list post_type="episodi" taxonomy="category" terms="Amnesia" orderby="title" order="asc" showposts="0" ]
    the function is easy: the plugin see the title of post with category "Amnesia".

    then, if you can write a function for count oun post in a specific category, you can give a automatic progress bar ^^!

    you can do it ?
    thanks for plugin :)

  8. Chris Reynolds
    Member
    Plugin Author

    Posted 1 year ago #

    @yukiko-kawa

    Either the core Progress Bar plugin or the custom list plugin would need to be modified to pass a value from one shortcode to the other. In general, shortcodes don't like having other shortcodes inside them -- it tends to break stuff -- so what I would do if I was building that is turn the number of posts into a variable that I could pass to the Progress Bar plugin. It's not supported by the plugin right now, but what I may do in the next update is make it so the output can be modified by a filter, so other developers have an easier time doing stuff like this.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.