• Resolved rwwood

    (@rwwood)


    I’m using iThemes builder for my theme, and one of the plugins that comes with it is for listing mp3 sermons on a church site. The url for the listing page is https://www.mysite.com/sermons. Any new sermons added via the plugin will be listed on that page. (the page doesn’t show up in the WP pages list) There is an mp3 player on the page for each individual sermon, but not on the listing page, where I would like to have one. There is a link there which opens a player in a new browser tab, but that’s not what I want.

    Is it possible to add a function to your plugin to allow it to insert the player on a specific URL?

    Thanks.
    RW Wood

    https://www.ads-software.com/extend/plugins/auto-attachments/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Serkan Algur

    (@kaisercrazy)

    Hi,

    Are you attach your mp3s (upload to your site)?

    If you don’t, plugin can’t see unattached items or dynamically generated contents for now.

    I’m working on it.

    Thread Starter rwwood

    (@rwwood)

    Yes, the mp3 files are attached to each of the posts on the listing page. There is a link to the mp3 that opens an ugly player in another tab, but I’d like to see your player there instead.

    Plugin Author Serkan Algur

    (@kaisercrazy)

    Ok then, your mp3 list plugin uses a different way to open/play your files.

    Which plugin you use for listing your mp3s? If you can give name of the plugin i can make a search for codes.

    Thread Starter rwwood

    (@rwwood)

    It’s from a paid theme by iThemes. If you tell me what I’m looking for, I’ll try to find the needed code.

    Thread Starter rwwood

    (@rwwood)

    Actually, here’s the template.php file for the listing page.

    <?php
    /**
     *	This is the template for displaying archive sermons.
     *
     *	@package		Builder Block Church
     *	@subpackage		Templates
     *	@author			Justin Kopepasah
     *	@since			1.1.0
     *
     *	DO NOT EDIT THIS TEMPLATE.
     *
     *	If you wish to use a custom template, copy this template over
     *	to your theme and rename the template to archive-sermon.php.
    */
    
    function render_content() {
    	global $post;
    ?>
    	<?php if ( have_posts() ) : ?>
    		<div class="loop sermon-archive">
    			<div class="loop-header">
    				<h4 class="loop-title"><?php _e( 'Sermons', 'it-l10n-builder-block-church' ); ?></h4>
    			</div>
    
    			<div class="loop-content">
    				<?php while ( have_posts() ) : the_post(); ?>
    					<?php $audio = get_children( array('post_parent' => $post->ID, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'audio' ) ); ?>
    					<div id="post-<?php the_ID(); ?>" <?php post_class( 'clearfix' ); ?>>
    						<div class="entry-header">
    							<h3 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
    							<span class="sermon-date"><?php printf( __( ' Posted on %s', 'it-l10n-builder-block-church' ), get_the_date() ); ?><span>
    							<span class="sermon-tags"><?php printf( __( ' in %s', 'it-l10n-builder-block-church' ), get_the_term_list( $post->ID, 'sermon_tag', '', ', ', '' ) ); ?></span>
    							<?php if ( ! empty( $audio ) ) : ?>
    								<?php _e( '| MP3', 'it-l10n-builder-block-church' ); ?><?php if ( count( $audio ) >= 2 ) { echo 's'; } else { echo ' -'; } ?>
    								<?php foreach ( $audio as $attachment_id => $attachment ) : ?>
    									<span class="sermon-mp3"> <?php if ( count( $audio ) >= 2 ) { echo "-"; } ?> <a href="<?php echo wp_get_attachment_url( $attachment_id, 'full' ); ?>" target="_blank" title="<?php echo wp_get_attachment_link( $attachment_id, '' , false, false, ' '); ?>" rel="audio-file"><?php echo $attachment->post_title; ?></a></span>
    								<?php endforeach; ?>
    							<?php endif; ?>
    						</div>
    						<div class="entry-content">
    							<?php if ( has_post_thumbnail() ) : ?>
    								<?php the_post_thumbnail( 'sermon-archive', array( 'class' => 'alignright' ) ); ?>
    							<?php endif; ?>
    							<?php the_content( __( 'View Sermon &rarr;', 'it-l10n-builder-block-church' ) ); ?>
    						</div>
    					</div>
    
    					<?php comments_template(); // include comments template ?>
    				<?php endwhile; // end of one post ?>
    			</div>
    
    			<div class="loop-footer">
    				<!-- Previous/Next page navigation -->
    				<div class="loop-utility clearfix">
    					<div class="alignleft"><?php previous_posts_link( __( '&laquo; Previous Sermon', 'it-l10n-builder-block-church' ) ); ?></div>
    					<div class="alignright"><?php next_posts_link( __( 'Next Sermon &raquo;', 'it-l10n-builder-block-church' ) ); ?></div>
    				</div>
    			</div>
    		</div>
    	<?php else : // do not delete ?>
    		<?php do_action( 'builder_template_show_not_found' ); ?>
    	<?php endif; // do not delete ?>
    <?php
    }
    
    add_action( 'builder_layout_engine_render_content', 'render_content' );
    do_action( 'builder_layout_engine_render', basename( __FILE__ ) );

    Plugin Author Serkan Algur

    (@kaisercrazy)

    Copy and save this code to archive-sermon.php, change https://yoursite.com to your domain and upload to your theme’s folder. I think this code will work for you. If it don’t please tell me.

    Have a nice day

    <?php
    /**
     *	This is the template for displaying archive sermons.
     *
     *	@package		Builder Block Church
     *	@subpackage		Templates
     *	@author			Justin Kopepasah
     *	@since			1.1.0
     *
     *	DO NOT EDIT THIS TEMPLATE.
     *
     *	If you wish to use a custom template, copy this template over
     *	to your theme and rename the template to archive-sermon.php.
    */
    
    function render_content() {
    	global $post;
    ?>
    	<?php if ( have_posts() ) : ?>
    		<div class="loop sermon-archive">
    			<div class="loop-header">
    				<h4 class="loop-title"><?php _e( 'Sermons', 'it-l10n-builder-block-church' ); ?></h4>
    			</div>
    
    			<div class="loop-content">
    				<?php while ( have_posts() ) : the_post(); ?>
    					<?php $audio = get_children( array('post_parent' => $post->ID, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'audio' ) ); ?>
    					<div id="post-<?php the_ID(); ?>" <?php post_class( 'clearfix' ); ?>>
    						<div class="entry-header">
    							<h3 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
    							<span class="sermon-date"><?php printf( __( ' Posted on %s', 'it-l10n-builder-block-church' ), get_the_date() ); ?><span>
    							<span class="sermon-tags"><?php printf( __( ' in %s', 'it-l10n-builder-block-church' ), get_the_term_list( $post->ID, 'sermon_tag', '', ', ', '' ) ); ?></span>
    							<script language='javascript' type='text/javascript' src='https://yoursite.com/wp-content/plugins/auto-attachments/includes/jw/swfobject.js'></script>
    							<ul>
    							<?php if ( ! empty( $audio ) ) : ?>
    								<?php _e( '| MP3', 'it-l10n-builder-block-church' ); ?><?php if ( count( $audio ) >= 2 ) { echo 's'; } else { echo ' -'; } ?>
    								<?php foreach ( $audio as $attachment_id => $attachment ) : ?>
    									<li>
    										<div id='mediaspace-<?php echo wp_get_attachment_link( $attachment_id, '' , false, false, ' '); ?>'></div>
    											<script type='text/javascript'>
    											var so = new SWFObject('https://yoursite.com/wp-content/plugins/auto-attachments/includes/jw/player.swf','ply','470','24','9','#000000');
    												so.addParam('allowfullscreen','false');
    												so.addParam('allowscriptaccess','always');";
    												so.addParam('wmode','opaque');";
    												so.addVariable('file','<?php echo wp_get_attachment_url( $attachment_id, 'full' ); ?>');";
    												so.write('mediaspace-<?php echo wp_get_attachment_link( $attachment_id, '' , false, false, ' '); ?>');";
    												</script>
    												<span class='mp3title'><?php echo $attachment->post_title; ?></span>";
    									</li>
    								<?php endforeach; ?>
    							<?php endif; ?>
    							</ul>
    						</div>
    						<div class="entry-content">
    							<?php if ( has_post_thumbnail() ) : ?>
    								<?php the_post_thumbnail( 'sermon-archive', array( 'class' => 'alignright' ) ); ?>
    							<?php endif; ?>
    							<?php the_content( __( 'View Sermon →', 'it-l10n-builder-block-church' ) ); ?>
    						</div>
    					</div>
    
    					<?php comments_template(); // include comments template ?>
    				<?php endwhile; // end of one post ?>
    			</div>
    
    			<div class="loop-footer">
    				<!-- Previous/Next page navigation -->
    				<div class="loop-utility clearfix">
    					<div class="alignleft"><?php previous_posts_link( __( '? Previous Sermon', 'it-l10n-builder-block-church' ) ); ?></div>
    					<div class="alignright"><?php next_posts_link( __( 'Next Sermon ?', 'it-l10n-builder-block-church' ) ); ?></div>
    				</div>
    			</div>
    		</div>
    	<?php else : // do not delete ?>
    		<?php do_action( 'builder_template_show_not_found' ); ?>
    	<?php endif; // do not delete ?>
    <?php
    }
    
    add_action( 'builder_layout_engine_render_content', 'render_content' );
    do_action( 'builder_layout_engine_render', basename( __FILE__ ) );
    Thread Starter rwwood

    (@rwwood)

    No, that doesn’t change anything. I still am not getting the player. Don’t spend a lot of time on this, though as I think I’ve found another solution.

    Thanks.

    Plugin Author Serkan Algur

    (@kaisercrazy)

    OK then

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Plugin: Auto Attachments] Need to insert mp3 player on page created by plugin’ is closed to new replies.