vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   New Posting Features - Download Credit System (https://vborg.vbsupport.ru/showthread.php?t=78953)

tnguy3n 03-27-2005 10:00 PM

Download Credit System
 
Author: tnguy3n (Thinh Nguyen)
Live Demo: http://www.all4actions.net
Description:
This hack allows admin to set a specific amount of credit required to download each attachment. Admin can assign which forums this hack to take effect, excluding usergroups not to be restricted by it, resetting user's credit ...
Users can earn credits by making threads/replies, or sharing their files (upload). This hack may become handy in some ways, it forces members on your board to post more to earn credits, also to prevent leechers.
Default settings of of Download Credit System is off. Go to Admincp -> vBulletin Options -> Download Credit System to activate it.

VERSION v.1.1 is newest release. If you installed previous version, please reverse it (actually, just 3 files: includes/functions_newpost.php, attachment.php, newattachment.php), then re-install new one.

Features:
- Ability to reset users credits
- Exceptional Groups
- Credit System Applied To Specific Forums
- Credits Per Post
- Credit Per Thread
- Credit Per Attachment
- Download Cost (users download their own attachments at no cost)
- Pet Owning Cost **

Planned features: (next release)
- ucash/ushop integration
- paypal integration

Queries (run installer http://yoursite/forum/admincp/credit..._installer.php)
File Modification: 4
Template mod: 2
Installation Time: 3-5 mins
Tested in vb 3.0.3 -> 3.0.7

Pls click INSTALL button if you use it.

lasto 03-28-2005 03:48 PM

installed and works fine - was real easy installation as well.

One problem - it costs us our own credit to download any attachments we have uploaded.Should`nt anything we upload be free for us to download - but besides that it does what it says on the can :)

Well done m8 - quick and easy way to make people be active if they want something

nexialys 03-28-2005 03:48 PM

hum... we win points by posting etc... good thing, but would it be handy to compare with the other point systems (uShop etc) so there is no double points anywhere?!

or making this system compatible with the uShop would be even better... no need to edit all the files, just the download part...!!!
(these are suggestions thought!)

tnguy3n 03-28-2005 03:55 PM

good points, lasto. and thanks for the feedbacks guys. making it compatible with uCash system is on my todo list already. :)

lasto 03-28-2005 03:56 PM

you know for posts - 0.25

they never add up

i did four replys in suscession so should of got 1 point after the fifth reply it still never showed up

infact something aint right

i set it so u get 1 point for new thread and 1 point for each attachment

now just done a new thread and added an attachment with it but i only got 1 point altogehter ??

tnguy3n 03-28-2005 03:59 PM

Quote:

Originally Posted by lasto
you know for posts - 0.25

they never add up

i did four replys in suscession so should of got 1 point after the fifth reply it still never showed up

infact something aint right

i set it so u get 1 point for new thread and 1 point for each attachment

now just done a new thread and added an attachment with it but i only got 1 point altogehter ??

sorry, i use int type in that column, so it rounds up .25 = 0 . I forgot to change that value back in my installer.

lasto 03-28-2005 04:05 PM

tnguy3n i would actually use this but at moment im using it local on me comp.

Is this possible - if attachment is RAR then credit to download

if attachment is jpeg or gif its free so no credit needed - as i run a map forum for RTCW and ET and people upload maps as rars but they also add a preview pic and dont want to start charging people to view a preview pic.

Also this needs fixing badly

Quote:

Originally Posted by lasto

infact something aint right

i set it so u get 1 point for new thread and 1 point for each attachment

now just done a new thread and added an attachment with it but i only got 1 point altogehter ??

as you will penaliseing people who add attachments to their first post in a thread.

tnguy3n 03-28-2005 04:12 PM

another great suggested feature. You can just put an if...else statement in newattachment to check whether the uploaded file is within "credit-up" extensions.
I'll look into it later of the day (run for class now).

lasto 03-28-2005 04:16 PM

cheers m8 not sure how to do the statement so any help appreciated on that - catch u laters when u back from class.

Lionel 03-28-2005 10:21 PM

I would love to see this integrated with ushop

lasto 03-29-2005 12:12 AM

dont use ushop - so just happy to have them few bits above fixed.

tnguy3n 03-29-2005 01:27 AM

I made a few fixes just by now. users can download their own attachments with no cost; unfortunately, extension part still ain't work. :rolleyes:

NitroMan 03-29-2005 02:40 AM

has anyone else had this problem
the post count not showing up or the credits
help if u can thanks

AlienSector 03-29-2005 07:51 AM

Another suggestion would be allow others to purchase download credits via PayPal and update upon payment completion. I am sure many would gain use from this feature.

Deaths 03-29-2005 08:43 AM

I've created this addon for the hack:
[Addon]Download Credit System with uCash

Enjoy :)

tnguy3n 03-29-2005 08:52 AM

check your settings, Credit System For Forums. Leave that part blank or the forum your post replies must be included there.

lasto 03-29-2005 09:07 AM

tnguy3n what part of code have u updated so members can download there own attachments for free as already installed it so dont want to have to re-do it all.

lasto 03-29-2005 12:27 PM

heres the problem m8

as you can see by the pic u need a credit to actually view the pic that is attached whihc is useless really.

Ok have messed with this for a few hours and the hack simply dont work.
it works if u want every attachment on your board to be paid for with credit but the option in admin to set certain forums certainly dont work.

I had set forum id 2 in admincp as the only forum which people need credit for to download but any attachments in any other forum also fall under the credit system even though they are not listed in admincp.

So it seems it covers every attachment on all the board inc all sections.

if these bugs could be solved this would be a good hack to have.

1 - maybe have an option to exclude forums
2 - jpegs or gifs do not require credits
3 - bug where it covers every attachment on the board - and not sections. (forum IDS)

Wential 03-29-2005 01:09 PM

Fantastic!

Julie 03-29-2005 01:24 PM

Seems like a cool idea this one, but I was merely wondering if I could manually alter the credit number in the AdminCP? Like, if a user has 76, I can alter the number to f.ex. 50?

lasto 03-29-2005 01:32 PM

yeah u can alter credit for any user just by going to admincp and looking up that user -there is a new box there under the reputation which says how mucj they got.You can give or take at will.

But hack still has serious flaws to it at moment.


https://vborg.vbsupport.ru/showpost....6&postcount=18

Julie 03-29-2005 01:58 PM

Hm, it's not so important about the attachments... I was thinking of kinda using this in a RPG setting, where the credit points can be used it a shop f.ex :) But thanks for the reply! :)

tnguy3n 03-29-2005 02:18 PM

I'll release updated version of this hack later of the nite.
@ lasto: don't use space between commas and forumids, just commas.

Julie 03-29-2005 03:00 PM

Okies, I have a question... It seems that every user on my board (or at least the ones I looked at) had the same points as me (admin account). Even if I altered one user's account to have 8 points, it still displayed 4 points, which my account has (4 points)...

Any idea how to fix this? Thanks,

Edit in: Apparently only I (Superadmin) can view the credit points... The other usergroups (even other admins) can't...

Julie 03-29-2005 03:15 PM

Quote:

Originally Posted by NitroMan
has anyone else had this problem
the post count not showing up or the credits
help if u can thanks

I have the problem that only I can see them, but did you add the code in the postbit_legacy template? At first I just added it in the POSTBIT template, but that didn't work.... Added it in postbit_legacy and it worked :)

lasto 03-29-2005 03:45 PM

Quote:

Originally Posted by tnguy3n
I'll release updated version of this hack later of the nite.
@ lasto: don't use space between commas and forumids, just commas.

look forward m8 to the update and thanks

as for the forumids there was`nt any spaces as on that line all i had was

2

nothing else yet every other forum still wanted creidt to view a pic or attachment.

tbh im not really bothered about all forums have a price to download an attachment as can get round that by only allowing certain forums to be allowed to have attachments but the main problem is the jpegs and gifs
Need these to get around the problem and ill be happy.

PixelFx 03-29-2005 11:58 PM

Looks like a good hack, if you can add admincp to exclude specific files or images it from the credit / points system would be worth installing. also if you could make a phrase to change the name from credits to anything that would be cool. of if your using ucash system to have it take on the name points.

Deaths 03-30-2005 07:04 AM

I've created an addon for it to work with uCash, find it here: https://vborg.vbsupport.ru/showthread.php?t=79000

Deaths 03-30-2005 08:15 AM

Ok, this *might* work, I guess it's worth the try.

Find:
PHP Code:

// Begin Download Credit System 

BELOW, add:
PHP Code:

 $extension strtolower(file_extension($attachmentinfo['filename']));
 switch(
$extension)
 {
    case 
'gif':
    case 
'jpg':
    case 
'jpeg':
    case 
'jpe':
    case 
'png':
    case 
'bmp':
                 
        
$vboptions['credit_mode']=0;
        
$cmpt++;
                        
    break;



lasto 03-30-2005 08:26 AM

what file ??

newattachment or attachment ?

in fact will try both

BRB

lasto 03-30-2005 08:36 AM

EDIT

Ok am back - Its looking good so far - done a few test posts with 1 preview pic and 1 small test rar

The rar wont download if got no credit which is fine but the pic loads fine :)
will do a few more tests to see if its 100% but so far its looking good.

EDIT (again)

Ok can confirm that the code that Death posted does show image files while making people pay a credit to download the attached rar.

add the code in attachment.php

Deaths 03-30-2005 09:13 AM

If you add it to newattachment.php it wont give credits for images, if you add it to attachment.php it wont ask credits for the images :)

Deaths 03-30-2005 09:14 AM

Quote:

Originally Posted by lasto
EDIT

Ok am back - Its looking good so far - done a few test posts with 1 preview pic and 1 small test rar

The rar wont download if got no credit which is fine but the pic loads fine :)
will do a few more tests to see if its 100% but so far its looking good.

EDIT (again)

Ok can confirm that the code that Death posted does show image files while making people pay a credit to download the attached rar.

add the code in attachment.php

Good to hear!
Thanks for testing :).

tnguy3n 03-30-2005 01:50 PM

Sorry, i still ain't able to complete integration with Ushop/Ucash nor pet system or Paypay due to my massive amount of skool work + works. However, I release this version v.1.1 of the hack (as update) to patch some minor bug in previous version. I didn't update instruction(no time), but you can reverse previous version of the hack, then install new one, v.1.1.

fixes in version 1.1.
- system works in assigned forums
- user download their own attachment for no costs
- fix upload stats

TO FIX BUG in inaccuracy of upload stats (multiple attachments), it's recommended to set max allowed upload attachment to 1.


Features will be included in next release v.1.2 (working on it on my localhost now)
- image files will be free to view
- credit system applied to certain file extensions
- Ucash/Ushop integration
- vbpet integration
- paypay integration


v.1.2 expected to be released this weekend. stay tuned.

and thanks Deaths + lasto for great inputs + suggestions. :up:

Deaths 03-30-2005 01:55 PM

If you wish, you may use my uCash integration code (can be found in my addon thread), and the 'Dont show image' (can be found in this thread) :).

You can edit my 'Dont show image' code to apply to other attachment types aswell, just add a new case line ;)

tnguy3n 03-30-2005 02:00 PM

thanks, I might use your uCash integration. for images, i used if statement to check if it's in "credit" array, return false if not. :)

Deaths 03-30-2005 02:01 PM

Thats posible aswell :).

If you don't have any time, just send me a PM, I'll code the addons for you.

tnguy3n 03-30-2005 02:06 PM

thanks, I'll send you the project if I ain't be able to finish it this weekend. I'm pretty busy, skool + work already take away my whole day.

Deaths 03-30-2005 02:17 PM

Ok mate, sounds good.

lasto 03-30-2005 02:20 PM

looking good and cheers


All times are GMT. The time now is 07:36 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01341 seconds
  • Memory Usage 1,830KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete