- Posts: 2
COMMUNITY FORUM
Images in search results
- Nireas Theodorakopoulos
- Offline
- New Member
Less
More
13 years 2 months ago #93529
by Nireas Theodorakopoulos
Replied by Nireas Theodorakopoulos on topic Images in search results
Thank you so much for the solution. Works Great!! You saved my day!
jjozsika said:
Hello! i've found a solution:
You have the search mod which is searching in the table.
Located: plugins/search/jak2_filter.php
It has the SQL query with binary search, you have to add the id field to the selected list:
In the 231. line oyou have to add the id field name:
$query = " SELECT i.id, i.title, i.metadesc,
Now, you can go and edit the result lister tamplate:
/templates/gk_mystore/html/com_search/search/default_results.php
After the result cycle,
<?php foreach ($this->results as $result) : ?>
You can add the image generation based pn the id and md5() hash:
<?php $row = './media/k2/items/cache/'.md5("Image".$result->id).'_S.jpg'; if(file_exists($row)) echo "<img src=\"$row\">";?>
And woala, the images right there!
regards, jjozsi
jjozsika said:
Hello! i've found a solution:
You have the search mod which is searching in the table.
Located: plugins/search/jak2_filter.php
It has the SQL query with binary search, you have to add the id field to the selected list:
In the 231. line oyou have to add the id field name:
$query = " SELECT i.id, i.title, i.metadesc,
Now, you can go and edit the result lister tamplate:
/templates/gk_mystore/html/com_search/search/default_results.php
After the result cycle,
<?php foreach ($this->results as $result) : ?>
You can add the image generation based pn the id and md5() hash:
<?php $row = './media/k2/items/cache/'.md5("Image".$result->id).'_S.jpg'; if(file_exists($row)) echo "<img src=\"$row\">";?>
And woala, the images right there!
regards, jjozsi
Please Log in or Create an account to join the conversation.
- Jock
- Offline
- Premium Member
Less
More
- Posts: 90
13 years 2 months ago #93530
by Jock
Replied by Jock on topic Images in search results
Anyone know if you can return the results snippet from the extra fields?
Please Log in or Create an account to join the conversation.
- jorge mejia gallegos
- Offline
- Junior Member
Less
More
- Posts: 25
13 years 1 month ago #93531
by jorge mejia gallegos
Replied by jorge mejia gallegos on topic Images in search results
i went ahead and added:
$query = " SELECT i.id, i.title, i.extra_fields
and i can access extrafield id and value this way, i can't figure out now how to get the extra field label so i can display all the extrafields on my search results. anyone has an idea? it would really make my day!
thanks in advance
$query = " SELECT i.id, i.title, i.extra_fields
and i can access extrafield id and value this way, i can't figure out now how to get the extra field label so i can display all the extrafields on my search results. anyone has an idea? it would really make my day!
thanks in advance
Please Log in or Create an account to join the conversation.
- kobiavr
- Offline
- New Member
Less
More
- Posts: 4
11 years 2 months ago #93532
by kobiavr
Replied by kobiavr on topic Re: Images in search results
Unfortunately it does not work in version v2.6.6
Please Log in or Create an account to join the conversation.