本文整理汇总了PHP中Settings::pluginGet方法的典型用法代码示例。如果您正苦于以下问题:PHP Settings::pluginGet方法的具体用法?PHP Settings::pluginGet怎么用?PHP Settings::pluginGet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Settings
的用法示例。
在下文中一共展示了Settings::pluginGet方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ircReport
function ircReport($stuff)
{
$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
socket_connect($sock, Settings::pluginGet("host"), Settings::pluginGet("port"));
socket_write($sock, $stuff . "\n");
socket_close($sock);
}
示例2: ircReport
function ircReport($stuff)
{
if (Settings::pluginGet("mode") == "http") {
file_get_contents(Settings::pluginGet('url') . rawurlencode($stuff));
} else {
$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
socket_connect($sock, Settings::pluginGet("host"), Settings::pluginGet("port"));
socket_write($sock, $stuff . "\n");
socket_close($sock);
}
}
示例3: actionLinkTagItem
<?php
if (Settings::pluginGet('showlink')) {
print actionLinkTagItem(__("Minecraft stats"), "minestats");
}
示例4: resourceLink
<?php
$mcTitles = Settings::pluginGet("titles");
$mcTitles = explode("\n", $mcTitles);
//Remove empty strings
$mcTitles = array_map('trim', $mcTitles);
$mcTitles = array_filter($mcTitles);
//Choose one randomly!
if (count($mcTitles)) {
$mcTitle = $mcTitles[array_rand($mcTitles)];
} else {
$mcTitle = "Add titles in plugin settings!";
}
?>
<script type="text/javascript" src="<?php
print resourceLink("plugins/mctitles/makeTitle.js");
?>
"></script>
<script type="text/javascript">
window.addEventListener("load", function() {
makeMcTitle(<?php
print json_encode($mcTitle);
?>
);
}, false);
</script>
<link rel="stylesheet" type="text/css" href="<?php
print resourceLink("plugins/mctitles/mctitles.css");
?>
" />
示例5: Goomba
<?php
echo "\n\t<script>\n\t(function () {\n\t\tvar i = 0;\n\t\tfor (; i < " . (int) Settings::pluginGet('goombas') . "; ++i) {\n\t\t\tsetTimeout(function () {\n\t\t\t\tvar goomba = new Goomba();\n\t\t\t\tgoomba.startWalking();\n\t\t\t}, " . (double) Settings::pluginGet('interval') . " * i);\n\t\t}\n\t})();\n\t</script>\n";
示例6: PipeMenuLinkEntry
<?php
$path->shift();
$path->addStart(new PipeMenuLinkEntry(Settings::pluginGet("crumbsBoardLink"), "board"));
$path->addStart(new PipeMenuLinkEntry(Settings::pluginGet("crumbsBlogLink"), "blog"));
示例7: getServerURLNoSlash
$extra = "";
if ($urlRewriting) {
$link = getServerURLNoSlash() . actionLink("profile", $user["id"], "", "_");
} else {
$link = getServerURL() . "?uid=" . $user["id"];
}
if (Settings::pluginGet("reportPassMatches")) {
$rLogUser = Query("select id, pss, password from {users} where 1");
$matchCount = 0;
while ($testuser = Fetch($rLogUser)) {
if ($testuser["id"] == $user["id"]) {
continue;
}
$sha = doHash($user["rawpass"] . $salt . $testuser['pss']);
if ($testuser['password'] == $sha) {
$matchCount++;
}
}
if ($matchCount) {
$extra .= "-- " . Plural($matchCount, "password match") . " ";
}
}
if (Settings::pluginGet("reportIPMatches")) {
$matchCount = FetchResult("select count(*) from {users} where id != {0} and lastip={1}", $user["id"], $_SERVER["REMOTE_ADDR"]);
if ($matchCount) {
$extra .= "-- " . Plural($matchCount, "IP match") . " ";
}
}
if ($forum['minpower'] <= 0) {
ircReport("" . $c2 . "New user: {$c1}" . ircUserColor($user["name"], $user['sex'], $user['powerlevel']) . "{$c2} {$extra}-- " . $link);
}
示例8: Fetch
$admin = Fetch(Query("select u.(_userfields) from {users} u where id = 1"));
$admin = UserLink(getDataPrefix($admin, "u_"));
$sexes = array(0 => __("Male"), 1 => __("Female"), 2 => __("N/A"));
$powerlevels = array(0 => __("Normal user"), 1 => __("Local moderator"), 2 => __("Full moderator"), 3 => __("Administrator"), 4 => __("Root"));
$headers = "";
$colors = "";
foreach ($sexes as $ss) {
$headers .= format("\n\t<th>\n\t\t{0}\n\t</th>\n", $ss);
}
foreach ($powerlevels as $pn => $ps) {
$cellClass = ($cellClass + 1) % 2;
$items = "";
foreach ($sexes as $sn => $ss) {
$items .= format("\n\t<td class=\"center\">\n\t\t<a href=\"javascript:void()\"><span class=\"nc{0}{1}\" style=\"font-weight: bold;\">\n\t\t\t{2}\n\t\t</span></a>\n\t</td>\n", $sn, $pn, $ps);
}
$colors .= format("\n<tr class=\"cell{0}\">\n\t{1}\n</tr>\n", $cellClass, $items);
}
$colortable = format("\n<table class=\"width50 outline\" style=\"margin-left: 25%; margin-right: auto\">\n\t<tr class=\"header1\">\n\t\t{0}\n\t</tr>\n\t<tr class=\"cell0\">\n\t\t<td class=\"center\" colspan=\"3\">\n\t\t\t<a href=\"javascript:void()\"><span class=\"nc0x\" style=\"font-weight: bold;\">\n\t\t\t\t" . __("Banned user") . "\n\t\t\t</span></a>\n\t\t</td>\n\t</tr>\n\t{1}\n</table>\n", $headers, $colors);
$faq = Settings::pluginGet("faq");
$faq = str_replace("<colortable />", $colortable, $faq);
$code1 = '<link rel="stylesheet" type="text/css" href="http://.../MyLayout_$theme.css" />';
$code2 = '<link rel="stylesheet" type="text/css" href="http://.../MyLayout_' . $theme . '.css" />';
$faq = str_replace("<themeexample1 />", DoGeshi($code1), $faq);
$faq = str_replace("<themeexample2 />", DoGeshi($code2), $faq);
$faq = str_replace("<themelist />", implode(", ", $themefiles), $faq);
$faq = str_replace("<admin />", $admin, $faq);
write("\n<div class=\"faq outline margin\" style=\"width: 60%; overflow: auto; margin: auto;\">\n{0}\n</div>", $faq);
function DoGeshi($code)
{
return "<code>" . htmlspecialchars($code) . "</code>";
}
示例9: HandleExtraField
<?php
if (!function_exists("HandleExtraField")) {
function HandleExtraField($field, $item)
{
global $pluginSettings;
$i = $item['fieldnumber'];
$t = $item['isCaption'] ? "t" : "v";
$pluginSettings['profileExt' . $i . $t] = urlencode($_POST['extra' . $i . $t]);
return true;
}
}
$personal['extrafields'] = array("name" => "Custom profile fields", "items" => array());
for ($i = 0; $i < Settings::pluginGet('numberOfFields'); $i++) {
$personal['extrafields']['items']['extra' . $i . 't'] = array("caption" => format(__("Caption for #{0}"), $i + 1), "type" => "text", "value" => getSetting("profileExt" . $i . "t", true), "callback" => "HandleExtraField", "width" => "98%", "fieldnumber" => $i, "isCaption" => true);
$personal['extrafields']['items']['extra' . $i . 'v'] = array("caption" => format(__("Value for #{0}"), $i + 1), "type" => "text", "value" => getSetting("profileExt" . $i . "v", true), "callback" => "HandleExtraField", "width" => "98%", "fieldnumber" => $i, "isCaption" => false);
}
示例10: PipeMenuLinkEntry
<?php
$navigation->add(new PipeMenuLinkEntry(Settings::pluginGet("pagename"), "blog", "", "", "comments"));
示例11: Alert
<?php
if (str_word_count($_POST["text"]) < Settings::pluginGet("minwords")) {
Alert(__("If you have nothing interesting to post, just don't post."), __("Your post is too short."));
$rejected = true;
}
示例12: isDntEnabled
<?php
// Support Do Not Track header.
// http://donottrack.us/
function isDntEnabled()
{
return isset($_SERVER['HTTP_DNT']) && $_SERVER['HTTP_DNT'] == 1;
}
if (isDntEnabled() && Settings::pluginGet("dnt")) {
echo "<!-- Disabling Google Analytics because you have Do Not Track set! We're awesome like that. -->";
} else {
$loginstatus = json_encode($loguserid ? "Yes" : "No");
$tracking_id = json_encode(trim(Settings::pluginGet("trackingid")));
echo <<<EOS
\t<script type="text/javascript">
\t var _gaq = _gaq || [];
\t _gaq.push(['_setAccount', {$tracking_id}]);
\t _gaq.push(['_setCustomVar', 1, 'Logged in', {$loginstatus}, 2]);
\t _gaq.push(['_trackPageview']);
\t
\t (function() {
\t\tvar ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
\t\tga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
\t\tvar s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
\t })();
\t</script>
EOS;
}
示例13: explode
<?php
// Uploader support hub
$uploaddir = DATA_DIR . "uploader";
// uploader settings
$goodfiles = explode(' ', Settings::pluginGet('uploaderWhitelist'));
$badfiles = array("html", "htm", "php", "php2", "php3", "php4", "php5", "php6", "htaccess", "htpasswd", "mht", "js", "asp", "aspx", "cgi", "py", "exe", "com", "bat", "pif", "cmd", "lnk", "wsh", "vbs", "vbe", "jse", "wsf", "msc", "pl", "rb", "shtm", "shtml", "stm", "htc");
$userquota = Settings::pluginGet('uploaderCap') * 1024 * 1024;
$maxSize = Settings::pluginGet('uploaderMaxFileSize') * 1024 * 1024;
$uploaddirs = array(0 => $uploaddir, $uploaddir . '/' . $loguserid, $uploaddir . '/attachments', $uploaddir . '/objectdb');
function uploaderCleanup()
{
global $uploaddir;
$timebeforedel = 604800;
// one week
$todelete = Query("SELECT physicalname, user, private FROM {uploader} WHERE deldate!=0 AND deldate<{0}", time() - $timebeforedel);
while ($entry = Fetch($todelete)) {
if ($entry['private']) {
@unlink($uploaddir . "/" . $entry['user'] . "/" . $entry['physicalname']);
} else {
@unlink($uploaddir . "/" . $entry['physicalname']);
}
}
Query("DELETE FROM {uploader} WHERE deldate!=0 AND deldate<{0}", time() - $timebeforedel);
}
// cattype: 0=uploader file, 1=private file, 2=attachment, 3=objectdb
// cat: type=0: uploader category, type=1: nothing, type=2: post ID, type=3: object ID (except not-- object IDs aren't numeric)
function uploadFile($file, $cattype, $cat)
{
global $loguserid, $uploaddirs, $goodfiles, $badfiles, $userquota, $maxSize;
$targetdir = $uploaddirs[$cattype];
示例14: bb2_email
function bb2_email()
{
return Settings::pluginGet("email");
}
示例15:
<?php
$limit = Settings::pluginGet("limit");
doLastPosts(true, $limit);