• [MOD] similar images 4 0 5 1
Currently:  

Author Topic: [MOD] similar images  (Read 58592 times)

0 Members and 1 Guest are viewing this topic.

Offline dp

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: [MOD] similar images
« Reply #15 on: June 08, 2011, 08:51:00 AM »
Thanks for such a nice MOD.  8)

one request, can we control the number of rows and columns, not from ACP bcoz that changes the whole gallery i want to change number of rows and column for the similar images only..
In my case i've 4 rows with no columns in categories page, but in details page i want to show the similar images in 2 rows and 3 columns.
thanks.

To achive this you have to replace the $config['...']-variables with simple values and change the total numbers of displayed images.

So in details.php and only in the MOD's code find:
<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">
and replace e.g. with:
<table width='50%' border='0' cellpadding='2' cellspacing='4'>
This has to be done at 3 different places. Note: the values given are just examples, you are hard-coding html, adapt it to your needs.


Find:
if ($count == $config['image_cells']) {
Replace with:
if ($count == 2) {

Find:
$leftover = ($config['image_cells'] - $count);
Replace with:
$leftover = ($count);
2 is the number of rows.


At
if ($i_ids 4$i_ids 4;
set the maximum of displayed images. 2 rows and 3 colums will have 2x3=6 images. For your example change it to:
if ($i_ids 6$i_ids 6;

Good luck!

Offline khansahib

  • Full Member
  • ***
  • Posts: 100
    • View Profile
Re: [MOD] similar images
« Reply #16 on: June 08, 2011, 01:24:21 PM »
its working...
Thanks Alot... :D

Offline jotabonfim

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Re: [MOD] similar images
« Reply #17 on: June 09, 2011, 09:52:36 PM »
god idea

tks :) :) :) :) :) :)


Thanks for such a nice MOD.  8)

one request, can we control the number of rows and columns, not from ACP bcoz that changes the whole gallery i want to change number of rows and column for the similar images only..
In my case i've 4 rows with no columns in categories page, but in details page i want to show the similar images in 2 rows and 3 columns.
thanks.

To achive this you have to replace the $config['...']-variables with simple values and change the total numbers of displayed images.

So in details.php and only in the MOD's code find:
<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">
and replace e.g. with:
<table width='50%' border='0' cellpadding='2' cellspacing='4'>
This has to be done at 3 different places. Note: the values given are just examples, you are hard-coding html, adapt it to your needs.


Find:
if ($count == $config['image_cells']) {
Replace with:
if ($count == 2) {

Find:
$leftover = ($config['image_cells'] - $count);
Replace with:
$leftover = ($count);
2 is the number of rows.


At
if ($i_ids 4$i_ids 4;
set the maximum of displayed images. 2 rows and 3 colums will have 2x3=6 images. For your example change it to:
if ($i_ids 6$i_ids 6;

Good luck!

Offline sunl

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: [MOD] similar images
« Reply #18 on: December 07, 2011, 10:30:07 PM »
Good MOD

But when use more keywords images didn't show, even i lower the values. So i try to add category instead keywords but could not figure it out. Anyone know how to do this?

Offline dp

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: [MOD] similar images
« Reply #19 on: December 08, 2011, 09:13:43 AM »
So i try to add category instead keywords but could not figure it out. Anyone know how to do this?

This dosn't make sense, I think. Based on categories all images of the same category are similar. Self-evident, isn't it? To do so, you simply can use the categories template tags.

Mod similar images does not complex analysis of image description or keywords, it just uses php-own string comparison. So the results strongly depends on the quality of your metadata. If you don't use controlled vocabulary and consistent structure or systematic, results will be unsatisfying. For my experience only less galery operators pay attention to metadata, but metadata are the key to any information processing. To get proper results with this mod, set up your image description and keywords with controlled vocabulary and consistent structure first. This can be very time-expensive, but there's no other way.

Offline sunl

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: [MOD] similar images
« Reply #20 on: December 08, 2011, 12:47:52 PM »
Yes, It must show all images of category eg: Nature.

Actually i already use keywords in gallery and with those keywords it not working. So i thought it will be good if i use category instead keywords to show similar images from particular category. So i try to replace keyword tag with category tag but its not worked i think i am missing where  actually to put category tag.

If i use it, as it is, then i have to edit all images and its very hard work.

To show images from particular category i think category tag is good option.

Can you tell how to replace  keyword tag with category tag?

Offline dp

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: [MOD] similar images
« Reply #21 on: December 08, 2011, 01:08:51 PM »
Can you tell how to replace  keyword tag with category tag?

I'm sorry, but this mod performes a special database query on description or keywords. To show all images of a single category, you don't need any mod, just use the normal 4images template tags in your template.

Offline uploadeur

  • Newbie
  • *
  • Posts: 47
    • View Profile
Re: [MOD] similar images
« Reply #22 on: February 28, 2012, 02:39:46 AM »
I need an easier trick;

i need a trick(at left sidebar) which shows 5 or 10 random images from current category.

any ideas?

Offline dp

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: [MOD] similar images
« Reply #23 on: February 28, 2012, 07:34:23 AM »
I need an easier trick;

i need a trick(at left sidebar) which shows 5 or 10 random images from current category.

any ideas?

You can use V@tno's Mod Random pictures and fit it to your needs: http://www.4homepages.de/forum/index.php?topic=4259.msg17513#msg17513

Offline uploadeur

  • Newbie
  • *
  • Posts: 47
    • View Profile
Re: [MOD] similar images
« Reply #24 on: February 28, 2012, 02:03:02 PM »
I need an easier trick;

i need a trick(at left sidebar) which shows 5 or 10 random images from current category.

any ideas?

You can use V@tno's Mod Random pictures and fit it to your needs: http://www.4homepages.de/forum/index.php?topic=4259.msg17513#msg17513


i think i need a easier trick to do this.

Offline dp

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: [MOD] similar images
« Reply #25 on: February 28, 2012, 02:09:20 PM »
i think i need a easier trick to do this.

Well, you defenitly need to perform a database query on the current category and display the result in the propriate way. The only thing that's easier as v@tno's mod is, to look for a programmer and pay for its work.

Offline uploadeur

  • Newbie
  • *
  • Posts: 47
    • View Profile
Re: [MOD] similar images
« Reply #26 on: February 28, 2012, 03:35:52 PM »
i think i need a easier trick to do this.

Well, you defenitly need to perform a database query on the current category and display the result in the propriate way. The only thing that's easier as v@tno's mod is, to look for a programmer and pay for its work.

i just tried v@tno's code but didnt work :(

Offline dp

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: [MOD] similar images
« Reply #27 on: February 28, 2012, 03:58:07 PM »
i just tried v@tno's code but didnt work :(

All I can say is, v@tno's mods a pretty good and reliable and I'm using this particular one at my own galery - without problems. Working at 4images core files and modifying them to my needs have been my first experiences in coding php and I had to learn a lot, mostly by trial and error. If you are not familiar with php, this will be the hard way.

Post your problems at the given thread, v@tno for sure will give you kind assistance.

Offline uploadeur

  • Newbie
  • *
  • Posts: 47
    • View Profile
Re: [MOD] similar images
« Reply #28 on: February 29, 2012, 01:22:13 AM »
and your similar images, didnt work for me, i have no english folder in lang folder, maybe problem is this?

Offline dp

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: [MOD] similar images
« Reply #29 on: February 29, 2012, 07:57:01 AM »
and your similar images, didnt work for me, i have no english folder in lang folder, maybe problem is this?

main.php in folder lang/english just contains the variable for the heading "similar images". If it's not declared and set, only this output should miss, image thumbs should still be there.

Can you describe more detailed your problem?