Thread: Miscellaneous Hacks - Cyb - Advanced Registration
View Single Post
  #97  
Old 09-16-2010, 04:57 PM
ryancooper ryancooper is offline
 
Join Date: Jul 2002
Posts: 433
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

to allow admins only to use this replace the template cyb_areg_invite with

Code:
        $stylevar[htmldoctype]
        <html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
            <head>
            $headinclude
            <title>$vboptions[bbtitle] - $vbphrase[cybareg_invitations]</title>
            <script language="Javascript" type="text/javascript">
                function CybAReg_CheckMail(email_field,error_field,target){
                    emailRegExp = /^[_A-Za-z0-9-]+(\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(\.([A-Za-z]){2,4})$/;
                    var error_address = '$vbphrase[cybareg_invitation_mailerror]: ';
                    var error_blank = '$vbphrase[cybareg_invitation_missingmail]';
                    var error_number = '$vbphrase[cybareg_invitation_limit]: $vboptions[cybareg_invite_oncelimit]';
                    var wait_message = '$vbphrase[cybareg_wait]';
                    var email = target.split(","); 
                    var errmail = "";

                    if (target=='')
                    {
                        document.getElementById(error_field).innerHTML=error_blank;
                        document.cybareg_invite.cybareg_invite_email.focus();
                        return false;
                    }
                    else if (email.length>$vboptions[cybareg_invite_oncelimit])
                    {
                        document.getElementById(error_field).innerHTML=error_number;
                        document.cybareg_invite.cybareg_invite_email.focus();
                        return false;
                    }
                    else
                    {
                        for (var i in email)
                        {
                            if (!emailRegExp.test(email[i]))
                            {
                                errmail += "; " + email[i];
                            }
                        } 
                        if (errmail)
                        {    
                            document.cybareg_invite.cybareg_invite_email.focus();
                            document.getElementById(error_field).innerHTML=error_address + "<span class=\"smallfont\">" + errmail.substr(1) + "</span>";
                            return false;
                        } else {
                            document.getElementById(error_field).innerHTML=wait_message;
                            return true;
                        }
                    }
                }
                function CybAReg_UpdName(name){
                    if (name=='')
                    {
                        cybareg_name = "";
                    }
                    else
                    {
                        cybareg_name = " (" + name + ")";
                    }
                    document.getElementById('cybareg_nameupd').innerHTML=cybareg_name;
                }
            </script>
            </head>
            <body onload="document.cybareg_invite.cybareg_invite_email.focus();">
            $header
            $navbar
            <if condition="(($vboptions[cybareg_invite_amount]>0) AND ($cyb_areg_total_inv_user >= $vboptions[cybareg_invite_amount]))">
                <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
                    <tr valign="top">
                        <td class="tcat" align="$stylevar[left]">$vbphrase[cybareg_invitations]</td>
                    </tr>
                    <tr>
                        <td class="alt1" align="center"><phrase 1="$vboptions[cybareg_invite_amount]">$vbphrase[cybareg_invitation_nomore]</phrase></td>
                    </tr>
                </table>
            <else />
                
    <if condition="$bbuserinfo['usergroupid'] == 6">



<form name="cybareg_invite" id="cybareg_invite" action="misc.php?do=cybareginvdo" method="post" onsubmit="return CybAReg_CheckMail('cybareg_invite_email','cybareg_wrongmail', document.cybareg_invite.cybareg_invite_email.value);">
                    <input type="hidden" name="securitytoken" value="$cybareg_sectok" />
                    <input type="hidden" name="cybareg_inviter_id" value="$bbuserinfo[userid]" />
                    <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
                        <tr>
                            <td class="tcat" align="$stylevar[left]" colspan="2">$vbphrase[cybareg_invitations] $cyb_areg_inv_myinfo</td>
                        </tr>
                        <tr>
                            <td class="thead" align="$stylevar[left]">$vbphrase[email]</td>
                            <td class="thead" align="$stylevar[left]" width="50%">$vbphrase[cybareg_invitation_message_info]</td>
                        </tr>
                        <tr>
                            <td class="alt1" align="center"><span class="smallfont">$vbphrase[cybareg_invitation_notes]</span><br /><br /><span id="cybareg_wrongmail" style="color:red;">$vbphrase[cybareg_invitation_recipients]:</span><br /><br /><input type="text" class="smallfont" id="cybareg_invite_email" name="cybareg_invite_email" value="" size="50" dir="ltr" /></td>
                            <td class="alt2" align="$stylevar[left]" rowspan="2"><pre style="font-family:Verdana;font-size:11px">$cybareg_invmess_preview</pre></td>
                        </tr>
                        <tr>
                            <td class="alt1" align="center"><span class="smallfont">$vbphrase[cybareg_invitation_realname]</span><br /><br /><span>$vbphrase[cybareg_invitation_yourname]:</span><br /><br /><input type="text" class="smallfont" id="cybareg_inviter_name" name="cybareg_inviter_name" value="" size="50" dir="ltr" onkeyup="CybAReg_UpdName(this.value);" /></td>
                        </tr>
<tr>
                             <td class="tfoot" align="center" colspan="2">                       <input class="buton" type="submit" value="&nbsp;$vbphrase[send]&nbsp;" /><br>At this time invites are limited to admins only.</td>
                        </tr>
                    </table>
                </form>
            </if></if>
            <br />
At this time invites are limited to admins only.
            $footer
            </body>
        </html>
it doesn't actually NOT allow users to use the invites BUT it hides the invite forum to all but admins... Hope this helps soneone!

Ryan
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02314 seconds
  • Memory Usage 1,812KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete