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


PHP username函数代码示例

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


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

示例1: c

 public function c($rq = null)
 {
     $type = ['employee' => 1, 'agency' => 2, 'doctor' => 3];
     $rq = rq();
     $rq['senderid'] = uid();
     $rq['sendername'] = username();
     if (he_is('agency')) {
         $rq['org'] = sess('org');
     }
     if (he_is('employee')) {
         $rq['org'] = sess('org');
     }
     // return his_chara()[0];
     $rq['sendertype'] = $type[his_chara()[0]];
     if (his_chara()[0] == 'agency') {
         $rq['recipienttype'] = 1;
         $rq['recipientid'] = 1;
         $rq['recipientname'] = 'admin';
     } elseif (his_chara()[0] == 'employee') {
         $rq['recipienttype'] = $type[$rq['recipienttype']];
     }
     // 验证发信规则
     $valid = $this->verify($rq);
     if (!$valid) {
         return ee(2);
     }
     $rq['sendtime'] = date("Y-m-d H:i:s");
     return parent::c($rq);
 }
开发者ID:newset,项目名称:robot,代码行数:29,代码来源:IMessage.php

示例2: uploadRemoteFile

 function uploadRemoteFile($urlimage, $filename, $urlslug, $user_id = NULL)
 {
     $this->CI->output->set_header('Content-Type: application/json; charset=utf-8');
     $user_name = isset($user_id) ? username($user_id) : $this->CI->ion_auth->user()->row()->username;
     //get file info so we can check for allowed extensions
     $file_parts = pathinfo($urlimage);
     $exts = array('jpg', 'gif', 'png', 'jpeg');
     if (isset($file_parts['extension']) && in_array($file_parts['extension'], $exts)) {
         //check the exif data to ensure its a valid image type
         $image_exists = @fopen($urlimage, "r");
         if ($image_exists === false) {
             $output_array = array('validation' => 'error', 'response' => 'error', 'message' => 'Check image URL. Supplied URL does not appear to be an image.');
             $this->CI->output->set_output(json_encode($output_array));
         } else {
             fclose($image_exists);
             if (exif_imagetype($urlimage)) {
                 //send back json error for modal
                 //if folder for song does not  exist, make the folder
                 if (!file_exists(FCPATH . 'asset_uploads/' . $user_name . '/' . $urlslug)) {
                     mkdir(FCPATH . 'asset_uploads/' . $user_name . '/' . $urlslug, 0755, true);
                     file_put_contents(FCPATH . 'asset_uploads/' . $user_name . '/' . $urlslug . '/index.html', 'index.html');
                 }
                 //get the image
                 $image = file_get_contents($urlimage);
                 //save the image
                 file_put_contents(FCPATH . 'asset_uploads/' . $user_name . '/' . $urlslug . '/' . $filename . '.' . $file_parts['extension'], $image);
                 return true;
             }
         }
     } else {
         //send back json error for modal
         $output_array = array('validation' => 'error', 'response' => 'error', 'message' => 'Image filetype not supported. JPG or PNG only please!');
         $this->CI->output->set_output(json_encode($output_array));
     }
 }
开发者ID:JamesWuChina,项目名称:hhvip-ci,代码行数:35,代码来源:Images.php

示例3: login

 /**
  * 登录日志
  * @param  [type] $type [description]
  * @param  [type] $user [description]
  * @return [type]       [description]
  */
 public static function login($type, $user)
 {
     $related_id = $user->id;
     switch ($type) {
         case 'employee':
             $action_type_id = 1;
             $ins_type_id = 6;
             $memo = '员工登录';
             break;
         case 'agency':
             $action_type_id = 2;
             $ins_type_id = 5;
             $memo = '代理商登录';
             break;
         case 'department':
             $action_type_id = 3;
             $ins_type_id = 4;
             $memo = '科室登录';
             break;
         default:
             break;
     }
     $memo = $memo . '-' . username();
     Self::add_log($action_type_id, $ins_type_id, $related_id, $memo);
 }
开发者ID:newset,项目名称:robot,代码行数:31,代码来源:ILog.php

示例4: insertElement

function insertElement()
{
    if (isset($_POST['ClassificationID'])) {
        $ClassificationID = json_decode(sanitize($_POST['ClassificationID']));
    }
    if (isset($_POST['Element'])) {
        $Element = json_decode(sanitize($_POST['Element']));
    }
    if (isset($_POST['AtomicMass'])) {
        $AtomicMass = json_decode(sanitize($_POST['AtomicMass']));
    }
    $dbConn = mysqli_connect(server(), username(), password(), db("Elements"));
    if ($dbConn->connect_error) {
        die("Connection failed: " . $dbConn->connect_error);
    }
    $query = "INSERT INTO Elements ( ClassificationID, Element, AtomicMass ) " . "VALUES ( " . "" . $ClassificationID . ", " . "'" . $Element . "', " . "" . $AtomicMass . " );";
    $result = $dbConn->query($query);
    $return = new stdClass();
    $return->querystring = (string) $query;
    if ($result) {
        $return->success = true;
    } else {
        $return->success = false;
    }
    return json_encode($return);
}
开发者ID:d-retterer,项目名称:nc2016,代码行数:26,代码来源:dbInsert.php

示例5: sendNotify

function sendNotify($userid, $msg, $link, $subject = null)
{
    $umail = "noreply@wewanttotrade.com";
    $ufname = "eDart";
    $ulname = "User";
    $domail = 1;
    //PART I: Write to the database
    $con = mysqli_connect(host(), username(), password(), mainDb());
    $q = "INSERT INTO notify(`usr`,`date`,`message`,`link`) VALUES('" . mysqli_real_escape_string($con, $userid) . "','" . mysqli_real_escape_string($con, time()) . "','" . mysqli_real_escape_string($con, $msg) . "','" . mysqli_real_escape_string($con, $link) . "')";
    //Insert a new row into the author's notifications
    mysqli_query($con, $q);
    //Execute
    $user_call = new User(array("action" => "get", "id" => $userid));
    $user_info = $user_call->run(true);
    if (count($user_info) != 0) {
        $user_info = $user_info[0];
        $umail = $user_info["email"];
        $ufname = ucwords($user_info["fname"]);
        $ulname = ucwords($user_info["lname"]);
        $domail = $user_info["do_mail"];
    }
    $greetings = array("Just wanted to let you know that:<br><br> %s. <br><br>That is all. Have a good rest of your day!", "In case you didn't know: <br><br>%s<br><br> Better go check it out.", "We hope you're having a good day! Just thought you might you want to know:<br><br> %s. <br><br>That is all. Carry on!", "Don't mean to break your flow, but we just thought you might want to know that<br><br> %s. <br><br>If you get the chance, you can check it out back at eDart. For now, live long and prosper!", "Hope your day is going splendidly! Just thought we'd let you know that:<br><br> %s. <br><br>When you have the time, check it out on eDart. Cool. For now, bye.");
    $fullmsg = sprintf($greetings[rand(0, count($greetings) - 1)], $msg);
    if ($subject == null) {
        $subject = $msg;
    }
    //PART II: Send them an email
    if ($domail == 1) {
        sendMail($umail, $ufname, $ulname, $subject, $fullmsg, $link, "View on eDart");
    }
}
开发者ID:Nickersoft,项目名称:eDart,代码行数:31,代码来源:notify.php

示例6: __construct

 function __construct($type)
 {
     global $con, $table;
     $con = mysqli_connect(host(), username(), password(), mainDb());
     switch ($type) {
         case ITEM:
             $table = "item";
             break;
         case USER:
             $table = "usr";
             break;
     }
 }
开发者ID:Nickersoft,项目名称:eDart,代码行数:13,代码来源:search.php

示例7: replace

 /**
  * Function used to replace content
  * of email template with variables
  * it can either be email subject or message content
  * @param : Content STRING 
  * @param : array ARRAY => array({somevar}=>$isvar)
  */
 function replace($content, $array)
 {
     //Common Varialbs
     $com_array = array('{website_title}' => TITLE, '{baseurl}' => BASEURL, '{website_url}' => BASEURL, '{date_format}' => cbdate(DATE_FORMAT), '{date}' => cbdate(), '{username}' => username(), '{userid}' => userid(), '{date_year}' => cbdate("Y"), '{date_month}' => cbdate("m"), '{date_day}' => cbdate("d"), '{signup_link}' => cblink(array('name' => 'signup')), '{login_link}' => cblink(array('name' => 'login')));
     if (is_array($array) && count($array) > 0) {
         $array = array_merge($com_array, $array);
     } else {
         $array = $com_array;
     }
     foreach ($array as $key => $val) {
         $var_array[] = '/' . $key . '/';
         $val_array[] = $val;
     }
     return preg_replace($var_array, $val_array, $content);
 }
开发者ID:yukisky,项目名称:clipbucket,代码行数:22,代码来源:cbemail.class.php

示例8: match_class_code

 private static function match_class_code($class, $code)
 {
     $connect = mysqli_connect(host(), username(), password(), mainDb());
     if ($code) {
         $return_array = sqlToArray($connect, "SELECT `text` FROM `lookup` WHERE class={$class} AND code={$code}");
         if (count($return_array) != 0) {
             return $return_array[0]["text"];
         } else {
             return NULL;
         }
     } else {
         $return_array = sqlToArray($connect, "SELECT * FROM `lookup` WHERE class={$class}");
         return $return_array;
     }
 }
开发者ID:Nickersoft,项目名称:eDart,代码行数:15,代码来源:lookup.php

示例9: connect_db

function connect_db()
{
    # Attemt connect. Return success or fail. Catch exceptions.
    // Create connection
    //$conn = new mysqli(servername(), username(), password());
    $servername = servername();
    $username = username();
    $password = password();
    $dbname = dbname();
    //IMPROVE. Perhaps add check to see if we are already connected. Php db ping probably.
    try {
        $conn = new PDO("mysql:host={$servername};dbname={$dbname}", $username, $password);
    } catch (PDOException $e) {
        echo $e->getMessage();
        exit;
    }
    return $conn;
}
开发者ID:TheWhiskey,项目名称:BK,代码行数:18,代码来源:functions.php

示例10: login_menu

    function login_menu()
    {
        if (!is_logged()) {
            ?>
<div class='login_menu'>
<a href='login.php'>Logowanie</a>
</div>
				<?php 
        } else {
            ?>
<div class='login_menu'>
Zalogowano jako <?php 
            echo username();
            ?>
 <a href='logout.php'>wyloguj</a>
</div>
				<?php 
        }
    }
开发者ID:KMSUJ,项目名称:archive,代码行数:19,代码来源:base_site.inc.php

示例11: __construct

 function __construct($parameters)
 {
     global $con, $argv;
     $con = mysqli_connect(host(), username(), password(), mainDb());
     $argv = $parameters;
 }
开发者ID:Nickersoft,项目名称:eDart,代码行数:6,代码来源:messenger.php

示例12: username

}

</script>

<?php 
if (isset($_GET['hide_import_message'])) {
    $this->lf_core->Livefyre_Utility->update_import_status('complete');
    ?>
    <script type="text/javascript">
        window.location.href = window.location.pathname + '?page=livefyre';
    </script>
    <?php 
    exit;
}
if (isset($_POST['textfield'])) {
    echo username();
    return;
}
$import_status = get_option('livefyre_import_status', 'uninitialized');
// Handle legacy values
if ($import_status == 'csv_uploaded') {
    $import_status = 'complete';
} elseif ($import_status == 'started') {
    $import_status = 'pending';
}
// Start the animation only if the button was clicked
if ($import_status == 'pending') {
    // Only report status of the import
    ?>
    <script type="text/javascript">
        livefyre_start_ajax(1000);
开发者ID:dparks-seattletimes,项目名称:openworldstudios,代码行数:31,代码来源:settings-template.php

示例13: array

?>
</head>
<body>
<div id="header">
	<h1><?php 
echo SITE_TITLE;
?>
</h1>
	<?php 
$menuitems = array();
if ($GLOBALS["page"] != "mainMenu") {
    $menuitems[] = "<a href=\"" . SITEROOT_WEB . "\">Back to main menu</a>";
}
$menuitems[] = "<a href=\"" . SITEROOT_WEB . "eqiat\">Authoring tool</a>";
if (loggedin() && $GLOBALS["page"] != "logout") {
    $menuitems[] = "<a id=\"logoutlink\" href=\"" . SITEROOT_WEB . "?page=logout\">Log out (<strong>" . htmlspecialchars(username()) . "</strong>)</a>";
} else {
    if (!loggedin() && ($GLOBALS["page"] != "login" && !isset($_SESSION["nextpage"]))) {
        $menuitems[] = "<a href=\"" . SITEROOT_WEB . "?page=login\">Log in</a>";
    }
}
if ($GLOBALS["page"] != "help") {
    $menuitems[] = "<a href=\"" . SITEROOT_WEB . "?page=help\">Help</a>";
}
if (!empty($menuitems)) {
    ?>
		<ul id="headermenu">
			<?php 
    foreach ($menuitems as $menuitem) {
        ?>
				<li><?php 
开发者ID:rprince,项目名称:questionbank,代码行数:31,代码来源:htmlheader.php

示例14: isset

            $najdiclanok0 = isset($datacc[$najdiclanok - 1]) ? $datacc[$najdiclanok - 1] : "hide";
            $najdiclanok1 = isset($datacc[$najdiclanok + 1]) ? $datacc[$najdiclanok + 1] : "hide";
            echo '
<ul class="pager">
  ' . ($najdiclanok0 != "hide" ? '<li class="previous"><a href="/clanok/' . $najdiclanok0 . '/' . bezd(articlename($najdiclanok0)) . '">&larr; ' . ($najdiclanok1 == "hide" ? articlename($najdiclanok0) : 'Predchadzajúci článok') . '</a></li>' : '') . '
  ' . ($najdiclanok1 != "hide" ? '<li class="next"><a href="/clanok/' . $najdiclanok1 . '/' . bezd(articlename($najdiclanok1)) . '">' . articlename($najdiclanok1) . ' &rarr;</a></li>' : '') . '
</ul>
';
        }
    }
    echo '
        <div class="articleview-inside">
            <div class="info">
                <h4><a href="/clanok/' . $datacla["article_id"] . '/' . bezd($datacla["article_name"]) . '">' . $datacla["article_name"] . '</a></h4>
                <div class="infin">
                    <span><i class="fa fa-user"></i> Autor: ' . username($datacla["article_author"], 1) . '</span>
                    <span><i class="fa fa-time"></i> Dátum: <a>' . date("j. n. Y", $datacla["article_date"]) . '</a></span>
                    <span><i class="fa fa-th-list"></i> Kategória: ' . articlecat($datacla["article_cat"], 1) . '</span>
                    <span><i class="fa fa-eye"></i> Prečítané: <a>' . $datacla["article_reads"] . '</a>×</span>
                    
                </div>
                
            </div>
        </div>
';
    echo '
      <div class="articleview">   
      ' . $datacla["article_txt"];
    echo '</div>';
    ?>
<br><div class="heureka-163376503"> <div class="heureka3-content"> <div style="float: left; border: 1px solid #E2E2E2; margin: 0 15px 0 0; padding: 0; width: 50px; height: 50px;"><a href="http://grafika-a-design.heureka.sk/adobe-creative-suite-6-photoshop-extended-win-cz-dvd-pack/#c971:3" class="heureka-image-163376503"> </a></div> <div style="margin: 0; padding: 0; line-height: 1.2em;color:#888;"> <a href="http://grafika-a-design.heureka.sk/adobe-creative-suite-6-photoshop-extended-win-cz-dvd-pack/#c971:3" target="_blank">Adobe Creative Suite 6 Photoshop Extended WIN CZ DVD Pack</a> môžete kúpiť v <span class="heureka-shops-163376503"> </span> e-shopoch za cenu od <span class="heureka-price-163376503"> </span> <small>(Zdroj: Heureka.sk)</small><br /> <a href="http://grafika-a-design.heureka.sk/adobe-creative-suite-6-photoshop-extended-win-cz-dvd-pack/#c971:3" target="_blank">Porovnať ceny >></a> </div> </div> <div style="clear: both;"></div> </div> <script type="text/javascript" src="http://www.heureka.sk/direct/bannery/?id=16337650:3:971"></script><br><br>
开发者ID:Samuell1,项目名称:desart,代码行数:31,代码来源:clanok.php

示例15: dbquery

<?php

if (!defined('PERM')) {
    die;
}
?>


<div class="list-group">
<?php 
$result = dbquery("SELECT * FROM bg_forumtopicpost GROUP BY post_topicid ORDER BY post_time DESC LIMIT 0,5");
$rows1 = dbrows($result);
if ($rows1 >= "1") {
    while ($data = dbarray($result)) {
        $type = "/tema/" . $data["post_topicid"] . "/" . bezd(forumtopicname($data["post_topicid"]));
        echo '<a href="' . $type . '" class="list-group-item">' . forumtopicname($data["post_topicid"]) . '<br/><small>' . timeago($data["post_time"]) . ' od ' . username($data["post_userid"], 0) . '</small></a>';
    }
}
?>
</div>

<?php 
if (userperm("5")) {
    if (isset($_POST["editmod"])) {
        if ($_POST["modset"] == 1) {
            dbquery("DELETE FROM bg_forumtopicread WHERE forumr_tid='" . $dataf2["forumt_id"] . "'");
            dbquery("UPDATE bg_forumtopic SET forumt_locked='1',forumt_lockuserid='" . $userinfo["user_id"] . "' WHERE forumt_id='" . $dataf2["forumt_id"] . "'");
            redirect("/tema/" . $dataf2["forumt_id"] . "/" . bezd($dataf2["forumt_name"]));
        }
        if ($_POST["modset"] == 2) {
            dbquery("UPDATE bg_forumtopic SET forumt_locked='0' WHERE forumt_id='" . $dataf2["forumt_id"] . "'");
开发者ID:Samuell1,项目名称:desart,代码行数:31,代码来源:panelforum.php


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