Example #1
0
 function index_action()
 {
     if ($this->config['sy_linksq'] == "1") {
         header("location:" . Url('error'));
     }
     if ($_POST['submit']) {
         session_start();
         if (md5($_POST['authcode']) != $_SESSION['authcode']) {
             unset($_SESSION['authcode']);
             $this->ACT_layer_msg("验证码不正确!", 8, $_SERVER['HTTP_REFERER']);
         }
         $data['link_name'] = trim($_POST['title']);
         $data['link_url'] = $_POST['url'];
         $data['link_type'] = $_POST['type'];
         $data['link_time'] = mktime();
         if ($_POST['phototype'] != '') {
             $data['img_type'] = $_POST['phototype'];
             if ($_POST['phototype'] == 1) {
                 $upload = $this->upload_pic("upload/friend/", false);
                 $pictures = $upload->picture($_FILES['uplocadpic'], false);
                 $data['pic'] = $pictures;
             } else {
                 $data['pic'] = $_POST['uplocadpic'];
             }
         }
         $M = $this->MODEL("link");
         $nbid = $M->AddLink($data);
         isset($nbid) ? $this->ACT_layer_msg("请等待管理员审核!", 9, $_SERVER['HTTP_REFERER']) : $this->ACT_layer_msg("添加失败!", 8, $_SERVER['HTTP_REFERER']);
     }
     $this->seo("friend");
     $this->yun_tpl(array('index'));
 }
Example #2
0
 function index_action()
 {
     $urlarr = array("c" => "pl", "page" => "{{page}}");
     $pageurl = Url('member', $urlarr);
     $rows = $this->get_page("company_msg", "`cuid`='" . $this->uid . "'", $pageurl, "10");
     if (is_array($rows)) {
         foreach ($rows as $k => $v) {
             $uid[] = $v['uid'];
         }
         $uid = pylode(",", $uid);
         $user = $this->obj->DB_select_all("resume", "`uid` in ({$uid})", "`uid`,`name`");
         foreach ($rows as $k => $v) {
             foreach ($user as $val) {
                 if ($v['uid'] == $val['uid']) {
                     $rows[$k]['name'] = $val['name'];
                 }
             }
         }
     }
     $this->yunset("rows", $rows);
     $com = $this->obj->DB_select_once("company", "`uid`='" . $this->uid . "'");
     if ($com['pl_time'] && $com['pl_time'] > time()) {
         $this->yunset("pl_time", '1');
     }
     $this->obj->update_once("company_msg", array("status" => (int) $_POST['status']), array("id" => (int) $_POST['id']));
     $this->yunset("com", $com);
     $this->public_action();
     $this->yunset("js_def", 7);
     $this->com_tpl('pl');
 }
Example #3
0
/**
 * Writes the search box to the page.
 *
 * @param array The parameters passed into the function. This currently takes no parameters.
 * @param Smarty The smarty object rendering the template.
 * @return The url.
 */
function smarty_function_searchbox($Params, &$Smarty)
{
    $Form = Gdn::Factory('Form');
    $Form->InputPrefix = '';
    $Result = $Form->Open(array('action' => Url('/search'), 'method' => 'get')) . $Form->TextBox('Search', array('placeholder' => T('Search'))) . $Form->Button('Go', array('Name' => '')) . $Form->Close();
    return $Result;
}
Example #4
0
 function index_action()
 {
     $this->public_action();
     $urlarr["c"] = "search";
     $where = "`uid`='" . $this->uid . "'";
     if ($_GET['keyword']) {
         $where .= " and name like '%" . $_GET['keyword'] . "%'";
         $urlarr['keyword'] = $_GET['keyword'];
     }
     $urlarr["page"] = "{{page}}";
     $pageurl = Url('member', $urlarr);
     $rows = $this->get_page("company_job", $where, $pageurl, "10", "`id`,`name`,`state`,`sdate`,`edate`,`lastupdate`,`jobhits`");
     if (is_array($rows) && !empty($rows)) {
         foreach ($rows as $v) {
             $jobid[] = $v['id'];
         }
         $jobrows = $this->obj->DB_select_all("userid_job", "`job_id` in (" . pylode(',', $jobid) . ")");
         if (is_array($jobrows)) {
             foreach ($jobrows as $v) {
                 $jobnum[$v['job_id']]++;
             }
         }
     }
     $this->company_satic();
     $this->yunset("jobnum", $jobnum);
     $this->yunset("js_def", 3);
     $this->com_tpl('search');
 }
   /**
    * Check a password against a stored password.
    *
    * The stored password can be plain, a md5 hash or a phpass hash.
    * If the password wasn't a phppass hash, the Weak property is set to True.
    *
    * @param string $Password
    * @param string $StoredHash
    * @param string $Method
    * @param string $Username
    * @return boolean
    */
   function CheckPassword($Password, $StoredHash, $Method = FALSE, $Username = NULL) {
      $Result = FALSE;
		switch(strtolower($Method)) {
         case 'django':
            $Result = $this->CheckDjango($Password, $StoredHash);
            break;
         case 'phpbb':
            require_once(PATH_LIBRARY.'/vendors/phpbb/phpbbhash.php');
            $Result = phpbb_check_hash($Password, $StoredHash);
            break;
         case 'reset':
            throw new Gdn_UserException(sprintf(T('You need to reset your password.', 'You need to reset your password. This is most likely because an administrator recently changed your account information. Click <a href="%s">here</a> to reset your password.'), Url('entry/passwordrequest')));
            break;
         case 'smf':
            $Result = (sha1(strtolower($Username).$Password) == $StoredHash);
            break;
			case 'vbulletin':
            // assume vbulletin's password hash has a fixed length of 32, the salt length will vary between version 3 and 4
            $SaltLength = strlen($StoredHash) - 32;
            $Salt = trim(substr($StoredHash, -$SaltLength, $SaltLength));
            $VbStoredHash = substr($StoredHash, 0, strlen($StoredHash) - $SaltLength);
            
				$VbHash = md5(md5($Password).$Salt);
				$Result = $VbHash == $VbStoredHash;
				break;
			case 'vanilla':
			default:
				$Result = $this->CheckVanilla($Password, $StoredHash);
		}
		
		return $Result;
   }
Example #6
0
 function index_action()
 {
     $this->public_action();
     $urlarr = array("c" => "job", "page" => "{{page}}");
     if ($_GET['w'] >= 0) {
         $where = " and state='" . (int) $_GET['w'] . "' and `edate`>'" . time() . "'";
         $urlarr['w'] = $_GET['w'];
     }
     $pageurl = Url('member', $urlarr);
     $rows = $this->get_page("company_job", "`uid`='" . $this->uid . "' " . $where, $pageurl, '10');
     if (is_array($rows) && !empty($rows)) {
         foreach ($rows as $k => $v) {
             $rows[$k]['jobnum'] = $this->obj->DB_select_num("userid_job", "`job_id`='" . $v['id'] . "' and `com_id`='" . $this->uid . "'");
         }
     }
     $urgent = $this->config['com_urgent'];
     $this->yunset("rows", $rows);
     $this->yunset("urgent", $urgent);
     $this->company_satic();
     $this->yunset("js_def", 3);
     if (intval($_GET['w']) == 1) {
         $this->com_tpl('joblist');
     } else {
         $this->com_tpl('job');
     }
 }
 public function UserController_TempBan_Create($Sender, $Args)
 {
     $Sender->Permission('Garden.Moderation.Manage');
     $UserID = (int) GetValue('0', $Args);
     $Unban = (bool) GetValue('1', $Args);
     $User = Gdn::UserModel()->GetID($UserID, DATASET_TYPE_ARRAY);
     if (!$User) {
         throw NotFoundException($User);
     }
     $UserModel = Gdn::UserModel();
     if ($Sender->Form->AuthenticatedPostBack()) {
         if ($Unban) {
             $UserModel->Unban($UserID, array('RestoreContent' => $Sender->Form->GetFormValue('RestoreContent')));
         } else {
             $Minutes = $Sender->Form->GetValue('TempBanPeriodMinutes');
             $Hours = $Sender->Form->GetValue('TempBanPeriodHours');
             $Days = $Sender->Form->GetValue('TempBanPeriodDays');
             $Months = $Sender->Form->GetValue('TempBanPeriodMonths');
             $Years = $Sender->Form->GetValue('TempBanPeriodYears');
             if (!(empty($Minutes) && empty($Hours) && empty($Days) && empty($Months) && empty($Years))) {
                 $AutoExpirePeriod = Gdn_Format::ToDateTime(strtotime("+{$Years} years {$Months} months {$Days} days {$Hours} hours {$Minutes} minutes"));
             } else {
                 $Sender->Form->AddError('ValidateRequired', 'Ban Period');
             }
             if (!ValidateRequired($Sender->Form->GetFormValue('Reason'))) {
                 $Sender->Form->AddError('ValidateRequired', 'Reason');
             }
             if ($Sender->Form->GetFormValue('Reason') == 'Other' && !ValidateRequired($Sender->Form->GetFormValue('ReasonText'))) {
                 $Sender->Form->AddError('ValidateRequired', 'Reason Text');
             }
             if ($Sender->Form->ErrorCount() == 0) {
                 if ($Sender->Form->GetFormValue('Reason') == 'Other') {
                     $Reason = $Sender->Form->GetFormValue('ReasonText');
                 } else {
                     $Reason = $Sender->Form->GetFormValue('Reason');
                 }
                 Gdn::Locale()->SetTranslation('HeadlineFormat.Ban', FormatString('{RegardingUserID,You} banned {ActivityUserID,you} until {BanExpire, date}.', array('BanExpire' => $AutoExpirePeriod)));
                 $UserModel->Ban($UserID, array('Reason' => $Reason));
                 $UserModel->SetField($UserID, 'BanExpire', $AutoExpirePeriod);
             }
         }
         if ($Sender->Form->ErrorCount() == 0) {
             // Redirect after a successful save.
             if ($Sender->Request->Get('Target')) {
                 $Sender->RedirectUrl = $Sender->Request->Get('Target');
             } else {
                 $Sender->RedirectUrl = Url(UserUrl($User));
             }
         }
     }
     $Sender->SetData('User', $User);
     $Sender->AddSideMenu();
     $Sender->Title($Unban ? T('Unban User') : T('Temporary Ban User'));
     if ($Unban) {
         $Sender->View = 'Unban';
     } else {
         $Sender->View = $this->ThemeView('tempban');
     }
     $Sender->Render();
 }
 function index_action()
 {
     $group = $this->obj->DB_select_all("evaluate_group", "`keyid`='0'", "`id`,`name`");
     $arr = array();
     foreach ($group as $val) {
         $arr[$val['id']] = $val['name'];
     }
     $search_list[] = array("param" => "keyid", "name" => '试卷类别', "value" => $arr);
     $where = "1 and `keyid`!='0'";
     if ($_GET['evaluate_search'] && trim($_GET['keyword'])) {
         $where .= " and `name` like '%" . trim($_GET['keyword']) . "%'";
         $urlarr['evaluate_search'] = $_GET['evaluate_search'];
         $urlarr['keyword'] = trim($_GET['keyword']);
     }
     if ((int) $_GET['keyid']) {
         $where .= " and `keyid`='" . (int) $_GET['keyid'] . "'";
         $urlarr['keyid'] = (int) $_GET['keyid'];
     }
     if ($_GET['order']) {
         $where .= " order by " . $_GET['t'] . " " . $_GET['order'];
         $urlarr['order'] = $_GET['order'];
         $urlarr['t'] = $_GET['t'];
     } else {
         $where .= " order by id desc";
     }
     $urlarr['order'] = $_GET['order'];
     $urlarr['page'] = "{{page}}";
     $pageurl = Url($_GET['m'], $urlarr, 'admin');
     $rows = $this->get_page("evaluate_group", $where, $pageurl, $this->config['sy_listnum'], "`id`,`keyid`,`name`,`sort`,`ctime`");
     $this->yunset($rows);
     $this->yunset("arr", $arr);
     $this->yunset("search_list", $search_list);
     $this->yunset("get_type", $_GET);
     $this->yuntpl(array('admin/admin_evaluate_list'));
 }
Example #9
0
 function index_action()
 {
     include CONFIG_PATH . "db.data.php";
     $this->yunset("arr_data", $arr_data);
     $this->public_action();
     $statis = $this->company_satic();
     $urlarr = array("c" => "com", "page" => "{{page}}");
     $pageurl = Url('member', $urlarr);
     if ($statis['vip_etime'] > time()) {
         $statis['vip_time'] = date("Y年m月d日", $statis['vip_etime']);
     } else {
         $statis['vip_time'] = "已过期";
     }
     $statis[integral] = number_format($statis[integral]);
     $this->yunset("statis", $statis);
     $rows = $this->get_page("company_order", "uid='" . $this->uid . "' and `type`='1' order by id desc", $pageurl, "10");
     $this->yunset("rows", $rows);
     $allprice = $this->obj->DB_select_once("company_pay", "`com_id`='" . $this->uid . "' and `type`='1' and `order_price`<0", "sum(order_price) as allprice");
     if ($allprice['allprice'] == '') {
         $allprice['allprice'] = '0';
     }
     $this->yunset("integral", number_format(str_replace("-", "", $allprice['allprice'])));
     $this->yunset("js_def", 4);
     $this->com_tpl('com');
 }
Example #10
0
 function index_action()
 {
     $where = "`name` like '%" . $_GET['keyword'] . "%'";
     $urlarr = array("c" => "searchcom", "page" => "{{page}}");
     $pageurl = Url('member', $urlarr);
     $rows = $this->get_page("company", $where, $pageurl, "10");
     if (is_array($rows)) {
         include PLUS_PATH . "/city.cache.php";
         foreach ($rows as $v) {
             $c_uid[] = $v['uid'];
         }
         $black = $this->obj->DB_select_all("blacklist", "`p_uid`='" . $this->uid . "' and `c_uid` in (" . pylode(",", $c_uid) . ")");
         foreach ($rows as $k => $v) {
             $rows[$k]['provinceid'] = $city_name[$v['provinceid']];
             $rows[$k]['cityid'] = $city_name[$v['cityid']];
             foreach ($black as $val) {
                 if ($v['uid'] == $val['c_uid']) {
                     $rows[$k]['status'] = "1";
                 }
             }
         }
     }
     $this->yunset("rows", $rows);
     $this->public_action();
     $this->user_tpl('searchcom');
 }
 public function Authenticate()
 {
     $ForeignIdentityUrl = C('Garden.Authenticator.AuthenticateURL');
     if (!$ForeignIdentityUrl) {
         return FALSE;
     }
     try {
         $Response = $this->_GetForeignCredentials($ForeignIdentityUrl);
         if (!$Response) {
             throw new Exception();
         }
         $SQL = Gdn::Database()->SQL();
         $Provider = $SQL->Select('uap.AuthenticationKey, uap.AssociationSecret')->From('UserAuthenticationProvider uap')->Get()->FirstRow(DATASET_TYPE_ARRAY);
         if (!$Provider) {
             throw new Exception();
         }
         // Got a response from the remote identity provider
         $UserEmail = ArrayValue('Email', $Response);
         $UserName = ArrayValue('Name', $Response);
         $UserName = trim(preg_replace('/[^a-z0-9-]+/i', '', $UserName));
         $AuthResponse = $this->ProcessAuthorizedRequest($Provider['AuthenticationKey'], $UserEmail, $UserName);
         if ($AuthResponse == Gdn_Authenticator::AUTH_SUCCESS) {
             Gdn::Request()->WithRoute('DefaultController');
         } elseif ($AuthResponse == Gdn_Authenticator::AUTH_PARTIAL) {
             Redirect(Url('/entry/handshake/proxy', TRUE), 302);
         } else {
             Gdn::Request()->WithRoute('DefaultController');
             throw new Exception('authentication failed');
         }
     } catch (Exception $e) {
         // Fallback to defer checking until the next session
         $this->SetIdentity(-1, FALSE);
     }
 }
Example #12
0
 function index_action()
 {
     if ($_GET[pid]) {
         $where = "`pid`='" . $_GET['pid'] . "' ";
         $urlarr['pid'] = $_GET['pid'];
         $this->yunset("pid", $_GET['pid']);
     } else {
         $where = "`pid`='0' ";
     }
     if ($_GET[name]) {
         $where .= " and `name` like '%" . $_GET['name'] . "%' ";
         $urlarr['name'] = $_GET['name'];
         $this->yunset("name", $_GET['name']);
     }
     if ($_GET['order']) {
         $where .= " order by " . $_GET['t'] . " " . $_GET['order'];
         $urlarr['order'] = $_GET['order'];
         $urlarr['t'] = $_GET['t'];
     } else {
         $where .= " order by id desc";
     }
     $urlarr['page'] = "{{page}}";
     $pageurl = Url($_GET['m'], $urlarr, 'admin');
     $q_class = $this->get_page("q_class", $where, $pageurl, $this->config['sy_listnum']);
     $this->yunset("q_class", $q_class);
     $this->yuntpl(array('admin/admin_q_class_list'));
 }
   /**
    * @return LightOpenID
    */
   public function GetOpenID() {
      if (get_magic_quotes_gpc()) {
         foreach ($_GET as $Name => $Value) {
            $_GET[$Name] = stripslashes($Value);
         }
      }

      $OpenID = new LightOpenID();

      if (isset($_GET['url']))
         $OpenID->identity = $_GET['url'];

      $Url = Url('/entry/connect/openid', TRUE);
      $UrlParts = explode('?', $Url);
      parse_str(GetValue(1, $UrlParts, ''), $Query);
      $Query = array_merge($Query, ArrayTranslate($_GET, array('display', 'Target')));

      $OpenID->returnUrl = $UrlParts[0].'?'.http_build_query($Query);
      $OpenID->required = array('contact/email', 'namePerson/first', 'namePerson/last', 'pref/language');

      $this->EventArguments['OpenID'] = $OpenID;
      $this->FireEvent('GetOpenID');
      
      return $OpenID;
   }
Example #14
0
 function index_action()
 {
     $this->set_search();
     $where = "1";
     if ($_GET['keyword']) {
         if ($_GET['type'] == "1") {
             $where .= " AND `username` like '%" . $_GET['keyword'] . "%'";
         } else {
             $where .= " AND `content` like '%" . $_GET['keyword'] . "%'";
         }
         $urlarr['keyword'] = $_GET['keyword'];
         $urlarr['type'] = $_GET['type'];
     }
     if ($_GET['end']) {
         if ($_GET['end'] == '1') {
             $where .= " and `ctime` >= '" . strtotime(date("Y-m-d 00:00:00")) . "'";
         } else {
             $where .= " and `ctime` >= '" . strtotime('-' . $_GET['end'] . 'day') . "'";
         }
         $urlarr['end'] = $_GET['end'];
     }
     if ($_GET['order']) {
         $where .= " order by " . $_GET['t'] . " " . $_GET['order'];
         $urlarr['order'] = $_GET['order'];
         $urlarr['t'] = $_GET['t'];
     } else {
         $where .= " order by id desc";
     }
     $urlarr['status'] = $_GET['status'];
     $urlarr['order'] = $_GET['order'];
     $urlarr['page'] = "{{page}}";
     $pageurl = Url($_GET['m'], $urlarr, 'admin');
     $rows = $this->get_page("sysmsg", $where, $pageurl, $this->config['sy_listnum']);
     $this->yuntpl(array('admin/sysnews'));
 }
Example #15
0
 function com_action()
 {
     $_GET['id'] = (int) $_GET['id'];
     $urlarr['c'] = $_GET['c'];
     $urlarr['id'] = $_GET['id'];
     $urlarr['page'] = "{{page}}";
     $pageurl = Url($_GET['m'], $urlarr, 'admin');
     $rows = $this->get_page("special_com", "`sid`='" . $_GET['id'] . "'", $pageurl, $this->config['sy_listnum']);
     if ($rows && is_array($rows)) {
         $uid = array();
         foreach ($rows as $val) {
             $uid[] = $val['uid'];
         }
         $company = $this->obj->DB_select_all("company", "`uid` in(" . pylode(',', $uid) . ")", "uid,name");
         foreach ($rows as $key => $val) {
             foreach ($company as $v) {
                 if ($val['uid'] == $v['uid']) {
                     $rows[$key]['name'] = $v['name'];
                 }
             }
         }
     }
     $this->yunset("rows", $rows);
     $this->yuntpl(array('admin/admin_special_com'));
 }
 public function Add()
 {
     $this->Permission('Garden.Users.Add');
     $this->AddJsFile('user.js');
     $this->Title(T('Add User'));
     $this->AddSideMenu('dashboard/user');
     $UserModel = new UserModel();
     $RoleModel = new Gdn_Model('Role');
     $this->RoleData = $RoleModel->Get();
     $this->UserRoleData = FALSE;
     $this->User = FALSE;
     // Set the model on the form.
     $this->Form->SetModel($UserModel);
     if ($this->Form->AuthenticatedPostBack()) {
         $NewUserID = $this->Form->Save(array('SaveRoles' => TRUE));
         if ($NewUserID !== FALSE) {
             $Password = $this->Form->GetValue('Password', '');
             $UserModel->SendWelcomeEmail($NewUserID, $Password, 'Add');
             $this->StatusMessage = T('The user has been created successfully');
             $this->RedirectUrl = Url('dashboard/user');
         }
         $this->UserRoleData = $this->Form->GetFormValue('RoleID');
     }
     $this->Render();
 }
Example #17
0
 function index_action()
 {
     $where .= "`uid`='" . $this->uid . "' or (`fid`='" . $this->uid . "' and `status`<>'1') order by ctime desc";
     $urlarr["c"] = $_GET["c"];
     $urlarr["page"] = "{{page}}";
     $pageurl = Url('member', $urlarr);
     $rows = $this->get_page("friend_message", $where, $pageurl, "20");
     if (is_array($rows)) {
         foreach ($rows as $v) {
             $uids[] = $v['uid'];
             $uids[] = $v['fid'];
         }
         $statis = $this->obj->DB_select_all("friend_info", "`uid` in (" . pylode(",", $uids) . ")", "uid,nickname");
         foreach ($rows as $key => $value) {
             $rows[$key]['ctime'] = date("Y-m-d H:i", $value['ctime']);
             foreach ($statis as $k => $v) {
                 if ($value['uid'] == $v['uid']) {
                     $rows[$key]['nickname'] = $v['nickname'];
                 }
                 if ($value['fid'] == $v['uid']) {
                     $rows[$key]['name'] = $v['nickname'];
                 }
             }
         }
     }
     $this->yunset("rows", $rows);
     $this->public_action();
     $this->obj->DB_update_all("friend_message", "`remind_status`='1'", "`fid`='" . $this->uid . "' and `remind_status`='0'");
     $this->unset_remind("friend_message1", "1");
     $this->user_tpl('xin');
 }
Example #18
0
 function index_action()
 {
     $urlarr = array("c" => "look", "page" => "{{page}}");
     $pageurl = Url('member', $urlarr);
     $look = $this->get_page("look_resume", "`uid`='" . $this->uid . "' and `status`='0' order by datetime desc", $pageurl, "15");
     if (is_array($look)) {
         foreach ($look as $k => $v) {
             $com_uid[] = $v['com_id'];
             $res_uid[] = $v['resume_id'];
         }
         $resume = $this->obj->DB_select_all("resume_expect", "`id` IN (" . pylode(",", $res_uid) . ")", "id,name");
         $com = $this->obj->DB_select_all("company", "`uid` IN (" . pylode(",", $com_uid) . ")", "uid,name");
         foreach ($look as $k => $v) {
             foreach ($resume as $key => $val) {
                 if ($v['resume_id'] == $val['id']) {
                     $look[$k]['resume'] = $val['name'];
                 }
             }
             foreach ($com as $value) {
                 if ($v['com_id'] == $value['uid']) {
                     $look[$k]['com'] = $value['name'];
                 }
             }
         }
     }
     $this->yunset("js_def", 2);
     $this->yunset("look", $look);
     $this->public_action();
     $this->user_tpl('look');
 }
 function index_action()
 {
     $this->set_search();
     if ($_GET['keyword']) {
         $where = "`title` like '%" . $_GET['keyword'] . "%'";
         $urlarr['keyword'] = $_GET['keyword'];
     } else {
         $where = 1;
     }
     if ($_GET['end']) {
         if ($_GET['end'] == '1') {
             $where .= " and `datetime` >= '" . strtotime(date("Y-m-d 00:00:00")) . "'";
         } else {
             $where .= " and `datetime` >= '" . strtotime('-' . (int) $_GET['end'] . 'day') . "'";
         }
         $urlarr['end'] = $_GET['end'];
     }
     if ($_GET['order']) {
         $where .= " order by " . $_GET['t'] . " " . $_GET['order'];
         $urlarr['order'] = $_GET['order'];
         $urlarr['t'] = $_GET['t'];
     } else {
         $where .= " order by id desc";
     }
     $urlarr['page'] = "{{page}}";
     $pageurl = Url($_GET['m'], $urlarr, 'admin');
     $M = $this->MODEL();
     $announcement = $M->get_page("admin_announcement", $where, $pageurl, $this->config['sy_listnum'], '*', 'announcement');
     $this->yunset($announcement);
     $this->yuntpl(array('admin/admin_announcement_list'));
 }
Example #20
0
 function index_action()
 {
     $this->yunset($this->MODEL('cache')->GetCache(array('city', 'com')));
     $this->public_action();
     $this->member_satic();
     $urlarr = array("c" => "favorite", "page" => "{{page}}");
     $StateNameList = array('0' => '等待审核', '1' => '招聘中', '2' => '已结束', '3' => '未通过');
     $pageurl = Url('member', $urlarr);
     $rows = $this->get_page("fav_job", "`uid`='" . $this->uid . "' order by id desc", $pageurl, "20");
     $fnum = $this->obj->DB_select_num("fav_job", "`uid`='" . $this->uid . "'", "`id`");
     if ($rows && is_array($rows)) {
         foreach ($rows as $val) {
             $jobids[] = $val['job_id'];
         }
         $company_job = $this->obj->DB_select_all("company_job", "`id` in(" . pylode(',', $jobids) . ")", "`id`,`salary`,`provinceid`,`cityid`,`state`");
         foreach ($rows as $key => $val) {
             $rows[$key]['statename'] = '已关闭';
             foreach ($company_job as $v) {
                 if ($val['job_id'] == $v['id']) {
                     $rows[$key]['salary'] = $v['salary'];
                     $rows[$key]['provinceid'] = $v['provinceid'];
                     $rows[$key]['cityid'] = $v['cityid'];
                     $rows[$key]['statename'] = $StateNameList[$v['state']];
                 }
             }
         }
     }
     $num = $this->obj->DB_select_num("fav_job", "`uid`='" . $this->uid . "'");
     $this->obj->DB_update_all("member_statis", "fav_jobnum='" . $num . "'", "`uid`='" . $this->uid . "'");
     $this->yunset(array("rows" => $rows, "fnum" => $fnum));
     $this->yunset();
     $this->user_tpl('favorite');
 }
 public function base_render_before($sender)
 {
     if ($sender->MasterView == 'admin') {
         return;
     }
     //tell the browser this is a mobile style
     $sender->Head->addTag('meta', array('name' => 'viewport', 'content' => "width=device-width,minimum-scale=1.0,maximum-scale=1.0"));
     /*
             $sender->InformMessage(
                 'This message will stay here until you dismiss it!',
                 array(
                     'CssClass' => 'Dismissable',
                     'DismissCallbackUrl' => '/plugin/dismissmessage/'
                 )
             );
     */
     $sender->Head->addTag('meta', array('name' => 'theme-color', 'content' => "#C08F00"));
     // YOU CAN REMOVE FONT-AWESOME IN ONLINE-VERSION
     $sender->Head->addTag('link', array('rel' => 'stylesheet', 'href' => "https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"));
     //position of the panel
     $sender->CssClass .= c('MinusBaseline.Panel.Left', false) ? ' PanelLeft' : ' PanelRight';
     //add the hamburger menu
     $sender->addAsset('Content', anchor('n', url('#'), 'Hamburger'), 'Hamburger');
     //add the searchbox to the panel
     //copied from library/vendors/SmartyPlugins/function.searchbox.php
     $form = Gdn::factory('Form');
     $form->InputPrefix = '';
     $search = $form->open(array('action' => Url('/search'), 'method' => 'get')) . $form->textBox('Search', array('placeholder' => t('SearchBoxPlaceHolder', 'Search'))) . $form->button('Go', array('Name' => '')) . $form->close();
     $sender->addAsset('Panel', wrap($search, 'div', array('class' => 'SiteSearch')), 'SearchBox');
     //nomobile link to switch to the full site
     $sender->addAsset('Foot', Gdn_Theme::link('/', t(' '), '<div class="LogoFoot"><a href="%url" class="%class">%text</a></div>'), 'LogoFoot');
     //Add logo to button of site
     $sender->addAsset('Foot', Gdn_Theme::link('profile/nomobile', t('Full Site'), '<div class="NoMobile"><a href="%url" class="%class">%text</a></div>'), 'NoMobile');
 }
Example #22
0
function DiscussionPollAnswerForm($PollForm, $Poll, $PartialAnswers)
{
    echo '<div class="DP_AnswerForm">';
    if (GetValue('Title', $Poll) || C('Plugins.DiscussionPolls.DisablePollTitle', FALSE)) {
        echo $Poll->Title;
        if (trim($Poll->Title) != FALSE) {
            echo '<hr />';
        }
    }
    echo $PollForm->Open(array('action' => Url('/discussion/poll/submit/'), 'method' => 'post', 'ajax' => TRUE));
    echo $PollForm->Errors();
    $m = 0;
    // Render poll questions
    echo '<ol class="DP_AnswerQuestions">';
    foreach ($Poll->Questions as $Question) {
        echo '<li class="DP_AnswerQuestion">';
        echo $PollForm->Hidden('DP_AnswerQuestions[]', array('value' => $Question->QuestionID));
        echo Wrap($Question->Title, 'span');
        echo '<ol class="DP_AnswerOptions">';
        foreach ($Question->Options as $Option) {
            if (GetValue($Question->QuestionID, $PartialAnswers) == $Option->OptionID) {
                //fill in partial answer
                echo Wrap($PollForm->Radio('DP_Answer' . $m, $Option->Title, array('Value' => $Option->OptionID, 'checked' => 'checked')), 'li');
            } else {
                echo Wrap($PollForm->Radio('DP_Answer' . $m, $Option->Title, array('Value' => $Option->OptionID)), 'li');
            }
        }
        echo '</ol>';
        echo '</li>';
        $m++;
    }
    echo '</ol>';
    echo $PollForm->Close('Submit');
    echo '</div>';
}
Example #23
0
 function index_action()
 {
     $this->public_action();
     $urlarr["c"] = "zhaopinhui";
     $urlarr["page"] = "{{page}}";
     $pageurl = Url('member', $urlarr);
     $where = "`uid`='" . $this->uid . "'";
     $rows = $this->get_page("zhaopinhui_com", $where, $pageurl, "10");
     if (is_array($rows)) {
         foreach ($rows as $key => $v) {
             $zphid[] = $v['zid'];
         }
         $zphrows = $this->obj->DB_select_all("zhaopinhui", "`id` in (" . pylode(',', $zphid) . ")", "`id`,`title`,`address`");
         foreach ($rows as $k => $v) {
             foreach ($zphrows as $val) {
                 if ($v['zid'] == $val['id']) {
                     $rows[$k]['title'] = $val['title'];
                     $rows[$k]['address'] = $val['address'];
                 }
             }
         }
     }
     $this->yunset("rows", $rows);
     $this->yunset("js_def", 2);
     $this->com_tpl("zhaopinhui");
 }
Example #24
0
 /**
  * Confirmation page.
  *
  * @since 2.0.?
  * @access public
  *
  * @param string $Action Type of action.
  * @param array $LogIDs Numeric IDs of items to confirm.
  */
 public function Confirm($Action, $LogIDs = '')
 {
     $this->Permission('Garden.Moderation.Manage');
     $this->Form->InputPrefix = '';
     $this->Form->IDPrefix = 'Confirm_';
     if (trim($LogIDs)) {
         $LogIDArray = explode(',', $LogIDs);
     } else {
         $LogIDArray = array();
     }
     // We also want to collect the users from the log.
     $Logs = $this->LogModel->GetIDs($LogIDArray);
     $Users = array();
     foreach ($Logs as $Log) {
         $UserID = $Log['RecordUserID'];
         if (!$UserID) {
             continue;
         }
         $Users[$UserID] = array('UserID' => $UserID);
     }
     Gdn::UserModel()->JoinUsers($Users, array('UserID'));
     $this->SetData('Users', $Users);
     $this->SetData('Action', $Action);
     $this->SetData('ActionUrl', Url("/log/{$Action}?logids=" . urlencode($LogIDs)));
     $this->SetData('ItemCount', count($LogIDArray));
     $this->Render();
 }
Example #25
0
 function index_action()
 {
     if ($_GET['id']) {
         $id = (int) $_GET['id'];
         $gonggao = $this->obj->DB_select_once("admin_announcement", "`id`='{$id}'");
         $annou_last = $this->obj->DB_select_once("admin_announcement", "`id`<'{$id}' order by `id` desc");
         if (!empty($annou_last)) {
             $annou_last['url'] = Url('announcement', array('id' => $annou_last['id']));
         }
         $annou_next = $this->obj->DB_select_once("admin_announcement", "`id`>'{$id}' order by `id` asc");
         if (!empty($annou_next)) {
             $annou_next['url'] = Url('announcement', array('id' => $annou_next['id']));
         }
         $info = $gonggao;
         $data['gg_title'] = $gonggao['title'];
         $description = $gonggao['description'] ? $gonggao['description'] : $gonggao['content'];
         $data['gg_desc'] = $this->GET_content_desc($gonggao['description']);
         $this->data = $data;
         $info["last"] = $annou_last;
         $info["next"] = $annou_next;
         $this->yunset("Info", $info);
         $this->seo("announcement");
         $this->yun_tpl(array('show'));
     } else {
         $this->seo("announcement_index");
         $this->yun_tpl(array('index'));
     }
 }
Example #26
0
 function index_action()
 {
     $where = "`cuid`='" . $this->uid . "'";
     if ($_GET['keyword']) {
         $resume = $this->obj->DB_select_alls("resume", "resume_expect", "a.uid=b.uid and a.`r_status`<>'2' and a.`name` like '%" . $_GET['keyword'] . "%'", "a.`name`,a.`uid`,a.`sex`,a.`edu`,a.`exp`,b.`salary`,b.`job_classid`");
         if (is_array($resume)) {
             foreach ($resume as $v) {
                 $uid[] = $v['uid'];
             }
         }
         $where .= " and uid in (" . pylode(',', $uid) . ")";
         $urlarr['keyword'] = $_GET['keyword'];
     }
     $this->public_action();
     $urlarr['c'] = 'talent_pool';
     $urlarr["page"] = "{{page}}";
     $pageurl = Url('member', $urlarr);
     $rows = $this->get_page("talent_pool", "{$where}  order by id desc", $pageurl, "10");
     if (is_array($rows)) {
         if (!$_GET['keyword']) {
             if (empty($resume)) {
                 foreach ($rows as $v) {
                     $uid[] = $v['uid'];
                 }
                 $resume = $this->obj->DB_select_alls("resume", "resume_expect", "a.uid=b.uid and a.`r_status`<>'2' and a.uid in (" . pylode(',', $uid) . ")", "a.`name`,a.`uid`,a.`sex`,a.`edu`,b.`job_classid`,a.`exp`,b.`salary`");
             }
         }
         $userid_msg = $this->obj->DB_select_all("userid_msg", "`fid`='" . $this->uid . "' and `uid` in (" . pylode(",", $uid) . ")", "uid");
         if (is_array($resume)) {
             include PLUS_PATH . "user.cache.php";
             include PLUS_PATH . "job.cache.php";
             foreach ($rows as $key => $val) {
                 foreach ($resume as $va) {
                     if ($val['uid'] == $va['uid']) {
                         $rows[$key]['name'] = $va['name'];
                         $rows[$key]['sex'] = $userclass_name[$va['sex']];
                         $rows[$key]['edu'] = $userclass_name[$va['edu']];
                         $rows[$key]['exp'] = $userclass_name[$va['exp']];
                         $rows[$key]['salary'] = $userclass_name[$va['salary']];
                         if ($va['job_classid'] != "") {
                             $job_classid = @explode(",", $va['job_classid']);
                             $rows[$key]['jobname'] = $job_name[$job_classid[0]];
                         }
                     }
                 }
                 foreach ($userid_msg as $va) {
                     if ($val['uid'] == $va['uid']) {
                         $rows[$key]['userid_msg'] = 1;
                     }
                 }
             }
         }
     }
     $this->yunset("rows", $rows);
     $report = $this->config['com_report'];
     $this->yunset("report", $report);
     $this->company_satic();
     $this->yunset("js_def", 5);
     $this->com_tpl('talent_pool');
 }
Example #27
0
 public function Edit($MessageID = '')
 {
     $this->AddJsFile('js/library/jquery.autogrow.js');
     $this->AddJsFile('messages.js');
     $this->Permission('Garden.Messages.Manage');
     $this->AddSideMenu('garden/message');
     // Generate some Controller & Asset data arrays
     $this->LocationData = $this->_GetLocationData();
     $this->AssetData = $this->_GetAssetData();
     // Set the model on the form.
     $this->Form->SetModel($this->MessageModel);
     $this->Message = $this->MessageModel->GetID($MessageID);
     // Make sure the form knows which item we are editing.
     if (is_numeric($MessageID) && $MessageID > 0) {
         $this->Form->AddHidden('MessageID', $MessageID);
     }
     // If seeing the form for the first time...
     if ($this->Form->AuthenticatedPostBack() === FALSE) {
         $this->Form->SetData($this->Message);
     } else {
         if ($MessageID = $this->Form->Save()) {
             // Reset the message cache
             $this->MessageModel->SetMessageCache();
             // Redirect
             $this->StatusMessage = Gdn::Translate('Your changes have been saved.');
             $this->RedirectUrl = Url('garden/message');
         }
     }
     $this->Render();
 }
 public function __construct(&$Sender = '')
 {
     $Session = Gdn::Session();
     if (property_exists($Sender, 'Conversation')) {
         $this->Conversation = $Sender->Conversation;
     }
     $this->Form = Gdn::Factory('Form', 'AddPeople');
     // $this->Form->Action = $Sender->SelfUrl;
     // If the form was posted back, check for people to add to the conversation
     if ($this->Form->AuthenticatedPostBack()) {
         $NewRecipientUserIDs = array();
         $NewRecipients = explode(',', $this->Form->GetFormValue('AddPeople', ''));
         $UserModel = Gdn::Factory("UserModel");
         foreach ($NewRecipients as $Name) {
             if (trim($Name) != '') {
                 $User = $UserModel->GetByUsername(trim($Name));
                 if (is_object($User)) {
                     $NewRecipientUserIDs[] = $User->UserID;
                 }
             }
         }
         $Sender->ConversationModel->AddUserToConversation($this->Conversation->ConversationID, $NewRecipientUserIDs);
         // if ($Sender->DeliveryType() == DELIVERY_TYPE_ALL)
         //    Redirect('/messages/'.$this->Conversation->ConversationID);
         $Sender->StatusMessage = T('Your changes were saved.');
         $Sender->RedirectUrl = Url('/messages/' . $this->Conversation->ConversationID);
     }
     $this->_ApplicationFolder = $Sender->Application;
     $this->_ThemeFolder = $Sender->Theme;
 }
 public function DiscussionController_CommentOptions_Handler($Sender)
 {
     $Comment = $Sender->CurrentComment;
     $Session = Gdn::Session();
     $Inc = $this->GetScoreIncrements($Comment->CommentID);
     $Signs = array(-1 => 'Neg', +1 => 'Pos');
     // Create a container for the score.
     echo '<div class="CommentScore">';
     $SumScore = is_null($Comment->SumScore) ? 0 : $Comment->SumScore;
     // Write the current score.
     echo '<span class="Score">' . sprintf(Plural($SumScore, '%s point', '%s points'), $SumScore) . '</span>';
     // Write the buttons.
     foreach ($Inc as $Key => $IncAmount) {
         $Button = '<span>' . ($Key < 0 ? '-' : '+') . '</span>';
         $Attributes = array();
         $CssClass = $Signs[$Key] . ' Inc';
         $Href = '/vanilla/discussion/score/' . $Comment->CommentID . '/' . $Signs[$Key] . '/' . $Session->TransientKey() . '?Target=' . urlencode($Sender->SelfUrl);
         if ($IncAmount == 0) {
             $Attributes['href2'] = Url($Href);
             $CssClass .= ' Disabled';
             $Href = '';
         } else {
             $Attributes['title'] = ($Key > 0 ? '+' : '') . $Inc[$Key];
         }
         // Display an increment button.
         $Foo = Anchor($Button, $Href, $CssClass, $Attributes, TRUE);
         echo $Foo;
     }
     echo '</div>';
 }
Example #30
0
 function index_action()
 {
     $id = (int) $_GET['id'];
     $M = $this->MODEL('article');
     $news = $M->GetNewsBaseOnce(array('id' => $id));
     $row = $M->GetNewsContentOnce(array('nbid' => $id));
     $news['content'] = $row['content'];
     $news_last = $M->GetNewsBaseOnce(array("`id`<'" . $id . "'"), array('orderby' => " `id` desc"));
     if (!empty($news_last)) {
         if ($this->config[sy_news_rewrite] == "2") {
             $news_last["url"] = $this->config['sy_weburl'] . "/article/" . date("Ymd", $news_last["datetime"]) . "/" . $news_last['id'] . ".html";
         } else {
             $news_last["url"] = Url('article', array('c' => 'show', "id" => $news_last[id]), "1");
         }
     }
     $news_next = $M->GetNewsBaseOnce(array("`id`>'" . $id . "'"), array('orderby' => " `id` desc"));
     if (!empty($news_next)) {
         if ($this->config[sy_news_rewrite] == "2") {
             $news_next["url"] = $this->config['sy_weburl'] . "/article/" . date("Ymd", $news_next["datetime"]) . "/" . $news_next['id'] . ".html";
         } else {
             $news_next["url"] = Url('article', array('c' => 'show', "id" => $news_next[id]), "1");
         }
     }
     $class = $M->GetNewsGroupOnce(array("id" => $news['nid']));
     if ($news["keyword"] != "") {
         $keyarr = @explode(",", $news["keyword"]);
         if (is_array($keyarr) && !empty($keyarr)) {
             foreach ($keyarr as $key => $value) {
                 $sqlkeyword[] = " `keyword` LIKE '%{$value}%'";
             }
             $sqlkw = @implode(" OR ", $sqlkeyword);
             $about = $M->GetNewsBaseList(array("(" . $sqlkw . ") and `id`<>'" . $id . "'"), array("orderby" => '`id` desc ', 'limit' => 6));
             if (is_array($about)) {
                 foreach ($about as $k => $v) {
                     if ($this->config[sy_news_rewrite] == "2") {
                         $about[$k]["url"] = $this->config['sy_weburl'] . "/article/" . date("Ymd", $v["datetime"]) . "/" . $v['id'] . ".html";
                     } else {
                         $about[$k]["url"] = Url('article', array('c' => 'show', "id" => $v[id]), "1");
                     }
                 }
             }
         }
     }
     $info = $news;
     $data['news_title'] = $news['title'];
     $data['news_keyword'] = $news['keyword'];
     $data['news_class'] = $class['name'];
     $description = $news['description'] ? $news['description'] : $news['content'];
     $data['news_desc'] = $this->GET_content_desc($description);
     $this->data = $data;
     $info["news_class"] = $class['name'];
     $info["last"] = $news_last;
     $info["next"] = $news_next;
     $info["like"] = $about;
     $info['content'] = htmlspecialchars_decode($info['content']);
     $this->yunset("Info", $info);
     $this->seo("news_article");
     $this->news_tpl('show');
 }