Support » Plugin: WP Photo Album Plus » [Plugin: WP Photo Album Plus] how can I change the link to?

  • Resolved andrewjs18

    (@andrewjs18)


    How can I change the link to so that it goes to the root of the album rather than going directly to a photo within an album? I find that to be quite annoying.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Jacob N. Breetvelt

    (@opajaap)

    What link?

    under the album settings.

    the “link to” option. is it possible to get it to link to the album itself rather than 1 photo within the album?

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    Yes, the implementation differs from the design in this aspect as i see now. I will change this in a later rev.

    Unless you specify a particular page, the coverphoto should link to the fullsize coverphoto and therefore open the album in browse mode as it does now, while the album title should link to the contents of the album, i.e. the thumbnail display.

    opajaap,

    is there a way to manaully change this now with some code edits so that the photo/album name link to the actual root of the album rather than a specific photo?

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    Look into wppa_functions.php and search for

    function wppa_album_cover()

    The new text is below. This has the link fixed, as well as fixes to the ‘View xx albumsand .. photos’ issue.
    If nothing dramatic happens, this will be the text for the next release. I suggest you change the name of the existing function (to get back if needed) and append this text to the file.
    Good luck!

    function wppa_album_cover() {
    global $album;
    global $wppa_master_occur;
    global $wppa_alt;
    
    	$coverphoto = wppa_get_coverphoto_id();
    	$photocount = wppa_get_photo_count();
    	$albumcount = wppa_get_album_count();
    	$mincount = wppa_get_mincount();
    	if (is_numeric($album['cover_linkpage']) && $album['cover_linkpage'] > 0) {
    		$page_data = get_page($album['cover_linkpage']);
    		if (!empty($page_data) && $page_data->post_status == 'publish') {
    			$href = get_page_link($album['cover_linkpage']);
    			$title = __('Link to', 'wppa');
    			$title .= ' ' . $page_data->post_title;
    		} else {
    			$href = '#';
    			$title = __('Page is not available.');
    		}
    		$href_p = $href;
    		$href_t = $href;
    		$title_p = $title;
    		$title_t = $title;
    	} elseif (is_numeric($album['cover_linkpage']) && $album['cover_linkpage'] == -1) {
    		$href = '';
    		$title = '';
    		$href_p = $href;
    		$href_t = $href;
    		$title_p = $title;
    		$title_t = $title;
    	} else {
    		if ($photocount != '0' && $photocount) {
    			$href_p = wppa_get_image_page_url_by_id($coverphoto);
    			$title_p = __('View the cover photo', 'wppa');
    			if ($photocount > 1) $title_p .= __('s', 'wppa');
    		} else {
    			$href_p = wppa_get_album_url();
    			$title_p = __('View the album', 'wppa') . ' ' . $album['name'];
    		}
    		$href_t = wppa_get_album_url();
    		$title_t = __('View the album', 'wppa') . ' ' . $album['name'];
    	}
    	$src = wppa_get_thumb_url_by_id($coverphoto);
    	$path = wppa_get_thumb_path_by_id($coverphoto);
    	$imgattr = wppa_get_imgstyle($path, get_option('wppa_smallsize'), '', 'cover');
    	$events = wppa_get_imgevents('cover');
    	$photo_left = get_option('wppa_coverphoto_left', 'no') == 'yes';
    
    	?>
    	<div id="album-<?php echo($album['id'].'-'.$wppa_master_occur) ?>" class="album wppa-box wppa-<?php echo($wppa_alt); ?>"><?php
    		if ($src != '') {
    			if ($photo_left) {
    				$photoframestyle = 'style="float:left; margin-right:5px;"';
    			}
    			else {
    				$photoframestyle = 'style="float:right; margin-left:5px;"';
    			}
    			?>
    			<div id="coverphoto_frame_<?php echo($album['id'].'_'.$wppa_master_occur) ?>" class="coverphoto-frame" <?php echo($photoframestyle) ?>><?php
    			if ($href_p != '') {
    				?>
    				<a href="<?php echo($href_p); ?>" title="<?php echo($title_p); ?>">
    					<img src="<?php echo($src); ?>" alt="<?php echo($title_p); ?>" class="image wppa-img" style="<?php echo($imgattr); ?>" <?php echo($events) ?>/>
    				</a><?php
    			} else {
    				?>
    				<img src="<?php echo($src); ?>" alt="<?php echo($title_p); ?>" class="image wppa-img" style="<?php echo($imgattr); ?>" <?php echo($events) ?>/><?php
    			}
    			?>
    			</div><!-- #coverphoto_frame_ <?php echo($album['id'].$wppa_master_occur) ?> --><?php
    		} 
    
    		if ($photo_left) {
    			$textframestyle = 'style="margin-left:'.(get_option('wppa_smallsize', '100')+17).'px;"';
    		}
    		else {
    			$textframestyle = '';
    		}
    		?>
    <div id="covertext_frame_<?php echo($album['id'].'_'.$wppa_master_occur) ?>" class="covertext-frame" <?php echo($textframestyle) ?>>
    		<h2 class="wppa-title name" style="clear:none;"><?php
    			if ($href_t != '') {
    				?>
    				<a href="<?php echo($href_t); ?>" title="<?php echo($title_t); ?>"><?php echo(stripslashes($album['name'])); ?></a><?php
    			} else {
    				echo(stripslashes($album['name']));
    			}
    		?>
    		</h2>
    		<p class="wppa-box-text wppa-black description"><?php echo(wppa_html(wppa_get_the_album_desc())); ?></p>
    		<div class="wppa-box-text wppa-black info"><?php
    			if ($photocount > $mincount && get_option('wppa_hide_slideshow', 'no') == 'no') {
    				?>
    				<a href="<?php wppa_slideshow_url(); ?>" title="<?php _e('Slideshow', 'wppa'); ?>" ><?php _e('Slideshow', 'wppa'); ?></a><?php
    			} else echo('&nbsp;');
    		?>
    		</div>
    		<div class="wppa-box-text wppa-black info"><?php
    			if ($photocount > $mincount || $albumcount) {
    				?>
    				<a href="<?php wppa_album_url(); ?>" title="<?php _e('View the album', 'wppa'); echo(' ' . $album['name']); ?>" ><?php
    				_e('View', 'wppa');
    				if ($albumcount) {
    					if ($albumcount == '1') {
    						echo(' 1 '); _e('album', 'wppa');
    					}
    					else {
    						echo(' ' . $albumcount . ' ');
    						_e('albums', 'wppa');
    					}
    				}
    				if ($photocount > $mincount && $albumcount) {
    					echo(' ');
    					_e('and', 'wppa');
    				}
    				if ($photocount > $mincount) {
    					if ($photocount == '1') {
    						echo(' 1 '); _e('photo', 'wppa');
    					}
    					else {
    						echo(' ' . $photocount . ' ');
    						_e('photos', 'wppa');
    					}
    				}
    				?>
    				</a><?php
    			}
    		?>
    		</div>
    </div>
    		<div class="clear"></div>
    	</div><!-- #album-<?php echo($album['id'].'-'.$wppa_master_occur) ?> --><?php
    	if ($wppa_alt == 'even') $wppa_alt = 'alt'; else $wppa_alt = 'even';
    }
    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    Fixed in 2.4.2

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: WP Photo Album Plus] how can I change the link to?’ is closed to new replies.