File: /home/httpd/html/camheart.com/public_html_bad/update.php
<?php
ini_set("zlib.output_compression", 0); // off
ini_set("implicit_flush", 1); // on
ob_implicit_flush(true);
ob_end_flush();
ob_start();
include 'admin/db.php';
error_reporting(E_ALL & ~E_WARNING & ~E_NOTICE & ~E_DEPRECATED);
ini_set('display_errors', 1);
ignore_user_abort(true);
ini_set('memory_limit', '2G');
ini_set('max_execution_time', 3600);
set_time_limit(3600);
?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Mechbunny Cam Aggregator Update</title>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootswatch/3.3.6/united/bootstrap.min.css" />
<style type="text/css">
.alert{margin-bottom:0}
.notification .alert{padding:10px 15px}
</style>
</head>
<body>
<div class="container">
<div class="well">
<div class="row">
<div class="col-xs-12">
<div class="page-header text-center">
<h1>Mechbunny Cam Aggregator Update 1.2.0</h1>
</div>
</div>
</div>
<div class="row">
<?php
$run_update = true;
$error = false;
if ($_POST['startUpgrade'] && $run_update === true) {
dbQuery("ALTER TABLE `performers` ADD INDEX (`last_online`);");
dbQuery("INSERT INTO `configuration` SET `field_name` = 'Cron Cleanup Days Old', `field_description` = 'When cronCleanup.php is run, it will delete models that have not been online in at least this many days.', `field` = 'cronCleanupDays', `value` = '90';");
dbQuery("INSERT INTO `paysites` (`name`, `slug`, `functionName`, `apiData`, `apiDataFieldName`, `maxResults`, `parameters`, `parametersPlaceholder`, `wmReferral`, `preferred`, `preferredLink`, `logoImage`, `whitelist`, `whitelabel_domain`, `whitelabel_domain_placeholder`, `defaultModelText`, `last_log`, `settings_json`, `enabled`, `record_num`) VALUES ('SkyPrivate', 'skyprivate', 'skyprivateData', '', 'API URL', '1000', '', '', 'https://affiliates.whalehunter.cash/track/ODUwMS41Mi4xOC4xOC4wLjAuMC4wLjAuMC4wLjA', 'iframe_embed_revshare', 'chat_room_url', 'skyprivate.jpg', '', '', '', '', '', '', '1', '0');");
dbQuery("ALTER TABLE `performers` ADD FULLTEXT `gender` (`gender`, `tags`, `spoken_languages`, `race`, `hair`);");
dbQuery("ALTER TABLE `performers` ADD FULLTEXT (`spoken_languages`);");
dbQuery("ALTER TABLE `performers` ADD FULLTEXT (`tags`);");
dbQuery("ALTER TABLE `performers` ADD FULLTEXT (`tags`);");
dbQuery("ALTER TABLE `performers` ADD FULLTEXT (`hair`);");
dbQuery("ALTER TABLE `performers` ADD FULLTEXT (`race`);");
dbQuery("ALTER TABLE `performers` ADD FULLTEXT (`tags`,`persistentTags`);");
dbQuery("ALTER TABLE `performers` ADD FULLTEXT (`tags`,`persistentTags`,`username`);");
dbQuery("INSERT INTO `metatags` (`controller`, `mode`, `path`, `language`, `header_title`, `meta_title`, `meta_description`, `meta_keywords`, `robots`, `record_num`) VALUES ('router', '', '', 'EN', 'Webcams', 'Webcams', '{{DESCRIPTION}}', '{{KEYWORDS}}', '', NULL);");
dbQuery("INSERT INTO `template_configuration` (`field_name`, `field_description`, `field`, `value`, `data`, `weight`, `template`, `localized`, `settings`, `record_num`) VALUES ('Header Button Background', '', 'headerButtonBackground', '#ff4157', '', '1', 'default_v3', '0', 'color', NULL);");
dbQuery("INSERT INTO `template_configuration` (`field_name`, `field_description`, `field`, `value`, `data`, `weight`, `template`, `localized`, `settings`, `record_num`) VALUES ('Header Text', '', 'headerButtonColor', '#ffffff', '', '1', 'default_v3', '0', 'color', NULL);");
dbQuery("INSERT INTO `template_configuration` (`field_name`, `field_description`, `field`, `value`, `data`, `weight`, `template`, `localized`, `settings`, `record_num`) VALUES ('Main Background', '', 'mainBackground', '#ffffff', '', '1', 'default_v3', '0', 'color', NULL);");
dbQuery("INSERT INTO `template_configuration` (`field_name`, `field_description`, `field`, `value`, `data`, `weight`, `template`, `localized`, `settings`, `record_num`) VALUES ('Header Background', '', 'headerBackground', '#1a1a1a', '', '1', 'default_v3', '0', 'color', NULL);");
dbQuery("INSERT INTO `template_configuration` (`field_name`, `field_description`, `field`, `value`, `data`, `weight`, `template`, `localized`, `settings`, `record_num`) VALUES ('Footer Background', '', 'footerBackground', '#1a1a1a', '', '1', 'default_v3', '0', 'color', NULL);");
dbQuery("INSERT INTO `template_configuration` (`field_name`, `field_description`, `field`, `value`, `data`, `weight`, `template`, `localized`, `settings`, `record_num`) VALUES ('Buttons Background', '', 'buttonsBackground', '#ff4157', '', '1', 'default_v3', '0', 'color', NULL);");
dbQuery("INSERT INTO `template_configuration` (`field_name`, `field_description`, `field`, `value`, `data`, `weight`, `template`, `localized`, `settings`, `record_num`) VALUES ('Buttons Text', '', 'buttonsColor', '#ffffff', '', '1', 'default_v3', '0', 'color', NULL);");
dbQuery("INSERT INTO `template_configuration` (`field_name`, `field_description`, `field`, `value`, `data`, `weight`, `template`, `localized`, `settings`, `record_num`) VALUES ('Ethnicity Color', '', 'ethnicityColor', '#faf575', '', '1', 'default_v3', '0', 'color', NULL);");
dbQuery("INSERT INTO `template_configuration` (`field_name`, `field_description`, `field`, `value`, `data`, `weight`, `template`, `localized`, `settings`, `record_num`) VALUES ('Live Button Green', '', 'liveBtnGreen', '#028d08', '', '1', 'default_v3', '0', 'color', NULL);");
dbQuery("INSERT INTO `template_configuration` (`field_name`, `field_description`, `field`, `value`, `data`, `weight`, `template`, `localized`, `settings`, `record_num`) VALUES ('Live Button Text', '', 'liveBtnText', '#ffffff', '', '1', 'default_v3', '0', 'color', NULL);");
dbQuery("INSERT INTO `template_configuration` (`field_name`, `field_description`, `field`, `value`, `data`, `weight`, `template`, `localized`, `settings`, `record_num`) VALUES ('Title Color', '', 'titleColor', '#191919', '', '1', 'default_v3', '0', 'color', NULL);");
dbQuery("INSERT INTO `template_configuration` (`field_name`, `field_description`, `field`, `value`, `data`, `weight`, `template`, `localized`, `settings`, `record_num`) VALUES ('Description Color', '', 'descriptionColor', '#454444', '', '1', 'default_v3', '0', 'color', NULL);");
dbQuery("INSERT INTO `template_configuration` (`field_name`, `field_description`, `field`, `value`, `data`, `weight`, `template`, `localized`, `settings`, `record_num`) VALUES ('Footer Link Color', '', 'footerLink', '#ffffff', '', '1', 'default_v3', '0', 'color', NULL);");
dbQuery("INSERT INTO `template_configuration` (`field_name`, `field_description`, `field`, `value`, `data`, `weight`, `template`, `localized`, `settings`, `record_num`) VALUES ('Header Link Color', '', 'headerLink', '#ffffff', '', '1', 'default_v3', '0', 'color', NULL);");
dbQuery("INSERT INTO `template_configuration` (`field_name`, `field_description`, `field`, `value`, `data`, `weight`, `template`, `localized`, `settings`, `record_num`) VALUES ('Search Header Background', '', 'searchHeaderBackground', '#ffffff', '', '1', 'default_v3', '0', 'color', NULL);");
dbQuery("INSERT INTO `template_configuration` (`field_name`, `field_description`, `field`, `value`, `data`, `weight`, `template`, `localized`, `settings`, `record_num`) VALUES ('Search Header Text', '', 'searchHeaderText', '#5d5b5b', '', '1', 'default_v3', '0', 'color', NULL);");
dbQuery("INSERT INTO `template_configuration` (`field_name`, `field_description`, `field`, `value`, `data`, `weight`, `template`, `localized`, `settings`, `record_num`) VALUES ('Input Background', '', 'inputBackground', '#434242', '', '1', 'default_v3', '0', 'color', NULL);");
dbQuery("INSERT INTO `template_configuration` (`field_name`, `field_description`, `field`, `value`, `data`, `weight`, `template`, `localized`, `settings`, `record_num`) VALUES ('Filter Title Background', '', 'filterTitleBackground', '#191919', '', '1', 'default_v3', '0', 'color', NULL);");
dbQuery("INSERT INTO `template_configuration` (`field_name`, `field_description`, `field`, `value`, `data`, `weight`, `template`, `localized`, `settings`, `record_num`) VALUES ('About Text', '', 'aboutText', '#ff4157', '', '1', 'default_v3', '0', 'color', NULL);");
dbQuery("INSERT INTO `template_configuration` (`field_name`, `field_description`, `field`, `value`, `data`, `weight`, `template`, `localized`, `settings`, `record_num`) VALUES ('Filters Background', '', 'filtersBackground', '#f3f1f1', '', '1', 'default_v3', '0', 'color', NULL);");
dbQuery("UPDATE template_configuration SET settings = 'color' WHERE field LIKE '%color%' OR field LIKE '%foreground%' OR field LIKE '%background%'; ");
dbQuery("UPDATE template_configuration SET settings = '' WHERE field = 'template_colors_enabled'; ");
dbQuery("INSERT INTO `template_configuration` (`field_name`, `field_description`, `field`, `value`, `data`, `weight`, `template`, `localized`, `settings`, `record_num`) VALUES ('Use Color Scheme', '', 'template_colors_enabled', '0', '', '1', 'default_v3', '0', '', NULL);");
dbQuery("INSERT INTO `template_configuration` (`field_name`, `field_description`, `field`, `value`, `data`, `weight`, `template`, `localized`, `settings`, `record_num`) VALUES
('Sidebar - Status', 'Enable/Disable Online Yes/No Filter in Sidebar', 'template_sidebar_status', '1', '{\"true\":1,\"false\":0}', 1, 'default_v3', 0, '', NULL ),
('Sidebar - Gender', 'Enable/Disable Gender Filter in Sidebar', 'template_sidebar_gender', '1', '{\"true\":1,\"false\":0}', 1, 'default_v3', 0, '', NULL),
('Sidebar - Age', 'Enable/Disable Age Filter in Sidebar', 'template_sidebar_age', '1', '{\"true\":1,\"false\":0}', 1, 'default_v3', 0, '', NULL),
('Sidebar - Tags', 'Enable/Disable Tag Filter in Sidebar', 'template_sidebar_tags', '1', '{\"true\":1,\"false\":0}', 1, 'default_v3', 0, '', NULL),
('Sidebar - Ethnicity', 'Enable/Disable Ethnicity Filter in Sidebar', 'template_sidebar_ethnicity', '1', '{\"true\":1,\"false\":0}', 1, 'default_v3', 0, '', NULL),
('Sidebar - Hair Color', 'Enable/Disable Hair Color Filter in Sidebar', 'template_sidebar_hair', '1', '{\"true\":1,\"false\":0}', 1, 'default_v3', 0, '', NULL),
('Adblock Check', 'Enable/Disable adblock check on webcam page', 'template_adblock_check', '1', '{\"true\":1,\"false\":0}', 1, 'default_v3', 0, '', NULL),
('Logo URL', 'Logo URL (use Logo Upload under Settings to Upload, or specify manually)', 'template_logo_url', '', '', 1, 'default_v3', 0, '', NULL),
('Homepage Top Text', '', 'template_homepage_top_text', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', '', 1, 'default_v3', 0, '', NULL),
('Sidebar - Custom URLs', 'Enable/Disable Custom URLs in Sidebar', 'template_sidebar_custom', '1', '{\"true\":1,\"false\":0}', 1, 'default_v3', 0, '', NULL),
('Sidebar - Custom URLs Title', '', 'template_sidebar_custom_title', 'Quick Links', '', 1, 'default_v3', 0, '', NULL);");
if (!$error) {
setMessage('<div class="alert alert-success">Upgrade completed</div>', 'alert');
setMessage('<div class="alert alert-warning"><strong>WARNING: remove "update.php" file from your server!</strong></div>', 'alert');
}
setMessage('<div class="alert alert-info"><a href="' . $basehttp . '">Go to homepage</a> or <a href="' . $basehttp . '/admin/">go to Admin Area</a></div>', 'alert');
}
?>
<?php echo getMessages(); ?>
</div>
<?php if ($run_update === true && !$_POST['startUpgrade']) { ?>
<div class="row">
<div class="col-xs-12">
<form action="" method="post" class="text-center">
<input type="hidden" name="startUpgrade" value="1">
<button type="submit" class="btn btn-primary btn-lg">Start upgrade (click once!!!)</button><br>
This update may take a while if your database is large.
</form>
</div>
</div>
<?php } ?>
</div>
</div>
</body>
</html>
<?php ob_flush(); flush(); ?>