Author Topic: Template Codes  (Read 2386 times)

picard102

  • Newbie
  • Posts: 8
Template Codes
« on: March 02, 2011, 01:04:06 am »
I'm looking for individual codes to call the popup player, the download link, and the player on separate areas of the page rather then in one grouping at the bottom of the post under the player.

Any such functionality?

mgdell

  • Blubrry Customer Support Coordinator
  • Administrator
  • Hero Member
  • *****
  • Posts: 3318
Re: Template Codes
« Reply #1 on: March 02, 2011, 08:58:21 am »
Not currently automatically.  Powerpress gives you the option of turning off the download and play in new window links, but it won't put them in different places away from the player.   

You could put in manual links to them wherever you want them and just turn off the links under the player. 

-Mike
« Last Edit: March 02, 2011, 09:03:47 am by mgdell »

picard102

  • Newbie
  • Posts: 8
Re: Template Codes
« Reply #2 on: March 02, 2011, 11:44:00 am »
Ya, I'm trying to put the links off to the side outside of the post area but still within the loop.
I don't suppose there is a way to hack something together in the template to make the call to the popup player?

I see that

$player_links .= "<a href=\"{$EpisodeData['url']}\" class=\"powerpress_link_pinw\" target=\"_blank\" title=\"". POWERPRESS_PLAY_IN_NEW_WINDOW_TEXT ."\">". POWERPRESS_PLAY_IN_NEW_WINDOW_TEXT ."</a>".PHP_EOL;

and

$player_links .= "<a href=\"{$EpisodeData['url']}\" class=\"powerpress_link_d\" title=\"". POWERPRESS_DOWNLOAD_TEXT ."\">". POWERPRESS_DOWNLOAD_TEXT ."</a> (". htmlspecialchars(POWERPRESS_DURATION_TEXT) .": " . powerpress_readable_duration($EpisodeData['duration']) ." &#8212; ".powerpress_byte_size($EpisodeData['size']).")".PHP_EOL;

are roughly the code that outputs the data. Is there a way to make them work on their own in the template file?
« Last Edit: March 02, 2011, 12:48:59 pm by picard102 »

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: Template Codes
« Reply #3 on: March 04, 2011, 02:19:29 pm »

picard102

  • Newbie
  • Posts: 8
Re: Template Codes
« Reply #4 on: March 04, 2011, 03:56:00 pm »
Not exactly sure how that helps? Could you be more specific?

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: Template Codes
« Reply #5 on: March 06, 2011, 10:22:17 pm »
The link I replied with eplains how to put the PowerPress player and links where you want in your theme. I presume this is what you want.

Can you be more specific what you want?

picard102

  • Newbie
  • Posts: 8
Re: Template Codes
« Reply #6 on: March 17, 2011, 02:03:16 pm »
I want to take the two links, separate them, and individually call them in the template.

http://dl.dropbox.com/u/23132/new-1.jpg



angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: Template Codes
« Reply #7 on: March 17, 2011, 03:06:05 pm »
You should be able to view the source code in PowerPress and figure this out. You need to have experience working with WordPress plugins and knowledge how WordPress filters work. If you cant then I would not recommend trying to do this on your own.

You can easily get the link to the media file in your theme and then make links for it how ever you wish.

Code: [Select]
<?php
$media_url 
powerpress_get_enclosureget_the_ID() );
echo 
"<a href=\"$media_url\">mp3</a>";
?>

picard102

  • Newbie
  • Posts: 8
Re: Template Codes
« Reply #8 on: March 17, 2011, 03:30:51 pm »
You should be able to view the source code in PowerPress and figure this out.

Well if I could have I would have.

Todd

  • Administrator
  • Sr. Member
  • *****
  • Posts: 418
Re: Template Codes
« Reply #9 on: March 17, 2011, 04:14:05 pm »
PowerPress is a free plugin, we do out best to document the functions for those that have non standard templates.

We do not do offer custom coding for free. Contact us at support@rawvoice.com if you would like us to do custom coding for you.

Todd..

picard102

  • Newbie
  • Posts: 8
Re: Template Codes
« Reply #10 on: March 17, 2011, 04:24:17 pm »
We do not do offer custom coding for free.

Saying "how do I do this" is a bit different then asking you to code an entirely new function for me. I even pulled out some code from the plugin and asked if it's the right direction, only to be told to read the manual. Whatever, at least now I know to move onto another plugin.

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: Template Codes
« Reply #11 on: March 17, 2011, 05:28:04 pm »
You're being very rude, your getting a lot already for free. This is an open source plugin that I develop on my free time. I take my time and serious consideration anytime someone asks for a feature or wants help. I have over 100 features still waiting to be coded in PowerPress by users who respectfully ask for the feature and are gracious enough to wait until it can be added. If you want a feature, ask for it, we'll put it in the list. If you want a solution coded for your theme today, hire us and we'll develop it for you and it will be our top priority. If you want to make threats to open source developers to get what you want, then perhaps you need think twice about the open source tools you are using.

Here's a little more sudo code, and I cannot guarantee it will work but it's enough logic to show that if you look at the source code and know what you're doing, you can do this without our help. It also demonstrates that if you don't get it, you need to find a PHP developer that does understand what's happening.

Code: [Select]
<?php
$EpisodeData 
powerpress_get_enclosure_dataget_the_ID() );
$media_url powerpress_get_enclosureget_the_ID() );

echo 
"<a href=\"{$media_url}\" target=\"_blank\" onclick=\"return powerpress_pinw(&#39;{$EpisodeData [&#39;id&#39;]}-{$EpisodeData [&#39;feed&#39;]}&#39;);\">Listen Now</a>";

echo &#39;<br />&#39;;

echo "<a href=\"$media_url\">mp3</a>";

?>


carlyblack

  • Newbie
  • Posts: 1
Re: Template Codes
« Reply #12 on: August 30, 2013, 02:29:40 am »
Hi everyone,

I know this is an old topic, but I spent most of the day trying to figure out how to separate the links into template tags, once i figured it out (by trial and error and ready different sources) I thought I'd share them here just in case anyone else is looking to do this. thanks to the code from Angelo above as that helped me start to finally figure it out :)

So what I wanted to do was to have a podcasting 'index' style page, so it just listed the name of the podcast, the duration and then the link to the mp3. So here it is:

Code: [Select]
$EpisodeData = powerpress_get_enclosure_data( get_the_ID() );
$media_url = powerpress_get_enclosure( get_the_ID() );
echo "<td class='duration'>{$EpisodeData ['duration']}</td>";
echo "<td class='mp3'><a href=\"$media_url\"><img src='/img/mp3.gif' alt='Download the MP3' /></a>";
?>

it probably seems very simple and obvious to people that understand plugins and php, but I'm a bit slow with this stuff - so hopefully this helps someone.

angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: Template Codes
« Reply #13 on: September 05, 2013, 11:11:23 am »
Cool!

By the way if you just wanted an icon next to the links, you could have done this with CSS. Example is here: http://create.blubrry.com/resources/powerpress/powerpress-and-your-theme/