4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: thunderstrike on November 07, 2007, 04:56:11 AM

Title: [MOD] - See other upload images by uploader from details page
Post by: thunderstrike on November 07, 2007, 04:56:11 AM
This is MOD for see in details page - all relate upload image of each uploader (relate image of upload).

// Step 1

In details.php file,

find:

Code: [Select]
//-----------------------------------------------------
//--- Show Image --------------------------------------
//-----------------------------------------------------
$image_allow_comments = (check_permission("auth_readcomment", $cat_id)) ? $image_row['image_allow_comments'] : 0;
$image_name = format_text($image_row['image_name'], 2);
show_image($image_row, $mode, 0, 1);

add after:

Code: [Select]
//-----------------------------------------------------
//--- Show All Related Images By Uploader -------------
//-----------------------------------------------------
$sql1 = "

SELECT i.image_id, i.image_name, i.image_thumb_file, i.image_media_file, i.cat_id" . get_user_table_field(", u.", "user_name") . "
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_active = 1 AND i.cat_id = c.cat_id AND i.image_id != " . $image_id . " AND (i.cat_id NOT IN (".get_auth_cat_sql("auth_viewimage", "NOTIN").", ".get_auth_cat_sql("auth_viewcat", "NOTIN")."))

";

$result = $site_db->query($sql1);
$num_rows = $site_db->get_numrows($result);

if (!$num_rows)  {
  $uploader_related_images = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"><tr class=\"imagerow1\"><td>";
  $uploader_related_images .= $lang['no_new_images'];
  $uploader_related_images .= "</td></tr></table>";
}
else  {
  $uploader_related_images = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">";
  $count = 0;
  $bgcounter = 0;
  while ($uploader_related_images_row = $site_db->fetch_array($result)) {
      $user_name = format_text(trim(ucfirst($uploader_related_images_row[$user_table_fields['user_name']]), 2));
     
    if ($count == 0) {
      $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
      $uploader_related_images .= "<tr class=\"imagerow".$row_bg_number."\">\n";
    }
    $uploader_related_images .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";

    show_image($uploader_related_images_row);
    $uploader_related_images .= $site_template->parse_template("thumbnail_bit");
    $uploader_related_images .= "\n</td>\n";
    $count++;
    if ($count == $config['image_cells']) {
      $uploader_related_images .= "</tr>\n";
      $count = 0;
    }
  } // end while

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

$site_template->register_vars("lang_uploader_related_images", preg_replace("/" . $site_template->start . "user_name" . $site_template->end . "/siU", $user_name, $lang['uploader_related_images']));
$site_template->register_vars("uploader_related_images", $uploader_related_images);
unset($uploader_related_images);

// Step 2

In lang/english/main.php file,

add in top ?>:

Code: [Select]
$lang['uploader_related_images'] = "See other images uploaded by {user_name}";

// Step 3

In templates/your_template/details.html file,

find:

Code: [Select]
{admin_links}<br />
                    {endif admin_links}<br />
                    {lightbox_button}&nbsp;&nbsp;{postcard_button}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{download_button}&nbsp;&nbsp;{download_zip_button}
</div>
                  <br />

add after:

Code: [Select]
{if uploader_related_images}
  <table width="450" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td class="head1">
                        <table width="100%" border="0" cellspacing="0" cellpadding="4">
                          <tr>
                            <td class="head1" valign="top">{lang_uploader_related_images}</td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                    <tr>
                      <td class="head1">{uploader_related_images}</td>
                    </tr>                       
                  </table>
  <br />
  {endif uploader_related_images}

Finish.
Title: Re: [MOD] - See other upload images by uploader from details page
Post by: thunderstrike on November 07, 2007, 09:53:26 PM
I fix step 1 from 1st post (include me - I get trap for this MOD  8O  :oops: :mrgreen:).
Title: Re: [MOD] - See other upload images by uploader from details page
Post by: l1some on November 07, 2007, 11:56:27 PM
Not working
Title: Re: [MOD] - See other upload images by uploader from details page
Post by: thunderstrike on November 08, 2007, 12:05:46 AM
Quote
Not working

Please read step 6 of my signature.

Quote
« Last Edit: November 07, 2007, 10:19:25 PM by kai »

I take no responsible for other edit of admin in my post :!:
Title: Re: [MOD] - See other upload images by uploader from details page
Post by: l1some on November 08, 2007, 12:53:19 AM
??? does the mod work in 1.7.4. can you post your code, this one is not working pretty easy to install but nothing shows up
Title: Re: [MOD] - See other upload images by uploader from details page
Post by: thunderstrike on November 08, 2007, 01:03:57 AM
Quote
??? does the mod work in 1.7.4.

Yes - is work with v1.7.4.
Title: Re: [MOD] - See other upload images by uploader from details page
Post by: l1some on November 08, 2007, 03:04:14 AM
can you help???
Title: Re: [MOD] - See other upload images by uploader from details page
Post by: thunderstrike on November 08, 2007, 03:11:40 AM
I test this on fresh 4images install and is work 100%. If install today after my fix post, MOD is work good. If install before, please do step 1 again.
If problem is same, I no can reproduce.
Title: Re: [MOD] - See other upload images by uploader from details page
Post by: l1some on November 08, 2007, 03:35:48 AM
Working, one thing how do I limit the picture to only 4-6
Title: Re: [MOD] - See other upload images by uploader from details page
Post by: thunderstrike on November 08, 2007, 04:07:31 AM
In details.php file,

find:

Code: [Select]
WHERE i.image_active = 1 AND i.cat_id = c.cat_id AND i.image_id != " . $image_id . " AND (i.cat_id NOT IN (".get_auth_cat_sql("auth_viewimage", "NOTIN").", ".get_auth_cat_sql("auth_viewcat", "NOTIN")."))

add after:

Code: [Select]
ORDER BY i.image_date DESC
LIMIT 4

(no space after line).
Change 4 to value limit you want.
Title: Re: [MOD] - See other upload images by uploader from details page
Post by: l1some on November 08, 2007, 04:35:08 AM
Thanks for your help :lol:
Title: Re: [MOD] - See other upload images by uploader from details page
Post by: Sun Zaza on November 08, 2007, 05:20:01 PM
Hi Thunderstrike,
I just installed your MOD on a fresh gallery, but it seems not to be working. :roll:
 
We you click on a thumb to view an image, you get only the image you uploaded or it works randomly. That means you get not what you want.

I am working on 1.74.
Title: Re: [MOD] - See other upload images by uploader from details page
Post by: thunderstrike on November 08, 2007, 06:11:18 PM
Quote
you get only the image you uploaded

Is what I say on first post. :?

Quote
it works randomly

Ramdom ... ? I no get ... example ? (Step 4 of my signature)
Title: Re: [MOD] - See other upload images by uploader from details page
Post by: Sun Zaza on November 08, 2007, 08:28:44 PM
I will make an example for you. Later  :)
Title: Re: [MOD] - See other upload images by uploader from details page
Post by: malpa on November 09, 2007, 03:15:40 PM
 :x ATTENTION:
Installation of this MODis the best way to kill your server.

Never install this MOD if your 4homepages-site has many visitors.

I did this mistake 10 minutes ago: all websites (not only 4homepages-based) on the hole server were in down.
Title: Re: [MOD] - See other upload images by uploader from details page
Post by: thunderstrike on November 09, 2007, 06:32:43 PM
If true ... I create quick fix for this today.
Title: Re: [MOD] - See other upload images by uploader from details page
Post by: thunderstrike on November 09, 2007, 09:48:37 PM
Ok so for good ressource - edit step 3 -

Find:

Quote
{if uploader_related_images}

add before:

Code: [Select]
{if user_loggedin}

find:

Quote
{endif uploader_related_images}

add after:

Code: [Select]
{endif user_loggedin}

This reduce trafic for details page. ;)
Title: Re: [MOD] - See other upload images by uploader from details page
Post by: malpa on December 06, 2007, 11:18:12 AM
Does this MOD use "cache" folder in the root 4images directory?

You can (I hope) to link users playlists with "cache" to reduce traffic for details page on MySQL database.

____________

The idea of this MOD is great: 4images script  has no working playlists. The best way to increase daily amount of users: build playlists (for authors, depending on keywords or tags of an image on details.php page).

Title: Re: [MOD] - See other upload images by uploader from details page
Post by: masterred on December 08, 2007, 12:37:07 AM
hi

work in version 1.7.4

thanks for this  MOD
Title: Re: [MOD] - See other upload images by uploader from details page
Post by: masterred on December 08, 2007, 10:25:21 AM
hi
i have this error

 (http://www.imagehosting.com/out.php/t1434944_1.jpg) (http://www.imagehosting.com/out.php/i1434944_1.jpg)

the image girl at room is the image_id=2 (otro) and the direction bar show the image_id=1 (Princess room)

when doing click in the image http://localhost/4images/details.php?image_id=1
leaves the image http://localhost/4images/details.php?image_id=2
to me and not the one that corresponds thanks


thanks
Title: Re: [MOD] - See other upload images by uploader from details page
Post by: mato72 on January 09, 2008, 01:17:40 AM
Have a little problwm with this mod...
it works, true, but it shows not the OTHER pictures from UPLOADER, only the last uploaded Images to the gallery...
What I have to change to get it working????

I use 1.7.4

Thanks for helping me...
Title: Re: [MOD] - See other upload images by uploader from details page
Post by: thunderstrike on January 09, 2008, 03:50:53 AM
Have a little problwm with this mod...
it works, true, but it shows not the OTHER pictures from UPLOADER, only the last uploaded Images to the gallery...
What I have to change to get it working????

I use 1.7.4

Thanks for helping me...

Hum ... in details.php file,
[edit] - I find problem.

find:

Code: [Select]
WHERE i.image_active = 1 AND i.cat_id = c.cat_id AND i.image_id != " . $image_id . " AND (i.cat_id NOT IN (".get_auth_cat_sql("auth_viewimage", "NOTIN").", ".get_auth_cat_sql("auth_viewcat", "NOTIN")."))

replace:

Code: [Select]
WHERE i.image_active = 1 AND i.cat_id = c.cat_id AND i.image_id NOT IN (" . $image_id . ") AND " . get_user_table_field("u.", "user_id") . " = i.user_id AND (i.cat_id NOT IN (".get_auth_cat_sql("auth_viewimage", "NOTIN").", ".get_auth_cat_sql("auth_viewcat", "NOTIN")."))

is work right ?
Title: Re: [MOD] - See other upload images by uploader from details page
Post by: masterred on February 08, 2008, 05:48:38 AM
hi

this MOD work with 4images 1.7.6 for the links or image it´s bad or change

Teaches changed pictures, if I want to watch the image of someone else, showing rises by the administrator, namely mine, the name of the image does not correspond to that is watching, the image is called DIY 7, the previous image called mistake and I DIY above the previous image.

image 7 call bricolage

 (http://www.imagehosting.com/out.php/t1563763_7.jpg) (http://www.imagehosting.com/out.php/i1563763_7.jpg)

and you see after image in this photo

 (http://www.imagehosting.com/out.php/i1563766_71.jpg) (http://www.imagehosting.com/out.php/i1563766_71.jpg)

after image not call bricolage you name is error

2- If I click from page categories in the image of this photo I taught rise by another user, but I am trying not to look

image 7_2 click in this photo and show other

 (http://www.imagehosting.com/out.php/t1563778_72.jpg) (http://www.imagehosting.com/out.php/i1563778_72.jpg)

see this photo

 (http://www.imagehosting.com/out.php/t1563781_73.jpg) (http://www.imagehosting.com/out.php/i1563781_73.jpg)

Everything is reversed ,Because.

thank



Title: Re: [MOD] - See other upload images by uploader from details page
Post by: bazalt on June 25, 2008, 04:41:47 AM
Yes, same bug :(
Title: Re: [MOD] - See other upload images by uploader from details page
Post by: jotabonfim on June 28, 2008, 05:10:02 PM
hi
i have this error

 (http://www.imagehosting.com/out.php/t1434944_1.jpg) (http://www.imagehosting.com/out.php/i1434944_1.jpg)

the image girl at room is the image_id=2 (otro) and the direction bar show the image_id=1 (Princess room)

when doing click in the image http://localhost/4images/details.php?image_id=1
leaves the image http://localhost/4images/details.php?image_id=2
to me and not the one that corresponds thanks
thanks


This error also present in version 1.7.6.
This module is a bug!