Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - alekinna

Pages: 1 2 [3] 4
31
Discussion & Troubleshooting / Uploading 2 files with the same name
« on: December 08, 2008, 05:11:20 AM »
In my general settings I set Upload mode=Save files with new name
and it's work fine if I upload 2 files with the same name and the same extension.
But I want it will work also if the extension is different.
How can I do this?

32
SnaFy
maybe this mod will help you

33
Mods & Plugins (Releases & Support) / Re: [MOD] Download limit v1.0
« on: November 20, 2008, 06:53:01 AM »
it work with 1.7.6?? :?:

Work fine!

34
Quote
Is it posible that the names  with the link to the userdetails, of the users who have the picture in they Lightbox are printed in details.htm ?

in the file details.php find
Code: [Select]
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(

replace with
Code: [Select]
$sql = "SELECT l.lightbox_image_ids, u.user_id, l.user_id".get_user_table_field(", u.", "user_name")."
FROM (".LIGHTBOXES_TABLE." l, ".USERS_TABLE." u)
WHERE l.lightbox_image_ids LIKE '%$image_id%' AND u.user_id=l.user_id";

$result = $site_db->query($sql);
  $lightbox_row = array();
  while ($row = $site_db->fetch_array($result)) {
    $lightbox_row[] = $row;
  }
  $site_db->free_result($result);
  $num_rows = sizeof($lightbox_row);
if ($num_rows) {
    for ($i = 0; $i < $num_rows; $i++) {
$lightbox_list .= "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$lightbox_row[$i]['user_id'])."\">".$lightbox_row[$i]['user_name']."</a>";
if ($i+1 != $num_rows) {
$lightbox_list .= ", ";
}
}
}

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
"lightbox_list" => $lightbox_list,

in your details.html file use {lightbox_list} to insert the list of names.

35
Sorry, I don't understand which images you want upload. For mini-thumbs the  MOD take some images before and after the big image that you see in the details. You can use it instead "next", "previous".

36
try this

1. in the file detals.php before
Code: [Select]
//-----------------------------------------------------
//--- Save Comment ------------------------------------
//-----------------------------------------------------

add this code
Code: [Select]
//-----------------------------------------------------------------
//--------------- Start MOD: Photo Preview Hack -------------------
//-------------------------------------------------------------------
$cells = 4;                   //number of cells in table
$num_thumbs = 12;    // number of thumbnails to view
$sizeTimes = 0.5;        // size of thumbnails (0.5 = half of regular thumbnail size)
//------------------------------------------END SETTINGS ---------------------------------------------------

$result = $site_db->query($sql);

while($row = $site_db->fetch_array($result)){
    $image_preview[] = $row['image_id'];
    $preview_row[$row['image_id']] = $row;
}
$lastPage = count($image_preview);
$count = 0;
$t_template = "<table width=\"1%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">\n";
if($lastPage < ($num_thumbs + 1)){
    $start = 0;
    $end = $lastPage -1;
} elseif ($act_key == 0 || $act_key == 1){
    $start = 0;
    $end   = ($num_thumbs - 1);
} elseif ($act_key == $lastPage-1 || $act_key == $lastPage -2){
    $start = $lastPage - $num_thumbs;
    $end = $lastPage - 1;
} else {
    $start = $act_key - (floor(($num_thumbs - 1) / 2));
    $end   = $act_key + (ceil(($num_thumbs - 1) / 2));
}

for($i=$start; $i<=$end; $i++){
if ($count == 0) {
$t_template .= "<tr>\n";
}
    if ($preview_row[$image_preview[$i]]['image_id'] == $image_row['image_id']) {
    $t_template .= "<td align=\"center\" style=\"border: 1px solid #004C75; background: #F1F1F1; padding: .1cm\">\n";
    } else {
    $t_template .= "<td align=\"center\" style=\"padding: .1cm\">\n";
    }
    $tag = get_thumbnail_code($preview_row[$image_preview[$i]]['image_media_file'], $preview_row[$image_preview[$i]]['image_thumb_file'], $preview_row[$image_preview[$i]]['image_id'], $preview_row[$image_preview[$i]]['cat_id'], format_text(trim($preview_row[$image_preview[$i]]['image_name']), 2), $mode, 1);
    $oriWidth = substr($tag, strpos($tag, "width")+7, strpos($tag, "\" height")-strlen($tag));
    $oriHeight = substr($tag, strpos($tag, "height")+8, strpos($tag, " alt")-strlen($tag)-1);
    $tag = str_replace('width="'.$oriWidth.'"', 'width="'.$oriWidth*$sizeTimes.'"', $tag);
    $tag = str_replace('height="'.$oriHeight.'"', 'height="'.$oriHeight*$sizeTimes.'"', $tag);
    $t_template .= $tag."<td>\n";
$count++;
if ($count == $cells) {
$t_template .= "</tr>\n";
$count = 0;
}
}

if ($count > 0)  {
    $leftover = ($cells - $count);
    if ($leftover >= 1) {
      for ($f = 0; $f < $leftover; $f++) {
        $t_template .= "<td>\n&nbsp;\n</td>\n";
      }
      $t_template .= "</tr>\n</table>";
    }
}
else {
$t_template .= "</table>\n";
}
$site_template->register_vars("preview_box", $t_template);
unset($image_preview);
//-------------------------------- END  MOD: Photo Preview Hack --------------------------------------

see settings and change it if need

2. in the file details.html use {preview_box} to insert mini-thumbs

Almost all code was taken from this MOD, I just did little modification

37
I very liked this mod and want to use it in my gallery. So I added support for comments (stored in files, it's was important for me) and very simply admin panel and I would like to share it with you.
Just some notes before:
1. I don't have php knowledge, so will be good if someone can check the code.
2. I could make spelling mistakes in English.  :oops: (Sorry)
3. The templates are based on default style.
3. Make backup before modifications.

------------------- INSTALLATION -----------------------
1. Download the attachment from this message.
  • upload the file articles.php to root directory of gallery
  • the file add_edit_articles.php to folder admin/plugins
  • the html files to your template directory

2. In the file global.php find:
Code: [Select]
  elseif (preg_match("/categories.php/", $self_url) && !preg_match("/[?|&]".URL_CAT_ID."=[^?|&]*/", $self_url)) {
    $self_url .= "?".URL_CAT_ID."=".$cat_id;
  }

add below this code:
Code: [Select]
  elseif (preg_match("/articles.php/", $self_url) && !preg_match("/[?|&]".URL_ID."=[^?|&]*/", $self_url) && $id) {
    $self_url .= "?".URL_ID."=".$id;
  }

3. In the file includes/page_header.php find:
Code: [Select]
"url_top_images" => $site_sess->url(ROOT_PATH."top.php"),
add below this:
Code: [Select]
  "url_articles" => $site_sess->url(ROOT_PATH."articles.php"),
  "lang_articles" => $lang['articles'],

4. In the file your language/main.php just before ?> add:
Code: [Select]
// --------------- MOD for articles publishing --------------
$lang['articles'] = "Articles";
$lang['edit_article'] = "Edit article";
$lang['total_comments'] = "Total comments: ";

5. In the file home.html use this link to your articles
Code: [Select]
<a href="{url_articles}">{lang_articles}</a>
---------------- END INSTALLATION ------------------

Now you can go in your gallery to articles page and click Edit article
or in admin panel you can find in the left link add_edit_articles in PlugIns menu.

Some important things:
1. You must put article's title between <!-->. For example: <span class="title"><!-->Article title<!--></span>
2. Don't write <span class="title"><!-->{lang_articles}<!--></span> in the articles.html file,
   put it in the file articles/index.html
3. You can find more notes in control panel of mod.

 If your liked this, ENJOY!

38
Mods & Plugins (Releases & Support) / Re: [MOD] Last comments v1
« on: October 28, 2008, 02:36:56 AM »
External
in index.php find
Code: [Select]
"comment_date" => format_date($config['date_format']." ".$config['time_format'], $row['comment_date']),
and add after
Code: [Select]
"lang_author" => $lang['author'],

39
OK,solved!
I did it by myself

40
Hello,
I saw some mods for different tops, but not exactly what I need.
I want to put all most rated images from each category in one category/page.
How can I do that?

41
Hi all,
One more great and usefull mod. Work perfect!!

I had only one problem:
If images_validate=true, images was resaized but no 'big' folder was created and original file not saved.

So I did some manipulations:
in file member.php find
Code: [Select]
//-----------------------------------------------------------
//----------------------- Auto Image Resizing --------------
//----------------------------------------------------------
if ($config['auto_image'] && !$uploaderror) {
$src_copy = MEDIA_PATH."/".$cat_id."/big";
if ($direct_upload) {
$src = MEDIA_PATH."/".$cat_id."/".$new_name;
$src_copy = MEDIA_PATH."/".$cat_id."/big";
}
else {
$src = MEDIA_TEMP_PATH."/".$new_name;
}

replace with:
Code: [Select]
//-----------------------------------------------------------
//----------------------- Auto Image Resizing --------------
//----------------------------------------------------------
if ($config['auto_image'] && !$uploaderror) {
$src_copy = MEDIA_PATH."/".$cat_id."/big";
if ($direct_upload) {
$src = MEDIA_PATH."/".$cat_id."/".$new_name;
$src_copy = MEDIA_PATH."/".$cat_id."/big";
}
else {
$src = MEDIA_TEMP_PATH."/".$new_name;
$src_copy = MEDIA_TEMP_PATH."/big";
}

in file admin/admin_functions.php find:
Code: [Select]
function copy_thumbnail($image_media_file, $image_thumb_file, $from_cat = 0, $to_cat = 0) {
Insert above:
Code: [Select]
function copy_big($image_media_file, $image_big_file, $from_cat = 0, $to_cat = 0) {
if (is_remote($image_big_file)) {
return $image_big_file
}
$image_src_big = (($from_cat != -1) ? MEDIA_PATH.(($from_cat != 0) ? "/".$from_cat : "") : MEDIA_TEMP_PATH)."/big";
$image_dest_big = (($to_cat != -1) ? MEDIA_PATH.(($to_cat != 0) ? "/".$to_cat : "") : MEDIA_TEMP_PATH)."/big";
$image_src_file_big = $image_src_big."/".$image_media_file;
if ($image_big_file != "" && file_exists($image_src_big."/".$image_big_file)) {
if (!@is_dir($image_dest_big)) {
$oldumask = umask(0);
$result = @mkdir($image_dest_big);
umask($oldumask);
if (!@is_dir($image_dest_big) || !$result) {
@mkdir($image_dest_big, CHMOD_DIRS);
}
}
$big_extension = get_file_extension($image_big_file);
$new_big = get_file_name($image_media_file).".".$big_extension;
if (file_exists($image_dest_big."/".$new_big)) {
unlink($image_dest_big."/".$new_big);
}
$ok = copy($image_src_big."/".$image_big_file, $image_dest_big."/".$new_big);
if ($ok) {
@unlink($image_src_file_big);
@chmod($image_dest_big."/".$new_big, CHMOD_FILES);
$image_big_file = $new_big;
}
if (!file_exists($image_dest_big."/".$new_big)) {
if (!copy($image_src_file_big, $image_dest_big."/".$new_big)) {
$error_log[] = sprintf($lang['copy_file_error_perm'], $image_src_file_big, $image_dest_big."/".$new_big);
}
}
}
return $image_big_file;
}

In file admin/validateimages/php find:
Code: [Select]
$old_thumb_path = THUMB_TEMP_PATH."/".$image_thumb_file;
Insert below:
Code: [Select]
if (file_exists( MEDIA_TEMP_PATH."/big/".$image_media_file ) ) { //  Проверяем есть ли ориг. файл
$image_big_file = addslashes($image_cache[$key]['image_media_file']);
$old_big_path = MEDIA_TEMP_PATH."/big/".$image_big_file;
}

Find:
Code: [Select]
$new_thumb_name = copy_thumbnail($new_name, $image_thumb_file, "-1", $cat_id);
Insert below:
Code: [Select]
if ($old_big_path) {
$new_big_name = copy_big($new_name, $image_big_file, "-1", $cat_id);
}

Find:
Code: [Select]
@unlink($old_thumb_path);
Insert below:
Code: [Select]
if ($old_big_path) {
@unlink($old_big_path);
}


May be it's not right way to solve this problem, but it's work for me.

V@no, thank you for this mod!

42
Mods & Plugins (Releases & Support) / Re: [MOD] Last comments v1
« on: September 24, 2008, 08:07:04 PM »
Excellent! Thank you!

43
Mods & Plugins (Releases & Support) / Re: [MOD] Last comments v1
« on: September 24, 2008, 01:11:02 PM »
Hi, V@no!
Thank you for this great mod! It's work perfect, however as all your mods.
My question is about "image_cat_name"  :
how can I get parametre cat_parent_id from category table to display the parent category name?

44
I did little modification, based on this mod, that add keyword list to admin panel (textarea, not dropdown form).But first:
1. It will add keyword list only to form "check new images"
2. I'm not a programmer and perhaps it is no correct way to do this, but it work for me.

Open includes/functions.php, locate this code at the very bottom:
Code: [Select]
?>
Change it to the following:
Code: [Select]
// --------------- Add a list of keywords to the admin form "check new images" BEGIN -------------------------------
function get_keyword_list_admin() {
  global $lang, $site_sess, $site_db;
  $keyword_dropdown = "";
  $keyword_dropdown .= "<textarea name=\"search_keyword_list[]\" cols=\"30\" rows=\"8\" class=\"setperpageselect\">\n";
  $sql = "SELECT `image_keywords` FROM ".IMAGES_TABLE." WHERE 1 order by `image_keywords` DESC";
  $result = $site_db->query($sql);
  $array = array();
  while(list($Name) = mysql_fetch_row($result)) {
// Commented out until enforcement of user/category/image permissions is developed
//    if (!check_permission("auth_viewimage", $image_row['cat_id']) || !check_permission("auth_viewcat", $image_row['cat_id'])) {
    if(!empty($Name)) {
      $explode_array = explode(" ",$Name);
      for($ctr=0; $ctr < count($explode_array); $ctr++){
        $temp = $explode_array[$ctr];
        $array[] = $temp;
      }
    }
  }
  $site_db->free_result();
  $array1 = array_unique($array); // Remove duplicate values from the array
  if (!empty($array1)) {
    natcasesort($array1); // Sort the array by A-Z, case insensitive
    foreach($array1 as $val) {
       $keyword_dropdown .= $val."\n";
    }
  }
  $keyword_dropdown .= "</textarea>\n";
  return $keyword_dropdown;
}
//----------------------------- Add a list of keywords to the admin form "check new images" END ---------------------------

?>

Open admin/checkimages.php, locate this code:
Code: [Select]
$title = $lang['field_keywords_ext'].((isset($file_src)) ? get_iptc_insert_link($file_src, "keyword", "image_keywords_".$ii) : "");
Change it to the following:
Code: [Select]
$title = $lang['field_keywords_ext'].((isset($file_src)) ? get_iptc_insert_link($file_src, "keyword", "image_keywords_".$ii) : "")."<br />".get_keyword_list_admin();

45
Discussion & Troubleshooting / Re: Comments count refresh
« on: August 31, 2008, 09:09:01 PM »
I think it's little bug in code, if you delete comments one by one - everything is OK. But if you deleted user with his post and images - DB don't change count of comments. I solved problem in this way (only for fresh gallery, if you still havn't this problem)
In admin/users.php find:
Code: [Select]
if ($delcomments) {
      $sql = "DELETE FROM ".COMMENTS_TABLE."
              WHERE user_id = $user_id";
      if ($site_db->query($sql)) {
        echo "&nbsp;&nbsp;".$lang['comments_delete_success']."<br />\n";
      }
      else {
        $error_log[] = $lang['comments_delete_error'].": ".format_text($user_name, 2);
      }
    }
and replace by this code:
Code: [Select]
if ($delcomments) {
      $sql = "SELECT comment_id, image_id, user_id, user_name, comment_headline
          FROM ".COMMENTS_TABLE."
          WHERE user_id = $user_id";
                    $comment_result = $site_db->query($sql);
            while ($comment_row = $site_db->fetch_array($comment_result)) {
                    $sql = "DELETE FROM ".COMMENTS_TABLE."
          WHERE user_id = $user_id";
                if ($site_db->query($sql)) {
                        update_comment_count($comment_row['image_id'], $comment_row['user_id']);
                        echo "&nbsp;&nbsp;".$lang['comments_delete_success']."<br />\n";
                }
                else {
                    $error_log[] = $lang['comments_delete_error'].": ".format_text($user_name, 2);
                }
            }
        }

How to repair DB, if you already have the "deleted" comments I don't know. I have only idea, may be some one can help us.

Pages: 1 2 [3] 4