-
AuthorPosts
-
thangnn1510 Friend
thangnn1510
- Join date:
- October 2014
- Posts:
- 1608
- Downloads:
- 0
- Uploads:
- 80
- Thanks:
- 73
- Thanked:
- 278 times in 256 posts
July 23, 2011 at 2:36 am #402608Thanks for giving me all the info. After checking this is our solution. In the case of select extrafield you should add this code:
<div class="detallename"><?php echo JText::_('Transacción'); ?>:<span><?php
$db = &JFactory::getDBO();
$query = "SELECT * FROM #__k2_items WHERE id=".$result->id;
$db->setQuery($query);
$items = $db->loadObjectList();
if(count($items)>0){
foreach($items as $item){
$item = json_decode($item->extra_fields);
$query = "SELECT value FROM #__k2_extra_fields WHERE id=".$item[9]->id;
$db->setQuery($query);
$value = $db->loadResult();
$values = json_decode($value);
foreach($item[9]->value as $k){
if(count($values)>0){
foreach($values as $value){
if($value->value == $k){
echo $value->name."<br>";
}
}
}
}
}
}
?></span></div>
</div>I have changed it in your site. Others could use this similar code to apply to your site.
Thanks and tell me if you need more help.
jakkraphong Friendjakkraphong
- Join date:
- July 2011
- Posts:
- 45
- Downloads:
- 0
- Uploads:
- 4
- Thanks:
- 3
- Thanked:
- 1 times in 1 posts
July 26, 2011 at 8:10 pm #403182where to put extrafield ids?
thangnn1510 Friendthangnn1510
- Join date:
- October 2014
- Posts:
- 1608
- Downloads:
- 0
- Uploads:
- 80
- Thanks:
- 73
- Thanked:
- 278 times in 256 posts
July 27, 2011 at 4:27 am #403233<em>@jakkraphong 255789 wrote:</em><blockquote>where to put extrafield ids?</blockquote>
Could you explain more about your question? I don’t understand it much.
jakkraphong Friendjakkraphong
- Join date:
- July 2011
- Posts:
- 45
- Downloads:
- 0
- Uploads:
- 4
- Thanks:
- 3
- Thanked:
- 1 times in 1 posts
August 17, 2011 at 7:14 pm #406767<em>@thangnn1510 255070 wrote:</em><blockquote>Thanks for giving me all the info. After checking this is our solution. In the case of select extrafield you should add this code:
<div class="detallename"><?php echo JText::_('Transacción'); ?>:<span><?php
$db = &JFactory::getDBO();
$query = "SELECT * FROM #__k2_items WHERE id=".$result->id;
$db->setQuery($query);
$items = $db->loadObjectList();
if(count($items)>0){
foreach($items as $item){
$item = json_decode($item->extra_fields);
$query = "SELECT value FROM #__k2_extra_fields WHERE id=".$item[9]->id;
$db->setQuery($query);
$value = $db->loadResult();
$values = json_decode($value);
foreach($item[9]->value as $k){
if(count($values)>0){
foreach($values as $value){
if($value->value == $k){
echo $value->name."<br>";
}
}
}
}
}
}
?></span></div>
</div>I have changed it in your site. Others could use this similar code to apply to your site.
Thanks and tell me if you need more help.</blockquote>
i copied that into my default_result.php…. nothing happened… 🙁 i just would like the extra fields to appear side by side to the search result images, how can i do that? please heeeeeeeelp :laugh:
November 7, 2011 at 3:17 pm #423553i need the same results
is not possible to show k2 default search template? why?
i’ve try to edit k2 filter php form query but doesn’t work..
how can i create a query like this?
index.php?searchword=custom+search&ordering=&searchphrase=all&areas[0]=jak2_filter&option=com_k2&task=search&view=itemlist
that’s what many user want 🙂
-
AuthorPosts
This topic contains 35 replies, has 8 voices, and was last updated by espertoseo 13 years ago.
We moved to new unified forum. Please post all new support queries in our New Forum