vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Link to subscriptions page if user can not post attachments or new post (https://vborg.vbsupport.ru/showthread.php?t=71361)

GilbertZ 11-03-2004 10:00 PM

Link to subscriptions page if user can not post attachments or new post
 
Version: 1.0
vBulletin Version: 3.0.3
Developer: GilbertZ
Hack-Language: English
Install-difficulty: Low
File-edits: 2
Template-edits: 1
Is this hack supported: Officially, no. But I will try to keep an eye out and help where I can.

Description of the Hack:
Do you charge a subscription for users to upload files? Instead of just not showing them the attachments options, how about letting them know why they can't post attachments and giving them a link to the subscriptions page? This does that.

Files to edit:
newreply.php
newthread.php

Open newreply.php

Go to line 307 and look for:

PHP Code:

        $attachmentoption ''

replace with

PHP Code:

//HACK BEGINS
//        $attachmentoption = '';
        
eval('$attachmentoption = "' fetch_template('newpost_no_attachment') . '";');
//END HACK 

Open newthread.php

Go to line 259 and look for:

PHP Code:

        $attachmentoption ''

replace with

PHP Code:

//HACK BEGINS
//        $attachmentoption = '';
        
eval('$attachmentoption = "' fetch_template('newpost_no_attachment') . '";');
//END HACK 

Go to your AdminCP and create a new template called:
newpost_no_attachment

and put the following text in it:

HTML Code:

<fieldset class="fieldset">
 <legend>$vbphrase[attach_files]</legend>
 <div style="padding:$stylevar[formspacer]px">
  <div style="margin-bottom:$stylevar[formspacer]px">
  <div>In order to attach files you need to <a href="subscriptions.php" target="_blank">upgrade</a> your membership.</div>
  </div>
 </div>
</fieldset>

This hack is running at http://www.simstalk.com . If you want to check it out, please make sure not to actually post anything as it is a live board.

GilbertZ 11-04-2004 09:41 PM

Another thing I added for when users try to post in forums where posting requires a subscription, is to make the following change in the phrase manager:

Change the text in $vbphrase[nopermission_loggedin]
HTML Code:

<p>
<strong>$bbuserinfo[username]</strong>, you do not have permission to access this page. This could be due to one of several reasons:</p>
<ol> <li>Your user account may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?</li>
<li>You may need to <a href="subscriptions.php">upgrade</a> your account in order to do this.</li>
<li>If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.</li> </ol>
<div align="$stylevar[right]"> <a href="login.php?$session[sessionurl]do=logout&amp;u=$bbuserinfo[userid]">Log Out</a> <a href="$vboptions[forumhome].php?$session[sessionurl]">Home</a> </div>


manguish 11-04-2004 09:44 PM

Excellent - works great.

Thanks bud.

nexialys 11-04-2004 10:08 PM

this is one of the best solution ever for subscriptions.. this will bring more people to subscribe, as they will understand the reason why...

alkatraz 11-05-2004 12:15 AM

fantastic!

Hades-1 11-05-2004 07:16 PM

What about over quota?

Lets say they can upload 3 files under normal membership, if a user is at max qutoa will it say "upgrade your membership" ?

GilbertZ 11-05-2004 07:41 PM

Quote:

Originally Posted by Hades-1
What about over quota?

Lets say they can upload 3 files under normal membership, if a user is at max qutoa will it say "upgrade your membership" ?

I haven't tested that, but basically if it triggers the forumpermissions which states that the user does not have permission to upload an attachment, then it'll pop up that message. Here is the eval statement:

PHP Code:

if ($forumperms CANPOSTATTACHMENT AND $bbuserinfo['userid']) 

If the above fails, then you get the upgrade message.

alkatraz 11-25-2004 10:16 PM

awesome hack! thanks

Quote:

What about over quota?
I'm wondering this too, is it working for you?

BarryoBrien 06-20-2007 09:14 AM

will this work with vb 3.6.4?


All times are GMT. The time now is 06:31 AM.

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.01155 seconds
  • Memory Usage 1,746KB
  • 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_html_printable
  • (5)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete