OSSN Ads - Display Order and Number

Roger Ghostraven Posted in General Discussion 7 years ago

I have 2 questions regarding the OSSN Sponsor Ads

1) Is there a way to reorder the ads or randomize their appearance order? My site is beginning to take off and I'm adding sponsors but it's going to be hard moving forward if new sponsors are always just on the end.

2) How many sponsor ads appear on the page? If I have 20 ads will that make the page length longer or will a set number show then when someone goes to the next page will it continue down the list?

I am preparing to upgrade to the premium version of OSSN as soon as I have a user base and sponsor base to support it financially but I need to make sure sponsors have an equal opportunity to be seen by users.

Replies
Burmese Brian Allen Replied 5 months ago

Thanks for the post. This is exactly what I was looking for for angel numbers. The arrangement of the advertising display is also very important so that readers do not feel uncomfortable

us Roger Ghostraven Replied 7 years ago

Thank you Zetman, that worked did exactly what I was looking for.

Rally and Arsalan, thank you guys too. I really appreciate the help from all of you.

-Roger

German Michael Zülsdorff Replied 7 years ago

Referring to what I saw in the manual there's no combination of rand AND a column name.
And in fact it doesn't make very much sense, because if I want to retrieve a randomly sorted number of records anyway, I wouldn't mind if the result is 'sorted' by column 1 or column 2, right?
So simply do a $this->order_by = "rand()";

us Roger Ghostraven Replied 7 years ago

Rally, I changed the code as you said, removing DESC and it moved one ad from near the bottom to the top on the first page load but did not randomize any other ones. Also, it doesn't change the first at on refreshes or when visiting on another account with another browser. I even had a friend in another country pull the page and he saw the ads in the same order I did.

Am I putting the code in the correct area? If I create a new ad it inserts it in a random spot in the list, not the end but the displayed order of the ads never changes. I need to find a way around that because it's not fair for new sponsors to always be at the tail end of the ads. It will limit their expsoure.

If needed, I can create a user acct to test if you want to see what I'm talking about.

Thanks for the help, this had me up all night last night.

ph Rally Homelancer Replied 7 years ago

Don't include the DESC. Just:

 /**
 * Get site ads.
 *
 * @return object;
 */
public function getAds() {
    $this->owner_guid = 1;
    $this->type = "site";
    $this->subtype = "ossnads";
    $this->order_by = "rand(o.guid)";
    return $this->getObjectByOwner();
}

The DESC will always reorder/sort the ads in latest to oldest.

us Roger Ghostraven Replied 7 years ago

This is where I added your code to OssnAds class

/**
 * Get site ads.
 *
 * @return object;
 */
public function getAds() {
    $this->owner_guid = 1;
    $this->type = 'site';
    $this->subtype = 'ossnads';
    $this->order_by = 'rand(o.guid) DESC';
    return $this->getObjectByOwner();
}

It appears the only change is it took the next to last ad and made it the first displayed ad. The order does not change on a refresh or even when I login on a different browser using a different user. Did I put it in the right spot?

Indonesian Arsalan Shah Replied 7 years ago

It should show all ads, however if you wanted to show random ads with some limited ads, you should take a look OssnAds class, you can add $this->order_by = "rand(o.guid) DESC", this should work