Go Back   PHP Link Directory Forum > PHP Link Directory (phpLD) > Mods and contribution Discussion > Mod Requests

Mod Requests Have a suggestion for a mod? Post it here. You may not always receive an answer, but phpLD devs and mod developers do regularly visit this forum. If you MUST get something done, you may need to opt for paid help.

Closed Thread
 
Thread Tools Display Modes
Old 08-04-2005   #1
Sharr76
 
Join Date: Jul 2005
Posts: 73
Send a message via MSN to Sharr76
Default Search Results to show category

When you carry out a search and the search is displayed would it be possible to show the category that the site belongs too?

For example a search for photographers currently show this:

Denise Chastain Photography
Includes portraits, documentary, Silo street shoot and contact detals.

Is it possible to show it like this:

Denise Chastain Photography (Photographers)
Includes portraits, documentary, Silo street shoot and contact detals.

(Photographers) would also be hyperlinked to display the full category when clicked on.

:?:

[/url]
Sharr76 is offline  
Old 08-10-2005   #2
Ap0s7le
 
Join Date: Jun 2005
Location: The world
Posts: 816
Send a message via ICQ to Ap0s7le Send a message via AIM to Ap0s7le Send a message via MSN to Ap0s7le Send a message via Yahoo to Ap0s7le Send a message via Skype™ to Ap0s7le
Default

Taken care of.

Thank you Sharon.

-Casey
__________________
Casey Wilson / Ap0s7le
Freelance Programmer
http://www.ap0s7le.com
Need help with PHPLD? PM me
Ap0s7le is offline  
Old 08-11-2005   #3
Ap0s7le
 
Join Date: Jun 2005
Location: The world
Posts: 816
Send a message via ICQ to Ap0s7le Send a message via AIM to Ap0s7le Send a message via MSN to Ap0s7le Send a message via Yahoo to Ap0s7le Send a message via Skype™ to Ap0s7le
Default

David asked me to post how I did this.

Here goes.

In the /index.php there is a section that looks for the query string in the URL.
That section in the latest version looks like this starting on line 63. In that block you'll find a query like so.

Code:
$feat_links = $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 AND (URL LIKE $q OR TITLE LIKE $q OR DESCRIPTION LIKE $q) AND FEATURED=1 $expire_where ORDER BY EXPIRY_DATE DESC");
Change that line to.

Code:
$feat_links = $db->GetAll("SELECT l.*, c.TITLE cTITLE FROM {$tables['link']['name']} AS l, {$tables['category']['name']} AS c WHERE l.STATUS=2 AND l.CATEGORY_ID = c.ID AND (l.URL LIKE $q OR l.TITLE LIKE $q OR l.DESCRIPTION LIKE $q) AND l.FEATURED=1 $expire_where ORDER BY l.EXPIRY_DATE DESC");
Now just a couple lines below that find.

Code:
$links = $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 AND (URL LIKE $q OR TITLE LIKE $q OR DESCRIPTION LIKE $q) $feat_where $expire_where ORDER BY {$sort_cols[$sort]} {$sort_ord[$sort]}");
Change it to.
Code:
$links = $db->GetAll("SELECT l.*, c.TITLE cTITLE FROM {$tables['link']['name']} AS l, {$tables['category']['name']} AS c WHERE l.STATUS=2 AND l.CATEGORY_ID = c.ID AND (l.URL LIKE $q OR l.TITLE LIKE $q OR l.DESCRIPTION LIKE $q) $feat_where $expire_where ORDER BY {$sort_cols[$sort]} {$sort_ord[$sort]}");
Now you can access that added Category Title in your templates like so

Code:
{$link.cTITLE}
For example with Sharon I used this in the link.tpl
Code:
{if $link.cTITLE}(http ://{$smarty.const.DOC_ROOT}/index.php?c={$link.CATEGORY_ID}"]{$link.cTITLE}){/if}
Any questions just yell.

Thanks

-Casey
__________________
Casey Wilson / Ap0s7le
Freelance Programmer
http://www.ap0s7le.com
Need help with PHPLD? PM me

Last edited by David; 09-02-2008 at 03:47 AM.
Ap0s7le is offline  
Old 08-11-2005   #4
David
Administrator
phpLD Administrator
Supporter
 
David's Avatar
 
Join Date: Jan 2005
Posts: 11,667
Default

I'm thinking that to add the category links only to search results we need to go into main.tpl and do something where "q uneq 0"?
David is offline  
Old 08-11-2005   #5
Ap0s7le
 
Join Date: Jun 2005
Location: The world
Posts: 816
Send a message via ICQ to Ap0s7le Send a message via AIM to Ap0s7le Send a message via MSN to Ap0s7le Send a message via Yahoo to Ap0s7le Send a message via Skype™ to Ap0s7le
Default

Nah we don't.

It'll work fine the way I have it listed. You can view it active on her site.

Thanks

-Casey
__________________
Casey Wilson / Ap0s7le
Freelance Programmer
http://www.ap0s7le.com
Need help with PHPLD? PM me
Ap0s7le is offline  
Old 08-11-2005   #6
David
Administrator
phpLD Administrator
Supporter
 
David's Avatar
 
Join Date: Jan 2005
Posts: 11,667
Default

Cool, I figured it out now:
http://www.businessplexus.com/index.php?search=ballroom

Somebody give this guy a donation for helping.

Last edited by David; 06-15-2008 at 04:19 AM.
David is offline  
Old 09-19-2005   #7
ing
 
Join Date: Sep 2005
Posts: 90
Default

I got this to work, but is there a way to use ENABLE_REWRITE to make it point to the full url of the category or subcategory (site.tld/category/) instead of going to the category_ID (site.tld/index.php?c=xx) ??

Thanks
__________________
Work At Home Directory

Last edited by David; 09-02-2008 at 03:48 AM.
ing is offline  
Old 09-19-2005   #8
Nobody
Supporter
 
Join Date: Aug 2005
Location: Sweden
Posts: 218
Default

Yeah I wonder that to. Additionally, I think it would be nice if the category spec should show up at "latest links" and "popular links" as well.

And what about the "Suggest a category" feature? How is that one working?
Nobody is offline  
Old 09-20-2005   #9
David
Administrator
phpLD Administrator
Supporter
 
David's Avatar
 
Join Date: Jan 2005
Posts: 11,667
Default

Quote:
Originally Posted by Nobody
Yeah I wonder that to. Additionally, I think it would be nice if the category spec should show up at "latest links" and "popular links" as well.

And what about the "Suggest a category" feature? How is that one working?
All we have right now is this:
{deleted}

Last edited by David; 06-15-2008 at 04:20 AM.
David is offline  
Old 09-25-2005   #10
mdarriba
 
Join Date: Sep 2005
Posts: 12
Send a message via MSN to mdarriba Send a message via Yahoo to mdarriba
Default

Hi!
How I can do to show the all Strocture Category, with this change in the code only see the las category for the link, is posible to show all tree of the categories?

Thank you for your time
mdarriba is offline  
Old 08-27-2006   #11
proprod
Mentor
 
proprod's Avatar
 
Join Date: May 2006
Location: Fond du Lac, WI
Posts: 1,380
Default

Quote:
Originally Posted by David
Cool, I figured it out now:
http://www.businessplexus.com/index.php?search=ballroom

Somebody give this guy a donation for helping.
David, I noticed there, it has a link with full cat structure, parent, child... how did you accomplish this?
__________________

Last edited by David; 06-15-2008 at 04:20 AM.
proprod is offline  
Old 09-11-2006   #12
Alex2006
Supporter
 
Join Date: Mar 2006
Posts: 27
Default

Hi All,
How I can do to show category url in search result?
Alex2006 is offline  
Old 09-11-2006   #13
Boby
Supporter
Moderator
 
Boby's Avatar
 
Join Date: Dec 2005
Location: Cluj-Napoca/Sighisoara (Romania)
Posts: 4,468
Default

That is an option of phpLD 3.06
__________________
wanna say thank you?
  • My phpLD Mods
  • I am *not* a phpLD staff member, so please do *not* ask me to grant permissions, sales stuff, for access to the private supporter forums or phpLD 3.0+ download area.
  • Before you report your problems, make sure it happens with the *default* package and not your highly modified code. Don't forget to use the search feature and do not *bump* threads to soon (allow at least 24h).
Boby is offline  
Old 09-12-2006   #14
Alex2006
Supporter
 
Join Date: Mar 2006
Posts: 27
Default

Unfortunately I am not able to provide payment for phpLD 3.06 from Russia.
Alex2006 is offline  
Old 09-12-2006   #15
Boby
Supporter
Moderator
 
Boby's Avatar
 
Join Date: Dec 2005
Location: Cluj-Napoca/Sighisoara (Romania)
Posts: 4,468
Default

None of the following are available in your case?
http://www.phplinkdirectory.com/foru...07&postcount=6

Maybe a wire transfer could be the best method.
__________________
wanna say thank you?
  • My phpLD Mods
  • I am *not* a phpLD staff member, so please do *not* ask me to grant permissions, sales stuff, for access to the private supporter forums or phpLD 3.0+ download area.
  • Before you report your problems, make sure it happens with the *default* package and not your highly modified code. Don't forget to use the search feature and do not *bump* threads to soon (allow at least 24h).
Boby is offline  
Old 09-13-2006   #16
Alex2006
Supporter
 
Join Date: Mar 2006
Posts: 27
Default

This {if $link.cTITLE} Category: <a href="/index.php?c={$link.CATEGORY_ID}">{$link.cTITLE}</a>{/if} work well. How I can to use ENABLE_REWRITE to make Url for category as <a href="{$current_path}{$cat.TITLE_URL}.html">{$cat. TITLE}</a>
Alex2006 is offline  
Old 09-13-2006   #17
Boby
Supporter
Moderator
 
Boby's Avatar
 
Join Date: Dec 2005
Location: Cluj-Napoca/Sighisoara (Romania)
Posts: 4,468
Default

That is another feature of phpLD 3.06
It builds the entire link path to the category in the cache no matter if URL is rewritten or not.
__________________
wanna say thank you?
  • My phpLD Mods
  • I am *not* a phpLD staff member, so please do *not* ask me to grant permissions, sales stuff, for access to the private supporter forums or phpLD 3.0+ download area.
  • Before you report your problems, make sure it happens with the *default* package and not your highly modified code. Don't forget to use the search feature and do not *bump* threads to soon (allow at least 24h).
Boby is offline  
Old 09-20-2006   #18
Kaz
 
Join Date: Sep 2006
Location: UK
Posts: 46
Send a message via Yahoo to Kaz
Default

I've added the code but my link to the category doesn't seem to be hyperlinked. Any ideas?
__________________
Atom Sounds Directory (PR 4/10)
Directory Blog
Kaz is offline  
Old 01-28-2007   #19
Kaz
 
Join Date: Sep 2006
Location: UK
Posts: 46
Send a message via Yahoo to Kaz
Default

Quote:
Originally Posted by David View Post
Cool, I figured it out now:
http://www.businessplexus.com/index.php?search=ballroom

Somebody give this guy a donation for helping.
Could you let us know how you got it working with enable rewrite
__________________
Atom Sounds Directory (PR 4/10)
Directory Blog

Last edited by David; 06-15-2008 at 04:21 AM.
Kaz is offline  
Old 01-28-2007   #20
solutionsphp
Supporter
 
Join Date: Jun 2005
Location: Denman Island, BC
Posts: 76
Default

What is the conditional statement required to have the category also display on the Latest Links and Top Hits pages?
solutionsphp is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:58 PM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.