search plugin problem

Phoca plugins - support for all Phoca plugins except Phoca Gallery plugins
kshipra
Phoca Member
Phoca Member
Posts: 41
Joined: 27 Feb 2009, 13:08

Re: search plugin problem

Post by kshipra »

hi,
Nice to hear that finally your problem is solved...but with some problems..well i can help you in solving one of your problem..
for showing categories you can add

Code: Select all

 <?php echo $result->title; ?>
result it will produce will be in this form category2: img1 (name of the category:image name) I hope this is what you want. You can ad it in the required position. :)
I am not getting what item-id you are talking about..coz in my case i have used this

Code: Select all

$list1[$key]->href = JRoute::_('index.php?option=com_phocagallery&view=detail&catid='.$item->catslug.'&id='.$item->slug.'&tmpl=component');
and it is generating the correct output. No problem is there. I think item-id you are talking about the id of a category like if you have 2 categories cat 1 and cat2 then cat1 will have some id and i dont know how to add it :( even in my case i have not used item-id and its not creating any problem whther you have 1 category or more then one..
I dont know how to add it :(
orangesparkz
Phoca Member
Phoca Member
Posts: 33
Joined: 11 Mar 2009, 22:41

Re: search plugin problem

Post by orangesparkz »

Thanks for all your help !
I applied the fix to show the categories and it works. Is there a way to only show only category and not the item number too?

I tried a number of things by guessing and none worked! Here are some I tried:

Code: Select all

 <?php echo $result->catslug; ?>
<?php echo $result->cat; ?>
<?php echo $result->slug; ?>
<?php echo $result->catid; ?>
Thanks for all your help. I am still clueless about the limited search results and I think I may know how to fix the itemid. I have a side menu set up with phoca menu module, so I want the search results to show it, and in order for that to happen it has to have the itemid coded onto the image path. Otherwise it links to the gallery, but the menu is gone and it looks weird!
:) Cathy
kshipra
Phoca Member
Phoca Member
Posts: 41
Joined: 27 Feb 2009, 13:08

Re: search plugin problem

Post by kshipra »

hi,
You dont want to show the item number....which item number you are talking about..ci did'nt get you as result->title only show the name of the category and the name of the image..can you be little more clear..which item number its showing... :)

And about showing limited number of search and displaying item id..i dont have much idea about it.. may be Jan can help you in this regard :)
orangesparkz
Phoca Member
Phoca Member
Posts: 33
Joined: 11 Mar 2009, 22:41

Re: search plugin problem

Post by orangesparkz »

Sorry I didn't explain that very well. I'll explain it again, better this time with pictures! :)

I tried

Code: Select all

 <?php echo $result->title; ?>
and got the search results to display like this:
Picture-1.jpg
See how it shows the category name (Spring & Summer or Interior) and then the title of the image (171 or 1005). example= Spring & Summer: 171
I didn't need it to say the title of the image, just the category name. Since it would be repeating the image name 3 times. Too redundant.

I tried this version

Code: Select all

 <?php echo $result->catslug; ?>
and got the search results to display like this:
Picture-2.jpg
See how mow it shows the category number (53 or 42) and then the category name (spring-summer or interiors).
example= 53: spring-summer
I thought this might confuse the viewer as to what number is important, since the category number is not important.

Your code

Code: Select all

 <?php echo $result->title; ?>
has the best looking results, except having the image name repeat 3 times is no good. Perhaps there is a way to only have it show 'Summer & Summer' or 'Interiors' ?
What do you think?
Or maybe there is an easier way to have it not show the image name before it the description (line 3 in picture). That would be fine too. Remove it from in front of the description. This line controls that

Code: Select all

<?php echo $result->text; ?>
:) P.S.
I didn't know if it is useful to you or you already know how, but see how the word "tree" is highlighted in the description? This was really easy to do and you can highlight the search word any color. All you have to do is set a css style for

Code: Select all

.highlight {
background-color:#FFFF99}
Just trying to give back a little for all your help!
thanks,
Cathy
kshipra
Phoca Member
Phoca Member
Posts: 41
Joined: 27 Feb 2009, 13:08

Re: search plugin problem

Post by kshipra »

hi Cathy,
Thanx for your help :) and thanx for increasing my knowledge :) will apply this in my gallery :)
Now things are clear..now i got what is the problem in your case..hmm..its is very simple to display only the category name not the image name..you just have to change the following in the plugins/phocagallery.php file
This one is the original one

Code: Select all

. ' CASE WHEN CHAR_LENGTH(a.title) THEN CONCAT_WS(\': \', b.title,a.title)
and now you simply have to remove a.title from the above line..and you"ll get the desired output :)and lines would become

Code: Select all

    . ' CASE WHEN CHAR_LENGTH(a.title) THEN CONCAT_WS(\': \', b.title)
orangesparkz
Phoca Member
Phoca Member
Posts: 33
Joined: 11 Mar 2009, 22:41

Re: search plugin problem

Post by orangesparkz »

Thank you so much for all your help! That worked perfectly. Now I understand a little what those lines are doing and I removed the a.title from the description line too. That's great!
I'll post on here, if (when) I figure out the answer to the other 2 issues, in case it helps anyone.
orangesparkz
Phoca Member
Phoca Member
Posts: 33
Joined: 11 Mar 2009, 22:41

Re: search plugin problem

Post by orangesparkz »

To fix the problem of the links not showing the itemid I used a hack, explained in this post:
viewtopic.php?f=1&t=3917
It may not be the best solution, but it will temporarily solve the problem.

To fix the problem of the search results not displaying all the results we changed a line of code in the file:
plugins/search/phocagallery.php

change this line:

Code: Select all

$db->setQuery( $query, 0, $limit );
to this:

Code: Select all

$db->setQuery( $query, 0, 999999999);
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: search plugin problem

Post by Jan »

Hi, thank you for this guide. Only for information, new version of search plugin was released. In this version the Itemid solution was added.

see:
https://www.phoca.cz/download/category/1 ... ery-plugin

Jan
If you find Phoca extensions useful, please support the project
nail.css
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 05 Dec 2009, 15:16

Re: search plugin problem

Post by nail.css »

I put in the code that I have does not work, why??
help please ..
is version 2.5.8 and 2.6.0alfa
Post Reply