Keyword

Advanced Search

Search Results (Searched for: extra field order)

  • Marc
  • Marc's Avatar
21 Dec 2011 18:17

How to order cat item view by extra field value

Category: English K2 Community

Did you ever find a way to do this? I think if you could list items in asc or desc order according to the Extra field (date) you could then list events and open K2 up to a whole new area away from blogposts and products.
  • Brian
  • Brian's Avatar
22 Nov 2011 00:24

How to order cat item view by extra field value

Category: English K2 Community

I have an extra fields > date field that I want to order my category item view with. How do I go about doing that?
  • Tijuana Mou Cartelli
  • Tijuana Mou Cartelli's Avatar
03 Nov 2011 14:59
Suggestion - Order Extra Fields in Alphabeticall O was created by Tijuana Mou Cartelli

Suggestion - Order Extra Fields in Alphabeticall O

Category: English K2 Community

Hi! Maybe it could be a good idea to give the possibility to order A/Z contents in extra fields :cheer:

Byee!
  • Marc
  • Marc's Avatar
26 Oct 2011 00:57

Creating table for extra fields help

Category: English K2 Community

Can someone please look at the following code for me please, the logic is right for 2 extra fields and I have echo 'New Row' and echo 'close row' in it so I know it should all be on one row, but for some reason it still is creating 2 new rows for the 2 extra fields.
 <!-- Item extra fields --> <?php $table = '<table width="100%" border="0">'; ?> <?php $counter = 0; ?> <?php $total1 = count($this->item->extra_fields); ?> <?php if($this->item->params->get('catItemExtraFields') && count($this->item->extra_fields)): ?> <!-- Item extra fields --> <?php $columns = 2; ?> <div class="catItemExtraFields"> <h4><?php echo JText::_('K2_ADDITIONAL_INFO'); ?></h4> <ul> <?php foreach ($this->item->extra_fields as $key=>$extraField) : ?> <?php if($extraField->value) : ?> <?php $counter++; ?> <?php if ($counter%$columns == 1) : ?> <?php echo 'New Row'; ?> <?php '<tr>\n'; ?> <?php endif ; ?> <li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?>"> </li> <?php 'td width ="95px"' ; ?> <span class="catItemExtraFieldsLabel"><?php echo $extraField->name; ?></span> <span class="catItemExtraFieldsValue"><?php echo $extraField->value; ?></span> <?php '</td>' ; ?> <?php if ($counter%$columns == 0): ?> <?php echo 'Close Row'; ?> <?php '</tr>' ?> <?php endif ; ?> <?php endif; ?> <?php endforeach; ?> <?php $table .= '</table>'; ?> </ul> <div class="clr"></div> </div> <?php endif; ?> 
  • richard frederick vincent
  • richard frederick vincent's Avatar
25 Oct 2011 22:03 - 25 Oct 2011 22:43
Cant save categories Unknown column 'language' was created by richard frederick vincent

Cant save categories Unknown column 'language'

Category: English K2 Community

Urgent please

Hello, after upgrading i tried to edit an existing category but then i got this message

TableK2Category: :store failed
Unknown column 'language' in 'field list' SQL=UPDATE `americas_k2_categories` SET `name`='National Post',`alias`='national-post',`description`='',`parent`='128',`extraFieldsGroup`='0',`published`='1',`access`='1',`params`='{\"inheritFrom\":\"9\",\"theme\":\"\",\"num_leading_items\":\"2\",\"num_leading_columns\":\"1\",\"leadingImgSize\":\"Large\",\"num_primary_items\":\"4\",\"num_primary_columns\":\"2\",\"primaryImgSize\":\"Medium\",\"num_secondary_items\":\"4\",\"num_secondary_columns\":\"1\",\"secondaryImgSize\":\"Small\",\"num_links\":\"4\",\"num_links_columns\":\"1\",\"linksImgSize\":\"XSmall\",\"catCatalogMode\":\"0\",\"catFeaturedItems\":\"1\",\"catOrdering\":\"\",\"catPagination\":\"2\",\"catPaginationResults\":\"1\",\"catTitle\":\"1\",\"catTitleItemCounter\":\"1\",\"catDescription\":\"1\",\"catImage\":\"1\",\"catFeedLink\":\"1\",\"feedLink\":\"1\",\"subCategories\":\"1\",\"subCatColumns\":\"2\",\"subCatOrdering\":\"\",\"subCatTitle\":\"1\",\"subCatTitleItemCounter\":\"1\",\"subCatDescription\":\"1\",\"subCatImage\":\"1\",\"itemImageXS\":\"\",\"itemImageS\":\"\",\"itemImageM\":\"\",\"itemImageL\":\"\",\"itemImageXL\":\"\",\"catItemTitle\":\"1\",\"catItemTitleLinked\":\"1\",\"catItemFeaturedNotice\":\"0\",\"catItemAuthor\":\"1\",\"catItemDateCreated\":\"1\",\"catItemRating\":\"0\",\"catItemImage\":\"1\",\"catItemIntroText\":\"1\",\"catItemIntroTextWordLimit\":\"\",\"catItemExtraFields\":\"0\",\"catItemHits\":\"0\",\"catItemCategory\":\"1\",\"catItemTags\":\"1\",\"catItemAttachments\":\"0\",\"catItemAttachmentsCounter\":\"0\",\"catItemVideo\":\"0\",\"catItemVideoWidth\":\"\",\"catItemVideoHeight\":\"\",\"catItemAudioWidth\":\"\",\"catItemAudioHeight\":\"\",\"catItemVideoAutoPlay\":\"0\",\"catItemImageGallery\":\"0\",\"catItemDateModified\":\"0\",\"catItemReadMore\":\"1\",\"catItemCommentsAnchor\":\"1\",\"catItemK2Plugins\":\"1\",\"itemDateCreated\":\"1\",\"itemTitle\":\"1\",\"itemFeaturedNotice\":\"1\",\"itemAuthor\":\"1\",\"itemFontResizer\":\"1\",\"itemPrintButton\":\"1\",\"itemEmailButton\":\"1\",\"itemSocialButton\":\"1\",\"itemVideoAnchor\":\"1\",\"itemImageGalleryAnchor\":\"1\",\"itemCommentsAnchor\":\"1\",\"itemRating\":\"1\",\"itemImage\":\"1\",\"itemImgSize\":\"Large\",\"itemImageMainCaption\":\"1\",\"itemImageMainCredits\":\"1\",\"itemIntroText\":\"1\",\"itemFullText\":\"1\",\"itemExtraFields\":\"1\",\"itemDateModified\":\"1\",\"itemHits\":\"1\",\"itemCategory\":\"1\",\"itemTags\":\"1\",\"itemAttachments\":\"1\",\"itemAttachmentsCounter\":\"1\",\"itemVideo\":\"1\",\"itemVideoWidth\":\"\",\"itemVideoHeight\":\"\",\"itemAudioWidth\":\"\",\"itemAudioHeight\":\"\",\"itemVideoAutoPlay\":\"0\",\"itemVideoCaption\":\"1\",\"itemVideoCredits\":\"1\",\"itemImageGallery\":\"1\",\"itemNavigation\":\"1\",\"itemComments\":\"1\",\"itemTwitterButton\":\"1\",\"itemFacebookButton\":\"1\",\"itemGooglePlusOneButton\":\"1\",\"itemAuthorBlock\":\"1\",\"itemAuthorImage\":\"1\",\"itemAuthorDescription\":\"1\",\"itemAuthorURL\":\"1\",\"itemAuthorEmail\":\"0\",\"itemAuthorLatest\":\"1\",\"itemAuthorLatestLimit\":\"5\",\"itemRelated\":\"1\",\"itemRelatedLimit\":\"5\",\"itemRelatedTitle\":\"1\",\"itemRelatedCategory\":\"0\",\"itemRelatedImageSize\":\"0\",\"itemRelatedIntrotext\":\"0\",\"itemRelatedFulltext\":\"0\",\"itemRelatedAuthor\":\"0\",\"itemRelatedMedia\":\"0\",\"itemRelatedImageGallery\":\"0\",\"itemK2Plugins\":\"1\",\"catMetaDesc\":\"\",\"catMetaKey\":\"\",\"catMetaRobots\":\"\",\"catMetaAuthor\":\"\"}',`language`='*' WHERE `id`='452'


meaning i cannot edit my categories anymore
  • Garzarath
  • Garzarath's Avatar
20 Oct 2011 08:04
Replied by Garzarath on topic add extra field with example plugin

add extra field with example plugin

Category: English K2 Community

Hi Jsmith,

Can you share the plugin with the community?
In order to solve my problem about relating k2 items I maybe will use an extended field.
I will save time if I can take a look on your plugin.

Thanks

Note: If I do it Iwill share mine too
  • jmcruznet
  • jmcruznet's Avatar
19 Sep 2011 14:54

How to make ordered/unordered list in k2extrafields?

Category: English K2 Community

I have

Amenities:


List One
List Two
List Three

Landmarks:


List One
List Two
List Three

Actually I might have 3 to 5 List. But if you could give me sample on how to code the list above, I can use them as my guide. Thanks again.
  • william white
  • william white's Avatar
19 Sep 2011 14:49
Replied by william white on topic How to make ordered/unordered list in k2extrafields?

How to make ordered/unordered list in k2extrafields?

Category: English K2 Community

I see, didnt know you had other lists you wanted to display....You will probably have to extract the extra fields one by one for this in an override...How many fields do you have, how are they gruped, and what are their names?
  • jmcruznet
  • jmcruznet's Avatar
19 Sep 2011 14:43

How to make ordered/unordered list in k2extrafields?

Category: English K2 Community

But that will comment out all extrafields labels? I might have two unordered list like "Amenities List" and "Floor List"
  • william white
  • william white's Avatar
19 Sep 2011 14:13
Replied by william white on topic How to make ordered/unordered list in k2extrafields?

How to make ordered/unordered list in k2extrafields?

Category: English K2 Community

Create an override.

Just above the foreach tht displays extra fields in item.php echo "Amenities"

Comment out the line in the foreach loop that displays the name of the extra fields and only display the value

This will be close to what you want i think.
  • jmcruznet
  • jmcruznet's Avatar
19 Sep 2011 13:58

How to make ordered/unordered list in k2extrafields?

Category: English K2 Community

How to make ordered/unordered list in k2extrafields?

I want to make something like this:

Amenities:

. List one

. List two

. List three
  • Jock
  • Jock's Avatar
19 Sep 2011 11:40
Replied by Jock on topic Joomla search and extra fields

Joomla search and extra fields

Category: English K2 Community

I sure can:

 

tinyurl.com/6drzd4o

 

If you run a search for "test" you will see the 1st 16 results are from extra fields and therefore don't have a snippet. The last 4 results are where the search term is in the content tab area and NOT the extra fields (thus the snippet showing up).I appreciate your help Simon, perhaps some modification of the php is in order?

 
  • that library
  • that library's Avatar
08 Sep 2011 18:21

k2_categories table has no language field in db - Joomla 1.6 with K2 SVN 2.5(RC)

Category: English K2 Community

I finally got upgraded (via Jupgrade) from Joomla v1.5.23 to 1.6.6, and installed the K2 SVN 2.5(RC) on the 1.6 site, which, thankfully is now acknowledged by J1.6 within the menu manager. This is a start but I'm having a strange issue that I hope someone can help me with:

 

I want to stress that the K2 content is in the j16_ database tables where it should be, I can see &amp; access it within the admin area of the 1.6 site, but it's just not showing up on the front end at all. I think the major reason for this is because:


Each category's access column in the database j16_k2_categories is set to 0 instead of 1, when I try to change this for the parent category, I get a big db error, because:
There is no column for language, so when I try to change anything in the parent category (from which all others inherit their parameters (or any category), I get the following error:

TableK2Category: :store failedUnknown column 'language' in 'field list' SQL=UPDATE `j16_k2_categories` SET `name`='Library',`alias`='library-main',`description`=' **description went here**

',`parent`='0',`extraFieldsGroup`='1',`published`='1',`access`='1',`params`='{\"inheritFrom\":\"0\",\"theme\":\"\",\"num_leading_items\":\"2\",\"num_leading_columns\":\"1\",\"leadingImgSize\":\"Large\",\"num_primary_items\":\"4\",\"num_primary_columns\":\"2\",\"primaryImgSize\":\"Medium\",\"num_secondary_items\":\"4\",\"num_secondary_columns\":\"1\",\"secondaryImgSize\":\"Small\",\"num_links\":\"4\",\"num_links_columns\":\"1\",\"linksImgSize\":\"XSmall\",\"catCatalogMode\":\"0\",\"catFeaturedItems\":\"1\",\"catOrdering\":\"\",\"catPagination\":\"2\",\"catPaginationResults\":\"1\",\"catTitle\":\"1\",\"catTitleItemCounter\":\"1\",\"catDescription\":\"1\",\"catImage\":\"1\",\"catFeedLink\":\"1\",\"feedLink\":\"1\",\"subCategories\":\"1\",\"subCatColumns\":\"2\",\"subCatOrdering\":\"\",\"subCatTitle\":\"1\",\"subCatTitleItemCounter\":\"1\",\"subCatDescription\":\"1\",\"subCatImage\":\"1\",\"itemImageXS\":\"\",\"itemImageS\":\"\",\"itemImageM\":\"\",\"itemImageL\":\"\",\"itemImageXL\":\"\",\"catItemTitle\":\"1\",\"catItemTitleLinked\":\"1\",\"catItemFeaturedNotice\":\"0\",\"catItemAuthor\":\"1\",\"catItemDateCreated\":\"1\",\"catItemRating\":\"0\",\"catItemImage\":\"1\",\"catItemIntroText\":\"1\",\"catItemIntroTextWordLimit\":\"\",\"catItemExtraFields\":\"0\",\"catItemHits\":\"0\",\"catItemCategory\":\"1\",\"catItemTags\":\"1\",\"catItemAttachments\":\"0\",\"catItemAttachmentsCounter\":\"0\",\"catItemVideo\":\"0\",\"catItemVideoWidth\":\"\",\"catItemVideoHeight\":\"\",\"catItemVideoAutoPlay\":\"0\",\"catItemImageGallery\":\"0\",\"catItemDateModified\":\"0\",\"catItemReadMore\":\"1\",\"catItemCommentsAnchor\":\"1\",\"catItemK2Plugins\":\"1\",\"itemDateCreated\":\"1\",\"itemTitle\":\"1\",\"itemFeaturedNotice\":\"1\",\"itemAuthor\":\"1\",\"itemFontResizer\":\"1\",\"itemPrintButton\":\"1\",\"itemEmailButton\":\"1\",\"itemSocialButton\":\"1\",\"itemVideoAnchor\":\"1\",\"itemImageGalleryAnchor\":\"1\",\"itemCommentsAnchor\":\"1\",\"itemRating\":\"1\",\"itemImage\":\"1\",\"itemImgSize\":\"Large\",\"itemImageMainCaption\":\"1\",\"itemImageMainCredits\":\"1\",\"itemIntroText\":\"1\",\"itemFullText\":\"1\",\"itemExtraFields\":\"1\",\"itemDateModified\":\"1\",\"itemHits\":\"1\",\"itemTwitterLink\":\"1\",\"itemCategory\":\"1\",\"itemTags\":\"1\",\"itemShareLinks\":\"1\",\"itemAttachments\":\"1\",\"itemAttachmentsCounter\":\"1\",\"itemRelated\":\"1\",\"itemRelatedLimit\":\"5\",\"itemVideo\":\"1\",\"itemVideoWidth\":\"\",\"itemVideoHeight\":\"\",\"itemVideoAutoPlay\":\"0\",\"itemVideoCaption\":\"1\",\"itemVideoCredits\":\"1\",\"itemImageGallery\":\"1\",\"itemNavigation\":\"1\",\"itemComments\":\"1\",\"itemAuthorBlock\":\"1\",\"itemAuthorImage\":\"1\",\"itemAuthorDescription\":\"1\",\"itemAuthorURL\":\"1\",\"itemAuthorEmail\":\"0\",\"itemAuthorLatest\":\"1\",\"itemAuthorLatestLimit\":\"5\",\"itemK2Plugins\":\"1\"}',`language`='en-GB' WHERE id='23'


Even with the seo-friendly links turned on, J1.6 has /en/ within the links, so the language field in the k2_categories has to exist.

 

So clearly I need to add another field to not only the K2 categories, but where would it go? What I mean is where should I insert this field within that db table (in between something, at the end)? And would the items be able to be seen (retrieved properly) if it is only in the categories table after that?

Or do I need to execute a SQL query to insert it into the k2_items table as well?

 

It is worth noting that I do have a number of languages installed, but even before I installed them, all Joomla! categories &amp; content are automatically listed as "Language - All." 

 

Can someone please help me out with this?

Bueller? Bueller?
  • Panagiotis Sakellariou
  • Panagiotis Sakellariou's Avatar
07 Sep 2011 03:06
How to add k2 rating to search results? was created by Panagiotis Sakellariou

How to add k2 rating to search results?

Category: English K2 Community

Hello all

 

I've been trying to customise my search results page and while I managed to load the rating system for any k2 items that appear in a search, it loads as if noone has voted, and when you click to vote, it then loads the correct amount of votes.

Below is my default_results.php (of joomla's com_search, template override).

 

&lt;?php defined('_JEXEC') or die('Restricted access'); ?&gt;&lt;?php    function getK2Images( $item)    {        jimport('joomla.filesystem.file');        //Image        $arr_return = array();        if (JFile::exists(JPATH_SITE.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.md5("Image".$item-&gt;id).'_XS.jpg'))        $arr_return = JURI::root().'media/k2/items/cache/'.md5("Image".$item-&gt;id).'_XS.jpg';        if (JFile::exists(JPATH_SITE.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.md5("Image".$item-&gt;id).'_S.jpg'))        $arr_return = JURI::root().'media/k2/items/cache/'.md5("Image".$item-&gt;id).'_S.jpg';        if (JFile::exists(JPATH_SITE.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.md5("Image".$item-&gt;id).'_M.jpg'))        $arr_return = JURI::root().'media/k2/items/cache/'.md5("Image".$item-&gt;id).'_M.jpg';        if (JFile::exists(JPATH_SITE.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.md5("Image".$item-&gt;id).'_L.jpg'))        $arr_return = JURI::root().'media/k2/items/cache/'.md5("Image".$item-&gt;id).'_L.jpg';        if (JFile::exists(JPATH_SITE.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.md5("Image".$item-&gt;id).'_XL.jpg'))        $arr_return = JURI::root().'media/k2/items/cache/'.md5("Image".$item-&gt;id).'_XL.jpg';        if (JFile::exists(JPATH_SITE.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.md5("Image".$item-&gt;id).'_Generic.jpg'))        $arr_return = JURI::root().'media/k2/items/cache/'.md5("Image".$item-&gt;id).'_Generic.jpg';                return $arr_return;    }?&gt;&lt;?php ?&gt;&lt;table class="contentpaneopen&lt;?php echo $this-&gt;escape($this-&gt;params-&gt;get('pageclass_sfx')); ?&gt;"&gt;    &lt;tr&gt;        &lt;td&gt;        &lt;?php        $db = JFactory::getDBO();                foreach( $this-&gt;results as $result ) : ?&gt;                        &lt;?php        $image ="";                if(isset($result-&gt;extra_fields_search))        {             $query = "                SELECT i.id,i.title,                i.metadesc,                i.featured,                i.featured_ordering,                i.metakey,                c.name as section,                i.image_caption,                i.image_credits,                i.video_caption,                i.video_credits,                i.extra_fields_search,                i.created,                i.introtext as text,                CASE WHEN CHAR_LENGTH(i.alias) THEN CONCAT_WS(':', i.id, i.alias) ELSE i.id END as slug,                CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(':', c.id, c.alias) ELSE c.id END as catslug                FROM #__k2_items AS i                INNER JOIN #__k2_categories AS c ON c.id=i.catid                 WHERE i.id = ". $result-&gt;id;            $db-&gt;setQuery($query);            $item = $db-&gt;loadObject();                    if(!empty($item))            {                    $arr_k2image = getK2Images($item);                $image = isset($arr_k2image["imageGeneric"])?$arr_k2image["imageGeneric"]:"";                            }        }                              ?&gt;            &lt;fieldset&gt;                &lt;div class="sea1"&gt;                    &lt;span class="small&lt;?php echo $this-&gt;escape($this-&gt;params-&gt;get('pageclass_sfx')); ?&gt;"&gt;                        &lt;?php echo $this-&gt;pagination-&gt;limitstart + $result-&gt;count.'. ';?&gt;                    &lt;/span&gt;                    &lt;?php if ( $result-&gt;href ) :                        if ($result-&gt;browsernav == 1 ) : ?&gt;                            &lt;a class="modal" rel="{handler:'iframe',size:{x:800,y:600}}" href="&lt;?php echo JRoute::_($result-&gt;href); ?&gt;?tmpl=component" target="_blank"&gt;                        &lt;?php else : ?&gt;                            &lt;a class="modal" rel="{handler:'iframe',size:{x:800,y:600}}" href="&lt;?php echo JRoute::_($result-&gt;href); ?&gt;?tmpl=component"&gt;                        &lt;?php endif;                        echo $this-&gt;escape($result-&gt;title);                        if ( $result-&gt;href ) : ?&gt;                            &lt;/a&gt;                        &lt;?php endif;                        if ( $result-&gt;section ) : ?&gt;                            &lt;br /&gt;                            &lt;span class="small&lt;?php echo $this-&gt;escape($this-&gt;params-&gt;get('pageclass_sfx')); ?&gt;"&gt;                                (&lt;?php echo $this-&gt;escape($result-&gt;section); ?&gt;)                            &lt;/span&gt;                        &lt;?php endif; ?&gt;                    &lt;?php endif; ?&gt;                &lt;/div&gt;                                &lt;!-- Item Rating --&gt;    &lt;div class="catItemRatingBlock"&gt;        &lt;span&gt;&lt;?php echo JText::_('Rate this item'); ?&gt;&lt;/span&gt;        &lt;div class="itemRatingForm"&gt;                &lt;ul class="itemRatingList"&gt;                &lt;li class="itemCurrentRating" id="itemCurrentRating&lt;?php echo $result-&gt;id; ?&gt;" style="width:&lt;?php echo $result-&gt;votingPercentage; ?&gt;%;"&gt;&lt;/li&gt;                &lt;li&gt;&lt;a href="#" rel="&lt;?php echo $result-&gt;id; ?&gt;" title="&lt;?php echo JText::_('1 star out of 5'); ?&gt;" class="one-star"&gt;1&lt;/a&gt;&lt;/li&gt;                &lt;li&gt;&lt;a href="#" rel="&lt;?php echo $result-&gt;id; ?&gt;" title="&lt;?php echo JText::_('2 stars out of 5'); ?&gt;" class="two-stars"&gt;2&lt;/a&gt;&lt;/li&gt;                &lt;li&gt;&lt;a href="#" rel="&lt;?php echo $result-&gt;id; ?&gt;" title="&lt;?php echo JText::_('3 stars out of 5'); ?&gt;" class="three-stars"&gt;3&lt;/a&gt;&lt;/li&gt;                &lt;li&gt;&lt;a href="#" rel="&lt;?php echo $result-&gt;id; ?&gt;" title="&lt;?php echo JText::_('4 stars out of 5'); ?&gt;" class="four-stars"&gt;4&lt;/a&gt;&lt;/li&gt;                &lt;li&gt;&lt;a href="#" rel="&lt;?php echo $result-&gt;id; ?&gt;" title="&lt;?php echo JText::_('5 stars out of 5'); ?&gt;" class="five-stars"&gt;5&lt;/a&gt;&lt;/li&gt;            &lt;/ul&gt;            &lt;div id="itemRatingLog&lt;?php echo $result-&gt;id; ?&gt;" class="itemRatingLog"&gt;&lt;?php echo $result-&gt;numOfvotes; ?&gt;&lt;/div&gt;            &lt;div class="clr"&gt;&lt;/div&gt;        &lt;/div&gt;        &lt;div class="clr"&gt;&lt;/div&gt;    &lt;/div&gt;                                &lt;?php                    if ( $result-&gt;featured == 1) : ?&gt;                    &lt;span class="feat"&gt;                        &lt;sup&gt;                            &lt;?php echo '&lt;img class="sear" src="/images/stories/featuredItem.png" title="Designer" alt="Designer" /&gt;'; ?&gt;                        &lt;/sup&gt;                    &lt;/span&gt;                &lt;?php endif; ?&gt;                            &lt;div&gt;                    &lt;div class="result_image"&gt;                    &lt;?php                        if(!empty($image))                        {                        ?&gt;&lt;a class="modal" rel="{handler:'iframe',size:{x:800,y:600}}" href="&lt;?php echo JRoute::_($result-&gt;href); ?&gt;?tmpl=component" title="&lt;?php echo $result-&gt;title;?&gt;"&gt;                        &lt;img class="search_image" src="&lt;?php echo $image; ?&gt;" alt="&lt;?php echo $result-&gt;title; ?&gt;"  width="200px" height="auto"/&gt;&lt;/a&gt;                        &lt;?php                        }                    ?&gt;                                                                    &lt;/div&gt;                                &lt;div class="catItemIntroText"&gt;                    &lt;?php echo JHTML::_('content.prepare', $result-&gt;text); ?&gt;                    &lt;/div&gt;                                    &lt;/div&gt;                                                            &lt;/fieldset&gt;        &lt;?php endforeach; ?&gt;        &lt;/td&gt;    &lt;/tr&gt;    &lt;tr&gt;        &lt;td colspan="3"&gt;            &lt;div align="center"&gt;                &lt;?php echo $this-&gt;pagination-&gt;getPagesLinks( ); ?&gt;            &lt;/div&gt;        &lt;/td&gt;    &lt;/tr&gt;&lt;/table&gt;
 

 

I believe the problem is at line 116  and 123, and more specifically the votingPercentage @ line 116 and the numOfvotes @ line 123. (I have bolded the 2 lines of code).

 

How can I fix that? Any help will be greatly appreciated.

 

p.s. The code above contains hacks to show the item's image with a link, open title link and image link as popup, show the featured notice-graphic(if there is one), load content plugins that are being invoked with tags in introtext, show only introtext with full HTML and some more that I can't remember,

 

feel free to copy at will.
  • Panagiotis Sakellariou
  • Panagiotis Sakellariou's Avatar
07 Sep 2011 03:02
Rating/Voting in Joomla Search Results was created by Panagiotis Sakellariou

Rating/Voting in Joomla Search Results

Category: English K2 Community

Hello all

 

I've been trying to customise my search results page and while I managed to load the rating system for any k2 items that appear in a search, it loads as if noone has voted, and when you click to vote, it then loads the correct amount of votes.

Below is my default_results.php (of joomla's com_search, template override).

 

&lt;?php defined('_JEXEC') or die('Restricted access'); ?&gt;&lt;?php    function getK2Images( $item)    {        jimport('joomla.filesystem.file');        //Image        $arr_return = array();        if (JFile::exists(JPATH_SITE.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.md5("Image".$item-&gt;id).'_XS.jpg'))        $arr_return = JURI::root().'media/k2/items/cache/'.md5("Image".$item-&gt;id).'_XS.jpg';        if (JFile::exists(JPATH_SITE.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.md5("Image".$item-&gt;id).'_S.jpg'))        $arr_return = JURI::root().'media/k2/items/cache/'.md5("Image".$item-&gt;id).'_S.jpg';        if (JFile::exists(JPATH_SITE.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.md5("Image".$item-&gt;id).'_M.jpg'))        $arr_return = JURI::root().'media/k2/items/cache/'.md5("Image".$item-&gt;id).'_M.jpg';        if (JFile::exists(JPATH_SITE.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.md5("Image".$item-&gt;id).'_L.jpg'))        $arr_return = JURI::root().'media/k2/items/cache/'.md5("Image".$item-&gt;id).'_L.jpg';        if (JFile::exists(JPATH_SITE.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.md5("Image".$item-&gt;id).'_XL.jpg'))        $arr_return = JURI::root().'media/k2/items/cache/'.md5("Image".$item-&gt;id).'_XL.jpg';        if (JFile::exists(JPATH_SITE.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.md5("Image".$item-&gt;id).'_Generic.jpg'))        $arr_return = JURI::root().'media/k2/items/cache/'.md5("Image".$item-&gt;id).'_Generic.jpg';                return $arr_return;    }?&gt;&lt;?php ?&gt;&lt;table class="contentpaneopen&lt;?php echo $this-&gt;escape($this-&gt;params-&gt;get('pageclass_sfx')); ?&gt;"&gt;    &lt;tr&gt;        &lt;td&gt;        &lt;?php        $db = JFactory::getDBO();                foreach( $this-&gt;results as $result ) : ?&gt;                        &lt;?php        $image ="";                if(isset($result-&gt;extra_fields_search))        {             $query = "                SELECT i.id,i.title,                i.metadesc,                i.featured,                i.featured_ordering,                i.metakey,                c.name as section,                i.image_caption,                i.image_credits,                i.video_caption,                i.video_credits,                i.extra_fields_search,                i.created,                i.introtext as text,                CASE WHEN CHAR_LENGTH(i.alias) THEN CONCAT_WS(':', i.id, i.alias) ELSE i.id END as slug,                CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(':', c.id, c.alias) ELSE c.id END as catslug                FROM #__k2_items AS i                INNER JOIN #__k2_categories AS c ON c.id=i.catid                 WHERE i.id = ". $result-&gt;id;            $db-&gt;setQuery($query);            $item = $db-&gt;loadObject();                    if(!empty($item))            {                    $arr_k2image = getK2Images($item);                $image = isset($arr_k2image["imageGeneric"])?$arr_k2image["imageGeneric"]:"";                            }        }                              ?&gt;            &lt;fieldset&gt;                &lt;div class="sea1"&gt;                    &lt;span class="small&lt;?php echo $this-&gt;escape($this-&gt;params-&gt;get('pageclass_sfx')); ?&gt;"&gt;                        &lt;?php echo $this-&gt;pagination-&gt;limitstart + $result-&gt;count.'. ';?&gt;                    &lt;/span&gt;                    &lt;?php if ( $result-&gt;href ) :                        if ($result-&gt;browsernav == 1 ) : ?&gt;                            &lt;a class="modal" rel="{handler:'iframe',size:{x:800,y:600}}" href="&lt;?php echo JRoute::_($result-&gt;href); ?&gt;?tmpl=component" target="_blank"&gt;                        &lt;?php else : ?&gt;                            &lt;a class="modal" rel="{handler:'iframe',size:{x:800,y:600}}" href="&lt;?php echo JRoute::_($result-&gt;href); ?&gt;?tmpl=component"&gt;                        &lt;?php endif;                        echo $this-&gt;escape($result-&gt;title);                        if ( $result-&gt;href ) : ?&gt;                            &lt;/a&gt;                        &lt;?php endif;                        if ( $result-&gt;section ) : ?&gt;                            &lt;br /&gt;                            &lt;span class="small&lt;?php echo $this-&gt;escape($this-&gt;params-&gt;get('pageclass_sfx')); ?&gt;"&gt;                                (&lt;?php echo $this-&gt;escape($result-&gt;section); ?&gt;)                            &lt;/span&gt;                        &lt;?php endif; ?&gt;                    &lt;?php endif; ?&gt;                &lt;/div&gt;                                &lt;!-- Item Rating --&gt;    &lt;div class="catItemRatingBlock"&gt;        &lt;span&gt;&lt;?php echo JText::_('Rate this item'); ?&gt;&lt;/span&gt;        &lt;div class="itemRatingForm"&gt;                &lt;ul class="itemRatingList"&gt;                &lt;li class="itemCurrentRating" id="itemCurrentRating&lt;?php echo $result-&gt;id; ?&gt;" style="width:&lt;?php echo $result-&gt;votingPercentage; ?&gt;%;"&gt;&lt;/li&gt;                &lt;li&gt;&lt;a href="#" rel="&lt;?php echo $result-&gt;id; ?&gt;" title="&lt;?php echo JText::_('1 star out of 5'); ?&gt;" class="one-star"&gt;1&lt;/a&gt;&lt;/li&gt;                &lt;li&gt;&lt;a href="#" rel="&lt;?php echo $result-&gt;id; ?&gt;" title="&lt;?php echo JText::_('2 stars out of 5'); ?&gt;" class="two-stars"&gt;2&lt;/a&gt;&lt;/li&gt;                &lt;li&gt;&lt;a href="#" rel="&lt;?php echo $result-&gt;id; ?&gt;" title="&lt;?php echo JText::_('3 stars out of 5'); ?&gt;" class="three-stars"&gt;3&lt;/a&gt;&lt;/li&gt;                &lt;li&gt;&lt;a href="#" rel="&lt;?php echo $result-&gt;id; ?&gt;" title="&lt;?php echo JText::_('4 stars out of 5'); ?&gt;" class="four-stars"&gt;4&lt;/a&gt;&lt;/li&gt;                &lt;li&gt;&lt;a href="#" rel="&lt;?php echo $result-&gt;id; ?&gt;" title="&lt;?php echo JText::_('5 stars out of 5'); ?&gt;" class="five-stars"&gt;5&lt;/a&gt;&lt;/li&gt;            &lt;/ul&gt;            &lt;div id="itemRatingLog&lt;?php echo $result-&gt;id; ?&gt;" class="itemRatingLog"&gt;&lt;?php echo $result-&gt;numOfvotes; ?&gt;&lt;/div&gt;            &lt;div class="clr"&gt;&lt;/div&gt;        &lt;/div&gt;        &lt;div class="clr"&gt;&lt;/div&gt;    &lt;/div&gt;                                &lt;?php                    if ( $result-&gt;featured == 1) : ?&gt;                    &lt;span class="feat"&gt;                        &lt;sup&gt;                            &lt;?php echo '&lt;img class="sear" src="/images/stories/featuredItem.png" title="Designer" alt="Designer" /&gt;'; ?&gt;                        &lt;/sup&gt;                    &lt;/span&gt;                &lt;?php endif; ?&gt;                            &lt;div&gt;                    &lt;div class="result_image"&gt;                    &lt;?php                        if(!empty($image))                        {                        ?&gt;&lt;a class="modal" rel="{handler:'iframe',size:{x:800,y:600}}" href="&lt;?php echo JRoute::_($result-&gt;href); ?&gt;?tmpl=component" title="&lt;?php echo $result-&gt;title;?&gt;"&gt;                        &lt;img class="search_image" src="&lt;?php echo $image; ?&gt;" alt="&lt;?php echo $result-&gt;title; ?&gt;"  width="200px" height="auto"/&gt;&lt;/a&gt;                        &lt;?php                        }                    ?&gt;                                                                    &lt;/div&gt;                                &lt;div class="catItemIntroText"&gt;                    &lt;?php echo JHTML::_('content.prepare', $result-&gt;text); ?&gt;                    &lt;/div&gt;                                    &lt;/div&gt;                                                            &lt;/fieldset&gt;        &lt;?php endforeach; ?&gt;        &lt;/td&gt;    &lt;/tr&gt;    &lt;tr&gt;        &lt;td colspan="3"&gt;            &lt;div align="center"&gt;                &lt;?php echo $this-&gt;pagination-&gt;getPagesLinks( ); ?&gt;            &lt;/div&gt;        &lt;/td&gt;    &lt;/tr&gt;&lt;/table&gt;
 

 

I believe the problem is at line 116  and 123, and more specifically the votingPercentage @ line 116 and the numOfvotes @ line 123. (I have bolded the 2 lines of code).

 

How can I fix that? Any help will be greatly appreciated.

 

p.s. The code above contains hacks to show the item's image with a link, open title link and image link as popup, show the featured notice-graphic(if there is one), load content plugins that are being invoked with tags in introtext, show only introtext with full HTML and some more that I can't remember,

 

feel free to copy at will.
  • Marjorie COULIN
  • Marjorie COULIN's Avatar
28 Aug 2011 02:36
Replied by Marjorie COULIN on topic (Solved) Access and print extra fields (K2) within slide

(Solved) Access and print extra fields (K2) within slide

Category: Frontpage Slideshow

Hi Fotis,

My opinion is that it might not be an overkill if a bunch of people use an extra field as for example, some subtitle (thus not a "detail"), like I do.

just use mod_k2_content and wrap it with a similar slideshow effect/script.

I'm not sure I understand what you mean here.
My goal is to fully integrate a particular extra-field within the slides (I above mentionned the subtitle concept). Meaning backoffice management, order, position and effects. I don't see any other solution than making the slides retrieve the information by themselves.
Not mentionning that using mod_k2_content and JS/CSS tricks in parallel of FPSS would be quite messy, not to say dirty.
  • david nelband
  • david nelband's Avatar
23 Aug 2011 17:38
display extra field groups on category page was created by david nelband

display extra field groups on category page

Category: English K2 Community

hi,

first of all - this is my first post, and i got to say that k2 has really upgraded my joomla abillities, so thank you for developing this extension!

 

my question is this - 

is it possible to display the extra field group that is assigned to the category on ites category view page?

 



to visualize what i need check out this page on dhgate - look on the left side ('refine your search')
www.dhgate.com/wholesale-hoody/OjpSMlZ1WkdWeQ%253D%253D-OjpUV1Z1/s014001006.html#DCP014022-L1-01
imagine that the left side is the extra field group, and every option group (for example - material) is an extra field.
is this possible with some php programming? and of course, what is exactly ? :)
if not - is it possible to contact you guys in order for you to make this for me custum made?
  • Dario Pintarić
  • Dario Pintarić's Avatar
14 Aug 2011 20:22

Get specific extra field from database to use outside of K2

Category: English K2 Community

Hi,

I'm working on some customization on a RokStories module and i got caught up with few problems...

As I see it, RokStories is querying items from DB, and now i have a big problem....

1. each item has two extrafields, and i would like to display the second extrafield - how do i do that ?

 

So far i've been able to pull out the items date of creation and categoryname by editing RokStories "helper.php"....

 

Here's the K2 references inside RokStories helper.php

 

require_once (JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'helpers'.DS.'route.php');                        $query = "SELECT a.*, c.name as categoryname,c.id as categoryid, c.alias as categoryalias, c.params as categoryparams".            " FROM #__k2_items as a".            " LEFT JOIN #__k2_categories c ON c.id = a.catid";                $query .= " WHERE a.published = 1"            ." AND a.access &lt;= {$aid}"            ." AND a.trash = 0"            ." AND c.published = 1"            ." AND c.access &lt;= {$aid}"            ." AND c.trash = 0"            ;                   if ($params-&gt;get('catfilter')){                if (!is_null($cid)) {                    if (is_array($cid)) {                        $query .= " AND a.catid IN(".implode(',', $cid).")";                    }                    else {                        $query .= " AND a.catid={$cid}";                    }                }            }            if ($params-&gt;get('FeaturedItems')=='0')                $query.= " AND a.featured != 1";                if ($params-&gt;get('FeaturedItems')=='2')                $query.= " AND a.featured = 1";                            $query .= $where . ' ORDER BY ' . $orderby;            // end K2 specific        }                                $db-&gt;setQuery($query, 0, $count);        $rows = $db-&gt;loadObjectList();        $i=0;        $lists    = array();                if (is_array($rows) &amp;&amp; count($rows)&gt;0) {            foreach ( $rows as $row )            {                //process content plugins               $text = JHTML::_('content.prepare',$row-&gt;introtext,$cparams);                $lists[$i]-&gt;id = $row-&gt;id;                $lists[$i]-&gt;created = $row-&gt;created;                $lists[$i]-&gt;modified = $row-&gt;modified;                $lists[$i]-&gt;title = htmlspecialchars( $row-&gt;title );                $lists[$i]-&gt;introtext = modRokStoriesHelper::prepareContent($text, $params);                $lists[$i]-&gt;garantirano = $row-&gt;garantirano;                $lists[$i]-&gt;kategorija = $row-&gt;categoryname;

 

p.s. this goes and although i'm not a php pro i think i'll have to query/get the extra fields from DB and use helper or something to get the extra field...

 

Any one have any idea ?
  • BNR Investment Group
  • BNR Investment Group's Avatar
06 Aug 2011 18:29
Replied by BNR Investment Group on topic Where and when I can download K2 for Joomla 1.7?

Where and when I can download K2 for Joomla 1.7?

Category: English K2 Community

@Mark - when did you try Zoo? I tried Zoo when I was evaluating CCKs and I didn't like it. K2 was much better and easier to understand, which is why I chose it for all client sites we've built since. If you have not looked at Zoo recently, you should. They got slaughtered by K2 and went back to the drawing board. The new version is much different. It has many more features and works much better.

Someone mentioned something about being constrained to apps. That's not actually the case. Not only is there an app bundle for $100, but you can easily modify apps to fit your needs. Think of an app as a subtemplate and extra field bundled in to a package. It doesn't really require more work than K2, just different work. The interface for ordering the content items is fantastic as well and much better than any other CCK I have looked at. It's really come a long way.As I mentioned before, I have dozens of sites I have to consider. We've started our first Zoo site and so far it is looking like that will be the path we take for all of our other clients as well. It's a shame because I really like K2. We've developed a lot of cool stuff for K2 that I guess we will have to adapt to Zoo, but we can't afford to wait around for the end of August to find out there has been another delay. April is only 9 months from now. If I convert 1 site a week I will be really pushing my luck. I cannot gamble on K2 being released when I am already looking at a lot of work to make the deadline now.
  • Rob Avey
  • Rob Avey's Avatar
24 Jul 2011 22:45

Need to attach "sub items" to main items to create a menu

Category: English K2 Community

Hello, I spent a couple of days looking around the web and can't seem to come up with a suitable answer to my problem.

 

Each of my items (27 in all) there are 3 accompanying info items.  At first I used extra fields but because the extra items contain so much html it breaks the html when using joomfish...couldn't come up with a fix for that so I took each accompanying extra field and created a separate item for each.

 

I am also using tags to achieve the multi category item layout.

 

I can use mod_dmk2articlelistpro to list the accompanying item titles (the items that use to be extra fields)...that works okay but it also means that I have to create 27 modules that match up with the current items.  I can't imagine my customer would be too impressed if every time they add a new item that they would then have to create another module in order to display the accompanying items.

 

Is there any way that this could be automated?  So basically what I have is a top level item that has 3 info items attached to it...the main item is a shopping cart item (using K2mart).

 

Any input would be appreciated...hopefully I've explained myself clear enough but at this point i may have confused myself!

 

TIA
Displaying 381 - 400 out of 529 results.

Powered by Kunena Forum