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

PHP getUserName函数代码示例

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

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



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

示例1: plist

 /**
  * 测试计划列表
  */
 public function plist()
 {
     //如果caseid不为空,则直接id查询,其他查询条件不生效
     $planId = $this->_get('plan_id');
     if (!empty($planId)) {
         $condition['id'] = trim($planId);
     } else {
         $desc = $this->_get('plan_desc');
         if (!empty($desc)) {
             $condition['desc'] = array('like', '%' . $desc . '%');
         }
         $owner = $this->_get('owner');
         if (!empty($owner)) {
             $condition['userId'] = getUserIdByName(trim($owner));
         }
     }
     $new = $this->merge($condition);
     $page = $this->getPaging('Plan', $new);
     $paging = $page->show();
     $this->assign('paging', $paging);
     $plans = D('Plan')->where($new)->order('updateTime desc')->limit($page->firstRow . ',' . $page->listRows)->select();
     //添加username作为返回信息
     foreach ($plans as $plan) {
         $plan['caseCount'] = count(explode(",", $plan['caseIds']));
         $plan['username'] = getUserName($plan['userId']);
         $data[] = $plan;
     }
     $this->assign('plans', $data);
     $this->display();
 }
开发者ID:john1688,项目名称:BAT,代码行数:33,代码来源:PlanAction.class.php


示例2: getContact

function getContact($idContact)
{
    //Realiza el query en la base de datos
    $mysqli = makeSqlConnection();
    $sql = "SELECT * FROM contacts a LEFT JOIN contacts_cstm ac ON a.id = ac.id_c WHERE id = '{$idContact}'";
    $res = $mysqli->query($sql);
    $rows = array();
    while ($r = mysqli_fetch_assoc($res)) {
        $obj = (object) $r;
        $obj->email_address = getEmail($idContact);
        $obj->idAccount = getAccountId($idContact);
        $obj->nameAccount = getAccountName($obj->idAccount);
        $obj->reports_to_name = getContactName($obj->reports_to_id);
        $obj->created_by_name = getUserName($obj->created_by);
        $obj->modified_user_name = getUserName($obj->modified_user_id);
        $obj->assigned_user_name = getUserName($obj->user_id_c);
        $obj->nameCampaign = getCampaignName($obj->campaign_id);
        $a = (array) $obj;
        $rows[] = $a;
    }
    if (empty($rows)) {
        return '{"results" :[]}';
    } else {
        //Convierte el arreglo en json y lo retorna
        $temp = json_encode(utf8ize($rows));
        return '{"results" :' . $temp . '}';
    }
}
开发者ID:ekutor,项目名称:hermes,代码行数:28,代码来源:getContact.php


示例3: replaceRelatedUser

 public function replaceRelatedUser()
 {
     $related_user = unserialize($_SESSION['_widget_related_user']);
     if (empty($related_user)) {
         echo '0';
     } else {
         $html = '';
         $limit = min(intval($_POST['limit']), count($related_user));
         for ($i = 1; $i <= $limit; $i++) {
             $shifted_user = array_shift($related_user);
             $html .= '<li id="related_user_' . $shifted_user['uid'] . '">';
             $html .= '<div class="userPic">';
             $html .= '<a title="" href="' . U("home/Space/index", array("uid" => $shifted_user['uid'])) . '">';
             $html .= '<img src="' . getUserFace($shifted_user['uid'], 'm') . '" card="1">';
             $html .= '</a>';
             $html .= '</div>';
             $html .= '<div class="interest_info">';
             $html .= '<p><a href="' . U("home/Space/index", array("uid" => $shifted_user['uid'])) . '">' . getUserName($shifted_user['uid']) . '</a></p>';
             $html .= '<p><a href="javascript:void(0);" class="guanzhu" onclick="subscribe(' . $shifted_user['uid'] . ')">加关注</a></p>';
             $html .= '<p class="cGray2">' . $shifted_user['reason'] . '</p>';
             $html .= '</div>';
             $html .= '</li>';
         }
         $_SESSION['_widget_related_user'] = serialize($related_user);
         echo $html;
     }
 }
开发者ID:armebayelm,项目名称:thinksns-vietnam,代码行数:27,代码来源:WidgetAction.class.php


示例4: getDatasForTemplate

 function getDatasForTemplate($event, $options = array())
 {
     global $CFG_GLPI;
     $this->datas['##notinfocom.entity##'] = Dropdown::getDropdownName('glpi_entities', $options['entities_id']);
     $this->datas['##lang.notinfocom.entity##'] = __('Entity');
     $events = $this->getAllEvents();
     $this->datas['##lang.notinfocom.title##'] = $events[$event];
     $this->datas['##lang.notinfocom.name##'] = __('Name');
     $this->datas['##lang.notinfocom.urlname##'] = __('URL');
     $this->datas['##lang.notinfocom.computertype##'] = __('Type');
     $this->datas['##lang.notinfocom.operatingsystem##'] = __('Operating system');
     $this->datas['##lang.notinfocom.state##'] = __('Status');
     $this->datas['##lang.notinfocom.location##'] = __('Location');
     $this->datas['##lang.notinfocom.urluser##'] = __('URL');
     $this->datas['##lang.notinfocom.urlgroup##'] = __('URL');
     $this->datas['##lang.notinfocom.user##'] = __('User');
     $this->datas['##lang.notinfocom.group##'] = __('Group');
     foreach ($options['notinfocoms'] as $id => $notinfocom) {
         $tmp = array();
         $tmp['##notinfocom.urlname##'] = urldecode($CFG_GLPI["url_base"] . "/index.php?redirect=computer_" . $notinfocom['id']);
         $tmp['##notinfocom.name##'] = $notinfocom['name'];
         $tmp['##notinfocom.computertype##'] = Dropdown::getDropdownName("glpi_computertypes", $notinfocom['computertypes_id']);
         $tmp['##notinfocom.operatingsystem##'] = Dropdown::getDropdownName("glpi_operatingsystems", $notinfocom['operatingsystems_id']);
         $tmp['##notinfocom.state##'] = Dropdown::getDropdownName("glpi_states", $notinfocom['states_id']);
         $tmp['##notinfocom.location##'] = Dropdown::getDropdownName("glpi_locations", $notinfocom['locations_id']);
         $tmp['##notinfocom.urluser##'] = urldecode($CFG_GLPI["url_base"] . "/index.php?redirect=user_" . $notinfocom['users_id']);
         $tmp['##notinfocom.urlgroup##'] = urldecode($CFG_GLPI["url_base"] . "/index.php?redirect=group_" . $notinfocom['groups_id']);
         $tmp['##notinfocom.user##'] = getUserName($notinfocom['users_id']);
         $tmp['##notinfocom.group##'] = Dropdown::getDropdownName("glpi_groups", $notinfocom['groups_id']);
         $tmp['##notinfocom.contact##'] = $notinfocom['contact'];
         $this->datas['notinfocoms'][] = $tmp;
     }
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:33,代码来源:notificationtargetinfocomalert.class.php


示例5: pdfMain

 static function pdfMain(PluginPdfSimplePDF $pdf, KnowbaseItem $item)
 {
     global $DB;
     $ID = $item->getField('id');
     if (!Session::haveRight('knowbase', 'r') || !Session::haveRight('faq', 'r')) {
         return false;
     }
     $knowbaseitemcategories_id = $item->getField('knowbaseitemcategories_id');
     $fullcategoryname = Html::clean(getTreeValueCompleteName("glpi_knowbaseitemcategories", $knowbaseitemcategories_id));
     $question = Html::clean(Toolbox::unclean_cross_side_scripting_deep(html_entity_decode($item->getField('name'), ENT_QUOTES, "UTF-8")));
     $answer = Html::clean(Toolbox::unclean_cross_side_scripting_deep(html_entity_decode($item->getField('answer'), ENT_QUOTES, "UTF-8")));
     $pdf->setColumnsSize(100);
     if (Toolbox::strlen($fullcategoryname) > 0) {
         $pdf->displayTitle('<b>' . __('Category name') . '</b>');
         $pdf->displayLine($fullcategoryname);
     }
     if (Toolbox::strlen($question) > 0) {
         $pdf->displayTitle('<b>' . __('Subject') . '</b>');
         $pdf->displayText('', $question, 5);
     } else {
         $pdf->displayTitle('<b>' . __('No question found', 'pdf') . '</b>');
     }
     if (Toolbox::strlen($answer) > 0) {
         $pdf->displayTitle('<b>' . __('Content') . '</b>');
         $pdf->displayText('', $answer, 5);
     } else {
         $pdf->displayTitle('<b>' . __('No answer found') . '</b>');
     }
     $pdf->setColumnsSize(50, 15, 15, 10, 10);
     $pdf->displayTitle(__('Writer'), __('Creation date'), __('Last update'), __('FAQ'), _n('View', 'Views', 2));
     $pdf->displayLine(getUserName($item->fields["users_id"]), Html::convDateTime($item->fields["date"]), Html::convDateTime($item->fields["date_mod"]), Dropdown::getYesNo($item->fields["is_faq"]), $item->fields["view"]);
     $pdf->displaySpace();
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:33,代码来源:knowbaseitem.class.php


示例6: doFollowRelatedUser

 public function doFollowRelatedUser()
 {
     $_POST['uid'] = intval($_POST['uid']);
     if (0 == $_POST['uid']) {
         echo 0;
     } else {
         D('Follow', 'weibo')->dofollow($this->mid, $_POST['uid']);
         $related_user = unserialize($_SESSION['related_user']);
         if (empty($related_user)) {
             echo '';
             return;
         } else {
             $shifted_user = array_shift($related_user);
             $_SESSION['related_user'] = serialize($related_user);
             $html = '';
             $html .= '<li id="related_user_' . $shifted_user . '">';
             $html .= '<span class="userPic"><a title="" href="' . U("home/Space/index", array("uid" => $shifted_user)) . '">';
             $html .= '<img src="' . getUserFace($shifted_user, 's') . '" card="1">';
             $html .= '</a></span>';
             $html .= '<div class="name"><a href="' . U("home/Space/index", array("uid" => $shifted_user)) . '">' . getUserName($shifted_user) . '</a></div>';
             $html .= '<div><a href="javascript:void(0);" class="cGray2" onclick="subscribe(' . $shifted_user . ');">加关注</a></div>';
             $html .= '</li>';
             echo $html;
         }
     }
 }
开发者ID:laiello,项目名称:thinksns-2,代码行数:26,代码来源:WidgetAction.class.php


示例7: getDatasForTemplate

 function getDatasForTemplate($event, $options = array())
 {
     global $CFG_GLPI;
     if ($event == 'AlertNotValidatedTypology') {
         $this->datas['##typology.entity##'] = Dropdown::getDropdownName('glpi_entities', $options['entities_id']);
         $this->datas['##lang.typology.entity##'] = __('Entity');
         $this->datas['##typology.action##'] = __('Elements not match with the typology', 'typology');
         $this->datas['##lang.typology.name##'] = PluginTypologyTypology::getTypeName(1);
         $this->datas['##lang.typology.itemtype##'] = __('Type');
         $this->datas['##lang.typology.items_id##'] = __('Name');
         $this->datas['##lang.typology.error##'] = __('Error');
         $this->datas['##lang.typology.url##'] = __('Link to the typology', 'typology');
         $this->datas['##lang.typology.itemurl##'] = __('Link to the element', 'typology');
         $this->datas['##lang.typology.itemuser##'] = __('User');
         $this->datas['##lang.typology.itemlocation##'] = __('Location');
         foreach ($options['items'] as $id => $item) {
             $tmp = array();
             $tmp['##typology.name##'] = $item['name'];
             $itemtype = new $item['itemtype']();
             $itemtype->getFromDB($item["items_id"]);
             $tmp['##typology.itemtype##'] = $itemtype->getTypeName();
             $tmp['##typology.items_id##'] = $itemtype->getName();
             $tmp['##typology.error##'] = PluginTypologyTypology_Item::displayErrors($item['error'], false);
             $tmp['##typology.url##'] = urldecode($CFG_GLPI["url_base"] . "/index.php?redirect=plugin_typology_" . $item['plugin_typology_typologies_id']);
             $tmp['##typology.itemurl##'] = urldecode($CFG_GLPI["url_base"] . "/index.php?redirect=" . Toolbox::strtolower($item['itemtype']) . "_" . $item["items_id"]);
             $tmp['##typology.itemuser##'] = getUserName($itemtype->fields["users_id"]);
             $tmp['##typology.itemlocation##'] = Dropdown::getDropdownName("glpi_locations", $itemtype->fields['locations_id']);
             $this->datas['typologyitems'][] = $tmp;
         }
     }
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:31,代码来源:notificationtargettypology.class.php


示例8: insert

 function insert()
 {
     //Fantasy新加上的这句判断,为了在home页添加好友用
     if ($_POST['id'] != '') {
         $friendId = $_POST['id'];
     } else {
         $friendId = $this->uid;
     }
     $userId = $this->mid;
     $dao = D('UserFriend');
     $result1 = $dao->addFriend($friendId, $userId);
     $result2 = $dao->addFriend($userId, $friendId);
     if ($result1 > 0 && $result2 > 0) {
         //记录动态,发送通知
         /* add_user_feed */
         $feedTitle = "和 <a href=\"/Space/index/id/{$friendId}\">" . getUserName($friendId) . "</a> 成为好友";
         $this->addUserFeed($userId, 'add', 'friend', $friendId, $feedTitle);
         /* /add_user_feed */
         /* add_user_feed */
         $feedTitle = "和 <a href=\"/Space/index/id/{$userId}\">" . getUserName($userId) . "</a> 成为好友";
         $this->addUserFeed($friendId, 'add', 'friend', $userId, $feedTitle);
         /* /add_user_feed */
         $this->addUserAlert($friendId, "makeFriend");
         //$this->success("你们已经成为好朋友!");
         //echo true;
         $this->myAjaxRetrun(true);
     } else {
         //$this->error("添加好友失败!");
         //echo false;
         $this->myAjaxRetrun(false);
     }
 }
开发者ID:skiman100,项目名称:thinksns,代码行数:32,代码来源:FriendAction.class.php


示例9: renderGroupPosts

function renderGroupPosts($groupPosts, $db)
{
    echo '<div class="scrollContainer">';
    foreach ($groupPosts as $a) {
        ?>
 <div class="post">

      <h4><a href="/?page=viewProfile&amp;id=<?php 
        echo $a['userId'];
        ?>
"><?php 
        echo getUserName($a['userId'], $db);
        ?>
</a></h4>
      <p><?php 
        echo $a['content'];
        ?>
</p>
      <a class="timestamp"><?php 
        echo $a['timestamp'];
        ?>
</a>
      <?php 
        if ($a['admin'] == 1) {
            echo "<span class='postTag'>Announcement<span>";
        }
        ?>
    </div> <?php 
    }
    echo '</div>';
}
开发者ID:ruslan-a,项目名称:teamworker,代码行数:31,代码来源:postHandler.php


示例10: pdfForTicket

 static function pdfForTicket(PluginPdfSimplePDF $pdf, Ticket $ticket)
 {
     global $CFG_GLPI, $DB;
     $pdf->setColumnsSize(100);
     $pdf->displayTitle("<b>" . __('Approvals for the ticket') . "</b>");
     if (!Session::haveRight('validate_request', 1) && !Session::haveRight('validate_incident', 1) && !Session::haveRight('create_incident_validation', 1) && !Session::haveRight('create_request_validation', 1)) {
         return false;
     }
     $ID = $ticket->getField('id');
     $query = "SELECT *\n                FROM `glpi_ticketvalidations`\n                WHERE `tickets_id` = '" . $ticket->getField('id') . "'\n                ORDER BY submission_date DESC";
     $result = $DB->query($query);
     $number = $DB->numrows($result);
     if ($number) {
         $pdf->setColumnsSize(20, 19, 21, 19, 21);
         $pdf->displayTitle(_x('item', 'State'), __('Request date'), __('Approval requester'), __('Approval date'), __('Approver'));
         while ($row = $DB->fetch_assoc($result)) {
             $pdf->setColumnsSize(20, 19, 21, 19, 21);
             $pdf->displayLine(TicketValidation::getStatus($row['status']), Html::convDateTime($row["submission_date"]), getUserName($row["users_id"]), Html::convDateTime($row["validation_date"]), getUserName($row["users_id_validate"]));
             $tmp = trim($row["comment_submission"]);
             $pdf->displayText("<b><i>" . sprintf(__('%1$s: %2$s'), __('Request comments') . "</i></b>", empty($tmp) ? __('None') : $tmp, 1));
             if ($row["validation_date"]) {
                 $tmp = trim($row["comment_validation"]);
                 $pdf->displayText("<b><i>" . sprintf(__('%1$s: %2$s'), __('Approval comments') . "</i></b>", empty($tmp) ? __('None') : $tmp, 1));
             }
         }
     } else {
         $pdf->displayLine(__('No item found'));
     }
     $pdf->displaySpace();
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:30,代码来源:ticketvalidation.class.php


示例11: doaddcomment

 function doaddcomment($uid, $post, $api = false)
 {
     $data['uid'] = $uid;
     $data['reply_comment_id'] = intval($post['reply_comment_id']);
     $data['weibo_id'] = intval($post['weibo_id']);
     $data['content'] = $post['content'];
     $data['ctime'] = time();
     $miniInfo = D('Weibo')->where('weibo_id=' . $data['weibo_id'])->find();
     if ($data['reply_comment_id']) {
         $replyInfo = $this->where('comment_id=' . $data['reply_comment_id'])->find();
         $data['reply_uid'] = $replyInfo['uid'];
     } else {
         $data['reply_uid'] = $miniInfo['uid'];
         $notify['reply_type'] = 'weibo';
     }
     if ($comment_id = $this->addcomment($data)) {
         //微博回复积分操作
         if ($data['uid'] != $data['reply_uid']) {
             X('Credit')->setUserCredit($data['uid'], 'reply_weibo')->setUserCredit($data['reply_uid'], 'replied_weibo');
         }
         $data['comment'] = $miniInfo['comment'] + 1;
         $return['data'] = $data;
         $return['html'] = '<div class="position_list" id="comment_list_c_' . $comment_id . '"> <a href="' . U('home/space/index', array('uid' => $this->mid)) . '" class="pic">
         		<img class="pic30" src="' . getUserFace($uid, 's') . '" /></a>
                   <p class="list_c"><a href="#">' . getUserName($uid) . '</a> ' . getUserGroupIcon($uid) . ' : ' . formatComment($data['content'], true) . ' (刚刚)</p>
                   <div class="alR clear"><a href="javascript:void(0)" onclick="ui.confirm(this,\'确认要删除此评论?\')" callback="delComment(' . $comment_id . ')">删除</a>&nbsp;&nbsp;<a href="javascript:void(0)" onclick="reply(\'' . getUserName($uid) . '\',' . $data['weibo_id'] . ')">回复</a></div>
                 </div>';
         if ($post['transpond'] != 0) {
             if ($miniInfo['transpond_id'] != 0) {
                 $transpondData['content'] = $data['content'] . " //@" . getUserName($miniInfo['uid']) . ":" . $miniInfo['content'];
                 $transpondData['transpond_id'] = $miniInfo['transpond_id'];
                 $transpondInfo = M('weibo')->where('weibo_id=' . $miniInfo['transpond_id'])->find();
                 $transpondData['transpond_uid'] = $transpondInfo['uid'];
             } else {
                 $transpondData['content'] = $data['content'];
                 $transpondData['transpond_id'] = $miniInfo['weibo_id'];
                 $transpondData['transpond_uid'] = $miniInfo['uid'];
             }
             $id = D('Weibo', 'weibo')->doSaveWeibo($uid, $transpondData, $post['from']);
             if ($id) {
                 //当转发的微博uid 与 回复人的uid不一致时发布@到我
                 if ($transpondData['transpond_uid'] != $data['reply_uid']) {
                     D('Weibo', 'weibo')->notifyToAtme($id, $transpondData['content'], $transpondData['transpond_uid']);
                 } else {
                     D('Weibo', 'weibo')->notifyToAtme($id, $transpondData['content'], $transpondData['transpond_uid'], false);
                 }
             }
         }
         //添加统计
         Model('UserCount')->addCount($data['reply_uid'], 'comment');
         if ($api) {
             return true;
         } else {
             return json_encode($return);
         }
     } else {
         return '0';
     }
 }
开发者ID:laiello,项目名称:thinksns-2,代码行数:59,代码来源:CommentModel.class.php


示例12: _following

 public function _following($param)
 {
     $uid = $param['uid'];
     $data['uname'] = getUserName($uid);
     $data['list'] = D('Follow', 'weibo')->getList($uid, "following", 0, null, 6);
     $this->assign($data);
     $this->display('following');
 }
开发者ID:armebayelm,项目名称:thinksns-vietnam,代码行数:8,代码来源:SpaceFollowAddons.class.php


示例13: prepareComment

function prepareComment($msg, $timestamp, $uid, $cid, $event_id)
{
    $date = formatDate($timestamp);
    // $time = formatDate($timestamp);
    $name = getUserName($uid);
    $msg = formatMsg($msg);
    $delbtn = deleteBtnComment($cid, $uid, $event_id);
    return "<div class='eventComment'>\n                <span style='font-size:50%;'>\n                    <span>{$date}</span>\n                    &nbsp;&nbsp;\n                    |\n                    &nbsp;&nbsp;\n                    <span style='font-size:75%;'>\n                        {$name}</span>\n                    </span>\n                    <span>\n                        {$delbtn}\n                        </span>\n                <br />\n                <span class='eventCommentText'>\n                    " . strip_tags($msg) . "\n                </span>\n            </div>\n            ";
}
开发者ID:nainapjj,项目名称:waanoo,代码行数:9,代码来源:get_event_comments.php


示例14: writeLog

 function writeLog($gid, $uid, $content, $type = 'topic')
 {
     $map['gid'] = $gid;
     $map['uid'] = $uid;
     $map['type'] = $type;
     $map['content'] = "<a href='__TS__/space/{$uid}'>" . getUserName($uid) . "</a> " . $content;
     $map['ctime'] = time();
     $this->add($map);
 }
开发者ID:wangping1987,项目名称:dhfriendluck,代码行数:9,代码来源:LogModel.class.php


示例15: writeLog

 function writeLog($gid, $uid, $content, $type = 'topic')
 {
     $map['gid'] = $gid;
     $map['uid'] = $uid;
     $map['type'] = $type;
     $map['content'] = getUserSpace($uid, 'fn', '_blank', '@' . getUserName($uid)) . ' ' . $content;
     $map['ctime'] = time();
     $this->add($map);
 }
开发者ID:songhongyu,项目名称:THINKSNS,代码行数:9,代码来源:LogModel.class.php


示例16: getAnswer

 public function getAnswer()
 {
     $value = $this->getValue();
     if ($this->fields['values'] == 'User') {
         return getUserName($value);
     } else {
         return Dropdown::getDropdownName(getTableForItemType($this->fields['values']), $value);
     }
 }
开发者ID:jcr0ch4,项目名称:formcreator,代码行数:9,代码来源:dropdown-field.class.php


示例17: viewVote

 public function viewVote()
 {
     $id = intval($this->data["id"]);
     $data['vote'] = M("Vote")->where(array('id' => $id))->find();
     $data['vote']['name'] = getUserName($data['vote']['uid']);
     $data['vote_opts'] = D("VoteOpt")->where("vote_id = {$id}")->order("id asc")->findAll();
     $data['vote_users'] = D('VoteUser')->where("vote_id = {$id} AND opts<>'' ")->findAll();
     return $data;
 }
开发者ID:songhongyu,项目名称:THINKSNS,代码行数:9,代码来源:VoteApi.class.php


示例18: applyWeiba

 /**
  * 申请加入微吧
  * @param unknown $uid
  * @param unknown $weiba_id
  * @param string $reason
  * @return string|Ambigous <string, number>
  */
 public function applyWeiba($uid, $weiba_id, $reason = '')
 {
     $rtn['status'] = 0;
     if (empty($uid)) {
         $rtn['info'] = '请先登录';
         return $rtn;
     }
     if (empty($weiba_id)) {
         $rtn['info'] = '请选择微吧';
         return $rtn;
     }
     //判断微吧是否解散了
     $weiba = D('weiba')->where('is_del=0 and status=1 and weiba_id=' . $weiba_id)->find();
     if (!$weiba) {
         $rtn['info'] = '该圈子还未被审核或已被解散';
         return $rtn;
     }
     if ($weiba['is_verify'] == 0) {
         $rtn['info'] = '圈子公开,无需加入';
         return $rtn;
     }
     if (M('weiba_follow')->where(array('weiba_id' => $weiba_id, 'follower_uid' => $uid))->find()) {
         $rtn['info'] = '你已加入该圈子,无需在申请';
         return $rtn;
     }
     //是否已经申请未超过一天
     $isExist = $this->where(array('uid' => $uid, 'weiba_id' => $weiba_id))->find();
     if ($isExist && $isExist['status'] == 0 && $isExist['ctime'] > time() - 86400) {
         $rtn['info'] = '申请等待审核中';
         return $rtn;
     }
     //加入申请列表
     $data['uid'] = $uid;
     $data['weiba_id'] = $weiba_id;
     $data['reason'] = $reason;
     $data['status'] = 0;
     $data['ctime'] = time();
     $rst = $isExist ? $this->where(array('uid' => $uid, 'weiba_id' => $weiba_id))->save($data) : $this->add($data);
     if ($rst) {
         //读取管理员
         $adminMap['weiba_id'] = array('eq', $weiba_id);
         $adminMap['level'] = array('in', array('2', '3'));
         $weibaAdmin = M('weiba_follow')->where($adminMap)->field('follower_uid,level')->select();
         if ($weibaAdmin) {
             $admin_ids = getSubByKey($weibaAdmin, 'follower_uid');
             //添加消息提示
             $this->addApplyNotice($admin_ids, '“' . getUserName($uid) . '”申请加入加入“' . $weiba['weiba_name'] . '”圈子,赶快去看看吧', $uid, $weiba_id);
         }
         $rtn['info'] = '申请已提交,等待审核中';
         $rtn['status'] = 1;
         return $rtn;
     } else {
         $rtn['info'] = '申请失败';
         return $rtn;
     }
 }
开发者ID:songhongyu,项目名称:THINKSNS,代码行数:63,代码来源:WeibaCommonApplyModel.class.php


示例19: rank

 function rank()
 {
     $list = D('check_info')->where('ctime>' . strtotime(date('Ymd')))->order('ctime asc')->limit(5)->findAll();
     foreach ($list as &$v) {
         $avatar = model('Avatar')->init($v['uid'])->getUserAvatar();
         $v['avatar'] = $avatar['avatar_big'];
         $v['uname'] = getUserName($v['uid']);
     }
     return $list;
 }
开发者ID:songhongyu,项目名称:THINKSNS,代码行数:10,代码来源:CheckinApi.class.php


示例20: IsHotList

function IsHotList()
{
    //读取推荐列表
    $votes = M('vote')->where(' isHot="1" ')->order('rTime DESC')->limit(20)->findAll();
    foreach ($votes as &$value) {
        $value['username'] = getUserName($value['uid']);
        $value['title'] = getShort($value['title'], 12 - strlen($value['username']) / 2);
    }
    return $votes;
}
开发者ID:lyhiving,项目名称:icampus,代码行数:10,代码来源:common.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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