View Single Post
  #1  
Old 05-03-2011, 06:45 AM
cowcowcow cowcowcow is offline
 
Join Date: Jul 2009
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Tidying up some awesome BBcode

This BBCode is really awesome but i need some help tidying it up as i dont have any formal coding knowledge.
Basically it replicates a featured slider as shown here http://www.efectorelativo.net/laboratory/noobSlide/ - scroll down to Sample #5 - but with BBCode so you can customise the items that are featured each time.

Right now im using a total of 5 bbcodes but if some1 can show me how i will be able to shorten it to 2 or 3 i will be very grateful. This is how i currently do it. Its pretty dangerous that im leaving a script line open so i would like to know how i can close it properly.

PHP Code:

BBCODEZOPEN

<script type="text/javascript" src="js/mootools-1.2-core.js"></script>
    <
script type="text/javascript" src="js/_class.noobSlide.packed.js"></script>
    <
script type="text/javascript">
    
window.addEvent('domready',function(){

        
//SAMPLE 5 (mode: vertical, using "onWalk" )
        
var info5 = $('info5').set('opacity',0.5);
        var 
sampleObjectItems =[


BBCODEZLIST

            
{title:'Morbi elementum'autor:'Lorem'date:'5 Jun 2007'link:'http://www.link1.com'},
            {
title:'asdasd'},

BBCODEZCLOSE


];
        var 
nS5 = new noobSlide({
            
mode'vertical',
            
box: $('box5'),
            
size180,
            
itemssampleObjectItems,
            
addButtons: {
                
previous: $('prev5'),
                
play: $('play5'),
                
stop: $('stop5'),
                
next: $('next5')
            },
            
onWalk: function(currentItem){
                
info5.empty();
                new 
Element('h4').set('html','<a href="'+currentItem.link+'">link</a>'+currentItem.title).inject(info5);
                new 
Element('p').set('html','<b>Autor</b>: '+currentItem.autor+' &nbsp; &nbsp; <b>Date</b>: '+currentItem.date).inject(info5);
            }
        });

        
nS8.addActionButtons('previous',$$('#box8 .prev'));
        
nS8.addActionButtons('next',$$('#box8 .next'));
        
//more handle buttons
        
nS8.addHandleButtons(handles8_more);
        
//walk to item 3 witouth fx
        
nS8.walk(3,false,true);

    });
    </
script>

BBCODEXOPEN

<center>
<
span class="bigcatm">{param}</span>


<
div class="sample">
    <
div class="mask2">
        <
div id="box5">
            <
span><img src="img1.jpg" alt="Photo" /></span>
            <
span><img src="img2.jpg" alt="Photo" /></span>


BBCODEXLIST

<span><img src="img1.jpg" alt="Photo" /></span>

BBCODEXCLOSE
        
</div>
        <
div id="info5" class="info"></div>
    </
div>
    <
class="buttons">
        <
span id="prev5">&lt;&ltPrevious</span>
        <
span id="play5">Play &gt;</span>
        <
span id="stop5">Stop</span>
        <
span id="next5">Next &gt;&gt;</span>
    </
p>
</
div>
</
center
So basically when i type in the BBCodes this way it comes out perfectly and customised. But yea its messy and theres problems running multiple replications of it on the same page.

PHP Code:

[zopen]CAPTION 1[/zopen][zist]CAPTION 2[/zist][zclose]nothing[/zclose]

[
xopen]nothing[/xopen]
[
xlist=asdasd]IMG LOCATION 1[/xlist]
[
xlist=asdasd]IMG LOCATION 2[/xlist]
[
xclose]nothing[/xclose
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01260 seconds
  • Memory Usage 1,827KB
  • 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
  • (2)bbcode_php
  • (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