Updated : CLipBucket Installer & favicon.ico

This commit is contained in:
Arslan Hassan 2011-03-06 13:04:14 +00:00
parent 7f4c7e5f4c
commit 18a73af720
15 changed files with 189 additions and 33 deletions

View file

@ -140,9 +140,9 @@ switch($mode)
{
//exec(php_path()." -q ".BASEDIR."/actions/video_convert.php &> /dev/null &");
if (stristr(PHP_OS, 'WIN')) {
exec(php_path()." -q ".BASEDIR."/actions/video_convert.php $targetFileName");
// exec(php_path()." -q ".BASEDIR."/actions/video_convert.php $targetFileName");
} else {
exec(php_path()." -q ".BASEDIR."/actions/video_convert.php $targetFileName &> /dev/null &");
// exec(php_path()." -q ".BASEDIR."/actions/video_convert.php $targetFileName &> /dev/null &");
}
}

View file

@ -1,14 +1,17 @@
<?php
define("THIS_PAGE","cb_install");
include('clipbucket.php');
/**
* ClipBucket v2.1 Installat Ajax
*/
include("functions.php");
$mode = $_POST['mode'];
if($mode!='finish_upgrade')
include("functions.php");
include("upgradeable.php");
if($mode=='dataimport')
{
$result = array();
@ -215,5 +218,75 @@ define("THIS_PAGE","cb_install");
echo json_encode($return);
}
if($mode=='finish_upgrade')
{
chdir("..");
$configIncluded = true;
require_once 'includes/config.inc.php';
chdir("cb_install");
include("functions.php");
$files = getUpgradeFiles();
if($files)
{
$step = $_POST['step'];
if($step=='upgrade')
$index = 0;
else
$index = $step;
$total = count($files);
if($index >= $total)
{
$return['msg'] = '<div class="ok green">Upgrade clipbucket</div>';
$return['status'] = 'finalizing upgrade...';
$return['step'] = 'forward';
}
if($index+1 >= $total)
$next = 'forward';
else
$next = $index+1;
if($next=='forward')
$status = 'finalizing upgrade...';
else
$status = 'Importing upgrade_'.$files[$next].'.sql';
$sqlfile = BASEDIR."/cb_install/sql/upgrade_".$files[$index].".sql";
if(file_exists($sqlfile))
{
$lines = file($sqlfile);
foreach ($lines as $line_num => $line)
{
if (substr($line, 0, 2) != '--' && $line != '')
{
@$templine .= $line;
if (substr(trim($line), -1, 1) == ';')
{
@$templine = preg_replace("/{tbl_prefix}/",TABLE_PREFIX,$templine);
$templine;
mysql_query($templine);
$templine = '';
}
}
}
}
$return['msg'] = '<div class="ok green">upgrade_'.$files[$index].'.sql has been imported</div>';
$return['status'] = $status;
$return['step'] = $next;
}else
{
$return['msg'] = '<div class="ok green">Upgrade clipbucket</div>';
$return['status'] = 'finalizing upgrade...';
$return['step'] = 'forward';
}
echo json_encode($return);
}
?>

View file

@ -9,11 +9,10 @@
* NOTE : EDITING THIS FILE MAY CASUE YOUR CLIPBUCKET UPDATER NOT TO WORK PROPERLY
*/
define("ClipBucket","ClipBucket - Open Source Media Sharing Script by Arslan Hassan");
define("VERSION","2.1");
define("VERSION","2.2");
define("STATE","BETA");
define("REV","525");
define("REV","579");
define("RELEASED","2-14-2011");
define("AUTHORS","ARSLAN HASSAN,FAWAZ TAHIR");

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -38,9 +38,8 @@ function dodatabase(step)
if(data.step=='forward')
{
$('#installation').submit();
}
if(data.step)
}
if(data.step && data.step!='forward')
dodatabase(data.step)
},"json");
}

View file

@ -1,5 +1,6 @@
<?php
define("BASEDIR",dirname(dirname(__FILE__)));
if(!file_exists(BASEDIR.'/files/temp/install.me'))
@ -200,6 +201,7 @@
(
'cache',
'cache/comments',
'cache/userfeeds',
'files',
'files/conversion_queue',
'files/logs',
@ -257,4 +259,33 @@
if($mode==$selected)
return "class='selected'";
}
/**
* Function used to create list of files
* that have to be executed while upgrade
*/
function getUpgradeFiles()
{
global $versions,$upgrade;
$version = VERSION;
$oldVer = $upgrade;
if($oldVer)
{
$total = count($versions);
$files = array();
$found = false;
foreach($versions as $ver)
{
if($found)
$files[] = $ver;
if($ver==$oldVer)
$found = true;
}
return $files;
}
return false;
}
?>

View file

@ -1,35 +1,40 @@
<?php
define("THIS_PAGE","cb_install");
/**
* ClipBucket v2.1 Installaer
*/
define("THIS_PAGE","cb_install");
include('clipbucket.php');
include("upgradeable.php");
$modes = array
('agreement','precheck','permission','database','dataimport','adminsettings','sitesettings','register','finish');
('agreement','precheck','permission','database','dataimport','adminsettings','sitesettings','register','finish','upgrade'
,'finish_upgrade');
$mode = @$_POST['mode'];
$mode = @$_POST['mode'];
if(!$mode || !in_array($mode,$modes))
$mode = 'agreement';
{
if(!$upgrade)
$mode = 'agreement';
else
$mode = 'upgrade';
}
$configIncluded = false;
/**
* Clipbucket modes
* modes which requires clipbucket core files so installer
* function file does not create a conflict
*/
$cbarray = array('adminsettings','sitesettings','register','finish');
if(in_array($mode,$cbarray))
if(in_array($mode,$cbarray) || $upgrade)
{
define("THIS_PAGE",'cb_install');
chdir("..");
require 'includes/config.inc.php';
$configIncluded = true;
require_once 'includes/config.inc.php';
chdir("cb_install");
}
include("functions.php");
include('modes/body.php');
include("functions.php");
include('modes/body.php');
?>

View file

@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ClipBucket v2.1 Beta Installer</title>
<title>ClipBucket v<?=VERSION?> <?=STATE?> Installer</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<link href='http://fonts.googleapis.com/css?family=Cabin:regular,bold' rel='stylesheet' type='text/css'>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>
@ -11,8 +11,10 @@
</head>
<body>
<div id="head">
<span id="logo"><span style="color:#09c">ClipBucket</span> Installer v2.1 -&beta;eta</span>
<span id="logo"><span style="color:#09c">ClipBucket</span> Installer v<?=VERSION?> - &beta;eta</span>
</div>
<?php if(!$upgrade):?>
<div id="header" class="br5px">
<ul class="headstatus">
<li <?=selected('agreement')?>>Agreement</li>
@ -26,12 +28,22 @@
<li <?=selected('finish')?>>Finish</li>
</ul>
</div>
<?php else: ?>
<div id="header" class="br5px">
<ul class="headstatus">
<li <?=selected('upgrade')?>>Upgrade</li>
<li <?=selected('permission')?>>Permissions</li>
<li <?=selected('dataimport')?>>Data import</li>
<li <?=selected('finish_upgrade')?>>Finish Upgrade</li>
</ul>
</div>
<?php endif; ?>
<div id="container" class="br5px">
<?php include($mode.'.php'); ?>
</div>
<div align="center" style="padding-top:10px; color:#999">
Clipbucket 2.1 is an effort of Arslan Hassan, Fawaz Tahir and some great supporters.<br />
Clipbucket <?=VERSION?> is an effort of Arslan Hassan, Fawaz Tahir and some great supporters.<br />
&copy; Clipbucket2007 - <?=date("Y",time())?> | Code written by Clipbucket &amp; Team
</div>

View file

@ -3,7 +3,15 @@
<div id="resultsDiv" style="margin-top:20px">
<img src="images/loading.gif" id="loading" />
<?php if(!$upgrade): ?>
<span id="current">creating database structure...</span>
<?php
else:
?>
<span id="current">upgrading clipbucket...</span>
<?php
endif;
?>
</div>
<form name="installation" method="post" id="installation">
@ -12,13 +20,28 @@
<input type="hidden" name="dbname" value="<?=@$_POST['dbname']?>" />
<input type="hidden" name="dbuser" value="<?=@$_POST['dbuser']?>" />
<input type="hidden" name="dbprefix" value="<?=$_POST['dbprefix']?>" />
<?php if($upgrade): ?>
<input type="hidden" name="mode" value="finish_upgrade" />
<?php
else:
?>
<input type="hidden" name="mode" value="adminsettings" />
<?php
endif;
?>
</form>
<script>
$(document).ready()
{
<?php if($upgrade): ?>
dodatabase('upgrade');
<?php
else:
?>
dodatabase('structure');
<?php
endif;
?>
}
</script>

View file

@ -23,11 +23,15 @@
<form name="installation" method="post" id="installation">
<input type="hidden" name="mode" value="permission" />
<div style="padding:10px 0px" align="right">
<?=button('Recheck',' onclick="$(\'#mode\').val(\'permission\');
$(\'#installation\').submit()" ',true);?>
<?=button('Continue To Next Step',' onclick="$(\'#installation\').submit()" ');?></div>
<?php if(!$upgrade): ?>
<input type="hidden" name="mode" value="database" id="mode"/>
<?php else: ?>
<input type="hidden" name="mode" value="dataimport" id="mode"/>
<?php endif; ?>
</form>

View file

@ -9,7 +9,7 @@ INSERT INTO `{tbl_prefix}group_categories` (`category_id`, `category_name`, `cat
INSERT INTO `{tbl_prefix}user_categories` (`category_id`, `category_name`, `category_order`, `category_desc`, `date_added`, `category_thumb`, `isdefault`) VALUES
(1, 'Basic User', 1, '', now(), '', 'yes'),
(2, 'Gurus', 1, '', now(), '', 'no'),
(3, 'Comedian', 1, '', now()', '', 'no');
(3, 'Comedian', 1, '', now(), '', 'no');
INSERT INTO `{tbl_prefix}video_categories` (`category_id`, `parent_id`, `category_name`, `category_order`, `category_desc`, `date_added`, `category_thumb`, `isdefault`) VALUES

View file

@ -233,3 +233,7 @@ INSERT INTO `{tbl_prefix}validation_re` (`re_id`, `re_name`, `re_code`, `re_synt
(2, 'Email', 'email', '^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,10})$'),
(3, 'Field Text', 'field_text', '^^[_a-z0-9-]+$');
INSERT INTO `{tbl_prefix}config` (`configid` ,`name` ,`value`)VALUES (
NULL , 'comments_per_page', '15'
);

View file

@ -18,4 +18,7 @@ INSERT INTO `{tbl_prefix}email_templates` (`email_template_id`, `email_template_
(12, 'Contact Form', 'contact_form', '[{website_title} - Contact] {reason} from {name}', 'Name : {name}\r\nEmail : {email}\r\nReason : {reason}\r\n\r\nMessage:\r\n{message}\r\n\r\n===============\r\nIp : {ip_address}\r\ndate : {now}', ''),
(13, 'Video Acitvation Email', 'video_activation_email', '[{website_title}] - Your video has been activated', 'Hello {username},\r\nYour video has been reviewed and activated by one of our staff, thanks for uploading this video. You can view this video here.\r\n{video_link}\r\n\r\nThanks\r\n{website_title} Team', ''),
(14, 'User Comment Email', 'user_comment_email', '[{website_title}] {username} made comment on your {obj}', '{username} has commented on your {obj}\r\n"{comment}"\r\n\r\n<a href="{obj_link}">{obj_link}</a>\r\n\r\n{website_title} team', ''),
(15, 'Photo Share Template', 'photo_share_template', '{username} wants to share photo with you', '<html>\r\n<head>\r\n<style type="text/css">\r\n<!--\r\n.title {\r\n font-family: Arial, Helvetica, sans-serif;\r\n padding: 5px;\r\n font-weight:bold;\r\n color: #FFFFFF;\r\n font-size: 16px;\r\n}\r\n.title2 {\r\n font-family: Arial, Helvetica, sans-serif;\r\n padding: 5px;\r\n font-weight:bold;\r\n color: #000000;\r\n font-size: 14px;\r\n}\r\n.messege {\r\n font-family: Arial, Helvetica, sans-serif;\r\n padding: 5px;\r\n font-weight:bold;\r\n color: #000000;\r\n font-size: 12px;\r\n}\r\n#videoThumb{\r\n float:left;\r\n padding: 2px;\r\n margin: 3px;\r\n border: 1px solid #F0F0F0;\r\n text-align: center;\r\n vertical-align: middle;\r\n}\r\n#videoThumb img{border:0px}\r\nbody,td,th {\r\n font-family: tahoma;\r\n font-size: 11px;\r\n color: #FFFFFF;\r\n}\r\n.text {\r\n font-family: tahoma;\r\n font-size: 11px;\r\n color: #000000;\r\n padding: 5px;\r\n}\r\n-->\r\n</style>\r\n</head>\r\n<body>\r\n<table width="100%" border="0" cellspacing="0" cellpadding="5">\r\n <tr>\r\n <td bgcolor="#0099cc" ><span class="title">{website_title}</span></td>\r\n </tr>\r\n\r\n <tr>\r\n <td height="20" class="messege">{username} wants to share this photo with you<br>\r\n <div id="videoThumb"><a class="text" title="{photo_title}" href="{photo_link}"><img src="{photo_thumb}"><br>\r\n View Photo</a></div></td>\r\n </tr>\r\n <tr>\r\n <td class="text" ><span class="title2">Photo Description</span><br>\r\n <span class="text">{photo_description}</span></td>\r\n </tr>\r\n <tr>\r\n <td><span class="title2">Personal Message</span><br>\r\n <span class="text">{user_message}\r\n </span><br>\r\n <br>\r\n<span class="text">Thanks,</span><br> \r\n<span class="text">{website_title}</span></td>\r\n </tr>\r\n <tr>\r\n <td bgcolor="#0099cc">copyrights {date_year} {website_title}</td>\r\n </tr>\r\n</table>\r\n</body>\r\n</html>', '');
(15, 'Photo Share Template', 'photo_share_template', '{username} wants to share photo with you', '<html>\r\n<head>\r\n<style type="text/css">\r\n<!--\r\n.title {\r\n font-family: Arial, Helvetica, sans-serif;\r\n padding: 5px;\r\n font-weight:bold;\r\n color: #FFFFFF;\r\n font-size: 16px;\r\n}\r\n.title2 {\r\n font-family: Arial, Helvetica, sans-serif;\r\n padding: 5px;\r\n font-weight:bold;\r\n color: #000000;\r\n font-size: 14px;\r\n}\r\n.messege {\r\n font-family: Arial, Helvetica, sans-serif;\r\n padding: 5px;\r\n font-weight:bold;\r\n color: #000000;\r\n font-size: 12px;\r\n}\r\n#videoThumb{\r\n float:left;\r\n padding: 2px;\r\n margin: 3px;\r\n border: 1px solid #F0F0F0;\r\n text-align: center;\r\n vertical-align: middle;\r\n}\r\n#videoThumb img{border:0px}\r\nbody,td,th {\r\n font-family: tahoma;\r\n font-size: 11px;\r\n color: #FFFFFF;\r\n}\r\n.text {\r\n font-family: tahoma;\r\n font-size: 11px;\r\n color: #000000;\r\n padding: 5px;\r\n}\r\n-->\r\n</style>\r\n</head>\r\n<body>\r\n<table width="100%" border="0" cellspacing="0" cellpadding="5">\r\n <tr>\r\n <td bgcolor="#0099cc" ><span class="title">{website_title}</span></td>\r\n </tr>\r\n\r\n <tr>\r\n <td height="20" class="messege">{username} wants to share this photo with you<br>\r\n <div id="videoThumb"><a class="text" title="{photo_title}" href="{photo_link}"><img src="{photo_thumb}"><br>\r\n View Photo</a></div></td>\r\n </tr>\r\n <tr>\r\n <td class="text" ><span class="title2">Photo Description</span><br>\r\n <span class="text">{photo_description}</span></td>\r\n </tr>\r\n <tr>\r\n <td><span class="title2">Personal Message</span><br>\r\n <span class="text">{user_message}\r\n </span><br>\r\n <br>\r\n<span class="text">Thanks,</span><br> \r\n<span class="text">{website_title}</span></td>\r\n </tr>\r\n <tr>\r\n <td bgcolor="#0099cc">copyrights {date_year} {website_title}</td>\r\n </tr>\r\n</table>\r\n</body>\r\n</html>', '');,
(
NULL , 'Video Subscription Email', 'video_subscription_email', '{uploader} has uploaded new video on {website_title}', 'Hello {username} You have been notified by {website_title} that {uploader} has uploaded new video Video Title : {video_title} Video Description : {video_description} <a href="{video_link}"> <img src="{video_thumb" border="0" height="90" width="120"><br> click here to watch this video</a> You are notified because you are subscribed to {uploader}, you can manage your subscriptions by going to your account and click on manage subscriptions. {website_title}', ''
);

View file

@ -1039,4 +1039,7 @@ CREATE TABLE IF NOT EXISTS `{tbl_prefix}video_files` (
ALTER TABLE `{tbl_prefix}video` ADD `video_password` VARCHAR( 255 ) NOT NULL AFTER `videokey` ;
ALTER TABLE `{tbl_prefix}video` ADD `video_users` TEXT NOT NULL AFTER `video_password`;
ALTER TABLE `{tbl_prefix}video` ADD `category_parents` TEXT NOT NULL AFTER `category` ;
ALTER TABLE `{tbl_prefix}video` ADD `category_parents` TEXT NOT NULL AFTER `category` ;
ALTER TABLE `{tbl_prefix}_video` ADD `subscription_email` ENUM( "pending", "sent" ) NOT NULL DEFAULT 'pending' AFTER `last_commented` ;
ALTER TABLE `{tbl_prefix}_groups` ADD `group_admins` TEXT NOT NULL AFTER `userid` ;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB