Mmm.. could probably do it in category.html, with:
New Global: get_random_place_to_put_ad
my $cat_id = $_[0];
my $tbl = $DB->table('CatLinks','Links');
$tbl->select_options('ORDER BY RAND()','LIMIT 1');
my $id_pos = $tbl->select( { CategoryID => $cat_id } )->fetchrow_hashref;
return { ID_To_Put_Ad_At => $id_pos->{ID} }
}
Call with:
1) At the top of category.html:
<%get_random_place_to_put_ad($category_id)%>
..then, in link.html -
..show adsense code here
<%endif%>
Untested, but hopefully that'll work :)
It should select a random link ID, and then, in link.html you can put the adsense code in.
Hope that helps.
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
New Global: get_random_place_to_put_ad
Code:
sub { my $cat_id = $_[0];
my $tbl = $DB->table('CatLinks','Links');
$tbl->select_options('ORDER BY RAND()','LIMIT 1');
my $id_pos = $tbl->select( { CategoryID => $cat_id } )->fetchrow_hashref;
return { ID_To_Put_Ad_At => $id_pos->{ID} }
}
Call with:
1) At the top of category.html:
<%get_random_place_to_put_ad($category_id)%>
..then, in link.html -
Code:
<%if $ID eq $ID_To_Put_Ad_At%> ..show adsense code here
<%endif%>
Untested, but hopefully that'll work :)
It should select a random link ID, and then, in link.html you can put the adsense code in.
Hope that helps.
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!