當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Content::setContent方法代碼示例

本文整理匯總了PHP中Content::setContent方法的典型用法代碼示例。如果您正苦於以下問題:PHP Content::setContent方法的具體用法?PHP Content::setContent怎麽用?PHP Content::setContent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Content的用法示例。


在下文中一共展示了Content::setContent方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getContent

 public function getContent($section)
 {
     $sql = "SELECT * FROM content WHERE section ='" . $section . "' ";
     $result = mysqli_query(self::$conn, $sql);
     while ($row = mysqli_fetch_array($result)) {
         $Content = new Content();
         $Content->getid($row['id']);
         $Content->setSection($row['section']);
         $Content->setContent($row['content']);
         $Content->setCreated($row['created']);
         $Content->setNiceName($row['niceName']);
         return $Content;
     }
 }
開發者ID:vaskaloidis,項目名稱:woodburyflea,代碼行數:14,代碼來源:ContentDAO.php

示例2: array

<?php

$nav['index'] = array('url' => '/index', 'slug' => 'index', 'name' => 'Home', 'loggedInOnly' => false, 'weight' => -100, 'visible' => false);
if ($slug == "index") {
    $uname = 'stranger!!';
    $message = '';
    if (isset($_SESSION['message'])) {
        $message = '<p>' . $_SESSION['message'] . '</p>';
        unset($_SESSION['message']);
    }
    if (User::isValid()) {
        $uname = User::$uname;
    }
    Content::setContent(<<<EOT
\t{$message}
\tYou have reached the home of Fill The Bukkit, the global mod repository for <a href="http://bukkit.org">Bukkit</a>, the fabulous mod for <a href="http://minecraft.net">Minecraft</a>, the highly addictive online and single player 8-bit mining game
\t


EOT
);
}
開發者ID:robbiet480,項目名稱:hRepo,代碼行數:22,代碼來源:02-index.php

示例3:

    Content::setContent(<<<EOT
\t<h1>Login</h1>
<div id="loginHalf">
\t<h4>Login to hRepo</h4>
\t<form action="/login" method="post">{$message}
\t\t<div class="form-row">
\t\t\t<label for="username">Username</label>
\t\t\t<span><input type="text" name="username" id="username" value="{$unameLogin}" /></span>
\t\t</div>
\t\t<div class="form-row">
\t\t\t<label for="password">Password</label>
\t\t\t<span><input type="password" name="password" id="password" /></span>
\t\t</div>
\t\t<div class="form-row">
\t\t\t<label for="rememberme">Remember Me</label>
\t\t\t<span><input type="checkbox" name="rememberMe" id="rememberMe" value="rememberMeFoSure" /></span>
\t\t</div>
\t\t<div class="form-row form-row-last">
\t\t\t<span><input type="submit" name="login" value="Login" /></span>
\t\t</div>
\t</form>
</div>
<div id="registerHalf">
\t<h4>Need to register?</h4>
        <form action="/register" method="post" id="registerForm">
\t\t\t<div id="notificationArea">{$regMessage}</div>

                <div class="form-row">
                        <label for="usernameReg">Username</label>
                        <span><input type="text" name="username" id="usernameReg" value="{$username}" class="{$usernameClass}" /></span>
                </div>

                <div class="form-row">
                        <label for="passwordReg">Password</label>
                        <span><input type="password" name="password" id="passwordReg" value="{$password}" class="{$passwordClass}" /></span>
                </div>

\t\t\t\t<div class="form-row">
                        <label for="confirmPasswordReg">Confirm Password</label>
                        <span><input type="password" name="confirmPassword" id="confirmPasswordReg" value="{$confirmPassword}" class="{$confirmPasswordClass}" /></span>
                </div>

\t\t\t\t<div class="form-row">
                        <label for="emailReg">E-mail</label>
                        <span><input type="text" name="email" id="emailReg" value="{$email}" class="{$emailClass}" /></span>
                </div>
\t\t\t
\t\t\t\t<div class="form-row">
                        <span>{$recaptcha}</span>
                </div>
\t\t\t\t
                <div class="form-row form-row-last">
                        <span><input type="submit" name="login" value="Register!" /></span>
                </div>
        </form>
\t
</div>


EOT
);
開發者ID:robbiet480,項目名稱:hRepo,代碼行數:61,代碼來源:login.php

示例4: setContent

 private function setContent($page)
 {
     Seo::setSeo($page);
     Content::setContent($page);
     Breadcrumbs::setCrumbs($page);
 }
開發者ID:alexber127,項目名稱:StCms-v3.0,代碼行數:6,代碼來源:Pages.php

示例5:

            Content::setContent(<<<EOT
\t<h1>Create a New Plugin</h1>
\t<h3>Step 1 of 2</h3>
\t\t\t{$message}
\t\t<form action="/create/" method="POST">
\t\t\t<div class="form-row">
\t\t\t\t<label for="pname">Plugin Name</label>
\t\t\t\t<span><input type="text" name="pname" id="pname" value="{$pname}" /></span>
\t\t\t</div>
\t\t\t<div class="form-row">
\t\t\t\t<label for="pdesc">Description (<a href="/markdown/">Markdown</a> formatted)</label>
\t\t\t\t<span><textarea name="pdesc" id="pdesc">{$pdesc}</textarea></span>
\t\t\t</div>
\t\t\t<div class="form-row">
\t\t\t\t<label for="preqs">Requirements</label>
\t\t\t\t<span><input type="text" name="preqs" id="preqs" value="{$preqs}" /></span>
\t\t\t</div>
\t\t\t<div class="form-row">
\t\t\t\t<label for="pmysql">Requires MySQL?</label>
\t\t\t\t<span><input type="checkbox" name="pmysql" id="pmysql" value="yes" {$pmysql} /></span>
\t\t\t</div>
\t\t\t<div class="form-row">
\t\t\t\t<label for="ismyplugin">Is My Own Plugin?</label>
\t\t\t\t<span><input type="checkbox" name="ismyplugin" id="ismyplugin" value="yes" {$ismyplugin} /></span>
\t\t\t</div>
\t\t\t<div class="form-row" id="pauthornameRow" {$pauthornameVis}>
\t\t\t\t<label for="pauthorname">Real Author Name</label>
\t\t\t\t<span><input type="text" name="pauthorname" id="pauthorname" value="{$pauthorname}" /></span>
\t\t\t</div>
\t\t\t<div class="form-row form-row-last">
\t\t\t\t<span><input type="submit" name="submit" id="submitBtn" value="Create!" /></span>
\t\t\t</div>
\t\t</form>
EOT
);
開發者ID:robbiet480,項目名稱:hRepo,代碼行數:35,代碼來源:create.php

示例6:

    Content::setContent(<<<EOT
\t\t\t\t\t\t<h1>About</h1>
\t\t\t\t\t\t<h3>About the team</h3> 
 
<h4>Robbie Trencheny</h4> 
<p>Owner of MinecraftServers.com & Hostiio. Web devloper by day, sysadmin by night</p> 
 
<img alt="Robbie Trencheny" class="bioicon" src="http://hrepo.com/static/images/bio/robbie.png" /> 
<dl class="bioinfo"> 
\t<dt>Title</dt> 
\t<dd>Project Founder</dd> 
\t
\t<dt>IRC Nick</dt> 
\t<dd>robbiet480</dd> 
\t
\t<dt>Coding languages</dt> 
\t<dd>PHP, MySQL, HTML, CSS</dd> 
</dl> 
 
<h4>emirin</h4> 
<p>Bla bla bla</p> 
 
<img alt="Member 2" class="bioicon" src="http://placehold.it/57x57" /> 
<dl class="bioinfo"> 
\t<dt>Title</dt> 
\t<dd>sql dev</dd> 
\t
\t<dt>IRC Nick</dt> 
\t<dd>emirin_</dd> 
\t
\t<dt>Coding languages</dt> 
\t<dd>PHP, SQL</dd> 
</dl>

<h4>Alec Gorge</h4> 
<p>High school student by day, programmer by night</p> 
 
<img alt="Member 2" class="bioicon" src="http://placehold.it/57x57" /> 
<dl class="bioinfo"> 
\t<dt>Title</dt> 
\t<dd>Programmer</dd> 
\t
\t<dt>IRC Nick</dt> 
\t<dd>alecgorge</dd> 
\t
\t<dt>Coding languages</dt> 
\t<dd>PHP, MySQL, HTML, CSS, Python, Objective-C, JavaScript/ECMAScript, Java, C#</dd> 
</dl>

<h4>Sturmeh</h4> 
<p>Am I doin it right?</p> 
 
<img alt="Member 2" class="bioicon" src="http://placehold.it/57x57" /> 
<dl class="bioinfo"> 
\t<dt>Title</dt> 
\t<dd>Programmer</dd> 
\t
\t<dt>IRC Nick</dt> 
\t<dd>Sturmeh</dd> 
\t
\t<dt>Coding languages</dt> 
\t<dd>Java, PHP, MySQL</dd> 
</dl>

<h4>Organik</h4> 
<p>I'll design your life</p> 
 
<img alt="Member 2" class="bioicon" src="http://placehold.it/57x57" /> 
<dl class="bioinfo"> 
\t<dt>Title</dt> 
\t<dd>Designer/Graphics</dd> 
\t
\t<dt>IRC Nick</dt> 
\t<dd>Organik</dd> 
\t
\t<dt>Coding languages</dt> 
\t<dd>Photoshop, CSS, HTML, SQL</dd> 
</dl>

<h4>lukegb</h4>
<p>Lean, mean, teen machine</p>

<img alt="Oh hai" class="bioicon" src="http://placehold.it/57x57" />
<dl class="bioinfo">
        <dt>Title</dt>
        <dd>Programmer</dd>

        <dt>IRC Nick</dt>
        <dd>lukegb</dd>

        <dt>Coding languages</dt>
        <dd>(X)HTML, CSS, SQL, PHP, C#, Python, JavaScript/ECMAScript, Java</dd>
</dl>

<h4>GoMySQL</h4> 
<p>NULL</p> 

<img alt="GoMySQL" class="bioicon" src="http://placehold.it/57x57" /> 
<dl class="bioinfo"> 
\t<dt>Title</dt> 
//.........這裏部分代碼省略.........
開發者ID:robbiet480,項目名稱:hRepo,代碼行數:101,代碼來源:03-about.php

示例7: foreach

                $message = Message::notice('Hi there! It looks like this is the first time you\'ve uploaded files for this plugin. Simply select the files you wish to upload using the file selector below, and then provide details of your uploads in the form which will appear.');
            } else {
                $listNess = $dbQuery2->fetchAll();
                $list = '';
                foreach ($listNess as $fnameThing) {
                    $list .= '<li>' . $fnameThing['dfname'] . '</li>';
                }
                $message = Message::notice('The files you currently have on Fill are called:<br /><ul>' . $list . '</ul>');
            }
            $message .= Message::warning('Remember: if you want to upload a new version of a file, that file must be named EXACTLY the same.<br /><br />Example: I previously uploaded AwesomePlugin.jar - to upload a new version, you must ensure that it is named exactly the same.<br /><br /><b>File names cannot be changed once uploaded.</b>');
            Content::addAdditionalCSS('uploadify.css');
            Content::addAdditionalJS('jquery.uploadify.min.js');
            Content::addAdditionalJS('upload.js');
            $session = array('name' => session_name(), 'id' => session_id());
            Content::setContent(<<<EOT
\t\t\t\t<h1>Upload Files</h1>
\t\t\t\t{$message}
\t\t\t\t<div id="uploadBox"></div>
\t\t\t\t<!--<form action="/uploadComplete/{$params[0]}/{$params[1]}/" method="POST" id="uploadFormForm">-->
\t\t\t\t<form action="http://www.postbin.org/1ffsuan" method="POST" id="uploadFormForm">
\t\t\t\t<div id="uploadFormArea"></div>
\t\t\t\t<input type="submit" id="bigSubmitButton" disabled="disabled" value="Save Data" />
\t\t\t\t</form>
\t\t\t\t<script type="text/javascript">
\tuploadURI = '/handleUpload/{$params[0]}/{$params[1]}/&{$session['name']}={$session['id']}&loadSessionFromGET=true';
\t\t\t\t</script>
EOT
);
        }
    }
}
開發者ID:robbiet480,項目名稱:hRepo,代碼行數:31,代碼來源:upload.php

示例8: array

<?php

$nav['faq'] = array('url' => '/faq', 'slug' => 'faq', 'name' => 'FAQ', 'loggedInOnly' => false, 'weight' => 3);
if ($slug == "faq") {
    Content::setContent(<<<EOT
\t<h1>1. Why is Sturmeh so cool?</h1>
\t<p>Many scientists have tried to derive the answer to the question but even the world's best minds are unsure of what causes the effect.</p>
\t<h3>2. Why is sk89q so lame?</h3>
\t<p>Many scientists have tried to derive the answer to the question but even the world's best minds are unsure of what causes the effect. Also, his plugins suck</p>
\t<h3>3. Why now?</h3>
\t<p>Why not?</p>


EOT
);
}
開發者ID:robbiet480,項目名稱:hRepo,代碼行數:16,代碼來源:05-faq.php

示例9:

if (empty(Content::$content) && !isset($httpError)) {
    $httpError = 404;
}
if (!isset($httpError)) {
    $httpError = 200;
}
if ($httpError == 403) {
    Content::$forcedTitle = "403 Unauthorised";
    Content::$status = "403 Unauthorised";
    $maybeLogin = '';
    if (User::$role == User::ROLE_GUEST) {
        $maybeLogin = '<p>You might need to <a href="/login/">log in</a> to access this area.</p>';
    }
    Content::setContent(<<<EOT
\t<h1>Access Denied</h1>
\t<p>You do not have the correct privileges to access this area.</p>
\t{$maybeLogin}
EOT
);
} else {
    if ($httpError == 404) {
        Content::$forcedTitle = "404 Error";
        Content::$status = "404 Not Found";
        Content::setcontent(<<<EOT
\t<h1>404 Error</h1>
\t<p>You suck.</p>
EOT
);
    }
}
開發者ID:robbiet480,項目名稱:hRepo,代碼行數:30,代碼來源:zz-http-error.php

示例10: unset

        if ($dbr->rowCount() != 1) {
            Log::add('Database did not return a row');
            Content::setContent($activationError);
        } else {
            $uid = $dbr->fetchColumn();
            Log::add('Database returned a row. UID: ' . $uid);
            unset($dbr);
            if ($slug == 'activate') {
                // ugh, annoying database class.
                $dbh = Database::getHandle();
                $dbr = $dbh->prepare('UPDATE users SET validate_key = NULL, status = 1 WHERE uid = ?');
                if ($dbr->execute(array($uid))) {
                    Log::add('Account activation successful.');
                    Content::setContent(Message::success('Your account has been activated successfully!'));
                } else {
                    Log::add('Activation error. Database says: ' . print_r(Database::getHandle()->errorInfo(), true));
                    Content::setContent(Message::error('An error occurred during account activation. Please contact an hRepo administrator.'));
                }
            } else {
                // now I've got to delete their account...
                if (Database::delete('users', array('uid = ?', $uid), 1)) {
                    Log::add('Account deletion successful.');
                    Content::setContent(Message::success('The account has been deleted successfully.'));
                } else {
                    Log::add('Deletion error. Database says: ' . print_r(Database::getHandle()->errorInfo(), true));
                    Content::setContent(Message::error('An error occurred during account deletion. Please contact an hRepo administrator.'));
                }
            }
        }
    }
}
開發者ID:robbiet480,項目名稱:hRepo,代碼行數:31,代碼來源:activatecancel.php

示例11: array

<?php

$nav['contact'] = array('url' => '/contact', 'slug' => 'contact', 'name' => 'Contact', 'loggedInOnly' => false, 'weight' => 5);
// -1 for only not logged in
if ($slug == "contact") {
    Content::setContent(<<<EOT
\t<h1>Contact Us!</h1>
\t<h2>IRC</h2>
\tJoin our IRC chatroom!<br />
\tJust point your favorite client to irc.esper.net, port 6667 and join #bukkit!
\t<h2>Twitter</h2>
\tTweet us on Twitter! We are <a href="http://twitter.com/bukkit">hRepo</a>

EOT
);
}
開發者ID:robbiet480,項目名稱:hRepo,代碼行數:16,代碼來源:04-contact.php

示例12: chdir

<?php

if ($slug == "git") {
    Content::$forcedTitle = "Git Update";
    if (count($params) > 0) {
        chdir(HR_ROOT);
        Content::setContent("\n\t\t\t<h1>Updating website from git...</h1>\n\t\t\t<pre>" . `echo Running git reset --hard && git reset --hard 2>&1 && echo Running git pull && git pull` . "</pre><br />\n\t\t\t<h3>Now pulling latest commit information from Github...</h3>\n\t\t");
        inclib('github/lib/phpGitHubApi.php');
        $phpGH = new phpGitHubApi();
        $phpGH->authenticate('lukegb', '3b4e0c11ee0681db035b0e885147e236', phpGitHubAPI::AUTH_HTTP_TOKEN);
        $latestCommits = $phpGH->getCommitApi()->getBranchCommits('robbiet480', 'hRepo', 'master');
        $gitCommit = array('long' => $latestCommits[0]['id'], 'short' => substr($latestCommits[0]['id'], 0, 7), 'userid' => $latestCommits[0]['author']['login'], 'commitdate' => $latestCommits[0]['committed_date']);
        file_put_contents(HR_ROOT . '/gitcommit.txt', serialize($gitCommit));
        Content::append('<p>Last git commit: ' . $gitCommit['long'] . ' by ' . $gitCommit['userid'] . '</p>');
    } else {
        Content::setContent("\n\t\t\t<h1>Authorisation code incorrect or missing</h2>\n\t\t\t<p>Git update did not go through.</p>\n\t\t");
    }
}
開發者ID:robbiet480,項目名稱:hRepo,代碼行數:18,代碼來源:00-git.php

示例13: ob_start

<?php

if ($slug == "phpinfol33tHAXX") {
    ob_start();
    phpinfo();
    $phpinfo = ob_get_contents();
    ob_end_clean();
    Content::setContent(<<<EOT
\t<h1>LOL PHPINFO</h1>
\t<p>{$phpinfo}</p>
\t


EOT
);
}
開發者ID:robbiet480,項目名稱:hRepo,代碼行數:16,代碼來源:01-phpinfo.php

示例14: setContent

    function setContent($content_body)
    {
        $this->content_body = htmlentities("{$content_body}");
    }
    function getContent()
    {
        return $this->content_body;
    }
}
/* Test Id */
$content = new Content();
$content->setID();
$content->setID();
$content->setID();
$content->setID();
$content->setID();
$content->setID() . '<br/>';
$content->setAuthor('Guillermina', 'Gonjon') . '<br/>';
$content->setTitle("this is my title") . '<br/>';
$content->setContent("This is an example of what this page can do.  This is my content for this page.");
echo $content->getAuthor() . '<br/>';
echo $content->getDate() . '<br/>';
echo $content->getTitle() . '<br/>';
echo $content->getContent() . '<br/>';
$theid = $content->content_id;
echo $content->formatID($theid) . '<br/>';
var_dump($content);
//echo $content->formatted_id.'<br/>';
$output = shell_exec('cal 2016 | grep 2016') . '<br/>';
//echo "<pre>$output</pre>";
//echo "<br>".phpversion().'<br/>';
開發者ID:gmanon,項目名稱:contributions,代碼行數:31,代碼來源:Content.class.php

示例15:

                        } else {
                            $extraforadmins = '';
                        }
                        // Welcome!
                        Content::setContent(<<<EOT
<h1>{$uname}'s profile</h1>
<h2>User Details</h2>
<dl class="userdets">

<dt>Username</dt>
<dd>{$uname}</dd>

<dt>Email Address</dt>
<dd>{$email}</dd>
\t
<dt>Access Level</dt>
<dd>{$axx}</dd>
\t
<dt>Status</dt>
<dd>{$statustext}</dd>
\t
<dt>Date Registered</dt>
<dd>{$regdatetext}</dd>
{$extraforadmins}
</dl>
EOT
);
                    }
                }
                Sidebar::clear();
                if (User::$role == 0 && !User::getField('wantsdev')) {
開發者ID:robbiet480,項目名稱:hRepo,代碼行數:31,代碼來源:user.php


注:本文中的Content::setContent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。