本文整理匯總了PHP中load::smodel方法的典型用法代碼示例。如果您正苦於以下問題:PHP load::smodel方法的具體用法?PHP load::smodel怎麽用?PHP load::smodel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類load
的用法示例。
在下文中一共展示了load::smodel方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: messages
#!/usr/bin/php -q
<?php
include_once 'core/includes.php';
load::smodel("messages");
$messages = new messages();
//Listen to incoming e-mails
$sock = fopen("php://stdin", 'r');
$email = '';
//Read e-mail into buffer
while (!feof($sock)) {
$email .= fread($sock, 1024);
}
//Close socket
fclose($sock);
//Parse "subject"
$subject1 = explode("\nSubject: ", $email);
$subject2 = explode("\n", $subject1[1]);
$subject = $subject2[0];
//Parse "to"
$to1 = explode("\nTo: ", $email);
$to2 = explode("\n", $to1[1]);
$to = str_replace('>', '', str_replace('<', '', $to2[0]));
$to = explode(" ", $to);
foreach ($to as $toField) {
if (filter_var($toField, FILTER_VALIDATE_EMAIL)) {
$to = $toField;
break;
}
}
$message1 = explode("\n\n", $email);
$start = count($message1) - 3;
示例2: hasParent
function hasParent($user = 0)
{
if (!$user) {
$user = session::get("id");
}
load::smodel("users");
$users = new users();
$info = $users->getInfo($user);
if ($info["parent_user"]) {
return true;
} else {
return false;
}
}