• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP LogPage类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中LogPage的典型用法代码示例。如果您正苦于以下问题:PHP LogPage类的具体用法?PHP LogPage怎么用?PHP LogPage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了LogPage类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: trySubmit

 function trySubmit()
 {
     global $wgOut, $wgUser;
     $errors = array();
     $ip = $this->mUnblockIP;
     if (!IP::isIPAddress($ip) && strlen($ip)) {
         $errors[] = array('globalblocking-unblock-ipinvalid', $ip);
         $ip = '';
     }
     if (0 == ($id = GlobalBlocking::getGlobalBlockId($ip))) {
         $errors[] = array('globalblocking-notblocked', $ip);
     }
     if (count($errors) > 0) {
         return $errors;
     }
     $dbw = GlobalBlocking::getGlobalBlockingMaster();
     $dbw->delete('globalblocks', array('gb_id' => $id), __METHOD__);
     $page = new LogPage('gblblock');
     $page->addEntry('gunblock', Title::makeTitleSafe(NS_USER, $ip), $this->mReason);
     $successmsg = wfMsgExt('globalblocking-unblock-unblocked', array('parse'), $ip, $id);
     $wgOut->addHTML($successmsg);
     $link = $wgUser->getSkin()->makeKnownLinkObj(SpecialPage::getTitleFor('GlobalBlockList'), wfMsg('globalblocking-return'));
     $wgOut->addHTML($link);
     $wgOut->setSubtitle(wfMsg('globalblocking-unblock-successsub'));
     return array();
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:26,代码来源:SpecialRemoveGlobalBlock.php


示例2: execute

 function execute($par)
 {
     global $wgRequest, $wgSitename, $wgLanguageCode;
     global $wgDeferredUpdateList, $wgOut, $wgUser, $wgServer;
     $fname = "wfChangerealname";
     if (!$wgUser->isAllowed('changerealname')) {
         $wgOut->permissionRequired('changerealname');
         return;
     }
     if ($wgRequest->wasPosted()) {
         if ($wgRequest->getVal('target') && $wgRequest->getVal('realname')) {
             // $dbw = wfGetDB(DB_MASTER);
             $user = User::newFromName($wgRequest->getVal('target'));
             if ($user->getId() == 0) {
                 $wgOut->addHTML(wfMsg('changerealname_nouser', $user->getName()));
                 return;
             }
             //yeah...if you could not go straight to the database, that'd be great... [sc]
             // $oldname = $dbw->selectField( 'user', 'user_real_name', array('user_name'=>$wgRequest->getVal('target')) );
             // $dbw->update('user', array('user_real_name' => $wgRequest->getVal('realname')), array('user_name'=>$wgRequest->getVal('target')));
             $oldname = $user->getRealName();
             $user->setRealName($wgRequest->getVal('realname'));
             $user->saveSettings();
             $summary = wfMsg('changerealname_summary', $wgUser->getName(), $user->getName(), $oldname, $wgRequest->getVal('realname'));
             $log = new LogPage('realname', true);
             $log->addEntry('realname', $user->getUserPage(), $summary);
             $wgOut->addHTML(wfMsg('changerealname_success'));
         }
     } else {
         $me = Title::makeTitle(NS_SPECIAL, "Changerealname");
         $wgOut->addHTML("<form method='POST' action='{$me->getFullURL()}'>\n\t\t\t\t\tUsername: <input type='text' name='target'><br/><br/>\n\t\t\t\t\tNew real name: <input type='text' name='realname'><br/>\n\t\t\t\t\t<input type='submit' value='" . wfMsg('changerealname_submit') . "'>\n\t\t\t\t</form>");
     }
 }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:33,代码来源:Changerealname.body.php


示例3: wfNewuserlogHook

function wfNewuserlogHook($user)
{
    global $wgUser, $wgContLang, $wgVersion;
    if (is_null($user)) {
        // Compatibility with old versions which didn't pass the parameter
        $user = $wgUser;
    }
    $talk = $wgContLang->getFormattedNsText(NS_TALK);
    $contribs = wfMsgForContent('contribslink');
    $block = wfMsgForContent('blocklink');
    if ($user->getName() == $wgUser->getName()) {
        $message = '';
        $action = 'create';
    } else {
        // Links not necessary for self-creations, they will appear already in
        // recentchanges and special:log view for the creating user.
        // For compatability: From 1.10alpha the 'user tools' are used at special:log
        // see bug 4756: Long usernames break block link in new user log entries
        $action = 'create2';
        if (version_compare($wgVersion, '1.10alpha', '>=')) {
            $message = '';
        } else {
            $message = wfMsgForContent('newuserlog-create-text', $user->getName(), $talk, $contribs, $block);
        }
    }
    $log = new LogPage('newusers');
    $log->addEntry($action, $user->getUserPage(), $message);
    return true;
}
开发者ID:clrh,项目名称:mediawiki,代码行数:29,代码来源:NewUserLog.php


示例4: logFeedback

 public function logFeedback($params, $itemId)
 {
     $title = SpecialPage::getTitleFor('FeedbackDashboard', $itemId);
     $reason = wfMessage('moodbar-log-reason')->params($params['type'], $params['comment'])->text();
     $log = new LogPage('moodbar');
     $log->addEntry('feedback', $title, $reason);
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:7,代码来源:ApiMoodBar.php


示例5: wfNewuserlogAutoCreate

function wfNewuserlogAutoCreate($user)
{
    wfLoadExtensionMessages('Newuserlog');
    $log = new LogPage('newusers');
    $log->addEntry('autocreate', $user->getUserPage(), '', array($user->getId()));
    return true;
}
开发者ID:ErdemA,项目名称:wikihow,代码行数:7,代码来源:Newuserlog.php


示例6: PureWikiDeletionSaveCompleteHook

 /**
  * After a page is saved, add or remove it from the blank_page table if
  * it has been blanked or unblanked, respectively; if blanked, redirect
  * the user to the "Action complete" page
  */
 public static function PureWikiDeletionSaveCompleteHook(&$article, &$user, $text, $summary, $minoredit, &$watchthis, $sectionanchor, &$flags, $revision, &$status, $baseRevId, &$redirect)
 {
     global $wgOut, $wgInterWikiIntegrationInEffect;
     if (!isset($revision)) {
         return true;
     }
     $mTitle = $article->getTitle();
     if ($mTitle->getNamespace() == NS_FILE) {
         return true;
     }
     $blankRevId = $revision->getId();
     if ($text == "") {
         if ($summary == wfMsgForContent('autosumm-blank')) {
             $hasHistory = false;
             $summary = $article->generateReason($hasHistory);
         }
         $dbw = wfGetDB(DB_MASTER);
         $blank_row = array('blank_page_id' => $article->getID(), 'blank_user_id' => $user->getId(), 'blank_user_name' => $user->getName(), 'blank_timestamp' => $revision->getTimeStamp(), 'blank_summary' => $summary, 'blank_parent_id' => $revision->getParentId());
         $dbw->insert('blanked_page', $blank_row);
         $log = new LogPage('blank');
         $log->addEntry('blank', $mTitle, $summary, array(), $user);
         $dbw->commit();
         $dbw->delete('recentchanges', array('rc_this_oldid' => $blankRevId));
         Article::onArticleDelete($mTitle);
         $mTitle->resetArticleID(0);
         if ($user->getOption('watchblank')) {
             $watchthis = true;
         }
         wfRunHooks('PureWikiDeletionArticleBlankComplete', array($mTitle));
         $redirect = false;
         $wgOut->setPagetitle(wfMsg('actioncomplete'));
         $wgOut->setRobotPolicy('noindex,nofollow');
         $loglink = wfMsg('blank-log-link');
         $wgOut->addWikiMsg('purewikideletion-blankedtext', $mTitle->getPrefixedText(), $loglink);
         $wgOut->returnToMain(false);
     } else {
         $dbr = wfGetDB(DB_SLAVE);
         $blank_page_id = $article->getID();
         $result = $dbr->selectRow('blanked_page', 'blank_page_id', array("blank_page_id" => $blank_page_id));
         if (!$result) {
             return true;
         } else {
             if ($summary == '') {
                 $summary = $article->getAutosummary('', $text, EDIT_NEW);
             }
             $dbw = wfGetDB(DB_MASTER);
             $blank_page_id = $article->getID();
             $dbw->delete('blanked_page', array("blank_page_id" => $blank_page_id));
             $log = new LogPage('blank');
             $log->addEntry('unblank', $mTitle, $summary, array(), $user);
             $dbw->commit();
             $dbw->delete('recentchanges', array('rc_this_oldid' => $blankRevId));
             $mTitle->touchLinks();
             $mTitle->invalidateCache();
             $mTitle->purgeSquid();
             wfRunHooks('PureWikiDeletionArticleUnblankComplete', array($mTitle));
         }
     }
     return true;
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:65,代码来源:PureWikiDeletion.hooks.php


示例7: logRestore

 function logRestore($itemId, $low, $hi, $reason, $count)
 {
     $title = $this->makeTitle($itemId);
     $params = array($itemId, $low, $hi);
     $log = new LogPage($this->logType, true);
     $log->addEntry($this->logType, $title, wfMsg('clearratings_logrestore', $reason, $title->getFullText(), $count), $params);
 }
开发者ID:ErdemA,项目名称:wikihow,代码行数:7,代码来源:RatingSample.php


示例8: hUnwatchArticleComplete

 public function hUnwatchArticleComplete(&$user, &$article)
 {
     $message = wfMsgForContent('watchlog-unwatch-text', $article->mTitle->getPrefixedText());
     $log = new LogPage('watchlog');
     $log->addEntry('unwatchok', $user->getUserPage(), $message);
     return true;
 }
开发者ID:clrh,项目名称:mediawiki,代码行数:7,代码来源:WatchLog.body.php


示例9: execute

 public function execute()
 {
     global $wgUser, $wgTranslateWorkflowStates;
     if (!$wgTranslateWorkflowStates) {
         $this->dieUsage('Message group review not in use', 'disabled');
     }
     if (!$wgUser->isallowed(self::$right)) {
         $this->dieUsage('Permission denied', 'permissiondenied');
     }
     $requestParams = $this->extractRequestParams();
     $group = MessageGroups::getGroup($requestParams['group']);
     if (!$group) {
         $this->dieUsageMsg(array('missingparam', 'group'));
     }
     $languages = Language::getLanguageNames(false);
     if (!isset($languages[$requestParams['language']])) {
         $this->dieUsageMsg(array('missingparam', 'language'));
     }
     $dbr = wfGetDB(DB_SLAVE);
     $groupid = $group->getId();
     $currentState = $dbr->selectField('translate_groupreviews', 'tgr_state', array('tgr_group' => $groupid, 'tgr_lang' => $requestParams['language']), __METHOD__);
     if ($currentState == $requestParams['state']) {
         $this->dieUsage('The requested state is identical to the current state', 'sameworkflowstate');
     }
     $dbw = wfGetDB(DB_MASTER);
     $table = 'translate_groupreviews';
     $row = array('tgr_group' => $groupid, 'tgr_lang' => $requestParams['language'], 'tgr_state' => $requestParams['state']);
     $index = array('tgr_group', 'tgr_language');
     $res = $dbw->replace($table, array($index), $row, __METHOD__);
     $logger = new LogPage('translationreview');
     $logParams = array($requestParams['language'], $group->getLabel(), $currentState, $requestParams['state']);
     $logger->addEntry('group', SpecialPage::getTitleFor('Translate', $groupid), '', $logParams, $wgUser);
     $output = array('review' => array('group' => $group->getId(), 'language' => $requestParams['language'], 'state' => $requestParams['state']));
     $this->getResult()->addValue(null, $this->getModuleName(), $output);
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:35,代码来源:ApiGroupReview.php


示例10: logRestore

 function logRestore($itemId, $low, $hi, $reason, $count)
 {
     $title = Title::newFromId($itemId);
     $params = array($itemId, $low, $hi);
     $log = new LogPage('accuracy', true);
     $log->addEntry($this->logType, $title, wfMessage('clearratings_logrestore', $reason, $title->getFullText(), $count)->text(), $params);
 }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:7,代码来源:RatingArticle.php


示例11: getLogTitle

 function getLogTitle($rc)
 {
     $logtype = $rc->getAttribute('rc_log_type');
     $logpage = new LogPage($logtype);
     $logname = $logpage->getName()->escaped();
     $titleObj = SpecialPage::getTitleFor('Log', $logtype);
     return '(' . $this->skin->makeKnownLinkObj($titleObj, $logname) . ')';
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:8,代码来源:CleanChanges_body.php


示例12: dropDocent

function dropDocent($user)
{
    global $dbw, $debug, $project_page;
    if (!$debug) {
        $dbw->query("delete from docentcategories where dc_user={$user->getId()}");
    }
    $params = array($user->getID());
    $log = new LogPage('doc', false);
    $log->addEntry('doc', $project_page, wfMsg('doc_logsummary', $user->getName()), $params);
}
开发者ID:biribogos,项目名称:wikihow-src,代码行数:10,代码来源:updateDocents.php


示例13: wfUserLoginLogoutComplete

function wfUserLoginLogoutComplete($user)
{
    global $wgUser, $wgUserBeforeLogout;
    $tmp = $wgUser->mId;
    $wgUser->mId = $wgUserBeforeLogout->getId();
    $log = new LogPage('userlogin', false);
    $log->addEntry('logout', $wgUserBeforeLogout->getUserPage(), $user->getName());
    $wgUser->mId = $tmp;
    return true;
}
开发者ID:saper,项目名称:organic-extensions,代码行数:10,代码来源:UserLoginLog.php


示例14: hEmailUserComplete

 public function hEmailUserComplete($to, $from, $subject, $text)
 {
     global $wgUser;
     $toname = $to->name;
     $fromname = $from->name;
     $message = wfMsgForContent('emaillog-sent-text', $fromname, $toname);
     $log = new LogPage('emaillog');
     $log->addEntry('sentok', $wgUser->getUserPage(), $message);
     return true;
 }
开发者ID:clrh,项目名称:mediawiki,代码行数:10,代码来源:EmailLog.body.php


示例15: execute

 /**
  * Show the special page
  *
  * @param $user Mixed: parameter passed to the page or null
  */
 public function execute($par)
 {
     global $wgUploadAvatarInRecentChanges;
     $out = $this->getOutput();
     $request = $this->getRequest();
     $user = $this->getUser();
     // If the user isn't logged in, display an error
     if (!$user->isLoggedIn()) {
         $this->displayRestrictionError();
         return;
     }
     // If the user doesn't have 'avatarremove' permission, display an error
     if (!$user->isAllowed('avatarremove')) {
         $this->displayRestrictionError();
         return;
     }
     // Show a message if the database is in read-only mode
     if (wfReadOnly()) {
         $out->readOnlyPage();
         return;
     }
     // If user is blocked, s/he doesn't need to access this page
     if ($user->isBlocked()) {
         $out->blockedPage();
         return;
     }
     // Set the page title, robot policies, etc.
     $this->setHeaders();
     $out->setPageTitle($this->msg('avatarupload-removeavatar')->plain());
     if ($request->getVal('user') != '') {
         $out->redirect($this->getPageTitle()->getFullURL() . '/' . $request->getVal('user'));
     }
     // If the request was POSTed, then delete the avatar
     if ($request->wasPosted()) {
         $user_id = $request->getInt('user_id');
         $user_deleted = User::newFromId($user_id);
         $this->deleteImage($user_id, 's');
         $this->deleteImage($user_id, 'm');
         $this->deleteImage($user_id, 'l');
         $this->deleteImage($user_id, 'ml');
         $log = new LogPage('avatar');
         if (!$wgUploadAvatarInRecentChanges) {
             $log->updateRecentChanges = false;
         }
         $log->addEntry('avatar', $user->getUserPage(), $this->msg('user-profile-picture-log-delete-entry', $user_deleted->getName())->inContentLanguage()->text());
         $out->addHTML('<div>' . $this->msg('avatarupload-removesuccess')->plain() . '</div>');
         $out->addHTML('<div><a href="' . htmlspecialchars($this->getPageTitle()->getFullURL()) . '">' . $this->msg('avatarupload-removeanother')->plain() . '</a></div>');
     } else {
         if ($par) {
             $out->addHTML($this->showUserAvatar($par));
         } else {
             $out->addHTML($this->showUserForm());
         }
     }
 }
开发者ID:Reasno,项目名称:SocialProfile,代码行数:60,代码来源:SpecialRemoveAvatar.php


示例16: run

	function run() {
		global $wgUser;

		// Initialization
		$title = $this->title;
		// Other stuff
		$user    = $this->getUser();
		$summary = $this->getSummary();
		$base    = $this->getBase();

		PageTranslationHooks::$allowTargetEdit = true;
		$oldUser = $wgUser;
		$wgUser = $user;

		$error = '';
		$article = new Article( $title, 0 );
		$ok = $article->doDeleteArticle( $summary, false, 0, true, $error );
		if ( !$ok ) {
			$logger = new LogPage( 'pagetranslation' );
			$params = array(
				'user' => $this->getPerformer(),
				'target' => $base,
				'error' => base64_encode( serialize( $ok ) ), // This is getting ridiculous
			);
			$doer = User::newFromName( $this->getPerformer() );
			$msg = $this->getFull() ? 'deletefnok' : 'deletelnok';
			$logger->addEntry( $msg, $title, null, array( serialize( $params ) ), $doer );
		}

		PageTranslationHooks::$allowTargetEdit = false;

		$cache = wfGetCache( CACHE_DB );
		$pages = (array) $cache->get( wfMemcKey( 'pt-base', $base ) );
		$lastitem = array_pop( $pages );
		if ( $title->getPrefixedText() === $lastitem ) {
			$cache->delete( wfMemcKey( 'pt-base', $base ) );
			$logger = new LogPage( 'pagetranslation' );
			$params = array( 'user' => $this->getPerformer() );
			$doer = User::newFromName( $this->getPerformer() );
			$msg = $this->getFull() ? 'deletefok' : 'deletelok';
			$logger->addEntry( $msg, Title::newFromText( $base ), null, array( serialize( $params ) ), $doer );

			$tpage = TranslatablePage::newFromTitle( $title );
			$tpage->getTranslationPercentages( true );
			foreach ( $tpage->getTranslationPages() as $page ) {
				$page->invalidateCache();
			}
			$title->invalidateCache();
		}

		$wgUser = $oldUser;

		return true;
	}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:54,代码来源:DeleteJob.php


示例17: execute

	public function execute() {
		global $wgUser;
		if ( !$wgUser->isallowed( self::$right ) ) {
			$this->dieUsage( 'Permission denied', 'permissiondenied' );
		}

		$params = $this->extractRequestParams();

		$revision = Revision::newFromId( $params['revision'] );
		if ( !$revision ) {
			$this->dieUsage( 'Invalid revision', 'invalidrevision' );
		}

		$title = $revision->getTitle();
		$handle = new MessageHandle( $title );
		if ( !$handle->isValid() ) {
			$this->dieUsage( 'Unknown message', 'unknownmessage' );
		}

		if ( $handle->isFuzzy() ) {
			$this->dieUsage( 'Cannot review fuzzy translations', 'fuzzymessage' );
		}

		if ( $revision->getUser() == $wgUser->getId() ) {
			$this->dieUsage( 'Cannot review own translations', 'owntranslation' );
		}

		$dbw = wfGetDB( DB_MASTER );
		$table = 'translate_reviews';
		$row = array(
			'trr_user' => $wgUser->getId(),
			'trr_page' => $revision->getPage(),
			'trr_revision' => $revision->getId(),
		);
		$options = array( 'IGNORE' );
		$res = $dbw->insert( $table, $row, __METHOD__, $options );
		if ( !$dbw->affectedRows() ) {
			$this->setWarning( 'Already marked as reviewed by you' );
		} else {
			$logger = new LogPage( 'translationreview' );
			$params = array( $revision->getId() );
			$logger->addEntry( 'message', $title, null, $params, $wgUser );
		}

		$output = array( 'review' => array(
			'title' => $title->getPrefixedText(),
			'pageid' => $revision->getPage(),
			'revision' => $revision->getId()
		) );

		$this->getResult()->addValue( null, $this->getModuleName(), $output );
	}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:52,代码来源:ApiTranslationReview.php


示例18: execute

 /**
  * Show the special page
  *
  * @param $user Mixed: parameter passed to the page or null
  */
 public function execute($user)
 {
     global $wgUser, $wgOut, $wgRequest, $wgUploadAvatarInRecentChanges;
     $this->title = SpecialPage::getTitleFor('RemoveAvatar');
     // If the user isn't logged in, display an error
     if (!$wgUser->isLoggedIn()) {
         $this->displayRestrictionError();
         return;
     }
     // If the user doesn't have 'avatarremove' permission, display an error
     if (!$wgUser->isAllowed('avatarremove')) {
         $this->displayRestrictionError();
         return;
     }
     // Show a message if the database is in read-only mode
     if (wfReadOnly()) {
         $wgOut->readOnlyPage();
         return;
     }
     // If user is blocked, s/he doesn't need to access this page
     if ($wgUser->isBlocked()) {
         $wgOut->blockedPage();
         return;
     }
     $wgOut->setPageTitle(wfMsg('avatarupload-removeavatar'));
     if ($wgRequest->getVal('user') != '') {
         $wgOut->redirect($this->title->getFullURL() . '/' . $wgRequest->getVal('user'));
     }
     // If the request was POSTed, then delete the avatar
     if ($wgRequest->wasPosted()) {
         $user_id = $wgRequest->getInt('user_id');
         $user_deleted = User::newFromId($user_id);
         $user_deleted->loadFromDatabase();
         $this->deleteImage($user_id, 's');
         $this->deleteImage($user_id, 'm');
         $this->deleteImage($user_id, 'l');
         $this->deleteImage($user_id, 'ml');
         $log = new LogPage(wfMsgForContent('user-profile-picture-log'));
         if (!$wgUploadAvatarInRecentChanges) {
             $log->updateRecentChanges = false;
         }
         $log->addEntry(wfMsg('user-profile-picture-log'), $wgUser->getUserPage(), wfMsg('user-profile-picture-log-delete-entry', $user_deleted->getName()));
         $wgOut->addHTML('<div>' . wfMsg('avatarupload-removesuccess') . '</div>');
         $wgOut->addHTML('<div><a href="' . $this->title->escapeFullURL() . '">' . wfMsg('avatarupload-removeanother') . '</a></div>');
     } else {
         if ($user) {
             $wgOut->addHTML($this->showUserAvatar($user));
         } else {
             $wgOut->addHTML($this->showUserForm());
         }
     }
 }
开发者ID:kghbln,项目名称:semantic-social-profile,代码行数:57,代码来源:SpecialRemoveAvatar.php


示例19: showSuccess

    /**
     * Show some text and linkage on successful upload.
     *
     * @param $ext String: file extension (gif, jpg or png)
     */
    private function showSuccess($ext)
    {
        global $wgAvatarKey, $wgUploadPath, $wgUploadAvatarInRecentChanges;
        $user = $this->getUser();
        $log = new LogPage('avatar');
        if (!$wgUploadAvatarInRecentChanges) {
            $log->updateRecentChanges = false;
        }
        $log->addEntry('avatar', $user->getUserPage(), $this->msg('user-profile-picture-log-entry')->inContentLanguage()->text());
        $uid = $user->getId();
        $output = '<h1>' . $this->msg('uploadavatar')->plain() . '</h1>';
        $output .= UserProfile::getEditProfileNav($this->msg('user-profile-section-picture')->plain());
        $output .= '<div class="profile-info">';
        $output .= '<p class="profile-update-title">' . $this->msg('user-profile-picture-yourpicture')->plain() . '</p>';
        $output .= '<p>' . $this->msg('user-profile-picture-yourpicturestext')->plain() . '</p>';
        $output .= '<table cellspacing="0" cellpadding="0" style="margin-top:20px;">';
        $output .= '<tr>
			<td valign="top" style="color:#797979;font-size:12px;font-weight:bold;padding-bottom:20px;">' . $this->msg('user-profile-picture-large')->plain() . '</td>
			<td style="padding-bottom:20px;">
				<img src="' . $wgUploadPath . '/avatars/' . $wgAvatarKey . '_' . $uid . '_l.' . $ext . '?ts=' . rand() . '" alt="" border="0" />
			</td>
		</tr>';
        $output .= '<tr>
			<td valign="top" style="color:#797979;font-size:12px;font-weight:bold;padding-bottom:20px;">' . $this->msg('user-profile-picture-medlarge')->plain() . '</td>
			<td style="padding-bottom:20px;">
				<img src="' . $wgUploadPath . '/avatars/' . $wgAvatarKey . '_' . $uid . '_ml.' . $ext . '?ts=' . rand() . '" alt="" border="0" />
			</td>
		</tr>';
        $output .= '<tr>
			<td valign="top" style="color:#797979;font-size:12px;font-weight:bold;padding-bottom:20px;">' . $this->msg('user-profile-picture-medium')->plain() . '</td>
			<td style="padding-bottom:20px;">
				<img src="' . $wgUploadPath . '/avatars/' . $wgAvatarKey . '_' . $uid . '_m.' . $ext . '?ts=' . rand() . '" alt="" border="0" />
			</td>
		</tr>';
        $output .= '<tr>
			<td valign="top" style="color:#797979;font-size:12px;font-weight:bold;padding-bottom:20px;">' . $this->msg('user-profile-picture-small')->plain() . '</td>
			<td style="padding-bottom:20px;">
				<img src="' . $wgUploadPath . '/avatars/' . $wgAvatarKey . '_' . $uid . '_s.' . $ext . '?ts=' . rand() . '" alt="" border="0" />
			</td>
		</tr>';
        $output .= '<tr>
			<td>
				<input type="button" onclick="javascript:history.go(-1)" class="site-button" value="' . $this->msg('user-profile-picture-uploaddifferent')->plain() . '" />
			</td>
		</tr>';
        $output .= '</table>';
        $output .= '</div>';
        $this->getOutput()->addHTML($output);
    }
开发者ID:Reasno,项目名称:SocialProfile,代码行数:54,代码来源:SpecialUploadAvatar.php


示例20: updateCheckUserData

 /**
  * Hook function for RecentChange_save
  * Saves user data into the cu_changes table
  */
 public static function updateCheckUserData(RecentChange $rc)
 {
     global $wgRequest;
     // Extract params
     extract($rc->mAttribs);
     // Get IP
     $ip = wfGetIP();
     // Get XFF header
     $xff = $wgRequest->getHeader('X-Forwarded-For');
     list($xff_ip, $isSquidOnly) = self::getClientIPfromXFF($xff);
     // Get agent
     $agent = $wgRequest->getHeader('User-Agent');
     // Store the log action text for log events
     // $rc_comment should just be the log_comment
     // BC: check if log_type and log_action exists
     // If not, then $rc_comment is the actiontext and comment
     if (isset($rc_log_type) && $rc_type == RC_LOG) {
         $target = Title::makeTitle($rc_namespace, $rc_title);
         $actionText = LogPage::actionText($rc_log_type, $rc_log_action, $target, null, LogPage::extractParams($rc_params));
     } else {
         $actionText = '';
     }
     $dbw = wfGetDB(DB_MASTER);
     $cuc_id = $dbw->nextSequenceValue('cu_changes_cu_id_seq');
     $rcRow = array('cuc_id' => $cuc_id, 'cuc_namespace' => $rc_namespace, 'cuc_title' => $rc_title, 'cuc_minor' => $rc_minor, 'cuc_user' => $rc_user, 'cuc_user_text' => $rc_user_text, 'cuc_actiontext' => $actionText, 'cuc_comment' => $rc_comment, 'cuc_this_oldid' => $rc_this_oldid, 'cuc_last_oldid' => $rc_last_oldid, 'cuc_type' => $rc_type, 'cuc_timestamp' => $rc_timestamp, 'cuc_ip' => IP::sanitizeIP($ip), 'cuc_ip_hex' => $ip ? IP::toHex($ip) : null, 'cuc_xff' => !$isSquidOnly ? $xff : '', 'cuc_xff_hex' => $xff_ip && !$isSquidOnly ? IP::toHex($xff_ip) : null, 'cuc_agent' => $agent);
     # On PG, MW unsets cur_id due to schema incompatibilites. So it may not be set!
     if (isset($rc_cur_id)) {
         $rcRow['cuc_page_id'] = $rc_cur_id;
     }
     $dbw->insert('cu_changes', $rcRow, __METHOD__);
     return true;
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:36,代码来源:CheckUser.hooks.php



注:本文中的LogPage类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP LogUtil类代码示例发布时间:2022-05-23
下一篇:
PHP LogPagSeguro类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap