Previously we showed you how to create featured links RSS feed but what about creating a Featured Links page?
For those of you that need this feature in your PHP Link Directory install here is how you accomplish this.
First ftp to your PhpLD install.
Open “index.php” and find the following (somewhere around line 236);
case 'latestarticles':
$articles = $db->CacheGetAll ("SELECT * FROM `{$tables['article']['name']}` WHERE (`RELEASE_DATE`<= now() OR {$permission_links_arts}) AND (`STATUS` = '2' OR {$permission_links_arts}) {$email_conf} ORDER BY `FEATURED_MAIN` DESC, `FEATURED` DESC, `DATE_ADDED` DESC LIMIT 0, ".LINKS_TOP);
$path[] = array ('ID' => '0', 'TITLE' => _L('Latest Articles'), 'TITLE_URL' => '', 'DESCRIPTION' => '');
break;
Then right below it put this:
case 'featured':
$links = $db->CacheGetAll ("SELECT * FROM `{$tables['link']['name']}` WHERE (`FEATURED` = '1' OR {$permission_links_arts}) {$email_conf} {$expire_where} ORDER BY `HITS` DESC LIMIT 0, ".LINKS_TOP);
$path[] = array ('ID' => '0', 'TITLE' => _L('Featured Links'), 'TITLE_URL' => '', 'DESCRIPTION' => '');
break;
Save and upload your file.
Next under the template file you are using (eg: templates/professional) open “top_bar.tpl” and somewhere around line 15 find:
<a href="{$smarty.const.DOC_ROOT}/index.php?list=top" title="{l}Browse most popular links{/l}">{l}Top Sites{/l}</a>
Right below it put this:
<a href="{$smarty.const.DOC_ROOT}/index.php?list=featured" title="{l}Browse featured links{/l}">{l}Featured{/l}</a>
Save file and upload in your site.
Then open .htaccess file and find:
#RewriteBase /
Below it put:
##Featured Rewrite
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^featured-links\.htm[l]?$ index.php?list=featured [QSA,NC,L]
Save file and upload to your site.
That’s it Folks. Now go to your website and you should see “Featured” in your menu.