当前位置: 首页>>代码示例>>PHP>>正文


PHP Core::assign方法代码示例

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


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

示例1: VALUES

$username = $core->CurrentUser()->Name;
// Browser string
$browser = @$_SERVER["HTTP_USER_AGENT"];
if (empty($browser)) {
    $browser = "Unknown";
}
// Save username and browser string in our database
// SQL($query) is a method of the Core object that runs a SQL query on the plugin database
// SQLEscape($string) is also a Core method that is a shorthand for mysql_real_escape_string($string)
$core->SQL("INSERT INTO `browserstats` (`User`, `Browser`) VALUES ('" . $core->SQLEscape($username) . "', '" . $core->SQLEscape($browser) . "') ON DUPLICATE KEY UPDATE `Browser`='" . $core->SQLEscape($browser) . "'");
// Read the database
$result = $core->SQL("SELECT * FROM `browserstats`");
$browserstats = array();
while ($row = mysql_fetch_assoc($result)) {
    $br = new Browser($core->SQLUnEscape($row["Browser"]));
    $browsername = "{$br->Platform}, {$br->Name} {$br->Version}";
    if (isset($browserstats[$browsername])) {
        $browserstats[$browsername] += 1;
    } else {
        $browserstats[$browsername] = 1;
    }
}
// We have the browser stats in an array. Now assign it to a Smarty template variable
// So that it will be availabe in the Smarty template.
// You can assign any type of variable: numbers, strings, arrays, objects... all work
// The format is $core->assign("template_variable_name", "variable_value")
$core->assign("browserstats", $browserstats);
// We are done. Last step is to display our Smarty template
// PlugInPath is a property of the Core object that returns the absolute path to the main plugin directory.
// Relative paths do not work here.
$core->display($core->PlugInPath . "browserstats/browserstats.tpl");
开发者ID:Covert-Inferno,项目名称:eve-corp-portal,代码行数:31,代码来源:index.php

示例2: elseif

    $action = "home";
}
$result = 0;
if (isset($_GET["read"]) && is_numeric(@$_GET["read"])) {
    $note = $cms->ReadNotepad($_GET["read"]);
    $_POST["id"] = $note->ID;
    $_POST["title"] = $note->Title;
    if ($cms->IsIGB()) {
        $_POST["text"] = strip_tags($note->Text);
    } else {
        $_POST["text"] = $note->Text;
    }
    $action = "read";
} elseif ($action == "home") {
    $titles = $cms->GetNotepadTitles();
    $cms->assign("titles", $titles);
} elseif ($action == "newdone") {
    if ($_POST["submit"] == "Save") {
        if (empty($_POST["title"]) || empty($_POST["text"])) {
            $action = "new";
            $result = 1;
        } else {
            $cms->NewNotepad($_POST["title"], $_POST["text"]);
            $cms->Goto("notepad.php");
        }
    } else {
        $cms->Goto("notepad.php");
    }
} elseif ($action == "editdone") {
    if ($_POST["submit"] == "Save") {
        if (empty($_POST["title"]) || empty($_POST["text"])) {
开发者ID:Covert-Inferno,项目名称:eve-corp-portal,代码行数:31,代码来源:notepad.php

示例3: Core

<?php

require_once '../core/core.class.php';
$cms = new Core();
$step = @$_POST["step"];
if (empty($step)) {
    $step = 1;
}
$result = 0;
$cms->assign("apiuserid", @$_POST["apiuserid"]);
$cms->assign("apikey", @$_POST["apikey"]);
$cms->assign("charid", @$_POST["charid"]);
$cms->assign("charname", @$_POST["charname"]);
$cms->assign("corpname", @$_POST["corpname"]);
$cms->assign("corpticker", @$_POST["corpticker"]);
$cms->assign("corpid", @$_POST["corpid"]);
if ($step == 2) {
    if (empty($_POST["apiuserid"]) | empty($_POST["apikey"])) {
        $result = 1;
        $step = 1;
    } else {
        $res = $cms->GetUserCharacters($_POST["apiuserid"], $_POST["apikey"]);
        if ($res === FALSE) {
            $result = 2;
            $step = 1;
        } elseif (empty($res)) {
            $result = 3;
            $step = 1;
        } elseif (count($res) == 1) {
            $result = 4;
            $step = 2;
开发者ID:Covert-Inferno,项目名称:eve-corp-portal,代码行数:31,代码来源:register.php

示例4: Core

<?php

require_once '../core/core.class.php';
$cms = new Core();
$result = 0;
$cms->assign("username", @$_POST["username"]);
$cms->assign("apiuserid", @$_POST["apiuserid"]);
$cms->assign("apikey", @$_POST["apikey"]);
if (isset($_POST["submit"])) {
    if (empty($_POST["apiuserid"]) || empty($_POST["apikey"])) {
        $result = 1;
    } elseif (empty($_POST["username"])) {
        $result = 7;
    } elseif (empty($_POST["password1"]) || empty($_POST["password2"])) {
        $result = 4;
    } elseif ($_POST["password1"] != $_POST["password2"]) {
        $result = 5;
    } else {
        $result = $cms->CoreSQL("SELECT * FROM users WHERE Name='" . $cms->SQLEscape($_POST["username"]) . "' OR FIND_IN_SET('" . $cms->SQLEscape($_POST["username"]) . "', Alts) LIMIT 1");
        if (mysql_num_rows($result) == 0) {
            $result = 6;
        } else {
            $res = $cms->GetUserCharacters($_POST["apiuserid"], $_POST["apikey"]);
            if ($res === FALSE) {
                $result = 2;
            } elseif (empty($res)) {
                $result = 3;
            } elseif (count($res) > 0) {
                foreach ($res as $char) {
                    if ($char["Name"] == $_POST["username"]) {
                        $result = 8;
开发者ID:Covert-Inferno,项目名称:eve-corp-portal,代码行数:31,代码来源:newpassword.php

示例5: Core

<?php

require_once '../core/core.class.php';
$cms = new Core();
if (isset($_GET["unsubscribe"]) && is_numeric(@$_GET["unsubscribe"])) {
    $cms->UnSubscribeForumTopic($_GET["unsubscribe"]);
}
// List all signed-up events
$calendar = $cms->ReadCalendarSignups();
$cms->assign("calendar", $calendar);
// Subscribed topics
$subs = $cms->GetForumSubscriptions();
$cms->assign('subscriptions', $subs);
$cms->display('signups.tpl');
开发者ID:Covert-Inferno,项目名称:eve-corp-portal,代码行数:14,代码来源:signups.php

示例6: Core

<?php

require_once '../core/core.class.php';
$cms = new Core();
if (!$cms->AccessCheck()) {
    header("Location: access.php");
    exit;
}
$article = $cms->ReadArticle(3);
$cms->assign("quickinfo", $article);
$cms->display('quickinfo.tpl');
开发者ID:Covert-Inferno,项目名称:eve-corp-portal,代码行数:11,代码来源:quickinfo.php

示例7: elseif

$action = @$_GET["action"];
if (empty($action)) {
    $action = "plugins";
}
$result = 0;
if (isset($_GET["edit"]) && is_numeric(@$_GET["edit"])) {
    if (!isset($_POST["id"])) {
        $plugin = $cms->ReadPlugIn($_GET["edit"]);
        $_POST["id"] = $plugin->ID;
        $_POST["title"] = $plugin->Title;
        $_POST["releasecontrol"] = $plugin->Release;
        $_POST["accesscontrol"] = $plugin->ReadAccess;
        $_POST["showigb"] = $plugin->ShowIGB ? "on" : "";
        $_POST["showadmin"] = $plugin->ShowAdmin ? "on" : "";
    }
    $cms->assign("id", @$_POST["id"]);
    $cms->assign("title", @$_POST["title"]);
    $cms->assign("releasecontrol", @$_POST["releasecontrol"]);
    $cms->assign("accesscontrol", @$_POST["accesscontrol"]);
    $cms->assign("showigb", @$_POST["showigb"]);
    $cms->assign("showadmin", @$_POST["showadmin"]);
    $action = "edit";
} elseif ($action == "editdone" && is_numeric(@$_POST["id"])) {
    if ($_POST["submit"] == "Save") {
        if (empty($_POST["title"])) {
            $action = "edit";
            $result = 1;
            $cms->assign("id", @$_POST["id"]);
            $cms->assign("title", @$_POST["title"]);
            $cms->assign("releasecontrol", @$_POST["releasecontrol"]);
            $cms->assign("accesscontrol", @$_POST["accesscontrol"]);
开发者ID:Covert-Inferno,项目名称:eve-corp-portal,代码行数:31,代码来源:plugins.php

示例8: Core

<?php

require_once '../core/core.class.php';
$cms = new Core();
$ismoderator = $cms->CurrentUser()->HasPortalRole(User::MDYN_CEO) || $cms->CurrentUser()->HasPortalRole(User::MDYN_ForumModerator) || $cms->CurrentUser()->HasPortalRole(User::MDYN_Administrator) || $cms->CurrentUser()->HasEVERole(User::EVE_Director) ? 1 : 0;
$cms->assign("ismoderator", $ismoderator);
$cms->assign("pagetitle", " | Forums");
if (isset($_GET["category"]) && is_numeric(@$_GET["category"])) {
    $access = $cms->CanReadCategory($_GET["category"]);
    if ($access == 0) {
        $cms->Goto("access.php");
    }
    if ($access == 2) {
        $cms->Goto("forums.php?getcategorypassword=" . $_GET["category"]);
    }
    $page = 0;
    if (isset($_GET["page"]) && is_numeric(@$_GET["page"])) {
        $page = $_GET["page"] - 1;
    }
    $pagecount = floor($cms->ReadForumTopicCount($_GET["category"]) / 20) + 1;
    if ($pagecount < 0) {
        $pagecount = 0;
    }
    if ($page < 0) {
        $page = 0;
    }
    if ($page > $pagecount - 1) {
        $page = $pagecount - 1;
    }
    $cat = $cms->ReadForumCategory($_GET["category"]);
    $topics = $cms->ReadForumTopics($_GET["category"], $page * 20);
开发者ID:Covert-Inferno,项目名称:eve-corp-portal,代码行数:31,代码来源:forums.php

示例9: Core

<?php

require_once '../core/core.class.php';
$cms = new Core();
$action = @$_GET["action"];
if (empty($action)) {
    $action = "home";
}
$result = 0;
$isadmin = $cms->CurrentUser()->HasPortalRole(User::MDYN_CEO) || $cms->CurrentUser()->HasPortalRole(User::MDYN_Administrator) || $cms->CurrentUser()->HasEVERole(User::EVE_Director) ? 1 : 0;
$cms->assign("isadmin", $isadmin);
if ($cms->CurrentUser()->HasPortalRole(User::MDYN_CanSubmitNews) || $cms->CurrentUser()->AccessRight() >= 3) {
    $cms->assign("canpost", true);
}
if (isset($_GET["read"]) && is_numeric(@$_GET["read"])) {
    // Show news item from the archive
    $note = $cms->ReadNewsItem($_GET["read"]);
    $_POST["id"] = $note->ID;
    $_POST["title"] = $note->Title;
    $_POST["text"] = $note->Text;
    $_POST["readaccess"] = $note->ReadAccess;
    $cms->assign("author", $note->AuthorName);
    $cms->assign("date", $note->Date);
    $cms->assign("editid", $isadmin == true || $cms->CurrentUser()->AccessRight() >= 4 || $note->Author == $cms->CurrentUser()->ID ? $note->ID : 0);
    $action = "read";
} elseif (isset($_GET["edit"]) && is_numeric(@$_GET["edit"])) {
    $note = $cms->ReadNewsItem($_GET["edit"]);
    $_POST["id"] = $note->ID;
    $_POST["title"] = $note->Title;
    $_POST["text"] = $note->Text;
    $_POST["readaccess"] = $note->ReadAccess;
开发者ID:Covert-Inferno,项目名称:eve-corp-portal,代码行数:31,代码来源:news.php

示例10: Core

<?php

require_once '../core/core.class.php';
$cms = new Core();
$action = @$_GET["action"];
if (empty($action)) {
    $action = "home";
}
$result = 0;
$isadmin = $cms->CurrentUser()->HasPortalRole(User::MDYN_CEO) || $cms->CurrentUser()->HasPortalRole(User::MDYN_Administrator) || $cms->CurrentUser()->HasEVERole(User::EVE_Director) ? 1 : 0;
$cms->assign("isadmin", $isadmin);
if ($cms->CurrentUser()->HasPortalRole(User::MDYN_CanSubmitCalendar) || $cms->CurrentUser()->AccessRight() >= 3) {
    $cms->assign("canpost", true);
}
// All corp members can post
if ($cms->CurrentUser()->AccessRight() >= 2) {
    $cms->assign("canpost", true);
}
if (isset($_GET["view"])) {
    // List all calendar entries
    $allcalendar = $cms->ReadCalendarAll();
    $calendar = array();
    foreach ($allcalendar as $item) {
        if (date("Ymd", strtotime($item->Date)) == $_GET["view"]) {
            $calendar[] = $item;
        }
    }
    $cms->assign("view", date("Y-m-d", strtotime($_GET["view"])));
    $cms->assign("calendar", $calendar);
    $action = "view";
} elseif (isset($_GET["read"]) && is_numeric(@$_GET["read"])) {
开发者ID:Covert-Inferno,项目名称:eve-corp-portal,代码行数:31,代码来源:calendar.php

示例11: while

    $portalid = $core->CurrentUser()->ID;
}
if ($template == "" || empty($template) || $template < 0) {
    $template = 0;
}
if ($templatepost == "" || empty($templatepost) || $templatepost < 0) {
    $templatepost = 0;
}
if ($return == "" || empty($return) || $return < 0) {
    $return = 0;
}
if ($action == "home") {
    $result = $core->SQL("SELECT * FROM operations_params");
    while ($row = mysql_fetch_assoc($result)) {
        if ($row["Name"] == "IndexDate") {
            $core->assign("indexdate", $row["Value"]);
        }
        if ($row["Name"] == "IndexTime") {
            $core->assign("indextime", $row["Value"]);
        }
    }
} elseif ($action == "qtc7" || $action == "qtc30") {
    $timeperiod = 7;
    if ($action == "qtc30") {
        $timeperiod = 30;
    }
    $raw = file_get_contents("http://www.starvingpoet.net/feeds/mmi.xml");
    if ($raw !== FALSE) {
        $xml = new SimpleXMLElement($raw);
        $date = $xml["date"];
        $date = substr($date, 0, 4) . "-" . substr($date, 4, 2) . "-" . substr($date, 6, 2);
开发者ID:Covert-Inferno,项目名称:eve-corp-portal,代码行数:31,代码来源:index.php

示例12: Core

<?php

require_once '../core/core.class.php';
$cms = new Core();
if ($cms->CurrentUser()->Name == "Guest") {
    header("Location: access.php");
    exit;
}
$action = @$_GET["action"];
$result = 0;
if (isset($_GET["user"]) && is_numeric(@$_GET["user"])) {
    $cms->assign('showuser', $cms->GetUserFromID($_GET["user"]));
    $cms->assign('posts', $cms->ForumRepliesByAuthor($_GET["user"]));
    $_GET["action"] = "user";
} elseif ($action == "editdone") {
    if ($_POST["submit"] == "Save") {
        $cms->EditUserInfo($_POST["timezone"], $_POST["email"], $_POST["im"], $_POST["dob_Year"] . "-" . $_POST["dob_Month"] . "-" . $_POST["dob_Day"], $_POST["location"]);
        if (!empty($_POST["apiuserid"]) && !empty($_POST["apikey"])) {
            $cms->EditUserAPIInfo($_POST["apiuserid"], $_POST["apikey"]);
        }
        $settings = 0;
        if (@$_POST["showgamenews"] == "on") {
            $settings = $settings | User::ShowGameNews;
        }
        if (@$_POST["showdevblogs"] == "on") {
            $settings = $settings | User::ShowDevBlogs;
        }
        if (@$_POST["showrpnews"] == "on") {
            $settings = $settings | User::ShowRPNews;
        }
        if (@$_POST["showtqstatus"] == "on") {
开发者ID:Covert-Inferno,项目名称:eve-corp-portal,代码行数:31,代码来源:profile.php

示例13: Core

<?php

require_once '../core/core.class.php';
$cms = new Core();
if (!$cms->AccessCheck(User::EVE_Director, array(User::MDYN_CEO, User::MDYN_Administrator, User::MDYN_Developer))) {
    $cms->Goto("access.php");
}
$action = @$_GET["action"];
if (empty($action)) {
    $action = "cronjobs";
}
$result = 0;
$crontypes = array("Hourly at xx:00", "Hourly at xx:30", "Daily at 00:00 GMT", "Daily at 11:00 GMT", "Daily at 12:00 GMT", "Weekly on Mondays at 00:00 GMT", "Weekly on Wednesdays at 00:00 GMT", "Weekly on Fridays at 00:00 GMT", "Weekly on Saturdays at 00:00 GMT", "Weekly on Sundays at 00:00 GMT");
$cms->assign("crontypes", $crontypes);
if (isset($_GET["edit"]) && is_numeric(@$_GET["edit"])) {
    if (!isset($_POST["id"])) {
        $job = $cms->ReadCronJob($_GET["edit"]);
        $_POST["id"] = $job->ID;
        $_POST["title"] = $job->Title;
        $_POST["type"] = $job->ScheduleType;
        $_POST["source"] = $job->Source;
    }
    $cms->assign("id", @$_POST["id"]);
    $cms->assign("title", @$_POST["title"]);
    $cms->assign("type", @$_POST["type"]);
    $cms->assign("source", @$_POST["source"]);
    $action = "edit";
} elseif ($action == "editdone") {
    if ($_POST["submit"] == "Save") {
        if (empty($_POST["title"]) || empty($_POST["source"])) {
            $action = "edit";
开发者ID:Covert-Inferno,项目名称:eve-corp-portal,代码行数:31,代码来源:cron.php

示例14: elseif

if (!$cms->AccessCheck(User::EVE_Director, array(User::MDYN_CEO, User::MDYN_Administrator))) {
    $cms->Goto("access.php");
}
$action = @$_GET["action"];
if (empty($action)) {
    $action = "users";
}
$result = 0;
if (isset($_GET["edit"]) && is_numeric(@$_GET["edit"])) {
    if (!isset($_POST["id"])) {
        $note = $cms->ReadArticle($_GET["edit"]);
        $_POST["id"] = $note->ID;
        $_POST["title"] = $note->Title;
        $_POST["text"] = $note->Text;
    }
    $cms->assign("id", @$_POST["id"]);
    $cms->assign("title", @$_POST["title"]);
    $cms->assign("text", @$_POST["text"]);
    $action = "edit";
} elseif ($action == "editdone") {
    if ($_POST["submit"] == "Save") {
        if (empty($_POST["title"]) || empty($_POST["text"])) {
            $action = "edit";
            $result = 1;
            $cms->assign("id", @$_POST["id"]);
            $cms->assign("title", @$_POST["title"]);
            $cms->assign("text", @$_POST["text"]);
        } else {
            if ($_POST["id"] == 1 || $_POST["id"] == 2) {
                $cms->EditArticle($_POST["id"], $_POST["title"], $_POST["text"], 0, 4);
            } else {
开发者ID:Covert-Inferno,项目名称:eve-corp-portal,代码行数:31,代码来源:admin.php

示例15: Core

<?php

require_once '../core/core.class.php';
$cms = new Core();
$article = $cms->ReadArticle(4);
$cms->assign("help", $article);
$cms->display('help.tpl');
开发者ID:Covert-Inferno,项目名称:eve-corp-portal,代码行数:7,代码来源:help.php


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