1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. 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>

Discussion in 'Add-on Releases [Archive]' started by tenants, Sep 15, 2011.

  1. tenants

    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:
     

    Attached Files:

    Puntocom, Walter, Dan and 6 others like this.
  2. tenants

    tenants Well-Known Member

    A few snaps (added new overlay styles):
     

    Attached Files:

    ShadyX likes this.
  3. tenants

    tenants Well-Known Member

    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)
     

    Attached Files:

  4. Sylar

    Sylar Well-Known Member

    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?
     
    faeronsayn likes this.
  5. tenants

    tenants Well-Known Member

    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")
     
  6. Slavik

    Slavik XenForo Moderator Staff Member

    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 :)
     
  7. tenants

    tenants Well-Known Member

    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
     
  8. Slavik

    Slavik XenForo Moderator Staff Member

    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.
     
    tenants likes this.
  9. tenants

    tenants Well-Known Member

    - 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
     
  10. tenants

    tenants Well-Known Member

    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
     

    Attached Files:

  11. Brogan

    Brogan XenForo Moderator Staff Member

    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.
     
  12. ragtek

    ragtek Guest

    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
     
  13. Brogan

    Brogan XenForo Moderator Staff Member

    Agreed, but it's always worth double checking how it looks in the standalone page, just in case.
     
  14. John L.

    John L. Well-Known Member

    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.
     
    onthefly likes this.
  15. Sylar

    Sylar Well-Known Member

    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
     
  16. Lenin

    Lenin Active Member

    cool---- thnaks.
     
  17. tenants

    tenants Well-Known Member

    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
     
    laztrix likes this.
  18. Slavik

    Slavik XenForo Moderator Staff Member

    No problem, ill take a branding free version as my fee :D
     
  19. tenants

    tenants Well-Known Member

    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
     
  20. John L.

    John L. Well-Known Member

    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.jpg
     

Share This Page