当前位置: 首页>>代码示例>>PHP>>正文


PHP MEMBER::current_member_anywhere方法代码示例

本文整理汇总了PHP中MEMBER::current_member_anywhere方法的典型用法代码示例。如果您正苦于以下问题:PHP MEMBER::current_member_anywhere方法的具体用法?PHP MEMBER::current_member_anywhere怎么用?PHP MEMBER::current_member_anywhere使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MEMBER的用法示例。


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

示例1: manage

 public static function manage($email)
 {
     $db = new \ParlDB();
     $q = $db->query('SELECT * FROM alerts WHERE email = :email
         AND deleted != 1 ORDER BY created', array(':email' => $email));
     $out = '';
     for ($i = 0; $i < $q->rows(); ++$i) {
         $row = $q->row($i);
         $criteria = explode(' ', $row['criteria']);
         $ccc = array();
         $current = true;
         foreach ($criteria as $c) {
             if (preg_match('#^speaker:(\\d+)#', $c, $m)) {
                 $MEMBER = new \MEMBER(array('person_id' => $m[1]));
                 $ccc[] = 'spoken by ' . $MEMBER->full_name();
                 if (!$MEMBER->current_member_anywhere()) {
                     $current = false;
                 }
             } else {
                 $ccc[] = $c;
             }
         }
         $criteria = join(' ', $ccc);
         $token = $row['alert_id'] . '-' . $row['registrationtoken'];
         $action = '<form action="/alert/" method="post"><input type="hidden" name="t" value="' . $token . '">';
         if (!$row['confirmed']) {
             $action .= '<input type="submit" name="action" value="Confirm">';
         } elseif ($row['deleted'] == 2) {
             $action .= '<input type="submit" name="action" value="Resume">';
         } else {
             $action .= '<input type="submit" name="action" value="Suspend"> <input type="submit" name="action" value="Delete">';
         }
         $action .= '</form>';
         $out .= '<tr><td>' . $criteria . '</td><td align="center">' . $action . '</td></tr>';
         if (!$current) {
             $out .= '<tr><td colspan="2"><small>&nbsp;&mdash; <em>not a current member of any body covered by TheyWorkForYou</em></small></td></tr>';
         }
     }
     if ($out) {
         print '<table cellpadding="3" cellspacing="0"><tr><th>Criteria</th><th>Action</th></tr>' . $out . '</table>';
     } else {
         print '<p>You currently have no email alerts set up.</p>';
     }
 }
开发者ID:vijo,项目名称:theyworkforyou,代码行数:44,代码来源:Alert.php


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