本文整理汇总了PHP中AZLib::strippedLink方法的典型用法代码示例。如果您正苦于以下问题:PHP AZLib::strippedLink方法的具体用法?PHP AZLib::strippedLink怎么用?PHP AZLib::strippedLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AZLib
的用法示例。
在下文中一共展示了AZLib::strippedLink方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: filter_link
function filter_link($link, $text)
{
if ($text = AZLib::trimSpace(AZLib::plainText($text))) {
$text = AZLib::strippedLink($text);
if (strpos($link, 'http://enbac.com') === 0 || strpos($link, 'http://www.enbac.com') === 0 || strpos($link, 'enbac.com') === 0 || strpos($link, 'http://') === false) {
return "<a href=\"{$link}\" target=\"_blank\">{$text}</a>";
} else {
if (strpos($link, 'http://blog.enbac.com') === 0 || strpos($link, 'blog.enbac.com') === 0 || strpos($link, 'http://') === false) {
return "<a href=\"{$link}\" target=\"_blank\">{$text}</a>";
} else {
if (strpos($link, 'http://help.enbac.com') === 0 || strpos($link, 'help.enbac.com') === 0 || strpos($link, 'http://') === false) {
return "<a href=\"{$link}\" target=\"_blank\">{$text}</a>";
}
}
}
return "<a href=\"#\" rel=\"nofollow\" target=\"_blank\">...</a>";
}
return '';
}
示例2: edit_user_info
//.........这里部分代码省略.........
$output = 'Chức năng này đang được bổ sung. Ấn F5 để tải lại trang.';
if ($info == 'blast') {
$input = array('blast' => $value);
$userblast = ' ' . AZLib::BBCode(AZLib::cleanHtml($value));
if (strpos($userblast, 'http://')) {
$user_blast = $userblast;
while (strpos($user_blast, 'http://')) {
$tmp = substr($user_blast, strpos($user_blast, 'http://'));
if (strpos($tmp, ' ') || strpos($tmp, '<')) {
if (strpos($tmp, ' ') && strpos($tmp, '<') && strpos($tmp, ' ') > strpos($tmp, '<')) {
$blast_url = substr($tmp, 0, strpos($tmp, '<'));
} else {
$blast_url = substr($tmp, 0, strpos($tmp, ' '));
}
} else {
$blast_url = $tmp;
}
$user_blast = str_replace($blast_url, '', $user_blast);
}
$new_blast_url = ' <a href="' . $blast_url . '" target="_blank">Click here</a>';
$userblast = substr($user_blast . $new_blast_url, 1);
}
$user = User::getUser($user_id);
if ($value) {
//blast không trống
if ($value != $user['blast']) {
//Thay đổi blast
DB::delete("feed", "user_id={$user_id} AND type = 8");
//thêm vào feed cho các thành viên theo đuôi
DB::query("INSERT INTO \tfeed \t(type, \tuser_id, act_user_id, time)\r\n VALUES\t(8,\t\t{$user_id}, {$user_id}, " . TIME_NOW . ")");
}
} else {
//Xoá blast
DB::delete("feed", "user_id={$user_id} AND type = 8");
}
$output = $userblast . ' <img src="style/images/icon/icon_edit.gif" title="Click để sửa..." alt="Click để sửa..." class="hand_point" rel="blast" align="absmiddle">';
} elseif ($info == 'address') {
$input = array('address' => trim($value));
$output = AZLib::word_limit($value, 12, '');
} elseif ($info == 'mobile_phone') {
$value = preg_replace("/[^0-9]/", "", $value);
if (!AZLib::is_mobile($value)) {
$value = '';
}
$input = array('mobile_phone' => trim($value));
$output = AZLib::word_limit($value, 10, '');
} elseif ($info == 'home_phone') {
if (User::have_permit(ADMIN_USER) || User::$current->data['phone_verify'] == 0) {
$value = preg_replace("/[^0-9]/", "", $value);
if (AZLib::is_mobile($value) || substr($value, 0, 1) != "0") {
$value = '';
}
$input = array('home_phone' => trim($value));
$output = AZLib::word_limit($value, 10, '');
}
} elseif ($info == 'yahoo_id') {
$input = array('yahoo_id' => trim($value));
$output = AZLib::word_limit($value, 12, '');
} elseif ($info == 'skype_id') {
$input = array('skype_id' => trim($value));
$output = AZLib::word_limit($value, 12, '');
} elseif ($info == 'website') {
$input = array('website' => trim($value));
$website = $value;
if ($website != '') {
if (strrpos($website, 'ttp://') != 1) {
$website = 'http://' . $website;
}
if (strlen($website) > 8) {
if (strpos($website, '/', 8) > 0) {
$website = substr($website, 0, strpos($website, '/', 8));
}
}
}
$website = '<a href="' . $value . '" target="_blank" class="lineHeight18"><strong>' . AZLib::strippedLink($website, 26) . '</strong></a>';
$output = $website;
} elseif ($info == 'email' && User::is_admin()) {
$input = array('email' => trim($value));
$output = $value;
} elseif ($info == 'signature') {
$input = array('signature' => trim($value));
$output = AZLib::parseBBCode(AZLib::cleanHtml($value));
} else {
$output = '';
}
echo $output;
} else {
echo 'Nội dung có từ xấu! Click để sửa nhanh.';
exit;
}
} else {
echo 'Bạn không có quyền sửa thông tin thành viên';
exit;
}
if ($input) {
DB::Update('user', $input, "id={$user_id}");
User::getUser($user_id, 0, 1);
}
exit;
}
示例3: draw
function draw()
{
global $display;
if (isset($_POST['update'])) {
$this->on_submit();
}
$user = PersonalDB::get_user_information();
foreach ($user as $key => $value) {
if (is_string($value) and !isset($_REQUEST[$key])) {
$_REQUEST[$key] = $value;
}
}
if ($user['show_home_phone'] == 0) {
$user['show_home_phone_checked'] = '';
} else {
$user['show_home_phone_checked'] = 'checked';
}
if ($user['show_email'] == 0) {
$user['checked'] = '';
} else {
$user['checked'] = 'checked';
}
if ($user['email_alert'] == 0) {
$user['alert_email_checked'] = '';
} else {
$user['alert_email_checked'] = 'checked';
}
if ($user['birth_day']) {
$arrBirtday = explode('-', $user['birth_day']);
$user['birth_day'] = $arrBirtday['2'] . '-' . $arrBirtday['1'] . '-' . $arrBirtday['0'];
}
if ($user['avatar_url'] != "") {
$user['avatar_url'] = '<img src="' . AZLib::getImageThumb($user['avatar_url'], 100, 100, 0, $user['img_server']) . '" />';
} else {
$user['avatar_url'] = '<img src="style/images/no_avatar_item.gif" width="94" height="94" />';
}
$display->add('msg', $this->showFormErrorMessages(1));
$display->add('user', $user);
$openids = array();
$re = DB::query("SELECT id, openid_url FROM openid WHERE user_id=" . $user['id']);
if ($re) {
while ($openid = mysql_fetch_assoc($re)) {
$openid['openid'] = AZLib::strippedLink($openid['openid_url'], 48) . ' <img src="style/images/delete.gif" title="Xoá bỏ OpenID Url này khỏi tài khoản của bạn!" onclick="return del_openid(' . $openid['id'] . ');" />';
$openids[$openid['id']] = $openid;
}
}
$display->add('openids', $openids);
$display->add('can_edit_blast', User::is_admin() || !User::is_block());
$blast = User::$current->data['blast'];
$avatar_link = '';
$avatar_url = 'style/images/no_avatar_item.gif';
if (User::$current->data['avatar_url'] != '') {
$avatar_link = "http://" . CGlobal::$img_server[User::$current->data['img_server']] . User::$current->data['avatar_url'];
$avatar_url = AZLib::getImageThumb(User::$current->data['avatar_url'], 80, 80, 0, User::$current->data['img_server']);
}
if ($blast == '') {
$blast = '...';
} else {
$blast = ' ' . $blast;
if (strpos($blast, 'http://')) {
$user_blast = $blast;
while (strpos($user_blast, 'http://')) {
$tmp = substr($user_blast, strpos($user_blast, 'http://'));
if (strpos($tmp, ' ') || strpos($tmp, '<')) {
if (strpos($tmp, ' ') && strpos($tmp, '<') && strpos($tmp, ' ') > strpos($tmp, '<')) {
$blast_url = substr($tmp, 0, strpos($tmp, '<'));
} else {
$blast_url = substr($tmp, 0, strpos($tmp, ' '));
}
} else {
$blast_url = $tmp;
}
$user_blast = str_replace($blast_url, '', $user_blast);
}
$new_blast_url = ' <a rel="nofollow" href="' . $blast_url . '" target="_blank">Click here</a>';
$blast = substr($user_blast . $new_blast_url, 1);
}
}
$display->add('avatar_link', $avatar_link);
$display->add('avatar_url', $avatar_url);
$display->add('blast', $blast);
$display->add('get_cmd', Url::get('cmd'));
$display->add('get_action', Url::get('action'));
$display->add('get_page', Url::get('page'));
$display->add('url', Url::build_all());
$display->add('user_name', User::user_name());
$display->add('user_id', User::id());
$TopMenu = $display->output('TopMenu', true, 'Personal');
$display->add('TopMenu', $TopMenu);
$display->output('edit_user', false, 'Personal');
}