235.patch

jobin dcruz, 02/15/2011 04:25 AM

Download (42.3 KB)

View differences:

install/inc/folders.php
1 1
<?php
2 2

  
3 3
$writable_folders = array(
4
    'chimg' => 'DIR',
5
    'cache' => 'DIR',
6
    'flvideo' => 'DIR',
7
    'include' => 'DIR',
8
    'include/config.php' => 'FILE',
9
    'photo' => 'DIR',
10
    'templates' => 'DIR',
11
    'templates_c' => 'DIR',
12
    'thumb' => 'DIR',
13
    'video' => 'DIR'
4
    'chimg' => GLOB_ONLYDIR,
5
    'cache' => GLOB_ONLYDIR,
6
    'flvideo' => GLOB_ONLYDIR,
7
    'include' => GLOB_ONLYDIR,
8
    'include/config.php' => GLOB_NOCHECK,
9
    'photo' => GLOB_ONLYDIR,
10
    'templates' => GLOB_ONLYDIR,
11
    'templates_c' => GLOB_ONLYDIR,
12
    'thumb' => GLOB_ONLYDIR,
13
    'video' => GLOB_ONLYDIR
14 14
);
15 15

  
install/index.php
1
<p><a href="./install.php">Click here</a> to install vshare</p>
2
<p><a href="./upgrade.php">Click here</a> to upgrade vshare</p>
1
<?php
2
/******************************************************************************
3
 *
4
 *   COMPANY: BuyScripts.in
5
 *   PROJECT: vShare Youtube Clone
6
 *   VERSION: [VSHARE_VERSION]
7
 *   LISENSE: http://buyscripts.in/vshare-license.html
8
 *   WEBSITE: http://buyscripts.in/youtube_clone.html
9
 *
10
 *   This program is a commercial software and any kind of using it must agree 
11
 *   to vShare license.
12
 *
13
 ******************************************************************************/
14

  
15
$html_title = 'VSHARE UPGRADE';
16
require './tpl/header.php';
17

  
18
$vshare_install = 0;
19

  
20
if (file_exists('../include/config.php') && filesize('../include/config.php') > 0)
21
{
22
    $vshare_install = 1;
23
}
24

  
25
if ($vshare_install == 1)
26
{
27
    require '../include/config.php';  
28
?>  
29
    <span class="msg">Installation cannot be performed</span>
30
    <div style="display:inline-block;width:450px;"><hr />        
31
        <span style="font-size: 12px;">
32
             vShare <?php echo $config['version'];?> is already installed..
33
             <br />
34
            <span class="re-install-msg">(If you want to re-install vshare delete "include/config.php")</span>
35
        </span>
36
        <p class="backup-warning">Before you continue with upgrade, you must take backup of your database and files.</p>
37
    </div> 
38
    <div style="display:inline-block;margin-left:4em;vertical-align:top;"><a href="./upgrade_start.php" class="button">Upgrade Now</a></div>
39
<?php          
40
}
41
else
42
{   
43
?>  
44
    <span class="msg">Welcome to vShare 2.8 Installation</span>
45
    <div style="display:inline-block;width:450px;"><hr />        
46
        <span style="font-size: 12px;">
47
            YouTube Clone Script has almost same features as popular video sharing site YouTube.com
48
            YouTube Clone Script allow you to run your own video sharing portal. Visitors will be able to upload video to your web site, view existing video, comment on video, share video with others.
49
        </span>
50
    </div> 
51
    <div style="display:inline-block;margin-left:4em;vertical-align:top;"><a href="./install.php" class="button">install vshare</a></div>
52
<?php          
53
}
54

  
55
require './tpl/footer.php';
56

  
install/install.php
3 3
 *
4 4
 *   COMPANY: BuyScripts.in
5 5
 *   PROJECT: vShare Youtube Clone
6
 *   VERSION: 2.7
6
 *   VERSION: [VSHARE_VERSION]
7 7
 *   LISENSE: http://buyscripts.in/vshare-license.html
8 8
 *   WEBSITE: http://buyscripts.in/youtube_clone.html
9 9
 *
......
16 16
require 'tpl/header.php';
17 17
require 'inc/folders.php';
18 18

  
19
define('VSHARE_INSTALL',true);
20

  
19 21
$error = '';
20 22

  
21
echo '<h1>Installation Instruction</h1>';
22
echo '<ul>';
23
$folder = str_replace('/install', '', getcwd());
24
echo '<ul id="check-default-folders">';
23 25

  
24
while (list($k, $v) = each($writable_folders))
25
{
26
    if ($v == 'DIR')
26
foreach($writable_folders AS $folder_name => $type)
27
{   
28
    if (!$dir = glob($folder . '/' . $folder_name,$type))
27 29
    {
28
        echo '<li>Make a directory name <b>' . $k . '</b> in your server. Chmod it to 777';
30
        echo '<li class="error">Cannot found folder "' . $folder_name .'". Create folder "' . $folder_name . '" with 777 permission</li>';
31
        $error = 1;
29 32
    }
30
    else if ($v == 'FILE')
31
    {
32
        echo '<li>Set the property of file <b>' . $k . '</b> to writable, So Chmod it to 777';
33
    else
34
    {   
35
        if (!is_writable($dir[0]))
36
        {
37
            echo '<li class="error">Set permission for ' . $folder_name . ' to 777</li>';
38
            $error = 1;
39
        }
33 40
    }
34 41
}
35

  
36 42
echo '</ul>';
37 43

  
38
?>
39

  
40
<form name="myform1" id="foler-input-form" method="POST" action="./install_check_folder_permission.php" onsubmit="return check_folder();">
41
    <input type="hidden" name="step" value="1" /> Enter Directory Location below:
42
    <br /><br />
43
    <input type="text" name="folder" value="<?php echo str_replace('/install/install.php', '', $_SERVER['SCRIPT_FILENAME']); ?>" />
44
    <br /><br />
45
    <input type="submit" name="submit" class="button" value="Start Installation" />
46
</form>
47

  
48

  
49
<?php
44
if ($error == 1)
45
{
46
    echo '<ul style="list-style-type: none;"><li><a href="./install.php" class="button" style="padding:6px;">Check Again</a></li></ul>';
47
}
48
else
49
{
50
    require 'install_collect_info.php';
51
}
50 52

  
51 53
require 'tpl/footer.php';
52

  
53
?>
54
?>
install/install_collect_info.php
3 3
 *
4 4
 *   COMPANY: BuyScripts.in
5 5
 *   PROJECT: vShare Youtube Clone
6
 *   VERSION: 2.7
6
 *   VERSION: [VSHARE_VERSION]
7 7
 *   LISENSE: http://buyscripts.in/vshare-license.html
8 8
 *   WEBSITE: http://buyscripts.in/youtube_clone.html
9 9
 *
10
 *   This program is a commercial software and any kind of using it must agree 
10
 *   This program is a commercial software and any kind of using it must agree
11 11
 *   to vShare license.
12 12
 *
13 13
 ******************************************************************************/
14 14

  
15
$html_title = 'VSHARE INSTALLATION';
16 15

  
17
$error = '';
16
if (!defined('VSHARE_INSTALL'))
17
{
18
    die('Hacking Attempt');
19
}
20

  
21
$site_error = '';
22
$db_error = '';
23
$library_error = '';
24

  
25
$library_info['ffmpeg_path'] = exec('which ffmpeg');
26
$library_info['mencoder_path'] = exec('which mencoder');
27
$library_info['mplayer_path'] = exec('which mplayer');
28
$library_info['flvtool_path'] = exec('which flvtool2');
18 29

  
19 30
if (isset($_POST['connect_info']))
20 31
{
21

  
22 32
    $site_url = $_POST['site_url'];
23 33
    
24 34
    if (strlen($site_url) < 12)
25 35
    {
26
        $error .= '<li>Site url invalid.</li>';
36
        $site_error .= '<li>Site url invalid.</li>';
27 37
    }
28 38
    
39
    if (strlen($_POST['admin_name']) < 4)
40
    {
41
        $site_error .= '<li>Site admin name too short.</li>';
42
    }
43
    
44
    if (strlen($_POST['admin_password']) < 6)
45
    {
46
        $site_error .= '<li>Site admin password too short.</li>';
47
    }
48
    else if ($_POST['admin_password'] != $_POST['admin_password_confirm'])
49
    {
50
        $site_error .= '<li>Site admin password and confirm password don\'t match.</li>';
51
    }
52

  
29 53
    $ffmpeg_path = $_POST['ffmpeg_path'];
30 54
    
31 55
    if (!file_exists($ffmpeg_path))
32 56
    {
33
        $error .= '<li>ffmpeg not found : ' . $ffmpeg_path . '</li>';
57
        $library_error .= '<li>ffmpeg not found : ' . $ffmpeg_path . '</li>';
34 58
    }
35 59
    
36 60
    $mplayer_path = $_POST['mplayer_path'];
37 61
    
38 62
    if (!file_exists($mplayer_path))
39 63
    {
40
        $error .= '<li>mplayer not found : ' . $mplayer_path . '</li>';
64
        $library_error .= '<li>mplayer not found : ' . $mplayer_path . '</li>';
41 65
    }
42 66
    
43 67
    $mencoder_path = $_POST['mencoder_path'];
44 68
    
45 69
    if (!file_exists($mencoder_path))
46 70
    {
47
        $error .= '<li>mencoder not found : ' . $mencoder_path . '</li>';
71
        $library_error .= '<li>mencoder not found : ' . $mencoder_path . '</li>';
48 72
    }
49 73
        
50 74
    $flvtool_path = $_POST['flvtool_path'];
51 75
    
52 76
    if (!file_exists($flvtool_path))
53 77
    {
54
        $error .= '<li>flvtool2 not found : ' . $flvtool_path . '</li>';
78
        $library_error .= '<li>flvtool2 not found : ' . $flvtool_path . '</li>';
55 79
    }
56 80
        
57 81
    $db_server = $_POST['db_server'];
......
62 86

  
63 87
    if (!is_dir($folder))
64 88
    {
65
        $error .= '<li>folder not found : ' . $folder . '</li>';
89
        $site_error .= '<li>folder not found : "' . $folder . '"</li>';
66 90
    }
67 91
    
68 92
    $link = @mysql_connect($db_server, $db_user,$db_pass);
69 93
    
70 94
    if (! $link)
71 95
    {
72
        $error .= '<li>Failed to connect to database server. ' . mysql_error() . '</li>';
96
        $db_error = '<li>Failed to connect to database server. ' . mysql_error() . '</li>';
73 97
    }
74 98
    else
75 99
    {
......
77 101
        
78 102
        if (! $suc)
79 103
        {
80
            $error .= '<li>Succesfuly connected to database server, but failed to open the database (' . $db_name . '). Please check the data and try again. ' . mysql_error() . '</li>';
104
            $db_error = '<li>Succesfuly connected to database server, but failed to open the database (' . $db_name . '). Please check the data and try again. ' . mysql_error() . '</li>';
81 105
        }
106
        
107
        mysql_close($link);
82 108
    }
83 109

  
84
    if ($error == '')
110
    if ($site_error == '' && $db_error == '' && $library_error == '')
85 111
    {
112
        $admin_name = $_POST['admin_name'];
113
        $admin_password = $_POST['admin_password'];
86 114
        $fp = fopen('../include/config.php', 'w');
87 115
        fputs($fp, '<?php');
88 116

  
......
114 142
            
115 143
    fputs($fp, $vshare_config);
116 144
    fclose($fp);
117

  
118
    require './tpl/header.php';
119
?>
120

  
121
<p class="config-created">Configuration file created (include/config.php)</p>
122

  
123
<form method="post" action="install_create_tables.php">
124
<input type="submit" class="button" name=submit value="Continue Installation"> 
125
<input type="hidden" name="db_host" value="<?php echo $db_server; ?>"> 
126
<input type="hidden" name="db_name" value="<?php echo $db_name; ?>"> 
127
<input type="hidden" name="db_user" value="<?php echo $db_user; ?>"> 
128
<input type="hidden" name="db_pass" value="<?php echo $db_pass; ?>"> 
129
<input type="hidden" name="action" value="create_tables">
130
</form>
131

  
132
<?php
133
            
134
        require 'tpl/footer.php';            
135
        exit(0);
145
    
146
    echo '<ul><li><span style="color:#059E07;font-weight:bold;">Configuration file created "include/config.php".</span></li>';
147
      
148
    require 'install_create_tables.php';
149
    require 'tpl/footer.php';
150
    exit(0);
136 151
    }
137 152
}
138
else 
153
else
139 154
{
140 155
    
141 156
    $url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
142
    $site_url = str_replace('/install/install_collect_info.php', '', $url);
143
    
144
    $ffmpeg_path = '';
145
    
146
    if (file_exists('/usr/bin/ffmpeg'))
147
    {
148
        $ffmpeg_path = '/usr/bin/ffmpeg';
149
    }
150
    else if (file_exists('/usr/local/bin/ffmpeg'))
151
    {
152
        $ffmpeg_path = '/usr/local/bin/ffmpeg';
153
    }
154
    
155
    $mplayer_path = '';
156
    
157
    if (file_exists('/usr/bin/mplayer'))
158
    {
159
        $mplayer_path = '/usr/bin/mplayer';
160
    }
161
    else if (file_exists('/usr/local/bin/mplayer'))
162
    {
163
        $mplayer_path = '/usr/local/bin/mplayer';
164
    }
165
    
166
    $mencoder_path = '';
167
    
168
    if (file_exists('/usr/bin/mencoder'))
169
    {
170
        $mencoder_path = '/usr/bin/mencoder';
171
    }
172
    else if (file_exists('/usr/local/bin/mencoder'))
173
    {
174
        $mencoder_path = '/usr/local/bin/mencoder';
175
    }
176
    
177
    $flvtool_path = '';
178
    
179
    if (file_exists('/usr/bin/flvtool2'))
180
    {
181
        $flvtool_path = '/usr/bin/flvtool2';
182
    }
183
    else if (file_exists('/usr/local/bin/flvtool2'))
184
    {
185
        $flvtool_path = '/usr/local/bin/flvtool2';
186
    }
187
    
157
    $site_url = str_replace('/install/install.php', '', $url);
188 158
    $db_name = $db_user = $db_pass = '';
189 159
    $db_server = 'localhost';
190 160
}
191
require 'tpl/header.php';
192 161

  
193
if ($error != '')
162
if (empty($site_error) && empty($db_error) && empty($library_error))
194 163
{
195
    echo '<div class="error"><ul>' . $error . '</ul></div>';
164
    echo '<span style="color:#059E07;font-weight:bold;">Environment checked. You can install vShare.</span><br /><br />';
196 165
}
197 166

  
198 167
?>
199 168

  
200
<h1>Database & Website Settings</h1>
201

  
202 169
<P>vShare only run if your server support all <a href="http://labs.buyscripts.in/projects/vshare/wiki/Requirements" target="_blank">requirements</A>. If you don't know path to ffmpeg, mencoder, flvtool2, etc... installed on your server, ask your server provider.</p>
203 170

  
204 171
<form name="myform2" method="POST" action="">
......
206 173
<table width="96%" border="0" cellspacing="2" cellpadding="2" align="center">
207 174

  
208 175
<tr>
176
<td colspan="2">
177
    <span class="msg">Site Settings</span><hr />
178
    <div class="error"><?php echo $site_error;?></div>
179
</td>
180
</tr>
181

  
182
<tr>
209 183
<td width="30%">Site URL</td>
210
<td width="70%"><input type="text" name="site_url" size="33" value="<?php echo $site_url;?>"> (i.e. <i>http://yoursite.com/vshare</i>)</td>
184
<td width="70%"><input type="text" name="site_url" size="33" value="<?php echo $site_url;?>"> <br /> <small>(i.e. http://yoursite.com/vshare</small>)</td>
211 185
</tr>
212 186

  
213 187
<tr>
214 188
<td width="30%">Site Path</td>
215
<td width="70%"><input type="text" name="folder" size="33" value="<?php echo $_POST['folder'];?>"> (i.e. <i>/home/username/public_html</i>)</td>
189
<td width="70%"><input type="text" name="folder" size="33" value="<?php echo $folder;?>"><br /> <small>(i.e. /home/username/public_html</small>)</td>
190
</tr>
191

  
192
<tr>
193
<td width="30%">Site Admin Name</td>
194
<td width="70%"><input type="text" name="admin_name" size="33" value="<?php if (!isset($_POST['admin_name'])){echo 'admin';}else{echo $_POST['admin_name'];}?>"></td>
195
</tr>
196

  
197
<tr>
198
<td width="30%">Site Admin Password</td>
199
<td width="70%"><input type="password" name="admin_password" size="33" value=""></td>
200
</tr>
201

  
202
<tr>
203
<td width="30%">Site Admin Password confirm</td>
204
<td width="70%"><input type="password" name="admin_password_confirm" size="33" value=""></td>
205
</tr>
206

  
207
<tr>
208
<td colspan="2">
209
    <a name="library-settings"></a>
210
    <span class="msg">Library Settings</span><hr />
211
</td>
216 212
</tr>
217 213

  
218 214
<tr>
219 215
<td width="30%">FFMpeg binary</td>
220
<td width="70%"><input type="text" name="ffmpeg_path" size="33" value="<?php echo $ffmpeg_path;?>"> (i.e. <i>/usr/bin/ffmpeg</i>)</td>
216
<td width="70%"><input type="text" name="ffmpeg_path" size="33" value="<?php echo $library_info['ffmpeg_path'];?>"><br /> <small> (i.e. /usr/bin/ffmpeg</small>)</td>
221 217
</tr>
222 218

  
223 219
<tr>
224 220
<td width="30%">Mencoder binary</td>
225
<td width="70%"><input type="text" name="mencoder_path" size="33" value="<?php echo $mencoder_path;?>"> (i.e. <i>/usr/bin/mencoder</i>)</td>
221
<td width="70%"><input type="text" name="mencoder_path" size="33" value="<?php echo $library_info['mencoder_path'];?>"> <br /> <small>(i.e. /usr/bin/mencoder</small>)</td>
226 222
</tr>
227 223

  
228 224
<tr>
229 225
<td width="30%">Mplayer binary</td>
230
<td width="70%"><input type="text" name="mplayer_path" size="33" value="<?php echo $mplayer_path;?>"> (i.e. <i>/usr/bin/mplayer</i>)</td>
226
<td width="70%"><input type="text" name="mplayer_path" size="33" value="<?php echo $library_info['mplayer_path'];?>"> <br /> <small>(i.e. /usr/bin/mplayer</small>)</td>
231 227
</tr>
232 228

  
233 229
<tr>
234 230
<td width="30%">FLVTool binary</td>
235
<td width="70%"><input type="text" name="flvtool_path" size="33" value="<?php echo $flvtool_path;?>"> (i.e. <i>/usr/bin/flvtool2</i>)</td>
231
<td width="70%"><input type="text" name="flvtool_path" size="33" value="<?php echo $library_info['flvtool_path'];?>"> <br /> <small>(i.e. /usr/bin/flvtool2</small>)</td>
232
</tr>
233

  
234
<tr>
235
<td colspan="2">
236
    <span class="msg">Database Settings</span><hr />
237
    <div class="error"><?php echo $db_error;?></div>
238
</td>
236 239
</tr>
237 240

  
238 241
<tr>
239 242
<td width="30%">MySQL database server</td>
240
<td width="70%"><input type="text" name="db_server" size="33" value="<?php echo $db_server;?>"> usually <i>localhost</i></td>
243
<td width="70%"><input type="text" name="db_server" size="33" value="<?php echo $db_server;?>"> <br /> <small>usually localhost</small></td>
241 244
</tr>
242 245

  
243 246
<tr>
......
263 266
</table>
264 267
</form>
265 268

  
266
<?php
267

  
268
require 'tpl/footer.php';
269
<script type="text/javascript">
270
$(document).ready(function(){
271
    var top = 0;
272
    $("div.error").each(function(){
273
        if ($(this).html() != '') {
274
        	top = $(this).offset().top;
275
        	top = top - 40;
276
        	return false;
277
        }
278
    });
279
    $('html, body').animate({scrollTop:top}, 'slow');
280
});
281
</script>
269 282

  
270
?>
install/install_create_tables.php
3 3
 *
4 4
 *   COMPANY: BuyScripts.in
5 5
 *   PROJECT: vShare Youtube Clone
6
 *   VERSION: 2.7
6
 *   VERSION: [VSHARE_VERSION]
7 7
 *   LISENSE: http://buyscripts.in/vshare-license.html
8 8
 *   WEBSITE: http://buyscripts.in/youtube_clone.html
9 9
 *
10
 *   This program is a commercial software and any kind of using it must agree 
10
 *   This program is a commercial software and any kind of using it must agree
11 11
 *   to vShare license.
12 12
 *
13 13
 ******************************************************************************/
14 14

  
15
$html_title = 'VSHARE INSTALLATION';
15
if (!defined('VSHARE_INSTALL'))
16
{
17
    die('Hacking Attempt');
18
}
16 19

  
17 20
require '../include/config.php';
18
require 'tpl/header.php';
19 21

  
20 22
$tables = array();
21 23

  
22 24
$q = mysql_query('SHOW TABLES');
23 25

  
24
while ($r = @mysql_fetch_array($q)) 
26
while ($r = @mysql_fetch_array($q))
25 27
{
26 28
    $tables[] = $r[0];
27 29
}
28 30

  
29 31
@mysql_free_result($q);
30 32

  
31
if(in_array('videos', $tables)) 
33
if(in_array('videos', $tables))
32 34
{
33 35
    echo "<p>Your database already have tables needed for vshare. If you are upgrading, use the upgrade script instead.</p>";
34 36
    echo "<p class=\"table-already-exists\">If you are doing fresh install, make sure the database is empty.</p>";
......
43 45
    <input type=\"hidden\" name=\"action\" value=\"create_tables\" />
44 46
    </form>";
45 47

  
46
} 
47
else 
48
}
49
else
48 50
{
49 51
    require 'inc/class.sql_import.php';
50 52
    $sql_import = new Sql2Db('sql/vshare.sql');
......
65 67
           `user_join_time`='" . time() . "',
66 68
           `user_last_login_time`='" . time() . "'";
67 69
    $result = mysql_query($sql) or mysql_die($sql);
68

  
69
    echo "<p class=\"tables-created\">Database tables created.</p>
70
        <form action=\"install_finished.php\" METHOD=\"POST\">
71
        <input type=\"hidden\" name=\"buyscript_pass\" value=\"$buyscript_pass\" />
72
        <input type=\"submit\" name=\"submit\" value=\"Continue Installation >>\" class=\"button\" />
73
        </form>";
70
    
71
    $sql = "UPDATE `sconfig` SET `svalue`='" . mysql_clean($admin_name) . "' WHERE
72
           `soption`='admin_name'";
73
    $result = mysql_query($sql) or mysql_die($sql);
74
    
75
    $md5_admin_password = md5($admin_password);
76
    
77
    $sql = "UPDATE `sconfig` SET `svalue`='" . mysql_clean($md5_admin_password) . "' WHERE
78
           `soption`='admin_pass'";
79
    $result = mysql_query($sql) or mysql_die($sql);
80
    
81
    
82
    echo '<li><span style="color:#059E07;font-weight:bold;">Database tables created.</span></li>';
83
    echo '<li><span style="color:#059E07;font-weight:bold;">Admin account created.</span></li></ul>';
84
    require 'install_finished.php';
74 85
}
75 86

  
76
require './tpl/footer.php';
install/install_finished.php
3 3
 *
4 4
 *   COMPANY: BuyScripts.in
5 5
 *   PROJECT: vShare Youtube Clone
6
 *   VERSION: 2.7
6
 *   VERSION: [VSHARE_VERSION]
7 7
 *   LISENSE: http://buyscripts.in/vshare-license.html
8 8
 *   WEBSITE: http://buyscripts.in/youtube_clone.html
9 9
 *
10
 *   This program is a commercial software and any kind of using it must agree 
10
 *   This program is a commercial software and any kind of using it must agree
11 11
 *   to vShare license.
12 12
 *
13 13
 ******************************************************************************/
14 14

  
15
$html_title = 'VSHARE INSTALLATION';
16
require '../include/config.php';
17
require './tpl/header.php';
18

  
19
$buyscript_pass = $_POST['buyscript_pass'];
15
if (!defined('VSHARE_INSTALL'))
16
{
17
    die('Hacking Attempt');
18
}
20 19

  
21 20
echo <<<EOT
22 21

  
23
<p class="install-finish-success">vShare Youtube Clone installation completed successfully.</p>
22
<span class="msg">vShare Youtube Clone installation completed successfully.</span><hr /><br />
24 23

  
25 24
<div class="login-info">
26 25

  
......
29 28
<a href='$config[baseurl]/admin/' target="_blank">$config[baseurl]/admin/</a><br />
30 29

  
31 30
<p>
32
Username : admin<br />
33
Password : buyscripts
31
Username : $admin_name<br />
32
Password : $admin_password
34 33
</p>
35 34

  
36
<p>You must change default admin password by logging into admin control panel.</p>
35
<p>You must change admin password by logging into admin control panel.</p>
37 36

  
38 37
<p>Test User Account</p>
39 38

  
......
50 49

  
51 50
EOT;
52 51

  
53
require './tpl/footer.php';
install/sql/upgrade_2.7_to_2.8.1.sql
1
ALTER TABLE `packages` ADD `package_allow_download` INT( 11 ) NOT NULL DEFAULT '0';
2
UPDATE `config` SET `config_name` = 'flv_metadata',`config_value` = 'flvtool' WHERE `config_name` = 'enable_flvtool' LIMIT 1 ;
3
ALTER TABLE `import_track` ADD `import_track_video_id` INT( 11 ) NOT NULL AFTER `import_track_unique_id`;
4
ALTER TABLE `process_queue` ADD `import_track_id` INT( 11 ) NOT NULL AFTER `process_queue_upload_ip`;
5
ALTER TABLE `users` ADD `user_friend_invition` tinyint(1) NOT NULL DEFAULT '1';
6
ALTER TABLE `users` ADD `user_private_message` tinyint(1) NOT NULL DEFAULT '1';
7
ALTER TABLE `users` ADD `user_profile_comment` tinyint(1) NOT NULL DEFAULT '1';
8
ALTER TABLE `users` ADD `user_favourite_public` tinyint(1) NOT NULL DEFAULT '1';
9
ALTER TABLE `users` ADD `user_playlist_public` tinyint(1) NOT NULL DEFAULT '1';
10
ALTER TABLE `users` ADD `user_videos` INT( 11 ) NOT NULL DEFAULT '0';
11
ALTER TABLE `users` ADD `user_subscribe_admin_mail` tinyint(1) NOT NULL DEFAULT '1' AFTER `user_email_verified`;
12

  
13
CREATE TABLE IF NOT EXISTS `admin_log` (
14
  `admin_log_id` int(11) NOT NULL auto_increment,
15
  `admin_log_user_id` int(11) NOT NULL,
16
  `admin_log_script` varchar(255) NOT NULL,
17
  `admin_log_time` int(11) NOT NULL,
18
  `admin_log_action` varchar(255) NOT NULL,
19
  `admin_log_extra` varchar(255) NOT NULL,
20
  `admin_log_ip` varchar(255) NOT NULL,
21
  PRIMARY KEY  (`admin_log_id`)
22
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
23

  
24
INSERT INTO `config` (`config_name`, `config_value`) VALUES ('youtube_player', 'youtube');
25

  
26
CREATE TABLE IF NOT EXISTS `video_responses` (
27
  `video_response_id` int(11) NOT NULL auto_increment,
28
  `video_response_video_id` int(11) NOT NULL,
29
  `video_response_to_video_id` int(11) NOT NULL,
30
  `video_response_active` int(1) NOT NULL default '0',
31
  `video_response_add_time` int(11) NOT NULL,
32
  PRIMARY KEY  (`video_response_id`)
33
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
34

  
35
INSERT INTO `email_templates` (`email_id` ,`email_subject` ,`email_body` ,`comment`) VALUES ('video_response_notify', '[SITE_NAME] - Video response to "[VIDEO_TITLE]"', '<p><a href="[SITE_URL]/[USERNAME]">[USERNAME]</a> has posted a video in response to <a href="[VIDEO_URL]">[VIDEO_TITLE]</a></p> <p>Response Video: <a href="[RESPONSE_VIDEO_URL]">[RESPONSE_VIDEO_TITLE]</a></p><p>This video requires your approval. You can approve or reject it by visiting the following link.</p><p><a href="[VERIFY_LINK]">[VERIFY_LINK]</a></p><p>Thanks</p><p><a href="[SITE_URL]">[SITE_NAME]</a> Team</p>', 'video response notify');
36
INSERT INTO `email_templates` (`email_id`, `email_subject`, `email_body`, `comment`) VALUES ('unsubscribe_admin_mail', 'admin mail footer', '<br />\r\n<a href="[UNSUBSCRIBE_URL]" target="_blank">Unsubscribe</a>', 'admin mail footer');
37

  
38
DROP TABLE IF EXISTS `playlists`;
39

  
40
CREATE TABLE IF NOT EXISTS `playlists_videos` (
41
`playlists_videos_playlist_id` int( 11 ) NOT NULL DEFAULT 0,
42
`playlists_videos_video_id` bigint( 20 ) default NULL
43
);
44

  
45
CREATE TABLE IF NOT EXISTS `playlists` (
46
`playlist_id` int(11) NOT NULL auto_increment,
47
`playlist_user_id` int(11) NOT NULL,
48
`playlist_name` varchar(50) NOT NULL,
49
`playlist_add_date` varchar(255) NOT NULL,
50
PRIMARY KEY (`playlist_id`)
51
);
52

  
53
INSERT INTO `config` (`config_name`, `config_value`) VALUES ('vshare_player', 'JW Player');
54
INSERT INTO `sconfig` (`soption` ,`svalue`) VALUES ('family_filter', '1');
55
ALTER TABLE `process_queue` ADD `adult` TINYINT( 1 ) NOT NULL DEFAULT '0';
56
INSERT INTO `config` (`config_name`, `config_value`) VALUES('signup_age_min_enforce', '0');
57
INSERT INTO `config` (`config_name`, `config_value`) VALUES('signup_age_min', '18');
58
ALTER TABLE `users` CHANGE `user_account_status` `user_account_status` ENUM( 'Active', 'Inactive', 'Suspended' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'Active';
install/sql/upgrade_2.7_to_2.8.sql
1
ALTER TABLE `packages` ADD `package_allow_download` INT( 11 ) NOT NULL DEFAULT '0'
2
UPDATE `config` SET `config_name` = 'flv_metadata',`config_value` = 'flvtool' WHERE `config_name` = 'enable_flvtool' LIMIT 1 ;
3
ALTER TABLE `import_track` ADD `import_track_video_id` INT( 11 ) NOT NULL AFTER `import_track_unique_id`;
4
ALTER TABLE `process_queue` ADD `import_track_id` INT( 11 ) NOT NULL AFTER `process_queue_upload_ip`;
5
ALTER TABLE `users` ADD `user_friend_invition` tinyint(1) NOT NULL DEFAULT '1';
6
ALTER TABLE `users` ADD `user_private_message` tinyint(1) NOT NULL DEFAULT '1';
7
ALTER TABLE `users` ADD `user_profile_comment` tinyint(1) NOT NULL DEFAULT '1';
8
ALTER TABLE `users` ADD `user_favourite_public` tinyint(1) NOT NULL DEFAULT '1';
9
ALTER TABLE `users` ADD `user_playlist_public` tinyint(1) NOT NULL DEFAULT '1';
10
ALTER TABLE `users` ADD `user_videos` INT( 11 ) NOT NULL DEFAULT '0';
11
ALTER TABLE `users` ADD `user_subscribe_admin_mail` tinyint(1) NOT NULL DEFAULT '1' AFTER `user_email_verified`;
12

  
13
CREATE TABLE IF NOT EXISTS `admin_log` (
14
  `admin_log_id` int(11) NOT NULL auto_increment,
15
  `admin_log_user_id` int(11) NOT NULL,
16
  `admin_log_script` varchar(255) NOT NULL,
17
  `admin_log_time` int(11) NOT NULL,
18
  `admin_log_action` varchar(255) NOT NULL,
19
  `admin_log_extra` varchar(255) NOT NULL,
20
  `admin_log_ip` varchar(255) NOT NULL,
21
  PRIMARY KEY  (`admin_log_id`)
22
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
23

  
24
INSERT INTO `config` (`config_name`, `config_value`) VALUES ('youtube_player', 'youtube');
25

  
26
CREATE TABLE IF NOT EXISTS `video_responses` (
27
  `video_response_id` int(11) NOT NULL auto_increment,
28
  `video_response_video_id` int(11) NOT NULL,
29
  `video_response_to_video_id` int(11) NOT NULL,
30
  `video_response_active` int(1) NOT NULL default '0',
31
  `video_response_add_time` int(11) NOT NULL,
32
  PRIMARY KEY  (`video_response_id`)
33
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
34

  
35
INSERT INTO `email_templates` (`email_id` ,`email_subject` ,`email_body` ,`comment`) VALUES ('video_response_notify', '[SITE_NAME] - Video response to "[VIDEO_TITLE]"', '<p><a href="[SITE_URL]/[USERNAME]">[USERNAME]</a> has posted a video in response to <a href="[VIDEO_URL]">[VIDEO_TITLE]</a></p> <p>Response Video: <a href="[RESPONSE_VIDEO_URL]">[RESPONSE_VIDEO_TITLE]</a></p><p>This video requires your approval. You can approve or reject it by visiting the following link.</p><p><a href="[VERIFY_LINK]">[VERIFY_LINK]</a></p><p>Thanks</p><p><a href="[SITE_URL]">[SITE_NAME]</a> Team</p>', 'video response notify');
36
INSERT INTO `email_templates` (`email_id`, `email_subject`, `email_body`, `comment`) VALUES ('unsubscribe_admin_mail', 'admin mail footer', '<br />\r\n<a href="[UNSUBSCRIBE_URL]" target="_blank">Unsubscribe</a>', 'admin mail footer');
37

  
38
DROP TABLE IF EXISTS `playlists`;
39

  
40
CREATE TABLE IF NOT EXISTS `playlists_videos` (
41
`playlists_videos_playlist_id` int( 11 ) NOT NULL DEFAULT 0,
42
`playlists_videos_video_id` bigint( 20 ) default NULL
43
);
44

  
45
CREATE TABLE IF NOT EXISTS `playlists` (
46
`playlist_id` int(11) NOT NULL auto_increment,
47
`playlist_user_id` int(11) NOT NULL,
48
`playlist_name` varchar(50) NOT NULL,
49
`playlist_add_date` varchar(255) NOT NULL,
50
PRIMARY KEY (`playlist_id`)
51
);
52

  
53
INSERT INTO `config` (`config_name`, `config_value`) VALUES ('vshare_player', 'JW Player');
54
INSERT INTO `sconfig` (`soption` ,`svalue`) VALUES ('family_filter', '1');
55
ALTER TABLE `process_queue` ADD `adult` TINYINT( 1 ) NOT NULL DEFAULT '0';
56
INSERT INTO `config` (`config_name`, `config_value`) VALUES('signup_age_min_enforce', '0');
57
INSERT INTO `config` (`config_name`, `config_value`) VALUES('signup_age_min', '18');
58
ALTER TABLE `users` CHANGE `user_account_status` `user_account_status` ENUM( 'Active', 'Inactive', 'Suspended' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'Active';
install/sql/upgrade_2.8 _to 2.8.1.sql
1
DROP TABLE IF EXISTS `playlists`;
2
DROP TABLE IF EXISTS `video_playlists`;
3

  
4
CREATE TABLE IF NOT EXISTS `playlists_videos` (
5
`playlists_videos_playlist_id` int( 11 ) NOT NULL DEFAULT 0,
6
`playlists_videos_video_id` bigint( 20 ) default NULL
7
);
8

  
9
CREATE TABLE IF NOT EXISTS `playlists` (
10
`playlist_id` int(11) NOT NULL auto_increment,
11
`playlist_user_id` int(11) NOT NULL,
12
`playlist_name` varchar(50) NOT NULL,
13
`playlist_add_date` varchar(255) NOT NULL,
14
PRIMARY KEY (`playlist_id`)
15
);
16

  
17
CREATE TABLE IF NOT EXISTS `video_responses` (
18
  `video_response_id` int(11) NOT NULL auto_increment,
19
  `video_response_video_id` int(11) NOT NULL,
20
  `video_response_to_video_id` int(11) NOT NULL,
21
  `video_response_active` int(1) NOT NULL default '0',
22
  `video_response_add_time` int(11) NOT NULL,
23
  PRIMARY KEY  (`video_response_id`)
24
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
25

  
26
ALTER TABLE `process_queue` CHANGE `adult` `adult` TINYINT( 1 ) NOT NULL DEFAULT '0';
27
ALTER TABLE `process_queue` ADD `import_track_id` INT( 11 ) NOT NULL AFTER `process_queue_upload_ip`;
28
ALTER TABLE `import_track` ADD `import_track_video_id` INT( 11 ) NOT NULL AFTER `import_track_unique_id`;
29
ALTER TABLE `users` ADD `user_videos` INT( 11 ) NOT NULL DEFAULT '0';
30
ALTER TABLE `users` ADD `user_subscribe_admin_mail` tinyint(1) NOT NULL DEFAULT '1' AFTER `user_email_verified`;
31

  
32
INSERT INTO `email_templates` (`email_id` ,`email_subject` ,`email_body` ,`comment`) VALUES ('video_response_notify', '[SITE_NAME] - Video response to "[VIDEO_TITLE]"', '<p><a href="[SITE_URL]/[USERNAME]">[USERNAME]</a> has posted a video in response to <a href="[VIDEO_URL]">[VIDEO_TITLE]</a></p> <p>Response Video: <a href="[RESPONSE_VIDEO_URL]">[RESPONSE_VIDEO_TITLE]</a></p><p>This video requires your approval. You can approve or reject it by visiting the following link.</p><p><a href="[VERIFY_LINK]">[VERIFY_LINK]</a></p><p>Thanks</p><p><a href="[SITE_URL]">[SITE_NAME]</a> Team</p>', 'video response notify');
33
INSERT INTO `email_templates` (`email_id`, `email_subject`, `email_body`, `comment`) VALUES ('unsubscribe_admin_mail', 'admin mail footer', '<br />\r\n<a href="[UNSUBSCRIBE_URL]" target="_blank">Unsubscribe</a>', 'admin mail footer');
34
INSERT INTO `config` (`config_name`, `config_value`) VALUES ('vshare_player', 'JW Player');
35
INSERT INTO `config` (`config_name`, `config_value`) VALUES ('youtube_player', 'youtube');
install/tpl/header.php
4 4
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 5
<title><?php echo $html_title; ?></title>
6 6
<link href="tpl/style.css" rel="stylesheet" type="text/css" />
7
<?php
8
    $url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
9
    $js_url = str_replace('/install/install.php', '', $url);
10
?>
11
<script type="text/javascript" src="<?php echo $js_url; ?>/js/jquery-1.3.2.min.js"></script>
7 12
</head>
8 13
<body>
9 14

  
......
15 20

  
16 21
    <div id="page">
17 22
    
18
    
23
    
install/tpl/style.css
1 1
body {
2 2
    background-color:#334075;
3
    font-family:verdana;
3
    font-family: sans-serif;
4
	color: #16619C;
4 5
    margin:0;
5 6
    padding:0;
6 7
    background:#11568c url(./images/body-bg.jpg) repeat-x scroll center top;
8
    font-size: 12px;
7 9
}
8 10
input {
9 11
    font-family:Verdana, Geneva, sans-serif;
......
12 14
    width:800px;
13 15
    margin:0 auto;
14 16
    background-color:#fff;
15
    min-height:600px;
17
    /*min-height:600px;*/
16 18
    border-left:3px dotted #16619c;
17 19
    border-right:3px dotted #16619c
18 20
}
......
55 57
input {
56 58
    font-size:16px;
57 59
    margin:0.5em 0;
58
    background:#FFC;
59
    border:1px solid #000;
60
    border:1px solid #075BB5;
60 61
    width:25em;
61
    padding:5px;
62
    padding:4px;
63
    color: #03458C;
64
    -moz-border-radius: 4px 4px 4px 4px;
65
    -webkit-border-radius: 4px 4px 4px 4px;
66
    border-radius: 4px 4px 4px 4px;
67
    -o-border-radius: 4px 4px 4px 4px;
62 68
}
63 69
input:hover {
64 70
    border:1px solid #F93;
65 71
}
66 72
input.button {
67
    font-size:16px;
68
    width:15em;
69
    background-color: #333333;
70
    color: #FFFFFF;
71
    margin-right: 6px;
73
    padding: 10px 5px;
74
    width: auto;
72 75
}
73 76
div#wrapper div#page ul#check-default-folders li {
74 77
    background:transparent url(./images/ok-tick.jpg) no-repeat scroll 1px 8px;
......
77 80
    list-style-type: none;
78 81
}
79 82
div#wrapper div#page ul#check-default-folders li.error {
80
    background:transparent url(./images/error-tick.jpg) no-repeat scroll 1px 8px;
83
    background:transparent url(./images/error.png) no-repeat scroll 1px 8px;
81 84
    color:#F00;
82 85
    font-weight:bold;
83 86
}
84 87
div.error {
85 88
    color:#F00;
86
    background-color:#FF9;
87
    font-weight:bold;
88
    border:1px solid red;
89 89
}
90 90
div.error li {
91 91
    margin:0.5em 0;
......
112 112
}
113 113
div.login-info {
114 114
    font-size:14px;
115
    font-weight:bold;
116
    color:#0f4c7c;
117 115
    margin-botton:1em;
118 116
}
119 117
div.login-info a, div.login-info a:visited {
......
127 125

  
128 126
p.backup-warning {
129 127
    color:#ff0000;
130
    font-weight:bold;
131
    font-size:2em;
128
    font-weight:normal;
129
    font-size:20px;
132 130
}
133 131

  
134 132
p.upgrade-finished {
......
140 138
p.upgrade-finished-version {
141 139
	font-weight:bold;
142 140
	color:#666;
143
}
141
}
142
span.msg {
143
     color:#941837;
144
     font-weight:bold;
145
	font-size: 17px;
146
}
147
.re-install-msg {
148
     color:#828181;
149
     font-size: 12px;
150
}
151
.button {
152
	display: inline-block;
153
	border: 1px solid rgb(0, 0, 0);
154
	padding: 30px;
155
	text-decoration: none;
156
	-moz-border-radius: 3px 3px 3px 3px;
157
	text-transform: uppercase;
158
	background: none repeat scroll 0% 0% rgb(22, 97, 156);
159
	color: rgb(255, 255, 255);
160
	-moz-box-shadow: 5px 5px 5px #ccc;
161
	-webkit-box-shadow: 5px 5px 5px #ccc;
162
	font-size: 15px;
163
}
164
hr {
165
    border-color: #ACADAC -moz-use-text-color #000000;
166
    border-left: 0 none;
167
    border-right: 0 none;
168
    border-style: dotted none solid;
169
    border-width: 1px 0;
170
    height: 2px;
171
    text-align: left;
172
}
install/upgrade_2.7_to_2.8.1.php
1
<?php
2
/******************************************************************************
3
 *
4
 *   COMPANY: BuyScripts.in
5
 *   PROJECT: vShare Youtube Clone
6
 *   VERSION: [VSHARE_VERSION]
7
 *   LISENSE: http://buyscripts.in/vshare-license.html
8
 *   WEBSITE: http://buyscripts.in/youtube_clone.html
9
 *
10
 *   This program is a commercial software and any kind of using it must agree 
11
 *   to vShare license.
12
 *
13
 ******************************************************************************/
14

  
15
$html_title = 'VSHARE UPGRADE';
16
require '../include/config.php'; 
17
require '../include/functions_seo_name.php';
18
require '../include/class.tags.php';
19
require './inc/class.sql_import.php';
20
require './inc/functions_upgrade.php';
21
require './tpl/header.php';
22

  
23
if ($config['version'] != '2.7')
24
{
25
    die('<p>This upgrade script can only upgrade if you are using version: 2.7</p>');
26
}
27

  
28
write_log('#### UPGRADE 2.7 to 2.8.1 STARTED ####', 'vshare_upgrade', 0,'txt');
29

  
30
$sql_file = VSHARE_DIR . '/install/sql/upgrade_2.7_to_2.8.1.sql';
31
$sql_import = new Sql2Db($sql_file);
32
$sql_import->import();
33

  
34
$sql = "UPDATE `sconfig` SET `svalue`='2.8.1' WHERE
35
       `soption`='version'";
36
$result = mysql_query($sql) or mysql_die($sql);       
37

  
38
write_log('#### UPGRADE 2.7 to 2.8.1 FINISHED ####', 'vshare_upgrade', 0,'txt');
39

  
40
redirect(VSHARE_URL . '/install/upgrade_finished.php');
41

  
42

  
install/upgrade_2.8_to_2.8.1.php
1
<?php
2
/******************************************************************************
3
 *
4
 *   COMPANY: BuyScripts.in
5
 *   PROJECT: vShare Youtube Clone
6
 *   VERSION: [VSHARE_VERSION]
7
 *   LISENSE: http://buyscripts.in/vshare-license.html
8
 *   WEBSITE: http://buyscripts.in/youtube_clone.html
9
 *
10
 *   This program is a commercial software and any kind of using it must agree 
11
 *   to vShare license.
12
 *
13
 ******************************************************************************/
14

  
15
$html_title = 'VSHARE UPGRADE';
16
require '../include/config.php'; 
17
require '../include/functions_seo_name.php';
18
require '../include/class.tags.php';
19
require './inc/class.sql_import.php';
20
require './inc/functions_upgrade.php';
21
require './tpl/header.php';
22

  
23
if ($config['version'] != '2.8')
24
{
25
    die('<p>This upgrade script can only upgrade if you are using version: 2.7</p>');
26
}
27

  
28
write_log('#### UPGRADE 2.8 to 2.8.1 STARTED ####', 'vshare_upgrade', 0,'txt');
29

  
30
$sql_file = VSHARE_DIR . '/install/sql/upgrade_2.8_to_2.8.1.sql';
31
$sql_import = new Sql2Db($sql_file);
32
$sql_import->import();
33

  
34
$sql = "UPDATE `sconfig` SET `svalue`='2.8.1' WHERE
35
       `soption`='version'";
36
$result = mysql_query($sql) or mysql_die($sql);       
37

  
38
write_log('#### UPGRADE 2.8 to 2.8.1 FINISHED ####', 'vshare_upgrade', 0,'txt');
39

  
40
redirect(VSHARE_URL . '/install/upgrade_finished.php');
41

  
42

  
install/upgrade_start.php
3 3
 *
4 4
 *   COMPANY: BuyScripts.in
5 5
 *   PROJECT: vShare Youtube Clone
6
 *   VERSION: 2.7
6
 *   VERSION: [VSHARE_VERSION]
7 7
 *   LISENSE: http://buyscripts.in/vshare-license.html
8 8
 *   WEBSITE: http://buyscripts.in/youtube_clone.html
9 9
 *
......
21 21
    '2.4',
22 22
    '2.5',
23 23
    '2.6',
24
    '2.7'
24
    '2.7',
25
    '2.8'
25 26
);
26 27

  
27 28
if (! in_array($config['version'], $vshare_versions))
......
61 62
        $redirect_url = VSHARE_URL . '/install/upgrade_2.6_to_2.7.php';
62 63
        break;
63 64
    case '2.7':
65
        $redirect_url = VSHARE_URL . '/install/upgrade_2.7_to_2.8.1.php';
66
        break;
67
    case '2.8':
68
        $redirect_url = VSHARE_URL . '/install/upgrade_2.8_to_2.8.1.php';
69
        break;        
70
    case '2.8.1':
64 71
        $redirect_url = VSHARE_URL . '/install/upgrade_finished.php';
65 72
        break;
66 73
    default:
67
-