當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。