SMFHacks.com

Ad Seller Pro => Support => Topic started by: webdzr on November 28, 2011, 02:32:09 pm

Title: Need Help Coding Mod
Post by: webdzr on November 28, 2011, 02:32:09 pm
Hello, First I would like to say that I think adseller pro is a great mod for smf.
There is just one thing that I didnt realize before I purchaced.
The ads only display one ad randomly on page refresh per location. I have read other posts on the forum about "stacking ads".
That is just what I would like to do. The way adsense displays.

I realize you can create a custom location and create a <table> but in my case I want a tower on the
left side of the forum index with 5 ads in it and different ads on the 6 other main pages of my forum (same location). If I made a custom location for each there would be 35 different locations/ad packages for customers to choose from.
I do not want to do this. It would be better to have only 7 locations/ad packages.

Im not fluent in php/mysql but I think this could be done with a WHILE() loop on the query starting on line 2144
in sources/adseller2.php and change the ORDER BY RAND() LIMIT 1 to ORDER BY ID_AD DESC the
number of ads that display could be set by the number of ad stock in the location(my case 5)
Im not using the rev.share part or have any other ad locations.

Im just not sure how to write the while loop and where it should go.

I may be compleatly wrong in all this. If anybody understands any of this and can help I would be very thankful
as I would really like to use this mod. I also feel this would be helpful to many other people. Thank You
Title: Re: Need Help Coding Mod
Post by: SMFHacks on November 28, 2011, 06:58:17 pm
Are you just showing ads in that one location/spot or are you having multiple locations.

Depending on that we can see which is the best way to go.

The function ShowAdLocation controls which ads are shown.
Condition check by ad location on how many ads to return or just one
A while loop would be needed to loop though and display and in that same loop formatting would be needed for table horizontal/vertical 
Title: Re: Need Help Coding Mod
Post by: webdzr on November 28, 2011, 08:46:24 pm
Thank you for the quick responce....I was going to have one other ad location at the top of the forum also, but
i only want to offer 1 ad space/inventory for it and it is to display throughout the entire forum. I dont think the loop
will affect this space unless there are more than one ads for that location.

Other than that i would like to have just the vertical 5 ads on the left of forum.

I think the table $adDisplayData already uses might work (im not sure) might need some space between ads.
Having the advertise here link after the last ad would be a plus.

Im not sure if i want to use all text ads or image yet. It would be great if it worked for both.



Title: Re: Need Help Coding Mod
Post by: SMFHacks on November 30, 2011, 10:01:47 am
Had an idea last night what we could do is make a duplicate of the ShowAdLocation function change it and call it like ShowFiveAdLocations and then replace the calling code in the template with that function.

Then we would just tweak that the new function code to get the result that we want so we don't mess up the original function.
Title: Re: Need Help Coding Mod
Post by: webdzr on November 30, 2011, 01:30:40 pm
That sounds like it might just work.
Title: Re: Need Help Coding Mod
Post by: SMFHacks on November 30, 2011, 02:42:46 pm
Attach your adseller2.php and will see what I can do.
Title: Re: Need Help Coding Mod
Post by: webdzr on November 30, 2011, 03:20:35 pm
here it is
Title: Re: Need Help Coding Mod
Post by: SMFHacks on November 30, 2011, 04:27:02 pm
Try this

And change the template call to ShowAdFiveLocation
Title: Re: Need Help Coding Mod
Post by: webdzr on December 01, 2011, 09:51:28 am
Thats it! Everything seems to be working perfectly.....Just what I was looking for...Ill put in some
formating to give some space between ads and im done.

Thank You So Much!!!!!
Title: Re: Need Help Coding Mod
Post by: SMFHacks on December 01, 2011, 10:06:19 am
Glad to help
Title: Re: Need Help Coding Mod
Post by: Tarasu on February 15, 2012, 01:13:55 pm
I had the same issue. Many thanks for your advice! ;)
Title: Re: Need Help Coding Mod
Post by: Selena_Kitt on December 05, 2012, 01:55:15 pm
I'm looking for a similar fix for my site.

Is there code available?

Thanks!
Title: Re: Need Help Coding Mod
Post by: SMFHacks on December 05, 2012, 02:59:09 pm
I'm looking for a similar fix for my site.

Is there code available?

Thanks!
For AdSeller Pro?
Title: Re: Need Help Coding Mod
Post by: Selena_Kitt on December 05, 2012, 03:36:25 pm
I'm looking for a similar fix for my site.

Is there code available?

Thanks!
For AdSeller Pro?

yes, for Pro!
Title: Re: Need Help Coding Mod
Post by: SMFHacks on December 05, 2012, 03:43:36 pm
Upgrade your account to move to customer group here
http://www.smfhacks.com/index.php?action=license


Then let me know what you want done and we can go from there.
Title: Re: Need Help Coding Mod
Post by: Selena_Kitt on December 05, 2012, 04:59:06 pm
Upgrade your account to move to customer group here
http://www.smfhacks.com/index.php?action=license


Then let me know what you want done and we can go from there.

Okay did that! :)

I'd like to have a line of vertical ads down the right side of our forum (instead of one that switches, just at the top). Just 100x150 ads, 8 of them would be good. All the same on every page. How do I do that?
Title: Re: Need Help Coding Mod
Post by: SMFHacks on December 05, 2012, 05:58:11 pm
Attach these files
Sources/AdSeller.php
And
themes/default/index.template.php
Title: Re: Need Help Coding Mod
Post by: Selena_Kitt on December 05, 2012, 06:22:03 pm
I'm using a different template though - elegant minds. Do you want that one instead? I renamed and attached that one just in case!
Title: Re: Need Help Coding Mod
Post by: SMFHacks on December 05, 2012, 06:25:19 pm
Yeah I would use what ever the main theme you are using as the index.template.php go will check it out in a bit.
Title: Re: Need Help Coding Mod
Post by: SMFHacks on December 05, 2012, 07:45:33 pm
Files attached see if this helps
Title: Re: Need Help Coding Mod
Post by: Selena_Kitt on December 05, 2012, 08:26:52 pm
YES! Perfect! *doing the snoopy happy dance of joy!*  ;D ;D ;D ;D
Title: Re: Need Help Coding Mod
Post by: SMFHacks on December 05, 2012, 08:29:05 pm
Glad to help!