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'),
size: 180,
items: sampleObjectItems,
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+' <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>
<p class="buttons">
<span id="prev5"><< Previous</span>
<span id="play5">Play ></span>
<span id="stop5">Stop</span>
<span id="next5">Next >></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]