• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

[SurreyForum] XenKingPin: Pay To Pin (Thread Sticky Bidding), Pay to Bump, <pay per click>

tenants

Well-known member
Feel free to Donate, a donation of £40 (or more) earns you the right to remove the copyright for this mod from a single install.

<v1.07 works with XF 1.1>

This is an advertising plug-in.

The great thing about "Pay per Pin" and "Pay per Bump" is that they are a very unobtrusive form of advertising. Most members wont ever realise that there is paid advertising (apart from those that pay for it)

This plug-in allows users to pin / bump threads in selected forums you decide. The plug-in is integrated with PayPal, so that users can buy credits, the credits will automatically be added to their account once the transaction is complete. Users can then use these credits to bump threads or pin threads <and soon, pay for site adds>

The only people that will see the "bump" of "pin" buttons will be the thread creator (or people with thread edit permissions.. mods/admins)
The only person that will have access to pay to bump / pin a thread will be the thread creator

Thread Bumping
Forums that you select as "bumping forums" are no longer ordered by last_post date, but are now ordered by created time (or bump time). This ordering will only apply to the forums you select as thread bumping forums. This prevents users from bumping their adverts by simply replying to them. If the user wishes to bump their thread, the need to press the bump button and pay credits (the amount is defined by you)

Thread Pinning (sticky threads)
Thread pinning can be added to any forum. Pinned threads are now ordered by the bid price on forums that you select as "pinning forums". The more the users has bid for their pinned thread, the higher up the list the thread is pinned. The threads are pinned for a user defined time (the default is 1 week), the user can select to pin the thread for more weeks (but will be charged more). A cron job runs every morning to check for any expired pinned adverts. You can add more frequent cron jobs if required. On running the cron job, any expired pinned adverts are unpinned. After this, the user can pay to re-pin the thread if they wish
[Please note, it is okay to un-stick/unpin threads that have been stuck, it will not cause an issue with this plug-in... but you might get told off by the person that paid for it]

Enchantments to come:
- display date/time of pinned expiry
- allow user to bid more after they have pinned their thread
- an area to show payment / credit history in the users control panel
- an area to show all payment / credit history in the admin/mod users control panel

To Come : Pay Per Click Adverts
This will take some work, but I will use the credit system here to charge for the Pay Per Clicks. <when no adds have been bought, it will default to your Google ads>

IMPORTANT: A PayPal mechanism has been provided for user to buy credits, but you will need to add your own buttons to the templates. To add PayPal buttons, you will need a PayPal merchant account (which is free), or a PayPal business account. (demo PayPal buttons have been added, but they are demo only, you will need to update the sfaddfunds template)

The hardest part of setting up this plug-in is the PayPal set up, I will explain that in a separate post below. I appreciate the PayPal site isn't an easy site to use, I'll try to help where I can, but please please please read my set up instructions before asking for support.

To Install

Installation:
  • Upload the entire contents of the attached zip to the XenForo root
So now you should have a structure:
www.myforum.com/library/XenKingPin/
www.myforum.com/requests/
  • Go to ACP -> Add-ons -> Install Add-on -> Install from file on server
  • Install from file on server: " library/XenKingPin/addon-XenKingPin.xml"
  • Set options in administration control panel
ACP>>Home>>Options>>[SurreyForum] XenKingPin
Once in the ACP, select the forums you wish to be "pay for bump" forums, and select forum you wish to be "pay for pin" forums (forums CAN be both, in fact I use both on one forum advertising area), please make sure you select forums and not categories

Uninstallation:

Since I believe the tables could be fairly sensitive, before uninstalling this plug-in, open the file: library\XenKingPin\install.php
and uncomment the section:

// $db->query(" DROP TABLE IF EXISTS`sf_xenkingpin_pp_history`,`sf_xenkingpin_credits`, `sf_xenkingpin_thread` ");

Download:
 

Attachments

A few snaps (added new overlay styles):
 

Attachments

  • KingPinACP.webp
    KingPinACP.webp
    39.9 KB · Views: 195
  • KingPin_PINBUMP_Buttons.webp
    KingPin_PINBUMP_Buttons.webp
    55.6 KB · Views: 197
  • paytobump2.webp
    paytobump2.webp
    13.8 KB · Views: 142
  • paytopin3.webp
    paytopin3.webp
    23.4 KB · Views: 136
  • addfunds3.webp
    addfunds3.webp
    20 KB · Views: 137
  • updatepin.webp
    updatepin.webp
    27.2 KB · Views: 130
Navigating around PayPal is a headache

So I'll try to give as clear instructions as I can to help you

1) You will need a PayPal account
2) You will need to make you PayPal account a Merchant account or a Business Account (a Merchant Account is FREE)
3) Log into PayPal
4) Navigate to the area where you can create buttons, it should be possible to navigate to this area:
https://www.paypal.com/uk/cgi-bin/webscr?cmd=_button-management

For now, create the button as I have, using the same prices <see here>
Item name: Credits Item ID: credits
Add dropdown: true

100 Credits, 10.00, GBP
220 Credits, 20.00, GBP
460 Credits, 40.00, GBP
940 Credits, 80.00, GBP
2000 Credits, 160.00, GBP

5) Select the done button, then select save changes
6) Select the code, copy it and go to your xenForo ACP
7) open the templates up and navigate to the sfaddfunds template
8) Find the demo form, and paste your new form under it
9) If you look at the demo PayPal form, you will notice it has a line:

"<input type="hidden" name="custom" value="{$visitor.user_id},{$visitor.username}">"

and the form also uses this class:
class="xenForm formOverlay"

-- Add this line to your new PayPal form, and remove the demo Form
-- make sure your new form also contains the class above
-- You can now navigate to the page: yourforum.com/funds/addfunds/ and it should look something like the attached <see here>
10) now update the IPN area. Deeply hidden in your PayPal Profile area, you'll eventaully run into options to "update" your IPN (Instant Notifcation), if you cant find it <click here>

Update these settings so they look like this: <see here> (obviously use your forum below):

Notification URL: http://www.yourforum.co.uk/requests/IPN_PHP.php
Notification: Enabled

Save these settings... and you should be done

... If you want to change the price of credits, you will need to update the file IPN_PHP.php
... If you want to test the payment, I would look at the PayPal sandbox area. You will need to update the PayPal button form and the IPN_PHP file ( - using the sandbox area is a little tricky at first, but its worth doing if you want to make any big changes / or you are thinking of using PayPal for your own plug-in)
 

Attachments

  • paypal1.webp
    paypal1.webp
    63.5 KB · Views: 176
  • IPN1.webp
    IPN1.webp
    44.2 KB · Views: 167
  • addfunds3.webp
    addfunds3.webp
    20 KB · Views: 124
Would it be possible to integrate this add-on with [BD]Banking add-on so that the users can use those points from that mod to bump or pin those threads?
 
Possibly. I wanted these points to be locked in for my purpose (no money going out / no transfer of points / strictly for income from advertising), I've still lots to do, but it might be possible .

If I do it, its a long way down my list... for now I'm just concentrating on what this plug-in can offer for income.

Transferring points and earning points isn't really what this was designed for, it was designed for areas of the forum where people like to advertise (in which case they can "Pay to Pin" and "Pay to Bump")
 
Nice work, was one of the mods I was going to have made for me.

May I suggest you work a little on the styling, some of the layouts / texts you use look a little unproffessional compared to the high standard normally found in xF :)
 
Yes, the templates "look-and-feel" isn't very good at all right now. The buttons look great, since they're using xenforo styles, but the 2nd level pages don't look so great (I mainly play with databases, so styling isnt my strong point :( )

I was going to do the pay per click ads next, but can work on styling, any suggestion for how you think the 2nd level pages should look?

To do list, order of priority:

1) Improve the styling for the 2nd level pages (I agree, it is important) - Done 16/09/11
2) Allow user to update their bids after they have bid - Done 16/09/11
3) Give ACP options for the Forum index to display the "lasted bumped post" Or the "lastest replied post":
"for the selected bump forums, the forum index will now: show the lasted bumped/created thread || show the latest replied thread"
4) Make better use of xenForo Phrases to make this more user configerable
5) ACP option to make Pinned / Bumped threads a special style (configurable)
6) Pay Per Click Ads << thats a big one
7) Create an area for users to look at their payment & credit history
8) Create an area for admins to look at all users payment & credit history
9) Allow the super admin to Add / Remove credits from any users
 
Yes, the templates "look-and-feel" isn't very good at all. The buttons look great, since they're using xenforo styles, but the 2nd level pages don't look so great (I mainly play with databases, so styling isnt my strong point :( )

I was going to do the pay per click ads next, but can work on styling, any suggestion for how you think the 2nd level pages should look?

Use the xenforo popup overlay, and put it in there opposed to a seperate page.

Remove the large fonts, no need to do that. Just looks ugly.
 
- I Agree completely, the XenForo overlays looks great for this, and its ideal for a button click... Why didn't I think of this to begin with..
[I'm Still new to designing xenForo Plug-ins, so I'm still finding my way around]

It looks so easy to do to:
Code:
<a href="{xen:link 'misc/contact'}" class="OverlayTrigger" data-overlayOptions="{&quot;fixed&quot;:false}">{xen:phrase contact_us}</a>

Thanks
 
It looks a lot better when using overlays (see attached)

I should have these templates updated and a new version release by the end of today
 

Attachments

  • paytopin2.webp
    paytopin2.webp
    24.8 KB · Views: 148
Don't forget that all overlays also have an equivalent page (for anyone browsing with JavaScript disabled), so you might want to right-click and open in a new tab to check how it looks .

It should be fine if you get the overlay looking OK.
 
Don't forget that all overlays also have an equivalent page (for anyone browsing with JavaScript disabled), so you might want to right-click and open in a new tab to check how it looks .

It should be fine if you get the overlay looking OK.
The good think in xenforo is, it's handeled automatic;)
You don't need to do anything, only give the class & form the right classes.
If you have js => it will show you the normal page as a overlay
If not, it will redirect you to the page
 
Agreed, but it's always worth double checking how it looks in the standalone page, just in case.
 
I like this idea. However the front-end doesn't look like it belongs to XenForo. I'm a fan of addons that try to use the styles XenForo provides so the overall consistency of everything feels seamless. No one would know it's an addon you're using. I would work on your front-end a bit.

Have you thought about integrating the account upgrades section to provide the credits for purchasing? Also, how about doing more than just bumping or sticking a thread. How about putting a different color behind your thread so it stands out? I was thinking of making something like this for a site I have that will let users posts advertisements. the features I was hoping to add is:
  • The ability to purchase a sticky for certain amount of time (defined by me).
  • The ability to add a special look and feel to the thread so it stands out (defined by me).
  • The ability for the user to purchase this ability on a (X) amount of days (defined by me).
  • Credits System
    • User can purchase credits via the subscription service provided by XenForo.
    • Profile page keeps track of credits information and warns them of low credits.
Just some suggestions and feedback.
 
Possibly. I wanted these points to be locked in for my purpose (no money going out / no transfer of points / strictly for income from advertising), I've still lots to do, but it might be possible .

If I do it, its a long way down my list... for now I'm just concentrating on what this plug-in can offer for income.

Transferring points and earning points isn't really what this was designed for, it was designed for areas of the forum where people like to advertise (in which case they can "Pay to Pin" and "Pay to Bump")

The points wouldn't really be "earned" because I would be the only one getting them. However, I also understand the point of the add-on and I hope to see future updates :D
 
I've now updated the zip (in the 1st post), with version: xenKingPin_v1_0_3.zip

The paytopin, paytobump, and addfunds areas are now all overlays (and also work independently as pages)
- I also took this opportunity to do some code tidying.

This looks a lot better, thanks for the suggestion
 
I've now updated the zip (in the 1st post), with version: xenKingPin_v1_0_3.zip

The paytopin, paytobump, and addfunds areas are now all overlays (and also work independently as pages)
- I also took this opportunity to do some code tidying.

This looks a lot better, thanks for the suggestion

No problem, ill take a branding free version as my fee :D
 
No problem, ill take a branding free version as my fee
Cheeky ;)

I like this idea. However the front-end doesn't look like it belongs to XenForo. I'm a fan of addons that try to use the styles XenForo provides so the overall consistency of everything feels seamless. No one would know it's an addon you're using. I would work on your front-end a bit.

Done, see above screen shots

Have you thought about integrating the account upgrades section to provide the credits for purchasing? Also, how about doing more than just bumping or sticking a thread. How about putting a different color behind your thread so it stands out? I was thinking of making something like this for a site I have that will let users posts advertisements. the features I was hoping to add is:

How would the account upgrades work,
1) when a user pays for an upgrade, give them x amount credit
or
2) When a user is upgraded (due to what ever reason), they now belong to a group that can "buy credits"
-- I'm not sure how useful either of these would be, since I think most would like the ability to "make money" from any users, rather than restricting the options to certain groups.
The options to buy credits/bump/pin will only be visible to users that create the post in the "bumping / pinning" section, so I'm not sure what benefit restricting the option to buy credits would give

Currently the only people that will ever see these options are "advertisers", so no restriction is necessary

  • The ability to purchase a sticky for certain amount of time (defined by me).
  • The ability to add a special look and feel to the thread so it stands out (defined by me).
  • The ability for the user to purchase this ability on a (X) amount of days (defined by me).
  • Credits System
    • User can purchase credits via the subscription service provided by XenForo.
    • Profile page keeps track of credits information and warns them of low credits.
Just some suggestions and feedback.

The stickies are already bought for a defined amount of time (you can define the cycle to 1 hour, 168 hrs (default = 1 week), x hrs)
The minimum cycle is defined by you (I could put a max limit on this, but since the user will have to pay the bid price multiplied by the cycle, a maximum limit could mean you lose out on money)

- The special look sounds like a good idea, I'll add it to my to-do list, but I think I would just do it to pinned/bumped threads, so they stand out

- Integrating with the xenForo subscription is something that I could look into, but it will be low down on my list for now

- The profile page/credit history is already on my "to do list" (see here)

Some great suggestions, thanks LP-John
 
Cheeky ;)

Done, see above screen shots

How would the account upgrades work,
1) when a user pays for an upgrade, give them x amount credit
or
2) When a user is upgraded (due to what ever reason), they now belong to a group that can "buy credits"
-- I'm not sure how useful either of these would be, since I think most would like the ability to "make money" from any users, rather than restricting the options to certain groups.
The options to buy credits/bump/pin will only be visible to users that create the post in the "bumping / pinning" section, so I'm not sure what benefit restricting the option to buy credits would give

Currently the only people that will ever see these options are "advertisers", so no restriction is necessary

The stickies are already bought for a defined amount of time (you can define the cycle to 1 hour, 168 hrs (default = 1 week), x hrs)
The minimum cycle is defined by you (I could put a max limit on this, but since the user will have to pay the bid price multiplied by the cycle, a maximum limit could mean you lose out on money)

- The special look sounds like a good idea, I'll add it to my to-do list, but I think I would just do it to pinned/bumped threads, so they stand out

- Integrating with the xenForo subscription is something that I could look into, but it will be low down on my list for now

- The profile page/credit history is already on my "to do list" (see here)

Some great suggestions, thanks LP-John

Good job on the interface changes, but I would fix the add funds section now. It looks very weird left aligned. I would center it. Then using CSS space our the PayPal button and select menu (for choosing the cost).

Also having this work with the user upgrades would essentially make it easier to manage adding credits. So when the user goes to user upgrades you can call the upgrade something like "1,000 Credits" and it will give them 1000 credits and you could even set it to be recurring on a monthly basis.

I have attached a screenshot of how you could make it look:
credits_idea.webp
 
Top Bottom