本文整理汇总了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;
}
}