Last post Jul 08, 2009 08:13 AM by po10cy
May 13, 2009 02:49 AM|po10cy|LINK
May 14, 2009 09:29 PM|darkknight187|LINK
Wow, you're asking a lot in a single post.
I assure you you'll have better results if you take things one step at a time.
But I'll start you out with managing your users.
I found a piece of code set in a zip file. All you have to do is register yourself through your normal website registration.
Put the users.aspx file in your root folder so anyone can access it, type the location your browser, and change your login Id from guest to Admin.
AND THE MOST IMPORTANT PART IS AFTER YOU HAVE CHANGED YOURSELF TO AN ADMINISTRATOR,
MOVE THAT FILE TO A PROTECTED AREA OF YOUR SITE.
I wish I could take credit for writing the code but it was done by TomT, great piece of code.
Go here http://forums.asp.net/t/1110595.aspx the link for the users.aspx file is at the bottom of the first post.
And there you go.
It does leave out one thing though.
When you use the file above, it does not delete the member from the classifieds database.
So I added a storedprocedure to do this.
You should note that I am not using the exact code above.
I used a users.cs file that I converted to vb.
But you should be able to make my addition work.
You need to start with the user file you use for managing your members.
And you need to understand how it works.
When it runs through and deletes them member tell it to get the username you want to delete.
That line above tells it to go into App_Data/BLL/Members.vb
and looks for a sub your about to create, RemoveMemberFromDatabase
That sub tells it to look in App_Code/DAL/Members.xsd
I like to go into the code itself, and I just copied insertmember, deleted the entries, only leaving the top three.
THE NAMES BELOW ARE ABBREVIATED.
Since you copied, don't forget to change ALL insertmember (only in the one you copied) to RemoveMemberByUsername
Now it looks for your stored procedure.
Here's one I wrote.
And it should work.
(Note that I am using the final version so it says my members table is classifieds_Members)
If you are using beta, just remove "classifieds_"
Make sure you make a backup before trying new code, and test it out before publishing.
For the email notification you need to add code to the hourlyMaintenanceTimer to check for ads to expire.
It already does a check if it is expired, use that as a guideline,
And add a if statement to send an email if it will expire in 7 days or whatever you choose.
Questions 1, 2, & 3.
Use an if statement to tell the app what to do.
May 15, 2009 12:23 AM|ansii|LINK
I have benefited a lot from your postings. Keep up the goodwork. I don't know C#, but your help through the postings helped me a lot in learning it slowly. Would you mind giving the above code in C# to check how to send a mail if it will expire.
Regarding the answer for 1,2 & 3, you have said put an IF statement to tell what it should do. But, where and how will you store whether the user is a premium, free or silver user. Please forgive me as I am a novice and learning now only.
Thanks & Regards
May 16, 2009 08:00 PM|darkknight187|LINK
You'll never learn anything if you don't try.
And if you don't know C# why are you using it?
There's more helpers in Visual Web Developer for developing using VB.
Try this for coverting code.
Make backups, and try.
When coding you have to think of it as a very specific map to get to a point.
I recommend using pen and paper to map it out.
I find it easier that way.
I would store your user status, premium or whatever, in the members table.
Follow the path when a user registers.
Look for anything that has to do with members.
One step at a time, your going to have a lot of issues when things don't work.
And you made a ton of upgrades at a time.
Pick one upgrade, and work on that.
May 19, 2009 02:51 AM|po10cy|LINK
May 19, 2009 03:06 AM|po10cy|LINK
May 20, 2009 09:18 AM|darkknight187|LINK
For the featured ads sorting change the stored procedure getalladsbyquery.
At the bottom it tells the system to sort by DateCreated.
Make it sort by Featured
And the users.aspx file DOES work, I use it all the time.
Again you are not giving any information.
"Doesn't work" is not a statement that anyone can help you with.
Why do you think it doesn't work?
Write a complete question.
May 20, 2009 09:42 AM|po10cy|LINK
May 20, 2009 09:31 PM|darkknight187|LINK
It already sorts by those numbers.
As far as flagging the member as silver or whatever, it's to involved to do a walk through.
Make a backup of your project just in case you screw it up.
And start playing with anything that has to do with members.
Besides, you'll learn a lot more that way.
And I just downloaded the users.zip file again.
If it doesn't work for you, send me a private message and I'll email it to you.
May 21, 2009 02:27 AM|po10cy|LINK
May 31, 2009 10:26 AM|darkknight187|LINK
So I was making an upgrade to handle another image size and I didn't know you could set it this easily.
I figured you could just set one parameter, but as you can see,
it sorts by preview, then by date. Nice.
But take a look at the storedprocedure GetPhotosByAdId
At the bottom it tells the app how to order the results.
You could do the same thing for your Featured Ads.
By the way the DESC is for descending, use ASC if you want to sort by ascending.
Jun 01, 2009 02:35 AM|po10cy|LINK
Jun 01, 2009 10:06 AM|darkknight187|LINK
another issue i cant get sorted, on my home page it only lists 1 featured ad when it should list 5. any reason why
Probably because your code is wrong.
But you didn't post any, so not sure what's wrong.
for some reason when i make a search with no search term, it still lists by date.
Jun 01, 2009 10:21 AM|po10cy|LINK
Jun 01, 2009 11:57 AM|lingyun2003|LINK
Jun 02, 2009 07:57 AM|sangam100|LINK
Hi po10cy ,
I have just downloaded the classified ad starter kit and like you I also won't enjoy the default only. First of all thanks for the questions for being the weighty ones because all most all of we developers would like to have the features you mentioned. I
am not going to answer any of your question since I am new to this starter site and am just playing with the default features. However in the future I would also go for the deep feautures.
One thing I would like to request. If you have already got them work or if you are on the way, it would be a great work if you could give some walkthrough or sort of tips and tricks or have a series-articles somewhere. I don't know whether it is feasible
or not but I would like to ask wheter you make the code you have achieved by now available for other developers also.
With great appreciation! Thanks. Happy Programming!
Jun 25, 2009 06:00 AM|po10cy|LINK
Howsit guys, for the life of me I still cannot get the site to list the ads by AdLevel and not DateCreated whenever you search for something. And I have changed the procedure which sorts by DateCreated to AdLevel, I have searched the entire project for
anything to do with AdLevel and DateCreated and still doesnt do what it needs.
So now i have another thought, how about instead of having code to list all the ad's and sort them then by DateCreated, how about i have code to list only ads of a certain level? eg when you search how do I have it only list Ads thats featured Ads, then
it sorts by datecreated. what i want to do then, is have the code to display featured ads first, then another section of code to only display guest ads, that way it would appear to be sorting by AdLevel but in actual fact its only displaying featured ads
first, then normal ads afterwards because of the code.
Also i still cannot get it to display up to 5 featured ads on the homepage at the same time, it only display ones featured ad, and i have used all the code examples listed on this site including the line of code which says "GetMaxNumAds" from "GetMaxNumAds(1)"
to "(5)" and still no joy.
this is the only 2 issues im struggling with then my site can go live. Please any advise on how to go about this or code would be awesome. Ive sat many nights up now fiddling with this code.
Jul 08, 2009 08:13 AM|po10cy|LINK
ok so i managed to finally get the ads to sort by level.
what i did was i made duplicates of teh grid to display the search results in search .aspx. then i duplicated the datasource the same amount of times, changing each grid to point to each datasource. Then in each datasource is a field "adlevel=0" which
basically is default and tells it to display ALL adlevels. so i changed each grid to display the adlevel i wanted by changed each grid's data source to point to "adlevel=50".."adlevel=30".."adlevel=20" etc. 50 being the featured ads level and the rest being
my custom adlevels i created.
however i still cannot get it to list more than 1 featured ad on the home page...if i duplicate the repeater to have 5 repeaters on the home page, it sometimes lists the same ad twice on the home page at the same time...i really need help to get it so the
one repeater can list up to 5 different featured ads on the home page at the same time.