Forums

Podpress alternative in-post status display (2 posts)

  1. calliban
    Member
    Posted 1 year ago #

    I'm using podpress and I would like to display the number of downloads of a given episode to my listeners.

    The deal is, the way Podpress deal with that does not fit with my blog design. I want it to be displayed in a different place than the player box.

    I believe I could call some line of code to display just that text anywhere on my post, am I right? Can someone plese tell me if it's true, i.e., could I just paste a line of code on my HTML design version of post and it would show me the data I want?

  2. ntm
    Member
    Posted 1 year ago #

    I believe I could call some line of code to display just that text anywhere on my post, am I right?

    No, there is no such function. podPress prints this line via the file podpress_theme.php and the function in this file is called from a function from the function insert_content() in podpress_class.php . This function is a filter function which attached to the the_content Action Hook.

    Inside the Loop the variable $post does contain also the meta data of the podPress attachments.
    $post has 2 podPress elements of them is $post->podPressMedia
    You can see an example of the structure of podPressmedia and podPressPostSpecific here:
    http://pastebin.com/R0REqasF

    With this meta data you get the file names of the media files and with the file names you can retrieve the download numbers as it is done in the function insert_content():
    http://pastebin.com/cUb8w3uU

    Notice: if you build your own filter plugin to retrieve and insert the stats then $this->settings['enableStats'] becomes $podPress->settings['enableStats']. Also be aware that podPress counts the downloads only on the basis of the file name (and not the full URL or path). (That might change one day.)

    Another possibility to modify the displayed stats is to use the filter hook podpress_downloadlinks. You could attach a filter plugin to that hook and modify the line that way.

    In both cases you will need more than one line of code.

    If you have further questions then I will try answer them.

    Regards,
    Tim

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags