Hi,
Disclaimer: I’m a little rusty but I think I’m doing this correctly.
I’m using a plug-in to offer vouchers to paid users - the code here instances a download link; @ $download_buttons
$download_buttons = '';
if ( 1 != $voucher->require_like ) {
$download_buttons .= '<a href="' . gtvouchers_link( $voucher->guid ) . '" class="post_img">' . $download_text . '</a>';
if ( 1 != $voucher->require_email && 'true' == $options['listing_voucher_preview'] ) {
$download_buttons .= '<a href="" class="post_img" style="margin-left:20px;" onclick="printPage(\'' . gtvouchers_link( $voucher->guid ) . '\');return false;">' . $print_text . '</a><br />';
}
} else {
$download_buttons .= $voucher->liketextcta;
$download_buttons .= '<div id="fb-root"></div>';
if ( 'true' == $options['listing_voucher_preview'] ) {
$download_buttons .= gtv_encrypt_text( '<a href="' . gtvouchers_link( $voucher->guid ) . '" class="post_img">' . $download_text . '</a> <a href="" class="post_img" style="margin-left:20px;" onclick="printPage(\'' . gtvouchers_link( $voucher->guid ) . '\');">' . $print_text . '</a>' );
} else {
$download_buttons .= gtv_encrypt_text( '<a href="' . gtvouchers_link( $voucher->guid ) . '" class="post_img">' . $download_text . '</a>' );
}
$download_buttons .= '<br />';
}
When I wrap the content like so, covering the generated link, I still have the download link visible, along with the text generated by the else statement.
$download_buttons = '';
if ( 1 != $voucher->require_like ) {
$download_buttons .= ' <?php if (current_user_can("access_s2member_level1")){ ?> <a href="' . gtvouchers_link( $voucher->guid ) . '" class="post_img">' . $download_text . '</a> <?php } else { ?>
<p>YOU MUST UPGRADE</p>
<?php } ?> ';
if ( 1 != $voucher->require_email && 'true' == $options['listing_voucher_preview'] ) {
$download_buttons .= '<a href="" class="post_img" style="margin-left:20px;" onclick="printPage(\'' . gtvouchers_link( $voucher->guid ) . '\');return false;">' . $print_text . '</a><br />';
}
} else {
$download_buttons .= $voucher->liketextcta;
$download_buttons .= '<div id="fb-root"></div>';
if ( 'true' == $options['listing_voucher_preview'] ) {
$download_buttons .= gtv_encrypt_text( '<a href="' . gtvouchers_link( $voucher->guid ) . '" class="post_img">' . $download_text . '</a> <a href="" class="post_img" style="margin-left:20px;" onclick="printPage(\'' . gtvouchers_link( $voucher->guid ) . '\');">' . $print_text . '</a>' );
} else {
$download_buttons .= gtv_encrypt_text( '<a href="' . gtvouchers_link( $voucher->guid ) . '" class="post_img">' . $download_text . '</a>' );
}
$download_buttons .= '<br />';
}
I am previewing this with a subscriber level account (0)
Can someone help me understand the hang-up?