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 - alekseyn1

Pages: 1 2 3 [4] 5 6 7
46
Code: [Select]
ORDER BY ".(($selection[$cnt] == "rating") ? "((i.image_votes/15)^(1/3)) * (i.image_rating-3)" : "i.image_".$selection[$cnt])." DESC, i.image_".$selection_alt[$cnt];

For some reason this did not work for me... but this version did work just fine:
Code: [Select]
ORDER BY ".(($selection[$cnt] == "rating") ? "(POW((i.image_votes/15),(1/3))) * (i.image_rating-3)" : "i.image_".$selection[$cnt])." DESC, i.image_".$selection_alt[$cnt];

47
Discussion & Troubleshooting / Re: 500 error
« on: December 28, 2009, 10:17:20 PM »
that's exactly what was weird... it happened only when you try and view it...

on my other site, that runs 1.7.6 it got uploaded with no problems... (same host)... anyways... I start suspecting that I have too many MODs installed....

oh well... deleted it and asked to resize and re-upload it...

anyone needs a job )))? i need someone to optimize the code I think... i have commented on EVERY modification I made within the code...

48
Discussion & Troubleshooting / 500 error
« on: December 28, 2009, 01:09:13 PM »
Gents,

I have stumbled upon a very interesting issue...

my gallery runs well... very few server errors... but sometimes they do occur.... but today, one of the users uploaded an image... it shows under new photos, the thumb gets created, but when anyone attempts to view it, the error 500 occurs...

here is what the tech support from the provider gave me...

Quote
Hello,
I'm sorry, but the system appears to be segfaulting when trying to load that one image. I'm not certain why. It's possible there is a memory issue, if the image is unusually large in dimension (although it is not unusually large in file size). Here is the segfault in process execution trace:
time(NULL) = 1261997397
open("/home/.../data/media/4/2962016_large.jpeg", O_RDONLY) = 6
fstat64(6, {st_mode=S_IFREG|0666, st_size=109869, ...}) = 0
lseek(6, 0, SEEK_CUR) = 0
time(NULL) = 1261997397
stat64("/home/.../data/media/4/2962016_large.jpeg", {st_mode=S_IFREG|0666, st_size=109869, ...}) = 0
lseek(6, 0, SEEK_SET) = 0
read(6, "\377\330\377\340\0\20JFIF\0\1\2\1\0`\0`\0\0\377\341+\235Exif\0\0II"..., 8192) = 8192
read(6, "sj\223\v\270-\21\227l~fIb;q\322\200=#\341E\375\315\226\250\326\27O\30\16\236b"..., 8192) = 8192
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
Process 20152 detached

And the backtrace from the core dump:
#0 0x46cf47dc in memcpy () from /lib/libc.so.6
#1 0x08311953 in _estrndup (s=0xb4bb18e4 <Address 0xb4bb18e4 out of bounds>, length=3032160484) at /home/cpeasyapache/src/php-5.2.9/Zend/zend_alloc.c:2439
#2 0x0810d50a in exif_iif_add_tag (image_info=0xbfd804a4, section_index=147914252, name=0xbfd80014 "UndefinedTag:0x000D", tag=13, format=7, length=3072,
value=0xb4bb18e4, tsrm_ls=0x8865730) at /home/cpeasyapache/src/php-5.2.9/ext/exif/exif.c:1723
#3 0x0810e427 in exif_process_IFD_TAG (ImageInfo=0xbfd804a4, dir_entry=0x8d0d518 "\r", offset_base=0xb4bb1568 <Address 0xb4bb1568 out of bounds>,
IFDlength=11157, displacement=30, section_index=13, ReadNextIFD=0, tag_table=0x847d440, tsrm_ls=0x8865730)
at /home/cpeasyapache/src/php-5.2.9/ext/exif/exif.c:3120
#4 0x0810f30e in exif_process_IFD_TAG (ImageInfo=0xbfd804a4, dir_entry=<value optimized out>, offset_base=0xb4bb1568 <Address 0xb4bb1568 out of bounds>,
IFDlength=11157, displacement=30, section_index=7, ReadNextIFD=1, tag_table=0x847ca20, tsrm_ls=0x8865730)
at /home/cpeasyapache/src/php-5.2.9/ext/exif/exif.c:2807
#5 0x0810e007 in exif_process_IFD_in_JPEG (ImageInfo=0xbfd804a4, dir_start=<value optimized out>, offset_base=0x8d0d26c "II*", IFDlength=11157,
displacement=30, section_index=7, tsrm_ls=0x8865730) at /home/cpeasyapache/src/php-5.2.9/ext/exif/exif.c:3148
#6 0x0810f120 in exif_process_IFD_TAG (ImageInfo=0xbfd804a4, dir_entry=<value optimized out>, offset_base=0x8d0d26c "II*", IFDlength=11157,
displacement=30, section_index=3, ReadNextIFD=1, tag_table=0x847ca20, tsrm_ls=0x8865730) at /home/cpeasyapache/src/php-5.2.9/ext/exif/exif.c:3111
#7 0x0810e007 in exif_process_IFD_in_JPEG (ImageInfo=0xbfd804a4, dir_start=<value optimized out>, offset_base=0x8d0d26c "II*", IFDlength=11157,
displacement=30, section_index=3, tsrm_ls=0x8865730) at /home/cpeasyapache/src/php-5.2.9/ext/exif/exif.c:3148
#8 0x08110d04 in exif_read_file (ImageInfo=0xbfd804a4, FileName=<value optimized out>, read_thumbnail=0, read_all=0, tsrm_ls=0x8865730)
at /home/cpeasyapache/src/php-5.2.9/ext/exif/exif.c:3225
#9 0x08111fa6 in zif_exif_read_data (ht=2, return_value=0x8b20714, return_value_ptr=0x0, this_ptr=0x0, return_value_used=1, tsrm_ls=0x8865730)
at /home/cpeasyapache/src/php-5.2.9/ext/exif/exif.c:3972

Unfortunately, at this time there is nothing we can do to assist in getting this picture viewable. I have attempted to increase memory - although we were already at the maximum allotment for our shared servers - temporarily, and that did not make a difference. If this file is unusually large in dimension, you may wish to scale it down before uploading it to the site.

Cheers,
Linux Systems Administration


this happens with ONLY ONE picture so far... other pics show well with no problems.... strange....

49
one problem fixed....

the solution is here

http://www.4homepages.de/forum/index.php?topic=6646.msg114267#msg114267

so the modification required to above is:

in step 4

instead of code given, you should add:

Code: [Select]
if ($bbcode == 1) {

//crop suggestion mod - template plug {template_url} does not function here for some reason
$crop_code_ = array("/\[CROP\:(.*?)\]/is" => "<a href=\"javascript:loadState($1)\"><img src=\"".TEMPLATE_PATH."/js/icon_load.gif\"></a>");
$text = preg_replace(array_keys($crop_code_), array_values($crop_code_), $text);
//crop suggestion mod
}

this will prevent the comment from being formatted in you miss the comment headline for example or if you try to edit the comment with crop suggestion from the ACP...

50
Mods & Plugins (Releases & Support) / Re: [MOD] Votes saved in DB
« on: December 27, 2009, 11:13:23 PM »
well... trouble is, that when the comment is posted, the rating value is transfered with POST... database updates..

but the data for the rate form (not the one listed by me, but the one modded with the modification listed in this topic to show the user vote after he voted) does not get pulled from the database correctly...

EDIT

fixed by replacing in page_header.php

line

Code: [Select]
if ($action == "rateimage" && $id) {
with line
Code: [Select]
if ($action == "rateimage" && $id || $action == "postcomment" && $id) {

51
Mods & Plugins (Releases & Support) / Re: [MOD] Votes saved in DB
« on: December 27, 2009, 10:27:09 PM »
OK guys... I solved it...

Here is what you do if you want to have a comment ONLY if your user rated an image... and the user can VOTE with no comments for the image...

1. Install this MOD  :lol:

2. in comments_form.html

add in the place where you would like this form to appear...

Code: [Select]
  <!--new rate system -->
{if rate_form}
<tr>
<td>
{rate}
</td>

<td valign="bottom">
<select name="rating" class="select" {rate_button}>
{rate_options}
</select>
<input type="hidden" name="action" value="rateimage" />
<input type="hidden" name="id" value="{image_id}" />
</td>
</tr>
   {endif rate_form}
  <!-- end of new rate system -->


3. in details.php

find:

Code: [Select]
if ($user_name == "")  {
and ADD BEFORE

Code: [Select]
//no comment without rating

//user rated before?
$image_rated_by_user = "";
    $sql = "SELECT vote
            FROM ".VOTED_TABLE."
            WHERE image_id =".$id." AND user_id =".$user_info['user_id'];
   
$row = $site_db->query_firstrow($sql);
    $image_rated_by_user = (isset($row['vote']))? 1 : 0 ;

//user is the owner of image?

$is_image_owner2 = "";
$sql2 = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email")."
        FROM (".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
        LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
        WHERE i.image_id = ".$id." AND i.image_active = 1 AND c.cat_id = i.cat_id";
$image_row2 = $site_db->query_firstrow($sql2);
$is_image_owner2 = ($user_info['user_id'] == $image_row2['user_id']) ? 1 : 0;


    if (!$is_image_owner2 && $image_rated_by_user == 0 && $rating == "--")  {
  $msg .= (($msg != "") ? "<br />" : "").$lang['rating_required'];
  $error = 1;
}

//end no comment without rating

3.1

find

Code: [Select]
update_comment_count($id, $user_info['user_id']);
and ADD AFTER

Code: [Select]
//save rating from comment form
 
  if (!$is_image_owner2 && $image_rated_by_user == 0) {
  update_image_rating($id, $rating);
  }
  //end save rating from comment form


4. in your language main.php

find

Code: [Select]
//-----------------------------------------------------
//--- Image Details -----------------------------------
//-----------------------------------------------------

and add after

Code: [Select]
$lang['rating_required'] = "You did not include the rating for this image";
this should work for you...

I can not remove one bug....

I have not removed the original rate form from below the image, so that user can vote as before and that rate form works perfectly... and shows the rating you have gived to the image....

but if you add a rating from the comments form, it gets entered into the database and the comment appears.. but the rate form does not change... thus letting the user vote again from the separate rate form...

anyways any ideas please.. I ran out of steam today trying to resolve this one...

52
Mods & Plugins (Releases & Support) / Re: [MOD] Votes saved in DB
« on: December 26, 2009, 01:34:17 PM »
guys, anyone knows how to join this MOD and this MOD http://www.4homepages.de/forum/index.php?topic=4023.0?

I run a website where people comment, but are not  very keen in setting a rating....

so I would really appreciate any help in joining of this MOD with this MOD http://www.4homepages.de/forum/index.php?topic=4023.0

but i need that MOD to let visitors post comment ONLY with voting and vote without comment


EDIT
Nevermind...

53
Discussion & Troubleshooting / Re: russian file names
« on: December 25, 2009, 11:01:30 AM »
anyone found a solution to the subject of this topic??

54
Mods & Plugins (Releases & Support) / Re: [Mod] Mini-Top
« on: December 24, 2009, 12:32:28 PM »
Hi guys, here is the new idea -

to avoid duplications and to draw more attention to different photos i suggest we make a variation of this MOD to show different photos. Now there is a possibility that one photo could be a leader in some areas like most commented and most viewed and most rated...  

What I suggest is to make the following system:

photo a = leader max votes
photo b = leader max comments
if a=b then in place of photo show next one down (i.e photo with max comments - 1)

etc...

the idea is to have this block with different pictures and avoid the possibility to have duplications... The TRUE ratings would still be shown in TOP images section...



I would also love to have different MINI TOPs...

MINI TOP of the DAY
MINI TOP of the WEEK
MINI TOP of the MONTH

I guess that would involve duplicating the MOD three times??

EDIT
Nevermind.. solved...

55
V@no, is there a way to disable AJAX comments (let the page refresh) but keep the AJAX comments ratings if you know what I mean...

I just have some functions that do not work with comment postings... but AJAX comment rating I would like to keep (otherwise I would have just uninstalled the MOD)...

56
I am trying to extend this bridge and update not only the e-mail of the user, but also other fields from phpBB into 4images database...

i have created a custom profile field "full_name" in phpBB and now I am trying to update the relevant field (which I also created in 4images).

field definitions in 4images are done as follows:

in db_field_definitions.php:

Code: [Select]
$additional_user_fields['full_name'] = array($lang['full_name'], "text", 0);
in sessions.php
Code: [Select]
$user_table_fields = array(
 ...
  //new
  "full_name" => "full_name",
  //end new
...
);

then I try to compare and import from one php_users table into 4images_users like this:

Code: [Select]
//  --
//  check and update if user has a new info in phpBB

//e-mail
    if ($bbuser->data['user_id'] > ANONYMOUS && $bbuser->data['user_email'] !== $user_info['user_email']) {
        $sql = "
UPDATE ".USERS_TABLE."
SET ".get_user_table_field(" ", "user_email")." = '".$bbuser->data['user_email']."'
WHERE ".get_user_table_field("", "user_id")." = '".$user_info['user_id']."'
LIMIT 1;";
        $result = $site_db->query($sql);
    }

//name
    if ($bbuser->data['user_id'] > ANONYMOUS && $bbuser->profile_fields['pf_full_name'] !== $user_info['full_name']) {
$sql = "
UPDATE ".USERS_TABLE."
SET ".get_user_table_field(" ", "full_name")." = '".$bbuser->profile_fields['pf_full_name']."'
WHERE ".get_user_table_field("", "user_id")." = '".$user_info['user_id']."'
LIMIT 1;";
        $result = $site_db->query($sql);
    }

as a result, I get nothing in the 4images field... (although if you make the 4images field "full_name" as NULL, it becomes not null as the result of this script)... anyone knows what's wrong? I appreciate any help.

57
Programming / number of new photos in categories
« on: December 22, 2009, 06:46:40 PM »
Gents,

I have been trying to show the number of new images in every category...

I came up with this modification of function.php (

Code: [Select]
function get_categories($cat_id = 0) {
  ....

  foreach ($visible_cat_cache as $key => $category_id) {
    $categories .= "<tr>\n<td valign=\"top\">\n";

    $is_new = (isset($new_image_cache[$category_id]) && $new_image_cache[$category_id] > 0) ? 1 : 0;

$num_images = (isset($cat_cache[$category_id]['num_images'])) ? $cat_cache[$category_id]['num_images'] : 0;
    $num_new_images = (isset($new_image_cache[$category_id]['new_images'])) ? $new_image_cache[$category_id]['new_images'] : 0;

$subcat_ids = array();
    get_subcat_ids($category_id, $category_id, $cat_parent_cache);

    if (isset($subcat_ids[$category_id])) {
      foreach ($subcat_ids[$category_id] as $val) {
        if (isset($new_image_cache[$val]) && $new_image_cache[$val] > 0) {
          $is_new = 1;
  $num_new_images += $new_image_cache[$val]['new_images']; 
        }
        if (isset($cat_cache[$val]['num_images'])) {
          $num_images += $cat_cache[$val]['num_images'];

        }
      }
    }

  ....

  "num_new_images" => $num_new_images
    ...

  }



but for some reason some categories do not properly show the number of new images....
anyone has a better solution?



58
enable statistics info and debugging in includes/constants.php and then you will see all the timings of the 4images...

Code: [Select]
// Debug contants
define("PRINT_STATS", 1);
define("PRINT_QUERIES", 1);
define('PRINT_CACHE_MESSAGES', 1);

59
Mods & Plugins (Releases & Support) / Re: [Mod] User upload limits
« on: December 22, 2009, 11:31:03 AM »
Hello boys!

This module already completed 5 years of life and so far nobody has found a solution to the bug him.

Does anyone here has no Forum able to resolve this bug?

BUG: /member.php?action=uploadform

This module very interesting for me and I am willing to pay to have this correction on my website.

Who is interested?  :D

Thank you


here is a quick fix... please post here if you find a problem with this solution...

instead of in member.php
Code: [Select]
if ($cat_id != 0 && (!isset($cat_cache[$cat_id]) || !check_daily_picture_limit($user_id))) {
use this line
Code: [Select]
if (!check_daily_picture_limit($user_id)) {
not sure why there was a check for category number....

60
Quote

Re-download the package and replace only ajaxcomments.php file.
Also, I've changed Step 7.6
Apparently InternetExplorer chokes when JS tries change innerHTML in a table, so you'll need add a SPAN or DIV around the table with {comments} tag.


Problem V@no... comments now get encoded into a diiferent encoding in the database... and this effects the display in my last comments MOD on the front page... screen attached...

could the rating of the comments function stay and can the posting be disabled through AJAX? would this be feasible?

Pages: 1 2 3 [4] 5 6 7