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

PHP wfGetPad函数代码示例

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

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



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

示例1: displayCategoryTable

 function displayCategoryTable()
 {
     global $wgOut;
     $catmap = Categoryhelper::getIconMap();
     ksort($catmap);
     $queryString = WikihowCategoryViewer::getViewModeParam();
     if (!empty($queryString)) {
         $queryString = "?" . $queryString;
     }
     $wgOut->addHTML("<div class='section_text'>");
     foreach ($catmap as $cat => $image) {
         $title = Title::newFromText($image);
         if ($title) {
             $file = wfFindFile($title, false);
             $sourceWidth = $file->getWidth();
             $sourceHeight = $file->getHeight();
             $heightPreference = false;
             if (self::CAT_HEIGHT > self::CAT_WIDTH && $sourceWidth > $sourceHeight) {
                 //desired image is portrait
                 $heightPreference = true;
             }
             $thumb = $file->getThumbnail(self::CAT_WIDTH, self::CAT_HEIGHT, true, true, $heightPreference);
             $category = urldecode(str_replace("-", " ", $cat));
             $catTitle = Title::newFromText("Category:" . $category);
             if ($catTitle) {
                 $wgOut->addHTML("<div class='thumbnail'><a href='{$catTitle->getLocalUrl()}{$queryString}'><img src='" . wfGetPad($thumb->getUrl()) . "' /><div class='text'><p><span>{$category}</span></p></div></a></div>");
             }
         }
     }
     $wgOut->addHTML("<div class='clearall'></div>");
     $wgOut->addHTML("</div><!-- end section_text -->");
 }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:32,代码来源:Categorylisting.body.php


示例2: sendEmail

 function sendEmail(&$u, &$content)
 {
     global $wgServer;
     wfLoadExtensionMessages('ThumbsEmailNotifications');
     $email = $u->getEmail();
     $userText = $u->getName();
     $semi_rand = md5(time());
     $mime_boundary = "==MULTIPART_BOUNDARY_{$semi_rand}";
     $mime_boundary_header = chr(34) . $mime_boundary . chr(34);
     $userPageLink = self::getUserPageLink($userText);
     $html_text = wfMsg('tn_email_html', wfGetPad(''), $userPageLink, $content);
     $plain_text = wfMsg('tn_email_plain', $userText, $u->getTalkPage()->getFullURL());
     $body = "This is a multi-part message in MIME format.\n\n--{$mime_boundary}\nContent-Type: text/plain; charset=us-ascii\nContent-Transfer-Encoding: 7bit\n\n{$plain_text}\n\n--{$mime_boundary}\nContent-Type: text/html; charset=us-ascii\nContent-Transfer-Encoding: 7bit\n\n{$html_text}";
     $from = new MailAddress(wfMsg('aen_from'));
     $subject = "Congratulations! You just got a thumbs up";
     $isDev = false;
     if (strpos($_SERVER['HOSTNAME'], "wikidiy.com") !== false || strpos($wgServer, "wikidiy.com") !== false) {
         wfDebug("AuthorEmailNotification in dev not notifying: TO: " . $userText . ",FROM: {$from_name}\n");
         $isDev = true;
         $subject = "[FROM DEV] {$subject}";
     }
     if (!$isDev) {
         $to = new MailAddress($email);
         UserMailer::send($to, $from, $subject, $body, null, "multipart/alternative;\n" . "     boundary=" . $mime_boundary_header);
     }
     // send one to our test email account for debugging
     /*
     $to = new MailAddress ('[email protected]');
     UserMailer::send($to, $from, $subject, $body, null, "multipart/alternative;\n" .
     				"     boundary=" . $mime_boundary_header) ;
     */
     return true;
 }
开发者ID:ErdemA,项目名称:wikihow,代码行数:33,代码来源:ThumbsEmailNotifications.body.php


示例3: parserFunction

 public static function parserFunction($parser, $vid = null, $img = null)
 {
     global $wgTitle, $wgContLang;
     wfLoadExtensionMessages('WHVid');
     if ($vid === null || $img === null) {
         return '<div class="errorbox">' . wfMsg('missing-params') . '</div>';
     }
     $vid = htmlspecialchars($vid);
     $divId = "whvid-" . md5($vid . mt_rand(1, 1000));
     $vidUrl = self::getVidUrl($vid);
     $imgTitle = Title::newFromURL($img, NS_IMAGE);
     $imgUrl = null;
     if ($imgTitle) {
         $imgFile = RepoGroup::singleton()->findFile($imgTitle);
         $smallImgUrl = '';
         $largeImgUrl = '';
         if ($imgFile) {
             $width = 550;
             $height = 309;
             $thumb = $imgFile->getThumbnail($width, $height);
             $largeImgUrl = wfGetPad($thumb->getUrl());
             $width = 240;
             //$height = 135;
             $thumb = $imgFile->getThumbnail($width);
             $smallImgUrl = wfGetPad($thumb->getUrl());
         }
     }
     return $parser->insertStripItem(wfMsgForContent('embed-html', $divId, $vidUrl, $largeImgUrl, $smallImgUrl));
 }
开发者ID:ErdemA,项目名称:wikihow,代码行数:29,代码来源:WHVid.body.php


示例4: execute

 function execute($par)
 {
     global $wgUser, $wgOut;
     $wgOut->disable();
     header("Content-type: text/plain;");
     header('Expires: ' . gmdate('D, d M Y H:i:s', 0) . ' GMT');
     header("Cache-Control: private, must-revalidate, max-age=0");
     if ($wgUser->getID() == 0) {
         return;
     }
     if (self::isUserBlocked()) {
         self::updateRemote();
         return;
     }
     $avatar = wfGetPad(Avatar::getAvatarURL($wgUser->getName()));
     $result = "";
     $result .= "UniqueID={$wgUser->getID()}\n";
     $result .= "Name={$wgUser->getName()}\n";
     $result .= "Email={$wgUser->getEmail()}\n";
     $result .= "Avatar={$avatar}\n";
     $result .= "CurrentDate=" . date("r") . "\n";
     $result .= "Groups=" . implode(',', $wgUser->getGroups()) . "\n";
     wfDebug("ProxyConnect: returning {$result}\n");
     print $result;
     self::updateRemote();
     return;
 }
开发者ID:ErdemA,项目名称:wikihow,代码行数:27,代码来源:ProxyConnect.body.php


示例5: linkCss

 public static function linkCss($fileName, $noCache = false)
 {
     $tmpl = new TwitterReplierTemplate(dirname(__FILE__));
     $timestamp = '';
     if ($noCache) {
         $timestamp = '&nc=' . filemtime(dirname(__FILE__) . '/' . $fileName);
     }
     return '<style type="text/css" media="all">/*<![CDATA[*/ @import "' . wfGetPad('/extensions/min/f/extensions/wikihow/TwitterReplier/' . $fileName . '?rev=') . WH_SITEREV . $timestamp . '"; /*]]>*/</style>' . PHP_EOL;
 }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:9,代码来源:TwitterReplierTemplate.class.php


示例6: generateHtml

 private function generateHtml()
 {
     global $wgOut;
     $me = Title::makeTitle(NS_SPECIAL, 'ImageUploadHandler');
     $vars = array();
     $vars['submitUrl'] = $me->getFullUrl() . '?viapage=' . $this->t->getPartialURL();
     $vars['loadingWheel'] = wfGetPad('/extensions/wikihow/rotate.gif');
     return EasyTemplate::html('mobile-image-upload.tmpl.php', $vars);
 }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:9,代码来源:MobileUciHtmlBuilder.class.php


示例7: getCTAById

 function getCTAById($ctaId, &$ctaLinks)
 {
     $ctaId = intval($ctaId);
     $ctaIdx = array_search($ctaId, $ctaLinks);
     if ($ctaIdx === FALSE) {
         wfDebug("cta not found with id {$ctaId}");
         return "";
     }
     return '<script>utmx_section("ctaLink")</script><div class="ctaLink" id="' . $ctaId . '"></noscript><a href="' . trim($ctaLinks[$ctaIdx + 1]) . '?ctaconv=true">' . '<img src="' . wfGetPad('extensions/wikihow/ctalinks/cta_img_' . $ctaId . '.png') . '" /></a></div><!--end cta_link-->';
 }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:10,代码来源:CTALinks.body.php


示例8: GrabWidget

 function GrabWidget($widget_name)
 {
     global $wgArticleWidgets;
     $html = '';
     if (isset($wgArticleWidgets[$widget_name])) {
         $widget_height = $wgArticleWidgets[$widget_name];
         $html = '<iframe src="' . wfGetPad('/Special:ArticleWidgets/' . $widget_name) . '" scrolling="no" frameborder="0" class="article_widget" style="height:' . $widget_height . 'px" allowTransparency="true"></iframe>';
         $html = '<div class="widget_br"></div>' . $html . '<div class="widget_br"></div>';
     }
     return $html;
 }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:11,代码来源:ArticleWidgets.body.php


示例9: execute

    public function execute($par)
    {
        global $wgOut, $wgRequest;
        wfLoadExtensionMessages('FollowWidget');
        $wgOut->setArticleBodyOnly(true);
        $email = $wgRequest->getVal('getEmailForm');
        if ($email == "1") {
            $form = '<link type="text/css" rel="stylesheet" href="/extensions/wikihow/common/jquery-ui-themes/jquery-ui.css" />
				<form id="ccsfg" name="ccsfg" method="post" action="/extensions/wikihow/common/CCSFG/signup/index.php" style="display:none;">

		<h4>' . wfMessage('fw-head')->text() . '</h4>
		<p style="width:220px; margin-bottom: 23px; font-size:14px;">' . wfMessage('fw-blurb')->text() . '</p>
		<img src="' . wfGetPad('/skins/WikiHow/images/kiwi-small.png') . '" nopin="nopin" style="position:absolute; right:90px; top:68px;" />';
            $form .= <<<EOHTML
\t\t<table>
\t\t
\t\t\t<tr><td colspan="2">
\t\t\t\t\t<!-- ########## Email Address ########## -->
\t\t\t\t\t<label for="EmailAddress">Email Address</label><br />
\t\t\t\t\t<input type="text" name="EmailAddress" value="" id="EmailAddress" style="width:350px; height:25px; font-size:13px;" /><br /><br />
\t\t\t\t</td>
\t\t\t</tr>
\t\t\t<tr>
\t\t\t\t<td styel="padding-right:4px;">
\t\t\t\t\t<!-- ########## First Name ########## -->
\t\t\t\t\t<label for="FirstName">First Name (optional):</label><br />
\t\t\t\t\t<input type="text" name="FirstName" value="" id="FirstName" style="width:215px; height:25px; margin-right:10px; font-size:13px;" /><br />
\t\t\t\t</td>
\t\t\t\t<td>
\t\t\t\t\t<!-- ########## Last Name ########## -->
\t\t\t\t\t<label for="LastName">Last Name (optional):</label><br />
\t\t\t\t\t<input type="text" name="LastName" value="" id="LastName" style="width:215px; height:25px; font-size:13px;" /><br />
\t\t\t\t</td>
\t\t\t<tr>
\t\t\t<tr><td colspan="2">
\t\t\t\t<!-- ########## Contact Lists ########## -->
\t\t\t\t<input type="hidden"  checked="checked"  value="General Interest" name="Lists[]" id="list_General Interest" />

\t\t\t\t<input type="submit" name="signup" id="signup" value="Join" class="button primary" />
\t\t\t</td></tr>
\t\t</table>

\t\t</form>\t
EOHTML;
            echo $form;
        } else {
            $wgOut->addHTML($this->getForm());
        }
    }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:49,代码来源:FollowWidget.body.php


示例10: mainUploadForm

 function mainUploadForm($msg = '')
 {
     global $wgOut, $wgUser;
     global $wgUseCopyrightUpload;
     global $wgStylePath;
     // dont show all of the skin
     $ew = $wgUser->getOption('editwidth');
     if ($ew) {
         $ew = " style=\"width:100%\"";
     } else {
         $ew = '';
     }
     if ('' != $msg) {
         $sub = wfMsgHtml('uploaderror');
         $wgOut->addHTML("<h2>{$sub}</h2>\n" . "<span class='error'>{$msg}</span>\n");
     }
     $sk = $wgUser->getSkin();
     $sourcefilename = wfMsgHtml('sourcefilename');
     $destfilename = wfMsgHtml('destfilename');
     $summary = wfMsg('imagepopup_summary');
     $addtosection = wfMsg('imageuploadsection');
     $cp = wfMsg('imageuploadcaption');
     $licenses = new Licenses();
     $license = wfMsgHtml('license');
     $nolicense = wfMsgHtml('nolicense');
     $licenseshtml = $licenses->getHtml();
     $articlesummary = wfMsg('summary');
     $steps = wfMsg('steps');
     $tips = wfMsg('tips');
     $warnings = wfMsg('warnings');
     $ulb = wfMsgHtml('uploadbtn');
     $titleObj = Title::makeTitle(NS_SPECIAL, 'UploadPopup');
     $action = $titleObj->escapeLocalURL();
     $encDestFile = htmlspecialchars($this->mDestFile);
     $watchChecked = $wgUser->getOption('watchdefault') ? 'checked="checked"' : '';
     $wgOut->addHTML("\n            <script type='text/javascript'>\n                function checkFFBug() {\n                    if ((document.uploadform.wpLicense.value == '' || document.uploadform.wpLicense.value == 'No License' ) \n                        && navigator.userAgent.toLowerCase().indexOf('firefox') >= 0) { \n                        return confirm('" . wfMsg('no_license_selected') . "'); \n                    }\n                    return true;\n            }\n            </script>\n\t<form id='upload' name='uploadform' method='post' enctype='multipart/form-data' action=\"{$action}\" onsubmit='return checkFFBug();'>\n\t\t<table border='0'>\n\t\t<tr>\n\t\t\t<td align='right'><label for='wpUploadFile'>{$sourcefilename}:</label></td>\n\t\t\t<td align='left'>\n\t\t\t\t<input tabindex='1' type='file' name='wpUploadFile' id='wpUploadFile' " . ($this->mDestFile ? "" : "onchange='fillDestFilename(\"wpUploadFile\")' ") . "size='40' />\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td align='right'><label for='wpDestFile'>{$destfilename}:</label></td>\n\t\t\t<td align='left'>\n\t\t\t\t<input tabindex='2' type='text' name='wpDestFile' id='wpDestFile' size='40' value=\"{$encDestFile}\" />\n\t\t\t</td>\n\t\t</tr>\n\t      <tr>\n            <td align='right'><label for='wpAddToSection'>{$addtosection}:</label></td>\n            <td align='left'>\n        \t\t<SELECT name=wpAddToSection tabindex='3'>\n       \t\t\t  <OPTION VALUE=summary>{$articlesummary}</OPTION>\n        \t\t\t<OPTION VALUE=steps>{$steps}</OPTION>\n        \t\t\t<OPTION VALUE=tips>{$tips}</OPTION>\n        \t\t\t<OPTION VALUE=warnings>{$warnings}</OPTION>\n        \t\t</SELECT>#:<input type=text size=2 name=wpStepNum>\n            </td>\n        </tr>\n    \t<tr>\n            <td align='right'><label for='wpCaption'>{$cp}:</label></td>\n            <td align='left'>\n        \t\t\t<input tabindex='4' type='text' name=\"wpCaption\" size='40'\"/>\n        \t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td align='right'><label for='wpUploadDescription'>{$summary}</label></td>\n\t\t\t<td align='left'>\n\t\t\t\t<input tabindex='5' type='text' name='wpUploadDescription' id='wpUploadDescription' size='40' value=\"" . htmlspecialchars($this->mUploadDescription) . "\" />\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>");
     if ($licenseshtml != '') {
         global $wgStylePath;
         $wgOut->addHTML("\n\t\t\t<td align='right'><label for='wpLicense'>{$license}:</label></td>\n\t\t\t<td align='left'>\n\t\t\t\t<script type='text/javascript' src=\"" . wfGetPad('/extensions/min/f/skins/common/upload.js') . "\"></script>\n\t\t\t\t<select name='wpLicense' id='wpLicense' tabindex='6'\n\t\t\t\t\tonchange='licenseSelectorCheck()'>\n\t\t\t\t\t{$licenseshtml}\n\t\t\t\t</select>\n\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t");
     }
     $wgOut->addHtml("\n\t\t<td></td>\n\t\t<td>\n\t\t\t<input tabindex='7' type='checkbox' name='wpWatchthis' id='wpWatchthis' {$watchChecked} value='true' />\n\t\t\t<label for='wpWatchthis'>" . wfMsgHtml('watchthis') . "</label>\n\t\t\t<input tabindex='8' type='checkbox' name='wpIgnoreWarning' id='wpIgnoreWarning' value='true' />\n\t\t\t<label for='wpIgnoreWarning'>" . wfMsgHtml('ignorewarnings') . "</label>\n\t\t</td>\n\t</tr>\n\t<tr>\n\n\t</tr>\n\t<tr>\n\t\t<td></td>\n\t\t<td align='left'><input id='gatWPUploadPopup' tabindex='9' type='submit' name='wpUpload' value=\"{$ulb}\" /></td>\n\t</tr>\n\n\t<tr>\n\t\t<td></td>\n\t\t<td align='left'>\n\t\t");
     $wgOut->addWikiText(wfMsgForContent('edittools'));
     $wgOut->addHTML("\n\t\t</td>\n\t</tr>\n\n\t</table>\n\t</form>\n\n<script type='text/javascript'>\nvar gaJsHost = (('https:' == document.location.protocol) ? 'https://ssl.' : 'http://www.');\ndocument.write(unescape('%3Cscript src=\\'' + gaJsHost + 'google-analytics.com/ga.js\\' type=\\'text/javascript\\'%3E%3C/script%3E'));    \n\ntry {       \nvar pageTracker = _gat._getTracker('UA-2375655-1'); \npageTracker._setDomainName('.wikihow.com');} catch(err) {}\n\nif (typeof jQuery == 'undefined') {\n\tEvent.observe(window, 'load', gatStartObservers); \n} else {\n\tjQuery(window).load(gatStartObservers);\n}\n</script> ");
 }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:44,代码来源:UploadPopup.body.php


示例11: getStartLink

 public function getStartLink($showArrow, $widgetStatus)
 {
     if ($widgetStatus == DashboardWidget::WIDGET_ENABLED) {
         $link = "<a href='/Special:Spellchecker' class='comdash-start'>Start";
     } else {
         if ($widgetStatus == DashboardWidget::WIDGET_LOGIN) {
             $link = "<a href='/Special:Userlogin?returnto=Special:Spellchecker' class='comdash-login'>Login";
         } else {
             if ($widgetStatus == DashboardWidget::WIDGET_DISABLED) {
                 $link = "<a href='/Become-a-New-Article-Booster-on-wikiHow' class='comdash-start'>Start";
             }
         }
     }
     if ($showArrow) {
         $link .= " <img src='" . wfGetPad('/skins/owl/images/actionArrow.png') . "' alt=''>";
     }
     $link .= "</a>";
     return $link;
 }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:19,代码来源:SpellcheckerAppWidget.php


示例12: wfSendRequestNotificationEmail

function wfSendRequestNotificationEmail($emails)
{
    wfLoadExtensionMessages('RequestTopic');
    $from = new MailAddress(wfMsg('suggested_notify_email_from'));
    $semi_rand = md5(time());
    $mime_boundary = "==MULTIPART_BOUNDARY_{$semi_rand}";
    $mime_boundary_header = chr(34) . $mime_boundary . chr(34);
    foreach ($emails as $email => $title) {
        $html_text = wfMsg('suggested_notify_email_html', wfGetPad(''), $title->getText(), $title->getFullURL(), $title->getDBKey(), $title->getTalkPage()->getFullURL());
        $plain_text = wfMsg('suggested_notify_email_plain', $title->getText(), $title->getFullURL(), $title->getDBKey(), $title->getTalkPage()->getFullURL());
        $body = "This is a multi-part message in MIME format.\n\n--{$mime_boundary}\nContent-Type: text/plain; charset=us-ascii\nContent-Transfer-Encoding: 7bit\n\n{$plain_text}\n\n--{$mime_boundary}\nContent-Type: text/html; charset=us-ascii\nContent-Transfer-Encoding: 7bit\n\n{$html_text}";
        $subject = wfMsg('suggested_notify_email_subject', $title->getText());
        if (!$title) {
            continue;
        }
        $to = new MailAddress($email);
        UserMailer::send($to, $from, $subject, $body, null, "multipart/alternative;\n" . "     boundary=" . $mime_boundary_header);
    }
    return true;
}
开发者ID:biribogos,项目名称:wikihow-src,代码行数:20,代码来源:Suggest.php


示例13: makeUrlTags

 public static function makeUrlTags($type, $files, $path, $debug = false)
 {
     $files = array_unique($files);
     $path = preg_replace('/^\\/(.*)/', '$1', $path);
     $path = preg_replace('/(.*)\\/$/', '$1', $path);
     if ($type == 'css') {
         $fmt = '<link rel="stylesheet" type="text/css" href="%s" />' . "\n";
     } else {
         $fmt = '<script src="%s"></script>' . "\n";
     }
     if (!$debug) {
         $url = wfGetPad('/extensions/min/f/' . join(',', $files) . '&b=' . $path . '&' . WH_SITEREV);
         $ret = sprintf($fmt, $url);
     } else {
         $ret = '';
         foreach ($files as $file) {
             $ret .= sprintf($fmt, '/' . $path . '/' . $file);
         }
     }
     return $ret;
 }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:21,代码来源:HtmlSnips.class.php


示例14: injectCTAs

 public static function injectCTAs(&$xpath, &$t)
 {
     if (self::isActivePage() && self::isValidTitle($t)) {
         $nodes = $xpath->query('//div[@id="tips"]/ul');
         foreach ($nodes as $node) {
             $newHtml = "Insert new tip here:<br/>";
             $newHtml .= "<textarea class='newtip' style='margin-right:5px; height:35px; width:200px;'></textarea>";
             $newHtml .= "<a href='#' class='addtip button white_button' style='vertical-align:top'>Add</a>";
             $newHtml .= "<img class='tip_waiting' style='display:none' src='" . wfGetPad('/extensions/wikihow/rotate.gif') . "' alt='' />";
             $newNode = $node->ownerDocument->createElement('div', "");
             $newNode->setAttribute('class', 'addTipElement');
             $newNode->innerHTML = $newHtml;
             if ($node->nextSibling !== null) {
                 $node->parentNode->insertBefore($newNode, $node->nextSibling);
             } else {
                 $node->parentNode->appendChild($newNode);
             }
             $i++;
         }
     }
 }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:21,代码来源:TipsAndWarnings.body.php


示例15: execute

 function execute($par)
 {
     global $wgRequest, $wgSitename, $wgLanguageCode;
     global $wgDeferredUpdateList, $wgOut, $wgUser, $wgServer, $wgContLang;
     $fname = "wfRepublish";
     $this->setHeaders();
     $sk = $wgUser->getSkin();
     $target = $par != '' ? $par : $wgRequest->getVal('target');
     if ($target == '') {
         $wgOut->addHTML(wfMsg('articlestats_notitle'));
         return;
     }
     $t = Title::newFromText($target);
     $id = $t->getArticleID();
     if ($id == 0) {
         $wgOut->addHTML(wfMsg("checkquality_titlenonexistant"));
         return;
     }
     $output = Republish::getRepublishText($t);
     $wgOut->addHTML("\n\t\t\t\t<script type='text/javascript' src='" . wfGetPad('/extensions/min/f/skins/WikiHow/sharetab.js?') . WH_SITEREV . "'></script>\n\t\t\t\t<center>\n\t\t\t\t<textarea id='output' style='font-size: 1.0em; width:500px;' rows='8' cols='10'>{$output}</textarea>\n\t\t\t\t</center>" . wfMsg('republish_quicklinks', urlencode($t->getText()), urlencode($t->getFullURL())) . "<br/>" . wfMsg('republish_instructions'));
     $wgOut->addHTML("<br/>\n\t\t\t<style type='text/css'>\n\t\t\t\t#preview h2 {\n\t\t\t\t\tbackground: none;\n\t\t\t\t\tcolor: #000;\n\t\t\t\t\tborder: none;\n\t\t\t\t\tpadding: 0px;\n\t\t\t\t\tmargin-left: 0px;\n\t\t\t\t\tfont-size: 100%;\t\n\t\t\t\t}\n\t\t\t</style>" . "<script type='text/javascript'>\n\t\t\t\tvar txtarea = document.getElementById('output');\n\t\t\t\ttxtarea.focus();\n\t\t\t\ttxtarea.select();\t\n\t\t\t</script>\n\t\t\t");
 }
开发者ID:ErdemA,项目名称:wikihow,代码行数:22,代码来源:Republish.body.php


示例16: getArticleList

 function getArticleList()
 {
     global $wgMemc, $wgUser;
     $key = wfMemcKey("newarticleslist");
     $cached = $wgMemc->get($key);
     if ($cached) {
         return $cached;
     }
     $skin = $wgUser->getSkin();
     $dbr = wfGetDB(DB_SLAVE);
     $sql = self::getSql() . " ORDER BY value DESC LIMIT 50";
     $res = $dbr->query($sql);
     $html = "";
     $total_num = wfMsg('newarticles_listnum');
     $column_num = ceil($total_num / 3);
     for ($i = 0; $i < $total_num && ($row = $dbr->fetchObject($res));) {
         $title = Title::makeTitle($row->namespace, $row->title);
         $link = $skin->makeKnownLinkObj($title);
         if ($i % $column_num == 0) {
             $html .= "<ul>";
         }
         $html .= "<li>" . $link . "</li>";
         if ($i % $column_num == $column_num - 1) {
             $html .= "</ul>";
         }
         $i++;
     }
     if ($i % $column_num != $column_num) {
         $html .= "</ul>";
     }
     $title = Title::makeTitle(NS_SPECIAL, 'NewHowtoArticles');
     $link = $skin->makeKnownLinkObj($title, wfMsg('more_newarticles'));
     $html .= "<p id='more_newarticles'>" . $link . "<img alt='' src='" . wfGetPad('/skins/WikiHow/images/actionArrow.png') . "' ></p>";
     $wgMemc->set($key, $html, NewHowtoArticles::$cachelen_long);
     return $html;
 }
开发者ID:ErdemA,项目名称:wikihow,代码行数:36,代码来源:NewHowtoArticles.body.php


示例17: wfShowFollowUpOnCreation

function wfShowFollowUpOnCreation()
{
    global $wgTitle, $wgRequest, $wgOut, $wgUser, $wgCookiePrefix, $wgCookiePath, $wgCookieDomain, $wgCookieSecure;
    try {
        $t = $wgTitle;
        if (!$t || $t->getNamespace() != NS_MAIN) {
            return true;
        }
        $article = new Article($t);
        // short circuit the database look ups because they are frigging slow
        if (isset($_COOKIE[$wgCookiePrefix . 'ArticlesCreated'])) {
            $ids = explode(",", $_COOKIE[$wgCookiePrefix . 'ArticlesCreated']);
        } else {
            // they didn't create any articles
            return true;
        }
        if (!in_array($t->getArticleID(), $ids)) {
            // they didn't create this article
            return true;
        }
        // all of this logic could be cleaned up and HTML moved to a template
        $dbr = wfGetDB(DB_SLAVE);
        $num_revisions = $dbr->selectField('revision', 'count(*)', array('rev_page=' . $article->getId()));
        if ($num_revisions > 1) {
            return true;
        }
        $user_name = $dbr->selectField('revision', 'rev_user_text', array('rev_page=' . $article->getId()));
        if ((strpos($_SERVER['HTTP_REFERER'], 'action=edit') !== false || strpos($_SERVER['HTTP_REFERER'], 'action=submit2') !== false) && $wgUser->getName() == $user_name && !isset($_SESSION["aen_dialog"][$article->getId()])) {
            print '<script type="text/javascript" language="javascript" src="' . wfGetPad('/extensions/min/f/extensions/wikihow/winpop.js?rev=') . WH_SITEREV . '"></script>
								<script type="text/javascript" language="javascript" src="' . wfGetPad('/extensions/min/f/extensions/wikihow/authors/authoremails.js?rev=') . WH_SITEREV . '"></script>
						 <link rel="stylesheet" href="' . wfGetPad('/extensions/min/f/extensions/wikihow/winpop.css?rev=') . WH_SITEREV . '" type="text/css" />
						 <link rel="stylesheet" href="' . wfGetPad('/extensions/min/f/extensions/wikihow/createpage/createpage.css?rev=') . WH_SITEREV . '" type="text/css" />';
            if ($wgUser->getID() == 0) {
                setcookie('aen_anon_newarticleid', $article->getId(), time() + 3600, $wgCookiePath, $wgCookieDomain, $wgCookieSecure);
                setcookie('aen_dialog_check', $article->getId(), time() + 3600);
                print '
					<script type="text/javascript">
						var whNewLoadFunc = function() {
							if ( getCookie("aen_dialog_check") != "" ) {
								var url = "/extensions/wikihow/common/jquery-ui-slider-dialog-custom/jquery-ui-1.8.13.custom.min.js";
								$.getScript(url, function() {
									$("#dialog-box").load("/Special:CreatepageFinished");
									$("#dialog-box").dialog({
										width: 600,
										height: 600,
										modal: true,
										closeText: "Close",
										title: "' . wfMsg('createpage_congratulations') . '"
									});
									deleteCookie("aen_dialog_check");
								});
							}
						};
						// during move to jquery...
						if (typeof document.observe == "function") {
							document.observe("dom:loaded", whNewLoadFunc);
						} else {
							$(document).ready(whNewLoadFunc);
						}
					</script>
				';
            } else {
                if ($wgUser->getOption('enableauthoremail') != '1') {
                    setcookie('aen_dialog_check', $article->getId(), time() + 3600);
                    print '
						<script type="text/javascript">
						var whNewLoadFunc = function() {
							if ( getCookie("aen_dialog_check") != "" ) {
							
								var url = "/extensions/wikihow/common/jquery-ui-slider-dialog-custom/jquery-ui-1.8.13.custom.min.js";
								$.getScript(url, function() {
									$("#dialog-box").load("/Special:CreatepageFinished");
									$("#dialog-box").dialog({
										width: 600,
										height: 600,
										modal: true,
										closeText: "Close",
										title: "' . wfMsg('createpage_congratulations') . '"
									});
									deleteCookie("aen_dialog_check");
								});
							}
						};
						// during move to jquery...
						if (typeof document.observe == "function") {
							document.observe("dom:loaded", whNewLoadFunc);
						} else {
							$(document).ready(whNewLoadFunc);
						}
						</script>
					';
                }
            }
            $_SESSION["aen_dialog"][$article->getId()] = 1;
        }
    } catch (Exception $e) {
    }
    return true;
}
开发者ID:ErdemA,项目名称:wikihow,代码行数:99,代码来源:CreatePage.php


示例18: wfGetPad

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>The Volume of a Sphere</title>
<style type="text/css" media="all">/*<![CDATA[*/ @import "<?php 
echo wfGetPad('/extensions/min/f/extensions/wikihow/ArticleWidgets/common/css/style.css,/extensions/wikihow/ArticleWidgets/SPHEREVOL/css/styles.css,/extensions/wikihow/ArticleWidgets/components/whUpDownDropDown/wh.updowndropdown.css,/extensions/wikihow/ArticleWidgets/components/whLabel/wh.label.css&') . WH_SITEREV;
?>
"; /*]]>*/</style>
<script type="text/javascript" src="<?php 
echo wfGetPad('/extensions/min/f/extensions/wikihow/common/jquery-1.4.1.min.js,/extensions/wikihow/ArticleWidgets/common/js/tabs.js,/extensions/wikihow/ArticleWidgets/components/whUpDownDropDown/jq.wh.updowndropdown.js,/extensions/wikihow/ArticleWidgets/components/whLabel/jq.wh.label.js,/extensions/wikihow/ArticleWidgets/libs/wh.geometry.js&') . WH_SITEREV;
?>
"></script>
</head>
<body>
	<div id="wrapper">
    	<div id="header">
        	<h1>The Volume of a Sphere</h1>
			<div class="corner_left"></div>
			<div class="corner_right"></div>
            <ul class="tabs">
                <li><a href="#tab1"><p>Imperial</p></a></li>
                <li><a href="#tab2"><p>Metric</p></a></li>
            </ul>
        </div><!--end header-->
        	<div id="content">
            	<div class="tab_container">
    				<div id="tab1" class="tab_content">
        				<div class="left">
                        	<h1>Radius</h1>
                            <div class="form form_uk" id="uk">
开发者ID:ErdemA,项目名称:wikihow,代码行数:31,代码来源:SPHEREVOL.tmpl.php


示例19: listDrafts

 public static function listDrafts(&$title = null, $user = null)
 {
     global $wgOut, $wgRequest, $wgUser, $wgLang;
     //added twice?
     $wgOut->addScript('<style type="text/css" media="all">/*<![CDATA[*/ @import "' . wfGetPad('/extensions/min/f/extensions/Drafts/Drafts.css?rev=') . WH_SITEREV . '"; /*]]>*/</style>');
     // Get draftID
     $currentDraft = Draft::newFromID($wgRequest->getIntOrNull('draft'));
     //based on user preference
     $adv = $wgUser->getOption('defaulteditor', '') == 'advanced' ? '&advanced=true' : '';
     // Output HTML for list of drafts
     $drafts = Draft::getDrafts($title, $user);
     if (count($drafts) > 0) {
         global $egDraftsLifeSpan;
         // Internationalization
         wfLoadExtensionMessages('Drafts');
         // Add a summary, on Special:Drafts only
         if (!$title || $title->getNamespace() == NS_SPECIAL) {
             $wgOut->wrapWikiMsg('<div class="mw-drafts-summary">$1</div>', array('drafts-view-summary', $wgLang->formatNum($egDraftsLifeSpan)));
         }
         // Build XML
         $wgOut->addHTML(Xml::openElement('table', array('cellpadding' => 5, 'cellspacing' => 0, 'border' => 0, 'id' => 'drafts-list-table', 'class' => 'section_text', 'style' => 'margin-top:15px')));
         $wgOut->addHTML(Xml::openElement('tr'));
         $wgOut->addHTML(Xml::element('th', array('align' => 'left', 'nowrap' => 'nowrap', 'style' => 'text-align:center;'), wfMsg('drafts-view-article')));
         $wgOut->addHTML(Xml::element('th', array('align' => 'left', 'nowrap' => 'nowrap', 'style' => 'text-align:center;'), wfMsg('drafts-view-saved')));
         $wgOut->addHTML(Xml::element('th', array(), wfMsg('edit')));
         $wgOut->addHTML(Xml::element('th', array(), wfMsg('discard')));
         $wgOut->addHTML(Xml::closeElement('tr'));
         // Add existing drafts for this page and user
         $index = 0;
         foreach ($drafts as $draft) {
             // Get article title text
             $htmlTitle = $draft->getTitle()->getEscapedText();
             // Build Article Load link
             if ($draft->getHTML5()) {
                 $params = 'h5e=true&draft=' . urlencode($draft->getID());
                 if ($draft->getTitle()->getArticleID() == 0) {
                     $params .= "&create-new-article=true";
                 }
                 $urlLoad = $draft->getTitle()->getFullUrl($params);
             } else {
                 $urlLoad = $draft->getTitle()->getFullUrl('action=edit' . $adv . '&draft=' . urlencode($draft->getID()));
             }
             // Build discard link
             $urlDiscard = sprintf('%s?discard=%s&token=%s', SpecialPage::getTitleFor('Drafts')->getFullUrl(), urlencode($draft->getID()), urlencode($wgUser->editToken()));
             // If in edit mode, return to editor
             if ($wgRequest->getText('action') == 'edit' || $wgRequest->getText('action') == 'submit') {
                 $urlDiscard .= '&returnto=' . urlencode('edit');
             }
             // Append section to titles and links
             if ($draft->getSection() !== null) {
                 // Detect section name
                 $lines = explode("\n", $draft->getText());
                 // If there is any content in the section
                 if (count($lines) > 0) {
                     $htmlTitle .= '#' . htmlspecialchars(trim(trim(substr($lines[0], 0, 255), '=')));
                 }
                 // Modify article link and title
                 $urlLoad .= '&section=' . urlencode($draft->getSection());
                 $urlDiscard .= '&section=' . urlencode($draft->getSection());
             }
             // Build XML
             if ($index % 2 == 1) {
                 $wgOut->addHTML(Xml::openElement('tr', array('style' => 'background: #eee;')));
             } else {
                 $wgOut->addHTML(Xml::openElement('tr', array('style' => '')));
             }
             $wgOut->addHTML(Xml::openElement('td', array('align' => 'left', 'class' => 'draftpage')));
             $wgOut->addHTML(Xml::element('a', array('href' => $urlLoad, 'style' => 'font-weight:' . ($currentDraft->getID() == $draft->getID() ? 'bold' : 'normal')), $htmlTitle));
             $wgOut->addHTML(Xml::closeElement('td'));
             $wgOut->addHTML(Xml::element('td', array('align' => 'left', 'nowrap' => 'nowrap', 'class' => 'draftsaved'), $wgLang->timeanddate($draft->getSaveTime(), true)));
             // edit link
             $wgOut->addHTML(Xml::openElement('td', array('align' => 'left', 'nowrap' => 'nowrap', 'class' => 'draftedit')));
             $wgOut->addHTML(Xml::element('a', array('href' => $urlLoad), wfMsg('edit')));
             $wgOut->addHTML(Xml::closeElement('td'));
             $wgOut->addHTML(Xml::openElement('td', array('align' => 'left', 'nowrap' => 'nowrap', 'class' => 'draftdiscard')));
             $wgOut->addHTML(Xml::element('a', array('href' => $urlDiscard, 'onclick' => "if( true || !wgAjaxSaveDraft.insync ) return confirm('" . Xml::escapeJsString(wfMsgHTML('drafts-discard-warn', $draft->getTitle()->getText())) . "')"), wfMsg('drafts-view-discard')));
             $wgOut->addHTML(Xml::closeElement('td'));
             $wgOut->addHTML(Xml::closeElement('tr'));
             $index++;
         }
         $wgOut->addHTML(Xml::closeElement('table'));
         // Return number of drafts
         return count($drafts);
     }
     return 0;
 }
开发者ID:ErdemA,项目名称:wikihow,代码行数:86,代码来源:Drafts.classes.php



鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP wfGetParserCacheStorage函数代码示例发布时间:2022-05-23
下一篇:
PHP wfGetNull函数代码示例发布时间: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