Türkçe:1- lang/your_language/main.php dosyasını açın,
Aşağıdakini bulun (en altta)
PHP
?>
ve bununla değiştirin;
PHP
$lang['google_video'] = "Google ID";
$lang['youtube_video'] = "YouTube ID";
?>
2- admin/gal_images.php dosyasını açın,
a) Aşağıdakini bulun;
PHP
show_radio_row($lang['field_allow_comments'], "image_allow_comments_".$i, 1);
ve altına bunu ekleyin:
PHP
show_input_row($lang['youtube_video'], "youtube_id_".$i, "", $textinput_size);
show_input_row($lang['google_video'], "google_id_".$i, "", $textinput_size);
b) Aşağıdakini bulun;
PHP
$user_id = (intval($HTTP_POST_VARS['user_id_'.$i]) != 0) ? intval($HTTP_POST_VARS['user_id_'.$i]) : $user_info['user_id'];
$remote_file = trim($HTTP_POST_VARS['remote_file_'.$i]);
ve altına bunu ekleyin
PHP
$google_id = trim($HTTP_POST_VARS['google_id_'.$i]);
$youtube_id = trim($HTTP_POST_VARS['youtube_id_'.$i]);
c) Aşağıdakini bulun;
PHP
if (((empty($HTTP_POST_FILES['file_'.$i]['tmp_name']) || $HTTP_POST_FILES['file_'.$i]['tmp_name'] == "none") && $remote_file == "") || ($remote_file != "" && !check_remote_media($remote_file) && !check_local_media($remote_file))) {
$error['file_'.$i] = 1;
}
if ($remote_file != "" && !url_exists($remote_file)) {
$error['remote_file'] = 1;
}
ve bununla değiştirin;
PHP
if ($google_id == "" && $youtube_id == "") {
if (((empty($HTTP_POST_FILES['file_'.$i]['tmp_name']) || $HTTP_POST_FILES['file_'.$i]['tmp_name'] == "none") && $remote_file == "") || ($remote_file != "" && !check_remote_media($remote_file) && !check_local_media($remote_file))) {
$error['file_'.$i] = 1;
}
if ($remote_file != "" && !url_exists($remote_file)) {
$error['remote_file'] = 1;
}
}
d) Aşağıdakini bulun;
PHP
$sql = "INSERT INTO ".GAL_IMAGES_TABLE."
(cat_id, user_id, image_name, image_description, image_date, image_active, image_media_file, image_allow_comments, youtube_id, google_id".$additional_field_sql.")
VALUES
($cat_id, $user_id, '$image_name', '$image_description', $current_time, $image_active, '$new_name', $image_allow_comments, '$youtube_id', '$google_id'".$additional_value_sql.")";
ve bununla değiştirin;
PHP
$sql = "INSERT INTO ".GAL_IMAGES_TABLE."
(cat_id, user_id, image_name, image_description, image_date, image_active, image_media_file, image_allow_comments, youtube_id, google_id".$additional_field_sql.")
VALUES
($cat_id, $user_id, '$image_name', '$image_description', $current_time, $image_active, '$new_name', $image_allow_comments, '$youtube_id', '$google_id'".$additional_value_sql.")";
e) Aşağıdakini bulun;
PHP
if (!file_exists(GAL_MEDIA_PATH."/".$image_row['image_media_file']) && (!is_remote_file($image_row['image_media_file'])))
{
$file_src = $lang['no_image_found2'];
}
else {
if (is_remote_file($image_row['image_media_file'])) {
$file_src = image_thumb(GAL_MEDIA_PATH, $image_row['image_media_file'], $lang['show_full_image'].": ".$image_row['image_name'], 4, $image_row['image_media_file'], 150, 150, $image_row['image_media_file']);
}
else{
$file_src = image_thumb(GAL_MEDIA_PATH, $image_row['image_media_file'], $lang['show_full_image'].": ".$image_row['image_name'], 2, GAL_MEDIA_PATH."/".$image_row['image_media_file'], 150, 150);
}
}
ve bununla değiştirin;
PHP
if (empty($image_row['image_media_file'])){
$file_src = image_thumb(TEMPLATE_IMAGE_PATH, "video.png", "Video", 2, TEMPLATE_IMAGE_PATH."/video.png", $config['max_thumb_width'], $config['max_thumb_height']);
}else {
if (!file_exists(GAL_MEDIA_PATH."/".$image_row['image_media_file']) && (!is_remote_file($image_row['image_media_file'])))
{
$file_src = $lang['no_image_found2'];
}
else {
if (is_remote_file($image_row['image_media_file'])) {
$file_src = image_thumb(GAL_MEDIA_PATH, $image_row['image_media_file'], $lang['show_full_image'].": ".$image_row['image_name'], 4, $image_row['image_media_file'], 150, 150, $image_row['image_media_file']);
}
else{
$file_src = image_thumb(GAL_MEDIA_PATH, $image_row['image_media_file'], $lang['show_full_image'].": ".$image_row['image_name'], 2, GAL_MEDIA_PATH."/".$image_row['image_media_file'], 150, 150);
}
}
}
f) Aşağıdakini bulun;
PHP
show_input_row($lang['field_hits'], "image_hits", $image_row['image_hits'], 10);
ve altına bunu ekleyin
PHP
show_input_row($lang['youtube_video'], "youtube_id", $image_row['youtube_id'], $textinput_size);
show_input_row($lang['google_video'], "google_id", $image_row['google_id'], $textinput_size);
g) Aşağıdakini bulun;
PHP
$old_thumb_file_name = trim($HTTP_POST_VARS['old_thumb_file_name']);
ve altına bunu ekleyin;
PHP
$google_id = trim($HTTP_POST_VARS['google_id']);
$youtube_id = trim($HTTP_POST_VARS['youtube_id']);
h) Aşağıdakini bulun;
PHP
$sql = "UPDATE ".GAL_IMAGES_TABLE."
SET cat_id = $cat_id, user_id = $user_id, image_name = '$image_name', image_description = '$image_description', image_date = $image_date, image_active = $image_active, image_media_file = '$new_name', image_allow_comments = $image_allow_comments, image_votes = $image_votes, image_rating = '$image_rating', image_hits = $image_hits".$additional_sql."
WHERE image_id = $image_id";
$result = $site_db->query($sql);
ve bununla değiştirin;
PHP
$sql = "UPDATE ".GAL_IMAGES_TABLE."
SET cat_id = $cat_id, user_id = $user_id, image_name = '$image_name', image_description = '$image_description', image_date = $image_date, image_active = $image_active, image_media_file = '$new_name', image_allow_comments = $image_allow_comments, image_votes = $image_votes, image_rating = '$image_rating', image_hits = $image_hits, google_id='$google_id', youtube_id='$youtube_id'".$additional_sql."
WHERE image_id = $image_id";
3- includes/functions.php dosyasını açın:
a) Aşağıdakini bulun
PHP
if (is_remote_file($image_row['image_media_file'])) {
$image_src = image_thumb(GAL_MEDIA_PATH, $image_row['image_media_file'], $alt, $cur, $cat_url, $config['max_image_width'], $config['max_image_height'], $image_row['image_media_file']);
$thumb_src = image_thumb(GAL_MEDIA_PATH, $image_row['image_media_file'], $alt, $cur, $cat_url, $config['max_thumb_width'], $config['max_thumb_height'], $image_row['image_media_file']);
}
else{
$image_src = image_thumb(GAL_MEDIA_PATH, $image_row['image_media_file'], $alt, $cur, $cat_url, $config['max_image_width'], $config['max_image_height']);
$thumb_src = image_thumb(GAL_MEDIA_PATH, $image_row['image_media_file'], $alt, $cur, $cat_url, $config['max_thumb_width'], $config['max_thumb_height']);
}
ve bununla değiştirin;
PHP
if (empty($image_row['image_media_file'])){
$thumb_src = image_thumb(TEMPLATE_IMAGE_PATH, "video.png", $alt, $cur, $cat_url, $config['max_thumb_width'], $config['max_thumb_height']);
}else {
if (is_remote_file($image_row['image_media_file'])) {
$image_src = image_thumb(GAL_MEDIA_PATH, $image_row['image_media_file'], $alt, $cur, $cat_url, $config['max_image_width'], $config['max_image_height'], $image_row['image_media_file']);
$thumb_src = image_thumb(GAL_MEDIA_PATH, $image_row['image_media_file'], $alt, $cur, $cat_url, $config['max_thumb_width'], $config['max_thumb_height'], $image_row['image_media_file']);
}
else{
$image_src = image_thumb(GAL_MEDIA_PATH, $image_row['image_media_file'], $alt, $cur, $cat_url, $config['max_image_width'], $config['max_image_height']);
$thumb_src = image_thumb(GAL_MEDIA_PATH, $image_row['image_media_file'], $alt, $cur, $cat_url, $config['max_thumb_width'], $config['max_thumb_height']);
}
}
b) Aşağıdakini bulun
PHP
"thumbnail_file_name" => $image_row['image_thumb_file']
ve bununla değiştirin;
"thumbnail_file_name" => $image_row['image_thumb_file'],
"youtube_id" => !empty($image_row['youtube_id']) ? $image_row['youtube_id'] : "",
"google_id" => !empty($image_row['google_id']) ? $image_row['google_id'] : "",
4- gallery_image.php dosyasını açın;
Aşağıdakini bulun;
PHP
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_date, i.image_active, i.image_media_file, i.image_allow_comments, i.image_comments, i.image_votes, i.image_rating, i.image_hits, c.cat_name".get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email")."
FROM (".GAL_IMAGES_TABLE." i, ".GAL_CATEGORIES_TABLE." c)
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
WHERE i.image_id = $image_id AND i.image_active = 1 AND c.cat_id = i.cat_id";
ve bununla değiştirin;
PHP
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_date, i.image_active, i.image_media_file, i.image_allow_comments, i.image_comments, i.image_votes, i.image_rating, i.image_hits, c.cat_name, i.youtube_id,i.google_id".get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email")."
FROM (".GAL_IMAGES_TABLE." i, ".GAL_CATEGORIES_TABLE." c)
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
WHERE i.image_id = $image_id AND i.image_active = 1 AND c.cat_id = i.cat_id";
5- templates/your_template/gallery_image.html dosyasını açın;
Aşağıdakini bulun;
CODE
{image}
ve altına bunu ekleyin;
PHP
{if youtube_id}
<object width="476" height="392"><param name="movie" value="http://www.youtube.com/v/{youtube_id}"></param><embed src="http://www.youtube.com/v/{youtube_id}" type="application/x-shockwave-flash" width="476" height="392"></embed></object>
{endif youtube_id}
{if google_id}
<br>
<embed style="width:400px; height:326px;" id="VideoPlayback" align="middle" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId={google_id}" allowScriptAccess="sameDomain" quality="best" bgcolor="#ffffff" scale="noScale" salign="TL" FlashVars="playerMode=embedded"> </embed>
{endif google_id}
English:1- Open lang/your_language/main.php
and find
PHP
?>
and replace;
PHP
$lang['google_video'] = "Google ID";
$lang['youtube_video'] = "YouTube ID";
?>
2- Open admin/gal_images.php
a) Find;
PHP
show_radio_row($lang['field_allow_comments'], "image_allow_comments_".$i, 1);
Add the following line below
PHP
show_input_row($lang['youtube_video'], "youtube_id_".$i, "", $textinput_size);
show_input_row($lang['google_video'], "google_id_".$i, "", $textinput_size);
b) Find;
PHP
$user_id = (intval($HTTP_POST_VARS['user_id_'.$i]) != 0) ? intval($HTTP_POST_VARS['user_id_'.$i]) : $user_info['user_id'];
$remote_file = trim($HTTP_POST_VARS['remote_file_'.$i]);
Add the following line below
PHP
$google_id = trim($HTTP_POST_VARS['google_id_'.$i]);
$youtube_id = trim($HTTP_POST_VARS['youtube_id_'.$i]);
c) Find;
PHP
if (((empty($HTTP_POST_FILES['file_'.$i]['tmp_name']) || $HTTP_POST_FILES['file_'.$i]['tmp_name'] == "none") && $remote_file == "") || ($remote_file != "" && !check_remote_media($remote_file) && !check_local_media($remote_file))) {
$error['file_'.$i] = 1;
}
if ($remote_file != "" && !url_exists($remote_file)) {
$error['remote_file'] = 1;
}
and replace;
PHP
if ($google_id == "" && $youtube_id == "") {
if (((empty($HTTP_POST_FILES['file_'.$i]['tmp_name']) || $HTTP_POST_FILES['file_'.$i]['tmp_name'] == "none") && $remote_file == "") || ($remote_file != "" && !check_remote_media($remote_file) && !check_local_media($remote_file))) {
$error['file_'.$i] = 1;
}
if ($remote_file != "" && !url_exists($remote_file)) {
$error['remote_file'] = 1;
}
}
d) Find;
PHP
$sql = "INSERT INTO ".GAL_IMAGES_TABLE."
(cat_id, user_id, image_name, image_description, image_date, image_active, image_media_file, image_allow_comments, youtube_id, google_id".$additional_field_sql.")
VALUES
($cat_id, $user_id, '$image_name', '$image_description', $current_time, $image_active, '$new_name', $image_allow_comments, '$youtube_id', '$google_id'".$additional_value_sql.")";
and replace;
PHP
$sql = "INSERT INTO ".GAL_IMAGES_TABLE."
(cat_id, user_id, image_name, image_description, image_date, image_active, image_media_file, image_allow_comments, youtube_id, google_id".$additional_field_sql.")
VALUES
($cat_id, $user_id, '$image_name', '$image_description', $current_time, $image_active, '$new_name', $image_allow_comments, '$youtube_id', '$google_id'".$additional_value_sql.")";
e) Find;
PHP
if (!file_exists(GAL_MEDIA_PATH."/".$image_row['image_media_file']) && (!is_remote_file($image_row['image_media_file'])))
{
$file_src = $lang['no_image_found2'];
}
else {
if (is_remote_file($image_row['image_media_file'])) {
$file_src = image_thumb(GAL_MEDIA_PATH, $image_row['image_media_file'], $lang['show_full_image'].": ".$image_row['image_name'], 4, $image_row['image_media_file'], 150, 150, $image_row['image_media_file']);
}
else{
$file_src = image_thumb(GAL_MEDIA_PATH, $image_row['image_media_file'], $lang['show_full_image'].": ".$image_row['image_name'], 2, GAL_MEDIA_PATH."/".$image_row['image_media_file'], 150, 150);
}
}
and replace;
PHP
if (empty($image_row['image_media_file'])){
$file_src = image_thumb(TEMPLATE_IMAGE_PATH, "video.png", "Video", 2, TEMPLATE_IMAGE_PATH."/video.png", $config['max_thumb_width'], $config['max_thumb_height']);
}else {
if (!file_exists(GAL_MEDIA_PATH."/".$image_row['image_media_file']) && (!is_remote_file($image_row['image_media_file'])))
{
$file_src = $lang['no_image_found2'];
}
else {
if (is_remote_file($image_row['image_media_file'])) {
$file_src = image_thumb(GAL_MEDIA_PATH, $image_row['image_media_file'], $lang['show_full_image'].": ".$image_row['image_name'], 4, $image_row['image_media_file'], 150, 150, $image_row['image_media_file']);
}
else{
$file_src = image_thumb(GAL_MEDIA_PATH, $image_row['image_media_file'], $lang['show_full_image'].": ".$image_row['image_name'], 2, GAL_MEDIA_PATH."/".$image_row['image_media_file'], 150, 150);
}
}
}
f) Find;
PHP
show_input_row($lang['field_hits'], "image_hits", $image_row['image_hits'], 10);
Add the following line below;
show_input_row($lang['youtube_video'], "youtube_id", $image_row['youtube_id'], $textinput_size);
show_input_row($lang['google_video'], "google_id", $image_row['google_id'], $textinput_size);
g) Find;
PHP
$old_thumb_file_name = trim($HTTP_POST_VARS['old_thumb_file_name']);
Add the following line below;
PHP
$google_id = trim($HTTP_POST_VARS['google_id']);
$youtube_id = trim($HTTP_POST_VARS['youtube_id']);
h) Find;
PHP
$sql = "UPDATE ".GAL_IMAGES_TABLE."
SET cat_id = $cat_id, user_id = $user_id, image_name = '$image_name', image_description = '$image_description', image_date = $image_date, image_active = $image_active, image_media_file = '$new_name', image_allow_comments = $image_allow_comments, image_votes = $image_votes, image_rating = '$image_rating', image_hits = $image_hits".$additional_sql."
WHERE image_id = $image_id";
$result = $site_db->query($sql);
and replace;
PHP
$sql = "UPDATE ".GAL_IMAGES_TABLE."
SET cat_id = $cat_id, user_id = $user_id, image_name = '$image_name', image_description = '$image_description', image_date = $image_date, image_active = $image_active, image_media_file = '$new_name', image_allow_comments = $image_allow_comments, image_votes = $image_votes, image_rating = '$image_rating', image_hits = $image_hits, google_id='$google_id', youtube_id='$youtube_id'".$additional_sql."
WHERE image_id = $image_id";
3- Open includes/functions.php
a) Find
PHP
if (is_remote_file($image_row['image_media_file'])) {
$image_src = image_thumb(GAL_MEDIA_PATH, $image_row['image_media_file'], $alt, $cur, $cat_url, $config['max_image_width'], $config['max_image_height'], $image_row['image_media_file']);
$thumb_src = image_thumb(GAL_MEDIA_PATH, $image_row['image_media_file'], $alt, $cur, $cat_url, $config['max_thumb_width'], $config['max_thumb_height'], $image_row['image_media_file']);
}
else{
$image_src = image_thumb(GAL_MEDIA_PATH, $image_row['image_media_file'], $alt, $cur, $cat_url, $config['max_image_width'], $config['max_image_height']);
$thumb_src = image_thumb(GAL_MEDIA_PATH, $image_row['image_media_file'], $alt, $cur, $cat_url, $config['max_thumb_width'], $config['max_thumb_height']);
}
and replace;
PHP
if (empty($image_row['image_media_file'])){
$thumb_src = image_thumb(TEMPLATE_IMAGE_PATH, "video.png", $alt, $cur, $cat_url, $config['max_thumb_width'], $config['max_thumb_height']);
}else {
if (is_remote_file($image_row['image_media_file'])) {
$image_src = image_thumb(GAL_MEDIA_PATH, $image_row['image_media_file'], $alt, $cur, $cat_url, $config['max_image_width'], $config['max_image_height'], $image_row['image_media_file']);
$thumb_src = image_thumb(GAL_MEDIA_PATH, $image_row['image_media_file'], $alt, $cur, $cat_url, $config['max_thumb_width'], $config['max_thumb_height'], $image_row['image_media_file']);
}
else{
$image_src = image_thumb(GAL_MEDIA_PATH, $image_row['image_media_file'], $alt, $cur, $cat_url, $config['max_image_width'], $config['max_image_height']);
$thumb_src = image_thumb(GAL_MEDIA_PATH, $image_row['image_media_file'], $alt, $cur, $cat_url, $config['max_thumb_width'], $config['max_thumb_height']);
}
}
b) Find;
PHP
"thumbnail_file_name" => $image_row['image_thumb_file']
and replace;
PHP
"thumbnail_file_name" => $image_row['image_thumb_file'],
"youtube_id" => !empty($image_row['youtube_id']) ? $image_row['youtube_id'] : "",
"google_id" => !empty($image_row['google_id']) ? $image_row['google_id'] : "",
4- Open gallery_image.php
Find;
PHP
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_date, i.image_active, i.image_media_file, i.image_allow_comments, i.image_comments, i.image_votes, i.image_rating, i.image_hits, c.cat_name".get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email")."
FROM (".GAL_IMAGES_TABLE." i, ".GAL_CATEGORIES_TABLE." c)
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
WHERE i.image_id = $image_id AND i.image_active = 1 AND c.cat_id = i.cat_id";
and replace;
PHP
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_date, i.image_active, i.image_media_file, i.image_allow_comments, i.image_comments, i.image_votes, i.image_rating, i.image_hits, c.cat_name, i.youtube_id,i.google_id".get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email")."
FROM (".GAL_IMAGES_TABLE." i, ".GAL_CATEGORIES_TABLE." c)
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
WHERE i.image_id = $image_id AND i.image_active = 1 AND c.cat_id = i.cat_id";
5- Open templates/your_template/gallery_image.html;
Find;
CODE
{image}
Add the following line below;
PHP
{if youtube_id}
<object width="476" height="392"><param name="movie" value="http://www.youtube.com/v/{youtube_id}"></param><embed src="http://www.youtube.com/v/{youtube_id}" type="application/x-shockwave-flash" width="476" height="392"></embed></object>
{endif youtube_id}
{if google_id}
<br>
<embed style="width:400px; height:326px;" id="VideoPlayback" align="middle" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId={google_id}" allowScriptAccess="sameDomain" quality="best" bgcolor="#ffffff" scale="noScale" salign="TL" FlashVars="playerMode=embedded"> </embed>
{endif google_id}
Image: video.png