Hi,
Only one featured add is showing up on the main page even though I have 3 selected. I am still new to this and can't figure out how to change it so it displays all three.
Well, I figured out what seems to be the easiest solution to this...albeit not the best. I changed the following function to what is below:
Public Shared Function GetFeaturedAd()
As DataTable
Dim table As AdsDataComponent.AdsDataTable = AdsDB.GetFeaturedAdsSelection(3)
Return table
End Function
And in the control FeaturedAd.ascx I changed everything that said AdID with Id.
The kit was designed to pick one of 1 or more cached feature ads and show that. Your approach for showing a specified number of ads will work. If I were going to add the feature I would consider using the the generic List<> and duplicating the structure
of the existing methods to get the benefits of caching:
public static
List<CachedFeaturedAd> GetFeaturedAdList(int displayCount)
{
return GetFeaturedAdList(HttpContext.Current, displayCount);
}
public static
List<CachedFeaturedAd> GetFeatureAdList(HttpContext context,
int displayCount)
{
// check if feature is in cache
// if not add to cache
}
DisplayCount could be passed in <asp:Parameter> from FeatureAd.ascx ObjectDataSource. Otherwise FeatureAd.asc would stay the same.
[This posting is provided "AS IS" with no warranties, and confers no rights.]
Do you mean the person who post until 50 items then only can be shown on the home (or default) page? Don't quite understand .... correct me if i am wrong. Can anybody tell me more about this? I thought only administrator got the authority to decide who/what
to be appeared on the main page ....
So ..... if that is the case, how can I customise it? What if I (as an adminitrator) want a specific Ad (with photo) to be appeared at the home page? Please help.
That's not what I mean. Those values are saved to the database. So if an ad has a level of 50 it is considered a Featured Ad.
You, as the adminstrator can decide which ads are to be featured or not. So if you login as administrator and manage your ads, there is an option to set the selected ads as featured
I think you are refering to "Manage Ads & features" under Site Administration.
I tried to play with all kind of selection, click the "query" button, but it doesn't work, it showed "An error occurred. Please contact the
site administrator", may I know what could go wrong?
It's kind of hard to tell what your exact error is. But if I remember correct there is an error with a declaration of a variable.
There was a previous post about this:
The error is on line 167 in the 'Admin/Ads.aspx' file. maxPrice is defined as Type 'int32'. Change it to 'Decimal'.
You should turn off Custom Errors in your web.config until you upload it to production so you can see the exact error messages instead of that custom error page
jherch77
Member
65 Points
13 Posts
Only one featured add?
Jun 22, 2006 03:30 PM|LINK
Only one featured add is showing up on the main page even though I have 3 selected. I am still new to this and can't figure out how to change it so it displays all three.
Can anyone help?
Thanks
jherch77
Member
65 Points
13 Posts
Re: Only one featured add?
Jun 23, 2006 06:11 PM|LINK
Public Shared Function GetFeaturedAd() As DataTable
Dim table As AdsDataComponent.AdsDataTable = AdsDB.GetFeaturedAdsSelection(3)
Return table
End Function
And in the control FeaturedAd.ascx I changed everything that said AdID with Id.
That made my 3 ads show up.
marcgel
Member
405 Points
76 Posts
Microsoft
Re: Only one featured add?
Jun 28, 2006 10:18 PM|LINK
The kit was designed to pick one of 1 or more cached feature ads and show that. Your approach for showing a specified number of ads will work. If I were going to add the feature I would consider using the the generic List<> and duplicating the structure of the existing methods to get the benefits of caching:
public static List<CachedFeaturedAd> GetFeaturedAdList(int displayCount){
return GetFeaturedAdList(HttpContext.Current, displayCount);
} public static List<CachedFeaturedAd> GetFeatureAdList(HttpContext context, int displayCount)
{
// check if feature is in cache
// if not add to cache
}
DisplayCount could be passed in <asp:Parameter> from FeatureAd.ascx ObjectDataSource. Otherwise FeatureAd.asc would stay the same.
yhhaw
Member
75 Points
15 Posts
Re: Only one featured add?
Jul 20, 2006 08:12 AM|LINK
Hello,
May I know where can I activate the featuredAd? Anybody .... Please help.
Regards,
justin0501
Member
705 Points
138 Posts
Re: Only one featured add?
Jul 20, 2006 12:12 PM|LINK
It's already built in. There are 3 AdLevels if I remember right off hand.
Uspecified = 0
Normal = 10
Featured = 50
So if you save an ad with AdLevel 50 it will be a featured item
yhhaw
Member
75 Points
15 Posts
Re: Only one featured add?
Jul 20, 2006 01:21 PM|LINK
Do you mean the person who post until 50 items then only can be shown on the home (or default) page? Don't quite understand .... correct me if i am wrong. Can anybody tell me more about this? I thought only administrator got the authority to decide who/what to be appeared on the main page ....
So ..... if that is the case, how can I customise it? What if I (as an adminitrator) want a specific Ad (with photo) to be appeared at the home page? Please help.
justin0501
Member
705 Points
138 Posts
Re: Only one featured add?
Jul 20, 2006 01:57 PM|LINK
That's not what I mean. Those values are saved to the database. So if an ad has a level of 50 it is considered a Featured Ad.
You, as the adminstrator can decide which ads are to be featured or not. So if you login as administrator and manage your ads, there is an option to set the selected ads as featured
yhhaw
Member
75 Points
15 Posts
Re: Only one featured add?
Jul 20, 2006 02:37 PM|LINK
I think you are refering to "Manage Ads & features" under Site Administration.
I tried to play with all kind of selection, click the "query" button, but it doesn't work, it showed "An error occurred. Please contact the site administrator", may I know what could go wrong?
justin0501
Member
705 Points
138 Posts
Re: Only one featured add?
Jul 20, 2006 03:16 PM|LINK
It's kind of hard to tell what your exact error is. But if I remember correct there is an error with a declaration of a variable.
There was a previous post about this:
The error is on line 167 in the 'Admin/Ads.aspx' file. maxPrice is defined as Type 'int32'. Change it to 'Decimal'.
You should turn off Custom Errors in your web.config until you upload it to production so you can see the exact error messages instead of that custom error page
yhhaw
Member
75 Points
15 Posts
Re: Only one featured add?
Jul 20, 2006 03:53 PM|LINK