Saturday, September 28, 2013

Automatic Subscriptions For All Members On MyBB

Automatic Subscriptions For All Members On MyBB. If you want all your users to be subscribed to every thread and forum, this is for you. This tutorial makes the most minor edits. There are better ways to do this, however they require you to remove and replace code in the templates instead of putting in a few very minor additions.

Step 1: Eliminate the user's ability to change their subscription mode
In User Control Panel Templates->usercp_options

Change:

<tr>
<td colspan="2"><span class="smalltext"><label for="subscriptionmethod">{$lang->subscription_method}</label></span></td>
</tr>
<tr>
<td colspan="2">
    <select name="subscriptionmethod" id="subscriptionmethod">
        <option value="0" {$no_subscribe_selected}>{$lang->no_auto_subscribe}</option>
        <option value="1" {$no_email_subscribe_selected}>{$lang->no_email_subscribe}</option>
        <option value="2" {$instant_email_subscribe_selected}>{$lang->instant_email_subscribe}</option>
    </select>
</td>
</tr>


To:
<tr style="display:none">
<td colspan="2"><span class="smalltext"><label for="subscriptionmethod">{$lang->subscription_method}</label></span></td>
</tr>
<tr style="display:none">
<td colspan="2">
    <select name="subscriptionmethod" id="subscriptionmethod">
        <option value="0" {$no_subscribe_selected}>{$lang->no_auto_subscribe}</option>
        <option value="1" {$no_email_subscribe_selected}>{$lang->no_email_subscribe}</option>
        <option value="2" {$instant_email_subscribe_selected}>{$lang->instant_email_subscribe}</option>
    </select>
</td>
</tr>


Which simply inserts
style="display:none"
for both <tr> tags that house the thread subscriptions code.

Step 2: Set it up so that new members are created with default subscription mode of your choice.
In Member Templates->member_register

Change:

<tr>
<td colspan="2"><span class="smalltext"><label for="subscriptionmethod">{$lang->subscription_method}</label></span></td>
</tr>
<tr>
<td colspan="2">
    <select name="subscriptionmethod" id="subscriptionmethod">
        <option value="0" {$no_subscribe_selected}>{$lang->no_auto_subscribe}</option>
        <option value="1" {$no_email_subscribe_selected}>{$lang->no_email_subscribe}</option>
        <option value="2" {$instant_email_subscribe_selected}>{$lang->instant_email_subscribe}</option>
    </select>
</td>
</tr>
 



To:
 
<tr style="display:none">
<td colspan="2"><span class="smalltext"><label for="subscriptionmethod">{$lang->subscription_method}</label></span></td>
</tr>
<tr style="display:none">
<td colspan="2">
    <select name="subscriptionmethod" id="subscriptionmethod">
        <option value="0">{$lang->no_auto_subscribe}</option>
        <option value="1">{$lang->no_email_subscribe}</option>
        <option value="2" selected="selected">{$lang->instant_email_subscribe}</option>
    </select>
</td>
</tr>



Which is the exact same edit as above. Now however you need to choose which of the subscription methods you want to use. I've put the default to "Instant Email" in the above example.

Step 3: Make it so they cannot unsubscribe on a per-thread basis
In Show Thread Templates->showthread

Change:


<li class="subscription_{$add_remove_subscription}"><a href="usercp2.php?action={$add_remove_subscription}subscription&amp;tid={$tid}&amp;my_post_key={$mybb->post_code}">{$add_remove_subscription_text}</a></li>
 



To :
<li class="subscription_{$add_remove_subscription}" style="display:none"><a href="usercp2.php?action={$add_remove_subscription}subscription&amp;tid={$tid}&amp;my_post_key={$mybb->post_code}">{$add_remove_subscription_text}</a></li>
 



Which, once again simply addes the style="display:none", this time however it is to the li tag.

Step 4: SQL Query to affect all current users
For all users, including your initial Admin account:
UPDATE `mybb_users` SET `subscriptionmethod` = '2' WHERE `subscriptionmethod` != '2';
For all users except the initial Admin account:
UPDATE `mybb_users` SET `subscriptionmethod` = '2' WHERE `uid` != 1 AND `subscriptionmethod` != '2';

In Summary
This is the simplest way to do it. A more proper way would be to replace the various selects with a simple:
Code:

<input type="hidden"....


Automatic Subscriptions For All Members On MyBB


bit of code for the subscription method. However, as stated above, that is a much larger change to each template.


 Is that Automatic Subscriptions For All Members On MyBB, hopefully useful and helpful for you!

Wednesday, September 25, 2013

How to Easily Smooth Board Width Changer On IP. Board

How to Easily Smooth Board Width Changer On IP. Board. I was originally going to make a hook for this, and I got quite far with it too. But, I ran into a few problems and just couldn't get it to work. So I'm making a tutorial for it.

Please note: This was done on the default IPB skin. This may be different for you, depending on the skin you're using.

  • Go to your ACP
  • Look & Feel
  • Your Skin
  • globalTemplate.

Find this:

        {parse template="includeJS" group="global" params="$jsModules"}
        {parse template="includeFeeds" group="global" params="$documentHeadItems"}
        {parse template="includeRTL" group="global" params=""}        
        {parse template="includeVars" group="global" params="$header_items"}


Add this code above it:
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'></script>
<script type='text/javascript' src="{style_images_url}/boardwidth.js"></script>


Next go to :
  • Go to your ACP
  • Look & Feel
  • Your Skin
  • CSS
  • ipb_styles.css.

Find this:

#content, .main_width {
    margin: 0 auto;
    /* Uncomment for fixed */
    /*width: 980px;*/
    /* Fluid */
    width: 87% !important;
       min-width: 960px;
}


Change it to this:

#content, .main_width {
    margin: 0 auto;
    /* Uncomment for fixed */
    width: 980px;
    /* Fluid */
    /*width: 87% !important;*/
       min-width: 960px;
}


And save.

Next Go back to your globalTemplate and find this:

<if test="showhomeurl:|:$this->settings['home_url'] AND $this->settings['home_name']">


Add this code above it:

<li class='right widthSwitch'><a href="#">Change Width</a></li>


Note: You can place a link for this anywhere you want, I'm just using this location for tutorial purposes.


Next Now, you're going to code and paste the following code into Notepad or anything you prefer, and save it as "boardwidth.js".
Here is the code:

/**
* Cookie plugin
*
* Copyright (c) 2006 Klaus Hartl (stilbuero.de)
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
*/
jQuery.cookie=function(name,value,options){if(typeof value!="undefined"){options=options||{};if(value===null){value="";options.expires=-1;}var expires="";if(options.expires&&(typeof options.expires=="number"||options.expires.toUTCString)){var date;if(typeof options.expires=="number"){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}expires="; expires="+date.toUTCString();}var path=options.path?"; path="+(options.path):"";var domain=options.domain?"; domain="+(options.domain):"";var secure=options.secure?"; secure":"";document.cookie=[name,"=",encodeURIComponent(value),expires,path,domain,secure].join("");}else{var cookieValue=null;if(document.cookie&&document.cookie!=""){var cookies=document.cookie.split(";");for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+"=")){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}}return cookieValue;}};

jQuery.noConflict();
jQuery(document).ready(function($){

    // Board Width Changer
    var widthElem = '#content, .main_width'
    var    elemProp = $(widthElem).css('width')
    var    fluidWidth = 87;

    if( $.cookie('boardWidth') !== null ) {
        if ( $.cookie('boardWidth') == 'fluid' ) {
            $(widthElem).css('width', fluidWidth + '%');
         }
        if ( $.cookie('boardWidth') == 'fixed' ) {
            $(widthElem).css('width', elemProp);
        }
    }

    $('.widthSwitch a').click(function() {
        if ( $(widthElem).css('width') == elemProp ) {
            $(widthElem).animate({ width: fluidWidth + '%' });
            $.cookie('boardWidth', 'fluid');
        } else {
            $(widthElem).animate({ width: elemProp });
            $.cookie('boardWidth', 'fixed');
        }
        return false;
    });
});



Then go to
  • your FTP
  • public_html 
  • public
  • style_images 
  • (Your skin name)
  • Then upload the boardwidth.js file in that folder.


And you're done!
A smooth board width changer, made with jQuery.
This saves a cookie in your web browser, so each time you visit, it will be the same as the last time you visited ( until you clear your cookies ).

How to Easily Smooth Board Width Changer On IP. Board


Remember that the instructions may be a bit different depending on what skin you're using.
If you need help adding this to your board, just leave me a PM and I will reply whenever I read it.


It is How to Easily Smooth Board Width Changer On IP. Board, Good Luck!

Tuesday, September 24, 2013

Group Name Indicator 1.1.0 On IP. Board

Group Name Indicator 1.1.0 On IP. Board. For information and an explanation of the group name indicator please you can see the preview below!

Preview Demo :

Group Name Indicator 1.1.0 On IP. Board


Attachment

It that Group Name Indicator 1.1.0 On IP. Board, hopefully useful and helpful for you!

(Core Design Website) Hide Links From Guests On IP. Board

(Core Design Website) Hide Links From Guests On IP. Board. This time I will share Guests Hide Links From this it is useful for your website or forum so that more members are signing up out of curiosity to see and learn in such a website. Therefore please check the demo preview below.

Preview Demo :

(Core Design Website) Hide Links From Guests On IP. Board

 

Attachment

It that (Core Design Website) Hide Links From Guests On IP. Board, hopefully useful and helpful for you!

Sunday, September 22, 2013

How to Easily Disable Fast Reply On IP. Board

How to Easily Disable Fast Reply On IP. Board. A few people have expressed an interest in removing the fast reply from topic view. Here is a simple skin edit to do that.

Preview Demo :

How to Easily Disable Fast Reply On IP. Board


Its in two parts as part 1 involves removing the fast reply window and part 2 adds the 'post reply' button to the end of the page, otherwise you'd have to scroll to the top to add a reply.

Tutorial :
  • ACP 
  • Look / Feel 
  • Skin Manager 
  • (choose skin) 
  • Templates / CSS 
  • Topic View 
  • TopicViewTemplate


Part One, remove the fast reply box:

Find...

<if test="fastReply:|:$displayData['fast_reply'] && $displayData['reply_button']['url']">
<hr>
<div class="ipsBox" id="fast_reply_wrapper">
    <div class="ipsBox_container ipsPad">
        <h1 class="ipsType_subtitle">{$this->lang->words['topic_add_reply']}</h1>
        <if test="isLockedFR:|:$topic['state'] == 'closed'"><span class="error">{$this->lang->words['locked_reply_fr']}</span>
</if>
        
        <if test="isMember:|:$this->memberData['member_id']">
            <a href="%7Bparse%20url=" showuser="{$this-">memberData['member_id']}" seotitle="{$this->memberData['members_seo_name']}" template="showuser" base="public"}" title='{$this->lang->words['your_profile']}' class='ipsUserPhotoLink left'><img src="%7B$this-%3EmemberData[" pp_small_photo']}'="" alt="{parse expression=" sprintf($this-="">lang->words['users_photo'],$this->memberData['members_display_name'])"}" class='ipsUserPhoto ipsUserPhoto_medium' /></a>
        <else>
            <div class="left">{IPSMember::buildNoPhoto(0, 'small' )}</div>
        </else></if>
        <div class="ipsBox_withphoto clearfix">
            <form action="{parse url=" "="" base="public" }"="" method="post" id="ips_fastReplyForm">
                <input name="app" value="forums" type="hidden">
                <input name="module" value="post" type="hidden">
                <input name="section" value="post" type="hidden">
                <input name="do" value="reply_post_do" type="hidden">
                <input name="f" value="{$forum['id']}" type="hidden">
                <input name="t" value="{$topic['tid']}" type="hidden">
                <input name="st" value="{$this->request['st']}" type="hidden">
                <input name="auth_key" value="{$this->member->form_hash}" type="hidden">
                <input name="fast_reply_used" value="1" type="hidden">
                <input name="enableemo" value="yes" type="hidden">
                <input name="enablesig" value="yes" type="hidden">
                <if test="$this->memberData['auto_track']">
                    <input name="enabletrack" value="1" type="hidden">
                </if>
                <if test="is_array($topic['_fastReplyStatusMessage']) AND count($topic['_fastReplyStatusMessage']) AND strlen($topic['_fastReplyStatusMessage'][0])">
                    <div class="message">{parse expression="implode( '
', $topic['_fastReplyStatusMessage'] )"}</div>
                </if>
                {parse editor="Post" options="array( 'type' => 'full', 'minimize' => 1, 'isTypingCallBack' => 'ipb.topic.isTypingCallBack', 'height' => 180, 'autoSaveKey' => 'reply-' . $topic[tid] )"}
                
                
                <fieldset class="right" id="fast_reply_controls">
                    <input name="submit" class="input_submit" value="{$this->lang->words[" qr_post']}'="" tabindex="0" accesskey="s" id="submit_post" type="submit">&nbsp;&nbsp;<input name="preview" class="input_submit alt" value="{$this->lang->words[" qr_more_opts']}'="" tabindex="0" id="full_compose" type="submit">            
                </fieldset>
            </form>
        </div>
        <div id="ips_HasReplies"></div>
    </div>
</div>

<else>
    <if test="loadJsManually:|:$displayData['load_editor_js']">
        {parse template="editorLoadJs" group="editors" params="$displayData['smilies']"}
    </if>
</else></if>


Comment it out by adding a <!-- to the start and a --> to the end (do not remove the code)


Part two, add 'post reply' to the end of the page.

Immediately after the code you have removed, you'll see this line:

<!-- Close topic -->


Add the following code just above that 'close topic' line but after the code you commented out:

<ul class="topic_buttons">
        <if test="closedButton:|:$displayData['reply_button']['image'] == 'locked'">
            <li class="important">
                <if test="pollOnly:|:isset($displayData['poll_data']['poll']['poll_only']) && $displayData['poll_data']['poll']['poll_only']">
                    <if test="closedButtonLink:|:$displayData['reply_button']['url']">
                        <a href="%7B$displayData[" reply_button']['url']}'="" accesskey="r">{parse replacement="lock_icon"} {$this->lang->words['top_poll_only_reply']}</a>
                    <else>
                        <span>{parse replacement="lock_icon"} {$this->lang->words['top_poll_only']}</span>
                    </else></if>
                <else>
                    <if test="closedButtonLink:|:$displayData['reply_button']['url']">
                        <a href="%7B$displayData[" reply_button']['url']}'="" accesskey="r">{parse replacement="lock_icon"} {$this->lang->words['top_locked_reply']}</a>
                    <else>
                        <span>{parse replacement="lock_icon"} {$this->lang->words['top_locked']}</span>
                    </else></if>
                </else></if>
            </li>
        <else>
            <if test="replyButton:|:$displayData['reply_button']['image']">
                <if test="replyButtonLink:|:$displayData['reply_button']['url']">
                    <li><a href="%7B$displayData[" reply_button']['url']}'="" title="{$this->lang->words[" topic_add_reply']}'="" accesskey="r">{$this->lang->words['topic_add_reply']}</a></li>
                <else>
                    <li class="disabled"><span>{$this->lang->words['top_cannot_reply']}</span></li>
                </else></if>
            </if>
        </else></if>
    </ul>


Save.


 It is How to Easily Disable Fast Reply On IP. Board, Good luck!