Hi,
I think what you're wanting to do is 'remove' the premium links from your standard links and then display them separately, as opposed to 'marking' them as premium links within the standard ones - correct?
I've done this with V1.13 on three different levels:
•
Super listings (most likely the same as your proposed premium ones where link owners pay for an enhanced placement in the top of their link's category)
•
TopSites listings (for people who place a reciprocal link back to Qango)
•
Standard listings (all the rest of the regular links)
However, it's not all that easy to do since you have to create different 'sets' of links and process and format them individually to get the kind of control you're looking for.
Here's what I came up with, not sure if it'll apply to 2.x but it might give you an idea on how to proceed:
1) nph-build.cgi at
sub build_category_pages:
Directly UNDERNEATH this line "$get_related = $LINKDB->prepare (" SELECT Category.Name FROM ....." I modified the $get_links and added two new link sets:
$get_super = $LINKDB->prepare (" SELECT * FROM Links WHERE CategoryID = ?
AND isTop = 1 ORDER BY $LINKS{build_sort_order_category} LIMIT 1000 ");
$get_topsites = $LINKDB->prepare (" SELECT * FROM Links WHERE CategoryID = ?
AND isTop = 2 ORDER BY $LINKS{build_sort_order_category} LIMIT 1000 ");
$get_links = $LINKDB->prepare (" SELECT * FROM Links WHERE CategoryID = ?
AND isTop = 3 ORDER BY $LINKS{build_sort_order_category} LIMIT 1000 ");
... you'll notice that I've highlighted the parts of the statement that separate the different link types based on the value of 'isTop'. In your case, you'll probably only need one of these additional statements since you'll have 2 sets of links;
Premium and
Standard 2) Further down you'll find "# Get the links", this is where we split up the links into their different groups for processing and formatting - I added these lines:
$get_super->execute ($category_r->{'ID'});
$get_topsites->execute ($category_r->{'ID'});
$links_s = $get_super->fetchall_arrayref || ['Test','Rotz'];
$links_t = $get_topsites->fetchall_arrayref || ['Test','Rotz'];
$links_s = &build_sort_links ($links_s, $alt_r) if (@{$alt_r});
$links_t = &build_sort_links ($links_t, $alt_r) if (@{$alt_r});
$numlinkssup = $#{$links_s} + 1 || 0;
$numlinkstop = $#{$links_t} + 1 || 0;
$numlinks_total = $numlinks + $numlinkssup + $numlinkstop;
$OUT{total} = $numlinks_total;
$total_links = $numlinks_total;
3) After
# Calculate the related entries and put in a <LI> list. I added two new sub routines to process the new sets of links:
# Build the Super Listing's links
$OUT{super} = '';
if ($links_s) {
for my $i (0 .. $numlinkssup -1) {
$tmps = $LINKDB->array_to_hash (${$links_s}[$i]);
$OUT{super} .= &site_html_link ($tmps);
}
}
# Build the Top Sites links
$OUT{topsites} = '';
if ($links_t) {
for my $i (0 .. $numlinkstop -1) {
$tmpt = $LINKDB->array_to_hash (${$links_t}[$i]);
$OUT{topsites} .= &site_html_link ($tmpt);
}
}
4) Finally I added a 'check' into my category.html template to test for the new sets and place them if they are there:
<%if links%>
<hr width=100% size=1>
<ul><%links%></ul>
<%endif%>
... it took me a while to perfect the separation and placement and like I said, it may or may not work like this in 2.0 but it should give you an idea on how to go about separating the different link types for individual/unique placement in your category pages.
Hope this helps.
All the best
Shaun
BTW: there may well be a simpler method availble in 2.x than I've described above so if anyone else can improve on this, please let us know