本文整理汇总了PHP中gpFiles::NewTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP gpFiles::NewTitle方法的具体用法?PHP gpFiles::NewTitle怎么用?PHP gpFiles::NewTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gpFiles
的用法示例。
在下文中一共展示了gpFiles::NewTitle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CreateNew
/**
* Create a new page from a user post
*
*/
function CreateNew()
{
global $gp_index, $gp_titles, $langmessage;
includeFile('tool/editing_page.php');
$title = $_POST['title'];
$title = admin_tools::CheckPostedNewPage($title, $message);
if ($title === false) {
message($message);
return false;
}
$type = $_POST['content_type'];
$content = editing_page::GetDefaultContent($type);
if ($content === false) {
return false;
}
$label = admin_tools::PostedLabel($_POST['title']);
if ($type == 'text') {
$content = '<h2>' . strip_tags($_POST['title']) . '</h2>' . $content;
}
//add to $gp_index first!
$index = common::NewFileIndex();
$gp_index[$title] = $index;
if (!gpFiles::NewTitle($title, $content, $type)) {
message($langmessage['OOPS'] . ' (cn1)');
unset($gp_index[$title]);
return false;
}
//add to gp_titles
$new_titles = array();
$new_titles[$index]['label'] = $label;
$new_titles[$index]['type'] = $type;
$gp_titles += $new_titles;
return $index;
}
示例2: CreateNew
/**
* Create a new page from a user post
*
*/
function CreateNew()
{
global $gp_index, $gp_titles, $langmessage, $gpAdmin;
includeFile('tool/editing_page.php');
includeFile('tool/editing.php');
//check title
$title = $_POST['title'];
$title = admin_tools::CheckPostedNewPage($title, $message);
if ($title === false) {
message($message);
return false;
}
//multiple section types
$type = $_POST['content_type'];
if (strpos($type, '{') === 0) {
$types = json_decode($type, true);
if ($types) {
$types += array('wrapper_class' => 'gpRow');
$content = array();
//wrapper section
$section = gp_edit::DefaultContent('wrapper_section');
$section['contains_sections'] = count($types['types']);
$section['attributes']['class'] = $types['wrapper_class'];
$content[] = $section;
//nested sections
foreach ($types['types'] as $type) {
if (strpos($type, '.')) {
list($type, $class) = explode('.', $type, 2);
} else {
$class = '';
}
$section = gp_edit::DefaultContent($type);
$section['attributes']['class'] .= ' ' . $class;
$content[] = $section;
}
}
//single section type
} else {
$content = gp_edit::DefaultContent($type);
if ($content['content'] === false) {
return false;
}
if ($type == 'text') {
$content['content'] = '<h2>' . strip_tags($_POST['title']) . '</h2>' . $content['content'];
}
}
//add to $gp_index first!
$index = common::NewFileIndex();
$gp_index[$title] = $index;
if (!gpFiles::NewTitle($title, $content, $type)) {
message($langmessage['OOPS'] . ' (cn1)');
unset($gp_index[$title]);
return false;
}
//add to gp_titles
$new_titles = array();
$new_titles[$index]['label'] = admin_tools::PostedLabel($_POST['title']);
$new_titles[$index]['type'] = $type;
$gp_titles += $new_titles;
//add to users editing
if ($gpAdmin['editing'] != 'all') {
$gpAdmin['editing'] = rtrim($gpAdmin['editing'], ',') . ',' . $index . ',';
$users = gpFiles::Get('_site/users');
$users[$gpAdmin['username']]['editing'] = $gpAdmin['editing'];
gpFiles::SaveData('_site/users', 'users', $users);
}
return $index;
}
示例3: CreateNew
/**
* Create a new page from a user post
*
*/
function CreateNew()
{
global $gp_index, $gp_titles, $langmessage, $gpAdmin;
includeFile('tool/editing_page.php');
includeFile('tool/editing.php');
$title = $_POST['title'];
$title = admin_tools::CheckPostedNewPage($title, $message);
if ($title === false) {
message($message);
return false;
}
$type = $_POST['content_type'];
$section = gp_edit::DefaultContent($type);
if ($section['content'] === false) {
return false;
}
$label = admin_tools::PostedLabel($_POST['title']);
if ($type == 'text') {
$section['content'] = '<h2>' . strip_tags($_POST['title']) . '</h2>' . $section['content'];
}
//add to $gp_index first!
$index = common::NewFileIndex();
$gp_index[$title] = $index;
if (!gpFiles::NewTitle($title, $section, $type)) {
message($langmessage['OOPS'] . ' (cn1)');
unset($gp_index[$title]);
return false;
}
//add to gp_titles
$new_titles = array();
$new_titles[$index]['label'] = $label;
$new_titles[$index]['type'] = $type;
$gp_titles += $new_titles;
//add to users editing
if ($gpAdmin['editing'] != 'all') {
$gpAdmin['editing'] = rtrim($gpAdmin['editing'], ',') . ',' . $index . ',';
$users = gpFiles::Get('_site/users');
$users[$gpAdmin['username']]['editing'] = $gpAdmin['editing'];
gpFiles::SaveData('_site/users', 'users', $users);
}
return $index;
}
示例4: Install_DataFiles_New
function Install_DataFiles_New($destination = false, $config, $base_install = true)
{
global $langmessage;
if ($destination === false) {
$destination = $GLOBALS['dataDir'];
}
//set config variables
//$config = array(); //because of ftp values
$gpLayouts = array();
$gpLayouts['default']['theme'] = 'Light_Texture/Blue';
$gpLayouts['default']['color'] = '#93c47d';
$gpLayouts['default']['label'] = $langmessage['default'];
$config['toemail'] = $_POST['email'];
$config['gpLayout'] = 'default';
$config['title'] = Install_Tools::Install_Title();
$config['keywords'] = 'gpEasy CMS, Easy CMS, Content Management, PHP, Free CMS, Website builder, Open Source';
$config['desc'] = 'A new gpEasy CMS installation. You can change your site\'s description in the configuration.';
$config['timeoffset'] = '0';
$config['langeditor'] = 'inherit';
$config['dateformat'] = '%m/%d/%y - %I:%M %p';
$config['gpversion'] = $GLOBALS['gpversion'];
$config['shahash'] = function_exists('sha1');
if (!isset($config['gpuniq'])) {
$config['gpuniq'] = common::RandomString(20);
}
$config['combinecss'] = Install_Tools::BooleanValue('combinecss', true);
$config['combinejs'] = Install_Tools::BooleanValue('combinejs', true);
$config['etag_headers'] = Install_Tools::BooleanValue('etag_headers', true);
//directories
gpFiles::CheckDir($destination . '/data/_uploaded/image');
gpFiles::CheckDir($destination . '/data/_uploaded/media');
gpFiles::CheckDir($destination . '/data/_uploaded/file');
gpFiles::CheckDir($destination . '/data/_uploaded/flash');
gpFiles::CheckDir($destination . '/data/_sessions');
$content = '<h2>Welcome!</h2>
<p>Welcome to your new gpEasy powered website. Now that gpEasy is installed, you can start editing the content and customising your site.</p>
<h3>Getting Started</h3>
<p>You are currently viewing the default home page of your website. Here\'s a quick description of how to edit this page.</p>
<ol>
<li>First make sure you're ' . Install_Tools::Install_Link_Content('Admin_Main', 'logged in', 'file=Home') . '.</li>
<li>Then, to edit this page, click the "Edit" link that appears when you move your mouse over the content.</li>
<li>Make your edits, click "Save" and you're done!</li>
</ol>
<h3>More Options</h3>
<ul>
<li>Adding, renaming, deleting and organising your pages can all be done in the ' . Install_Tools::Install_Link_Content('Admin_Menu', 'Page Manager') . '.</li>
<li>Choose from a ' . Install_Tools::Install_Link_Content('Admin_Theme_Content', 'variety of themes') . ' to give your site a custom look.</li>
<li>Then, you can ' . Install_Tools::Install_Link_Content('Admin_Theme_Content', 'add, remove and rearrange', 'cmd=editlayout') . ' the content of your site without editing the html.</li>
<li>Take a look at the Administrator Toolbar to access all the features of gpEasy.</li>
</ul>
<h3>Online Resources</h3>
<p>gpEasy.com has a number of resources to help you do even more with gpEasy.</p>
<ul>
<li>Find more community developed <a href="http://gpeasy.com/Special_Addon_Themes" title="gpEasy CMS Themes">themes</a> and <a href="http://gpeasy.com/Special_Addon_Plugins" title="gpEasy CMS Plugin">plugins</a> to enhance your site.</li>
<li>Get help in the <a href="http://gpeasy.com/Special_Forum" title="gpEasy CMS Forum">gpEasy forum</a>.</li>
<li>Show off your <a href="http://gpeasy.com/Special_Powered_by" title="Sites Using gpEasy CMS">gpEasy powered site</a> or list your <a href="http://gpeasy.com/Special_Service_Provider" title="Businesses Using gpEasy CMS">gpEasy related business</a>.</li>
</ul>';
gpFiles::NewTitle('Home', $content);
gpFiles::NewTitle('Help_Videos', "<h1>Help Videos</h1>\n\t\t<p>Video tutorials are often a fast and easy way to learn new things quickly.\n\t\tSo far, we only have one in Deutsch (German) made by <a href=\"http://gpeasy.com/Special_Service_Provider?id=57\" title=\"IT Ricther on gpEasy.com\">IT Richter</a>.\n\t\tIf you make a video tutorial for gpEasy, <a href=\"http://gpeasy.com/Contact\">let us know</a>, and we'll make sure it's included in our list.\n\t\t</p>\n\t\t<p>And as always, to edit this page, just click the \"Edit\" button while logged in.</p>\n\t\t<h2>Deutsch</h2>\n\t\t<p><iframe width=\"560\" height=\"315\" src=\"http://www.youtube.com/embed/04cNgR1EiFY\" frameborder=\"0\" allowfullscreen></iframe></p>\n\t\t");
gpFiles::NewTitle('Child_Page', '<h1>A Child Page</h1><p>This was created as a subpage of your <em>Help Videos</em> . You can easily change the arrangement of all your pages using the ' . Install_Tools::Install_Link_Content('Admin_Menu', 'Page Manager') . '.</p>');
gpFiles::NewTitle('About', '<h1>About gpEasy CMS</h1><p><a href="http://gpEasy.com" title="gpEasy.com">gp|Easy</a> is a complete Content Management System (CMS) that can help you create rich and flexible web sites with a simple and easy to use interface.</p>
<h2>gpEasy CMS How To</h2>
<p>Learn how to <a href="http://docs.gpeasy.com/Main/Admin" title="gpEasy File Management">manage your files</a>,
<a href="http://docs.gpeasy.com/Main/Creating%20Galleries" title="Creating Galleries in gpEasy CMS">create galleries</a> and more in the
<a href="http://docs.gpeasy.org/index.php/" title="gpEasy CMS Documentation">gpEasy Documentation</a>.
</p>
<h2>gpEasy CMS Features</h2>
<ul>
<li>True WYSIWYG (Using CKEditor)</li>
<li>Galleries (Using ColorBox)</li>
<li>SEO Friendly Links</li>
<li>Free and Open Source (GPL)</li>
<li>Runs on PHP</li>
<li>File Upload Manager</li>
<li>Drag \'n Drop Theme Content</li>
<li>Deleted File Trash Can</li>
<li>Multiple User Administration</li>
<li>Flat File Storage</li>
<li>Fast Page Loading</li>
<li>Fast and Easy Installation</li>
<li>reCaptcha for Contact Form</li>
<li>HTML Tidy (when available)</li>
</ul>
<h2>If You Like gpEasy...</h2>
<p>If you like gpEasy, then you might also like:</p>
<ul>
<li><a href="http://phpeasymin.com" title="Minimize JavaScript and CSS files easily">phpEasyMin.com</a> - Minimize multiple JavaScript and CSS files in one sweep.</li>
</ul>');
//Side_Menu
$file = $destination . '/data/_extra/Side_Menu.php';
$content = '<h3>Join the gpEasy Community</h3>
<p>Visit gpEasy.com to access the many <a href="http://gpeasy.com/Special_Resources" title="gpEasy Community Resources">available resources</a> to help you get the most out of our CMS.</p>
<ul>
<li><a href="http://gpeasy.com/Special_Addon_Themes" title="gpEasy CMS Themes">Download Themes</a></li>
<li><a href="http://gpeasy.com/Special_Addon_Plugins" title="gpEasy CMS Plugin">Download Plugins</a></li>
<li><a href="http://gpeasy.com/Special_Forum" title="gpEasy CMS Forum">Get Help in the Forum</a></li>
<li><a href="http://gpeasy.com/Special_Powered_by" title="Sites using gpEasy CMS">Show off Your Site</a></li>
<li><a href="http://gpeasy.com/Special_Resources" title="gpEasy Community Resources">And Much More...</a></li>
</ul>
//.........这里部分代码省略.........