vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Tidying up some awesome BBcode (https://vborg.vbsupport.ru/showthread.php?t=263033)

cowcowcow 05-03-2011 06:45 AM

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


kh99 05-03-2011 02:47 PM

I was going to help you out but what you posted doesn't work for me.

BTW, were you planning to relase this as a mod?


All times are GMT. The time now is 09:08 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.00974 seconds
  • Memory Usage 1,750KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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