function encrypt($string, $salt = "sdfgdfg")
{
$strlen = strlen($string);
$gamma = '';
while (strlen($gamma) < $strlen)
{
$seq = pack("H*",sha1($gamma.$salt));
$gamma .= substr($seq,0,8);
}
return base64_encode($string^$gamma);
}
function decrypt($string, $salt = "sdfgdfg")
{
$string = base64_decode($string); // ибо так кодировали
$strlen = strlen($string);
$gamma = '';
while (strlen($gamma) < $strlen)
{
$seq = pack("H*",sha1($gamma.$salt));
$gamma .= substr($seq,0,8);
}
return $string^$gamma;
}
foreach($avatarid as $val){
echo '<td><center><img src="<?php echo $val;?>" width="50px" height="50px"/></center></td>'
}
<?php
$language = explode("/", $_SERVER['REQUEST_URI']);
$language = $language[1];
if($language == "ru") {
$_SESSION['lang'] = "2";
$_SESSION['lang_file'] = "lang_russian";
} else {
$_SESSION['lang'] = "2";
$_SESSION['lang_file'] = "lang_ukrainian";
}
require_once(SYSTEM_DIR . "languages/".$_SESSION['lang_file']."/lang_main.php");
?>
RewriteBase /
RewriteRule ^$ /index.php?mode=index
RewriteRule ^index.php$ /index.php?mode=index
function select_video($id, $lang){
db_connect();
$query = "SELECT `video`.*, (SELECT count(c.`id`) FROM `comments` c WHERE c.`note_id` = `video`.`title_url` AND c.`lang` = '{$lang}') comments_count
FROM `video`
WHERE `video` .`id` > (SELECT v.`id` FROM `video` v WHERE v.`id` < {$id} ORDER BY v.`id` DESC LIMIT 1) AND `video`.`lang` = '{$lang}'
ORDER BY `video` .`id` ASC
LIMIT 3";
$res = mysql_query($query);
for($i=0; $row = mysql_fetch_array($res); $i++){
$result[$i] = $row;
}
return $result;
}
$ratio = $width / $height;
if($width > $height) {
$width = 280;
$height = round( $width / $ratio );
}else{
$height = 260;
$width = round( $height * $ratio );
}