本文整理汇总了PHP中find_replace_templatesets函数的典型用法代码示例。如果您正苦于以下问题:PHP find_replace_templatesets函数的具体用法?PHP find_replace_templatesets怎么用?PHP find_replace_templatesets使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了find_replace_templatesets函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deactivate
public function deactivate()
{
require_once MYBB_ROOT . "inc/adminfunctions_templates.php";
$templates = array("myprofile_buddylist", "myprofile_buddylist_buddy_count", "myprofile_buddylist_buddy", "myprofile_buddylist_row", "myprofile_buddylist_spacer");
MyProfileUtils::delete_templates($templates);
find_replace_templatesets("member_profile", "#" . preg_quote('{$myprofile_buddylist}') . "#i", '', 0);
}
示例2: automedia_reapply_template_edits
function automedia_reapply_template_edits()
{
require_once MYBB_ROOT . "/inc/adminfunctions_templates.php";
find_replace_templatesets("usercp_nav_misc", "#" . preg_quote('</a></td></tr><tr><td class="trow1 smalltext"><a href="usercp.php?action=userautomedia" class="usercp_nav_item usercp_nav_options">{$lang->av_ucp_menu}') . "#s", '', '', false);
find_replace_templatesets("usercp_nav_misc", "#" . preg_quote('<tr><td class="trow1 smalltext"><a href="usercp.php?action=userautomedia" class="usercp_nav_item usercp_nav_options">AutoMedia</a></td></tr>') . "#s", '', '', false);
find_replace_templatesets("usercp_nav_misc", "#" . preg_quote('{$lang->ucp_nav_view_profile}') . "#i", '{$lang->ucp_nav_view_profile}</a></td></tr><tr><td class="trow1 smalltext"><a href="usercp.php?action=userautomedia" class="usercp_nav_item usercp_nav_options">{$lang->av_ucp_menu}');
}
示例3: mytwconnect_uninstall
function mytwconnect_uninstall()
{
global $db, $PL, $cache, $lang;
if (!$lang->mytwconnect) {
$lang->load('mytwconnect');
}
if (!file_exists(PLUGINLIBRARY)) {
flash_message($lang->mytwconnect_pluginlibrary_missing, "error");
admin_redirect("index.php?module=config-plugins");
}
$PL or (require_once PLUGINLIBRARY);
// Drop settings
$PL->settings_delete('mytwconnect');
// Delete our columns
$db->query("ALTER TABLE " . TABLE_PREFIX . "users DROP `twavatar`, DROP `twbio`, DROP `twlocation`, DROP `mytw_uid`");
// Delete the plugin from cache
$info = mytwconnect_info();
$shadePlugins = $cache->read('shade_plugins');
unset($shadePlugins[$info['name']]);
$cache->update('shade_plugins', $shadePlugins);
$PL->templates_delete('mytwconnect');
// Try to update templates
require_once MYBB_ROOT . 'inc/adminfunctions_templates.php';
find_replace_templatesets('header_welcomeblock_guest', '#' . preg_quote('— <a href="{$mybb->settings[\'bburl\']}/mytwconnect.php?action=login">{$lang->mytwconnect_login}</a>') . '#i', '');
}
示例4: update
private function update()
{
global $db, $mybb, $cache, $lang;
$new_settings = $drop_settings = array();
// Get the gid
$query = $db->simple_select("settinggroups", "gid", "name='mytwconnect'");
$gid = (int) $db->fetch_field($query, "gid");
// 1.0.2
if (version_compare($this->old_version, '1.0.1', "<")) {
require_once MYBB_ROOT . "inc/adminfunctions_templates.php";
find_replace_templatesets('mytwconnect_usercp_settings', '#' . preg_quote('<input type="submit" value="{$lang->mytwconnect_settings_save}" />') . '#i', '<input type="submit" class=\\"button\\" value="{$lang->mytwconnect_settings_save}" />{$unlink}');
}
// 2.0
if (version_compare($this->old_version, '2.0', "<")) {
$new_settings[] = array("name" => "mytwconnect_twavatar", "title" => $db->escape_string($lang->setting_mytwconnect_twavatar), "description" => $db->escape_string($lang->setting_mytwconnect_twavatar_desc), "optionscode" => "yesno", "value" => 1, "disporder" => 30, "gid" => $gid);
$new_settings[] = array("name" => "mytwconnect_tweet", "title" => $db->escape_string($lang->setting_mytwconnect_tweet), "description" => $db->escape_string($lang->setting_mytwconnect_tweet_desc), "optionscode" => "yesno", "value" => 0, "disporder" => 31, "gid" => $gid);
$new_settings[] = array("name" => "mytwconnect_tweet_message", "title" => $db->escape_string($lang->setting_mytwconnect_tweet_message), "description" => $db->escape_string($lang->setting_mytwconnect_tweet_message_desc), "optionscode" => "textarea", "value" => $lang->mytwconnect_default_tweet, "disporder" => 32, "gid" => $gid);
// Let's at least try to change that, anyway, 2.0 has backward compatibility so it doesn't matter if this fails
require_once MYBB_ROOT . "inc/adminfunctions_templates.php";
find_replace_templatesets('header_welcomeblock_guest', '#' . preg_quote('twlogin') . '#i', 'login');
}
if ($new_settings) {
$db->insert_query_multiple('settings', $new_settings);
}
if ($drop_settings) {
$db->delete_query('settings', "name IN ('mytwconnect_" . implode("','mytwconnect_", $drop_settings) . "')");
}
rebuild_settings();
// Update the current version number and redirect
$this->plugins[$this->info['name']] = array('title' => $this->info['name'], 'version' => $this->version);
$cache->update('shade_plugins', $this->plugins);
flash_message($lang->sprintf($lang->mytwconnect_success_updated, $this->old_version, $this->version), "success");
admin_redirect($_SERVER['HTTP_REFERER']);
}
示例5: icon_in_showthread_deactivate
function icon_in_showthread_deactivate()
{
require_once MYBB_ROOT . 'inc/adminfunctions_templates.php';
find_replace_templatesets('showthread', '#\\s?' . preg_quote('<div style="display: inline-block; vertical-align: middle; padding: 0 3px;">{$thread_icon}</div>') . '#i', '', 0);
find_replace_templatesets('printthread', '#\\s?' . preg_quote('<div style="display: inline-block; vertical-align: middle; padding: 0 3px;">{$thread_icon}</div>') . '#i', '', 0);
find_replace_templatesets('newreply', '#\\s?' . preg_quote('<div style="display: inline-block; vertical-align: middle; padding: 0 3px;">{$thread_icon}</div>') . '#i', '', 0);
}
示例6: tags_activate
function tags_activate()
{
global $mybb, $db;
require_once MYBB_ROOT . 'inc/adminfunctions_templates.php';
// add settings
$query = $db->simple_select('settinggroups', 'gid', "name='tags'");
$gid = $db->fetch_field($query, 'gid');
$i = 0;
$settings = array(array("name" => "tags_enabled", "title" => "Enable Plugin", "description" => $db->escape_string('Set to "on" if you want Enable this plugin.'), "optionscode" => "onoff", "value" => tags_setting_value("tags_enabled", 1), "disporder" => ++$i, "gid" => $gid), array("name" => "tags_droptable", "title" => $db->escape_string('Drop table?'), "description" => $db->escape_string('Do you want the "tags" table droped when you uninstall this plugin?'), "optionscode" => "yesno", "value" => tags_setting_value("tags_droptable", 1), "disporder" => ++$i, "gid" => $gid), array("name" => "tags_seo", "title" => "SEO Friendly URL", "description" => $db->escape_string('Do you want to use SEO URLs (ex: tag-***.html) for tags?<br />
You must add these codes to ".htaccess" file before set it to "On":
<pre style="background: #f7f7f7;border: 1px solid #ccc;padding: 6px;border-radius: 3px;direction: ltr;text-align: left;font-size: 12px;">
RewriteEngine <strong>on</strong>
RewriteRule <strong>^tag-(.*?)\\.html$ tag.php?name=$1</strong> <em>[L,QSA]</em>
RewriteRule <strong>^tag\\.html$ tag.php</strong> <em>[L,QSA]</em>
</pre>'), "optionscode" => "yesno", "value" => tags_setting_value("tags_seo", 0), "disporder" => ++$i, "gid" => $gid), array("name" => "tags_forceseo", "title" => "Force users to use seo URLs?", "description" => $db->escape_string('Do you want to force users to use SEO URLs (ex: tag-***.html) for tags?'), "optionscode" => "yesno", "value" => tags_setting_value("tags_forceseo", 0), "disporder" => ++$i, "gid" => $gid), array("name" => "tags_urlscheme", "title" => "Tags URL scheme", "description" => $db->escape_string('Enter the Tag URL scheme. By default this is tag-{name}.html. Please note that if you change this, you will also need to add a new rewrite rule in your .htaccess file.'), "optionscode" => "text", "value" => tags_setting_value("tags_urlscheme", 'tag-{name}.html'), "disporder" => ++$i, "gid" => $gid), array("name" => "tags_per_page", "title" => "Tags per page", "description" => $db->escape_string('How many tags shown in "Tags" page?'), "optionscode" => "text", "value" => tags_setting_value("tags_per_page", 10), "disporder" => ++$i, "gid" => $gid), array("name" => "tags_limit", "title" => $db->escape_string('Limit Tags in "Index Page" and "Forum Display Page"'), "description" => $db->escape_string('How many tags shown in "Index Page" and "Forum Display Page" ?'), "optionscode" => "text", "value" => tags_setting_value("tags_limit", 50), "disporder" => ++$i, "gid" => $gid), array("name" => "tags_index", "title" => $db->escape_string('Show tags in Index Page?'), "description" => $db->escape_string('Do you want tags shown in Index Page?'), "optionscode" => "yesno", "value" => tags_setting_value("tags_index", 1), "disporder" => ++$i, "gid" => $gid), array("name" => "tags_forumdisplay", "title" => $db->escape_string('Show tags in "Forum Display" Page?'), "description" => $db->escape_string('Do you want tags shown in "Forum Display" Page?'), "optionscode" => "yesno", "value" => tags_setting_value("tags_forumdisplay", 1), "disporder" => ++$i, "gid" => $gid), array("name" => "tags_max_thread", "title" => $db->escape_string('Maximun tags for a thread'), "description" => $db->escape_string('Please enter the maximum number of tags for threads. Set it to 0 for unlimited.'), "optionscode" => "text", "value" => tags_setting_value("tags_max_thread", 20), "disporder" => ++$i, "gid" => $gid), array("name" => "tags_groups", "title" => $db->escape_string('Tags Moderators'), "description" => $db->escape_string('Please select the groups can edit "tags". please note who can edit tags, that can edit thread.'), "optionscode" => "groupselect", "value" => tags_setting_value("tags_groups", -1), "disporder" => ++$i, "gid" => $gid), array("name" => "tags_bad", "title" => $db->escape_string('Bad Tags'), "description" => $db->escape_string('Please enter the bad tags, this tags don\'t shown in tags list. enter each tags in new line'), "optionscode" => "textarea", "value" => tags_setting_value("tags_bad", ''), "disporder" => ++$i, "gid" => $gid), array("name" => "tags_maxchars", "title" => $db->escape_string('Maximum tag length'), "description" => $db->escape_string('Please enter the maximum length that a tag can have'), "optionscode" => "text", "value" => tags_setting_value("tags_maxchars", 20), "disporder" => ++$i, "gid" => $gid), array("name" => "tags_minchars", "title" => $db->escape_string('Minimum tag length'), "description" => $db->escape_string('Please enter the minimum length that a tag can have'), "optionscode" => "text", "value" => tags_setting_value("tags_minchars", 0), "disporder" => ++$i, "gid" => $gid), array("name" => "tags_charreplace", "title" => $db->escape_string('Character Translation'), "description" => $db->escape_string('If you want translate some characters to other characters, you can use this setting.<br />
For example if you want replace "a" to "b" and "c" to "d" use this code:<br />
<pre style="background: #f7f7f7;border: 1px solid #ccc;padding: 6px;border-radius: 3px;direction: ltr;text-align: left;font-size: 12px;">
a=>b
c=>d
</pre>'), "optionscode" => "textarea", "value" => tags_setting_value("tags_charreplace", ''), "disporder" => ++$i, "gid" => $gid), array("name" => "tags_disallowedforums", "title" => $db->escape_string('Disallowed forums'), "description" => $db->escape_string('Please select the forums you want "Tags" don\'t work on these.'), "optionscode" => "forumselect", "value" => tags_setting_value("tags_disallowedforums", 0), "disporder" => ++$i, "gid" => $gid));
$db->delete_query('settings', "gid = '{$gid}'");
$db->insert_query_multiple("settings", $settings);
rebuild_settings();
find_replace_templatesets('newthread', '#' . preg_quote('{$posticons}') . '#', '{$tags}{$posticons}');
find_replace_templatesets('editpost', '#' . preg_quote('{$posticons}') . '#', '{$tags}{$posticons}');
find_replace_templatesets('showthread', '#' . preg_quote('{$ratethread}') . '#', '{$ratethread}{$tags}');
find_replace_templatesets('showthread', '#' . preg_quote('{$headerinclude}') . '#', '<meta name="keywords" content="{$thread[\'tags_meta\']}" />{$headerinclude}');
find_replace_templatesets('index', '#' . preg_quote('{$forums}') . '#', '{$forums}{$tags}');
find_replace_templatesets('forumdisplay', '#' . preg_quote('{$threadslist}') . '#', '{$threadslist}{$tags}');
}
示例7: zmultigroup_deactivate
function zmultigroup_deactivate()
{
global $db;
require_once MYBB_ROOT . "/inc/adminfunctions_templates.php";
$string = '{$post[\'zmultigroup\']}';
find_replace_templatesets("postbit", "#" . preg_quote($string) . "#i", '');
find_replace_templatesets("postbit_classic", "#" . preg_quote($string) . "#i", '');
}
示例8: youtubeminer_deactivate
function youtubeminer_deactivate()
{
global $db, $header;
require MYBB_ROOT . "inc/adminfunctions_templates.php";
require_once MYBB_ROOT . "admin/inc/functions_themes.php";
find_replace_templatesets("headerinclude", "#" . preg_quote($header) . '#', '', 0);
$db->delete_query("templates", "title='youtubeminer'");
}
示例9: cloudflare_deactivate
function cloudflare_deactivate()
{
global $db, $mybb;
include MYBB_ROOT . "/inc/adminfunctions_templates.php";
find_replace_templatesets('footer', '#<!-- End powered by --><cfb>#', '<!-- End powered by -->');
$db->delete_query("templates", "title = 'cloudflare_postbit_spam'");
rebuild_settings();
}
示例10: deactivate
public function deactivate()
{
global $db;
require_once MYBB_ROOT . "inc/adminfunctions_templates.php";
$templates = array("myprofile_member_headerinclude");
MyProfileUtils::delete_templates($templates);
find_replace_templatesets("headerinclude", "#" . preg_quote('{$myprofile_headerinclude}') . "#i", '', 0);
}
示例11: tags_deactivate
function tags_deactivate()
{
require_once MYBB_ROOT . 'inc/adminfunctions_templates.php';
find_replace_templatesets('newthread', '#' . preg_quote('{$tags}') . '#', '');
find_replace_templatesets('editpost', '#' . preg_quote('{$tags}') . '#', '');
find_replace_templatesets('showthread', '#' . preg_quote('{$tags}') . '#', '');
find_replace_templatesets('showthread', '#' . preg_quote('<meta name="keywords" content="{$thread[\'tags_meta\']}" />') . '#', '');
find_replace_templatesets('index', '#' . preg_quote('{$tags}') . '#', '');
find_replace_templatesets('forumdisplay', '#' . preg_quote('{$tags}') . '#', '');
}
示例12: cloudflare_deactivate
function cloudflare_deactivate()
{
global $db, $mybb;
include MYBB_ROOT . "/inc/adminfunctions_templates.php";
find_replace_templatesets("postbit", "#" . preg_quote('{$post[\'cloudflare_spam\']}') . "#i", '', 0);
find_replace_templatesets("postbit_classic", "#" . preg_quote('{$post[\'cloudflare_spam\']}') . "#i", '', 0);
find_replace_templatesets('footer', '#<!-- End powered by --><cfb>#', '<!-- End powered by -->');
$db->delete_query("templates", "title = 'cloudflare_postbit_spam'");
change_admin_permission("cloudflare", "", -1);
}
示例13: portal_news_preview_deactivate
function portal_news_preview_deactivate()
{
global $db, $mybb;
require_once MYBB_ROOT . 'inc/adminfunctions_templates.php';
find_replace_templatesets('portal_announcement', '#' . preg_quote('<br/><br/>{$announcement[\'link\']}') . '#', '', 0);
$db->query("DELETE FROM " . TABLE_PREFIX . "settings WHERE name='isenabled'");
$db->query("DELETE FROM " . TABLE_PREFIX . "settings WHERE name='whichway'");
$db->query("DELETE FROM " . TABLE_PREFIX . "settings WHERE name='cutstring'");
$db->query("DELETE FROM " . TABLE_PREFIX . "settings WHERE name='characters'");
$db->query("DELETE FROM " . TABLE_PREFIX . "settings WHERE name='readmoremessage'");
rebuild_settings();
}
示例14: update
private function update()
{
global $db, $mybb, $cache, $lang;
$new_settings = $drop_settings = array();
// Get the gid
$query = $db->simple_select("settinggroups", "gid", "name='myfbconnect'");
$gid = (int) $db->fetch_field($query, "gid");
// 1.0.1
if (version_compare($this->old_version, '1.0.1', "<")) {
require_once MYBB_ROOT . "inc/adminfunctions_templates.php";
find_replace_templatesets('myfbconnect_register', '#' . preg_quote('<td valign="top">') . '#i', '<td valign="top">{$errors}');
}
// 1.0.3
if (version_compare($this->old_version, '1.0.3', "<")) {
$new_settings[] = array("name" => "myfbconnect_verifiedonly", "title" => $db->escape_string($lang->setting_myfbconnect_verifiedonly), "description" => $db->escape_string($lang->setting_myfbconnect_verifiedonly_desc), "optionscode" => "yesno", "value" => 0, "disporder" => 7, "gid" => $gid);
}
// 1.1
if (version_compare($this->old_version, '1.1', "<")) {
$new_settings[] = array("name" => "myfbconnect_fbavatar", "title" => $db->escape_string($lang->setting_myfbconnect_fbavatar), "description" => $db->escape_string($lang->setting_myfbconnect_fbavatar_desc), "optionscode" => "yesno", "value" => 1, "disporder" => 12, "gid" => $gid);
require_once MYBB_ROOT . "inc/adminfunctions_templates.php";
find_replace_templatesets('myfbconnect_usercp_settings', '#' . preg_quote('<input type="submit" value="{$lang->myfbconnect_settings_save}" />') . '#i', '<input type="submit" class=\\"button\\" value="{$lang->myfbconnect_settings_save}" />{$unlink}');
}
// 2.0
if (version_compare($this->old_version, '2.0', "<")) {
$drop_settings[] = "requestpublishingperms";
$new_settings[] = array("name" => "myfbconnect_postonwall", "title" => $db->escape_string($lang->setting_myfbconnect_postonwall), "description" => $db->escape_string($lang->setting_myfbconnect_postonwall_desc), "optionscode" => "yesno", "value" => 0, "disporder" => 30, "gid" => $gid);
$new_settings[] = array("name" => "myfbconnect_postonwall_message", "title" => $db->escape_string($lang->setting_myfbconnect_postonwall_message), "description" => $db->escape_string($lang->setting_myfbconnect_postonwall_message_desc), "optionscode" => "textarea", "value" => $lang->myfbconnect_default_postonwall_message, "disporder" => 31, "gid" => $gid);
// Let's at least try to change that, anyway, 2.0 has backward compatibility so it doesn't matter if this fails
require_once MYBB_ROOT . "inc/adminfunctions_templates.php";
find_replace_templatesets('header_welcomeblock_guest', '#' . preg_quote('fblogin') . '#i', 'login');
}
// 2.3
if (version_compare($this->old_version, '2.3', "<")) {
// Add the report table
if (!$db->table_exists('myfbconnect_reports')) {
$collation = $db->build_create_table_collation();
$db->write_query("CREATE TABLE " . TABLE_PREFIX . "myfbconnect_reports(\n\t\t id INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,\n\t\t dateline VARCHAR(15) NOT NULL,\n\t\t code VARCHAR(10) NOT NULL,\n\t\t file TEXT,\n\t\t line INT(6) NOT NULL,\n\t\t message TEXT,\n\t\t trace TEXT\n\t\t ) ENGINE=MyISAM{$collation};");
}
}
if ($new_settings) {
$db->insert_query_multiple('settings', $new_settings);
}
if ($drop_settings) {
$db->delete_query('settings', "name IN ('myfbconnect_" . implode("','myfbconnect_", $drop_settings) . "')");
}
rebuild_settings();
// Update the current version number and redirect
$this->plugins[$this->info['name']] = array('title' => $this->info['name'], 'version' => $this->version);
$cache->update('shade_plugins', $this->plugins);
flash_message($lang->sprintf($lang->myfbconnect_success_updated, $this->old_version, $this->version), "success");
admin_redirect($_SERVER['HTTP_REFERER']);
}
示例15: teamonline_uninstall
function teamonline_uninstall()
{
global $db;
$db->delete_query('settings', "name LIKE ('teamonline\\_%')");
$db->delete_query('settinggroups', "name = 'plugin_teamonline'");
require MYBB_ROOT . '/inc/adminfunctions_templates.php';
find_replace_templatesets("index", '#' . preg_quote('{$teamonline}') . '#', '');
find_replace_templatesets("portal", '#' . preg_quote('{$teamonline}') . '#', '');
$deletetemplates = array('teamonline', 'teamonline_row', 'teamonline_no');
foreach ($deletetemplates as $title) {
$db->query("DELETE FROM " . TABLE_PREFIX . "templates WHERE title='" . $title . "'");
}
}