Jump to content

  •  

  • Tutorial info Visit support topic

    • Added on: May 14 2007 05:49 PM
    • Date Updated: May 17 2007 03:26 PM
    • Views: 2726
     


    * * * * *
    1 Ratings

    BG (Block Background) BBCode Button In Standerd Post Edit

    BG (Block Background) BBCode Button In Standerd Post Edit

    Posted by AmgedOsman on May 14 2007 05:49 PM

    ::::::::::wanna Youe My tutorials Keep My Credits::::::::::

    BG (Block Background) BBCode Button In Standerd Post Edit

    NOTE::::: This requires BG BBCODE to be installed on your Board

    **********************************************************************************************
    A MUST READ !!!!!!! : This will add BG Code to the Standered Post Editor it requirs the
    [ bg = color ] content [ / bg ] < mod
    NOT the IPB Default one
     [background = color] content [ / background]

    ill inclode the bg bbcode at the end of the post check it if you dont know what iam talkin about
    ************************************************************************************************

    Step 1
    Go to /jscripts/ipb_editor_std.js on your FTP

    Find the following around line 395:

    /*-------------------------------------------------------------------------*/
    // URL tag
    /*-------------------------------------------------------------------------*/
    
    function tag_url()
    {
    	var FoundErrors = '';
    	
    	//----------------------------------------
    	// Do we have ranged text?
    	//----------------------------------------
    	
    	if ( check_range() )
    	{
    		//----------------------------------------
    		// Yes, just ask for the URL and wrap
    		//----------------------------------------
    		
    		var enterURL = prompt(text_enter_url, "http://");
    		
    		if ( ! enterURL)
    		{
    			alert(error_no_url);
    			return;
    		}
    	
    		wrap_tags( "[url="+enterURL+"]", "[/url]", "" );
    	}
    	else
    	{
    		var enterURL	= prompt(text_enter_url, "http://");
    		var enterTITLE  = prompt(text_enter_url_name, jsfile_myweb_lang );
    	
    		if ( ! enterURL)
    		{
    			FoundErrors += " " + error_no_url;
    		}
    		if ( ! enterTITLE)
    		{
    			FoundErrors += " " + error_no_title;
    		}
    	
    		if ( FoundErrors )
    		{
    			alert( jsfile_error_lang +FoundErrors);
    			return;
    		}
    	
    		wrap_tags("[url="+enterURL+"]"+enterTITLE+"[/url]", "");
    	}
    }

    Add the following below:

    /*-------------------------------------------------------------------------*/
    // BG tag [CUSTOM BUTTON]
    /*-------------------------------------------------------------------------*/
    
    function tag_bg()
    {
    	var FoundErrors = '';
    	
    	//----------------------------------------
    	// Do we have ranged text?
    	//----------------------------------------
    	
    	if ( check_range() )
    	{
    		//----------------------------------------
    		// Yes, just ask for the OPTION and wrap
    		//----------------------------------------
    		
    		var enterOPTION = prompt("Sacred Says Put BG Color here", "black");
    		
    		if ( ! enterOPTION)
    		{
    			alert("Sacred Says You Must Choose Color For Your BG");
    			return;
    		}
    	
    		wrap_tags( "[bg="+enterOPTION+"]", "[/bg]", "" );
    	}
    	else
    	{
    		var enterOPTION	= prompt("Sacred Says Put BG Color here", "black");	
    		if ( ! enterOPTION)
    		{
    			FoundErrors += " " + "Sacred Says You Must Choose Color For Your BG";
    		}	
    		if ( FoundErrors )
    		{
    			alert( jsfile_error_lang +FoundErrors);
    			return;
    		}
    	
    		wrap_tags("[bg="+enterOPTION+"]", "[/bg]", "");
    	}
    }


    You Can Change where is says "Sacred Says Put bg Color here" to anything you would like AND "black" to any color u would like to be ur default shadow on your board

    Save Close & upload ipb_editor_std.js

    ==========================
    Step 2 :

    NOTE:::: this have to be done to all skins


    Go to AdminCP >Look & Feel >Edit Template HTML > Post / PM Editor > editor_std

    Find:

    <td><div id='do_code'><img class="rteimage" src="{ipb.vars['img_url']}/folder_rte_images/code.gif" width="21" height="21 alt="{ipb.lang['js_tt_code']}" title="{ipb.lang['js_tt_code']}" onclick="simpletag('code')"></div></td>

    Add after
    			<!--/SEP-->
    			 <td><div><img class="rteimage" src="{ipb.vars['img_url']}/folder_rte_images/b_g.bmp" width="40" height="24" alt="BG" title="bg" onclick="tag_bg()"></div></td>


    Save Close Template Bites

    ============================================

    Step 3 Upload the b_g.bmp to

    style_images/*/folder_rte_images/

    Note::::: the ( * ) is the name of your skin under the style images folder

    Heres an Image u can use download it and upload to ur site Posted Image

    Thats it your Done

    Sacred


    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    Heres the Custom BG bbcode you MUST install this BBCode so u can get my edits to work


    NOTE ::::::::::::::::::: THIS IS NOT MY CODE i did NOT make this code it was posted soem wheer but i cant find teh link for it, i included in my tutorial so i make it easier for you guys to find it .. but ill update who is the auther as soon as i find the post...

    Here's a simple custom BBCode to add different background colors to your posts, like in the screenshot below.
    
    Custom BBCode Title: BGColor
    Custom BBCode Description: This tag will add a different background color to your posts.
    Custom BBCode Example: [bg=lightgreen]This background will be lightgreen[/bg]
    Custom BBCode Tag: bg
    Use Option in tag?: Yes
    Custom BBCode Replacement: <div style="width: 100%; background-color:{option}">{content}</div>
    
    
    
    Take a look at my Test Board ( Test / test ) to see it working.
    
    
    It's fun and useful when creating tutorials or something similar. Blue for Find, Green for Add, Red for Remove and Yellow for Replace. Or something like that 
    
    
    Any problems let me know

    Powered by Tutorials 1.4.1 © 2012, by Michael McCune