I have the plugin setup to use the [podcast:...] tag and it is working fine. I'd like to configure it to only show the player and not the link to the file beside the player.
I've had a look at the code but can't seem to spot where I could change this behaviour.
Any help is appreciated. A pointer to the line of code I could comment out or modify would be great.
Thanks
Perlnerd
Help with small change to podcast plugin
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Help with small change to podcast plugin
Hi!
The magic lines that affect the output are those within the PHP filE:
This uses the template for HTML as defined here:
So if you change that <a href...> html to suit your needs in the preg_replacement call , you should work it out?
Something like this:
So, stripping the <a> tag at the required places...
HTH,
Garvin
The magic lines that affect the output are those within the PHP filE:
Code: Select all
if ($tagging_switch == 'podcast') {
$eventData[$entryPos]['body'] = preg_replace(
$mediaLinkPattern,
'<a href="\4\5">\5</a>',
$entry['body']);
$eventData[$entryPos]['extended'] = preg_replace(
$mediaLinkPattern,
'<a href="\4\5">\5</a>',
$entry['extended']);
}
if ($use_player && is_array($eventData[$entryPos])) {
$eventData[$entryPos]['body'] = preg_replace(
$playerRewritePattern,
'"\0". sprintf($this->playerHTML[strtolower("\3")], "\2", "\2"); ',
$eventData[$entryPos]['body']);
$eventData[$entryPos]['extended'] = preg_replace(
$playerRewritePattern,
'"\0". sprintf($this->playerHTML[strtolower("\3")], "\2", "\2"); ',
$eventData[$entryPos]['extended']);
}
Code: Select all
$playerRewritePattern =
'@<a\s+.*href\s*=\s*(\'|")([^\'"]+\.('.
implode('|', array_keys($this->playerHTML)).
'))\1[^>]*>.*</a>@Usie'; //won't match nested tags, like <a .. <b>.. </b></a>. but that's ugly anyway.
Something like this:
Code: Select all
if ($tagging_switch == 'podcast') {
$eventData[$entryPos]['body'] = preg_replace(
$mediaLinkPattern,
'\5',
$entry['body']);
$eventData[$entryPos]['extended'] = preg_replace(
$mediaLinkPattern,
'\5',
$entry['extended']);
}
HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
The regex upon regex was making my brain hurt....
The solution I came up with was pretty simple:
became:
This seems to keep the regexes that follow happy but gets rid of any visible link.
Another question: Is there a way to get the podcast plugin to work on pages created with the "static pages" module?
Thanks
PerlNerd
The solution I came up with was pretty simple:
Code: Select all
if ($tagging_switch == 'podcast') {
$eventData[$entryPos]['body'] = preg_replace(
$mediaLinkPattern,
'<a href="\4\5">\5</a>',
$entry['body']);
$eventData[$entryPos]['extended'] = preg_replace(
$mediaLinkPattern,
'<a href="\4\5">\5</a>',
$entry['extended']);
}
Code: Select all
if ($tagging_switch == 'podcast') {
$eventData[$entryPos]['body'] = preg_replace(
$mediaLinkPattern,
//'<a href="\4\5">\5</a>',
'<a href="\4\5"> </a>',
$entry['body']);
$eventData[$entryPos]['extended'] = preg_replace(
$mediaLinkPattern,
//'<a href="\4\5">\5</a>',
'<a href="\4\5"> </a>',
$entry['extended']);
}
Another question: Is there a way to get the podcast plugin to work on pages created with the "static pages" module?
Thanks
PerlNerd
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Glad you got it to work
Actually you should be able to make the podcast plugin also perform replacements on static pages, yes. You must enable the "Appl ymarkup transformations" option for the page then.
Regards,
Garvin
Glad you got it to work
Actually you should be able to make the podcast plugin also perform replacements on static pages, yes. You must enable the "Appl ymarkup transformations" option for the page then.
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
bdconnolly
- Regular
- Posts: 140
- Joined: Tue Apr 04, 2006 9:37 pm
Weird; looks like the code expects the plugin to be configured for markup, then calls frontend_display hook, then checks if "markup_staticpage" has been set. The only plugin that can do that is serendipity_event_smartymarkup.
So, if you've got the Smarty markup plugin, it'll always override any other static page markup. Is it installed?
So, if you've got the Smarty markup plugin, it'll always override any other static page markup. Is it installed?