本文整理汇总了PHP中CContact::getFirstLetters方法的典型用法代码示例。如果您正苦于以下问题:PHP CContact::getFirstLetters方法的具体用法?PHP CContact::getFirstLetters怎么用?PHP CContact::getFirstLetters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CContact
的用法示例。
在下文中一共展示了CContact::getFirstLetters方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: w2PformSafe
*/
// Let's remove the first '%' that we previously added to ContIdxWhere
$default_search_string = w2PformSafe(substr($AppUI->getState('ContIdxWhere'), '', strlen($AppUI->getState('ContIdxWhere'))), true);
$form = '<form action="./index.php" method="get" accept-charset="utf-8">' . $AppUI->_('Search for') . '
<input type="text" class="text" name="search_string" value="' . $default_search_string . '" />
<input type="hidden" name="m" value="contacts" />
<input type="submit" value=">" />
<a href="./index.php?m=contacts&search_string=0">' . $AppUI->_('Reset search') . '</a>
</form>';
// En of contact search form
$a2z = '<table cellpadding="2" cellspacing="1" border="0">';
$a2z .= '<tr>';
$a2z .= '<td width="100%" align="right">' . $AppUI->_('Show') . ': </td>';
$a2z .= '<td><a href="./index.php?m=contacts&where=0">' . $AppUI->_('All') . '</a></td>';
// Pull First Letters
$letters = CContact::getFirstLetters($AppUI->user_id);
for ($c = 65; $c < 91; $c++) {
$cu = chr($c);
$cell = !(mb_strpos($letters, $cu) === false) ? '<a href="?m=contacts&search_string=' . $cu . '">' . $cu . '</a>' : '<font color="#999999">' . $cu . '</font>';
$a2z .= '<td class="button">' . $cell . '</td>';
}
$a2z .= '</tr><tr><td colspan="28">' . $form . '</td></tr></table>';
// setup the title block
$titleBlock = new CTitleBlock('Contacts', 'monkeychat-48.png', $m, $m . '.' . $a);
$titleBlock->addCell($a2z);
if ($canEdit) {
$titleBlock->addCell('<input type="submit" class="button" value="' . $AppUI->_('new contact') . '">', '', '<form action="?m=contacts&a=addedit" method="post" accept-charset="utf-8">', '</form>');
$titleBlock->addCrumb('?m=contacts&a=csvexport&suppressHeaders=1', 'CSV Download');
$titleBlock->addCrumb('?m=contacts&a=vcardimport&dialog=0', 'Import vCard');
}
$titleBlock->show();
示例2: elseif
$AppUI->setState('UserIdxWhere', '');
} elseif (isset($_POST['search_string'])) {
$AppUI->setState('UserIdxWhere', $_POST['search_string']);
$AppUI->setState('UserIdxStub', '');
}
$stub = $AppUI->getState('UserIdxStub');
$where = $AppUI->getState('UserIdxWhere');
$where = w2PformSafe($where, true);
if (isset($_GET['orderby'])) {
$AppUI->setState('UserIdxOrderby', w2PgetParam($_GET, 'orderby', null));
}
$orderby = $AppUI->getState('UserIdxOrderby') ? $AppUI->getState('UserIdxOrderby') : 'user_username';
$orderby = $tab == 3 || $orderby != 'date_time_in' && $orderby != 'user_ip' ? $orderby : 'user_username';
// Pull First Letters
$letters = CUser::getFirstLetters();
$letters = $letters . CContact::getFirstLetters($AppUI->user_id, true);
$a2z = '<a href="./index.php?m=users&stub=0">' . $AppUI->_('All') . '</a> ';
for ($c = 65; $c < 91; $c++) {
$cu = chr($c);
$cell = !(mb_strpos($letters, $cu) === false) ? '<a href="?m=users&stub=' . $cu . '">' . $cu . '</a>' : '<font color="#999999">' . $cu . '</font>';
$a2z .= $cell . ' ';
}
// setup the title block
$titleBlock = new w2p_Theme_TitleBlock('User Management', 'icon.png', $m);
$titleBlock->addSearchCell($where);
$titleBlock->addCell($a2z);
$titleBlock->addButton('New user', '?m=users&a=addedit');
$titleBlock->show();
?>
<script language="javascript" type="text/javascript">
<?php