its already updated to 3.0.7-PL1!!Derky wrote:Update your phpBB installation to the latest version.
Code: Select all
<script type="text/javascript" src="{T_TEMPLATE_PATH}/js/jquery-1.3.2.js"></script>
<script type="text/javascript" src="{T_TEMPLATE_PATH}/js/ui.core.js"></script>
<script type="text/javascript" src="{T_TEMPLATE_PATH}/js/ui.sortable.js"></script>
<script type="text/javascript">
//no conflict jquery
jQuery.noConflict();
(function($) {
function createdata(listnameobject, column, resultid)
{
// Let's delete all the current input type="hidden" fields, this is easier to find out which were changed
var data = document.getElementById(column);
if ( data.hasChildNodes() ) {
while ( data.childNodes.length >= 1 ) {
data.removeChild( data.firstChild );
}
}
// Run through all childs
jQuery.each( listnameobject, function(){
// We only want the ID of the answer
var answer = $( this ).attr("id");
answer = answer.replace(/answer_/g, '');
// And add a hidden input field
inputbox = document.createElement("input");
inputbox.type = 'hidden';
inputbox.name = column + '[]';
inputbox.value = answer;
data.appendChild(inputbox);
});
}
$(function() {
// Javascript nubs
document.getElementById('enable_js').style.display = '';
$("#sortable1, #sortable2").sortable({
connectWith: '.connectedSortable',
items: 'li',
forcePlaceholderSize: true,
placeholder: 'row3'
}).disableSelection();
$("#sortable1, #sortable2").bind('sortreceive', function(event, ui) {
// If the left or right column receive an item, put the child nodes in an array
var arrSortableListItemsLeft = $( "#sortable1" ).children();
var arrSortableListItemsRight = $( "#sortable2" ).children();
// And create hidden input fields
createdata(arrSortableListItemsLeft, 'sortables_options_left', '#sortables_options_left');
createdata(arrSortableListItemsRight, 'sortables_options_right', '#sortables_options_right');
});
});
})(jQuery);
</script>
<tr>
<th colspan="2" valign="middle">{SORTABLES_CONFIRM_QUESTION}</th>
</tr>
<!-- Very simple version for javascript off with no dragging support -->
<noscript>
<tr>
<td class="row1"><b class="genmed">{SORTABLES_CONFIRM_QUESTION}</b><br />{L_CONFIRM_QUESTION_EXPLAIN_NOJS}</td>
<td class="row2">
<div style="width:300px; float:left;">
<div style="width:150px; float:left;"><strong><!-- IF SORTABLES_NAME_LEFT -->{SORTABLES_NAME_LEFT}<!-- ELSE -->{L_COLUMN_LEFT}<!-- ENDIF --></strong></div>
<div style="width:150px; float:right; text-align:right;"><strong><!-- IF SORTABLES_NAME_RIGHT -->{SORTABLES_NAME_RIGHT}<!-- ELSE -->{L_COLUMN_RIGHT}<!-- ENDIF --></strong></div>
<!-- BEGIN options -->
<div style="width:10px; float:left; clear:left; height:2em;"><input type="checkbox" name="sortables_options_left[]" value="{options.ID}"/></div>
<div style="width:280px; float:left; text-align:center; height:2em;">{options.TEXT}</div>
<div style="width:10px; float:right; text-align:right; height:2em;"><input type="checkbox" name="sortables_options_right[]" value="{options.ID}" /></div>
<!-- END options -->
</div>
</td>
</tr>
</noscript>
<!-- The normal version -->
<tr id="enable_js" style="display:none;">
<td class="row1" valign="top"><b class="genmed">{SORTABLES_CONFIRM_QUESTION}</b><br />{L_CONFIRM_QUESTION_EXPLAIN}</td>
<td class="row2">
<table class="tablebg" cellspacing="1">
<tr>
<td class="row3"><b class="genmed"><!-- IF SORTABLES_NAME_LEFT -->{SORTABLES_NAME_LEFT}<!-- ELSE -->{L_COLUMN_LEFT}<!-- ENDIF --></b></td>
<td class="row3"><b class="genmed"><!-- IF SORTABLES_NAME_RIGHT -->{SORTABLES_NAME_RIGHT}<!-- ELSE -->{L_COLUMN_RIGHT}<!-- ENDIF --></b></td>
</tr>
<tr>
<td class="row1">
<ul id="sortable1" class="connectedSortable" style="margin: 0; min-height: 100px; min-width:100px; list-style-type: none; padding: 0 5px 5px 5px;">
<!-- IF SORTABLES_DEFAULT_SORT == 'LEFT' -->
<!-- BEGIN options -->
<li class="row2" style="cursor:move; margin: 5px 0 5px 0; padding: 5px;" id="answer_{options.ID}">{options.TEXT}</li>
<!-- END options -->
<!-- ENDIF -->
</ul>
</td>
<td class="row1">
<ul id="sortable2" class="connectedSortable" style="margin: 0; min-height: 100px; min-width:100px; list-style-type: none; padding: 0 5px 5px 5px;">
<!-- IF SORTABLES_DEFAULT_SORT == 'RIGHT' -->
<!-- BEGIN options -->
<li class="row2" style="cursor:move; margin: 5px 0 5px 0; padding: 5px;" id="answer_{options.ID}">{options.TEXT}</li>
<!-- END options -->
<!-- ENDIF -->
</ul>
</td>
</tr>
</table>
<input type="hidden" name="sortables_confirm_id" id="confirm_id" value="{SORTABLES_CONFIRM_ID}" />
<div id="sortables_options_left"></div>
<div id="sortables_options_right"></div>
</td>
</tr>
Code: Select all
<script type="text/javascript" src="{T_TEMPLATE_PATH}/js/jquery-1.3.2.js"></script>
<script type="text/javascript" src="{T_TEMPLATE_PATH}/js/ui.core.js"></script>
<script type="text/javascript" src="{T_TEMPLATE_PATH}/js/ui.sortable.js"></script>
<script type="text/javascript">
//no conflict jquery
jQuery.noConflict();
function createdata(listnameobject, column, resultid)
{
// Let's delete all the current input type="hidden" fields, this is easier to find out which were changed
var data = document.getElementById(column);
if ( data.hasChildNodes() ) {
while ( data.childNodes.length >= 1 ) {
data.removeChild( data.firstChild );
}
}
// Run through all childs
jQuery.each( listnameobject, function(){
// We only want the ID of the answer
var answer = $( this ).attr("id");
answer = answer.replace(/answer_/g, '');
// And add a hidden input field
inputbox = document.createElement("input");
inputbox.type = 'hidden';
inputbox.name = column + '[]';
inputbox.value = answer;
data.appendChild(inputbox);
});
}
$(function() {
// Javascript nubs
document.getElementById('enable_js').style.display = 'block';
$("#sortable1, #sortable2").sortable({
connectWith: '.connectedSortable',
items: 'li',
forcePlaceholderSize: true,
placeholder: 'bg3'
}).disableSelection();
$("#sortable1, #sortable2").bind('sortreceive', function(event, ui) {
// If the left or right column receive an item, put the child nodes in an array
var arrSortableListItemsLeft = $( "#sortable1" ).children();
var arrSortableListItemsRight = $( "#sortable2" ).children();
// And create hidden input fields
createdata(arrSortableListItemsLeft, 'sortables_options_left', '#sortables_options_left');
createdata(arrSortableListItemsRight, 'sortables_options_right', '#sortables_options_right');
});
});
})(jQuery);
</script>
<!-- IF S_TYPE == 1 -->
<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>
<h3>{L_CONFIRMATION}</h3>
<fieldset class="fields2">
<!-- ENDIF -->
<!-- Very simple version for javascript off with no dragging support -->
<noscript>
<dl>
<dt><label>{SORTABLES_CONFIRM_QUESTION}</label><br /><span>{L_CONFIRM_QUESTION_EXPLAIN_NOJS}</span></dt>
<dd>
<div style="width:300px; float:left;">
<div style="width:150px; float:left;"><strong><!-- IF SORTABLES_NAME_LEFT -->{SORTABLES_NAME_LEFT}<!-- ELSE -->{L_COLUMN_LEFT}<!-- ENDIF --></strong></div>
<div style="width:150px; float:right; text-align:right;"><strong><!-- IF SORTABLES_NAME_RIGHT -->{SORTABLES_NAME_RIGHT}<!-- ELSE -->{L_COLUMN_RIGHT}<!-- ENDIF --></strong></div>
<!-- BEGIN options -->
<div style="width:10px; float:left; clear:left; height:2em;"><input type="checkbox" name="sortables_options_left[]" value="{options.ID}"/></div>
<div style="width:280px; float:left; text-align:center; height:2em;">{options.TEXT}</div>
<div style="width:10px; float:right; text-align:right; height:2em;"><input type="checkbox" name="sortables_options_right[]" value="{options.ID}" /></div>
<!-- END options -->
</div>
</dd>
</dl>
</noscript>
<!-- The normal version -->
<dl id="enable_js" style="display:none;">
<dt><label>{SORTABLES_CONFIRM_QUESTION}</label><br /><span>{L_CONFIRM_QUESTION_EXPLAIN}</span></dt>
<dd>
<div class="attachbox" style="clear:none; *width:20em;"><!-- *width:20em; is for nub IE-only -->
<strong><!-- IF SORTABLES_NAME_LEFT -->{SORTABLES_NAME_LEFT}<!-- ELSE -->{L_COLUMN_LEFT}<!-- ENDIF --></strong><hr />
<ul id="sortable1" class="connectedSortable" style="min-height: 100px; min-width:100px; list-style-type: none; padding: 0 5px 5px 5px;">
<!-- IF SORTABLES_DEFAULT_SORT == 'LEFT' -->
<!-- BEGIN options -->
<li class="bg2" style="cursor:move; margin: 5px 0 5px 0; padding: 5px;" id="answer_{options.ID}">{options.TEXT}</li>
<!-- END options -->
<!-- ENDIF -->
</ul>
</div>
<div class="attachbox" style="clear:none; *width:20em;"><!-- *width:20em; is for nub IE-only -->
<strong><!-- IF SORTABLES_NAME_RIGHT -->{SORTABLES_NAME_RIGHT}<!-- ELSE -->{L_COLUMN_RIGHT}<!-- ENDIF --></strong><hr />
<ul id="sortable2" class="connectedSortable" style="min-height: 100px; min-width:100px; list-style-type: none; padding: 0 5px 5px 5px;">
<!-- IF SORTABLES_DEFAULT_SORT == 'RIGHT' -->
<!-- BEGIN options -->
<li class="bg2" style="cursor:move; margin: 5px 0 5px 0; padding: 5px;" id="answer_{options.ID}">{options.TEXT}</li>
<!-- END options -->
<!-- ENDIF -->
</ul>
</div>
<input type="hidden" name="sortables_confirm_id" id="confirm_id" value="{SORTABLES_CONFIRM_ID}" />
<div id="sortables_options_left"></div>
<div id="sortables_options_right"></div>
</dd>
</dl>
<!-- IF S_TYPE == 1 -->
</fieldset>
<span class="corners-bottom"><span></span></span></div>
</div>
<!-- ENDIF -->