• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP sornot函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中sornot函数的典型用法代码示例。如果您正苦于以下问题:PHP sornot函数的具体用法?PHP sornot怎么用?PHP sornot使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了sornot函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: pmpro_membership_level_profile_fields

function pmpro_membership_level_profile_fields($user)
{
    global $current_user, $pmpro_currency_symbol;
    if (!current_user_can("administrator")) {
        return false;
    }
    global $wpdb;
    /*$user->membership_level = $wpdb->get_row("SELECT l.id AS ID, l.name AS name
    		FROM {$wpdb->pmpro_membership_levels} AS l
    		JOIN {$wpdb->pmpro_memberships_users} AS mu ON (l.id = mu.membership_id)
    		WHERE mu.user_id = " . $user->ID . "
    		LIMIT 1");*/
    $user->membership_level = pmpro_getMembershipLevelForUser($user->ID);
    $levels = $wpdb->get_results("SELECT * FROM {$wpdb->pmpro_membership_levels}", OBJECT);
    if (!$levels) {
        return "";
    }
    ?>
<h3><?php 
    _e("Membership Level", "pmpro");
    ?>
</h3>
<table class="form-table">
    <?php 
    $show_membership_level = true;
    $show_membership_level = apply_filters("pmpro_profile_show_membership_level", $show_membership_level, $user);
    if ($show_membership_level) {
        ?>
		<tr>
			<th><label for="membership_level"><?php 
        _e("Current Level", "pmpro");
        ?>
</label></th>
			<td>
				<select name="membership_level" onchange="pmpro_mchange_warning();">
					<option value="" <?php 
        if (empty($user->membership_level->ID)) {
            ?>
selected="selected"<?php 
        }
        ?>
>-- <?php 
        _e("None", "pmpro");
        ?>
 --</option>
				<?php 
        foreach ($levels as $level) {
            $current_level = $user->membership_level->ID == $level->id;
            ?>
					<option value="<?php 
            echo $level->id;
            ?>
" <?php 
            if ($current_level) {
                ?>
selected="selected"<?php 
            }
            ?>
><?php 
            echo $level->name;
            ?>
</option>
				<?php 
        }
        ?>
				</select>
				<script>
					var pmpro_mchange_once = 0;
					function pmpro_mchange_warning()
					{
						if(pmpro_mchange_once == 0)
						{
							alert('Warning: The existing membership will be cancelled, and the new membership will be free.');
							pmpro_mchange_once = 1;
						}
					}
				</script>
				<?php 
        $membership_values = $wpdb->get_row("SELECT * FROM {$wpdb->pmpro_memberships_users} WHERE status = 'active' AND user_id = '" . $user->ID . "' LIMIT 1");
        if (!empty($membership_values->billing_amount) || !empty($membership_values->trial_amount)) {
            ?>
						<?php 
            if ($membership_values->billing_amount > 0) {
                ?>
							at <?php 
                echo $pmpro_currency_symbol;
                echo $membership_values->billing_amount;
                ?>
							<?php 
                if ($membership_values->cycle_number > 1) {
                    ?>
								per <?php 
                    echo $membership_values->cycle_number;
                    ?>
 <?php 
                    echo sornot($membership_values->cycle_period, $membership_values->cycle_number);
                    ?>
							<?php 
                } elseif ($membership_values->cycle_number == 1) {
                    ?>
//.........这里部分代码省略.........
开发者ID:Willislahav,项目名称:paid-memberships-pro,代码行数:101,代码来源:profile.php


示例2: _e

        }
        ?>
			</li>
		<?php 
    }
    ?>
						
		
		<?php 
    if ($level->billing_limit) {
        ?>
			<li><strong><?php 
        _e("Duration", "pmpro");
        ?>
:</strong> <?php 
        echo $level->billing_limit . ' ' . sornot($level->cycle_period, $level->billing_limit);
        ?>
</li>
		<?php 
    }
    ?>
		
		</ul>
	<?php 
}
?>

<?php 
if (pmpro_isLevelRecurring($level)) {
    ?>
	<?php 
开发者ID:6226,项目名称:wp,代码行数:31,代码来源:billing.php


示例3: _e

				<?php 
        if (!pmpro_isLevelExpiring($level)) {
            ?>
					--
				<?php 
        } else {
            ?>
		
					<?php 
            _e('After', 'pmpro');
            ?>
 <?php 
            echo $level->expiration_number;
            ?>
 <?php 
            echo sornot($level->expiration_period, $level->expiration_number);
            ?>
				<?php 
        }
        ?>
			</td>
			<td><?php 
        if ($level->allow_signups) {
            _e('Yes', 'pmpro');
        } else {
            _e('No', 'pmpro');
        }
        ?>
</td>
			<td align="center"><a href="admin.php?page=pmpro-membershiplevels&amp;edit=<?php 
        echo $level->id;
开发者ID:danielcoats,项目名称:schoolpress,代码行数:31,代码来源:membershiplevels.php


示例4: _e

        }
        ?>
				</li>
			<?php 
    }
    ?>
						
			
			<?php 
    if ($current_user->membership_level->billing_limit) {
        ?>
				<li><strong><?php 
        _e("Duration", "pmpro");
        ?>
:</strong> <?php 
        echo $current_user->membership_level->billing_limit . ' ' . sornot($current_user->membership_level->cycle_period, $current_user->membership_level->billing_limit);
        ?>
</li>
			<?php 
    }
    ?>
			
			<?php 
    if ($current_user->membership_level->enddate) {
        ?>
				<li><strong><?php 
        _e("Membership Expires", "pmpro");
        ?>
:</strong> <?php 
        echo date_i18n(get_option('date_format'), $current_user->membership_level->enddate);
        ?>
开发者ID:kaiifalcutela,项目名称:eatdk,代码行数:31,代码来源:account.php


示例5: pmpro_getLevelExpiration

	function pmpro_getLevelExpiration(&$level)
	{		
		if($level->expiration_number)
		{
			$expiration_text = "Membership expires after " . $level->expiration_number . " " . sornot(strtolower($level->expiration_period), $level->expiration_number) . ".";
		}
		else
			$expiration_text = "";
			
		$expiration_text = apply_filters("pmpro_level_expiration_text", $expiration_text, $level);
		return $expiration_text;
	}
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:12,代码来源:functions.php


示例6: billing_content_func

function billing_content_func($atts)
{
    global $wpdb, $pmpro_msg, $pmpro_msgt, $pmpro_levels, $current_user, $levels;
    //-> If a member is logged in, show them some info here (1. past invoices. 2. billing information with button to update.)
    if ($current_user->membership_level->ID) {
        if ($pmpro_msg) {
            ?>
            <div class="pmpro_message <?php 
            echo $pmpro_msgt;
            ?>
"><?php 
            echo $pmpro_msg;
            ?>
</div>
            <?php 
        }
        ?>
	
        <div class="row billing-content">
            <div class="col-md-8 col-sm-8 col-sm-offset-3 col-md-offset-3">
                <!-- BEGIN CONTENT-->
                <div id="pmpro_account">		
                    <div id="pmpro_account-membership" class="pmpro_box-first">

                        <?php 
        //wpex_logo();
        ?>
                        <!--
                        <div class="clear clearfix"></div>
                        <br/>
                        -->
                        <?php 
        $level = $current_user->membership_level->name;
        ?>
                        <p><?php 
        _e("Membership status: <strong>" . $level . "</strong>", "pmpro");
        ?>
</p>
                        <?php 
        //die(var_dump($current_user));
        ?>
                        <ul>
                            <li><strong><?php 
        _e("Level", "pmpro");
        ?>
:</strong> <?php 
        echo $current_user->membership_level->name;
        ?>
</li>
                            <?php 
        if ($current_user->membership_level->billing_amount > 0) {
            ?>
                                <li><strong><?php 
            _e("Membership Fee", "pmpro");
            ?>
:</strong>
                                    <?php 
            $level = $current_user->membership_level;
            if ($current_user->membership_level->cycle_number > 1) {
                printf(__('%s every %d %s.', 'pmpro'), pmpro_formatPrice($level->billing_amount), $level->cycle_number, pmpro_translate_billing_period($level->cycle_period, $level->cycle_number));
            } elseif ($current_user->membership_level->cycle_number == 1) {
                printf(__('%s per %s.', 'pmpro'), pmpro_formatPrice($level->billing_amount), pmpro_translate_billing_period($level->cycle_period));
            } else {
                echo pmpro_formatPrice($current_user->membership_level->billing_amount);
            }
            ?>
                                </li>
                            <?php 
        }
        ?>
						

                            <?php 
        if ($current_user->membership_level->billing_limit) {
            ?>
                                <li><strong><?php 
            _e("Duration", "pmpro");
            ?>
:</strong> <?php 
            echo $current_user->membership_level->billing_limit . ' ' . sornot($current_user->membership_level->cycle_period, $current_user->membership_level->billing_limit);
            ?>
</li>
                            <?php 
        }
        ?>

                            <?php 
        if ($current_user->membership_level->enddate) {
            ?>
                                <li><strong><?php 
            _e("Next billing date", "pmpro");
            ?>
:</strong> <?php 
            echo date_i18n(get_option('date_format'), $current_user->membership_level->enddate);
            ?>
</li>
                            <?php 
        }
        ?>

//.........这里部分代码省略.........
开发者ID:TakenCdosG,项目名称:admissionsrevolution_new,代码行数:101,代码来源:shortcode.php


示例7: if

					<?php if($level->billing_limit) { ?>(for <?php echo $level->billing_limit?> <?php echo sornot($level->cycle_period,$level->billing_limit)?>)<?php } ?>
					
				<?php } ?>
			</td>				
			<td>
				<?php if(!pmpro_isLevelTrial($level)) { ?>
					--
				<?php } else { ?>		
					<?php echo $pmpro_currency_symbol?><?php echo $level->trial_amount?> for <?php echo $level->trial_limit?> <?php echo sornot("payment",$level->trial_limit)?>
				<?php } ?>
			</td>
			<td>
				<?php if(!pmpro_isLevelExpiring($level)) { ?>
					--
				<?php } else { ?>		
					After <?php echo $level->expiration_number?> <?php echo sornot($level->expiration_period,$level->expiration_number)?>
				<?php } ?>
			</td>
			<td><?php if($level->allow_signups) { ?>Yes<?php } else { ?>No<?php } ?></td>
			<td align="center"><a href="admin.php?page=pmpro-membershiplevels&edit=<?php echo $level->id?>" class="edit">edit</a></td>
			<td align="center"><a href="admin.php?page=pmpro-membershiplevels&copy=<?php echo $level->id?>&edit=-1" class="edit">copy</a></td>
			<td align="center"><a href="javascript: askfirst('Are you sure you want to delete membership level <?php echo $level->name?>? All subscriptions will be canceled.','admin.php?page=pmpro-membershiplevels&action=delete_membership_level&deleteid=<?php echo $level->id?>'); void(0);" class="delete">delete</a></td>
		</tr>
		<?php
			}
		?>
	</tbody>
	</table>	
	<?php
	}
	?>		
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:31,代码来源:membershiplevels.php


示例8: elseif

			<?php } elseif($current_user->membership_level->cycle_number == 1) { ?>
				per <?php echo $current_user->membership_level->cycle_period?>
			<?php } ?>
			</li>
		<?php } ?>						
		
		<?php if($current_user->membership_level->billing_limit) { ?>
			<li><strong>Duration:</strong> <?php echo $current_user->membership_level->billing_limit.' '.sornot($current_user->membership_level->cycle_period,$current_user->membership_level->billing_limit)?></li>
		<?php } ?>
		
		<?php if($current_user->membership_level->enddate) { ?>
			<li><strong>Membership Expires:</strong> <?php echo date(get_option('date_format'), $current_user->membership_level->enddate)?></li>
		<?php } ?>
		
		<?php if($current_user->membership_level->trial_limit) { ?>
			Your first <?php echo $current_user->membership_level->trial_limit?> <?php echo sornot("payment",$current_user->membership_level->trial_limit)?> will cost $<?php echo $current_user->membership_level->trial_amount?>.
		<?php } ?>   

		<?php
			//the nextpayment code is not tight yet
			/*
			$nextpayment = pmpro_next_payment();
			if($nextpayment)
			{
			?>
				<li><strong>Next Invoice:</strong> <?php echo date("F j, Y", $nextpayment)?></li>
			<?php
			}
			*/
		?>
		</ul>
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:31,代码来源:account.php


示例9: if

		  {			
			?>
				<p><?php if($level->trial_amount == '0.00') { ?><strong>Free</strong><?php } else { ?><?php echo $pmpro_currency_symbol . $level->trial_amount?><?php } ?> for the next <?php echo $level->trial_limit.' ' .sornot("payment",$level->trial_limit)?>.</p>
			<?php
		  }		  
		  
		  if($level->billing_limit > 0 && $level->initial_payment > 0) 
		  {		
			?>
				<p><strong><?php echo ($level->billing_limit+1).' '.sornot("payment",($level->billing_limit+1))?></strong> total.</p>
			<?php
		  }
		  elseif($level->billing_limit)
		  {
		   ?>
				<p><strong><?php echo $level->billing_limit.' '.sornot("payment",$level->billing_limit)?></strong> total.</p>
		   <?php
		  }
		  
		  $expiration_text = pmpro_getLevelExpiration($level);
		  if($expiration_text)
		  {
		  ?>
			<p><?php echo $expiration_text?></p>
		  <?php
		  }
		?>
		</td>
		<td>
		<?php if(empty($current_user->membership_level->ID)) { ?>
			<a href="<?php echo pmpro_url("checkout", "?level=" . $level->id, "https")?>">Select</a>               
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:31,代码来源:levels.php


示例10: wp_logout_url

		<p>Logged in as <strong><?php echo $current_user->user_login?></strong>. <small><a href="<?php echo wp_logout_url(get_bloginfo("url") . "/membership-checkout/?level=" . $level->id);?>">logout</a></small></p>
		<ul>
			<li><strong>Level:</strong> <?php echo $level->name?></li>
		<?php if($level->billing_amount > 0) { ?>
			<li><strong>Membership Fee:</strong>
			<?php echo $pmpro_currency_symbol?><?php echo $level->billing_amount?>
			<?php if($level->cycle_number > 1) { ?>
				per <?php echo $level->cycle_number?> <?php echo sornot($level->cycle_period,$level->cycle_number)?>
			<?php } elseif($level->cycle_number == 1) { ?>
				per <?php echo $level->cycle_period?>
			<?php } ?>
			</li>
		<?php } ?>						
		
		<?php if($level->billing_limit) { ?>
			<li><strong>Duration:</strong> <?php echo $level->billing_limit.' '.sornot($level->cycle_period,$level->billing_limit)?></li>
		<?php } ?>
		
		<?php
			//the nextpayment code is not tight yet
			/*
			$nextpayment = pmpro_next_payment();
			if($nextpayment)
			{
			?>
				<li><strong>Next Invoice:</strong> <?php echo date(get_option('date_format'), $nextpayment)?></li>
			<?php
			}
			*/
		?>
		</ul>
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:31,代码来源:billing.php


示例11: billing_content_func

function billing_content_func($atts)
{
    global $wpdb, $pmpro_msg, $pmpro_msgt, $pmpro_levels, $current_user, $levels;
    //-> If a member is logged in, show them some info here (1. past invoices. 2. billing information with button to update.)
    if ($current_user->membership_level->ID) {
        if ($pmpro_msg) {
            ?>
            <div class="pmpro_message <?php 
            echo $pmpro_msgt;
            ?>
"><?php 
            echo $pmpro_msg;
            ?>
</div>
            <?php 
        }
        ?>
	
        <div class="row">
            <div class="col-md-8 col-sm-8 col-sm-offset-2 col-md-offset-2">
                <!-- BEGIN CONTENT-->
                <div id="pmpro_account">		
                    <div id="pmpro_account-membership" class="pmpro_box">
                        <p><?php 
        _e("Your membership is <strong>active</strong>.", "pmpro");
        ?>
</p>
                        <ul>
                            <li><strong><?php 
        _e("Level", "pmpro");
        ?>
:</strong> <?php 
        echo $current_user->membership_level->name;
        ?>
</li>
                            <?php 
        if ($current_user->membership_level->billing_amount > 0) {
            ?>
                                <li><strong><?php 
            _e("Membership Fee", "pmpro");
            ?>
:</strong>
                                    <?php 
            $level = $current_user->membership_level;
            if ($current_user->membership_level->cycle_number > 1) {
                printf(__('%s every %d %s.', 'pmpro'), pmpro_formatPrice($level->billing_amount), $level->cycle_number, pmpro_translate_billing_period($level->cycle_period, $level->cycle_number));
            } elseif ($current_user->membership_level->cycle_number == 1) {
                printf(__('%s per %s.', 'pmpro'), pmpro_formatPrice($level->billing_amount), pmpro_translate_billing_period($level->cycle_period));
            } else {
                echo pmpro_formatPrice($current_user->membership_level->billing_amount);
            }
            ?>
                                </li>
                            <?php 
        }
        ?>
						

                            <?php 
        if ($current_user->membership_level->billing_limit) {
            ?>
                                <li><strong><?php 
            _e("Duration", "pmpro");
            ?>
:</strong> <?php 
            echo $current_user->membership_level->billing_limit . ' ' . sornot($current_user->membership_level->cycle_period, $current_user->membership_level->billing_limit);
            ?>
</li>
                            <?php 
        }
        ?>

                            <?php 
        if ($current_user->membership_level->enddate) {
            ?>
                                <li><strong><?php 
            _e("Membership Expires", "pmpro");
            ?>
:</strong> <?php 
            echo date_i18n(get_option('date_format'), $current_user->membership_level->enddate);
            ?>
</li>
                            <?php 
        }
        ?>

                            <?php 
        if ($current_user->membership_level->trial_limit == 1) {
            printf(__("Your first payment will cost %s.", "pmpro"), pmpro_formatPrice($current_user->membership_level->trial_amount));
        } elseif (!empty($current_user->membership_level->trial_limit)) {
            printf(__("Your first %d payments will cost %s.", "pmpro"), $current_user->membership_level->trial_limit, pmpro_formatPrice($current_user->membership_level->trial_amount));
        }
        ?>
                        </ul>

                    </div> <!-- end pmpro_account-membership -->

                    <div id="pmpro_account-profile" class="pmpro_box hide">	
                        <?php 
        get_currentuserinfo();
//.........这里部分代码省略.........
开发者ID:TakenCdosG,项目名称:admissionsrevolution_new,代码行数:101,代码来源:shortcode_last.php



注:本文中的sornot函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP sort函数代码示例发布时间:2022-05-23
下一篇:
PHP something_wrong函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap