本文整理汇总了PHP中CKunenaLink::GetProfileURL方法的典型用法代码示例。如果您正苦于以下问题:PHP CKunenaLink::GetProfileURL方法的具体用法?PHP CKunenaLink::GetProfileURL怎么用?PHP CKunenaLink::GetProfileURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CKunenaLink
的用法示例。
在下文中一共展示了CKunenaLink::GetProfileURL方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ban
function ban()
{
$userid = JRequest::getInt('userid', 0);
$ip = JRequest::getVar('ip', '');
$block = JRequest::getInt('block', 0);
$expiration = JRequest::getString('expiration', '');
$reason_private = JRequest::getString('reason_private', '');
$reason_public = JRequest::getString('reason_public', '');
$comment = JRequest::getString('comment', '');
if (!JRequest::checkToken()) {
while (@ob_end_clean()) {
}
$this->_app->redirect(CKunenaLink::GetProfileURL($this->profile->userid, false), COM_KUNENA_ERROR_TOKEN, 'error');
return false;
}
kimport('userban');
$ban = KunenaUserBan::getInstanceByUserid($userid, true);
if (!$ban->id) {
$ban->ban($userid, $ip, $block, $expiration, $reason_private, $reason_public, $comment);
$success = $ban->save();
} else {
$delban = JRequest::getString('delban', '');
if ($delban) {
$ban->unBan($comment);
$success = $ban->save();
} else {
$ban->blocked = $block;
$ban->setExpiration($expiration, $comment);
$ban->setReason($reason_public, $reason_private);
$success = $ban->save();
}
}
if ($block) {
if ($ban->isEnabled()) {
$message = JText::_('COM_KUNENA_USER_BLOCKED_DONE');
} else {
$message = JText::_('COM_KUNENA_USER_UNBLOCKED_DONE');
}
} else {
if ($ban->isEnabled()) {
$message = JText::_('COM_KUNENA_USER_BANNED_DONE');
} else {
$message = JText::_('COM_KUNENA_USER_UNBANNED_DONE');
}
}
if (!$success) {
$this->_app->enqueueMessage($ban->getError(), 'error');
} else {
$this->_app->enqueueMessage($message);
}
$banDelPosts = JRequest::getVar('bandelposts', '');
$DelAvatar = JRequest::getVar('delavatar', '');
$DelSignature = JRequest::getVar('delsignature', '');
$DelProfileInfo = JRequest::getVar('delprofileinfo', '');
if (!empty($DelAvatar)) {
jimport('joomla.filesystem.file');
$userprofile = KunenaFactory::getUser($userid);
$this->_db->setQuery("UPDATE #__kunena_users SET avatar=null WHERE userid={$this->_db->Quote($userid)}");
$this->_db->Query();
KunenaError::checkDatabaseError();
$avatar_deleted = '';
// Delete avatar from file system
if (JFile::exists(KUNENA_PATH_AVATAR_UPLOADED . '/' . $userprofile->avatar) && !stristr($userprofile->avatar, 'gallery/')) {
JFile::delete(KUNENA_PATH_AVATAR_UPLOADED . '/' . $userprofile->avatar);
$avatar_deleted = $this->_app->enqueueMessage(JText::_('COM_KUNENA_MODERATE_DELETED_BAD_AVATAR_FILESYSTEM'));
}
$this->_app->enqueueMessage(JText::_('COM_KUNENA_MODERATE_DELETED_BAD_AVATAR') . $avatar_deleted);
}
if (!empty($DelSignature)) {
$this->_db->setQuery("UPDATE #__kunena_users SET signature=null WHERE userid={$this->_db->Quote($userid)}");
$this->_db->Query();
KunenaError::checkDatabaseError();
$this->_app->enqueueMessage(JText::_('COM_KUNENA_MODERATE_DELETED_BAD_SIGNATURE'));
}
if (!empty($DelProfileInfo)) {
$this->_db->setQuery("UPDATE #__kunena_users SET signature=null,avatar=null,karma=null,personalText=null,gender=0,birthdate=0000-00-00,location=null,ICQ=null,AIM=null,YIM=null,MSN=null,SKYPE=null,GTALK=null,websitename=null,websiteurl=null,rank=0,TWITTER=null,FACEBOOK=null,MYSPACE=null,LINKEDIN=null,DELICIOUS=null,FRIENDFEED=null,DIGG=null,BLOGSPOT=null,FLICKR=null,BEBO=null WHERE userid={$this->_db->Quote($userid)}");
$this->_db->Query();
KunenaError::checkDatabaseError();
$this->_app->enqueueMessage(JText::_('COM_KUNENA_MODERATE_DELETED_BAD_PROFILEINFO'));
}
if (!empty($banDelPosts)) {
//select only the messages which aren't already in the trash
$this->_db->setQuery("UPDATE #__kunena_messages SET hold=2 WHERE hold!=2 AND userid={$this->_db->Quote($userid)}");
$idusermessages = $this->_db->loadObjectList();
KunenaError::checkDatabaseError();
$this->_app->enqueueMessage(JText::_('COM_KUNENA_MODERATE_DELETED_BAD_MESSAGES'));
}
while (@ob_end_clean()) {
}
$this->_app->redirect(CKunenaLink::GetProfileURL($this->profile->userid, false));
}
示例2: ban
function ban() {
$app = JFactory::getApplication();
$user = KunenaFactory::getUser(JRequest::getInt ( 'userid', 0 ));
if(!$user->exists() || !JRequest::checkToken()) {
$app->redirect ( CKunenaLink::GetProfileURL($user->userid, false), COM_KUNENA_ERROR_TOKEN, 'error' );
return;
}
$ip = JRequest::getVar ( 'ip', '' );
$block = JRequest::getInt ( 'block', 0 );
$expiration = JRequest::getString ( 'expiration', '' );
$reason_private = JRequest::getString ( 'reason_private', '' );
$reason_public = JRequest::getString ( 'reason_public', '' );
$comment = JRequest::getString ( 'comment', '' );
kimport ( 'kunena.user.ban' );
$ban = KunenaUserBan::getInstanceByUserid ( $user->userid, true );
if (! $ban->id) {
$ban->ban ( $user->userid, $ip, $block, $expiration, $reason_private, $reason_public, $comment );
$success = $ban->save ();
} else {
$delban = JRequest::getString ( 'delban', '' );
if ( $delban ) {
$ban->unBan($comment);
$success = $ban->save ();
} else {
$ban->blocked = $block;
$ban->setExpiration ( $expiration, $comment );
$ban->setReason ( $reason_private, $reason_public );
$success = $ban->save ();
}
}
if ($block) {
if ($ban->isEnabled ())
$message = JText::_ ( 'COM_KUNENA_USER_BLOCKED_DONE' );
else
$message = JText::_ ( 'COM_KUNENA_USER_UNBLOCKED_DONE' );
} else {
if ($ban->isEnabled ())
$message = JText::_ ( 'COM_KUNENA_USER_BANNED_DONE' );
else
$message = JText::_ ( 'COM_KUNENA_USER_UNBANNED_DONE' );
}
if (! $success) {
$app->enqueueMessage ( $ban->getError (), 'error' );
} else {
$app->enqueueMessage ( $message );
}
$banDelPosts = JRequest::getVar ( 'bandelposts', '' );
$DelAvatar = JRequest::getVar ( 'delavatar', '' );
$DelSignature = JRequest::getVar ( 'delsignature', '' );
$DelProfileInfo = JRequest::getVar ( 'delprofileinfo', '' );
$db = JFactory::getDBO();
if (! empty ( $DelAvatar ) || ! empty ( $DelProfileInfo )) {
jimport ( 'joomla.filesystem.file' );
$avatar_deleted = '';
// Delete avatar from file system
if (JFile::exists ( JPATH_ROOT . '/media/kunena/avatars/' . $userprofile->avatar ) && !stristr($userprofile->avatar,'gallery/')) {
JFile::delete ( JPATH_ROOT . '/media/kunena/avatars/' . $userprofile->avatar );
$avatar_deleted = $app->enqueueMessage ( JText::_('COM_KUNENA_MODERATE_DELETED_BAD_AVATAR_FILESYSTEM') );
}
$user->avatar = '';
$user->save();
$app->enqueueMessage ( JText::_('COM_KUNENA_MODERATE_DELETED_BAD_AVATAR') . $avatar_deleted );
}
if (! empty ( $DelProfileInfo )) {
$user->personalText = '';
$user->birthdate = '0000-00-00';
$user->location = '';
$user->gender = 0;
$user->icq = '';
$user->aim = '';
$user->yim = '';
$user->msn = '';
$user->skype = '';
$user->gtalk = '';
$user->twitter = '';
$user->facebook = '';
$user->myspace = '';
$user->linkedin = '';
$user->delicious = '';
$user->friendfeed = '';
$user->digg = '';
$user->blogspot = '';
$user->flickr = '';
$user->bebo = '';
$user->websitename = '';
$user->websiteurl = '';
$user->signature = '';
$user->save();
$app->enqueueMessage ( JText::_('COM_KUNENA_MODERATE_DELETED_BAD_PROFILEINFO') );
} elseif (! empty ( $DelSignature )) {
$user->signature = '';
$user->save();
$app->enqueueMessage ( JText::_('COM_KUNENA_MODERATE_DELETED_BAD_SIGNATURE') );
//.........这里部分代码省略.........
示例3: trigger_dberror
if ($pid) {
echo CKunenaLink::GetAutoRedirectHTML(JRoute::_(KUNENA_LIVEURLREL . '&func=view&catid=' . $catid . '&id=' . $pid), 3500);
} else {
echo CKunenaLink::GetAutoRedirectHTML(CKunenaLink::GetProfileURL($userid), 3500);
}
} else {
if ($do == "decrease") {
$kunena_db->setQuery('UPDATE #__fb_users SET karma_time=' . $time . ' WHERE userid=' . $kunena_my->id . '');
$kunena_db->query() or trigger_dberror("Unable to update karma.");
$kunena_db->setQuery('UPDATE #__fb_users SET karma=karma-1 WHERE userid=' . $userid . '');
$kunena_db->query() or trigger_dberror("Unable to update karma.");
echo _KARMA_DECREASED . '<br /> <a href="' . JRoute::_(KUNENA_LIVEURLREL . '&func=view&catid=' . $catid . '&id=' . $pid) . '">' . _POST_CLICK . '</a>.';
if ($pid) {
echo CKunenaLink::GetAutoRedirectHTML(JRoute::_(KUNENA_LIVEURLREL . '&func=view&catid=' . $catid . '&id=' . $pid), 3500);
} else {
echo CKunenaLink::GetAutoRedirectHTML(CKunenaLink::GetProfileURL($userid), 3500);
}
} else {
//you got me there... don't know what to $do
echo _USER_ERROR_A;
echo _USER_ERROR_B . "<br /><br />";
echo _USER_ERROR_C . "<br /><br />" . _USER_ERROR_D . ": <code>fb001-karma-02NoDO</code><br /><br />";
}
}
} else {
echo _KARMA_WAIT . '<br /> ' . _KARMA_BACK . ' <a href="' . JRoute::_(KUNENA_LIVEURLREL . '&func=view&catid=' . $catid . '&id=' . $pid) . '">' . _POST_CLICK . '</a>.';
}
} else {
if ($kunena_my->id == $userid) {
if ($do == "increase") {
$kunena_db->setQuery('UPDATE #__fb_users SET karma=karma-10, karma_time=' . $time . ' WHERE userid=' . $kunena_my->id . '');
示例4: getFBGroupName
$grp = getFBGroupName($user->id);
$time = date("H:i:s", $user->time);
?>
<?php
if ($is_Moderator && $user->showOnline < 1) {
?>
<a class = "whois<?php
echo $user->moderator;
?>
<?php
echo "fb_group_" . $grp->id;
?>
" href = "<?php
echo CKunenaLink::GetProfileURL($user->id);
?>
" title = "<?php
echo $time;
?>
"> <?php
echo $user->username;
?>
</a>
<?php
}
?>
<?php
}
示例5: GetProfileLink
function GetProfileLink($fbConfig, $userid, $name, $rel = 'nofollow', $class = '')
{
if ($userid > 0) {
$link = CKunenaLink::GetProfileURL($userid);
if (!empty($link)) {
return CKunenaLink::GetHrefLink($link, $name, '', $rel, $class);
}
}
return $name;
}
示例6: GetProfileLink
function GetProfileLink($userid, $name = null, $title = '', $rel = 'nofollow', $class = '')
{
if (!$name) {
$profile = KunenaFactory::getUser($userid);
$name = htmlspecialchars($profile->getName(), ENT_COMPAT, 'UTF-8');
}
if ($userid == 0) {
$uclass = 'kwho-guest';
} else {
if (CKunenaTools::isAdmin($userid)) {
$uclass = 'kwho-admin';
} else {
if (CKunenaTools::isModerator($userid, false)) {
$uclass = 'kwho-globalmoderator';
} else {
if (CKunenaTools::isModerator($userid)) {
$uclass = 'kwho-moderator';
} else {
$uclass = 'kwho-user';
}
}
}
}
if ($userid > 0) {
$link = CKunenaLink::GetProfileURL($userid);
if (!empty($link)) {
return CKunenaLink::GetHrefLink($link, $name, $title, $rel, $uclass);
}
}
return "<span class=\"{$uclass}\">{$name}</span>";
}
示例7: __construct
//.........这里部分代码省略.........
// If JFirePHP is installed and enabled, leave a trace of the Kunena startup
if (JDEBUG == 1 && defined('JFIREPHP')) {
// FB::trace("Kunena Startup");
}
// Redirect Forum Jump
if (isset($_POST['func']) && $func == "showcat") {
header("HTTP/1.1 303 See Other");
header("Location: " . KunenaRoute::_('index.php?option=com_kunena&func=showcat&catid=' . $catid, false));
$kunena_app->close();
}
$kunena_my =& JFactory::getUser();
$kunena_db =& JFactory::getDBO();
$document = JFactory::getDocument();
$document->addScriptDeclaration('// <![CDATA[
var kunena_toggler_close = "' . JText::_('COM_KUNENA_TOGGLER_COLLAPSE') . '";
var kunena_toggler_open = "' . JText::_('COM_KUNENA_TOGGLER_EXPAND') . '";
// ]]>');
global $lang, $topic_emoticons;
// Class structure should be used after this and all the common task should be moved to this class
require_once JPATH_COMPONENT . '/class.kunena.php';
// Central Location for all internal links
require_once JPATH_COMPONENT . '/lib/kunena.link.class.php';
require_once JPATH_COMPONENT . '/lib/kunena.smile.class.php';
// Redirect profile (menu item) to the right component
if ($func == 'profile' && !$do && empty($_POST)) {
$redirect = 1;
if (!empty($active)) {
$params = new JParameter($active->params);
$redirect = $params->get('integration', 1);
}
if ($redirect) {
$profileIntegration = KunenaFactory::getProfile();
if (!$profileIntegration instanceof KunenaProfileKunena) {
$url = CKunenaLink::GetProfileURL($kunena_my->id, false);
if ($url) {
$this->redirect($url);
}
}
}
}
// Check for JSON request
if ($func == "json") {
if (JDEBUG == 1 && defined('JFIREPHP')) {
FB::log('Kunena JSON request');
}
// URL format for JSON requests: e.g: index.php?option=com_kunena&func=json&action=autocomplete&do=getcat
require_once JPATH_COMPONENT . '/lib/kunena.ajax.helper.php';
$ajaxHelper =& CKunenaAjaxHelper::getInstance();
// Get the document object.
$document =& JFactory::getDocument();
// Set the MIME type for JSON output.
$document->setMimeEncoding('application/json');
// Change the suggested filename.
if ($action != 'uploadfile') {
JResponse::setHeader('Content-Disposition', 'attachment; filename="kunena.json"');
}
$value = JRequest::getVar('value', '');
JResponse::sendHeaders();
if ($kunena_config->board_offline && !CKunenaTools::isAdmin()) {
// when the forum is offline, we don't entertain json requests
json_encode(array('status' => '0', 'error' => @sprintf(_KUNENA_FORUM_OFFLINE)));
} else {
// Generate reponse
echo $ajaxHelper->generateJsonResponse($action, $do, $value);
}
$kunena_app->close();