VISIT STORE RECOMMEND US LINK TO US CONTACT US INDUSTRY NEWS Visit our Home Page Image hosted by Photobucket.com

Go Back   CGIScript.net -- Forums > Programming Discussion > General PHP Discussion
User Name
Password


Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-02-2007, 05:42 PM
donpaul donpaul is offline
Junior Member
 
Join Date: Jan 2007
Posts: 5
Default CSDirectory Home Page

Happy New Year...love your products and services.

I have created a business directory and the home page displays a list of entries from the directory. Instead of a list from the directory, I'd like to show perhaps three "featured businesses" on the Directory Home Page.

I didn't see anything on the configuration page that would allow me to do this. Is this something I can do myself? If not, can you write a custom program to allow that?

I hope I explained this properly...also I may be in the wrong section so please accept my apology.

Thanks
Reply With Quote
  #2  
Old 01-03-2007, 01:17 AM
contact contact is offline
Administrator
 
Join Date: May 2005
Posts: 353
Default

Hi,

You'd need to do a little tweaking but it should be pretty easy. About line 231 or so of csDirectory, you'll see
Code:
if($in{'feature'} eq 'Yes'){ $tmpl = $ft; } else{ $tmpl = $rt; }

right below that add

Code:
if(($in{'sf'} == 1)&&($in{'feature'} ne 'Yes')){ next; }


I think my logic there is right - LOL. Anyway.. to view only the featured listings you would add &sf=1 to the normal view URL for csDirectory.

If you want to limit the number of featured sites it shows then you could add a counter and make it something like
Code:
($in{'sf'} == 1)&&($in{'feature'} eq 'Yes')&&($in{'cnt'}++); if(($in{'sf'} == 1)&&($in{'feature'} ne 'Yes')&&($in{'cnt'} > 3)){ next; }

Let me know if any of that works!
__________________
Andy Angrick
http://www.cgiscript.net
"Automate Your Website for Less!"
Reply With Quote
  #3  
Old 01-04-2007, 12:20 AM
donpaul donpaul is offline
Junior Member
 
Join Date: Jan 2007
Posts: 5
Default

Thanks so much...I'll try it. If you hear a loud squeal ...I got it right;
a loud scream means I screwed it up!
Reply With Quote
  #4  
Old 01-04-2007, 01:17 AM
donpaul donpaul is offline
Junior Member
 
Join Date: Jan 2007
Posts: 5
Default

Now this is how csDirectory.cgi looks now:
===============================
if($in{'feature'} eq 'Yes'){
$tmpl = $ft;
}
else{
$tmpl = $rt;
}

if(($in{'sf'} == 1)&&($in
{'feature'} ne 'Yes')){
next;
}

($in{'sf'} == 1)&&($in{'feature'} eq 'Yes')&&($in{'cnt'}++);
if(($in{'sf'} == 1)&&($in{'feature'} ne 'Yes')&&($in{'cnt'} > 3)){
next;
}
=======================
but I'm not sure of what's suppose to happen that will let me display only certain entries? I dumped the cache, nothing happened.

Forgive me, but I know nothing about coding...it's all geek ...uhhh greek to me!
I don't mind paying a fee to get it to work.
Reply With Quote
  #5  
Old 01-04-2007, 09:54 AM
Pierre Pierre is offline
Member
 
Join Date: Nov 2005
Posts: 70
Default

Don't forget to add &sf=1 to your URL (after csDirectory.cgi?command=view )

Pierre
Reply With Quote
  #6  
Old 01-04-2007, 02:07 PM
contact contact is offline
Administrator
 
Join Date: May 2005
Posts: 353
Default

There is probably something wrong with my login there - LOL. Anyway, if don't mind emailing me directly at angrick1@cgiscript.net with your login details i'll try to get it working for you.
__________________
Andy Angrick
http://www.cgiscript.net
"Automate Your Website for Less!"
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump



All times are GMT. The time now is 08:03 PM.


Powered by: vBulletin Version 3.0.7
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.