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
2
Chit Chat / Re: "Lightbox" fr Mods im Forum?
« on: January 22, 2010, 08:50:16 PM »
I would like to have this feature on the forum also.
And if you can add "Label Message" in the Outbox (Personal Messages) it would be great!

 Is this possible?

3
This is kind of top-photos, but the principle of selection is slightly different from the standard. For me it was important to select from each category just one photo with the highest rating.

displayed on a separate page
design as a category page

1. the file includes/page_header.php

find
Code: [Select]
"url_captcha_image" => $site_sess->url(ROOT_PATH."captcha.php"),
insert below
Code: [Select]
  "url_top_rated" => $site_sess->url(ROOT_PATH."top_rated.php"),
  "lang_top_rated" => $lang['top_rated'],


2. the file lang/your_lang/main.php

before ?> add

Code: [Select]
$lang['top_rated'] = "Top Rated";
$lang['top_rated_desc'] = "Here is one photo from each category with the highest rank.";

 :) My English isn't good, so change a name and description, if necessary.


3. a new file top_rated.php

save it in the root of gallery

Code: [Select]
<?php
/* --------- Most rated imade from each category on one page with paging ----------------- */


$templates_used 'top_rated,thumbnail_bit';
$main_template 'top_rated';

define('GET_CACHES'1);
define('ROOT_PATH''./');
include(
ROOT_PATH.'global.php');
require(
ROOT_PATH.'includes/sessions.php');
$user_access get_permission();
include(
ROOT_PATH.'includes/page_header.php');

$cache_id create_cache_id(
  
'page.top_rated',
  array(
    
$user_info[$user_table_fields['user_id']],
    
$cat_id,
    
$page,
    
$perpage,
    isset(
$user_info['lightbox_image_ids']) ? substr(md5($user_info['lightbox_image_ids']), 08) : 0,
    
$config['template_dir'],
    
$config['language_dir']
  )
);

if (!
$cache_page_top_rated || !$content get_cache_file($cache_id)) {
// Always append session id if cache is enabled
if ($cache_page_top_rated) {
  
$old_session_mode $site_sess->mode;
  
$site_sess->mode 'get';
}

ob_start();

//-----------------------------------------------------
//--- Show Images -------------------------------------
//-----------------------------------------------------

  
$sql "SELECT cat_id
          FROM "
.IMAGES_TABLE."
          WHERE cat_id NOT IN ("
.get_auth_cat_sql("auth_viewcat""NOTIN").")
          GROUP BY cat_id"
;
  
$result $site_db->query($sql);
    
$num_rows_all mysql_num_rows($result);

$link_arg $site_sess->url(ROOT_PATH."top_rated.php");

include(
ROOT_PATH.'includes/paging.php');
$getpaging = new Paging($page$perpage$num_rows_all$link_arg);
$offset $getpaging->get_offset();

$site_template->register_vars(array(
  
"paging" => $getpaging->get_paging(),
  
"paging_stats" => $getpaging->get_paging_stats()
));

$imgtable_width ceil((intval($config['image_table_width'])) / $config['image_cells']);
if ((
substr($config['image_table_width'], -1)) == "%") {
  
$imgtable_width .= "%";
}

$additional_sql "";
if (!empty(
$additional_image_fields)) {
  foreach (
$additional_image_fields as $key => $val) {
    
$additional_sql .= ", a.".$key;
  }
}

$sql "SELECT a.image_id, a.cat_id, a.user_id, a.image_description, a.image_keywords, a.image_date, a.image_active, a.image_media_file, a.image_thumb_file, a.image_download_url, a.image_allow_comments, a.image_comments, a.image_downloads, a.image_votes, a.image_hits".$additional_sql.", a.image_name, c.cat_name
    FROM ("
.IMAGES_TABLE." a, ".CATEGORIES_TABLE." c)
                WHERE a.image_active = 1 AND a.cat_id NOT IN ("
.get_auth_cat_sql("auth_viewcat""NOTIN").") AND a.image_votes != 0 AND a.image_rating = (SELECT MAX(image_rating)
                FROM  "
.IMAGES_TABLE." b
                WHERE a.cat_id= b.cat_id)
                GROUP BY a.cat_id
                ORDER BY "
.$config['image_order']." ".$config['image_sort']."
                LIMIT 
$offset$perpage";

$result $site_db->query($sql);
$num_rows $site_db->get_numrows($result);

if (!
$num_rows)  {
  
$thumbnails "";
  
$msg $lang['no_images'];
}
else {
  
$thumbnails "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">\n";
  
$count 0;
  
$bgcounter 0;
  while (
$image_row $site_db->fetch_array($result)){
    if (
$count == 0) {
      
$row_bg_number = ($bgcounter++ % == 0) ? 2;
      
$thumbnails .= "<tr class=\"imagerow".$row_bg_number."\">\n";
    }
    
$thumbnails .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";

    
show_image($image_row);
    
$thumbnails .= $site_template->parse_template("thumbnail_bit");
    
$thumbnails .= "\n</td>\n";

    
$count++;
    if (
$count == $config['image_cells']) {
      
$thumbnails .= "</tr>\n";
      
$count 0;
    }
  } 
// end while

  
if ($count 0)  {
    
$leftover = ($config['image_cells'] - $count);
    if (
$leftover 0) {
      for (
$i 0$i $leftover$i++){
        
$thumbnails .= "<td width=\"".$imgtable_width."\">\n&nbsp;\n</td>\n";
      }
      
$thumbnails .= "</tr>\n";
    }
  }
  
$thumbnails .= "</table>\n";
//end else
$site_template->register_vars("thumbnails"$thumbnails);
unset(
$thumbnails);

//-----------------------------------------------------
//--- Clickstream ------------- -----------------------
//-----------------------------------------------------
$clickstream "<span class=\"clickstream\"><a title=\"".$lang['home']."\" href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'].$lang['top_rated']."</span>";

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------

$site_template->register_vars(array(
    
"top_rated_desc" => $lang['top_rated_desc'],
  
"msg" => $msg,
  
"clickstream" => $clickstream,
));

$site_template->print_template($site_template->parse_template($main_template));

$content ob_get_contents();
ob_end_clean();

if (
$cache_page_top_rated) {
  
// Reset session mode
  
$site_sess->mode $old_session_mode;

  
save_cache_file($cache_id$content);
}

// end if get_cache_file()

echo $content;

include(
ROOT_PATH.'includes/page_footer.php');
?>


4. a new file top_rated.html

4.1 to save design of gallery, open your file categories.html  and save it as top_rated.html

4.2 find 3 times
Code: [Select]
random_cat_image
replace with
Code: [Select]
random_image
4.3 find
Code: [Select]
{cat_name}
replace with
Code: [Select]
{lang_top_rated}
4.4 find and delete
Code: [Select]
{upload_button}
4.5 find
Code: [Select]
{cat_description} (Hits: {cat_hits})
replace with
Code: [Select]
{top_rated_desc}
4.6 find and remove all from (if categories) and to (endif categories) inclusive


5. for a link to this page anywhere on the site

use
Code: [Select]
<a href="{url_top_rated}">{lang_top_rated}</a>

4
Chit Chat / Спам в комментариях...
« on: November 07, 2009, 03:01:10 PM »
В моей галерее комментарии могут добавлять все, включая гостей. Изменять этот параметр я не хочу.
Использую [MOD] Anti-Spam v1.0 for Guestbook & Comments, но в последнее время он не помогает.

Спам появляется только в комментариях к фоткам (в гостевой нет).
У спамера абсолютно разные IP, нормальная запись в User Agent.
Приходит всегда с Google после запроса Verification code inurl:details.php?image_id=.

На сайтах, где включена старндартная captcha - та же история.
Похоже кто-то нашёл слабое место в галерее.

Как с этим бороться?

5
Hi friends,

Can someone check modification I did for this mod? Is it good enough for publication on the forum?
Almost all code taken from thunderstrike version.
Multiupload.php is a separate file now.

In the archive you can find all necessary files and instruction for installation.

Thank you.

6
In my gallery (v1.7.6) works fine!

8
Before installation open the file data/database/default/mysql_default.sql
and replace each
Code: [Select]
TYPE=MyISAM;
with
Code: [Select]
TYPE=MyISAM CHARACTER SET=cp1251;
change cp1251 to encoding of your site


2. in the file includes/db_mysql.php

find
Code: [Select]
function Db($db_host, $db_user, $db_password = "", $db_name = "", $db_pconnect = 0) {
    $connect_handle = ($db_pconnect) ? "mysql_pconnect" : "mysql_connect";
    if (!$this->connection = $connect_handle($db_host, $db_user, $db_password)) {
      $this->error("Could not connect to the database server ($db_host, $db_user).", 1);
    }
    if ($db_name != "") {
      if (!@mysql_select_db($db_name)) {
        @mysql_close($this->connection);
        $this->error("Could not select database ($db_name).", 1);
      }
    }
    return $this->connection;
  }

replace with
Code: [Select]
function Db($db_host, $db_user, $db_password = "", $db_name = "", $db_pconnect = 0) {
    $connect_handle = ($db_pconnect) ? "mysql_pconnect" : "mysql_connect";
    if (!$this->connection = $connect_handle($db_host, $db_user, $db_password)) {
      $this->error("Could not connect to the database server ($db_host, $db_user).", 1);
    }
mysql_query ("set character_set_client='cp1251'");
mysql_query ("set character_set_results='cp1251'");
mysql_query ("set collation_connection='cp1251_general_ci'");
    if ($db_name != "") {
      if (!@mysql_select_db($db_name)) {
        @mysql_close($this->connection);
        $this->error("Could not select database ($db_name).", 1);
      }
    }
    return $this->connection;
  }

change cp1251 to encoding of your site


3. if you use cp1251 - in the file includes/search_utils.php

find
Code: [Select]
$val = convert_special($val);
replace with
Code: [Select]
// $val = convert_special($val);
3.a if you use utf8 -  in the file includes/search_utils.php

find
Code: [Select]
function convert_special($text) {
  return strtr(
    $text,
    array(
      "" => "AE",
      "" => "OE",
      "" => "UE",
      "" => "ae",
      "" => "oe",
      "" => "ue",
      "" => "ss"
    )
  );
}

replace with
Code: [Select]
function convert_special($text) {
  return strtr(
    $text,
    array(
      "" => "",
      "" => "",
      "" => "",
      "" => ""
    )
  );
}

and save the file in utf-8 format

9
Mods & Plugins (Releases & Support) / Re: Answers in comments
« on: January 13, 2009, 09:02:18 PM »
Hi all,

I know that Lunat already use my solution on his site, but we don't shure that found all bugs.
I trust on your help.

1. in the file member.php

find line with
Code: [Select]
$sql = "SELECT c.comment_id, c.user_id AS comment_user_id,
insert into
Code: [Select]
c.response, c.comment_response,
1.1 find
Code: [Select]
if ($comment_row['comment_user_id'] != GUEST) {
add above
Code: [Select]
if ($comment_row['comment_response'] != 0 && $comment_row['response'] != 0) {
    $sql = "UPDATE ".COMMENTS_TABLE."
            SET comment_response = ".$comment_row['comment_response']."
            WHERE comment_response = ".$comment_row['comment_id'];
    $site_db->query($sql);
  }
  elseif ($comment_row['response'] && $comment_row['comment_response'] == 0) {
    $sql = "UPDATE ".COMMENTS_TABLE."
            SET comment_response = 0
            WHERE comment_response = ".$comment_row['comment_id'];
    $site_db->query($sql);
  }
  elseif ($comment_row['comment_response'] && $comment_row['response'] == 0) {
    $response_id = $comment_row['comment_response'];
      while ($response_id != 0) {
        $sql = "SELECT comment_id, user_id, comment_response
                FROM ".COMMENTS_TABLE."
                WHERE comment_id = $response_id";
        $row = $site_db->query_firstrow($sql);
        $response_id = $row['comment_response'];
        $com_id = $row['comment_id'];

        $sql = "DELETE FROM ".COMMENTS_TABLE."
                WHERE comment_id = $com_id";
        $site_db->query($sql);
        update_comment_count($comment_row['image_id'], $row['user_id']);
      }
  }


2. in the file details.php

find
Code: [Select]
$comment_text = un_htmlspecialchars(trim($HTTP_POST_VARS['comment_text']));
add below
Code: [Select]
$response_to = (isset($HTTP_POST_VARS['response_to'])) ? un_htmlspecialchars(trim($HTTP_POST_VARS['response_to'])) : "";
2.1 find
Code: [Select]
if (!$error)  {
      $sql = "INSERT INTO ".COMMENTS_TABLE."
              (image_id, user_id, user_name, comment_headline, comment_text, comment_ip, comment_date)
              VALUES
              ($id, ".$user_info['user_id'].", '$user_name', '$comment_headline', '$comment_text', '".$session_info['session_ip']."', ".time().")";
      $site_db->query($sql);
      $commentid = $site_db->get_insert_id();
      update_comment_count($id, $user_info['user_id']);
      $msg = $lang['comment_success'];

replace with
Code: [Select]
if (!$error)  {
      if ($response_to) {
        $response = 1;
      } else {$response = 0;}
      $sql = "INSERT INTO ".COMMENTS_TABLE."
              (image_id, user_id, user_name, comment_headline, comment_text, comment_ip, comment_date, response)
              VALUES
              ($id, ".$user_info['user_id'].", '$user_name', '$comment_headline', '$comment_text', '".$session_info['session_ip']."', ".time().", '$response')";
      $site_db->query($sql);
      $commentid = $site_db->get_insert_id();
      update_comment_count($id, $user_info['user_id']);
      $msg = $lang['comment_success'];

      if ($response_to) {
        $sql = "UPDATE ".COMMENTS_TABLE."
                SET comment_response = '$commentid'
                WHERE comment_id = $response_to";
        $site_db->query($sql);
      }

2.2 find line with
Code: [Select]
$sql = "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name,
insert into
Code: [Select]
c.comment_response, c.response,
2.3 find
Code: [Select]
WHERE c.image_id = $image_id
replace with
Code: [Select]
WHERE c.image_id = $image_id AND c.response = 0
2.4 find
Code: [Select]
$comment_user_info = $lang['userlevel_guest'];
add below
Code: [Select]
$comment_headline = format_text($comment_row[$i]['comment_headline'], 0, $config['wordwrap_comments'], 0, 0);
2.5 find
Code: [Select]
$admin_links = "";
      if ($user_info['user_level'] == ADMIN) {
        $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=editcomment&amp;comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['edit']."</a>&nbsp;";
        $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=removecomment&amp;comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['delete']."</a>";
      }
      elseif ($is_image_owner) {
        $admin_links .= ($config['user_edit_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editcomment&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['edit']."</a>&nbsp;";
        $admin_links .= ($config['user_delete_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removecomment&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['delete']."</a>";
      }

add below
Code: [Select]
$responses = "";
    $response_comment_id = "";
      if ($comment_row[$i]['comment_response'] != 0) {
        $bg_number = $bgcounter;
        $response_bg = ($bg_number++ % 2 == 0) ? 1 : 2;
        $responses .= "<br /><table width=\"90%\" align=\"center\" cellpadding=\"5\" cellspacing=\"0\" style=\"border: 1px solid #004C75;\">\n";

        $response_row['comment_response'] = $comment_row[$i]['comment_response'];
        while ($response_row['comment_response'] != 0) {
          $sql = "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS response_user_name, c.comment_headline, c.comment_text, c.comment_ip, c.comment_date, c.comment_response".get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name")."
                  FROM ".COMMENTS_TABLE." c
                  LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = c.user_id)
                  WHERE c.comment_id = ".$response_row['comment_response'];
          $response_row = $site_db->query_firstrow($sql);

          $response_user_name = format_text($response_row['response_user_name'], 2);
          $response_user_info = $lang['userlevel_guest'];
          $response_user_id = $response_row['user_id'];
          $response_date = format_date($config['date_format']." ".$config['time_format'], $response_row['comment_date']);
          $response_text = format_text($response_row['comment_text'], $config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments']);
          $response_comment_id = $response_row['comment_id'];

          if (isset($response_row[$user_table_fields['user_name']]) && $response_user_id != GUEST) {
            $response_user_profile_link = !empty($url_show_profile) ? $site_sess->url(preg_replace("/{user_id}/", $response_user_id, $url_show_profile)) : $site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$response_user_id);
            $response_user_name = "<a href=\"".$response_user_profile_link."\">".format_text($response_row[$user_table_fields['user_name']], 2)."</a>";

            if (!isset($response_row[$user_table_fields['user_level']]) || (isset($response_row[$user_table_fields['user_level']]) && $response_row[$user_table_fields['user_level']] == USER)) {
              $response_user_info = $lang['userlevel_user'];
            }
            elseif ($response_row[$user_table_fields['user_level']] == ADMIN) {
              $response_user_info = $lang['userlevel_admin'];
            }
          }

          $response_user_ip = ($user_info['user_level'] == ADMIN) ? $response_row['comment_ip'] : "";

          $response_admin_links = "";
          if ($user_info['user_level'] == ADMIN) {
            $response_admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=editcomment&amp;comment_id=".$response_row['comment_id']))."\" target=\"_blank\">".$lang['edit']."</a>&nbsp;";
            $response_admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=removecomment&amp;comment_id=".$response_row['comment_id']))."\" target=\"_blank\">".$lang['delete']."</a>";
          }
          elseif ($is_image_owner) {
            $response_admin_links .= ($config['user_edit_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editcomment&amp;".URL_COMMENT_ID."=".$response_row['comment_id'])."\">".$lang['edit']."</a>&nbsp;";
            $response_admin_links .= ($config['user_delete_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removecomment&amp;".URL_COMMENT_ID."=".$response_row['comment_id'])."\">".$lang['delete']."</a>";
          }
          $responses .= "<tr>\n<a name=\"comment".$response_comment_id."\"></a>\n<td class=\"commentrow".$response_bg."\">\n";
          $responses .= "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
          $responses .= "<tr>\n<td><b>".$lang['response'].$response_user_name."</b> (".$response_user_info.")</td>\n";
          $responses .= "<td align=\"right\">".$response_date."</td>\n</tr>\n";
          $responses .= "<tr>\n<td colspan=\"2\"><hr>\n".$response_text."</td>\n</tr>\n";
          $responses .= "<tr>\n<td>".$response_user_ip."</td>\n";
          $responses .= "<td align=\"right\">".$response_admin_links."</td>\n</tr>\n";
          $responses .= "</table>\n</td>\n</tr>\n";

          $response_bg = ($bg_number++ % 2 == 0) ? 1 : 2;
        }

        $responses .= "</table>\n";
      }

      $response_to_id = "";
      if ($response_comment_id) {
        $response_to_id .= $response_comment_id;
      } else {
        $response_to_id .= $comment_row[$i]['comment_id'];
      }

2.6 find
Code: [Select]
"comment_headline" => format_text($comment_row[$i]['comment_headline'], 0, $config['wordwrap_comments'], 0, 0),
replace with
Code: [Select]
"comment_headline" => $comment_headline,
        "responses" => $responses,
        "response_to_id" => $response_to_id,
        "lang_post_response" => $lang['post_response'],

2.7 find
Code: [Select]
$comment_text = (isset($HTTP_POST_VARS['comment_text']) && $error) ? format_text(trim(stripslashes($HTTP_POST_VARS['comment_text'])), 2) : "";
add below
Code: [Select]
$response_to = (isset($HTTP_POST_VARS['response_to']) && $error) ? format_text(trim(stripslashes($HTTP_POST_VARS['response_to'])), 2) : "";
2.8 find
Code: [Select]
"comment_text" => $comment_text,
add below
Code: [Select]
"response_to" => $response_to,
      "lang_clear" => $lang['clear'],
      "lang_clear_desc" => $lang['clear_desc'],


3. in the file lang/your_lang/main.php

add
Code: [Select]
//-----------------------------------------------------
//--- Mod Responses to Comment -------------------------
// ----------------------------------------------------
  $lang['response'] = "Response: ";
  $lang['post_response'] = "Post response";
  $lang['clear'] = "Clear";
  $lang['clear_desc'] = "<span class=\"small\"> - will saved as a new comment (not response)</span>";


4. in the file admin/comments.php

find
Code: [Select]
$sql = "SELECT comment_id, image_id, user_id, user_name, comment_headline
          FROM ".COMMENTS_TABLE."
          WHERE comment_id IN ($comment_ids)";
  $comment_result = $site_db->query($sql);
  while ($comment_row = $site_db->fetch_array($comment_result)) {

replace with
Code: [Select]
$sql = "SELECT comment_id, image_id, user_id, user_name, comment_headline, response, comment_response
          FROM ".COMMENTS_TABLE."
          WHERE comment_id IN ($comment_ids)";
  $comment_result = $site_db->query($sql);
  while ($comment_row = $site_db->fetch_array($comment_result)) {
    if ($comment_row['comment_response'] != 0 && $comment_row['response'] != 0) {
      $sql = "UPDATE ".COMMENTS_TABLE."
              SET comment_response = ".$comment_row['comment_response']."
              WHERE comment_response = ".$comment_row['comment_id'];
      $site_db->query($sql);
    }
    elseif ($comment_row['response'] && $comment_row['comment_response'] == 0) {
      $sql = "UPDATE ".COMMENTS_TABLE."
              SET comment_response = 0
              WHERE comment_response = ".$comment_row['comment_id'];
      $site_db->query($sql);
    }
    elseif ($comment_row['comment_response'] && $comment_row['response'] == 0) {
      $response_id = $comment_row['comment_response'];
      while ($response_id != 0) {
        $sql = "SELECT comment_id, user_id, comment_response
                FROM ".COMMENTS_TABLE."
                WHERE comment_id = $response_id";
        $row = $site_db->query_firstrow($sql);
        $response_id = $row['comment_response'];
        $com_id = $row['comment_id'];

        $sql = "DELETE FROM ".COMMENTS_TABLE."
                WHERE comment_id = $com_id";
        $site_db->query($sql);
        update_comment_count($comment_row['image_id'], $row['user_id']);
      }
    }


5. in the file comment_bit.html

find
Code: [Select]
{comment_text}
add below
Code: [Select]
{if responses}<br />{responses}<br />{endif responses}
5.1 for the link "post response" use:
Code: [Select]
<a href="#comment_form" onClick="get_link('{comment_headline}', '{response_to_id}')" /><b>{lang_post_response}</b></a>

6. in the file comment_form.html

before all content add
Code: [Select]
<script language="javascript" type="text/javascript">

function get_link(headline, hidden_id){
document.commentform.comment_headline.value=headline
document.commentform.response_to.value=hidden_id
}

function clear_link() {
document.commentform.comment_headline.value=""
document.commentform.response_to.value=""
}
</script>

<a name="comment_form"></a>

6.1 find
Code: [Select]
<form name="commentform" action="{self}" method="post" onsubmit="postbutton.disabled=true;">
add below
Code: [Select]
<input type="hidden" name="response_to" value="{response_to}" />
6.2 find
Code: [Select]
<input type="text" name="comment_headline" size="30" value="{comment_headline}" class="commentinput" />
after add
Code: [Select]
<br /><a href="#comment_form" onClick="clear_link()">{lang_clear}</a>{lang_clear_desc}

7. install mod

upload to root directory the atached file responses_install.php, install mod and delete this file from your server.

10
Mods & Plugins (Requests & Discussions) / Re: in the comments
« on: January 11, 2009, 10:42:02 AM »
nameless

in the file details.php

find
Code: [Select]
if ($action == "postcomment" && isset($HTTP_POST_VARS[URL_ID])) {
add below
Code: [Select]
if ($is_image_owner || $user_info['user_level'] == ADMIN) {

find
Code: [Select]
unset($row);
  unset($spam_row);

add below
Code: [Select]
  }
  else{
    $msg .= $lang['comments_deactivated'];
  }

11
Discussion & Troubleshooting / Re: Total Images
« on: January 09, 2009, 05:33:55 PM »
Hi V@no

I managed to fix the issue but on the pagination it hasn't changed

Code: [Select]
3651 images(s) on 305 page(s). :)

I know, cch already resolved this problem.
I will post for other users too.

In the file includes/paging.php

find
Code: [Select]
$this->num_rows_all = $num_rows_all;
add below
Code: [Select]
$this->new_format = number_format($num_rows_all, "", "", ",");
find
Code: [Select]
$replace_array = array(
      $this->num_rows_all,

replace with
Code: [Select]
$replace_array = array(
      $this->new_format,

12
You are right, it not saved.

Check now.

13
V@no, I don't understand.. If an user not allowed to view comment, how he can to rate it (how he will see the rate-images).

Also I forgot one important thing - users can't rate for their own comments.
So I changed step 1.2 and added line in step 2.

14
here my changings ...

1. in the file details.php
after your ...
Code: [Select]
$comment_rank .= "+".$comment_row[$i]['is_good']." ".$comrate_good." ".$comrate_bad." ".$comment_row[$i]['is_bad']."-";

I added this...
Code: [Select]
$site_template->register_vars("comment_rank", $comment_rank);

Thank you mawenzi, I forgot to add this step.

Quote
... I think, you should post your [MOD] Rate Comments in a new thread in Mods & Plugins (Requests & Discussions) ...
... and then we will move this thread to Mods & Plugins (Releases & Support) ...

Am I need to create a new topic?

Also I think will be more interesting if some function will based on comment_rank.
For example:
user rate comment -> comment's author karma +point (or -point)
when comment's author will get karma = 20, he will allowed to download/upload more images
his karma can be again < 20, so it's good motivation for user to be an active member.

15
This mod will add to user's profile user's images top (most rated, most commented, most viewed, most downloaded).
If all user's images have most value (hits, rating, e.g.) = 0, no image will displayed for this value.

1. in the file member.php

find
Code: [Select]
else {
      $user_email = REPLACE_EMPTY;
      $user_email_save = REPLACE_EMPTY;
      $user_mailform_link = REPLACE_EMPTY;
      $user_email_button = REPLACE_EMPTY;
    }

add below
Code: [Select]
// ----------------------------------- USER'S IMAGES TOP ----------------------------------
    $user_images_top = "";
    $most_value_array = array("image_rating", "image_hits", "image_comments", "image_downloads");
    $most_value_image = "";
    foreach ($most_value_array as $key) {
     
      $additional_sql = "";
      if ($key == "image_rating") {
        $additional_sql .= "AND image_rating = (SELECT MAX(image_rating) ";
        $most_value = $lang['most_rate'];
      }
      elseif ($key == "image_hits") {
        $additional_sql .= "AND image_hits = (SELECT MAX(image_hits) ";
        $most_value = $lang['most_hits'];
      }
      elseif ($key == "image_comments") {
        $additional_sql .= "AND image_comments = (SELECT MAX(image_comments) ";
        $most_value = $lang['most_comments'];
      }
      elseif ($key == "image_downloads") {
        $additional_sql .= "AND image_downloads = (SELECT MAX(image_downloads) ";
        $most_value = $lang['most_downloads'];
      }
    $sql = "SELECT image_id, cat_id, image_name, image_thumb_file, image_comments, image_downloads, image_rating, image_hits
            FROM ".IMAGES_TABLE." a
            WHERE user_id = $user_id AND image_active = 1 $additional_sql
            FROM ".IMAGES_TABLE." b
            WHERE a.user_id = b.user_id)
            GROUP BY image_date";

      $most_value_row = $site_db->query_firstrow($sql);

      if ($most_value_row[$key] != 0 && !empty($most_value_row[$key])) {
        $most_value_image .= "<td align=\"center\"><b>".$most_value." (".$most_value_row[$key].")</b><br>\n";
        $most_value_image .= "<a href=\"".$site_sess->url(ROOT_PATH."details.php?image_id=".$most_value_row['image_id'])."\"><img src=\"".get_file_path($most_value_row['image_thumb_file'], "thumb", $most_value_row['cat_id'], 0, 1)."\" border=\"0\" alt=\"\" title=\"".$most_value_row['image_name']."\" /><br>\n";
        $most_value_image .= $most_value_row['image_name']."</a><br></td>\n";
      }

  }
    if ($most_value_image != "") {
      $user_images_top .= "<table border=\"0\" cellpading=\"0\" cellspasing=\"0\">\n<tr>\n";
      $user_images_top .= $most_value_image."</tr>\n</table>\n";
    }
// ---------------------------------------------------------------------------------------

1.1 find
Code: [Select]
"user_name" => (isset($user_row['user_name'])) ? format_text($user_row['user_name'], 2) : REPLACE_EMPTY,
add below
Code: [Select]
"user_images_top" => $user_images_top,

2. in the file lang/your_lang/main.php

add before ?>
Code: [Select]
$lang['most_rate'] = "Most rated";
$lang['most_hits'] = "Most viewed";
$lang['most_comments'] = "Most commented";
$lang['most_downloads'] = "Most downloaded";

3. in the file member_profile.html

use
Code: [Select]
{if user_images_top}{user_images_top}{endif user_images_top}

Pages: [1] 2 3 4