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

Mods and contribution Discussion This forum is only for discussion of modding phpLD. For specific mod releases, please see the appropriate forum.

Closed Thread
 
Thread Tools Display Modes
Old 01-05-2006   #1
VSDan
Supporter
Moderator
 
VSDan's Avatar
 
Join Date: Sep 2005
Location: Vancouver, BC, Canada
Posts: 1,180
Default Prioritized Featured Links in Top Listings

This mod will list Featured Links above other links in New Listings, Popular Listings, and Top Rated Listings.

Open index.php, and change:

Code:
		case 'd':
			$links = $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 $expire_where ORDER BY DATE_ADDED desc limit 0, ".LINKS_TOP);
			$path[] = array ('ID' => '0', 'TITLE' => _L('New Listings'), 'TITLE_URL' => '', 'DESCRIPTION' => '');
			break;
		case 'h':
			$links = $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 $expire_where ORDER BY hits desc limit 0, ".LINKS_TOP);
			$path[] = array ('ID' => '0', 'TITLE' => _L('Popular Listings'), 'TITLE_URL' => '', 'DESCRIPTION' => '');
			break;
		case 'r':
			$links = $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 $expire_where ORDER BY rate desc limit 0, ".LINKS_TOP);
			$path[] = array ('ID' => '0', 'TITLE' => _L('Top Rated'), 'TITLE_URL' => '', 'DESCRIPTION' => '');
			break;
to:

Code:
		case 'd':
			$links1	= $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 AND FEATURED=1 $expire_where ORDER BY DATE_ADDED desc limit 0, ".LINKS_TOP);
			$links2	= $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 AND FEATURED=0 $expire_where ORDER BY DATE_ADDED desc limit 0, ".LINKS_TOP);
			$links	= array_merge($links1, $links2);
			$path[]	= array ('ID' => '0', 'TITLE' => _L('Top ' . LINKS_TOP . ' New Listings'), 'TITLE_URL' => '', 'DESCRIPTION' => '');
			break;
		case 'h':
			$links1	= $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 AND FEATURED=1 $expire_where ORDER BY hits desc limit 0, ".LINKS_TOP);
			$links2	= $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 AND FEATURED=0 $expire_where ORDER BY hits desc limit 0, ".LINKS_TOP);
			$links	= array_merge($links1, $links2);
			$path[] = array ('ID' => '0', 'TITLE' => _L('Top ' . LINKS_TOP . ' Popular Listings'), 'TITLE_URL' => '', 'DESCRIPTION' => '');
			break;
		case 'r':
			$links1	= $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 AND FEATURED=1 $expire_where ORDER BY rate desc limit 0, ".LINKS_TOP);
			$links2	= $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 AND FEATURED=0 $expire_where ORDER BY rate desc limit 0, ".LINKS_TOP);
			$links	= array_merge($links1, $links2);
			$path[] = array ('ID' => '0', 'TITLE' => _L('Top' . LINKS_TOP . ' Top Rated'), 'TITLE_URL' => '', 'DESCRIPTION' => '');
			break;
Notes:

1. Yours may look at little different as my index.php is modified.

2. Ignore case 'r' block if you are not using the Rating mod.
__________________
Dan

Unlock the Vault Contest :: Over $350 Prizes!
phpLD Mods :: phpLD_Vault
Webmaster Resources Directory
phpLD_Vault Support

IMPORTANT NOTE:
phpLD_Vault Support not handled in this forum AND not via PM here. Click on link above for support. NO exceptions!
VSDan is offline  
Old 01-06-2006   #2
Bill
Mentor
 
Bill's Avatar
 
Join Date: Aug 2005
Location: New Jersey
Posts: 334
Default

Hey Dan, you have a demo up?

Thanks
Bill is offline  
Old 01-06-2006   #3
VSDan
Supporter
Moderator
 
VSDan's Avatar
 
Join Date: Sep 2005
Location: Vancouver, BC, Canada
Posts: 1,180
Default

You bet - you can go here to see it in action:

http://www.monster-submit.com/directory/

New Listings | Popular Listings | Top Rated

...any one of these will show that Featured Listings display first ahead of others. Not for everyone, but I wanted Featured Listings to show up first across the board.
__________________
Dan

Unlock the Vault Contest :: Over $350 Prizes!
phpLD Mods :: phpLD_Vault
Webmaster Resources Directory
phpLD_Vault Support

IMPORTANT NOTE:
phpLD_Vault Support not handled in this forum AND not via PM here. Click on link above for support. NO exceptions!
VSDan is offline  
Old 05-13-2006   #4
Steven Myers
Supporter
 
Steven Myers's Avatar
 
Join Date: May 2006
Posts: 1,178
Default

This feature works only showing the featured link on the category you choose it to be on. Is there a way to get the featured link to show up on ALL of the pages, including the main page?

Thanks
__________________
Hosting Feedback - General Web Directory
Steven Myers is offline  
Old 05-20-2006   #5
Steven Myers
Supporter
 
Steven Myers's Avatar
 
Join Date: May 2006
Posts: 1,178
Default

Do we have a mod for this on 3.05?

I want to get the featured links on the main page like this: http://www.alivedirectory.com/ <--- look at the bottom.
__________________
Hosting Feedback - General Web Directory
Steven Myers is offline  
Old 08-10-2006   #6
Nerz
 
Join Date: Aug 2006
Posts: 118
Default

Ya id like to get it working for 3.06 so the featured links are showing in the top rated, top hits etc...say with a maximum of 5 random featured links.

Im gonna have sponsored links on the frontpage which will be dealt with differantly
Nerz is offline  
Old 02-04-2007   #7
Kaz
 
Join Date: Sep 2006
Location: UK
Posts: 46
Send a message via Yahoo to Kaz
Default

Great mod, now my top sites and latest link pages, show the featured sites first, brilliant
__________________
Atom Sounds Directory (PR 4/10)
Directory Blog
Kaz is offline  
Old 02-22-2007   #8
rez0
 
rez0's Avatar
 
Join Date: Nov 2006
Posts: 54
Send a message via MSN to rez0
Default

great mod but how show 5 random feature links in top of latest, top ... tks
rez0 is offline  
Old 02-22-2007   #9
anon
Supporter
 
anon's Avatar
 
Join Date: Feb 2006
Location: As far from you as humanly possible!
Posts: 2,893
Send a message via Yahoo to anon
Default

Quote:
Originally Posted by rez0 View Post
great mod but how show 5 random feature links in top of latest, top ... tks
Change the ORDER BY clause:

ORDER BY hits desc

to

ORDER BY RAND()
anon is offline  
Old 02-25-2007   #10
PHPLDrocks
Supporter
 
PHPLDrocks's Avatar
 
Join Date: Dec 2006
Posts: 89
Default

Is it valid for v2.1 ?
PHPLDrocks is offline  
Old 02-25-2007   #11
shadav
Mentor
Supporter
Moderator
 
shadav's Avatar
 
Join Date: Dec 2006
Location: Indiana
Posts: 5,077
Default

yes it works on versions 2.x
__________________
shadav is offline  
Old 02-27-2007   #12
jminscoe
 
jminscoe's Avatar
 
Join Date: Sep 2005
Location: NC
Posts: 791
Send a message via MSN to jminscoe
Question

How about featured by pr for instace on this page http://www.ahealthylifestyle4u.net/d.../index.php?p=d I have featured but I want to show feature by pr also
how can I get just feature to show thumbnails

Quote:
Originally Posted by VSDan View Post
This mod will list Featured Links above other links in New Listings, Popular Listings, and Top Rated Listings.

Open index.php, and change:

Code:
		case 'd':
			$links = $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 $expire_where ORDER BY DATE_ADDED desc limit 0, ".LINKS_TOP);
			$path[] = array ('ID' => '0', 'TITLE' => _L('New Listings'), 'TITLE_URL' => '', 'DESCRIPTION' => '');
			break;
		case 'h':
			$links = $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 $expire_where ORDER BY hits desc limit 0, ".LINKS_TOP);
			$path[] = array ('ID' => '0', 'TITLE' => _L('Popular Listings'), 'TITLE_URL' => '', 'DESCRIPTION' => '');
			break;
		case 'r':
			$links = $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 $expire_where ORDER BY rate desc limit 0, ".LINKS_TOP);
			$path[] = array ('ID' => '0', 'TITLE' => _L('Top Rated'), 'TITLE_URL' => '', 'DESCRIPTION' => '');
			break;
to:

Code:
		case 'd':
			$links1	= $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 AND FEATURED=1 $expire_where ORDER BY DATE_ADDED desc limit 0, ".LINKS_TOP);
			$links2	= $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 AND FEATURED=0 $expire_where ORDER BY DATE_ADDED desc limit 0, ".LINKS_TOP);
			$links	= array_merge($links1, $links2);
			$path[]	= array ('ID' => '0', 'TITLE' => _L('Top ' . LINKS_TOP . ' New Listings'), 'TITLE_URL' => '', 'DESCRIPTION' => '');
			break;
		case 'h':
			$links1	= $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 AND FEATURED=1 $expire_where ORDER BY hits desc limit 0, ".LINKS_TOP);
			$links2	= $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 AND FEATURED=0 $expire_where ORDER BY hits desc limit 0, ".LINKS_TOP);
			$links	= array_merge($links1, $links2);
			$path[] = array ('ID' => '0', 'TITLE' => _L('Top ' . LINKS_TOP . ' Popular Listings'), 'TITLE_URL' => '', 'DESCRIPTION' => '');
			break;
		case 'r':
			$links1	= $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 AND FEATURED=1 $expire_where ORDER BY rate desc limit 0, ".LINKS_TOP);
			$links2	= $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 AND FEATURED=0 $expire_where ORDER BY rate desc limit 0, ".LINKS_TOP);
			$links	= array_merge($links1, $links2);
			$path[] = array ('ID' => '0', 'TITLE' => _L('Top' . LINKS_TOP . ' Top Rated'), 'TITLE_URL' => '', 'DESCRIPTION' => '');
			break;
Notes:

1. Yours may look at little different as my index.php is modified.

2. Ignore case 'r' block if you are not using the Rating mod.
__________________
JoDee
$10-5 & $5-3 deep links JoDeesWebDirectory.com HealthDirectory

To succeed in Life its not always what you know but who you know

Last edited by jminscoe; 02-27-2007 at 01:46 AM. Reason: added to description
jminscoe is offline  
Old 03-06-2007   #13
tldir.com
 
Join Date: Jan 2007
Posts: 40
Default

I was able to get this to work for 3.1.

Question: The featured listings are blended in with the regular listings.
Example: http://www.seo-sources.com/index.php?list=latest

Anyone have a suggestion on how I can get the featured links in the "Latest links" and "Top links" to display like this:
http://www.seo-sources.com/Shopping/ on top of the other regular links?

This will make the advantages of having a featured link more visible to visitors and potential advertisers.

Last edited by tldir.com; 03-06-2007 at 11:10 PM.
tldir.com is offline  
Old 03-14-2007   #14
tldir.com
 
Join Date: Jan 2007
Posts: 40
Default

Anyone know how to accomplish this?
tldir.com is offline  
Old 03-14-2007   #15
thompson
Supporter
 
Join Date: Oct 2005
Posts: 548
Default

nice mod. thanks.
__________________
many thanks.

thompson.
thompson is offline  
Old 03-25-2007   #16
Fastian
 
Fastian's Avatar
 
Join Date: Sep 2006
Posts: 180
Default

How to get this work with v3.1 ??
I cant find the following code ...

Quote:
Originally Posted by VSDan View Post
Open index.php, and change:

Code:
        case 'd':
            $links = $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 $expire_where ORDER BY DATE_ADDED desc limit 0, ".LINKS_TOP);
            $path[] = array ('ID' => '0', 'TITLE' => _L('New Listings'), 'TITLE_URL' => '', 'DESCRIPTION' => '');
            break;
        case 'h':
            $links = $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 $expire_where ORDER BY hits desc limit 0, ".LINKS_TOP);
            $path[] = array ('ID' => '0', 'TITLE' => _L('Popular Listings'), 'TITLE_URL' => '', 'DESCRIPTION' => '');
            break;
        case 'r':
            $links = $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 $expire_where ORDER BY rate desc limit 0, ".LINKS_TOP);
            $path[] = array ('ID' => '0', 'TITLE' => _L('Top Rated'), 'TITLE_URL' => '', 'DESCRIPTION' => '');
            break;
__________________
BEST Web Directory Permanent Regular links with 3 Deep Links for $14.95 Only
Free Blog Directory ~ PHPLD_Vault Rocks
Fastian is offline  
Old 04-07-2007   #17
jminscoe
 
jminscoe's Avatar
 
Join Date: Sep 2005
Location: NC
Posts: 791
Send a message via MSN to jminscoe
Default

Do I add it where I have this
case 'latest':
$links = $db->GetAll ("SELECT * FROM `{$tables['link']['name']}` WHERE `STATUS` = '2' {$expire_where} ORDER BY `DATE_ADDED` DESC LIMIT 0, ".LINKS_TOP);
$path[] = array ('ID' => '0', 'TITLE' => _L('Latest Links'), 'TITLE_URL' => '', 'DESCRIPTION' => '');
break;
case 'top':
$links = $db->GetAll ("SELECT * FROM `{$tables['link']['name']}` WHERE `STATUS` = '2' {$expire_where} ORDER BY `HITS` DESC LIMIT 0, ".LINKS_TOP);
$path[] = array ('ID' => '0', 'TITLE' => _L('Top Hits'), 'TITLE_URL' => '', 'DESCRIPTION' => '');
break;
__________________
JoDee
$10-5 & $5-3 deep links JoDeesWebDirectory.com HealthDirectory

To succeed in Life its not always what you know but who you know
jminscoe is offline  
Old 04-07-2007   #18
navjotjsingh
 
navjotjsingh's Avatar
 
Join Date: Jan 2007
Posts: 27
Default

You are right jminscoe.
navjotjsingh is offline  
Old 06-13-2007   #19
msolution
Supporter
 
msolution's Avatar
 
Join Date: Jun 2007
Posts: 131
Lightbulb Showing featured as a seperate list above normal listing:

Quote:
Originally Posted by VSDan View Post
This mod will list Featured Links above other links in New Listings, Popular Listings, and Top Rated Listings.

Open index.php, and change:

Code:
        case 'd':
            $links = $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 $expire_where ORDER BY DATE_ADDED desc limit 0, ".LINKS_TOP);
            $path[] = array ('ID' => '0', 'TITLE' => _L('New Listings'), 'TITLE_URL' => '', 'DESCRIPTION' => '');
            break;
        case 'h':
            $links = $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 $expire_where ORDER BY hits desc limit 0, ".LINKS_TOP);
            $path[] = array ('ID' => '0', 'TITLE' => _L('Popular Listings'), 'TITLE_URL' => '', 'DESCRIPTION' => '');
            break;
        case 'r':
            $links = $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 $expire_where ORDER BY rate desc limit 0, ".LINKS_TOP);
            $path[] = array ('ID' => '0', 'TITLE' => _L('Top Rated'), 'TITLE_URL' => '', 'DESCRIPTION' => '');
            break;
to:

Code:
        case 'd':
            $links1    = $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 AND FEATURED=1 $expire_where ORDER BY DATE_ADDED desc limit 0, ".LINKS_TOP);
            $links2    = $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 AND FEATURED=0 $expire_where ORDER BY DATE_ADDED desc limit 0, ".LINKS_TOP);
            $links    = array_merge($links1, $links2);
            $path[]    = array ('ID' => '0', 'TITLE' => _L('Top ' . LINKS_TOP . ' New Listings'), 'TITLE_URL' => '', 'DESCRIPTION' => '');
            break;
        case 'h':
            $links1    = $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 AND FEATURED=1 $expire_where ORDER BY hits desc limit 0, ".LINKS_TOP);
            $links2    = $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 AND FEATURED=0 $expire_where ORDER BY hits desc limit 0, ".LINKS_TOP);
            $links    = array_merge($links1, $links2);
            $path[] = array ('ID' => '0', 'TITLE' => _L('Top ' . LINKS_TOP . ' Popular Listings'), 'TITLE_URL' => '', 'DESCRIPTION' => '');
            break;
        case 'r':
            $links1    = $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 AND FEATURED=1 $expire_where ORDER BY rate desc limit 0, ".LINKS_TOP);
            $links2    = $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 AND FEATURED=0 $expire_where ORDER BY rate desc limit 0, ".LINKS_TOP);
            $links    = array_merge($links1, $links2);
            $path[] = array ('ID' => '0', 'TITLE' => _L('Top' . LINKS_TOP . ' Top Rated'), 'TITLE_URL' => '', 'DESCRIPTION' => '');
            break;
Notes:

1. Yours may look at little different as my index.php is modified.

2. Ignore case 'r' block if you are not using the Rating mod.

Showing featured as a seperate list above normal listing:

hi,
i have used the following code to show featured links as a seperate list in New Listings, Popular Listings, and Top Rated Listings.

Demo : http://www.dir.vc
Tested on phpLD 2.1.2
requesting feedback on other versions,

Code:
 
  case 'd':
      if (FTR_ENABLE) {
         $feat_links = $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 AND FEATURED=1 $expire_where ORDER BY DATE_ADDED desc limit 0, ".LINKS_TOP);
         $tpl->assign('feat_links', $feat_links);
 
         $links = $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 AND FEATURED=0 $expire_where ORDER BY DATE_ADDED desc limit 0, ".LINKS_TOP);
 
    } else {
 
        $links = $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 $expire_where ORDER BY DATE_ADDED desc limit 0, ".LINKS_TOP);
    }
     $path[] = array ('ID' => '0', 'TITLE' => _L('Top ' . LINKS_TOP . ' New Listings'), 'TITLE_URL' => '', 'DESCRIPTION' => '');
     break;
  case 'h':
      default :
      if (FTR_ENABLE) {
          $feat_links = $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 AND FEATURED=1 $expire_where ORDER BY hits desc limit 0, ".LINKS_TOP);
          $tpl->assign('feat_links', $feat_links);
 
          $links = $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 AND FEATURED=0 $expire_where ORDER BY hits desc limit 0, ".LINKS_TOP);
     } else {
          $links = $db->GetAll("SELECT * FROM {$tables['link']['name']} WHERE STATUS=2 $expire_where ORDER BY DATE_ADDED desc limit 0, ".LINKS_TOP);
     }
     $path[] = array ('ID' => '0', 'TITLE' => _L('Top ' . LINKS_TOP . ' Popular Listings'), 'TITLE_URL' => '', 'DESCRIPTION' => '');
   break;
hope this helps someone

Regards
M.
msolution is offline  
Old 06-17-2007   #20
shadav
Mentor
Supporter
Moderator
 
shadav's Avatar
 
Join Date: Dec 2006
Location: Indiana
Posts: 5,077
Default

thanks msolution
dan why isn't the rate part of it working? eh i'll get off my lazy butt and scan your forum here in a bit
__________________
shadav 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 01:05 PM.


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