Using php with your plugin
-
Hi!
I have read the documentation and know that I can use the following shortcode syntax to obtain the download count for a given item:
[sdm_show_download_info id="123" download_info="download_count"]
I have three downloads so I can have three shortcode references. No problem with that.
My issue is that I need to come up with a new shortcode code that basically does this:
WorkOutDownloadAsPercentage(download id) total_msa = get-download-total-for-msa total_pts = get-download-total-for-pts total_vrr = get-download-total-for-vrr total = total_msa + total_pts + total_vrr; percent_msa = (100 / total) * total_msa percent_pts = (100 / total) * total_pts percent_vrr = (100 / total) * total_vrr if(download id is msa) return percent_msa else if(download id is pts) return percent_pts else if(download id is vrr) return percent_vrr return 0
Some thing like the above in to a shortcode, so I can call:
[sdm_get_download_as_percent id=xxx]
I appreciate this can’t be part of your plugin and just custom snippet at my end.
Thanks for help.
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Using php with your plugin’ is closed to new replies.