function tinypass_display_card($rid, TPPaySettings $ps) { $tags = $ps->getPremiumTagsArray(); $all = array(); $count = 0; foreach ($tags as $name) { $td = get_term_by('name', $name, 'post_tag'); $count += $td->count; $td = get_term_by('name', $name, 'story_tag'); if ($td) { $count += $td->count; } } ?> <div class="paywall-card"> <div class="slider"> <form> <?php wp_nonce_field('enable_paywall', 'tinypass_nonce'); ?> <input type="hidden" name="tinypass[rid]" value="<?php echo $rid; ?> "> <?php echo tinypass_slider('tinypass[en]', array('Off' => '0', 'On' => '1'), $ps->getEnabled()); ?> </form> </div> <div class="type"> <?php echo "{$ps->getModeName()} ({$ps->getModeNameReal()}) "; ?> </div> <div class="title"> <?php echo $ps->getResourceName(); ?> </div> <div class="footer"> <div class="leftcol"> <div class="section"> <div class="label"><?php _e("Content"); ?> </div> <div class="value"><?php echo $count; ?> Items</div> </div> <div class="section"> <div class="label"><?php _e("Tags"); ?> </div> <div class="value"><?php _e($ps->getPremiumTags(',')); ?> </div> </div> <div class="section"> <div class="label"><?php _e("RID"); ?> </div> <div class="value"> <?php echo $ps->getResourceId(); ?> <a onclick="tinypass.showEditRIDPopup('<?php echo esc_js($ps->getResourceId()); ?> ');return false;"> <img class="edit-bundle"> </a> </div> </div> <div class="clear"></div> </div> <div class="action"> <a class="button" href="admin.php?page=TinyPassEditPaywall&rid=<?php echo $rid; ?> ">Edit</a> </div> <div class="clear"></div> </div> </div> <div id="tp-edit-rid-dialog" style="display:none"> <form method="post" action="" onsubmit="return false;"> <div class="info"> <p> This is the Resource ID (RID) to your paywall and all of its content. You can refer to it on your Tinypass publisher dashboard. </p> <p> <b>Warning:</b> Changing your ResourceID will result in paid users losing access to their content. </p> </div> <input type="hidden" id="rid" name="tinypass[rid]"> <input type="text" id="value" name="tinypass[value]"> <?php wp_nonce_field('update_rid', 'tinypass_nonce'); ?> <br> <br> <br> <div style="text-align: center"> <a class="button" onclick="tinypass.updateRID(this);return false;">Save</a> <a class="button" onclick="tinypass.closeEditRIDPopup();return false;">Cancel</a> </div> </form> </div> <?php }
/** * Show the metered content section */ function __tinypass_appeal_display(TPPaySettings $ps) { $num_views = $ps->getAppealNumViews(5); $freq = $ps->getAppealFrequency(2); $msg1 = esc_attr(stripslashes($ps->getAppealMessage1())); $msg2 = esc_attr(stripslashes($ps->getAppealMessage2())); ?> <div class="tp-section"> <div class="info"> <div class="heading">Add an appeal pop-up</div> <div class="slider"> <?php echo tinypass_slider('tinypass[app_en]', array('Off' => '0', 'On' => '1'), $ps->getAppealEnabled()); ?> <div class="clear"></div> <br> </div> <div class="desc">During the preview periods, you can trigger a lightbox overlay that asks users to purchase or subscribe. Pick what it says, how it looks, and when it appears. </div> <div class="image"> <img src="<?php echo TINYPASS_IMAGE_DIR; ?> /support-appeal.png"> </div> </div> <div class="body"> <div class="postbox"> <h3><?php _e('When it appears'); ?> </h3> <div class="inside"> <div id="" class="tp-appeal-config"> <div class="inline-label">Pop-up the appeal after </div> <input type="text" size="3" maxlength="3" name="tinypass[app_views]" value="<?php echo $num_views; ?> "> <div class="inline-label">views, then continue to show it every </div> <input type="text" size="3" maxlength="3" name="tinypass[app_freq]" value="<?php echo $freq; ?> "> <div class="inline-label"> views until the preview period ends</div> </div> </div> <h3><?php _e('Add some messaging'); ?> </h3> <div class="inside"> <div class="label">Enter a header</div> <input id="tp_pd_denied_msg1" name="tinypass[app_msg1]" value="<?php echo $msg1; ?> " size="60" maxlength="80"> <br> <div class="label">Enter a description</div> <textarea id="tp_pd_denied_sub1" rows="3" cols="59" name="tinypass[app_msg2]"><?php echo $msg2; ?> </textarea> </div> <!-- <h3><?php _e('Create a custom appeal design'); ?> </h3> <div class="inside"> <div class=""> Override the default appeal design by creating a custom template file <br> <br> <?php echo get_template_directory(); ?> /<b>tinypass_appeal_display.php</b> </div> </div> --> </div> </div> <div class="clear"></div> </div> <?php }