Version 3.0.5
No files matched your search
@@ -1,240 +0,0 @@
|
||||
/**************************************************
|
||||
* dom-drag.js
|
||||
* 09.25.2001
|
||||
* www.youngpup.net
|
||||
**************************************************
|
||||
* 10.28.2001 - fixed minor bug where events
|
||||
* sometimes fired off the handle, not the root.
|
||||
**************************************************
|
||||
* IPS CHANGES
|
||||
* 06.01.2005 - Added "cursorchange" to change
|
||||
* 07.18.2005 - Added cookie to store values
|
||||
* 07.18.2005 - Made it impossible to drag < 0 height (keeponscreen)
|
||||
* mouse cursor when over drag handle
|
||||
* 07.29.2005 - Added "AddEvent" handler to prevent
|
||||
* event clashes / overwrites
|
||||
**************************************************/
|
||||
|
||||
|
||||
var Drag = {
|
||||
|
||||
obj : null,
|
||||
fx : null,
|
||||
fy : null,
|
||||
cookiename : null,
|
||||
keeponscreen: true,
|
||||
|
||||
init : function(o, oRoot, minX, maxX, minY, maxY, bSwapHorzRef, bSwapVertRef, fXMapper, fYMapper)
|
||||
{
|
||||
o.onmousedown = Drag.start;
|
||||
o.onmouseover = Drag.cursorchange;
|
||||
|
||||
o.hmode = bSwapHorzRef ? false : true ;
|
||||
o.vmode = bSwapVertRef ? false : true ;
|
||||
|
||||
o.root = oRoot && oRoot != null ? oRoot : o ;
|
||||
|
||||
if (o.hmode && isNaN(parseInt(o.root.style.left ))) o.root.style.left = "0px";
|
||||
if (o.vmode && isNaN(parseInt(o.root.style.top ))) o.root.style.top = "0px";
|
||||
if (!o.hmode && isNaN(parseInt(o.root.style.right ))) o.root.style.right = "0px";
|
||||
if (!o.vmode && isNaN(parseInt(o.root.style.bottom))) o.root.style.bottom = "0px";
|
||||
|
||||
o.minX = typeof minX != 'undefined' ? minX : null;
|
||||
o.minY = typeof minY != 'undefined' ? minY : null;
|
||||
o.maxX = typeof maxX != 'undefined' ? maxX : null;
|
||||
o.maxY = typeof maxY != 'undefined' ? maxY : null;
|
||||
|
||||
o.xMapper = fXMapper ? fXMapper : null;
|
||||
o.yMapper = fYMapper ? fYMapper : null;
|
||||
|
||||
//----------------------------------
|
||||
// Figure width and height
|
||||
//----------------------------------
|
||||
|
||||
if ( Drag.keeponscreen )
|
||||
{
|
||||
Drag.my_width = 0;
|
||||
Drag.my_height = 0;
|
||||
|
||||
if ( typeof( window.innerWidth ) == 'number' )
|
||||
{
|
||||
//----------------------------------
|
||||
// Non IE
|
||||
//----------------------------------
|
||||
|
||||
Drag.my_width = window.innerWidth;
|
||||
Drag.my_height = window.innerHeight;
|
||||
}
|
||||
else if ( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
|
||||
{
|
||||
//----------------------------------
|
||||
// IE 6+
|
||||
//----------------------------------
|
||||
|
||||
Drag.my_width = document.documentElement.clientWidth;
|
||||
Drag.my_height = document.documentElement.clientHeight;
|
||||
}
|
||||
else if ( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
|
||||
{
|
||||
//----------------------------------
|
||||
// Old IE
|
||||
//----------------------------------
|
||||
|
||||
Drag.my_width = document.body.clientWidth;
|
||||
Drag.my_height = document.body.clientHeight;
|
||||
}
|
||||
}
|
||||
|
||||
o.root.onDragStart = new Function();
|
||||
o.root.onDragEnd = new Function();
|
||||
o.root.onDrag = new Function();
|
||||
},
|
||||
|
||||
cursorchange : function(e)
|
||||
{
|
||||
var o = Drag.obj = this;
|
||||
o.style.cursor = 'move';
|
||||
},
|
||||
|
||||
start : function(e)
|
||||
{
|
||||
var o = Drag.obj = this;
|
||||
e = Drag.fixE(e);
|
||||
var y = parseInt(o.vmode ? o.root.style.top : o.root.style.bottom);
|
||||
var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right );
|
||||
o.root.onDragStart(x, y);
|
||||
|
||||
o.lastMouseX = e.clientX;
|
||||
o.lastMouseY = e.clientY;
|
||||
|
||||
if (o.hmode) {
|
||||
if (o.minX != null) o.minMouseX = e.clientX - x + o.minX;
|
||||
if (o.maxX != null) o.maxMouseX = o.minMouseX + o.maxX - o.minX;
|
||||
} else {
|
||||
if (o.minX != null) o.maxMouseX = -o.minX + e.clientX + x;
|
||||
if (o.maxX != null) o.minMouseX = -o.maxX + e.clientX + x;
|
||||
}
|
||||
|
||||
if (o.vmode) {
|
||||
if (o.minY != null) o.minMouseY = e.clientY - y + o.minY;
|
||||
if (o.maxY != null) o.maxMouseY = o.minMouseY + o.maxY - o.minY;
|
||||
} else {
|
||||
if (o.minY != null) o.maxMouseY = -o.minY + e.clientY + y;
|
||||
if (o.maxY != null) o.minMouseY = -o.maxY + e.clientY + y;
|
||||
}
|
||||
|
||||
//Drag.addEvent( document, 'mousemove', Drag.drag , false );
|
||||
//Drag.addEvent( document, 'mouseup' , Drag.end , false );
|
||||
|
||||
document.onmousemove = Drag.drag;
|
||||
document.onmouseup = Drag.end;
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
drag : function(e)
|
||||
{
|
||||
e = Drag.fixE(e);
|
||||
var o = Drag.obj;
|
||||
|
||||
var ey = e.clientY;
|
||||
var ex = e.clientX;
|
||||
var y = parseInt(o.vmode ? o.root.style.top : o.root.style.bottom);
|
||||
var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right );
|
||||
var nx, ny;
|
||||
|
||||
if (o.minX != null) ex = o.hmode ? Math.max(ex, o.minMouseX) : Math.min(ex, o.maxMouseX);
|
||||
if (o.maxX != null) ex = o.hmode ? Math.min(ex, o.maxMouseX) : Math.max(ex, o.minMouseX);
|
||||
if (o.minY != null) ey = o.vmode ? Math.max(ey, o.minMouseY) : Math.min(ey, o.maxMouseY);
|
||||
if (o.maxY != null) ey = o.vmode ? Math.min(ey, o.maxMouseY) : Math.max(ey, o.minMouseY);
|
||||
|
||||
nx = x + ((ex - o.lastMouseX) * (o.hmode ? 1 : -1));
|
||||
ny = y + ((ey - o.lastMouseY) * (o.vmode ? 1 : -1));
|
||||
|
||||
if (o.xMapper) nx = o.xMapper(y);
|
||||
else if (o.yMapper) ny = o.yMapper(x);
|
||||
|
||||
//----------------------------------
|
||||
// Keep on screen?
|
||||
//----------------------------------
|
||||
|
||||
if ( Drag.keeponscreen )
|
||||
{
|
||||
ny = ny < 0 ? 0 : ny;
|
||||
nx = nx < 0 ? 0 : nx;
|
||||
|
||||
if ( Drag.my_width )
|
||||
{
|
||||
nx = nx > Drag.my_width - parseInt(o.root.style.width) ? Drag.my_width - parseInt(o.root.style.width) : nx;
|
||||
}
|
||||
}
|
||||
|
||||
Drag.obj.root.style[o.hmode ? "left" : "right"] = nx + "px";
|
||||
Drag.obj.root.style[o.vmode ? "top" : "bottom"] = ny + "px";
|
||||
Drag.obj.lastMouseX = ex;
|
||||
Drag.obj.lastMouseY = ey;
|
||||
|
||||
Drag.obj.root.onDrag(nx, ny);
|
||||
return false;
|
||||
},
|
||||
|
||||
end : function()
|
||||
{
|
||||
document.onmousemove = null;
|
||||
document.onmouseup = null;
|
||||
Drag.obj.root.onDragEnd( parseInt(Drag.obj.root.style[Drag.obj.hmode ? "left" : "right"]),
|
||||
parseInt(Drag.obj.root.style[Drag.obj.vmode ? "top" : "bottom"]));
|
||||
|
||||
var o = Drag.obj;
|
||||
|
||||
fy = parseInt( o.root.style.top );
|
||||
fx = parseInt( o.root.style.left );
|
||||
|
||||
//----------------------------------
|
||||
// Store in a cookie?
|
||||
//----------------------------------
|
||||
|
||||
if ( Drag.cookiename )
|
||||
{
|
||||
try
|
||||
{
|
||||
ipsclass.my_setcookie( Drag.cookiename, fx+','+fy, 1 );
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
Drag.obj = null;
|
||||
|
||||
},
|
||||
|
||||
addEvent: function(elm, evType, fn, useCapture)
|
||||
{
|
||||
// Cross-browser event handling for IE5+, NS6 and Mozilla
|
||||
// By Scott Andrew
|
||||
|
||||
if ( elm.addEventListener )
|
||||
{
|
||||
elm.addEventListener(evType, fn, useCapture);
|
||||
return true;
|
||||
}
|
||||
else if ( elm.attachEvent )
|
||||
{
|
||||
var r = elm.attachEvent('on' + evType, fn);
|
||||
return r;
|
||||
}
|
||||
else
|
||||
{
|
||||
elm['on' + evType] = fn;
|
||||
}
|
||||
},
|
||||
|
||||
fixE : function(e)
|
||||
{
|
||||
if (typeof e == 'undefined') e = window.event;
|
||||
if (typeof e.layerX == 'undefined') e.layerX = e.offsetX;
|
||||
if (typeof e.layerY == 'undefined') e.layerY = e.offsetY;
|
||||
return e;
|
||||
}
|
||||
};
|
||||
@@ -1,14 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1 +0,0 @@
|
||||
<html>␍<head><title>Invision Power Board - Bulletin Board System</title></head>␍<body>␍<h1>403: Invision Power Board -> Forbidden</h1>␍<hr>␍You have reached this Page in error, please use␍your back button to return to Invision Board.␍<hr>␍<a href="http://anonym.to/http://www.invisionboard.com/">Invision Power Board</a>␍</body>␍</html>
|
||||
@@ -1,246 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Insert Custom BBCode</title>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
|
||||
//-----------------------------------------
|
||||
// Attempt to get editor ID
|
||||
//-----------------------------------------
|
||||
|
||||
var editor_id = <?php print '"'.trim( htmlspecialchars( substr( $_REQUEST['editorid'], 0, 30 ) ) ).'";'; ?>
|
||||
var bbcode_id = <?php print '"'.trim( htmlspecialchars( substr( $_REQUEST['id'], 0, 30 ) ) ).'";'; ?>
|
||||
var this_module = 'bbcodeloader';
|
||||
var this_height = 400;
|
||||
var allow_advanced = null;
|
||||
var current_selection = null;
|
||||
var bbcode = parent.ips_bbcode_items[ bbcode_id ];
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// INIT
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function Init()
|
||||
{
|
||||
var allow_advanced = parent.IPS_editor[ editor_id ].allow_advanced;
|
||||
var current_selection = parent.ipsclass.un_htmlspecialchars( parent.IPS_editor[ editor_id ].get_selection() );
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up main close button
|
||||
//-----------------------------------------
|
||||
|
||||
parent.document.getElementById( editor_id + '_cb-close-window' ).onclick = do_cancel;
|
||||
parent.document.getElementById( editor_id + '_cb-close-window' ).style.cursor = 'pointer';
|
||||
|
||||
//-----------------------------------------
|
||||
// Resize window
|
||||
//-----------------------------------------
|
||||
|
||||
parent.document.getElementById( editor_id + '_htmlblock_' + this_module + '_menu' ).style.height = this_height + 'px';
|
||||
parent.document.getElementById( editor_id + '_iframeblock_' + this_module + '_menu' ).style.height = ( this_height - 10 ) + 'px';
|
||||
|
||||
//-----------------------------------------
|
||||
// Module specific stuff
|
||||
//-----------------------------------------
|
||||
|
||||
document.getElementById("f_content_text").focus();
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up initial text value
|
||||
//-----------------------------------------
|
||||
|
||||
document.getElementById("f_content_text").value = current_selection;
|
||||
|
||||
//-----------------------------------------
|
||||
// Add in data
|
||||
//-----------------------------------------
|
||||
|
||||
document.getElementById("_title").innerHTML += ' ' + bbcode['title'];
|
||||
document.getElementById("_example").innerHTML += ' ' + bbcode['example'];
|
||||
document.getElementById("_option").innerHTML += ' ' + bbcode['text_option'];
|
||||
document.getElementById("_content").innerHTML += ' ' + bbcode['text_content'];
|
||||
|
||||
//-----------------------------------------
|
||||
// Using option?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( parseInt( bbcode['use_option'] ) == 1 )
|
||||
{
|
||||
document.getElementById( 'use-option' ).style.display = '';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up initial text value
|
||||
//-----------------------------------------
|
||||
|
||||
document.getElementById("f_content_text").value = parent.IPS_editor[ editor_id ].strip_empty_html( current_selection );
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Do cancel
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function do_cancel()
|
||||
{
|
||||
parent.IPS_editor[ editor_id ].module_remove_control_bar();
|
||||
return false;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Do submit (low tech)
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function do_submit()
|
||||
{
|
||||
var fields = [ "f_option_text", "f_content_text" ];
|
||||
|
||||
var param = new Object();
|
||||
|
||||
//-----------------------------------------
|
||||
// Compile data
|
||||
//-----------------------------------------
|
||||
|
||||
for ( var i in fields )
|
||||
{
|
||||
param[ fields[i] ] = document.getElementById( fields[i] ).value;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up required fields
|
||||
//-----------------------------------------
|
||||
|
||||
var required = {
|
||||
"f_option_text" : "You must enter option text",
|
||||
"f_content_text": "You must enter content text"
|
||||
};
|
||||
|
||||
for (var i in required)
|
||||
{
|
||||
var el = document.getElementById(i);
|
||||
|
||||
if ( i == 'f_option_text' )
|
||||
{
|
||||
if ( parseInt( bbcode['use_option'] ) != 1 )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! el.value )
|
||||
{
|
||||
alert( required[i] );
|
||||
el.focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Now prep the table
|
||||
//-----------------------------------------
|
||||
|
||||
var _html = '';
|
||||
var _content = document.getElementById( 'f_content_text' ).value;
|
||||
var _option = document.getElementById( 'f_option_text' ).value;
|
||||
|
||||
if ( parseInt( bbcode['use_option'] ) == 1 )
|
||||
{
|
||||
if ( parseInt( bbcode['switch_option'] ) == 1 )
|
||||
{
|
||||
_html = '[' + bbcode['tag'] + '="' + _content + '"]' + _option + '[/' + bbcode['tag'] + ']';
|
||||
}
|
||||
else
|
||||
{
|
||||
_html = '[' + bbcode['tag'] + '="' + _option + '"]' + _content + '[/' + bbcode['tag'] + ']';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_html = '[' + bbcode['tag'] + ']' + _content + '[/' + bbcode['tag'] + ']';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Is this RTE?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( parent.IPS_editor[ editor_id ].is_rte )
|
||||
{
|
||||
_html = _html.replace( /(\n|\r|<br>|<br \/>)/g, "<br />" );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Return..
|
||||
//-----------------------------------------
|
||||
|
||||
parent.IPS_editor[ editor_id].editor_check_focus();
|
||||
|
||||
parent.IPS_editor[ editor_id ].insert_text( _html );
|
||||
|
||||
//-----------------------------------------
|
||||
// Kill Window
|
||||
//-----------------------------------------
|
||||
|
||||
do_cancel();
|
||||
|
||||
return false;
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
|
||||
<style type='text/css' media="all">
|
||||
@import url(rte_popup.css);
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body onload="Init()">
|
||||
|
||||
<div class="title" id="_title">Insert</div>
|
||||
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend><strong>Example</strong></legend>
|
||||
<div id="_example" style='font-family:"Courier New", Monaco, Courier;font-size:12px'></div>
|
||||
</fieldset>
|
||||
|
||||
<br />
|
||||
|
||||
<form action="" method="get">
|
||||
|
||||
<div id='use-option' style='display:none'>
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend><strong>Option Text</strong></legend>
|
||||
<div id='_option' style='padding:2px;color:#555;'></div>
|
||||
<table border="0" width='100%' style="padding: 0px; margin: 0px">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><textarea name="text" id="f_option_text" style='width:100%;height:70px' cols='23' rows='4'></textarea></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
<br />
|
||||
</div>
|
||||
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend><strong>Content Text</strong></legend>
|
||||
<div id='_content' style='padding:2px;color:#555;'></div>
|
||||
<table border="0" width='100%' style="padding: 0px; margin: 0px">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><textarea name="href" id="f_content_text" style='width:100%;height:60px' cols='23' onfocus='this.select()' rows='4'></textarea></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<br />
|
||||
|
||||
|
||||
<div style="text-align: center;">
|
||||
<hr />
|
||||
<button type="button" class='tblbutton' name="ok" onclick="return do_submit();">OK</button>
|
||||
<button type="button" class='tblbutton' name="cancel" onclick="return do_cancel();">Cancel</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,264 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Insert Div/Span</title>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
|
||||
//-----------------------------------------
|
||||
// Attempt to get editor ID
|
||||
//-----------------------------------------
|
||||
|
||||
var editor_id = <?php print '"'.trim( htmlspecialchars( substr( $_REQUEST['editorid'], 0, 30 ) ) ).'";'; ?>
|
||||
var this_module = 'div';
|
||||
var this_height = 400;
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// INIT
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function Init()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Set up main close button
|
||||
//-----------------------------------------
|
||||
|
||||
parent.document.getElementById( editor_id + '_cb-close-window' ).onclick = do_cancel;
|
||||
parent.document.getElementById( editor_id + '_cb-close-window' ).style.cursor = 'pointer';
|
||||
|
||||
//-----------------------------------------
|
||||
// Resize window
|
||||
//-----------------------------------------
|
||||
|
||||
parent.document.getElementById( editor_id + '_htmlblock_' + this_module + '_menu' ).style.height = this_height + 'px';
|
||||
parent.document.getElementById( editor_id + '_iframeblock_' + this_module + '_menu' ).style.height = ( this_height - 10 ) + 'px';
|
||||
|
||||
//-----------------------------------------
|
||||
// Module specific stuff
|
||||
//-----------------------------------------
|
||||
|
||||
document.getElementById("f_type").focus();
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Do cancel
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function do_cancel()
|
||||
{
|
||||
parent.IPS_editor[ editor_id ].module_remove_control_bar();
|
||||
return false;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Do submit (low tech)
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function do_submit()
|
||||
{
|
||||
var fields = [ "f_type" , "f_fontfamily" , "f_fontsize", "f_color" , "f_backgroundimage", "f_backgroundrepeat",
|
||||
"f_backgroundcolor", "f_border" , "f_padding", "f_margin" , "f_other" ];
|
||||
|
||||
var param = new Object();
|
||||
|
||||
//-----------------------------------------
|
||||
// Compile data
|
||||
//-----------------------------------------
|
||||
|
||||
for ( var i in fields )
|
||||
{
|
||||
param[ fields[i] ] = document.getElementById( fields[i] ).value;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Now prep the table
|
||||
//-----------------------------------------
|
||||
|
||||
var doc = parent.IPS_editor[ editor_id ].editor_document;
|
||||
|
||||
//-------------------------------
|
||||
// Build remap array
|
||||
//-------------------------------
|
||||
|
||||
var remap_elements = {
|
||||
"f_fontfamily" : "font-family" ,
|
||||
"f_fontsize" : "font-size" ,
|
||||
"f_color" : "color" ,
|
||||
"f_backgroundimage" : "background-image" ,
|
||||
"f_backgroundrepeat" : "background-repeat",
|
||||
"f_backgroundcolor" : "background-color" ,
|
||||
"f_border" : "border" ,
|
||||
"f_padding" : "padding" ,
|
||||
"f_margin" : "margin"
|
||||
};
|
||||
|
||||
//-------------------------------
|
||||
// Get tag type
|
||||
//-------------------------------
|
||||
|
||||
var tagtype = param["f_type"];
|
||||
var style = "";
|
||||
|
||||
//-------------------------------
|
||||
// Start building style
|
||||
//-------------------------------
|
||||
|
||||
style += "style='";
|
||||
|
||||
for (var field in param)
|
||||
{
|
||||
var value = param[field];
|
||||
|
||||
if ( ! value || value == 'undefined' || field == 'undefined' || ! remap_elements[ field ] )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( remap_elements[ field ] && value )
|
||||
{
|
||||
style += remap_elements[ field ] + ":" + value + ";";
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// Finish style
|
||||
//-------------------------------
|
||||
|
||||
style += param["f_other"]+"'";
|
||||
|
||||
//-----------------------------------------
|
||||
// Return..
|
||||
//-----------------------------------------
|
||||
|
||||
parent.IPS_editor[ editor_id].editor_check_focus();
|
||||
|
||||
if ( style )
|
||||
{
|
||||
parent.IPS_editor[ editor_id ].wrap_tags_lite( '<' + tagtype + ' ' + style + '>', '</' + tagtype + '>' );
|
||||
}
|
||||
else
|
||||
{
|
||||
parent.IPS_editor[ editor_id ].wrap_tags_lite( '<' + tagtype + '>', '</' + tagtype + '>' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Kill Window
|
||||
//-----------------------------------------
|
||||
|
||||
do_cancel();
|
||||
|
||||
return false;
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
|
||||
<style type='text/css' media="all">
|
||||
@import url(rte_popup.css);
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body onload="Init()">
|
||||
|
||||
<div class="title">Insert DIV/SPAN</div>
|
||||
|
||||
<form action="" method="get">
|
||||
<table border="0" width='100%' style="padding: 0px; margin: 0px">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td width="1%" nowrap="nowrap">Type:</td>
|
||||
<td width="99%"><select size="1" name="type" id="f_type" title="Div or Span?">
|
||||
<option value="div" selected="1" >DIV</option>
|
||||
<option value="span" >SPAN</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<br />
|
||||
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend>Font</legend>
|
||||
<table border="0" width='100%' style="padding: 0px; margin: 0px">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Family:</td>
|
||||
<td><input type="text" name="fontfamily" id="f_fontfamily" size="20" value="Verdana" title="Enter name of font-family" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Size:</td>
|
||||
<td><input type="text" name="fontsize" id="f_fontsize" size="7" value="10px" title="Enter size and unit" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Color:</td>
|
||||
<td><input type="text" name="color" id="f_color" size="7" value="#000" title="Enter color" /></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<br />
|
||||
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend>Background</legend>
|
||||
<table border="0" width='100%' style="padding: 0px; margin: 0px">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Image:</td>
|
||||
<td><input type="text" name="backgroundimage" id="f_backgroundimage" size="15" value="" title="Leave blank for no image" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Repeat:</td>
|
||||
<td><input type="text" name="backgroundrepeat" id="f_backgroundrepeat" size="15" value="" title="Leave blank for no repeat" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Color:</td>
|
||||
<td><input type="text" name="backgroundcolor" id="f_backgroundcolor" size="7" value="" title="Leave blank for no color" /></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<br />
|
||||
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend>Box Model</legend>
|
||||
<table border="0" width='100%' style="padding: 0px; margin: 0px">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Border:</td>
|
||||
<td><input type="text" name="border" id="f_border" size="20" value="" title="Enter border values" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Padding:</td>
|
||||
<td><input type="text" name="padding" id="f_padding" size="20" value="4px" title="Enter size and unit" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Margin:</td>
|
||||
<td><input type="text" name="margin" id="f_margin" size="20" value="" title="Enter size and unit" /></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend>Custom Elements</legend>
|
||||
<table border="0" width='100%' style="padding: 0px; margin: 0px">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><textarea name="other" id="f_other" style='width:100%;height:70px' cols='23' rows='4'></textarea></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
|
||||
<div style="text-align: center;">
|
||||
<hr />
|
||||
<button type="button" class='tblbutton' name="ok" onclick="return do_submit();">OK</button>
|
||||
<button type="button" class='tblbutton' name="cancel" onclick="return do_cancel();">Cancel</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,208 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Insert Div/Span</title>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
|
||||
//-----------------------------------------
|
||||
// Attempt to get editor ID
|
||||
//-----------------------------------------
|
||||
|
||||
var editor_id = <?php print '"'.trim( htmlspecialchars( substr( $_REQUEST['editorid'], 0, 30 ) ) ).'";'; ?>
|
||||
var this_module = 'email';
|
||||
var this_height = 300;
|
||||
var allow_advanced = null;
|
||||
var current_selection = null;
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// INIT
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function Init()
|
||||
{
|
||||
var allow_advanced = parent.IPS_editor[ editor_id ].allow_advanced;
|
||||
var current_selection = parent.IPS_editor[ editor_id ].get_selection();
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up main close button
|
||||
//-----------------------------------------
|
||||
|
||||
parent.document.getElementById( editor_id + '_cb-close-window' ).onclick = do_cancel;
|
||||
parent.document.getElementById( editor_id + '_cb-close-window' ).style.cursor = 'pointer';
|
||||
|
||||
//-----------------------------------------
|
||||
// Resize window
|
||||
//-----------------------------------------
|
||||
|
||||
parent.document.getElementById( editor_id + '_htmlblock_' + this_module + '_menu' ).style.height = this_height + 'px';
|
||||
parent.document.getElementById( editor_id + '_iframeblock_' + this_module + '_menu' ).style.height = ( this_height - 10 ) + 'px';
|
||||
|
||||
//-----------------------------------------
|
||||
// Module specific stuff
|
||||
//-----------------------------------------
|
||||
|
||||
document.getElementById("f_email").focus();
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up initial text value
|
||||
//-----------------------------------------
|
||||
|
||||
var link_regex = '';
|
||||
var link_text = '';
|
||||
var link_href = '';
|
||||
|
||||
if ( parent.IPS_editor[ editor_id ].use_bbcode && ! parent.IPS_editor[ editor_id ].is_rte )
|
||||
{
|
||||
link_regex = new RegExp( "\[email=([^\]]+?)\]([^\[]+?)\[/email\]", "i" );
|
||||
}
|
||||
else
|
||||
{
|
||||
link_regex = new RegExp( "<a href=['\"]mailto\:([^\"']+?)['\"]([^>]+?)?>(.+?)</a>", "i" );
|
||||
}
|
||||
|
||||
if ( current_selection.match( link_regex ) )
|
||||
{
|
||||
link_href = current_selection.replace( link_regex, "$1" );
|
||||
link_text = current_selection.replace( link_regex, "$3" );
|
||||
}
|
||||
|
||||
if ( link_text )
|
||||
{
|
||||
current_selection = link_text;
|
||||
}
|
||||
|
||||
if ( link_href )
|
||||
{
|
||||
document.getElementById("f_email").value = link_href;
|
||||
}
|
||||
|
||||
document.getElementById("f_text").value = parent.IPS_editor[ editor_id ].strip_empty_html( current_selection );
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Do cancel
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function do_cancel()
|
||||
{
|
||||
parent.IPS_editor[ editor_id ].module_remove_control_bar();
|
||||
return false;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Do submit (low tech)
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function do_submit()
|
||||
{
|
||||
var fields = [ "f_email", "f_text" ];
|
||||
|
||||
var param = new Object();
|
||||
|
||||
//-----------------------------------------
|
||||
// Compile data
|
||||
//-----------------------------------------
|
||||
|
||||
for ( var i in fields )
|
||||
{
|
||||
param[ fields[i] ] = document.getElementById( fields[i] ).value;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up required fields
|
||||
//-----------------------------------------
|
||||
|
||||
var required = {
|
||||
"f_email": "You must enter an email address",
|
||||
"f_text": "You must enter some text for the email body"
|
||||
};
|
||||
|
||||
for (var i in required)
|
||||
{
|
||||
var el = document.getElementById(i);
|
||||
|
||||
if ( ! el.value )
|
||||
{
|
||||
alert(required[i]);
|
||||
el.focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
var link_html = '';
|
||||
|
||||
if ( parent.IPS_editor[ editor_id ].use_bbcode && ! parent.IPS_editor[ editor_id ].is_rte )
|
||||
{
|
||||
link_html = '[email=' + param['f_email'] + ']' + param['f_text'] + '[/email]';
|
||||
}
|
||||
else
|
||||
{
|
||||
link_html = '<a href="mailto:' + param['f_email'] + '">' + param['f_text'] + '</a>';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Return..
|
||||
//-----------------------------------------
|
||||
|
||||
parent.IPS_editor[ editor_id].editor_check_focus();
|
||||
|
||||
parent.IPS_editor[ editor_id ].insert_text( link_html );
|
||||
|
||||
//-----------------------------------------
|
||||
// Kill Window
|
||||
//-----------------------------------------
|
||||
|
||||
do_cancel();
|
||||
|
||||
return false;
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
|
||||
<style type='text/css' media="all">
|
||||
@import url(rte_popup.css);
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body onload="Init()">
|
||||
|
||||
<div class="title">Insert Email</div>
|
||||
|
||||
<form action="" method="get">
|
||||
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend>Email Address</legend>
|
||||
<table border="0" width='100%' style="padding: 0px; margin: 0px">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><textarea name="email" id="f_email" style='width:100%;height:60px' cols='23' onfocus='this.select()' rows='4'>user@domain.com</textarea></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<br />
|
||||
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend>Email Text</legend>
|
||||
<table border="0" width='100%' style="padding: 0px; margin: 0px">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><textarea name="text" id="f_text" style='width:100%;height:70px' cols='23' rows='4'></textarea></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<br />
|
||||
|
||||
<div style="text-align: center;">
|
||||
<hr />
|
||||
<button type="button" class='tblbutton' name="ok" onclick="return do_submit();">OK</button>
|
||||
<button type="button" class='tblbutton' name="cancel" onclick="return do_cancel();">Cancel</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,231 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Insert Div/Span</title>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
|
||||
//-----------------------------------------
|
||||
// Attempt to get editor ID
|
||||
//-----------------------------------------
|
||||
|
||||
var editor_id = <?php print '"'.trim( htmlspecialchars( substr( $_REQUEST['editorid'], 0, 30 ) ) ).'";'; ?>
|
||||
var this_module = 'image';
|
||||
var this_height = 400;
|
||||
var allow_advanced = null;
|
||||
var current_selection = null;
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// INIT
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function Init()
|
||||
{
|
||||
var allow_advanced = parent.IPS_editor[ editor_id ].allow_advanced;
|
||||
var current_selection = parent.IPS_editor[ editor_id ].get_selection();
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up main close button
|
||||
//-----------------------------------------
|
||||
|
||||
parent.document.getElementById( editor_id + '_cb-close-window' ).onclick = do_cancel;
|
||||
parent.document.getElementById( editor_id + '_cb-close-window' ).style.cursor = 'pointer';
|
||||
|
||||
//-----------------------------------------
|
||||
// Resize window
|
||||
//-----------------------------------------
|
||||
|
||||
parent.document.getElementById( editor_id + '_htmlblock_' + this_module + '_menu' ).style.height = this_height + 'px';
|
||||
parent.document.getElementById( editor_id + '_iframeblock_' + this_module + '_menu' ).style.height = ( this_height - 10 ) + 'px';
|
||||
|
||||
//-----------------------------------------
|
||||
// Module specific stuff
|
||||
//-----------------------------------------
|
||||
|
||||
document.getElementById("f_src").focus();
|
||||
|
||||
//-----------------------------------------
|
||||
// Show advanced options?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( allow_advanced )
|
||||
{
|
||||
document.getElementById("advanced-options").style.display = '';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up initial text value
|
||||
//-----------------------------------------
|
||||
|
||||
var link_regex = '';
|
||||
var link_src = '';
|
||||
|
||||
if ( parent.IPS_editor[ editor_id ].use_bbcode && ! parent.IPS_editor[ editor_id ].is_rte )
|
||||
{
|
||||
link_regex = new RegExp( "\[img\]([^\[]+?)\[/img\]", "i" );
|
||||
}
|
||||
else
|
||||
{
|
||||
link_regex = new RegExp( "<img src=['\"]([^\"']+?)['\"]([^>]+?)?/>", "i" );
|
||||
}
|
||||
|
||||
if ( current_selection.match( link_regex ) )
|
||||
{
|
||||
link_src = current_selection.replace( link_regex, "$1" );
|
||||
}
|
||||
|
||||
if ( link_src )
|
||||
{
|
||||
current_selection = link_src;
|
||||
}
|
||||
|
||||
document.getElementById("f_src").value = parent.IPS_editor[ editor_id ].strip_empty_html( current_selection );
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Do cancel
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function do_cancel()
|
||||
{
|
||||
parent.IPS_editor[ editor_id ].module_remove_control_bar();
|
||||
return false;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Do submit (low tech)
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function do_submit()
|
||||
{
|
||||
var fields = [ "f_src", "f_ad_title", "f_ad_alt" ];
|
||||
|
||||
var param = new Object();
|
||||
|
||||
//-----------------------------------------
|
||||
// Compile data
|
||||
//-----------------------------------------
|
||||
|
||||
for ( var i in fields )
|
||||
{
|
||||
param[ fields[i] ] = document.getElementById( fields[i] ).value;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up required fields
|
||||
//-----------------------------------------
|
||||
|
||||
var required = {
|
||||
"f_src": "You must enter an image location"
|
||||
};
|
||||
|
||||
for (var i in required)
|
||||
{
|
||||
var el = document.getElementById(i);
|
||||
|
||||
if ( ! el.value )
|
||||
{
|
||||
alert(required[i]);
|
||||
el.focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Now prep the table
|
||||
//-----------------------------------------
|
||||
|
||||
var link_title = allow_advanced && param['f_ad_title'] != '' ? ' title="' + param['f_ad_title'] + '"' : '';
|
||||
var link_alt = allow_advanced && param['f_ad_alt'] != '' ? ' alt="' + param['f_ad_alt'] + '"' : '';
|
||||
var link_border = allow_advanced && param['f_ad_border'] != '' ? ' border="' + param['f_ad_border'] + '"' : '';
|
||||
var link_html = '';
|
||||
|
||||
if ( parent.IPS_editor[ editor_id ].use_bbcode && ! parent.IPS_editor[ editor_id ].is_rte )
|
||||
{
|
||||
link_html = '[img]' + param['f_src'] + '[/img]';
|
||||
}
|
||||
else
|
||||
{
|
||||
link_html = '<img src="' + param['f_src'] + '"' + link_title + link_alt + link_border + ' />';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Return..
|
||||
//-----------------------------------------
|
||||
|
||||
parent.IPS_editor[ editor_id].editor_check_focus();
|
||||
|
||||
parent.IPS_editor[ editor_id ].insert_text( link_html );
|
||||
|
||||
//-----------------------------------------
|
||||
// Kill Window
|
||||
//-----------------------------------------
|
||||
|
||||
do_cancel();
|
||||
|
||||
return false;
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
|
||||
<style type='text/css' media="all">
|
||||
@import url(rte_popup.css);
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body onload="Init()">
|
||||
|
||||
<div class="title">Insert Image</div>
|
||||
|
||||
<form action="" method="get">
|
||||
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend>Image Location</legend>
|
||||
<table border="0" width='100%' style="padding: 0px; margin: 0px">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><textarea name="src" id="f_src" style='width:100%;height:60px' cols='23' onfocus='this.select()' rows='4'>http://</textarea></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
|
||||
<div id='advanced-options' style='display:none'>
|
||||
<br />
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend>Advanced Options</legend>
|
||||
<table border="0" width='100%' style="padding: 0px; margin: 0px">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Border:</td>
|
||||
<td><input type="text" name="border" id="f_ad_border" size="4" value="0" title="Image Border" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Title:</td>
|
||||
<td><input type="text" name="title" id="f_ad_title" size="20" value="" title="Image Title" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Alt Text:</td>
|
||||
<td><input type="text" name="fontsize" id="f_ad_alt" size="20" value="" title="Image ALT" /></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div style="text-align: center;">
|
||||
<hr />
|
||||
<button type="button" class='tblbutton' name="ok" onclick="return do_submit();">OK</button>
|
||||
<button type="button" class='tblbutton' name="cancel" onclick="return do_cancel();">Cancel</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,260 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Insert Div/Span</title>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
|
||||
//-----------------------------------------
|
||||
// Attempt to get editor ID
|
||||
//-----------------------------------------
|
||||
|
||||
var editor_id = <?php print '"'.trim( htmlspecialchars( substr( $_REQUEST['editorid'], 0, 30 ) ) ).'";'; ?>
|
||||
var this_module = 'link';
|
||||
var this_height = 400;
|
||||
var allow_advanced = null;
|
||||
var current_selection = null;
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// INIT
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function Init()
|
||||
{
|
||||
var allow_advanced = parent.IPS_editor[ editor_id ].allow_advanced;
|
||||
var current_selection = parent.ipsclass.un_htmlspecialchars( parent.IPS_editor[ editor_id ].get_selection() );
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up main close button
|
||||
//-----------------------------------------
|
||||
|
||||
parent.document.getElementById( editor_id + '_cb-close-window' ).onclick = do_cancel;
|
||||
parent.document.getElementById( editor_id + '_cb-close-window' ).style.cursor = 'pointer';
|
||||
|
||||
//-----------------------------------------
|
||||
// Resize window
|
||||
//-----------------------------------------
|
||||
|
||||
parent.document.getElementById( editor_id + '_htmlblock_' + this_module + '_menu' ).style.height = this_height + 'px';
|
||||
parent.document.getElementById( editor_id + '_iframeblock_' + this_module + '_menu' ).style.height = ( this_height - 10 ) + 'px';
|
||||
|
||||
//-----------------------------------------
|
||||
// Module specific stuff
|
||||
//-----------------------------------------
|
||||
|
||||
document.getElementById("f_href").focus();
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up initial text value
|
||||
//-----------------------------------------
|
||||
|
||||
document.getElementById("f_text").value = current_selection;
|
||||
|
||||
//-----------------------------------------
|
||||
// Show advanced options?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( allow_advanced )
|
||||
{
|
||||
document.getElementById("advanced-options").style.display = '';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up initial text value
|
||||
//-----------------------------------------
|
||||
|
||||
var link_regex = '';
|
||||
var link_text = '';
|
||||
var link_href = '';
|
||||
|
||||
if ( parent.IPS_editor[ editor_id ].use_bbcode && ! parent.IPS_editor[ editor_id ].is_rte )
|
||||
{
|
||||
link_regex = /\[url=([^\]]+?)\]([^\[]+?)\[\/url\]/ig;
|
||||
|
||||
if ( current_selection.match( link_regex ) )
|
||||
{
|
||||
link_href = current_selection.replace( link_regex, "$1" );
|
||||
link_text = current_selection.replace( link_regex, "$2" );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
link_regex = /<a href=['"]([^"']+?)['"]([^>]+?)?>(.+?)<\/a>/ig;
|
||||
|
||||
if ( current_selection.match( link_regex ) )
|
||||
{
|
||||
link_href = current_selection.replace( link_regex, "$1" );
|
||||
link_text = current_selection.replace( link_regex, "$3" );
|
||||
}
|
||||
}
|
||||
|
||||
if ( link_text )
|
||||
{
|
||||
current_selection = link_text;
|
||||
}
|
||||
|
||||
if ( link_href )
|
||||
{
|
||||
document.getElementById("f_href").value = link_href;
|
||||
}
|
||||
|
||||
current_selection = current_selection.replace( /<br \/>|<br>|\n|\r/g, "");
|
||||
|
||||
document.getElementById("f_text").value = parent.IPS_editor[ editor_id ].strip_empty_html( current_selection );
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Do cancel
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function do_cancel()
|
||||
{
|
||||
parent.IPS_editor[ editor_id ].module_remove_control_bar();
|
||||
return false;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Do submit (low tech)
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function do_submit()
|
||||
{
|
||||
var fields = [ "f_href", "f_text", "f_ad_title", "f_ad_target" ];
|
||||
|
||||
var param = new Object();
|
||||
|
||||
//-----------------------------------------
|
||||
// Compile data
|
||||
//-----------------------------------------
|
||||
|
||||
for ( var i in fields )
|
||||
{
|
||||
param[ fields[i] ] = document.getElementById( fields[i] ).value;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up required fields
|
||||
//-----------------------------------------
|
||||
|
||||
var required = {
|
||||
"f_href": "You must enter a link location",
|
||||
"f_text": "You must enter some text for the link body"
|
||||
};
|
||||
|
||||
for (var i in required)
|
||||
{
|
||||
var el = document.getElementById(i);
|
||||
|
||||
if ( ! el.value )
|
||||
{
|
||||
alert(required[i]);
|
||||
el.focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Now prep the table
|
||||
//-----------------------------------------
|
||||
|
||||
var link_title = allow_advanced && param['f_ad_title'] ? ' title="' + param['f_ad_title'] + '" ' : '';
|
||||
var link_target = allow_advanced && param['f_ad_target'] ? ' target="' + param['f_ad_target'] + '"' : '';
|
||||
var link_html = '';
|
||||
|
||||
if ( parent.IPS_editor[ editor_id ].use_bbcode && ! parent.IPS_editor[ editor_id ].is_rte )
|
||||
{
|
||||
link_html = '[url=' + param['f_href'] + ']' + param['f_text'] + '[/url]';
|
||||
}
|
||||
else
|
||||
{
|
||||
link_html = '<a href="' + param['f_href'] + '"' + link_title + link_target + '>' + param['f_text'] + '</a>';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Return..
|
||||
//-----------------------------------------
|
||||
|
||||
parent.IPS_editor[ editor_id].editor_check_focus();
|
||||
|
||||
parent.IPS_editor[ editor_id ].insert_text( link_html );
|
||||
|
||||
//-----------------------------------------
|
||||
// Kill Window
|
||||
//-----------------------------------------
|
||||
|
||||
do_cancel();
|
||||
|
||||
return false;
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
|
||||
<style type='text/css' media="all">
|
||||
@import url(rte_popup.css);
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body onload="Init()">
|
||||
|
||||
<div class="title">Insert Link</div>
|
||||
|
||||
<form action="" method="get">
|
||||
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend>Link Location</legend>
|
||||
<table border="0" width='100%' style="padding: 0px; margin: 0px">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><textarea name="href" id="f_href" style='width:100%;height:60px' cols='23' onfocus='this.select()' rows='4'>http://</textarea></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<br />
|
||||
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend>Link Text</legend>
|
||||
<table border="0" width='100%' style="padding: 0px; margin: 0px">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><textarea name="text" id="f_text" style='width:100%;height:70px' cols='23' rows='4'></textarea></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<div id='advanced-options' style='display:none'>
|
||||
<br />
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend>Advanced Options</legend>
|
||||
<table border="0" width='100%' style="padding: 0px; margin: 0px">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Title:</td>
|
||||
<td><input type="text" name="title" id="f_ad_title" size="20" value="" title="Link Title" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Target:</td>
|
||||
<td><input type="text" name="fontsize" id="f_ad_target" size="20" value="" title="Link Target" /></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div style="text-align: center;">
|
||||
<hr />
|
||||
<button type="button" class='tblbutton' name="ok" onclick="return do_submit();">OK</button>
|
||||
<button type="button" class='tblbutton' name="cancel" onclick="return do_cancel();">Cancel</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,299 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
|
||||
<meta HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
|
||||
<meta HTTP-EQUIV="Expires" CONTENT="Mon, 06 May 1996 04:57:00 GMT">
|
||||
<title>Insert Table</title>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
|
||||
//-----------------------------------------
|
||||
// Attempt to get editor ID
|
||||
//-----------------------------------------
|
||||
|
||||
var editor_id = <?php print '"'.trim( htmlspecialchars( substr( $_REQUEST['editorid'], 0, 30 ) ) ).'";'; ?>
|
||||
var this_module = 'table';
|
||||
var this_height = 350;
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// INIT
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function Init()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Set up main close button
|
||||
//-----------------------------------------
|
||||
|
||||
parent.document.getElementById( editor_id + '_cb-close-window' ).onclick = do_cancel;
|
||||
parent.document.getElementById( editor_id + '_cb-close-window' ).style.cursor = 'pointer';
|
||||
|
||||
//-----------------------------------------
|
||||
// Resize window
|
||||
//-----------------------------------------
|
||||
|
||||
parent.document.getElementById( editor_id + '_htmlblock_' + this_module + '_menu' ).style.height = this_height + 'px';
|
||||
parent.document.getElementById( editor_id + '_iframeblock_' + this_module + '_menu' ).style.height = ( this_height - 10 ) + 'px';
|
||||
|
||||
//-----------------------------------------
|
||||
// Module specific stuff
|
||||
//-----------------------------------------
|
||||
|
||||
document.getElementById("f_rows").focus();
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Do cancel
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function do_cancel()
|
||||
{
|
||||
parent.IPS_editor[ editor_id ].module_remove_control_bar();
|
||||
return false;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Do submit (low tech)
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function do_submit()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Fail safe
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! editor_id )
|
||||
{
|
||||
alert("Could not locate the editor ID");
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up required fields
|
||||
//-----------------------------------------
|
||||
|
||||
var required = {
|
||||
"f_rows": "You must enter a number of rows",
|
||||
"f_cols": "You must enter a number of columns"
|
||||
};
|
||||
|
||||
for (var i in required)
|
||||
{
|
||||
var el = document.getElementById(i);
|
||||
|
||||
if ( ! el.value )
|
||||
{
|
||||
alert(required[i]);
|
||||
el.focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
var fields = ["f_rows" , "f_cols" , "f_width" , "f_unit",
|
||||
"f_align", "f_border", "f_spacing", "f_padding"];
|
||||
|
||||
var param = new Object();
|
||||
|
||||
//-----------------------------------------
|
||||
// Compile data
|
||||
//-----------------------------------------
|
||||
|
||||
for ( var i in fields )
|
||||
{
|
||||
param[ fields[i] ] = document.getElementById( fields[i] ).value;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Now prep the table
|
||||
//-----------------------------------------
|
||||
|
||||
var doc = parent.IPS_editor[ editor_id ].editor_document;
|
||||
|
||||
//-----------------------------------------
|
||||
// create the table element inside a wrapper
|
||||
// div that we can use innerHTML on
|
||||
//-----------------------------------------
|
||||
|
||||
var wrap_div = document.createElement("DIV");
|
||||
var table = document.createElement("table");
|
||||
|
||||
wrap_div.appendChild( table );
|
||||
|
||||
//-----------------------------------------
|
||||
// assign the given arguments
|
||||
//-----------------------------------------
|
||||
|
||||
for (var field in param)
|
||||
{
|
||||
var value = param[field];
|
||||
|
||||
if ( ! value )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (field)
|
||||
{
|
||||
case "f_width" : table.style.width = value + param["f_unit"]; break;
|
||||
case "f_align" : table.align = value; break;
|
||||
case "f_border" : table.border = parseInt(value); break;
|
||||
case "f_spacing" : table.cellspacing = parseInt(value); break;
|
||||
case "f_padding" : table.cellpadding = parseInt(value); break;
|
||||
}
|
||||
}
|
||||
|
||||
var tbody = document.createElement("tbody");
|
||||
|
||||
table.appendChild(tbody);
|
||||
|
||||
for (var i = 0; i < param["f_rows"]; ++i)
|
||||
{
|
||||
var tr = document.createElement("tr");
|
||||
|
||||
tbody.appendChild(tr);
|
||||
|
||||
for (var j = 0; j < param["f_cols"]; ++j)
|
||||
{
|
||||
var td = document.createElement("td");
|
||||
|
||||
tr.appendChild(td);
|
||||
|
||||
//-------------------------------
|
||||
// Mozilla likes to see something
|
||||
// inside the cell.
|
||||
//-------------------------------
|
||||
|
||||
( ! parent.IPS_editor[ editor_id ].is_ie )
|
||||
{
|
||||
td.appendChild( document.createElement("br") );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Clean up
|
||||
//-----------------------------------------
|
||||
|
||||
wrap_div.innerHTML = parent.IPS_editor[ editor_id ].clean_html( wrap_div.innerHTML );
|
||||
|
||||
//-----------------------------------------
|
||||
// Return..
|
||||
//-----------------------------------------
|
||||
|
||||
parent.IPS_editor[ editor_id].editor_check_focus();
|
||||
|
||||
parent.IPS_editor[ editor_id ].insert_text( wrap_div.innerHTML );
|
||||
|
||||
//-----------------------------------------
|
||||
// Kill node
|
||||
//-----------------------------------------
|
||||
|
||||
//doc.removeChild( wrap_div );
|
||||
|
||||
//-----------------------------------------
|
||||
// Kill Window
|
||||
//-----------------------------------------
|
||||
|
||||
do_cancel();
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
|
||||
<style type='text/css' media="all">
|
||||
@import url(rte_popup.css);
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body onload="Init()">
|
||||
|
||||
<div class="title">Insert Table</div>
|
||||
|
||||
<form action="" method="get">
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend>Basics</legend>
|
||||
<table border="0" width='100%' style="padding: 0px; margin: 0px">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Rows:</td>
|
||||
<td><input type="text" name="rows" id="f_rows" size="5" title="Number of rows" value="2" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cols:</td>
|
||||
<td><input type="text" name="cols" id="f_cols" size="5" title="Number of columns" value="4" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Width:</td>
|
||||
<td><input type="text" name="width" id="f_width" size="5" title="Width of the table" value="100" />
|
||||
<select size="1" name="unit" id="f_unit" title="Width unit">
|
||||
<option value="%" selected="1" >Percent</option>
|
||||
<option value="px" >Pixels</option>
|
||||
<option value="em" >Em</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<br />
|
||||
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend>Layout</legend>
|
||||
<table border="0" width='100%' >
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Alignment:</td>
|
||||
<td>
|
||||
<select size="1" name="align" id="f_align"
|
||||
title="Positioning of this image">
|
||||
<option value="" selected="1" >Not set</option>
|
||||
<option value="left" >Left</option>
|
||||
<option value="right" >Right</option>
|
||||
<option value="texttop" >Texttop</option>
|
||||
<option value="absmiddle" >Absmiddle</option>
|
||||
<option value="baseline" >Baseline</option>
|
||||
<option value="absbottom" >Absbottom</option>
|
||||
<option value="bottom" >Bottom</option>
|
||||
<option value="middle" >Middle</option>
|
||||
<option value="top" >Top</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<br />
|
||||
|
||||
<fieldset style="margin-left: 5px;">
|
||||
<legend>Spacing</legend>
|
||||
<table border="0" width='100%' style="padding: 0px; margin: 0px">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Cell Spacing:</td>
|
||||
<td><input type="text" name="cols" id="f_spacing" size="5" title="Cell Spacing" value="0" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cell Padding:</td>
|
||||
<td><input type="text" name="cols" id="f_padding" size="5" title="Cell Padding" value="0" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Border thickness:</td>
|
||||
<td><input type="text" name="border" id="f_border" size="5" value="1" title="Leave empty for no border" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<hr />
|
||||
<div align='center'>
|
||||
<button type="button" class='tblbutton' name="ok" onclick="return do_submit();">OK</button>
|
||||
<button type="button" class='tblbutton' name="cancel" onclick="return do_cancel();">Cancel</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,143 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// IPS Cross-Browser Global Text Editor HTML
|
||||
//------------------------------------------------------------------------------
|
||||
// Supports all "v5" browsers (inc. Opera, Safari, etc)
|
||||
// Used for non RTE applications.
|
||||
// (c) 2005 Invision Power Services, Inc.
|
||||
// http://www.invisionpower.com
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
/**
|
||||
* Rich Text Editor HTML Functions
|
||||
*/
|
||||
function rte_html_functions()
|
||||
{
|
||||
/**
|
||||
* Main control bar object
|
||||
* @var object Main control bar object
|
||||
*/
|
||||
this.control_obj = false;
|
||||
/**
|
||||
* Editor ID
|
||||
*/
|
||||
this.editor_id = false;
|
||||
/**
|
||||
* Current open bar object
|
||||
*/
|
||||
this.current_bar_object = null;
|
||||
|
||||
/**
|
||||
* Main init function
|
||||
* Nothing much to do
|
||||
*/
|
||||
this.init = function()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Show new control bar
|
||||
*
|
||||
* @param type Type of control bar (must be same as function key)
|
||||
*/
|
||||
this.show_control_bar = function( type )
|
||||
{
|
||||
if ( ! this.control_obj )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Already open? Kill it
|
||||
//-----------------------------------------
|
||||
|
||||
if ( this.current_bar_object )
|
||||
{
|
||||
this.remove_control_bar();
|
||||
}
|
||||
|
||||
var mainbar = document.getElementById( 'rte-main-bar');
|
||||
var addtobar = document.getElementById( 'rte-hidden-items' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Spawn new DIV object
|
||||
//-----------------------------------------
|
||||
|
||||
var newdiv = document.createElement('div');
|
||||
|
||||
newdiv.id = this.editor_id + '_htmlblock_' + type + '_menu';
|
||||
newdiv.style.display = '';
|
||||
newdiv.className = 'rte-buttonbar';
|
||||
newdiv.style.zIndex = parseInt( this.control_obj.style.zIndex ) + 1;
|
||||
newdiv.style.position = 'absolute';
|
||||
newdiv.style.width = '220px';
|
||||
newdiv.style.height = '400px';
|
||||
newdiv.style.top = ipsclass.get_obj_toppos( mainbar ) + 'px';
|
||||
newdiv.style.left = ipsclass.get_obj_leftpos( mainbar ) - ( parseInt(newdiv.style.width) + 10 ) + 'px';
|
||||
|
||||
var tmpheight = parseInt(newdiv.style.height) - 15;
|
||||
newdiv.innerHTML = this.wrap_html_panel( "<iframe id='"+ this.editor_id + '_iframeblock_' + type + '_menu' + "' src='"+global_rte_includes_url + "insert_" + type + ".php?editorid="+this.editor_id+"' style='background-color:transparent;border:0px;overflow:auto;width:99%;height:" + tmpheight + "px'></iframe>" );
|
||||
|
||||
//-----------------------------------------
|
||||
// Add and show
|
||||
//-----------------------------------------
|
||||
|
||||
addtobar.appendChild(newdiv);
|
||||
|
||||
ipsclass.set_unselectable( newdiv );
|
||||
|
||||
//-----------------------------------------
|
||||
// INIT Drag
|
||||
//-----------------------------------------
|
||||
|
||||
var phdl = document.getElementById('rte-pallete-handle');
|
||||
|
||||
Drag.init( phdl, newdiv );
|
||||
|
||||
this.current_bar_object = newdiv;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove control bar
|
||||
* Removes the control bar.
|
||||
*/
|
||||
this.remove_control_bar = function()
|
||||
{
|
||||
if ( ! this.current_bar_object )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var addtobar = document.getElementById( 'rte-hidden-items' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Kill old bar
|
||||
//-----------------------------------------
|
||||
|
||||
addtobar.removeChild( this.current_bar_object );
|
||||
|
||||
//-----------------------------------------
|
||||
// Reset bar object
|
||||
//-----------------------------------------
|
||||
|
||||
this.current_bar_object = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrap HTML block with basic control panel stuff
|
||||
*/
|
||||
this.wrap_html_panel = function( html )
|
||||
{
|
||||
var newhtml = "";
|
||||
newhtml += " <div id='rte-pallete-wrap'>";
|
||||
newhtml += " <div id='rte-pallete-main'>";
|
||||
newhtml += " <div class='rte-cb-bg' id='rte-pallete-handle'>";
|
||||
newhtml += " <div align='left'><img id='rte-cb-close-window' src='"+global_rte_images_url+"rte-cb-close.gif' alt='' class='ipd' border='0' /></div>";
|
||||
newhtml += " </div>";
|
||||
newhtml += " <div>" + html + "</div>";
|
||||
newhtml += " </div>";
|
||||
newhtml += " </div>";
|
||||
|
||||
return newhtml;
|
||||
}
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
html, body
|
||||
{
|
||||
color: #000;
|
||||
font: 10px Verdana,sans-serif;
|
||||
background-color: transparent;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
body
|
||||
{
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
table
|
||||
{
|
||||
font: 10px Verdana,sans-serif;
|
||||
}
|
||||
|
||||
.tblbutton
|
||||
{
|
||||
border:1px solid #999;
|
||||
background-color: #CCC;
|
||||
font-family:Verdana, Arial;
|
||||
font-size:10px;
|
||||
font-weight:bold;
|
||||
padding:2px;
|
||||
}
|
||||
|
||||
form p
|
||||
{
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.fl
|
||||
{
|
||||
width: 9em; float: left; padding: 2px 5px; text-align: right;
|
||||
}
|
||||
|
||||
.fr
|
||||
{
|
||||
width: 7em; float: left; padding: 2px 5px; text-align: right;
|
||||
}
|
||||
|
||||
.frlarge
|
||||
{
|
||||
width: 10em; float: left; padding: 2px 5px; text-align: right;
|
||||
}
|
||||
|
||||
fieldset
|
||||
{
|
||||
padding: 0px 10px 5px 5px;
|
||||
}
|
||||
|
||||
select, input, button
|
||||
{
|
||||
font: 10px Verdana,sans-serif;
|
||||
}
|
||||
|
||||
button
|
||||
{
|
||||
width: 70px;
|
||||
}
|
||||
.space
|
||||
{
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.title
|
||||
{
|
||||
color: #000;
|
||||
font-weight: bold;
|
||||
font-size: 120%;
|
||||
padding: 3px 10px;
|
||||
margin-bottom: 10px;
|
||||
border-bottom: 1px solid black;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
form
|
||||
{
|
||||
padding: 0px; margin: 0px;
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<html>␍<head><title>Invision Power Board - Bulletin Board System</title></head>␍<body>␍<h1>403: Invision Power Board -> Forbidden</h1>␍<hr>␍You have reached this Page in error, please use␍your back button to return to Invision Board.␍<hr>␍<a href="http://anonym.to/http://www.invisionboard.com/">Invision Power Board</a>␍</body>␍</html>␍
|
||||
@@ -1,15 +0,0 @@
|
||||
//------------------------------------------
|
||||
// Invision Power Board v2.1
|
||||
// Boards JS File
|
||||
// (c) 2005 Invision Power Services, Inc.
|
||||
//
|
||||
// http://www.invisionboard.com
|
||||
//------------------------------------------
|
||||
|
||||
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Send request to update marker
|
||||
// NO LONGER USED
|
||||
/*--------------------------------------------*/
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
//------------------------------------------
|
||||
// Invision Power Board v2.0
|
||||
// Find User JS File
|
||||
// (c) 2004 Invision Power Services, Inc.
|
||||
//
|
||||
// http://www.invisionboard.com
|
||||
//------------------------------------------
|
||||
|
||||
|
||||
|
||||
function add_to_form()
|
||||
{
|
||||
var name = document.finduser.username.options[document.finduser.username.selectedIndex].value;
|
||||
|
||||
if (separator == 'line')
|
||||
{
|
||||
separator = '\n';
|
||||
}
|
||||
|
||||
if (separator == 'none')
|
||||
{
|
||||
separator = '';
|
||||
}
|
||||
|
||||
if (entry == 'textarea')
|
||||
{
|
||||
// Where shall we put the separator?
|
||||
|
||||
var tbox = eval('opener.document.REPLIER.'+in_name+'.value');
|
||||
var tboxSize = eval('opener.document.REPLIER.'+in_name+'.value.length');
|
||||
|
||||
// Remove leading spaces...
|
||||
|
||||
while ( tbox.slice(0,1) == " " )
|
||||
{
|
||||
tbox = tbox.substr(1, tboxSize - 1);
|
||||
tboxSize = tboxSize;
|
||||
}
|
||||
|
||||
// Remove trailing spaces...
|
||||
|
||||
while ( tbox.slice(tboxSize - 1, tboxSize) == " " )
|
||||
{
|
||||
tbox = tbox.substr(0, tboxSize - 1);
|
||||
tboxSize = tboxSize;
|
||||
}
|
||||
|
||||
// Do we have a leading comma?
|
||||
|
||||
while ( tbox.slice(0,1) == "\n" )
|
||||
{
|
||||
tbox = tbox.substr(1, tboxSize - 1);
|
||||
tboxSize = tboxSize;
|
||||
}
|
||||
|
||||
// Do we have a trailing comma?...
|
||||
|
||||
while ( tbox.slice(tboxSize - 1, tboxSize) == "\n" )
|
||||
{
|
||||
tbox = tbox.substr(0, tboxSize - 1);
|
||||
tboxSize = tboxSize;
|
||||
}
|
||||
|
||||
// First in box?
|
||||
|
||||
if ( tboxSize == 0)
|
||||
{
|
||||
eval('opener.document.REPLIER.'+in_name+'.value += name');
|
||||
}
|
||||
else
|
||||
{
|
||||
eval('opener.document.REPLIER.'+in_name+'.value += separator + name');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,965 +0,0 @@
|
||||
//------------------------------------------
|
||||
// Invision Power Board v2.1
|
||||
// Forums JS File
|
||||
// (c) 2005 Invision Power Services, Inc.
|
||||
//
|
||||
// http://www.invisionboard.com
|
||||
//------------------------------------------
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// INIT
|
||||
/*--------------------------------------------*/
|
||||
|
||||
var topic_dates = {};
|
||||
var topic_flags = {};
|
||||
var topic_state = {};
|
||||
var forum_mark_time;
|
||||
var newer_topics = new Array;
|
||||
var newer_count = 0;
|
||||
var flags_count = 0;
|
||||
var forum_id;
|
||||
var url_extra = '';
|
||||
var start_int = 0;
|
||||
var forum_mark_sent = 0;
|
||||
var span_html = new Array;
|
||||
var desc_html = new Array;
|
||||
var text_html = new Array;
|
||||
var folders = new Array;
|
||||
var _desc_clicked = 0;
|
||||
var topic_links_init = 0;
|
||||
|
||||
var _this_select_all = 0;
|
||||
|
||||
var tid_date = new Array();
|
||||
|
||||
var click_delay = 1200; //microseconds (1.2 seconds)
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Pop up mod options
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function forum_mod_pop( fid )
|
||||
{
|
||||
try
|
||||
{
|
||||
menu_action_close();
|
||||
}
|
||||
catch(e) { }
|
||||
|
||||
PopUp( ipb_var_base_url + 'act=mod&CODE=prune_start&f='+fid+'&auth_key='+ipb_md5_check, 'PRUNE', 600,500);
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// INIT topic links...
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function forum_init_topic_links()
|
||||
{
|
||||
//----------------------------------
|
||||
// Get page links...
|
||||
// Gah.. another safari bug
|
||||
//----------------------------------
|
||||
|
||||
var pagelinks = document.getElementsByTagName('a');
|
||||
|
||||
//----------------------------------
|
||||
// Sort through and grab topic links
|
||||
//----------------------------------
|
||||
|
||||
for ( var i = 0 ; i <= pagelinks.length ; i++ )
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( ! pagelinks[i].id )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var linkid = pagelinks[i].id;
|
||||
var linkname = linkid.replace( /^(.*)-(\d+)$/, "$1" );
|
||||
|
||||
if ( linkname == 'tid-link' )
|
||||
{
|
||||
pagelinks[i].onmousedown = topic_link_event_mousedown;
|
||||
pagelinks[i].onmouseup = topic_link_event_mouseup;
|
||||
//pagelinks[i].style.cursor = 'text';
|
||||
|
||||
if ( ! topic_links_init )
|
||||
{
|
||||
pagelinks[i].title = pagelinks[i].title + '. ' + lang_clickhold;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
topic_links_init = 1;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Mousedown, start timer
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function topic_link_event_mousedown( event )
|
||||
{
|
||||
//----------------------------------
|
||||
// Prevent link loading
|
||||
//----------------------------------
|
||||
|
||||
event = global_cancel_bubble( event, true );
|
||||
|
||||
//----------------------------------
|
||||
// Get TID
|
||||
//----------------------------------
|
||||
|
||||
var tid = _get_tid_from_id( this.id );
|
||||
|
||||
//----------------------------------
|
||||
// Start...
|
||||
//----------------------------------
|
||||
|
||||
tid_date[ tid ] = _get_time_now();
|
||||
|
||||
//----------------------------------
|
||||
// Start loop
|
||||
//----------------------------------
|
||||
|
||||
setTimeout( "topic_link_event_timer("+tid+")", 5 );
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Event, loop
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function topic_link_event_timer( tid )
|
||||
{
|
||||
//----------------------------------
|
||||
// Get time now
|
||||
//----------------------------------
|
||||
|
||||
var timenow = _get_time_now();
|
||||
|
||||
//----------------------------------
|
||||
// Click held for 1.5 s+?
|
||||
//----------------------------------
|
||||
|
||||
if ( timenow > 0 && tid_date[tid] > 0 && ( (timenow - tid_date[tid] ) > click_delay ) )
|
||||
{
|
||||
//----------------------------------
|
||||
// Yeah.. wipe tid time and convert
|
||||
//----------------------------------
|
||||
|
||||
tid_date[tid] = 0;
|
||||
span_to_input( tid );
|
||||
return false;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Not wiped? loop on!
|
||||
//----------------------------------
|
||||
|
||||
if ( tid_date[tid] > 0 )
|
||||
{
|
||||
setTimeout( "topic_link_event_timer("+tid+")", 5 );
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Mouseup? Cancel timer to kill the loop
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function topic_link_event_mouseup( event )
|
||||
{
|
||||
//----------------------------------
|
||||
// Prevent link loading
|
||||
//----------------------------------
|
||||
|
||||
event = global_cancel_bubble( event, true );
|
||||
|
||||
//----------------------------------
|
||||
// Get TID
|
||||
//----------------------------------
|
||||
|
||||
var tid = _get_tid_from_id( this.id );
|
||||
|
||||
//----------------------------------
|
||||
// Reset timer
|
||||
//----------------------------------
|
||||
|
||||
tid_date[tid] = 0;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Get time now
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function _get_time_now()
|
||||
{
|
||||
var mydate = new Date();
|
||||
return mydate.getTime();
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Get TID from ID
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function _get_tid_from_id( id )
|
||||
{
|
||||
return id.replace( /.*\-(\d+)/, "$1" );
|
||||
}
|
||||
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Turn topic title into text input
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function topic_toggle_folder( tid, state )
|
||||
{
|
||||
//----------------------------------
|
||||
// Using fancy js?
|
||||
//----------------------------------
|
||||
|
||||
if ( ! use_enhanced_js )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Can edit?
|
||||
//----------------------------------
|
||||
|
||||
if ( ! perm_can_open && ! perm_can_close )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var td_content = document.getElementById( 'tid-folder-' + tid ).innerHTML;
|
||||
|
||||
if ( topic_state[ tid ] )
|
||||
{
|
||||
state = topic_state[ tid ];
|
||||
}
|
||||
|
||||
if ( state == 'closed' )
|
||||
{
|
||||
//----------------------------------
|
||||
// Can?
|
||||
//----------------------------------
|
||||
|
||||
if ( ! perm_can_open )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Topic is locked
|
||||
//----------------------------------
|
||||
|
||||
if ( folders[ tid ] )
|
||||
{
|
||||
td_content = folders[ tid ];
|
||||
}
|
||||
|
||||
state = 'open';
|
||||
}
|
||||
else
|
||||
{
|
||||
//----------------------------------
|
||||
// Can?
|
||||
//----------------------------------
|
||||
|
||||
if ( ! perm_can_close )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Topic isn't locked
|
||||
//----------------------------------
|
||||
|
||||
folders[ tid ] = td_content;
|
||||
state = 'closed';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Store state
|
||||
//-----------------------------------------
|
||||
|
||||
topic_state[ tid ] = state;
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Main function to do on request
|
||||
// Must be defined first!!
|
||||
/*--------------------------------------------*/
|
||||
|
||||
do_request_function = function()
|
||||
{
|
||||
//----------------------------------
|
||||
// Ignore unless we're ready to go
|
||||
//----------------------------------
|
||||
|
||||
if ( ! xmlobj.readystate_ready_and_ok() )
|
||||
{
|
||||
// Could do a little loading graphic here?
|
||||
return;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// INIT
|
||||
//----------------------------------
|
||||
|
||||
var returned = xmlobj.xmlhandler.responseText;
|
||||
|
||||
td_content = returned;
|
||||
document.getElementById( 'tid-folder-' + tid ).innerHTML = td_content;
|
||||
};
|
||||
|
||||
//----------------------------------
|
||||
// LOAD XML
|
||||
//----------------------------------
|
||||
|
||||
xmlobj = new ajax_request();
|
||||
xmlobj.onreadystatechange( do_request_function );
|
||||
|
||||
xmlobj.process( ipb_var_base_url + 'act=xmlout&do=save-topic&type=openclose&name='+state+'&md5check='+ipb_md5_check+'&tid='+tid );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Turn topic title into text input
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function span_to_input( tid )
|
||||
{
|
||||
//----------------------------------
|
||||
// Using fancy js?
|
||||
//----------------------------------
|
||||
|
||||
if ( ! use_enhanced_js )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Can?
|
||||
//----------------------------------
|
||||
|
||||
if ( ! perm_can_edit )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Prevent double click when desc open
|
||||
//----------------------------------
|
||||
|
||||
if ( _desc_clicked )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
span_html[ tid ] = document.getElementById( 'tid-span-' + tid ).innerHTML;
|
||||
text_html[ tid ] = document.getElementById( 'tid-link-' + tid ).innerHTML;
|
||||
|
||||
//----------------------------------
|
||||
// Topic title
|
||||
//----------------------------------
|
||||
|
||||
perm_max_length = perm_max_length ? perm_max_length : 50;
|
||||
|
||||
document.getElementById( 'tid-span-' + tid ).innerHTML = '<input id="edit-'+tid+'" class="dny-edit-title" maxlength="'+perm_max_length+'" type="text" size="40" value="'+text_html[ tid ].replace( /"/g, '"') +'" />'; //"'
|
||||
document.getElementById( 'edit-' + tid ).onkeyup = function( event ) { tid_keypress(event, tid) }
|
||||
document.getElementById( 'edit-' + tid ).onblur = function( event ) { tid_blur(tid) }
|
||||
document.getElementById( 'edit-' + tid ).focus();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Turn topic DESC into text input
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function span_desc_to_input( tid )
|
||||
{
|
||||
//----------------------------------
|
||||
// Using fancy js?
|
||||
//----------------------------------
|
||||
|
||||
if ( ! use_enhanced_js )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Can?
|
||||
//----------------------------------
|
||||
|
||||
if ( ! perm_can_edit )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Prevent double click when desc open
|
||||
//----------------------------------
|
||||
|
||||
if ( _desc_clicked )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
_desc_clicked = 1;
|
||||
|
||||
desc_html[ tid ] = document.getElementById( 'tid-desc-' + tid ).innerHTML;
|
||||
|
||||
//----------------------------------
|
||||
// Topic desc
|
||||
//----------------------------------
|
||||
|
||||
document.getElementById( 'tid-desc-' + tid ).innerHTML = '<input id="edit-'+tid+'" maxlength="70" class="dny-edit-title" type="text" size="40" onblur="tid_blur(\''+tid+'\', \'desc\')" onkeypress="tid_keypress(event, \''+tid+'\',\'desc\')" value="'+desc_html[ tid ].replace( /"/g, '"')+'" />'; //"'
|
||||
document.getElementById( 'edit-' + tid ).focus();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// BLUR HANDLER
|
||||
/*--------------------------------------------*/
|
||||
|
||||
tid_blur = function( tid, type )
|
||||
{
|
||||
new_text = document.getElementById( 'edit-' + tid ).value;
|
||||
|
||||
if( type == 'desc' )
|
||||
{
|
||||
tid_save( tid, new_text, type );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( new_text != "" )
|
||||
{
|
||||
tid_save( tid, new_text, type );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// KEY PRESS HANDLER
|
||||
/*--------------------------------------------*/
|
||||
|
||||
tid_keypress = function( evt, tid, type )
|
||||
{
|
||||
if ( is_safari )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
evt = evt ? evt : window.event;
|
||||
|
||||
new_text = document.getElementById( 'edit-' + tid ).value;
|
||||
|
||||
if ( ( evt.keyCode == 13 || evt.keyCode == 3 ) && new_text != "" )
|
||||
{
|
||||
tid_save( tid, new_text, type );
|
||||
}
|
||||
else if( evt.keyCode == 27 )
|
||||
{
|
||||
if( type == 'desc' )
|
||||
{
|
||||
document.getElementById( 'tid-desc-' + tid ).innerHTML = desc_html[ tid ];
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById( 'tid-span-' + tid ).innerHTML = span_html[ tid ];
|
||||
document.getElementById( 'tid-link-' + tid ).innerHTML = text_html[ tid ];
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// UDPATE DB
|
||||
/*--------------------------------------------*/
|
||||
|
||||
tid_save = function( tid, new_text, type )
|
||||
{
|
||||
var donotedit = 0;
|
||||
|
||||
if ( type == 'desc' )
|
||||
{
|
||||
if ( new_text == desc_html[ tid ] )
|
||||
{
|
||||
donotedit = 1;
|
||||
}
|
||||
|
||||
_desc_clicked = 0;
|
||||
|
||||
document.getElementById( 'tid-desc-' + tid ).innerHTML = new_text;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( new_text == text_html[ tid ] )
|
||||
{
|
||||
donotedit = 1;
|
||||
}
|
||||
|
||||
type = 'title';
|
||||
document.getElementById( 'tid-span-' + tid ).innerHTML = span_html[ tid ];
|
||||
document.getElementById( 'tid-link-' + tid ).innerHTML = new_text;
|
||||
|
||||
//----------------------------------
|
||||
// Re-check topic links
|
||||
//----------------------------------
|
||||
|
||||
forum_init_topic_links();
|
||||
}
|
||||
|
||||
if ( donotedit )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var url = ipb_var_base_url + 'act=xmlout&do=save-topic&type='+type+'&md5check='+ipb_md5_check+'&tid='+tid;
|
||||
var fields = new Array();
|
||||
|
||||
//----------------------------------
|
||||
// Populate fields
|
||||
//----------------------------------
|
||||
|
||||
fields['md5check'] = ipb_md5_check;
|
||||
fields['tid'] = tid;
|
||||
fields['act'] = 'xmlout';
|
||||
fields['do'] = 'save-topic';
|
||||
fields['type'] = type;
|
||||
fields['name'] = new_text;
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Main function to do on request
|
||||
// Must be defined first!!
|
||||
/*--------------------------------------------*/
|
||||
|
||||
do_request_function = function()
|
||||
{
|
||||
//----------------------------------
|
||||
// Ignore unless we're ready to go
|
||||
//----------------------------------
|
||||
|
||||
if ( ! xmlobj.readystate_ready_and_ok() )
|
||||
{
|
||||
// Could do a little loading graphic here?
|
||||
return;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// INIT
|
||||
//----------------------------------
|
||||
|
||||
var returned = xmlobj.xmlhandler.responseText;
|
||||
|
||||
if ( type != 'desc' && ! returned.match( /<null>s<\/null>/ ) )
|
||||
{
|
||||
document.getElementById( 'tid-link-' + tid ).innerHTML = returned;
|
||||
}
|
||||
};
|
||||
|
||||
//----------------------------------
|
||||
// LOAD XML
|
||||
//----------------------------------
|
||||
|
||||
xmlobj = new ajax_request();
|
||||
xmlobj.onreadystatechange( do_request_function );
|
||||
xmlobj.process( url, 'POST', xmlobj.format_for_post(fields) );
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Who posted
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function who_posted(tid)
|
||||
{
|
||||
window.open( ipb_var_base_url+ "act=Stats&CODE=who&t="+tid, "WhoPosted", "toolbar=no,scrollbars=yes,resizable=yes,width=230,height=300");
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Check delete
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function checkdelete()
|
||||
{
|
||||
if ( ! document.modform.selectedtids.value )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
isDelete = document.modform.tact.options[document.modform.tact.selectedIndex].value;
|
||||
|
||||
if (isDelete == 'delete')
|
||||
{
|
||||
formCheck = confirm( lang_suredelete );
|
||||
|
||||
if (formCheck == true)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Toggle selection
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function forum_select_all()
|
||||
{
|
||||
clean = new Array();
|
||||
saved = new Array();
|
||||
var topics_this_page = new Array();
|
||||
|
||||
tmp = document.modform.selectedtids.value;
|
||||
|
||||
if ( tmp != "" )
|
||||
{
|
||||
saved = tmp.split(",");
|
||||
}
|
||||
|
||||
if( _this_select_all == 0 )
|
||||
{
|
||||
var the_topics = document.getElementsByTagName('input');
|
||||
|
||||
for ( var i = 0 ; i <= the_topics.length ; i++ )
|
||||
{
|
||||
var e = the_topics[i];
|
||||
|
||||
if ( e && (e.type == 'hidden') && (! e.disabled) )
|
||||
{
|
||||
var s = e.id;
|
||||
var a = s.replace( /^tid_(.+?)$/, "$1" );
|
||||
|
||||
if ( a )
|
||||
{
|
||||
try
|
||||
{
|
||||
document.getElementById( 'ipb-topic-' + a ).src = selectedbutton;
|
||||
clean[clean.length] = a;
|
||||
topics_this_page[ a ] = 1;
|
||||
}
|
||||
catch(err)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
document.getElementById( 'ipb-topics-all' ).src = selectedbutton;
|
||||
|
||||
_this_select_all = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
var the_topics = document.getElementsByTagName('input');
|
||||
|
||||
for ( var i = 0 ; i <= the_topics.length ; i++ )
|
||||
{
|
||||
var e = the_topics[i];
|
||||
|
||||
if ( e && (e.type == 'hidden') && (! e.disabled) )
|
||||
{
|
||||
var s = e.id;
|
||||
var a = s.replace( /^tid_(.+?)$/, "$1" );
|
||||
|
||||
if ( a )
|
||||
{
|
||||
try
|
||||
{
|
||||
document.getElementById( 'ipb-topic-' + a ).src = unselectedbutton;
|
||||
topics_this_page[ a ] = 1;
|
||||
}
|
||||
catch(err)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
document.getElementById( 'ipb-topics-all' ).src = unselectedbutton;
|
||||
|
||||
_this_select_all = 0;
|
||||
}
|
||||
|
||||
for( i = 0 ; i < saved.length; i++ )
|
||||
{
|
||||
if ( saved[i] != "" && topics_this_page[ saved[i] ] != 1 )
|
||||
{
|
||||
clean[clean.length] = saved[i];
|
||||
}
|
||||
}
|
||||
|
||||
newvalue = clean.join(',');
|
||||
|
||||
var oldvalue = 0;
|
||||
|
||||
for( var k = 0; k < clean.length; k++ )
|
||||
{
|
||||
if( topics_this_page[ clean[ k ] ] != 1 )
|
||||
{
|
||||
oldvalue++;
|
||||
}
|
||||
}
|
||||
|
||||
my_setcookie( 'modtids', newvalue, 0 );
|
||||
|
||||
document.modform.selectedtids.value = newvalue;
|
||||
|
||||
newcount = stacksize(clean);
|
||||
|
||||
if( oldvalue > 0 )
|
||||
{
|
||||
document.modform.gobutton.value = ipsclass.html_entity_decode( lang_gobutton ) + ' (' + newcount + ') (' + oldvalue + ' ' + ipsclass.html_entity_decode( lang_otherpage ) +' )';
|
||||
}
|
||||
else
|
||||
{
|
||||
document.modform.gobutton.value = ipsclass.html_entity_decode( lang_gobutton ) + ' (' + newcount + ')';
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function forum_toggle_tid( tid )
|
||||
{
|
||||
var saved = new Array();
|
||||
var clean = new Array();
|
||||
var add = 1;
|
||||
var _img = document.getElementById( 'ipb-topic-' + tid );
|
||||
|
||||
//-----------------------------------
|
||||
// Get form info
|
||||
//-----------------------------------
|
||||
|
||||
tmp = document.modform.selectedtids.value;
|
||||
|
||||
if( tmp != "" )
|
||||
{
|
||||
saved = tmp.split(",");
|
||||
}
|
||||
|
||||
//-----------------------------------
|
||||
// Remove bit if exists
|
||||
//-----------------------------------
|
||||
|
||||
for( i = 0 ; i < saved.length; i++ )
|
||||
{
|
||||
if ( saved[i] != "" )
|
||||
{
|
||||
if ( saved[i] == tid )
|
||||
{
|
||||
add = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
clean[clean.length] = saved[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------
|
||||
// Add?
|
||||
//-----------------------------------
|
||||
|
||||
if ( add )
|
||||
{
|
||||
clean[ clean.length ] = tid;
|
||||
_img.src = selectedbutton;
|
||||
}
|
||||
else
|
||||
{
|
||||
_img.src = unselectedbutton;
|
||||
}
|
||||
|
||||
newvalue = clean.join(',');
|
||||
var topics_this_page = new Array();
|
||||
var oldvalue = 0;
|
||||
var the_topics = document.getElementsByTagName('input');
|
||||
|
||||
for ( var i = 0 ; i <= the_topics.length ; i++ )
|
||||
{
|
||||
var e = the_topics[i];
|
||||
|
||||
if ( e && (e.type == 'hidden') && (! e.disabled) )
|
||||
{
|
||||
var s = e.id;
|
||||
var a = s.replace( /^tid_(.+?)$/, "$1" );
|
||||
|
||||
if ( a )
|
||||
{
|
||||
topics_this_page[ a ] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for( var k = 0; k < clean.length; k++ )
|
||||
{
|
||||
if ( topics_this_page[ clean[ k ] ] != 1 )
|
||||
{
|
||||
oldvalue++;
|
||||
}
|
||||
}
|
||||
|
||||
my_setcookie( 'modtids', newvalue, 0 );
|
||||
|
||||
document.modform.selectedtids.value = newvalue;
|
||||
|
||||
newcount = stacksize(clean);
|
||||
|
||||
if ( oldvalue > 0 )
|
||||
{
|
||||
document.modform.gobutton.value = ipsclass.html_entity_decode( lang_gobutton ) + ' (' + newcount + ') (' + oldvalue + ' ' + ipsclass.html_entity_decode( lang_otherpage ) +' )';
|
||||
}
|
||||
else
|
||||
{
|
||||
document.modform.gobutton.value = ipsclass.html_entity_decode( lang_gobutton ) + ' (' + newcount + ')';
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Do multi page jump
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function multi_page_jump( url_bit, total_posts, per_page )
|
||||
{
|
||||
pages = 1;
|
||||
cur_st = ipb_var_st;
|
||||
cur_page = 1;
|
||||
|
||||
if ( total_posts % per_page == 0 )
|
||||
{
|
||||
pages = total_posts / per_page;
|
||||
}
|
||||
else
|
||||
{
|
||||
pages = Math.ceil( total_posts / per_page );
|
||||
}
|
||||
|
||||
msg = ipb_lang_tpl_q1 + " " + pages;
|
||||
|
||||
if ( cur_st > 0 )
|
||||
{
|
||||
cur_page = cur_st / per_page; cur_page = cur_page -1;
|
||||
}
|
||||
|
||||
show_page = 1;
|
||||
|
||||
if ( cur_page < pages )
|
||||
{
|
||||
show_page = cur_page + 1;
|
||||
}
|
||||
|
||||
if ( cur_page >= pages )
|
||||
{
|
||||
show_page = cur_page - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
show_page = cur_page + 1;
|
||||
}
|
||||
|
||||
userPage = prompt( msg, show_page );
|
||||
|
||||
if ( userPage > 0 )
|
||||
{
|
||||
if ( userPage < 1 ) { userPage = 1; }
|
||||
if ( userPage > pages ) { userPage = pages; }
|
||||
if ( userPage == 1 ) { start = 0; }
|
||||
else { start = (userPage - 1) * per_page; }
|
||||
|
||||
window.location = url_bit + "&st=" + start + "&start=" + start;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function boards_send_marker_update( fid, is_subforum )
|
||||
{
|
||||
//----------------------------------
|
||||
// Get current image...
|
||||
//----------------------------------
|
||||
|
||||
try
|
||||
{
|
||||
var imgsrc = document.getElementById( 'f-'+fid ).innerHTML;
|
||||
|
||||
if ( imgsrc )
|
||||
{
|
||||
//----------------------------------
|
||||
// Find out what img its using...
|
||||
//----------------------------------
|
||||
|
||||
var regex = new RegExp( "src=['\"](.*/)("+regex_markers+")['\"]" );
|
||||
|
||||
var results = imgsrc.match( regex );
|
||||
|
||||
//----------------------------------
|
||||
// Got a replacement?
|
||||
//----------------------------------
|
||||
|
||||
if ( img_markers[ results[2] ] )
|
||||
{
|
||||
imgsrc = imgsrc.replace( regex, "src='$1"+img_markers[ results[2] ]+"'" );
|
||||
|
||||
document.getElementById( 'f-'+fid ).innerHTML = imgsrc;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(e){}
|
||||
|
||||
var text_return = 0;
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Main function to do on request
|
||||
// Must be defined first!!
|
||||
/*--------------------------------------------*/
|
||||
|
||||
do_request_function = function()
|
||||
{
|
||||
//----------------------------------
|
||||
// Ignore unless we're ready to go
|
||||
//----------------------------------
|
||||
|
||||
if ( ! xmlobj.readystate_ready_and_ok() )
|
||||
{
|
||||
// Could do a little loading graphic here?
|
||||
return;
|
||||
};
|
||||
|
||||
//----------------------------------
|
||||
// Do nothing
|
||||
//----------------------------------
|
||||
|
||||
text_return = xmlobj.xmlhandler.responseText;
|
||||
};
|
||||
|
||||
xmlobj = new ajax_request();
|
||||
xmlobj.onreadystatechange( do_request_function );
|
||||
|
||||
xmlobj.process( ipb_var_base_url + 'act=xmlout&do=mark-forum&fid='+fid+'&sf='+is_subforum );
|
||||
|
||||
if ( text_return == 1 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1,463 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// IPS XML HTTP REQUEST:: GET NEW POSTS
|
||||
//------------------------------------------------------------------------------
|
||||
// Supports Safari, Mozilla 1.3+ (Firefox, etc) and IE 5.5+
|
||||
// (c) 2005 Invision Power Services, Inc.
|
||||
// http://www.invisionpower.com
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// INIT VARS
|
||||
/*--------------------------------------------*/
|
||||
|
||||
var gnp_div = 'get-new-posts_menu';
|
||||
var msg_div = 'get-new-msgs_menu';
|
||||
var mem_div = 'get-members';
|
||||
var divobj;
|
||||
var divopen = 0;
|
||||
var xmlobj;
|
||||
var reg_img = '';
|
||||
|
||||
var myass_main;
|
||||
var myass_loaded = 0;
|
||||
var pm_cycle_count = 0;
|
||||
var search_cache = {};
|
||||
var posts_st = 0;
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Get NEXT posts link
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function xml_show_new_posts( st )
|
||||
{
|
||||
posts_st = st;
|
||||
xml_myassistant_init( 'posts' );
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Load MyASSISTANT!
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function xml_myassistant_init( tab )
|
||||
{
|
||||
myass_main = document.getElementById( 'get-myassistant' );
|
||||
myass_drag = document.getElementById( 'myass-drag' );
|
||||
myass_content = document.getElementById( 'myass-content' );
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Main function to do on request
|
||||
// Must be defined first!!
|
||||
/*--------------------------------------------*/
|
||||
|
||||
do_request_function = function()
|
||||
{
|
||||
//----------------------------------
|
||||
// Ignore unless we're ready to go
|
||||
//----------------------------------
|
||||
|
||||
if ( ! xmlobj_myass.readystate_ready_and_ok() )
|
||||
{
|
||||
// Could do a little loading graphic here?
|
||||
return;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// INIT
|
||||
//----------------------------------
|
||||
|
||||
var html = xmlobj_myass.xmlhandler.responseText;
|
||||
|
||||
//----------------------------------
|
||||
// Stop IE showing select boxes over
|
||||
// floating div [ 1 ]
|
||||
//----------------------------------
|
||||
|
||||
if ( is_ie )
|
||||
{
|
||||
html = "<iframe id='myass-shim' src='" + ipb_var_image_url + "/iframe.html' class='iframshim' scrolling='no' frameborder='0' style='position:absolute; top:0px; left:0px; right:0px; display: none;'></iframe>" + html;
|
||||
}
|
||||
|
||||
myass_content.innerHTML = html;
|
||||
|
||||
//----------------------------------
|
||||
// Stop IE showing select boxes over
|
||||
// floating div [ 1 ]
|
||||
//----------------------------------
|
||||
|
||||
if ( is_ie )
|
||||
{
|
||||
drag_html = myass_drag.innerHTML;
|
||||
main_drag_html = "<iframe id='myass-shim-two' src='" + ipb_var_image_url + "/iframe.html' class='iframshim' scrolling='no' frameborder='0' style='position:absolute; top:0px; left:0px; right:0px; display: none;'></iframe>" + drag_html;
|
||||
|
||||
myass_drag.innerHTML = main_drag_html;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Stop IE showing select boxes over
|
||||
// floating div [ 2 ]
|
||||
//----------------------------------
|
||||
|
||||
if ( is_ie )
|
||||
{
|
||||
myass_shim = document.getElementById('myass-shim');
|
||||
myass_shim.style.width = myass_content.offsetWidth;
|
||||
myass_shim.style.height = myass_content.offsetHeight;
|
||||
myass_shim.style.zIndex = myass_content.style.zIndex - 1;
|
||||
myass_shim.style.top = myass_content.style.top;
|
||||
myass_shim.style.left = myass_content.style.left;
|
||||
myass_shim.style.display = "block";
|
||||
|
||||
myass_shim_d = document.getElementById('myass-shim-two');
|
||||
myass_shim_d.style.width = myass_drag.offsetWidth;
|
||||
myass_shim_d.style.height = myass_drag.offsetHeight;
|
||||
myass_shim_d.style.zIndex = myass_drag.style.zIndex - 1;
|
||||
myass_shim_d.style.top = myass_drag.style.top;
|
||||
myass_shim_d.style.left = myass_drag.style.left;
|
||||
myass_shim_d.style.display = "block";
|
||||
}
|
||||
};
|
||||
|
||||
xmlobj_myass = new ajax_request();
|
||||
xmlobj_myass.onreadystatechange( do_request_function );
|
||||
|
||||
//----------------------------------
|
||||
// LOAD XML
|
||||
//----------------------------------
|
||||
|
||||
if ( ! tab )
|
||||
{
|
||||
xmlobj_myass.process( ipb_var_base_url + 'act=buddy&xml=1' );
|
||||
}
|
||||
else if ( tab == 'newpms' )
|
||||
{
|
||||
//----------------------------------
|
||||
// Figure out where we are..
|
||||
//----------------------------------
|
||||
|
||||
var limit_a = 0;
|
||||
|
||||
pm_cycle_count++;
|
||||
|
||||
if ( pm_cycle_count <= ipb_new_msgs )
|
||||
{
|
||||
limit_a = pm_cycle_count - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
pm_cycle_count = 1;
|
||||
}
|
||||
|
||||
xmlobj_myass.process( ipb_var_base_url + 'act=buddy&xml=1&tab=' + tab + '&limit=' + limit_a );
|
||||
|
||||
myass_content.style.width = '398px';
|
||||
myass_content.style.overflow = 'auto';
|
||||
myass_content.style.overflowX = 'hidden';
|
||||
}
|
||||
else if ( tab == 'posts' )
|
||||
{
|
||||
xmlobj_myass.process( ipb_var_base_url + 'act=buddy&xml=1&tab=' + tab + '&st=' + posts_st );
|
||||
}
|
||||
else
|
||||
{
|
||||
xmlobj_myass.process( ipb_var_base_url + 'act=buddy&xml=1&tab=' + tab );
|
||||
}
|
||||
|
||||
myass_main.style.position = 'absolute';
|
||||
myass_main.style.display = 'block';
|
||||
myass_main.style.zIndex = 99;
|
||||
|
||||
//----------------------------------
|
||||
// Not loaded? INIT
|
||||
//----------------------------------
|
||||
|
||||
if ( ! myass_loaded )
|
||||
{
|
||||
//----------------------------------
|
||||
// Figure width and height
|
||||
//----------------------------------
|
||||
|
||||
var my_width = 0;
|
||||
var my_height = 0;
|
||||
|
||||
if ( typeof( window.innerWidth ) == 'number' )
|
||||
{
|
||||
//----------------------------------
|
||||
// Non IE
|
||||
//----------------------------------
|
||||
|
||||
my_width = window.innerWidth;
|
||||
my_height = window.innerHeight;
|
||||
}
|
||||
else if ( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
|
||||
{
|
||||
//----------------------------------
|
||||
// IE 6+
|
||||
//----------------------------------
|
||||
|
||||
my_width = document.documentElement.clientWidth;
|
||||
my_height = document.documentElement.clientHeight;
|
||||
}
|
||||
else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
|
||||
{
|
||||
//----------------------------------
|
||||
// Old IE
|
||||
//----------------------------------
|
||||
|
||||
my_width = document.body.clientWidth;
|
||||
my_height = document.body.clientHeight;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Get div height && width
|
||||
//----------------------------------
|
||||
|
||||
var divheight = parseInt( myass_main.style.Height );
|
||||
var divwidth = parseInt( myass_main.style.Width );
|
||||
|
||||
divheight = divheight ? divheight : 400;
|
||||
divwidth = divwidth ? divwidth : 400;
|
||||
|
||||
//----------------------------------
|
||||
// Got it stored in a cookie?
|
||||
//----------------------------------
|
||||
|
||||
var divxy = my_getcookie( 'ipb-myass-div' );
|
||||
var co_ords;
|
||||
|
||||
if ( divxy && divxy != null )
|
||||
{
|
||||
co_ords = divxy.split( ',' );
|
||||
|
||||
//----------------------------------
|
||||
// Got co-ords?
|
||||
//----------------------------------
|
||||
|
||||
if ( co_ords.length )
|
||||
{
|
||||
var final_width = co_ords[0];
|
||||
var final_height = co_ords[1];
|
||||
|
||||
if ( co_ords[0] > my_width )
|
||||
{
|
||||
//----------------------------------
|
||||
// Keep it on screen
|
||||
//----------------------------------
|
||||
|
||||
final_width = my_width - divwidth;
|
||||
}
|
||||
|
||||
if ( co_ords[1] > my_height )
|
||||
{
|
||||
//----------------------------------
|
||||
// Keep it on screen
|
||||
//----------------------------------
|
||||
|
||||
final_height = my_height - divheight;
|
||||
}
|
||||
|
||||
myass_main.style.left = final_width + 'px';
|
||||
myass_main.style.top = final_height + 'px';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//----------------------------------
|
||||
// Reposition DIV roughly centered
|
||||
//----------------------------------
|
||||
|
||||
myass_main.style.left = my_width / 2 - (divwidth / 2) + 'px';
|
||||
myass_main.style.top = my_height / 2 - (divheight / 2 ) + 'px';
|
||||
}
|
||||
|
||||
Drag.cookiename = 'ipb-myass-div';
|
||||
Drag.init( myass_drag, myass_main );
|
||||
|
||||
myass_loaded = 1;
|
||||
}
|
||||
};
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Alter DST Retrieve XML document
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function xml_myassistant_search( url )
|
||||
{
|
||||
var keywords = document.getElementById('myass-search-input').value;
|
||||
var msg_field = document.getElementById('myass-search-message');
|
||||
var url = ipb_var_base_url+'act=Search&CODE=01&forums=all&cat_forum=forum&joinname=1&search_in=posts&result_type=topics&xml=1&keywords='+escape(keywords);
|
||||
|
||||
if ( keywords.length < 4 )
|
||||
{
|
||||
msg_field.innerHTML = ipb_myass_chars_lang;
|
||||
return false;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Already cached?
|
||||
//----------------------------------
|
||||
|
||||
if ( search_cache[ keywords ] )
|
||||
{
|
||||
msg_field.innerHTML = search_cache[ keywords ];
|
||||
return;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Main function to do on request
|
||||
// Must be defined first!!
|
||||
/*--------------------------------------------*/
|
||||
|
||||
do_request_function = function()
|
||||
{
|
||||
//----------------------------------
|
||||
// Ignore unless we're ready to go
|
||||
//----------------------------------
|
||||
|
||||
if ( ! xmlobj.readystate_ready_and_ok() )
|
||||
{
|
||||
xmlobj.show_loading();
|
||||
return;
|
||||
}
|
||||
|
||||
xmlobj.hide_loading();
|
||||
|
||||
//----------------------------------
|
||||
// INIT
|
||||
//----------------------------------
|
||||
|
||||
var html = xmlobj.xmlhandler.responseText;
|
||||
|
||||
msg_field.innerHTML = html;
|
||||
search_cache[ keywords ] = html;
|
||||
};
|
||||
|
||||
//----------------------------------
|
||||
// LOAD XML
|
||||
//----------------------------------
|
||||
|
||||
xmlobj = new ajax_request();
|
||||
xmlobj.onreadystatechange( do_request_function );
|
||||
|
||||
xmlobj.process( url );
|
||||
};
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Alter DST Retrieve XML document
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function xml_dst_set( url )
|
||||
{
|
||||
/*--------------------------------------------*/
|
||||
// Main function to do on request
|
||||
// Must be defined first!!
|
||||
/*--------------------------------------------*/
|
||||
|
||||
do_request_function = function()
|
||||
{
|
||||
//----------------------------------
|
||||
// Ignore unless we're ready to go
|
||||
//----------------------------------
|
||||
|
||||
if ( ! xmlobj.readystate_ready_and_ok() )
|
||||
{
|
||||
// Could do a little loading graphic here?
|
||||
return;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// INIT
|
||||
//----------------------------------
|
||||
|
||||
var html = xmlobj.xmlhandler.responseText;
|
||||
|
||||
if ( html == 'error' )
|
||||
{
|
||||
window.location = url.replace( '&xml=1', '&xml=0');
|
||||
}
|
||||
};
|
||||
|
||||
//----------------------------------
|
||||
// LOAD XML
|
||||
//----------------------------------
|
||||
|
||||
xmlobj = new ajax_request();
|
||||
xmlobj.onreadystatechange( do_request_function );
|
||||
|
||||
xmlobj.process( url );
|
||||
};
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// INIT Post GD Image
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function init_gd_image()
|
||||
{
|
||||
var reg_img = document.getElementById('gd-antispam');
|
||||
|
||||
try
|
||||
{
|
||||
reg_img.style.cursor = 'pointer';
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
reg_img.style.cursor = 'hand';
|
||||
};
|
||||
|
||||
reg_img._ready = 1;
|
||||
|
||||
reg_img.onclick = do_change_img;
|
||||
};
|
||||
|
||||
function do_change_img()
|
||||
{
|
||||
var rc = '';
|
||||
var act = 'Reg';
|
||||
var code = 'image';
|
||||
var reg_img = document.getElementById('gd-antispam');
|
||||
|
||||
if ( ! reg_img._ready )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var url = ipb_var_base_url+'act=xmlout&do=change-gd-img&img='+rc;
|
||||
|
||||
do_request_function = function()
|
||||
{
|
||||
//----------------------------------
|
||||
// Ignore unless we're ready to go
|
||||
//----------------------------------
|
||||
|
||||
if ( ! xmlobj.readystate_ready_and_ok() )
|
||||
{
|
||||
// Could do a little loading graphic here?
|
||||
return;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// INIT
|
||||
//----------------------------------
|
||||
|
||||
var html = xmlobj.xmlhandler.responseText;
|
||||
|
||||
reg_img.src = ipb_var_base_url+'act=captcha&showImage®id='+html;
|
||||
|
||||
var reg_field = document.getElementById('regid');
|
||||
reg_field.value = html;
|
||||
|
||||
reg_img._ready = 1;
|
||||
};
|
||||
|
||||
//----------------------------------
|
||||
// LOAD XML
|
||||
//----------------------------------
|
||||
|
||||
reg_img._ready = 0;
|
||||
|
||||
xmlobj = new ajax_request();
|
||||
xmlobj.onreadystatechange( do_request_function );
|
||||
xmlobj.process( url );
|
||||
}
|
||||
|
||||
|
||||
@@ -1,179 +0,0 @@
|
||||
//------------------------------------------
|
||||
// Invision Power Board v2.1
|
||||
// PM JS File
|
||||
// (c) 2005 Invision Power Services, Inc.
|
||||
//
|
||||
// http://www.invisionboard.com
|
||||
//------------------------------------------
|
||||
|
||||
//==========================================
|
||||
// Check All boxes
|
||||
//==========================================
|
||||
|
||||
function CheckAll(fmobj)
|
||||
{
|
||||
for (var i=0;i<fmobj.elements.length;i++)
|
||||
{
|
||||
var e = fmobj.elements[i];
|
||||
if ((e.name != 'allbox') && (e.type=='checkbox') && (!e.disabled))
|
||||
{
|
||||
e.checked = fmobj.allbox.checked;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//==========================================
|
||||
// Check all or uncheck all?
|
||||
//==========================================
|
||||
|
||||
function CheckCheckAll(fmobj)
|
||||
{
|
||||
var TotalBoxes = 0;
|
||||
var TotalOn = 0;
|
||||
for (var i=0;i<fmobj.elements.length;i++)
|
||||
{
|
||||
var e = fmobj.elements[i];
|
||||
if ((e.name != 'allbox') && (e.type=='checkbox'))
|
||||
{
|
||||
TotalBoxes++;
|
||||
if (e.checked)
|
||||
{
|
||||
TotalOn++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (TotalBoxes==TotalOn)
|
||||
{
|
||||
fmobj.allbox.checked=true;
|
||||
}
|
||||
else
|
||||
{
|
||||
fmobj.allbox.checked=false;
|
||||
}
|
||||
}
|
||||
|
||||
//==========================================
|
||||
// INBOX FUNCTIONS
|
||||
//==========================================
|
||||
|
||||
var ie = document.all ? 1 : 0;
|
||||
//var ns4 = document.layers ? 1 : 0;
|
||||
|
||||
//==========================================
|
||||
// highlite
|
||||
//==========================================
|
||||
|
||||
function hl(cb)
|
||||
{
|
||||
if (ie)
|
||||
{
|
||||
while (cb.tagName != "TR")
|
||||
{
|
||||
cb = cb.parentElement;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while (cb.tagName != "TD")
|
||||
{
|
||||
cb = cb.parentNode;
|
||||
}
|
||||
}
|
||||
|
||||
cb.className = 'row1';
|
||||
|
||||
}
|
||||
|
||||
//==========================================
|
||||
// down-lite
|
||||
//==========================================
|
||||
|
||||
function dl(cb)
|
||||
{
|
||||
if (ie)
|
||||
{
|
||||
while (cb.tagName != "TR")
|
||||
{
|
||||
cb = cb.parentElement;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while (cb.tagName != "TD")
|
||||
{
|
||||
cb = cb.parentNode;
|
||||
}
|
||||
}
|
||||
|
||||
cb.className = 'row2';
|
||||
}
|
||||
|
||||
//==========================================
|
||||
// Boxes checked?
|
||||
//==========================================
|
||||
|
||||
function cca(cb)
|
||||
{
|
||||
if (cb.checked)
|
||||
{
|
||||
hl(cb);
|
||||
}
|
||||
else
|
||||
{
|
||||
dl(cb);
|
||||
}
|
||||
}
|
||||
|
||||
//==========================================
|
||||
// Inbox check all
|
||||
//==========================================
|
||||
|
||||
function InboxCheckAll(cb)
|
||||
{
|
||||
var fmobj = document.mutliact;
|
||||
for (var i=0;i<fmobj.elements.length;i++)
|
||||
{
|
||||
var e = fmobj.elements[i];
|
||||
if ((e.name != 'allbox') && (e.type=='checkbox') && (!e.disabled))
|
||||
{
|
||||
e.checked = fmobj.allbox.checked;
|
||||
if (fmobj.allbox.checked)
|
||||
{
|
||||
hl(e);
|
||||
}
|
||||
else
|
||||
{
|
||||
dl(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function select_read()
|
||||
{
|
||||
var fmobj = document.mutliact;
|
||||
for (var i=0;i<fmobj.elements.length;i++)
|
||||
{
|
||||
var e = fmobj.elements[i];
|
||||
if ((e.type=='hidden') && (e.value == 1) && (! isNaN(e.name) ))
|
||||
{
|
||||
eval("fmobj.msgid_" + e.name + ".checked=true;");
|
||||
hl(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function unselect_all()
|
||||
{
|
||||
var fmobj = document.mutliact;
|
||||
for (var i=0;i<fmobj.elements.length;i++)
|
||||
{
|
||||
var e = fmobj.elements[i];
|
||||
if ((e.name != 'allbox') && (e.type=='checkbox') && (!e.disabled))
|
||||
{
|
||||
e.checked=false;
|
||||
dl(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,440 +0,0 @@
|
||||
//------------------------------------------
|
||||
// Invision Power Board v2.1
|
||||
// POLL JS File
|
||||
// (c) 2005 Invision Power Services, Inc.
|
||||
//
|
||||
// http://www.invisionboard.com
|
||||
// ASSUMES 'ipb_global.php' as been loaded
|
||||
//------------------------------------------
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// INIT
|
||||
/*--------------------------------------------*/
|
||||
|
||||
//-------------------------------
|
||||
// DIV & FORM id names
|
||||
//-------------------------------
|
||||
|
||||
var open_div = 'poll-box-open';
|
||||
var closed_div = 'poll-box-closed';
|
||||
var stat_div = 'poll-box-stat';
|
||||
var main_div = 'poll-box-main';
|
||||
var form_id = 'postingform';
|
||||
|
||||
//-------------------------------
|
||||
// DIV AND FORM objects
|
||||
//-------------------------------
|
||||
|
||||
var openobj;
|
||||
var closedobj;
|
||||
var formobj;
|
||||
var statobj;
|
||||
var mainobj;
|
||||
|
||||
//-------------------------------
|
||||
// Counters
|
||||
//-------------------------------
|
||||
|
||||
var used_questions = 0;
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// INIT STATE
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function poll_init_state()
|
||||
{
|
||||
//-------------------------------
|
||||
// Get objects
|
||||
//-------------------------------
|
||||
|
||||
openobj = document.getElementById( open_div );
|
||||
closedobj = document.getElementById( closed_div );
|
||||
formobj = document.getElementById( form_id );
|
||||
statobj = document.getElementById( stat_div );
|
||||
mainobj = document.getElementById( main_div );
|
||||
|
||||
//-------------------------------
|
||||
// Open and close divs
|
||||
//-------------------------------
|
||||
|
||||
if ( showfullonload )
|
||||
{
|
||||
my_show_div( openobj );
|
||||
my_hide_div( closedobj );
|
||||
}
|
||||
else
|
||||
{
|
||||
my_show_div( closedobj );
|
||||
my_hide_div( openobj );
|
||||
}
|
||||
|
||||
poll_draw_main_box();
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// DRAW MAIN BOX
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function poll_draw_main_box()
|
||||
{
|
||||
var html = '';
|
||||
used_questions = 0;
|
||||
|
||||
//-------------------------------
|
||||
// Draw all current questions
|
||||
//-------------------------------
|
||||
|
||||
for( var i in poll_questions )
|
||||
{
|
||||
var qhtml = '';
|
||||
used_questions++;
|
||||
|
||||
//-------------------------------
|
||||
// Show question box
|
||||
//-------------------------------
|
||||
|
||||
var question = poll_questions[i];
|
||||
|
||||
var this_poll_multi = '';
|
||||
|
||||
for ( var x in poll_multi )
|
||||
{
|
||||
if( x == i )
|
||||
{
|
||||
if( poll_multi[x] == 1 )
|
||||
{
|
||||
this_poll_multi = "checked='checked'";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var inputhtml = lang_build_string( html_question_box, i, _poll_make_form_safe( question ), this_poll_multi );
|
||||
|
||||
qhtml += "\n" + inputhtml + "\n";
|
||||
|
||||
//-------------------------------
|
||||
// Now, to add the poll choices..
|
||||
//-------------------------------
|
||||
|
||||
var choices = '';
|
||||
var choices_count = 0;
|
||||
|
||||
for ( var c in poll_choices )
|
||||
{
|
||||
var votes_box;
|
||||
|
||||
//-------------------------------
|
||||
// Is this a choice for this q?
|
||||
//-------------------------------
|
||||
|
||||
var id = c.replace( new RegExp( "^" + i + "_(\\d+)$" ), "$1" );
|
||||
|
||||
if ( ! isNaN( id ) )
|
||||
{
|
||||
if ( is_mod )
|
||||
{
|
||||
votes_box = lang_build_string( html_votes_box, i, id, poll_votes[c]);
|
||||
}
|
||||
else
|
||||
{
|
||||
votes_box = '';
|
||||
}
|
||||
|
||||
choices_count++;
|
||||
|
||||
choices += "\n" + lang_build_string( html_choice_box, i, id, _poll_make_form_safe( poll_choices[c] ), votes_box );
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// Not used max questions?
|
||||
//-------------------------------
|
||||
|
||||
if ( choices_count < max_poll_choices )
|
||||
{
|
||||
choices += lang_build_string( html_add_choice, i );
|
||||
}
|
||||
|
||||
if ( choices != '' )
|
||||
{
|
||||
qhtml += "\n" + lang_build_string( html_choice_wrap, choices ) + "\n";
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// Add wrapped question w/choice
|
||||
//-------------------------------
|
||||
|
||||
html += lang_build_string(html_question_wrap, qhtml );
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// Add a question link?
|
||||
//-------------------------------
|
||||
|
||||
if ( used_questions < max_poll_questions )
|
||||
{
|
||||
html += lang_build_string( html_question_wrap, html_add_question );
|
||||
}
|
||||
|
||||
mainobj.innerHTML = html;
|
||||
|
||||
poll_update_state();
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// WRITE FORM TO ARRAY
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function poll_write_form_to_array()
|
||||
{
|
||||
//-------------------------------
|
||||
// Update question array with form
|
||||
//-------------------------------
|
||||
|
||||
var tmp_poll_questions = {};
|
||||
var tmp_poll_choices = {};
|
||||
var tmp_poll_multi = {};
|
||||
|
||||
for ( var i in poll_questions )
|
||||
{
|
||||
//-------------------------------
|
||||
// Get form value...
|
||||
//-------------------------------
|
||||
|
||||
try
|
||||
{
|
||||
tmp_poll_questions[ i ] = document.getElementById( 'question_' + i ).value;
|
||||
}
|
||||
catch(e) { }
|
||||
}
|
||||
|
||||
for ( var x in poll_multi )
|
||||
{
|
||||
//-------------------------------
|
||||
// Get form value...
|
||||
//-------------------------------
|
||||
|
||||
try
|
||||
{
|
||||
tmp_poll_multi[ x ] = document.getElementById( 'multi_' + x ).checked ? 1 : 0;
|
||||
}
|
||||
catch(e) { }
|
||||
}
|
||||
|
||||
for ( var c in poll_choices )
|
||||
{
|
||||
//-------------------------------
|
||||
// Get form value...
|
||||
//-------------------------------
|
||||
|
||||
try
|
||||
{
|
||||
tmp_poll_choices[ c ] = document.getElementById( 'choice_' + c ).value;
|
||||
}
|
||||
catch(e) { }
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// Update
|
||||
//-------------------------------
|
||||
|
||||
poll_questions = tmp_poll_questions;
|
||||
poll_choices = tmp_poll_choices;
|
||||
poll_multi = tmp_poll_multi;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// ADD POLL QUESTION
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function poll_add_question()
|
||||
{
|
||||
var maxid = 0;
|
||||
|
||||
//-------------------------------
|
||||
// Get max choice ID
|
||||
//-------------------------------
|
||||
|
||||
for ( var i in poll_questions )
|
||||
{
|
||||
if ( i > maxid )
|
||||
{
|
||||
maxid = parseInt(i);
|
||||
}
|
||||
}
|
||||
|
||||
maxid = maxid + 1;
|
||||
|
||||
poll_write_form_to_array();
|
||||
|
||||
poll_questions[ maxid ] = '';
|
||||
poll_multi[ maxid ] = '';
|
||||
|
||||
poll_draw_main_box();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// ADD POLL CHOICE
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function poll_add_choice( qid )
|
||||
{
|
||||
var maxid = 0;
|
||||
|
||||
//-------------------------------
|
||||
// Get max choice ID
|
||||
//-------------------------------
|
||||
|
||||
for ( var c in poll_choices )
|
||||
{
|
||||
//-------------------------------
|
||||
// Is this a choice for this q?
|
||||
//-------------------------------
|
||||
|
||||
var id = c.replace( new RegExp( "^" + qid + "_(\\d+)$" ), "$1" );
|
||||
|
||||
if ( ! isNaN( id ) )
|
||||
{
|
||||
if ( id > maxid )
|
||||
{
|
||||
maxid = parseInt(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
maxid = maxid + 1;
|
||||
|
||||
poll_write_form_to_array();
|
||||
|
||||
poll_choices[ qid +'_'+maxid ] = '';
|
||||
|
||||
if ( is_mod )
|
||||
{
|
||||
poll_votes[ qid +'_'+maxid ] = 0;
|
||||
}
|
||||
|
||||
poll_draw_main_box();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// REMOVE POLL CHOICE
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function poll_remove_choice( mainid )
|
||||
{
|
||||
if ( confirm( js_lang_confirm ) )
|
||||
{
|
||||
delete( poll_choices[ mainid ] );
|
||||
|
||||
if ( is_mod )
|
||||
{
|
||||
delete( poll_votes[ mainid ] );
|
||||
}
|
||||
|
||||
poll_write_form_to_array();
|
||||
poll_draw_main_box();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// REMOVE POLL QUESTION
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function poll_remove_question( mainid )
|
||||
{
|
||||
if ( confirm( js_lang_confirm ) )
|
||||
{
|
||||
//-------------------------------
|
||||
// Delete question
|
||||
//-------------------------------
|
||||
|
||||
delete( poll_questions[ mainid ] );
|
||||
|
||||
//-------------------------------
|
||||
// Delete choices
|
||||
//-------------------------------
|
||||
|
||||
for ( var c in poll_choices )
|
||||
{
|
||||
//-------------------------------
|
||||
// Is this a choice for this q?
|
||||
//-------------------------------
|
||||
|
||||
var id = c.replace( new RegExp( "^" + mainid + "_(\\d+)$" ), "$1" );
|
||||
|
||||
if ( ! isNaN( id ) )
|
||||
{
|
||||
delete( poll_choices[ c ] );
|
||||
|
||||
if ( is_mod )
|
||||
{
|
||||
delete( poll_votes[ c ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
poll_write_form_to_array();
|
||||
poll_draw_main_box();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// UPDATE POLL STATE
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function poll_update_state()
|
||||
{
|
||||
used = max_poll_questions - used_questions;
|
||||
|
||||
var tmp_lang = lang_build_string( poll_stat_lang, used, max_poll_choices );
|
||||
statobj.innerHTML = lang_build_string( html_stat_wrap, tmp_lang );
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// SHOW POLL FORM
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function show_poll_form()
|
||||
{
|
||||
my_show_div( openobj );
|
||||
my_hide_div( closedobj );
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// CLOSE POLL FORM
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function close_poll_form()
|
||||
{
|
||||
my_show_div( closedobj );
|
||||
my_hide_div( openobj );
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// FORM MAKE SAFE
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function _poll_make_form_safe( t )
|
||||
{
|
||||
t = t.replace( /'/g, ''' );
|
||||
t = t.replace( /"/g, '"' );
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
//------------------------------------------
|
||||
// Invision Power Board v2.1
|
||||
// Profile JS File
|
||||
// (c) 2005 Invision Power Services, Inc.
|
||||
//
|
||||
// http://www.invisionboard.com
|
||||
//------------------------------------------
|
||||
|
||||
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Profile: Open pop-up window
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function profile_dname_history( mid )
|
||||
{
|
||||
//----------------------------------
|
||||
// Attempt to close the menu
|
||||
//----------------------------------
|
||||
|
||||
try
|
||||
{
|
||||
menu_action_close();
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Launch Pop Up
|
||||
//----------------------------------
|
||||
|
||||
PopUp( ipb_var_base_url + 'act=profile&CODE=show-display-names&id=' + mid, 'DNAMETITLE', 400, 300 );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -1,959 +0,0 @@
|
||||
//------------------------------------------
|
||||
// Invision Power Board v2.1
|
||||
// Register JS File
|
||||
// (c) 2005 Invision Power Services, Inc.
|
||||
//
|
||||
// http://www.invisionboard.com
|
||||
//------------------------------------------
|
||||
|
||||
var user_display_name_max_length = 26;
|
||||
var reg_got_dname = 0;
|
||||
var reg_oktogo = 0;
|
||||
var reg_field_ids = new Array();
|
||||
var reg_img_ids = new Array();
|
||||
var reg_box_ids = new Array();
|
||||
var reg_msg_ids = new Array();
|
||||
|
||||
var ucp_dname_illegal_chars = new Array( '[', ']', '|', ',', ';', '$', '"', '<', '>', '\\' );
|
||||
var ucp_dname_illegal_regex = '';
|
||||
|
||||
for ( var i in ucp_dname_illegal_chars )
|
||||
{
|
||||
ucp_dname_illegal_regex += '\\' + ucp_dname_illegal_chars[i];
|
||||
}
|
||||
|
||||
var error_email = 0;
|
||||
|
||||
var in_member_id = 0;
|
||||
|
||||
RegExp.escape = function(text)
|
||||
{
|
||||
if (!arguments.callee.sRE)
|
||||
{
|
||||
var specials = [ '/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\', '$' ];
|
||||
|
||||
arguments.callee.sRE = new RegExp( '(\\' + specials.join('|\\') + ')', 'g' );
|
||||
}
|
||||
|
||||
return text.replace(arguments.callee.sRE, '\\$1');
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// INIT Reg form
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function init_reg_form( got_dname, register_method )
|
||||
{
|
||||
//------------------------------------------
|
||||
// INIT objects
|
||||
//------------------------------------------
|
||||
|
||||
reg_got_dname = got_dname;
|
||||
|
||||
//------------------------------------------
|
||||
// Fields...
|
||||
//------------------------------------------
|
||||
|
||||
if( register_method == 'username' )
|
||||
{
|
||||
reg_field_ids['name'] = document.getElementById( 'reg-name' );
|
||||
}
|
||||
|
||||
reg_field_ids['password'] = document.getElementById( 'reg-password' );
|
||||
reg_field_ids['password-check'] = document.getElementById( 'reg-password-check' );
|
||||
reg_field_ids['emailaddress'] = document.getElementById( 'reg-emailaddress' );
|
||||
reg_field_ids['emailaddress-two'] = document.getElementById( 'reg-emailaddress-two' );
|
||||
|
||||
//------------------------------------------
|
||||
// Images
|
||||
//------------------------------------------
|
||||
|
||||
if( register_method == 'username' )
|
||||
{
|
||||
reg_img_ids['name'] = document.getElementById( 'img-name' );
|
||||
}
|
||||
|
||||
reg_img_ids['password'] = document.getElementById( 'img-password' );
|
||||
reg_img_ids['emailaddress'] = document.getElementById( 'img-emailaddress' );
|
||||
|
||||
//------------------------------------------
|
||||
// Boxes
|
||||
//------------------------------------------
|
||||
|
||||
if( register_method == 'username' )
|
||||
{
|
||||
reg_box_ids['name'] = document.getElementById( 'box-name' );
|
||||
}
|
||||
|
||||
reg_box_ids['password'] = document.getElementById( 'box-password' );
|
||||
reg_box_ids['emailaddress'] = document.getElementById( 'box-emailaddress' );
|
||||
|
||||
//------------------------------------------
|
||||
// Messages
|
||||
//------------------------------------------
|
||||
|
||||
if ( register_method == 'username' )
|
||||
{
|
||||
reg_msg_ids['name'] = document.getElementById( 'msg-name' );
|
||||
}
|
||||
|
||||
reg_msg_ids['password'] = document.getElementById( 'msg-password' );
|
||||
reg_msg_ids['emailaddress'] = document.getElementById( 'msg-emailaddress' );
|
||||
|
||||
//------------------------------------------
|
||||
// Set up onblur
|
||||
//------------------------------------------
|
||||
|
||||
if( register_method == 'username' )
|
||||
{
|
||||
reg_field_ids['name'].onblur = check_user_name;
|
||||
}
|
||||
|
||||
reg_field_ids['password-check'].onblur = check_passwords;
|
||||
reg_field_ids['emailaddress'].onblur = check_email_addresses_one;
|
||||
reg_field_ids['emailaddress-two'].onblur = check_email_addresses;
|
||||
|
||||
//------------------------------------------
|
||||
// Already got error messages?
|
||||
//------------------------------------------
|
||||
|
||||
if ( register_method == 'username' )
|
||||
{
|
||||
if ( ! reg_msg_ids['name'].innerHTML )
|
||||
{
|
||||
reg_box_ids['name'].style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! reg_msg_ids['password'].innerHTML )
|
||||
{
|
||||
reg_box_ids['password'].style.display = 'none';
|
||||
}
|
||||
|
||||
if ( ! reg_msg_ids['emailaddress'].innerHTML )
|
||||
{
|
||||
reg_box_ids['emailaddress'].style.display = 'none';
|
||||
}
|
||||
|
||||
//------------------------------------------
|
||||
// Display name. ..
|
||||
//------------------------------------------
|
||||
|
||||
if ( reg_got_dname )
|
||||
{
|
||||
reg_field_ids['dname'] = document.getElementById( 'reg-members-display-name' );
|
||||
reg_box_ids['dname'] = document.getElementById( 'box-dname' );
|
||||
reg_msg_ids['dname'] = document.getElementById( 'msg-dname' );
|
||||
reg_img_ids['dname'] = document.getElementById( 'img-members-display-name' );
|
||||
|
||||
if ( ! reg_msg_ids['dname'].innerHTML )
|
||||
{
|
||||
reg_box_ids['dname'].style.display = 'none';
|
||||
}
|
||||
|
||||
reg_field_ids['dname'].onblur = check_display_name;
|
||||
}
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// INIT Reg form
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function init_complete_login_form()
|
||||
{
|
||||
//------------------------------------------
|
||||
// INIT objects
|
||||
//------------------------------------------
|
||||
|
||||
reg_got_dname = got_dname;
|
||||
|
||||
if ( ! reg_email_ok )
|
||||
{
|
||||
//------------------------------------------
|
||||
// Fields...
|
||||
//------------------------------------------
|
||||
|
||||
reg_field_ids['emailaddress'] = document.getElementById( 'reg-emailaddress' );
|
||||
reg_field_ids['emailaddress-two'] = document.getElementById( 'reg-emailaddress-two' );
|
||||
|
||||
//------------------------------------------
|
||||
// Images
|
||||
//------------------------------------------
|
||||
|
||||
reg_img_ids['emailaddress'] = document.getElementById( 'img-emailaddress' );
|
||||
|
||||
//------------------------------------------
|
||||
// Boxes
|
||||
//------------------------------------------
|
||||
|
||||
reg_box_ids['emailaddress'] = document.getElementById( 'box-emailaddress' );
|
||||
|
||||
//------------------------------------------
|
||||
// Messages
|
||||
//------------------------------------------
|
||||
|
||||
reg_msg_ids['emailaddress'] = document.getElementById( 'msg-emailaddress' );
|
||||
|
||||
//------------------------------------------
|
||||
// Set up onblur
|
||||
//------------------------------------------
|
||||
|
||||
reg_field_ids['emailaddress'].onblur = check_email_addresses_one;
|
||||
reg_field_ids['emailaddress-two'].onblur = check_email_addresses;
|
||||
|
||||
//------------------------------------------
|
||||
// Already got error messages?
|
||||
//------------------------------------------
|
||||
|
||||
if ( ! reg_msg_ids['emailaddress'].innerHTML )
|
||||
{
|
||||
reg_box_ids['emailaddress'].style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------
|
||||
// Display name...
|
||||
//------------------------------------------
|
||||
|
||||
if ( reg_got_dname )
|
||||
{
|
||||
reg_field_ids['dname'] = document.getElementById( 'reg-members-display-name' );
|
||||
reg_box_ids['dname'] = document.getElementById( 'box-dname' );
|
||||
reg_msg_ids['dname'] = document.getElementById( 'msg-dname' );
|
||||
reg_img_ids['dname'] = document.getElementById( 'img-members-display-name' );
|
||||
|
||||
if ( ! reg_msg_ids['dname'].innerHTML )
|
||||
{
|
||||
reg_box_ids['dname'].style.display = 'none';
|
||||
}
|
||||
|
||||
reg_field_ids['dname'].onblur = check_display_name;
|
||||
}
|
||||
|
||||
in_member_id = member_id;
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Check email address validity
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function check_email_addresses_one( event )
|
||||
{
|
||||
if( !event )
|
||||
{
|
||||
event = window.event;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// INIT
|
||||
//----------------------------------
|
||||
|
||||
var error_found = '';
|
||||
|
||||
//----------------------------------
|
||||
// Ajax: check for existing email address
|
||||
//----------------------------------
|
||||
|
||||
if ( use_enhanced_js && reg_field_ids['emailaddress'].value )
|
||||
{
|
||||
var url = ipb_var_base_url+'act=xmlout&do=check-email-address&email='+encodeURIComponent( reg_field_ids['emailaddress'].value );
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Main function to do on request
|
||||
// Must be defined first!!
|
||||
/*--------------------------------------------*/
|
||||
|
||||
do_request_function = function()
|
||||
{
|
||||
//----------------------------------
|
||||
// Ignore unless we're ready to go
|
||||
//----------------------------------
|
||||
|
||||
if ( ! xmlobj.readystate_ready_and_ok() )
|
||||
{
|
||||
// Could do a little loading graphic here?
|
||||
return;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// INIT
|
||||
//----------------------------------
|
||||
|
||||
var html = xmlobj.xmlhandler.responseText;
|
||||
|
||||
if ( html == 'found' )
|
||||
{
|
||||
error_found += reg_error_email_taken + "<br />";
|
||||
}
|
||||
if ( html == 'banned' )
|
||||
{
|
||||
error_found += reg_error_email_ban + "<br />";
|
||||
}
|
||||
if ( html == 'invalid' )
|
||||
{
|
||||
error_found += reg_error_email_invalid + "<br />";
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Show errors
|
||||
//----------------------------------
|
||||
|
||||
if ( error_found )
|
||||
{
|
||||
reg_field_ids['emailaddress'].className = input_red;
|
||||
reg_img_ids['emailaddress'].src = ipb_var_image_url + '/' + img_cross;
|
||||
reg_msg_ids['emailaddress'].innerHTML = error_found;
|
||||
reg_box_ids['emailaddress'].style.display = 'block';
|
||||
error_email = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
error_email = 0;
|
||||
}
|
||||
|
||||
error_found = '';
|
||||
};
|
||||
|
||||
//----------------------------------
|
||||
// LOAD XML
|
||||
//----------------------------------
|
||||
|
||||
xmlobj = new ajax_request();
|
||||
xmlobj.onreadystatechange( do_request_function );
|
||||
xmlobj.process( url );
|
||||
}
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Check email addresses
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function check_email_addresses( event )
|
||||
{
|
||||
if( !event )
|
||||
{
|
||||
event = window.event;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// INIT
|
||||
//----------------------------------
|
||||
|
||||
var error_found = '';
|
||||
|
||||
//----------------------------------
|
||||
// Check
|
||||
//----------------------------------
|
||||
|
||||
if ( ! reg_field_ids['emailaddress'].value.match( /[@\.]/ ) )
|
||||
{
|
||||
error_found += reg_error_email_missing + "<br />";
|
||||
}
|
||||
|
||||
if ( ! error_found && ( ! reg_field_ids['emailaddress'].value || ! reg_field_ids['emailaddress-two'].value ) )
|
||||
{
|
||||
error_found += reg_error_email_missing + "<br />";
|
||||
}
|
||||
|
||||
if ( reg_field_ids['emailaddress'].value.toLowerCase() != reg_field_ids['emailaddress-two'].value.toLowerCase() )
|
||||
{
|
||||
error_found += reg_error_email_nm + "<br />";
|
||||
}
|
||||
|
||||
if ( error_found )
|
||||
{
|
||||
reg_field_ids['emailaddress'].className = input_red;
|
||||
reg_field_ids['emailaddress-two'].className = input_red;
|
||||
reg_img_ids['emailaddress'].src = ipb_var_image_url + '/' + img_cross;
|
||||
reg_msg_ids['emailaddress'].innerHTML = error_found;
|
||||
reg_box_ids['emailaddress'].style.display = 'block';
|
||||
error_email = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
error_email = 0;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// No error....
|
||||
//----------------------------------
|
||||
|
||||
if ( error_email == 0 && event.type != 'submit' )
|
||||
{
|
||||
check_email_addresses_one();
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Still no errors...
|
||||
//----------------------------------
|
||||
|
||||
if ( error_email == 0 )
|
||||
{
|
||||
reg_field_ids['emailaddress'].className = input_green;
|
||||
reg_field_ids['emailaddress-two'].className = input_green;
|
||||
reg_img_ids['emailaddress'].src = ipb_var_image_url + '/' + img_tick;
|
||||
reg_box_ids['emailaddress'].style.display = 'none';
|
||||
reg_msg_ids['emailaddress'].innerHTML = '';
|
||||
}
|
||||
|
||||
if( reg_field_ids['emailaddress'].className == input_red )
|
||||
{
|
||||
reg_field_ids['emailaddress-two'].className = input_red;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Check passwords match
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function check_passwords( event )
|
||||
{
|
||||
if( !event )
|
||||
{
|
||||
event = window.event;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// INIT
|
||||
//----------------------------------
|
||||
|
||||
var error_found = '';
|
||||
|
||||
//----------------------------------
|
||||
// Check
|
||||
//----------------------------------
|
||||
|
||||
if ( ! reg_field_ids['password'].value || ! reg_field_ids['password-check'].value )
|
||||
{
|
||||
error_found += reg_error_no_pass + "<br />";
|
||||
}
|
||||
|
||||
if ( reg_field_ids['password'].value != reg_field_ids['password-check'].value )
|
||||
{
|
||||
error_found += reg_error_pass_nm + "<br />";
|
||||
}
|
||||
|
||||
if ( error_found )
|
||||
{
|
||||
reg_field_ids['password'].className = input_red;
|
||||
reg_field_ids['password-check'].className = input_red;
|
||||
reg_img_ids['password'].src = ipb_var_image_url + '/' + img_cross;
|
||||
reg_msg_ids['password'].innerHTML = error_found;
|
||||
reg_box_ids['password'].style.display = 'block';
|
||||
}
|
||||
else
|
||||
{
|
||||
reg_field_ids['password'].className = input_green;
|
||||
reg_field_ids['password-check'].className = input_green;
|
||||
reg_img_ids['password'].src = ipb_var_image_url + '/' + img_tick;
|
||||
reg_box_ids['password'].style.display = 'none';
|
||||
reg_msg_ids['password'].innerHTML = '';
|
||||
}
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Check display name
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function check_display_name( event )
|
||||
{
|
||||
if( !event )
|
||||
{
|
||||
event = window.event;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// INIT
|
||||
//----------------------------------
|
||||
|
||||
var error_found = '';
|
||||
|
||||
//----------------------------------
|
||||
// Make sure we have sommat
|
||||
//----------------------------------
|
||||
|
||||
if ( ! reg_field_ids['dname'].value || reg_field_ids['dname'].value.length < 3 || reg_field_ids['dname'].value.length > user_display_name_max_length )
|
||||
{
|
||||
error_found += reg_error_no_name + "<br />";
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Check for illegal chars
|
||||
//----------------------------------
|
||||
|
||||
if ( reg_field_ids['dname'].value.match( new RegExp( "[" + ucp_dname_illegal_regex + "]" ) ) )
|
||||
{
|
||||
error_found += reg_error_chars + "<br />";
|
||||
}
|
||||
|
||||
if ( allowed_chars != "" )
|
||||
{
|
||||
var test_regex = new RegExp();
|
||||
test_regex.compile( "^[" + RegExp.escape(allowed_chars) + "]+$" );
|
||||
|
||||
if ( !test_regex.test( reg_field_ids['dname'].value ) )
|
||||
{
|
||||
error_found += allowed_error + "<br />";
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Ajax: check for existing member name
|
||||
//----------------------------------
|
||||
|
||||
if ( use_enhanced_js && reg_field_ids['dname'].value && event.type != 'submit' )
|
||||
{
|
||||
var url = ipb_var_base_url+'act=xmlout&do=check-display-name&name='+escape( reg_field_ids['dname'].value );
|
||||
|
||||
// Complete reg form?
|
||||
|
||||
if ( in_member_id )
|
||||
{
|
||||
url += '&id=' + in_member_id;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Main function to do on request
|
||||
// Must be defined first!!
|
||||
/*--------------------------------------------*/
|
||||
|
||||
do_request_function = function()
|
||||
{
|
||||
//----------------------------------
|
||||
// Ignore unless we're ready to go
|
||||
//----------------------------------
|
||||
|
||||
if ( ! xmlobj.readystate_ready_and_ok() )
|
||||
{
|
||||
// Could do a little loading graphic here?
|
||||
return;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// INIT
|
||||
//----------------------------------
|
||||
|
||||
var html = xmlobj.xmlhandler.responseText;
|
||||
|
||||
if ( html == 'found' )
|
||||
{
|
||||
error_found += reg_error_taken + "<br />";
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Show errors
|
||||
//----------------------------------
|
||||
|
||||
if ( error_found )
|
||||
{
|
||||
reg_field_ids['dname'].className = input_red;
|
||||
reg_img_ids['dname'].src = ipb_var_image_url + '/' + img_cross;
|
||||
reg_msg_ids['dname'].innerHTML = error_found;
|
||||
reg_box_ids['dname'].style.display = 'block';
|
||||
}
|
||||
else
|
||||
{
|
||||
reg_field_ids['dname'].className = input_green;
|
||||
reg_img_ids['dname'].src = ipb_var_image_url + '/' + img_tick;
|
||||
reg_box_ids['dname'].style.display = 'none';
|
||||
reg_msg_ids['dname'].innerHTML = '';
|
||||
}
|
||||
|
||||
error_found = '';
|
||||
};
|
||||
|
||||
//----------------------------------
|
||||
// LOAD XML
|
||||
//----------------------------------
|
||||
|
||||
xmlobj = new ajax_request();
|
||||
xmlobj.onreadystatechange( do_request_function );
|
||||
xmlobj.process( url );
|
||||
}
|
||||
else
|
||||
{
|
||||
//----------------------------------
|
||||
// Show errors
|
||||
//----------------------------------
|
||||
|
||||
if ( error_found )
|
||||
{
|
||||
reg_field_ids['dname'].className = input_red;
|
||||
reg_img_ids['dname'].src = ipb_var_image_url + '/' + img_cross;
|
||||
reg_msg_ids['dname'].innerHTML = error_found;
|
||||
reg_box_ids['dname'].style.display = 'block';
|
||||
}
|
||||
else
|
||||
{
|
||||
reg_field_ids['dname'].className = input_green;
|
||||
reg_img_ids['dname'].src = ipb_var_image_url + '/' + img_tick;
|
||||
reg_box_ids['dname'].style.display = 'none';
|
||||
reg_msg_ids['dname'].innerHTML = '';
|
||||
}
|
||||
|
||||
error_found = '';
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Check username
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function check_user_name( event )
|
||||
{
|
||||
if( !event )
|
||||
{
|
||||
event = window.event;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// INIT
|
||||
//----------------------------------
|
||||
|
||||
var error_found = '';
|
||||
|
||||
//----------------------------------
|
||||
// Make sure we have sommat
|
||||
//----------------------------------
|
||||
|
||||
if ( ! reg_field_ids['name'].value || reg_field_ids['name'].value.length < 3 || reg_field_ids['name'].value.length > user_display_name_max_length )
|
||||
{
|
||||
error_found += reg_error_username_none + "<br />";
|
||||
}
|
||||
|
||||
if ( allowed_chars != "" )
|
||||
{
|
||||
var test_regex = new RegExp();
|
||||
test_regex.compile( "^[" + RegExp.escape(allowed_chars) + "]+$" );
|
||||
|
||||
if ( !test_regex.test( reg_field_ids['name'].value ) )
|
||||
{
|
||||
error_found += allowed_error + "<br />";
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Ajax: check for existing member name
|
||||
//----------------------------------
|
||||
|
||||
if ( use_enhanced_js && reg_field_ids['name'].value && event.type != 'submit' )
|
||||
{
|
||||
// + symbols get stripped due to escape
|
||||
reg_field_ids['name'].value = reg_field_ids['name'].value.replace("+", "+");
|
||||
|
||||
//----------------------------------
|
||||
// Get new xhttp obj
|
||||
//----------------------------------
|
||||
|
||||
var url = ipb_var_base_url+'act=xmlout&do=check-user-name&name='+escape( reg_field_ids['name'].value );
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Main function to do on request
|
||||
// Must be defined first!!
|
||||
/*--------------------------------------------*/
|
||||
|
||||
do_request_function = function()
|
||||
{
|
||||
//----------------------------------
|
||||
// Ignore unless we're ready to go
|
||||
//----------------------------------
|
||||
|
||||
if ( ! xmlobj.readystate_ready_and_ok() )
|
||||
{
|
||||
// Could do a little loading graphic here?
|
||||
return;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// INIT
|
||||
//----------------------------------
|
||||
|
||||
var html = xmlobj.xmlhandler.responseText;
|
||||
|
||||
if ( html == 'found' )
|
||||
{
|
||||
error_found += reg_error_username_taken + "<br />";
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Show errors
|
||||
//----------------------------------
|
||||
|
||||
if ( error_found )
|
||||
{
|
||||
reg_field_ids['name'].className = input_red;
|
||||
reg_img_ids['name'].src = ipb_var_image_url + '/' + img_cross;
|
||||
reg_msg_ids['name'].innerHTML = error_found;
|
||||
reg_box_ids['name'].style.display = 'block';
|
||||
}
|
||||
else
|
||||
{
|
||||
reg_field_ids['name'].className = input_green;
|
||||
reg_img_ids['name'].src = ipb_var_image_url + '/' + img_tick;
|
||||
reg_box_ids['name'].style.display = 'none';
|
||||
reg_msg_ids['name'].innerHTML = '';
|
||||
}
|
||||
|
||||
error_found = '';
|
||||
};
|
||||
|
||||
//----------------------------------
|
||||
// LOAD XML
|
||||
//----------------------------------
|
||||
|
||||
xmlobj = new ajax_request();
|
||||
xmlobj.onreadystatechange( do_request_function );
|
||||
xmlobj.process( url );
|
||||
}
|
||||
else
|
||||
{
|
||||
//----------------------------------
|
||||
// Show errors
|
||||
//----------------------------------
|
||||
|
||||
if ( error_found )
|
||||
{
|
||||
reg_field_ids['name'].className = input_red;
|
||||
reg_img_ids['name'].src = ipb_var_image_url + '/' + img_cross;
|
||||
reg_msg_ids['name'].innerHTML = error_found;
|
||||
reg_box_ids['name'].style.display = 'block';
|
||||
}
|
||||
else
|
||||
{
|
||||
reg_field_ids['name'].className = input_green;
|
||||
reg_img_ids['name'].src = ipb_var_image_url + '/' + img_tick;
|
||||
reg_box_ids['name'].style.display = 'none';
|
||||
reg_msg_ids['name'].innerHTML = '';
|
||||
}
|
||||
|
||||
error_found = '';
|
||||
}
|
||||
|
||||
reg_field_ids['name'].value = reg_field_ids['name'].value.replace("+", "+");
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Validate the complete log in form
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function validate_complete_login_form( event )
|
||||
{
|
||||
if( !event )
|
||||
{
|
||||
event = window.event;
|
||||
}
|
||||
|
||||
//------------------------------------------
|
||||
// Simply run the functions
|
||||
//------------------------------------------
|
||||
|
||||
reg_oktogo = 1;
|
||||
|
||||
if ( ! email_ok )
|
||||
{
|
||||
check_email_addresses( event );
|
||||
|
||||
//------------------------------------------
|
||||
// Got error messages
|
||||
//------------------------------------------
|
||||
|
||||
if ( reg_msg_ids['emailaddress'].innerHTML )
|
||||
{
|
||||
reg_oktogo = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------
|
||||
// Display name...
|
||||
//------------------------------------------
|
||||
|
||||
if ( reg_got_dname )
|
||||
{
|
||||
check_display_name( event );
|
||||
|
||||
if ( reg_msg_ids['dname'].innerHTML )
|
||||
{
|
||||
reg_oktogo = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------
|
||||
// Return
|
||||
//------------------------------------------
|
||||
|
||||
return reg_oktogo ? true : false;
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Validate the registration form
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function validate_reg_form( event )
|
||||
{
|
||||
if( !event )
|
||||
{
|
||||
event = window.event;
|
||||
}
|
||||
|
||||
//------------------------------------------
|
||||
// Simply run the functions
|
||||
//------------------------------------------
|
||||
|
||||
reg_oktogo = 1;
|
||||
|
||||
check_email_addresses( event );
|
||||
|
||||
check_passwords( event );
|
||||
|
||||
if( register_method == 'username' )
|
||||
{
|
||||
check_user_name( event );
|
||||
}
|
||||
|
||||
//------------------------------------------
|
||||
// Got error messages
|
||||
//------------------------------------------
|
||||
|
||||
if( register_method == 'username' )
|
||||
{
|
||||
if ( reg_msg_ids['name'].innerHTML )
|
||||
{
|
||||
reg_oktogo = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if ( reg_msg_ids['password'].innerHTML )
|
||||
{
|
||||
reg_oktogo = 0;
|
||||
}
|
||||
|
||||
if ( reg_msg_ids['emailaddress'].innerHTML )
|
||||
{
|
||||
reg_oktogo = 0;
|
||||
}
|
||||
|
||||
//------------------------------------------
|
||||
// Display name...
|
||||
//------------------------------------------
|
||||
|
||||
if ( reg_got_dname )
|
||||
{
|
||||
check_display_name( event );
|
||||
|
||||
if ( reg_msg_ids['dname'].innerHTML )
|
||||
{
|
||||
reg_oktogo = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------
|
||||
// Return
|
||||
//------------------------------------------
|
||||
|
||||
return reg_oktogo ? true : false;
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// They are a COPPA :D
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function coppa_save()
|
||||
{
|
||||
//------------------------------------------
|
||||
// Set cookie
|
||||
//------------------------------------------
|
||||
|
||||
my_setcookie( 'coppa', 'yes', 1 );
|
||||
my_setcookie( 'coppabday', bday_m + '-' + bday_d + '-' + bday_y, 1 );
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Run from the COPPA
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function coppa_cancel()
|
||||
{
|
||||
//------------------------------------------
|
||||
// Set cookie
|
||||
//------------------------------------------
|
||||
|
||||
//my_setcookie( 'coppa', '0', 1 );
|
||||
locationjump( '' );
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Run from the COPPA
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function coppa_check()
|
||||
{
|
||||
//------------------------------------------
|
||||
// Set cookie
|
||||
//------------------------------------------
|
||||
|
||||
var coppa_check = my_getcookie( 'coppa' );
|
||||
|
||||
if ( coppa_check == 'yes' )
|
||||
{
|
||||
alert( coppa_bounce );
|
||||
|
||||
var bdays = my_getcookie( 'coppabday' );
|
||||
var dates = bdays.split( '-' );
|
||||
|
||||
locationjump( 'act=reg&CODE=coppa_two&m=' + dates[0] + '&d=' + dates[1] + '&y=' + dates[2] );
|
||||
}
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Show a more info button?
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
function reg_get_more_check()
|
||||
{
|
||||
var dropdown = document.getElementById( 'subspackage' );
|
||||
var chosenid = dropdown.options[dropdown.selectedIndex].value;
|
||||
|
||||
if ( ! chosenid )
|
||||
{
|
||||
chosenid = 0;
|
||||
}
|
||||
|
||||
if ( subdesc[chosenid] )
|
||||
{
|
||||
document.getElementById( 'reg-get-more-info' ).style.display = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById( 'reg-get-more-info' ).style.display = 'none';
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Show subs more info form
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function get_more_info()
|
||||
{
|
||||
var dropdown = document.getElementById( 'subspackage' );
|
||||
var chosenid = dropdown.options[dropdown.selectedIndex].value;
|
||||
|
||||
if ( ! chosenid )
|
||||
{
|
||||
chosenid = 0;
|
||||
}
|
||||
|
||||
//------------------------------------------
|
||||
// Toggle view...
|
||||
//------------------------------------------
|
||||
|
||||
if ( subdesc[chosenid] )
|
||||
{
|
||||
document.getElementById('pkdesc').innerHTML = subdesc[chosenid];
|
||||
|
||||
toggleview('subspkdiv');
|
||||
}
|
||||
};
|
||||
@@ -1,238 +0,0 @@
|
||||
//------------------------------------------
|
||||
// Invision Power Board v2.1
|
||||
// User CP JS File
|
||||
// (c) 2005 Invision Power Services, Inc.
|
||||
//
|
||||
// http://www.invisionboard.com
|
||||
//------------------------------------------
|
||||
|
||||
var ucp_dname_name;
|
||||
var ucp_dname_pass;
|
||||
var ucp_dname_name_img;
|
||||
var ucp_dname_pass_img;
|
||||
var ucp_dname_form;
|
||||
var ucp_dname_warn;
|
||||
var ucp_dname_warn_content;
|
||||
var dname_max_length = 26;
|
||||
|
||||
var ucp_dname_ok_to_go = 0;
|
||||
var ucp_dname_illegal_chars = new Array( '[', ']', '|', ',', ';', '$' );
|
||||
var ucp_dname_illegal_regex = '';
|
||||
|
||||
for ( var i in ucp_dname_illegal_chars )
|
||||
{
|
||||
ucp_dname_illegal_regex += '\\' + ucp_dname_illegal_chars[i];
|
||||
}
|
||||
|
||||
var error_found = '';
|
||||
|
||||
RegExp.escape = function(text)
|
||||
{
|
||||
if (!arguments.callee.sRE)
|
||||
{
|
||||
var specials = [ '/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\', '$' ];
|
||||
|
||||
arguments.callee.sRE = new RegExp( '(\\' + specials.join('|\\') + ')', 'g' );
|
||||
}
|
||||
|
||||
return text.replace(arguments.callee.sRE, '\\$1');
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// INIT Display name change stuff
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function ucp_dname_init( name, pass, form, wbox )
|
||||
{
|
||||
ucp_dname_name = document.getElementById( name );
|
||||
ucp_dname_pass = document.getElementById( pass );
|
||||
ucp_dname_form = document.getElementById( form );
|
||||
ucp_dname_warn = document.getElementById( wbox );
|
||||
|
||||
ucp_dname_warn_content = document.getElementById( wbox+'-content' );
|
||||
ucp_dname_name_img = document.getElementById( name+'-img' );
|
||||
ucp_dname_pass_img = document.getElementById( pass+'-img' );
|
||||
|
||||
ucp_dname_name.onblur = ucp_dname_check;
|
||||
ucp_dname_form.onsubmit = ucp_dname_form_check;
|
||||
|
||||
if ( ucp_dname_warn_content.innerHTML )
|
||||
{
|
||||
ucp_dname_warn.style.display = 'block';
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// EVENT: Check display name
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function ucp_dname_check( event )
|
||||
{
|
||||
//----------------------------------
|
||||
// INIT
|
||||
//----------------------------------
|
||||
|
||||
//----------------------------------
|
||||
// Make sure we have sommat
|
||||
//----------------------------------
|
||||
|
||||
if ( ! ucp_dname_name.value || ucp_dname_name.value.length < 3 || ucp_dname_name.value.length > dname_max_length )
|
||||
{
|
||||
error_found += dname_error_no_name + "<br />";
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Check for illegal chars
|
||||
//----------------------------------
|
||||
|
||||
if ( ucp_dname_name.value.match( new RegExp( "[" + ucp_dname_illegal_regex + "]" ) ) )
|
||||
{
|
||||
error_found += dname_error_chars + "<br />";
|
||||
}
|
||||
|
||||
if ( allowed_chars != "" )
|
||||
{
|
||||
var test_regex = new RegExp();
|
||||
|
||||
test_regex.compile( "^[" + RegExp.escape(allowed_chars) + "]+$" );
|
||||
|
||||
if ( !test_regex.test( ucp_dname_name.value ) )
|
||||
{
|
||||
error_found += allowed_error + "<br />";
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Ajax: check for existing member name
|
||||
//----------------------------------
|
||||
|
||||
if ( use_enhanced_js && ucp_dname_name.value )
|
||||
{
|
||||
var url = ipb_var_base_url+'act=xmlout&do=check-display-name&name='+escape( ucp_dname_name.value );
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Main function to do on request
|
||||
// Must be defined first!!
|
||||
/*--------------------------------------------*/
|
||||
|
||||
do_request_function = function()
|
||||
{
|
||||
//----------------------------------
|
||||
// Ignore unless we're ready to go
|
||||
//----------------------------------
|
||||
|
||||
if ( ! xmlobj.readystate_ready_and_ok() )
|
||||
{
|
||||
// Could do a little loading graphic here?
|
||||
return;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// INIT
|
||||
//----------------------------------
|
||||
|
||||
var html = xmlobj.xmlhandler.responseText;
|
||||
|
||||
if ( html == 'found' )
|
||||
{
|
||||
error_found += dname_error_taken + "<br />";
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Show errors
|
||||
//----------------------------------
|
||||
|
||||
if ( error_found )
|
||||
{
|
||||
ucp_dname_name.className = input_red;
|
||||
ucp_dname_name_img.src = ipb_var_image_url + '/' + img_cross;
|
||||
ucp_dname_warn_content.innerHTML = error_found;
|
||||
ucp_dname_warn.style.display = 'block';
|
||||
}
|
||||
else
|
||||
{
|
||||
ucp_dname_name.className = input_green;
|
||||
ucp_dname_name_img.src = ipb_var_image_url + '/' + img_tick;
|
||||
ucp_dname_warn.style.display = 'none';
|
||||
ucp_dname_warn_content.innerHTML = '';
|
||||
}
|
||||
|
||||
error_found = '';
|
||||
};
|
||||
|
||||
//----------------------------------
|
||||
// LOAD XML
|
||||
//----------------------------------
|
||||
|
||||
xmlobj = new ajax_request();
|
||||
xmlobj.onreadystatechange( do_request_function );
|
||||
xmlobj.process( url );
|
||||
}
|
||||
else
|
||||
{
|
||||
//----------------------------------
|
||||
// Show errors
|
||||
//----------------------------------
|
||||
|
||||
if ( error_found )
|
||||
{
|
||||
ucp_dname_name.className = input_red;
|
||||
ucp_dname_name_img.src = ipb_var_image_url + '/' + img_cross;
|
||||
ucp_dname_warn_content.innerHTML = error_found;
|
||||
ucp_dname_warn.style.display = 'block';
|
||||
}
|
||||
else
|
||||
{
|
||||
ucp_dname_name.className = input_green;
|
||||
ucp_dname_name_img.src = ipb_var_image_url + '/' + img_tick;
|
||||
ucp_dname_warn.style.display = 'none';
|
||||
ucp_dname_warn_content.innerHTML = '';
|
||||
}
|
||||
|
||||
error_found = '';
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// EVENT: Check display name
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function ucp_dname_form_check( event )
|
||||
{
|
||||
//----------------------------------
|
||||
// DO pass fields
|
||||
//----------------------------------
|
||||
|
||||
if ( ! ucp_dname_pass.value )
|
||||
{
|
||||
error_found += dname_error_no_pass + "<br />";
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Check name
|
||||
//----------------------------------
|
||||
|
||||
ucp_dname_check( event );
|
||||
|
||||
if ( error_found )
|
||||
{
|
||||
ucp_dname_ok_to_go = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
ucp_dname_ok_to_go = 1;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Return
|
||||
//----------------------------------
|
||||
|
||||
if ( ucp_dname_ok_to_go )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1,720 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// IPS XML HTTP REQUEST:: GET NEW POSTS
|
||||
//------------------------------------------------------------------------------
|
||||
// Supports Safari, Mozilla 1.3+ (Firefox, etc) and IE 5.5+
|
||||
// (c) 2005 Invision Power Services, Inc.
|
||||
// http://www.invisionpower.com
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// INIT VARS
|
||||
/*--------------------------------------------*/
|
||||
|
||||
var mem_div = 'ipb-get-members';
|
||||
var divobj;
|
||||
var iframeobj;
|
||||
var formobj;
|
||||
var xmlobj;
|
||||
var _result_cache = new Array();
|
||||
var _div_rows = 0;
|
||||
var _cur_updown_pressed = 0;
|
||||
var _last_key_code = 0;
|
||||
var _event_key_code = 0;
|
||||
var _cur_input_val = '';
|
||||
var _old_input_val = '';
|
||||
var _hiliteindex = -1;
|
||||
var _hilite_sug_div;
|
||||
var _complete_div_list;
|
||||
var delay_action = false;
|
||||
var _allow_update = true;
|
||||
var _form_onsubmit_saved;
|
||||
var _urllookup;
|
||||
var _timemout_main = 0;
|
||||
var _timeout_blur = 0;
|
||||
var _in_focus = 0;
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// SHOW POSSIBLE MEMBER NAME MATCHES
|
||||
/*--------------------------------------------*/
|
||||
|
||||
main_loop = function()
|
||||
{
|
||||
if ( ( _old_input_val != _cur_input_val ) && ( _cur_input_val.length >= 3 ) && ( _in_focus == 1 ) )
|
||||
{
|
||||
if ( ! delay_action && _allow_update )
|
||||
{
|
||||
//----------------------------------
|
||||
// Try cache
|
||||
//----------------------------------
|
||||
|
||||
var cached = _result_cache[ _cur_input_val ];
|
||||
|
||||
if ( cached )
|
||||
{
|
||||
returnSearch( _cur_input_val, cached[0], cached[1] );
|
||||
}
|
||||
else
|
||||
{
|
||||
/*--------------------------------------------*/
|
||||
// Main function to do on request
|
||||
// Must be defined first!!
|
||||
/*--------------------------------------------*/
|
||||
|
||||
do_request_function = function()
|
||||
{
|
||||
//----------------------------------
|
||||
// Ignore unless we're ready to go
|
||||
//----------------------------------
|
||||
|
||||
if ( ! xmlobj.readystate_ready_and_ok() )
|
||||
{
|
||||
// Could do a little loading graphic here?
|
||||
return;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// INIT
|
||||
//----------------------------------
|
||||
|
||||
var returned = xmlobj.xmlhandler.responseText;
|
||||
|
||||
//----------------------------------
|
||||
// Did we get something?
|
||||
//----------------------------------
|
||||
|
||||
if ( returned.charAt(0) == '<' )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
eval( returned );
|
||||
}
|
||||
};
|
||||
|
||||
xmlobj = new ajax_request();
|
||||
xmlobj.onreadystatechange( do_request_function );
|
||||
|
||||
xmlobj.process( ipb_var_base_url + '&act=xmlout&do='+_urllookup+'&name='+escape(inobj.value) );
|
||||
|
||||
inobj.focus();
|
||||
}
|
||||
}
|
||||
|
||||
delay_action = false;
|
||||
}
|
||||
|
||||
_old_input_val = _cur_input_val;
|
||||
|
||||
_timemout_main = setTimeout( 'main_loop()', 10 );
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Initalize...
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function init_js( formobjname, fieldobjname, urllookup )
|
||||
{
|
||||
//----------------------------------
|
||||
// Set up
|
||||
//----------------------------------
|
||||
|
||||
if ( ! urllookup )
|
||||
{
|
||||
_urllookup = 'get-member-names';
|
||||
}
|
||||
else
|
||||
{
|
||||
_urllookup = urllookup;
|
||||
}
|
||||
|
||||
formobj = document.getElementById( formobjname );
|
||||
inobj = document.getElementById( fieldobjname );
|
||||
divobj = document.getElementById( mem_div );
|
||||
|
||||
inobj.setAttribute( "autocomplete", "off" );
|
||||
inobj.onfocus = function () { _in_focus = 1; };
|
||||
inobj.onblur = onblurhandler;
|
||||
inobj.onsubmit = submit_handler;
|
||||
|
||||
//----------------------------------
|
||||
// Already got a submit handler?
|
||||
//----------------------------------
|
||||
|
||||
if ( formobj.onsubmit )
|
||||
{
|
||||
_form_onsubmit_saved = formobj.onsubmit;
|
||||
}
|
||||
|
||||
formobj.onsubmit = submit_handler;
|
||||
|
||||
if ( inobj.createTextRange )
|
||||
{
|
||||
inobj.onkeyup = new Function( "return onkeyuphandler(event);" );
|
||||
}
|
||||
else
|
||||
{
|
||||
inobj.onkeyup = onkeyuphandler;
|
||||
}
|
||||
|
||||
cache_name_results("",new Array(),new Array());
|
||||
|
||||
_cur_input_val = inobj.value;
|
||||
|
||||
document.onkeydown = keydownhandler;
|
||||
|
||||
set_up_key_down();
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Set up key down
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function set_up_key_down()
|
||||
{
|
||||
if ( document.createEventObject )
|
||||
{
|
||||
var y = document.createEventObject();
|
||||
y.ctrlKey = true;
|
||||
y.keyCode = 70;
|
||||
document.fireEvent( "onkeydown", y )
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Key down handler
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function keydownhandler( event )
|
||||
{
|
||||
if( ! event && window.event )
|
||||
{
|
||||
event = window.event;
|
||||
}
|
||||
if ( event )
|
||||
{
|
||||
_last_key_code = event.keyCode;
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// On blur handler
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function onblurhandler( event )
|
||||
{
|
||||
if ( ! event && window.event )
|
||||
{
|
||||
event = window.event;
|
||||
}
|
||||
|
||||
if ( ! _cur_updown_pressed )
|
||||
{
|
||||
_in_focus = 0;
|
||||
|
||||
my_xr_hide_div( divobj );
|
||||
_hiliteindex = -1;
|
||||
|
||||
// Tab?
|
||||
|
||||
if ( _last_key_code == 9 )
|
||||
{
|
||||
_last_key_code = -1;
|
||||
}
|
||||
}
|
||||
|
||||
_cur_updown_pressed = false;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// On key up handler
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function key_handler_function()
|
||||
{
|
||||
//----------------------------------
|
||||
// trap up/down cursor
|
||||
//----------------------------------
|
||||
|
||||
if ( _event_key_code == 40 || _event_key_code == 38 )
|
||||
{
|
||||
_allow_update = false;
|
||||
blur_then_focus();
|
||||
}
|
||||
else
|
||||
{
|
||||
_cur_updown_pressed = false;
|
||||
_allow_update = true;
|
||||
}
|
||||
|
||||
_cur_input_val = inobj.value;
|
||||
|
||||
handle_cursor_press( _event_key_code );
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Handle cursor press
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function handle_cursor_press( eventcode )
|
||||
{
|
||||
if ( eventcode == 40 )
|
||||
{
|
||||
hilite_new_value( _hiliteindex + 1 );
|
||||
}
|
||||
else if ( eventcode == 38 )
|
||||
{
|
||||
hilite_new_value( _hiliteindex - 1 );
|
||||
}
|
||||
else if ( eventcode == 13 || eventcode == 3 )
|
||||
{
|
||||
//----------------------------------
|
||||
// Are we looking through the divs?
|
||||
//----------------------------------
|
||||
|
||||
if ( _hiliteindex != -1 )
|
||||
{
|
||||
my_xr_hide_div( divobj );
|
||||
_hiliteindex = -1;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Highlight new value (cursor keys pressed)
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function hilite_new_value( index )
|
||||
{
|
||||
if ( _div_rows <= 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
my_show_div( divobj );
|
||||
|
||||
if ( index > _div_rows )
|
||||
{
|
||||
index = _div_rows - 1;
|
||||
}
|
||||
|
||||
if ( _hiliteindex != -1 && index != _hiliteindex )
|
||||
{
|
||||
set_style_for_element( _hilite_sug_div, 'wrapdiv' );
|
||||
}
|
||||
|
||||
if ( index < 0 )
|
||||
{
|
||||
_hiliteindex = -1;
|
||||
inobj.focus();
|
||||
return;
|
||||
}
|
||||
|
||||
_hiliteindex = index;
|
||||
_hilite_sug_div = divobj.getElementsByTagName('DIV').item( index );
|
||||
|
||||
set_style_for_element( _hilite_sug_div, 'spanhilite' );
|
||||
|
||||
newval = find_span_value_for_class( _hilite_sug_div, 'namespan' );
|
||||
|
||||
if ( newval && typeof(newval) != 'undefined' )
|
||||
{
|
||||
inobj.value = find_span_value_for_class( _hilite_sug_div, 'namespan' );
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Blur then focus
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function blur_then_focus()
|
||||
{
|
||||
_cur_updown_pressed = true;
|
||||
|
||||
inobj.blur();
|
||||
|
||||
_timemout_blur = setTimeout( "set_input_field_focus();", 10 );
|
||||
return;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Set input field focus
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function set_input_field_focus()
|
||||
{
|
||||
inobj.focus();
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Styles element
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function set_style_for_element( c, name )
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( ! c )
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
c.className = name;
|
||||
|
||||
switch( name )
|
||||
{
|
||||
case 'wrapdiv':
|
||||
c.style.backgroundColor = "white";
|
||||
c.style.color = "black";
|
||||
|
||||
if ( c.displaySpan )
|
||||
{
|
||||
c.displaySpan.style.color = "green";
|
||||
}
|
||||
|
||||
break;
|
||||
case 'wrapspan':
|
||||
c.style.display = "block";
|
||||
c.style.paddingLeft = "3";
|
||||
c.style.paddingRight = "3";
|
||||
c.style.height = "16px";
|
||||
c.style.overflow = "hidden";
|
||||
break;
|
||||
case 'namespan':
|
||||
c.style.cssFloat = "left";
|
||||
c.style.width = '100%';
|
||||
break;
|
||||
case 'idspan':
|
||||
c.style.cssFloat = "right";
|
||||
c.style.display = 'none';
|
||||
break;
|
||||
case 'spanhilite':
|
||||
c.style.backgroundColor = "#3366cc";
|
||||
c.style.color = "white";
|
||||
|
||||
if ( c.displaySpan )
|
||||
{
|
||||
c.displaySpan.style.color = "white";
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Get value of named span
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function find_span_value_for_class( i, dc )
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( ! i )
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var ga = i.getElementsByTagName('span');
|
||||
|
||||
if ( ga )
|
||||
{
|
||||
for( var f=0; f < ga.length; ++f )
|
||||
{
|
||||
if ( ga[f].className == dc )
|
||||
{
|
||||
var value = ga[f].innerHTML;
|
||||
|
||||
if ( value == " " )
|
||||
{
|
||||
return "";
|
||||
}
|
||||
else
|
||||
{
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Displays the actual list
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function display_suggested_list( na, ia )
|
||||
{
|
||||
//----------------------------------
|
||||
// Clear div
|
||||
//----------------------------------
|
||||
|
||||
while( divobj.childNodes.length > 0 )
|
||||
{
|
||||
divobj.removeChild( divobj.childNodes[0] );
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Write Div
|
||||
//----------------------------------
|
||||
|
||||
_div_rows = 0;
|
||||
|
||||
for( var f = 0 ; f < na.length; ++f )
|
||||
{
|
||||
_div_rows++;
|
||||
var od = document.createElement("DIV");
|
||||
set_style_for_element( od, 'wrapdiv' );
|
||||
od.onmousedown = sb_mdown;
|
||||
od.onmouseover = sb_mover;
|
||||
od.onmouseout = sb_mout;
|
||||
|
||||
var span_wrap = document.createElement("SPAN");
|
||||
set_style_for_element( span_wrap, 'wrapspan' );
|
||||
|
||||
var span_name = document.createElement("SPAN");
|
||||
span_name.innerHTML = na[f];
|
||||
|
||||
var span_id = document.createElement("SPAN");
|
||||
|
||||
set_style_for_element( span_name, 'namespan' );
|
||||
set_style_for_element( span_id, 'idspan' );
|
||||
|
||||
od.displaySpan = span_id;
|
||||
|
||||
span_id.innerHTML = ia[f];
|
||||
|
||||
span_wrap.appendChild( span_name );
|
||||
span_wrap.appendChild( span_id );
|
||||
od.appendChild( span_wrap );
|
||||
divobj.appendChild( od );
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Calc pos.
|
||||
//----------------------------------
|
||||
|
||||
var mid = inobj;
|
||||
var left_px = _get_obj_leftpos(mid);
|
||||
var top_px = _get_obj_toppos(mid) + mid.offsetHeight;
|
||||
var width = parseInt( divobj.style.width );
|
||||
var height = parseInt( divobj.style.height );
|
||||
|
||||
//----------------------------------
|
||||
// Show menu DIV
|
||||
//----------------------------------
|
||||
|
||||
divobj.style.position = "absolute";
|
||||
|
||||
//----------------------------------
|
||||
// Try and keep it on screen
|
||||
//----------------------------------
|
||||
|
||||
if ( (left_px + width) >= document.body.clientWidth )
|
||||
{
|
||||
left_px = left_px + mid.offsetWidth - width;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Try and keep it on screen
|
||||
//----------------------------------
|
||||
|
||||
if ( (top_px + height) >= document.body.clientHeight )
|
||||
{
|
||||
top_px = top_px - height;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Finalize menu position
|
||||
//----------------------------------
|
||||
|
||||
divobj.style.left = left_px + "px";
|
||||
divobj.style.top = top_px + "px";
|
||||
divobj.style.display = "block";
|
||||
|
||||
_hiliteindex= -1;
|
||||
|
||||
//----------------------------------
|
||||
// Workaround for IE bug which shows
|
||||
// select boxes and other windows GUI
|
||||
// over divs. SHOW IFRAME
|
||||
//----------------------------------
|
||||
|
||||
if ( is_ie )
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( ! document.getElementById( 'if_xhr_' + mem_div ) )
|
||||
{
|
||||
iframeobj = document.createElement('iframe');
|
||||
|
||||
iframeobj.src = 'javascript:;';
|
||||
iframeobj.id = 'if_xhr_' + mem_div;
|
||||
|
||||
document.getElementsByTagName('body')[0].appendChild( iframeobj );
|
||||
}
|
||||
else
|
||||
{
|
||||
iframeobj = document.getElementById( 'if_xhr_' + mem_div );
|
||||
}
|
||||
|
||||
iframeobj.scrolling = 'no';
|
||||
iframeobj.frameborder = 'no';
|
||||
iframeobj.className = 'iframeshim';
|
||||
iframeobj.style.position = 'absolute';
|
||||
|
||||
iframeobj.style.width = parseInt(divobj.offsetWidth) + 'px';
|
||||
iframeobj.style.height = parseInt(divobj.offsetHeight) + 'px';
|
||||
iframeobj.style.top = divobj.style.top;
|
||||
iframeobj.style.left = divobj.style.left;
|
||||
iframeobj.style.zIndex = divobj.style.zIndex - 1;
|
||||
iframeobj.style.display = "block";
|
||||
|
||||
}
|
||||
catch(error)
|
||||
{
|
||||
//alert(error); // Oh dear, someones stolen the iframe
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Caches the results
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function cache_name_results( mstring, na, ia )
|
||||
{
|
||||
_result_cache[mstring] = new Array( na, ia );
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// This is the function the response XML text gives
|
||||
/*--------------------------------------------*/
|
||||
|
||||
returnSearch = function( mstring, namearray, idarray )
|
||||
{
|
||||
//----------------------------------
|
||||
// Cache..
|
||||
//----------------------------------
|
||||
|
||||
cache_name_results( mstring, namearray, idarray );
|
||||
|
||||
if ( _in_focus != 1 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Display
|
||||
//----------------------------------
|
||||
|
||||
display_suggested_list( namearray, idarray );
|
||||
|
||||
//----------------------------------
|
||||
// Resize or hide?
|
||||
//----------------------------------
|
||||
|
||||
if ( _div_rows > 0 )
|
||||
{
|
||||
divobj.style.height = 16 * _div_rows + 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
my_xr_hide_div( divobj );
|
||||
_hiliteindex = -1;
|
||||
}
|
||||
};
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Submit handler
|
||||
/*--------------------------------------------*/
|
||||
|
||||
submit_handler = function ( event )
|
||||
{
|
||||
delay_action = true;
|
||||
var retval = true;
|
||||
|
||||
if ( _hiliteindex != -1 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( _form_onsubmit_saved )
|
||||
{
|
||||
eval( 'tmpsubmit = ' + _form_onsubmit_saved );
|
||||
retval = tmpsubmit();
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
};
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// On key up handler
|
||||
/*--------------------------------------------*/
|
||||
|
||||
onkeyuphandler = function( event )
|
||||
{
|
||||
_event_key_code = event.keyCode;
|
||||
key_handler_function();
|
||||
};
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Div mouse events
|
||||
/*--------------------------------------------*/
|
||||
|
||||
sb_mdown = function()
|
||||
{
|
||||
delay_action = true;
|
||||
inobj.value = find_span_value_for_class( this, 'namespan' );
|
||||
};
|
||||
|
||||
sb_mover = function()
|
||||
{
|
||||
set_style_for_element( this, 'spanhilite' );
|
||||
};
|
||||
|
||||
sb_mout = function()
|
||||
{
|
||||
set_style_for_element( this, 'wrapdiv' );
|
||||
};
|
||||
|
||||
function my_xr_hide_div ( dobj )
|
||||
{
|
||||
dobj.style.display = "none";
|
||||
|
||||
if ( is_ie )
|
||||
{
|
||||
try
|
||||
{
|
||||
document.getElementById( 'if_xhr_' + mem_div ).style.display = "none";
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
//alert(e);// Oh dear, someones stolen the iframe
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,666 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// IPS JS: Attach Functions
|
||||
// (c) 2005 Invision Power Services, Inc.
|
||||
// http://www.invisionpower.com
|
||||
// Matt Mecham (16/12/05)
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
var ipsattach = new ips_attach();
|
||||
|
||||
function ips_attach()
|
||||
{
|
||||
/**
|
||||
* iFrame id
|
||||
*/
|
||||
this.iframe_id = 'ips--iframe-obj-attach';
|
||||
/**
|
||||
* iFrame Object
|
||||
*/
|
||||
this.iframe_obj = null;
|
||||
/**
|
||||
* Init URL
|
||||
* URL to load to display current attachments, etc
|
||||
*/
|
||||
this.iframe_init_url = '';
|
||||
/**
|
||||
* URL for removing attachment
|
||||
*/
|
||||
this.iframe_remove_url = '';
|
||||
/**
|
||||
* The name of the DIV that this iframe is attached to
|
||||
*/
|
||||
this.iframe_add_to_div = 'ips-attach-div-iframe';
|
||||
this.iframe_add_to_div_obj = null;
|
||||
/**
|
||||
* The name of the DIV that this iframe is attached to
|
||||
*/
|
||||
this.iframe_parent_div = 'ips-attach-div-parent';
|
||||
this.iframe_parent_div_obj = null;
|
||||
/**
|
||||
* The name of the DIV that the status bar is in
|
||||
*/
|
||||
this.status_div = 'ips-attach-div-status';
|
||||
this.status_div_obj = null;
|
||||
/**
|
||||
* The name of the DIV that the dropdown menu text is in
|
||||
*/
|
||||
this.dropdown_text = 'ips-attach-menu-text';
|
||||
this.dropdown_text_obj = null;
|
||||
/**
|
||||
* Default iframe height
|
||||
*/
|
||||
this.iframe_height = 300;
|
||||
/**
|
||||
* css class names
|
||||
*/
|
||||
this.iframe_classname = 'attach-iframe';
|
||||
/**
|
||||
* Message cover
|
||||
*/
|
||||
this.message_div_id = 'ips-attach-message';
|
||||
this.message_div_obj = null;
|
||||
this.message_span_id = 'ips-attach-message-span';
|
||||
this.message_span_obj = null;
|
||||
/**
|
||||
* Default Status message
|
||||
*/
|
||||
this.status_msg = '';
|
||||
this.status_is_error = '';
|
||||
/**
|
||||
* Current items array
|
||||
*/
|
||||
this.current_items = new Array();
|
||||
/**
|
||||
* Current items' menu
|
||||
*/
|
||||
this.current_item_menu = 'ips-attach-menu';
|
||||
this.current_item_menu_obj = null;
|
||||
/**
|
||||
* Images URL
|
||||
*/
|
||||
this.images_url = null;
|
||||
/**
|
||||
* Language array
|
||||
*/
|
||||
this.lang = new Array();
|
||||
/**
|
||||
* CSS classes
|
||||
*/
|
||||
this.css_menu_row = 'attach-menu-row';
|
||||
this.css_menu_row_over = 'attach-menu-row-over';
|
||||
/**
|
||||
* Show attachments menu
|
||||
*/
|
||||
this.show_attach_menu = 1;
|
||||
/**
|
||||
* Onload command
|
||||
*/
|
||||
this.onload_function = '';
|
||||
|
||||
/**
|
||||
* Has an upload...
|
||||
*/
|
||||
this.has_upload_pending = 0;
|
||||
|
||||
/**
|
||||
* INIT
|
||||
*/
|
||||
this.init = function()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT objects
|
||||
//-----------------------------------------
|
||||
|
||||
this.iframe_add_to_div_obj = document.getElementById( this.iframe_add_to_div );
|
||||
this.iframe_parent_div_obj = document.getElementById( this.iframe_parent_div );
|
||||
this.message_div_obj = document.getElementById( this.message_div_id );
|
||||
this.message_span_obj = document.getElementById( this.message_span_id );
|
||||
this.status_div_obj = document.getElementById( this.status_div );
|
||||
this.dropdown_text_obj = document.getElementById( this.dropdown_text );
|
||||
|
||||
//-----------------------------------------
|
||||
// INIT Current button
|
||||
//-----------------------------------------
|
||||
|
||||
if ( this.show_attach_menu )
|
||||
{
|
||||
// INIT div
|
||||
this.current_item_menu_obj = document.getElementById( this.current_item_menu );
|
||||
|
||||
ipsmenu.register( this.current_item_menu );
|
||||
|
||||
this.current_item_menu_obj._onclick = this.current_item_menu_obj.onclick;
|
||||
this.current_item_menu_obj.onmouseover = this.current_item_menu_obj.onmouseout = this.current_item_menu_obj.onclick = this.current_menu_mouseover;
|
||||
|
||||
ipsmenu.menu_registered[ this.current_item_menu ]._open = ipsmenu.menu_registered[ this.current_item_menu ].open;
|
||||
ipsmenu.menu_registered[ this.current_item_menu ].open = this.current_menu_button_show;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Dynamically builds the HTML for the IPS Menu system
|
||||
*
|
||||
* @var object Javascript object clicked
|
||||
*/
|
||||
this.init_current_menu = function( obj )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Old menu?
|
||||
//-----------------------------------------
|
||||
|
||||
var menu = '';
|
||||
|
||||
try
|
||||
{
|
||||
menu = document.getElementById( ipsattach.current_item_menu + '_menu' );
|
||||
menu.innerHTML = '';
|
||||
}
|
||||
catch(error)
|
||||
{
|
||||
menu = document.createElement('div');
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Create menu wrapper
|
||||
//-----------------------------------------
|
||||
|
||||
var _items = 0;
|
||||
|
||||
menu.id = ipsattach.current_item_menu + '_menu';
|
||||
menu.className = 'attach-popupmenu';
|
||||
menu.style.display = 'none';
|
||||
menu.style.cursor = 'default';
|
||||
menu.style.padding = '3px';
|
||||
menu.style.width = 'auto';
|
||||
menu.style.overflow = 'auto';
|
||||
|
||||
//-----------------------------------------
|
||||
// What are we doing?
|
||||
//-----------------------------------------
|
||||
|
||||
for( var i in ipsattach.current_items )
|
||||
{
|
||||
var option = document.createElement('div');
|
||||
option.innerHTML = ipsattach.current_items[i];
|
||||
option.style.width = ipsattach.current_item_menu_obj.style.width;
|
||||
option.className = 'attach-menu-row';
|
||||
option.onmouseover = option.onmouseout = ipsattach.menu_onmouse_event;
|
||||
menu.appendChild(option);
|
||||
|
||||
_items++;
|
||||
}
|
||||
|
||||
if ( ! _items )
|
||||
{
|
||||
var option = document.createElement('div');
|
||||
option.innerHTML = ipsattach.lang['no_items'];
|
||||
option.style.width = ipsattach.current_item_menu_obj.style.width;
|
||||
option.className = 'attach-menu-row';
|
||||
option.onmouseover = option.onmouseout = ipsattach.menu_onmouse_event;
|
||||
menu.appendChild(option);
|
||||
}
|
||||
|
||||
// Set status counter correct
|
||||
ipsattach.set_attach_count_status( _items );
|
||||
|
||||
ipsattach.iframe_parent_div_obj.appendChild(menu);
|
||||
|
||||
ipsclass.set_unselectable( menu );
|
||||
};
|
||||
|
||||
/**
|
||||
* Recounts number of current attachments and sets counter
|
||||
*
|
||||
* @param integer Cached count
|
||||
*/
|
||||
this.set_attach_count_status = function( _items )
|
||||
{
|
||||
if ( ! ipsattach.show_attach_menu )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ( typeof( _items ) == 'undefined' )
|
||||
{
|
||||
_items = 0;
|
||||
|
||||
for( var i in ipsattach.current_items )
|
||||
{
|
||||
_items++;
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
ipsattach.dropdown_text_obj.innerHTML = " (" + _items + ")";
|
||||
}
|
||||
catch(error)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Add item into current_attachments menu
|
||||
*/
|
||||
this.add_current_item = function( attach_id, attach_name, attach_size, attach_image )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Fix up attach_name
|
||||
//-----------------------------------------
|
||||
|
||||
if ( attach_name.length > 22 )
|
||||
{
|
||||
var _ext = attach_name.replace( /^.*\.(\S+?)$/ , "$1" );
|
||||
var _main = attach_name.replace( /^(.*)\.\S+?$/ , "$1" );
|
||||
var _a = _main.substr( 0, 8 );
|
||||
var _b = _main.substr( _main.length - 8 , _main.length );
|
||||
|
||||
attach_name = _a + '...' + _b + '.' + _ext;
|
||||
}
|
||||
|
||||
var html = '';
|
||||
|
||||
html += '<img onclick="ipsattach.add_attachment_into_editor(' + attach_id + ', \'' + attach_name + '\')" src="' + this.images_url + '/folder_attach_images/attach_add.png" title="' + this.lang['attach_insert'] + '" style="vertical-align:middle" border="0" alt="" /> ';
|
||||
html += '<img onclick="ipsattach.remove_attachment(' + attach_id + ');" src="' + this.images_url + '/folder_attach_images/attach_remove.png" title="' + this.lang['attach_remove'] + ': [' + attach_id + ']' + '" style="vertical-align:middle" border="0" alt="" /> ';
|
||||
|
||||
html += '<img src="' + this.images_url + '/' + attach_image + '" style="vertical-align:middle" border="0" alt="" /> ';
|
||||
html += '<span style="font-weight:bold" onclick="ipsattach.add_attachment_into_editor(' + attach_id + ', \'' + attach_name + '\')">' + attach_name + '</span>';
|
||||
html += ' <span class="desctext"> ('+attach_size+')</span>';
|
||||
|
||||
this.current_items[ this.current_items.length ] = html;
|
||||
};
|
||||
|
||||
/**
|
||||
* Adds the IPD attach tag into the current editor
|
||||
*
|
||||
* @param integer Attachment ID
|
||||
* @param string Attachment name
|
||||
*/
|
||||
this.add_attachment_into_editor = function( id, name )
|
||||
{
|
||||
// Form tag
|
||||
var tag = "[attachment=" + id + ":" + name + "]";
|
||||
|
||||
// Add
|
||||
ipsclass.add_editor_contents( tag );
|
||||
};
|
||||
|
||||
/**
|
||||
* Removes an attachment
|
||||
*
|
||||
* @param integer Attachment ID
|
||||
*/
|
||||
this.remove_attachment = function( id )
|
||||
{
|
||||
menu_action_close();
|
||||
|
||||
if ( confirm( ipsattach.lang['remove_warn'] + ' ['+ id + ']' ) )
|
||||
{
|
||||
ipsattach.iframe_obj.src = ipsattach.iframe_remove_url + "&attach_id=" + id;
|
||||
|
||||
ipsattach.iframe_on_un_load( 'attach_removal' );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Show upload field and attachments
|
||||
* Draws the iFrame and sets the source
|
||||
*/
|
||||
this.show_attach_box = function()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
var iheight = parseInt( this.iframe_add_to_div_obj.style.height );
|
||||
var iwidth = this.iframe_add_to_div_obj.style.width;
|
||||
|
||||
//-----------------------------------------
|
||||
// Generate iFrame box
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! this.iframe_obj )
|
||||
{
|
||||
this.iframe_obj = document.createElement( 'IFRAME' );
|
||||
|
||||
this.iframe_obj.src = this.iframe_init_url;
|
||||
this.iframe_obj.id = this.iframe_id;
|
||||
this.iframe_obj.name = this.iframe_id;
|
||||
this.iframe_obj.scrolling = 'no';
|
||||
this.iframe_obj.frameBorder = 'no';
|
||||
this.iframe_obj.border = '0';
|
||||
this.iframe_obj.className = this.iframe_classname;
|
||||
this.iframe_obj.style.width = iwidth ? iwidth : '100%';
|
||||
this.iframe_obj.style.height = iheight ? iheight - 5 + 'px' : this.iframe_height + 'px';
|
||||
this.iframe_obj.style.overflow = 'hidden';
|
||||
this.iframe_obj.style.display = '';
|
||||
|
||||
// Add environmentals..
|
||||
this.iframe_obj.msg_open = 1;
|
||||
this.iframe_obj.iframe_loaded = 0;
|
||||
this.iframe_obj.iframe_init = 0;
|
||||
|
||||
// Attach iFrame inside our DIV
|
||||
this.iframe_add_to_div_obj.appendChild( this.iframe_obj );
|
||||
|
||||
// Add handler
|
||||
if ( is_ie )
|
||||
{
|
||||
this.iframe_obj.style.backgroundColor = 'transparent';
|
||||
this.iframe_obj.allowTransparency = true;
|
||||
this.iframe_obj.onreadystatechange = this.iframe_on_load_ie;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.iframe_obj.onload = this.iframe_onload;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Safari bug: Onload events don't fire
|
||||
// when the parent DIV is hidden.
|
||||
//-----------------------------------------
|
||||
|
||||
if ( is_safari )
|
||||
{
|
||||
this.iframe_parent_div_obj.style.display = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
this.iframe_parent_div_obj.style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// INIT cover div
|
||||
//-----------------------------------------
|
||||
|
||||
if ( typeof this.message_div_obj != 'undefined' )
|
||||
{
|
||||
this.message_div_obj.style.width = typeof this.iframe_parent_div_obj.style.width != 'undefined' ? this.iframe_parent_div_obj.style.width : '100%';
|
||||
this.message_div_obj.style.height = this.iframe_parent_div_obj.offsetHeight ? this.iframe_parent_div_obj.offsetHeight : '120px';
|
||||
this.message_div_obj.style.position = 'relative';
|
||||
this.message_div_obj.style.display = 'none';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Show cover div during INIT
|
||||
//-----------------------------------------
|
||||
|
||||
this.show_message( this.lang['init_progress'] );
|
||||
};
|
||||
|
||||
/**
|
||||
* Draws status bar
|
||||
* Using "ipsattach" as is called in an event function
|
||||
*/
|
||||
this.init_status_bar = function()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
var _html = '';
|
||||
|
||||
if ( typeof ipsattach.status_div_obj != 'undefined' )
|
||||
{
|
||||
try
|
||||
{
|
||||
ipsattach.status_msg = ipsattach.lang[ ipsattach.status_msg ];
|
||||
}
|
||||
catch(error) { }
|
||||
|
||||
if ( ipsattach.status_msg )
|
||||
{
|
||||
if ( ipsattach.status_is_error )
|
||||
{
|
||||
_html += "<img src='" + this.images_url + "/folder_attach_images/attach_error.png' border='0' style='vertical-align:middle' alt='" + ipb_global_lang['general_error'] + "' /> " + ipsattach.status_msg;
|
||||
}
|
||||
else
|
||||
{
|
||||
_html += "<img src='" + this.images_url + "/folder_attach_images/attach_ok.png' border='0' style='vertical-align:middle' alt='" + ipb_global_lang['general_OK'] + "' /> " + ipsattach.status_msg;
|
||||
}
|
||||
}
|
||||
|
||||
ipsattach.status_div_obj.innerHTML = _html;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Reset pending...
|
||||
//-----------------------------------------
|
||||
|
||||
ipsattach.has_upload_pending = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* Manually show the iframe message
|
||||
*/
|
||||
this.iframe_on_un_load = function( msg )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Message...
|
||||
//-----------------------------------------
|
||||
|
||||
msg = typeof(msg) != 'undefined' ? ipsattach.lang[ msg ] : ipsattach.lang['uploading_file'];
|
||||
|
||||
//-----------------------------------------
|
||||
// Show...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( this.iframe_obj.iframe_loaded )
|
||||
{
|
||||
this.iframe_obj.iframe_loaded = 0;
|
||||
this.iframe_obj.msg_open = 1;
|
||||
|
||||
ipsattach.show_message( msg );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Each time the window is loaded, close
|
||||
* any open messages
|
||||
*/
|
||||
this.iframe_onload = function( e )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// First load?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! this.iframe_init )
|
||||
{
|
||||
this.iframe_init = 1;
|
||||
this.iframe_loaded = 1;
|
||||
|
||||
if ( this.msg_open )
|
||||
{
|
||||
this.msg_open = 0;
|
||||
|
||||
ipsattach.hide_message();
|
||||
}
|
||||
|
||||
window.frames[ this.id ].document.onmousedown = menu_action_close;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.iframe_loaded = 1;
|
||||
window.frames[ this.id ].document.onmousedown = menu_action_close;
|
||||
|
||||
if ( this.msg_open )
|
||||
{
|
||||
this.msg_open = 0;
|
||||
|
||||
ipsattach.hide_message();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Run command?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ipsattach.onload_function )
|
||||
{
|
||||
ipsattach.onload_function();
|
||||
}
|
||||
}
|
||||
|
||||
// INIT stuff
|
||||
ipsattach.init_status_bar();
|
||||
// Set status counter correct
|
||||
ipsattach.set_attach_count_status();
|
||||
};
|
||||
|
||||
/**
|
||||
* IE only calls onload once... So subsequent loads
|
||||
* don't do anything.. hence the readystate change
|
||||
*/
|
||||
this.iframe_on_load_ie = function( e )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// First load?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( this.readyState == 'complete' )
|
||||
{
|
||||
if ( ! this.iframe_init )
|
||||
{
|
||||
this.iframe_init = 1;
|
||||
this.iframe_loaded = 1;
|
||||
window.frames[ this.id ].document.onmousedown = menu_action_close;
|
||||
|
||||
if ( this.msg_open )
|
||||
{
|
||||
this.msg_open = 0;
|
||||
|
||||
ipsattach.hide_message();
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
this.iframe_loaded = 1;
|
||||
window.frames[ this.id ].document.onmousedown = menu_action_close;
|
||||
|
||||
if ( this.msg_open )
|
||||
{
|
||||
this.msg_open = 0;
|
||||
ipsattach.hide_message();
|
||||
}
|
||||
}
|
||||
|
||||
//window.frames[ this.id ].document.getElementsByTagName('html')[0].allowTransparency = true;
|
||||
window.frames[ this.id ].document.getElementsByTagName('html')[0].style.background = 'transparent';
|
||||
|
||||
//alert( window.frames[ this.id ].document.getElementsByTagName('html')[0].outerHTML );
|
||||
|
||||
//-----------------------------------------
|
||||
// Run command?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ipsattach.onload_function )
|
||||
{
|
||||
ipsattach.onload_function();
|
||||
}
|
||||
|
||||
// INIT stuff
|
||||
ipsattach.init_status_bar();
|
||||
// Set status counter correct
|
||||
ipsattach.set_attach_count_status();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Show message DIV
|
||||
*/
|
||||
this.show_message = function( msg )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Safari bug: Onload events don't fire
|
||||
// when the parent DIV is hidden.
|
||||
//-----------------------------------------
|
||||
|
||||
if ( is_safari )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ( typeof ipsattach.message_div_obj != 'undefined' )
|
||||
{
|
||||
ipsattach.message_div_obj.style.display = '';
|
||||
ipsattach.message_span_obj.innerHTML = msg;
|
||||
|
||||
// Hide other div
|
||||
ipsattach.iframe_parent_div_obj.style.display = 'none';
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Hide message DIV
|
||||
*/
|
||||
this.hide_message = function()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Safari bug: Onload events don't fire
|
||||
// when the parent DIV is hidden.
|
||||
//-----------------------------------------
|
||||
|
||||
if ( is_safari )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ( typeof ipsattach.message_div_obj != 'undefined' )
|
||||
{
|
||||
ipsattach.message_div_obj.style.display = 'none';
|
||||
ipsattach.message_span_obj.innerHTML = '';
|
||||
|
||||
// Show other div
|
||||
ipsattach.iframe_parent_div_obj.style.display = '';
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Mouseover events
|
||||
*
|
||||
* @param Event Object
|
||||
*/
|
||||
this.current_menu_mouseover = function(e)
|
||||
{
|
||||
e = ipsclass.cancel_bubble(e, true);
|
||||
|
||||
if ( e.type == 'click' )
|
||||
{
|
||||
this._onclick(e);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Shows the pop-up menu
|
||||
* First, dynamically writes menu - then passes to ipsmenu class to show
|
||||
*
|
||||
* @param Object Object
|
||||
*/
|
||||
this.current_menu_button_show = function(obj)
|
||||
{
|
||||
ipsattach.init_current_menu(obj);
|
||||
this._open(obj);
|
||||
};
|
||||
|
||||
/**
|
||||
* Roll over effect for the menu
|
||||
* ^^
|
||||
*
|
||||
* @param Event Object
|
||||
*/
|
||||
this.menu_onmouse_event = function( e )
|
||||
{
|
||||
e = ipsclass.cancel_bubble(e, true);
|
||||
|
||||
if ( e.type == 'mouseover' )
|
||||
{
|
||||
this.className = ipsattach.css_menu_row_over;
|
||||
}
|
||||
else if ( e.type == 'mouseout' )
|
||||
{
|
||||
this.className = ipsattach.css_menu_row;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,597 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// IPS Global JS functions
|
||||
//------------------------------------------------------------------------------
|
||||
// Matt Mecham Woz Here
|
||||
// (c) 2005 Invision Power Services, Inc.
|
||||
// http://www.invisionpower.com
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
function ipsclass()
|
||||
{
|
||||
this.cookies = new Array();
|
||||
this.ignore_cookies = new Array( ipb_var_cookieid + 'ipb_stronghold',
|
||||
ipb_var_cookieid + 'session_id',
|
||||
ipb_var_cookieid + 'ipb_admin_session_id',
|
||||
ipb_var_cookieid + 'member_id',
|
||||
ipb_var_cookieid + 'pass_hash' );
|
||||
|
||||
this.settings = {
|
||||
'do_linked_resize' : 0,
|
||||
'resize_percent' : 50
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Sort out cookies
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
this.init = function()
|
||||
{
|
||||
var _tmp = document.cookie.split(';');
|
||||
|
||||
if ( _tmp.length )
|
||||
{
|
||||
for( i = 0 ; i < _tmp.length ; i++ )
|
||||
{
|
||||
if ( _tmp[i].match( new RegExp( ipb_var_cookieid + ".*$" ) ) )
|
||||
{
|
||||
var _data = _tmp[i].split('=');
|
||||
var _key = this.trim( _data[0] );
|
||||
var _value = unescape( this.trim( _data[1] ) );
|
||||
|
||||
if ( _key && ( ! this.in_array( _key, this.ignore_cookies ) ) )
|
||||
{
|
||||
this.cookies[ _key.replace( ipb_var_cookieid, '' ) ] = _value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_tmp = null;
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// PHP EMULATION
|
||||
//=============================================================================
|
||||
|
||||
/**
|
||||
* Emulate PHPs trim function
|
||||
*/
|
||||
this.trim = function( text )
|
||||
{
|
||||
if( typeof(text) == 'undefined' )
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
text = text.replace(/^\s+/, '');
|
||||
return text.replace(/\s+$/, '');
|
||||
};
|
||||
|
||||
/**
|
||||
* Emulate PHPs html_entity_decode function
|
||||
*/
|
||||
this.html_entity_decode = function( text )
|
||||
{
|
||||
if( typeof ca == 'undefined' )
|
||||
{
|
||||
var ca = document.createElement( 'textarea' );
|
||||
}
|
||||
|
||||
ca.innerHTML = text.replace( /</g, '<' ).replace( />/g, '>' );
|
||||
|
||||
return ca.value;
|
||||
};
|
||||
|
||||
/**
|
||||
* Emulate PHPs in_array function
|
||||
*/
|
||||
this.in_array = function( needle, haystack )
|
||||
{
|
||||
if ( ! haystack.length )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for ( var i = 0 ; i < haystack.length ; i++)
|
||||
{
|
||||
if ( haystack[i] === needle )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Emulate PHPs htmlspecial chars function
|
||||
*/
|
||||
this.htmlspecialchars = function( text )
|
||||
{
|
||||
text = text.replace( /</g, '<' );
|
||||
text = text.replace( />/g, '>' );
|
||||
text = text.replace( /"/g, '"' );
|
||||
|
||||
return text;
|
||||
};
|
||||
|
||||
/**
|
||||
* Emulate PHPs un htmlspecial chars function
|
||||
*/
|
||||
this.un_htmlspecialchars = function( text )
|
||||
{
|
||||
text = text.replace( /</g , '<' );
|
||||
text = text.replace( />/g , '>' );
|
||||
text = text.replace( /"/g, '"' );
|
||||
|
||||
return text;
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// EDITOR FUNCTIONS
|
||||
//=============================================================================
|
||||
|
||||
/**
|
||||
* Get contents from an open editor
|
||||
*/
|
||||
this.get_editor_contents = function( editor_id, editor_array )
|
||||
{
|
||||
var aIPS_editor = editor_array ? editor_array : IPS_editor;
|
||||
|
||||
if ( ! editor_id )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Assume we don't care, and get first box
|
||||
//-----------------------------------------
|
||||
|
||||
for( var i in aIPS_editor )
|
||||
{
|
||||
if( typeof( aIPS_editor[i] ) != 'object' )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
editor_id = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return aIPS_editor[ editor_id ].editor_get_contents;
|
||||
};
|
||||
|
||||
/**
|
||||
* Add contents to an open editor
|
||||
*/
|
||||
this.add_editor_contents = function( text, editor_id, editor_array )
|
||||
{
|
||||
var aIPS_editor = editor_array ? editor_array : IPS_editor;
|
||||
|
||||
if ( ! editor_id )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Assume we don't care, and get first box
|
||||
//-----------------------------------------
|
||||
|
||||
for( var i in aIPS_editor )
|
||||
{
|
||||
if( typeof( aIPS_editor[i] ) != 'object' )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
editor_id = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return aIPS_editor[ editor_id ].insert_text( text );
|
||||
};
|
||||
|
||||
/**
|
||||
* Convert saved tags to display tags
|
||||
*/
|
||||
this.convert_saved_tags_to_display_tags = function( text )
|
||||
{
|
||||
text = text.replace( /(<|<|<)!--/, "{" );
|
||||
text = text.replace( /--(>|>|>)/ , "}" );
|
||||
|
||||
return text;
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// MISC FUNCTIONS
|
||||
//=============================================================================
|
||||
|
||||
/**
|
||||
* Include a script...
|
||||
*/
|
||||
this.include_javascript = function( _file, div_id )
|
||||
{
|
||||
/* INIT */
|
||||
var _doc = ( div_id ) ? document.getElementById( div_id ) : document.getElementsByTagName( 'head' ).item(0);
|
||||
var _js = document.createElement('script' );
|
||||
|
||||
/* Create attribute */
|
||||
_js.setAttribute( 'language', 'javascript' );
|
||||
_js.setAttribute( 'type', 'text/javascript' );
|
||||
_js.setAttribute( 'src', _file );
|
||||
_doc.appendChild( _js );
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Fade in colour...
|
||||
*/
|
||||
this.fade_in_element = function( div )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
var hash = '#';
|
||||
var color_items = "0123456789abcdef";
|
||||
var start_color = '#ffff66';
|
||||
var orig_color = document.getElementById( div ).style.backgroundColor;
|
||||
var temp_end = '#ffffff';
|
||||
var iter = 20;
|
||||
var time = 80;
|
||||
|
||||
var rbeg = color_items.indexOf(start_color.substr(1,1))*16 + color_items.indexOf(start_color.substr(2,1));
|
||||
var gbeg = color_items.indexOf(start_color.substr(3,1))*16 + color_items.indexOf(start_color.substr(4,1));
|
||||
var bbeg = color_items.indexOf(start_color.substr(5,1))*16 + color_items.indexOf(start_color.substr(6,1));
|
||||
var rend = color_items.indexOf(temp_end.substr(1,1))*16 + color_items.indexOf(temp_end.substr(2,1));
|
||||
var gend = color_items.indexOf(temp_end.substr(3,1))*16 + color_items.indexOf(temp_end.substr(4,1));
|
||||
var bend = color_items.indexOf(temp_end.substr(5,1))*16 + color_items.indexOf(temp_end.substr(6,1));
|
||||
|
||||
for ( i = 1, r = rbeg, g = gbeg, b = bbeg;
|
||||
i <= iter;
|
||||
r = Math.round(rbeg + i * ((rend - rbeg) / (iter-1))),
|
||||
g = Math.round(gbeg + i * ((gend - gbeg) / (iter-1))),
|
||||
b = Math.round(bbeg + i * ((bend - bbeg) / (iter-1))), i++
|
||||
)
|
||||
{
|
||||
hstr = '#' + color_items.charAt(Math.floor(r/16)) + color_items.charAt(r%16) + color_items.charAt(Math.floor(g/16)) + color_items.charAt(g%16) + color_items.charAt(Math.floor(b/16)) + color_items.charAt(b%16);
|
||||
|
||||
setTimeout('var div = document.getElementById("' + div + '"); div.style.backgroundColor = "' + hstr + '";', i * time);
|
||||
}
|
||||
|
||||
setTimeout('var div = document.getElementById("' + div + '"); div.style.backgroundColor = "' + orig_color + '";', (i+1) * time);
|
||||
};
|
||||
|
||||
/**
|
||||
* Accepts a string followed by a list of replacements
|
||||
*/
|
||||
|
||||
this.lang_build_string = function()
|
||||
{
|
||||
if ( ! arguments.length || ! arguments )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var string = arguments[0];
|
||||
|
||||
for( var i = 1 ; i < arguments.length ; i++ )
|
||||
{
|
||||
var match = new RegExp('<%' + i + '>', 'gi');
|
||||
string = string.replace( match, arguments[i] );
|
||||
}
|
||||
|
||||
return string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Return the ID from an ID title string
|
||||
*
|
||||
* @param string ID title
|
||||
* @return integar ID
|
||||
*/
|
||||
this.get_id_from_text = function( id )
|
||||
{
|
||||
return id.replace( /.*(\-|_)(\S+)/, "$2" );
|
||||
};
|
||||
|
||||
/**
|
||||
* Return the name from an ID string
|
||||
*
|
||||
* @param string ID title
|
||||
* @return integar ID
|
||||
*/
|
||||
this.get_name_from_text = function( id )
|
||||
{
|
||||
return id.replace( /(.*)(\-|_)(\S+)/, "$1" );
|
||||
};
|
||||
|
||||
/**
|
||||
* Location jump
|
||||
* @param string URL to redirect to
|
||||
* @param boolean Do not prepend normal URL
|
||||
*/
|
||||
this.location_jump = function( url, full )
|
||||
{
|
||||
url = url.replace( /&/g, '&' );
|
||||
|
||||
if ( full )
|
||||
{
|
||||
window.location.href = url;
|
||||
}
|
||||
else
|
||||
{
|
||||
window.location.href = ipb_var_base_url + url;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Confirm an action
|
||||
*/
|
||||
this.confirm_action = function(url, msg)
|
||||
{
|
||||
if ( ! msg )
|
||||
{
|
||||
msg = 'PLEASE CONFIRM:\nOK to proceed?';
|
||||
}
|
||||
|
||||
if ( url )
|
||||
{
|
||||
url = url.replace( '&', '&' );
|
||||
}
|
||||
else
|
||||
{
|
||||
url = '';
|
||||
}
|
||||
|
||||
if ( confirm( msg ) )
|
||||
{
|
||||
window.location.href = url;
|
||||
}
|
||||
else
|
||||
{
|
||||
alert ( ipb_global_lang['action_cancelled'] );
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Create pop-up window
|
||||
*/
|
||||
this.pop_up_window = function(url, width, height, name)
|
||||
{
|
||||
if ( ! name )
|
||||
{
|
||||
var mydate = new Date();
|
||||
name = mydate.getTime();
|
||||
}
|
||||
|
||||
var Win = window.open( url.replace( '&', '&' ), name, 'width='+width+',height='+height + ',resizable=1,scrollbars=1,location=no,directories=no,status=no,menubar=no,toolbar=no');
|
||||
|
||||
Win.focus();
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Set stuff unselectable
|
||||
*/
|
||||
this.set_unselectable = function(obj)
|
||||
{
|
||||
if ( ! is_ie4 && typeof( obj.tagName ) != 'undefined' )
|
||||
{
|
||||
if ( obj.hasChildNodes() )
|
||||
{
|
||||
for (var i = 0; i < obj.childNodes.length; i++)
|
||||
{
|
||||
this.set_unselectable( obj.childNodes[i] );
|
||||
}
|
||||
}
|
||||
obj.unselectable = 'on';
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* GET LEFT OBJECT POSITION
|
||||
* Safari friendly version...
|
||||
*/
|
||||
this.get_obj_leftpos = function(obj)
|
||||
{
|
||||
var curleft = 0;
|
||||
|
||||
if (obj.offsetParent)
|
||||
{
|
||||
while (obj.offsetParent)
|
||||
{
|
||||
curleft += obj.offsetLeft;
|
||||
obj = obj.offsetParent;
|
||||
}
|
||||
}
|
||||
else if (obj.x)
|
||||
{
|
||||
curleft += obj.x;
|
||||
}
|
||||
|
||||
return curleft;
|
||||
};
|
||||
|
||||
/**
|
||||
* GET TOP OBJECT POSITION
|
||||
* Safari friendly version...
|
||||
*/
|
||||
this.get_obj_toppos = function(obj)
|
||||
{
|
||||
var curtop = 0;
|
||||
|
||||
if (obj.offsetParent)
|
||||
{
|
||||
while (obj.offsetParent)
|
||||
{
|
||||
curtop += obj.offsetTop;
|
||||
obj = obj.offsetParent;
|
||||
}
|
||||
}
|
||||
else if (obj.y)
|
||||
{
|
||||
curtop += obj.y;
|
||||
}
|
||||
|
||||
return curtop;
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// CANCEL BUBBLE FUNCTIONS
|
||||
//=============================================================================
|
||||
|
||||
/**
|
||||
* Stop the browser bubbling events
|
||||
*/
|
||||
this.cancel_bubble = function(obj, extra)
|
||||
{
|
||||
if ( extra !== false )
|
||||
{
|
||||
extra = true;
|
||||
}
|
||||
|
||||
if ( ! obj || is_ie)
|
||||
{
|
||||
if ( extra )
|
||||
{
|
||||
window.event.returnValue = false;
|
||||
}
|
||||
|
||||
window.event.cancelBubble = true;
|
||||
|
||||
return window.event;
|
||||
}
|
||||
else
|
||||
{
|
||||
obj.stopPropagation();
|
||||
|
||||
if ( extra )
|
||||
{
|
||||
obj.preventDefault();
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
};
|
||||
|
||||
this.cancel_bubble_all = function( obj )
|
||||
{
|
||||
return ipsclass.cancel_bubble( obj, true );
|
||||
};
|
||||
|
||||
this.cancel_bubble_low = function( obj )
|
||||
{
|
||||
return ipsclass.cancel_bubble( obj, false );
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// COOKIE FUNCTIONS
|
||||
//=============================================================================
|
||||
|
||||
/**
|
||||
* Cookie: Get Cookie
|
||||
*/
|
||||
this.my_getcookie = function( name )
|
||||
{
|
||||
return this.cookies[ name ];
|
||||
/*cname = ipb_var_cookieid + name + '=';
|
||||
cpos = document.cookie.indexOf( cname );
|
||||
|
||||
if ( cpos != -1 )
|
||||
{
|
||||
cstart = cpos + cname.length;
|
||||
cend = document.cookie.indexOf(";", cstart);
|
||||
|
||||
if (cend == -1)
|
||||
{
|
||||
cend = document.cookie.length;
|
||||
}
|
||||
|
||||
return unescape( document.cookie.substring(cstart, cend) );
|
||||
}
|
||||
|
||||
return null;*/
|
||||
};
|
||||
|
||||
/**
|
||||
* Cookie: Set Cookie
|
||||
*/
|
||||
this.my_setcookie = function( name, value, sticky )
|
||||
{
|
||||
expire = "";
|
||||
domain = "";
|
||||
path = "/";
|
||||
|
||||
if ( sticky )
|
||||
{
|
||||
expire = "; expires=Wed, 1 Jan 2020 00:00:00 GMT";
|
||||
}
|
||||
|
||||
if ( ipb_var_cookie_domain != "" )
|
||||
{
|
||||
domain = '; domain=' + ipb_var_cookie_domain;
|
||||
}
|
||||
|
||||
if ( ipb_var_cookie_path != "" )
|
||||
{
|
||||
path = ipb_var_cookie_path;
|
||||
}
|
||||
|
||||
document.cookie = ipb_var_cookieid + name + "=" + value + "; path=" + path + expire + domain + ';';
|
||||
|
||||
//-----------------------------------------
|
||||
// Update internal array
|
||||
//-----------------------------------------
|
||||
|
||||
this.cookies[ name ] = value;
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// ARRAY FUNCTIONS
|
||||
//=============================================================================
|
||||
|
||||
/**
|
||||
* Array: Get stacksize
|
||||
* @param array Array
|
||||
* @return int Array length
|
||||
*/
|
||||
this.array_stacksize = function( thearray )
|
||||
{
|
||||
for (i = 0 ; i < thearray.length; i++ )
|
||||
{
|
||||
if ( (thearray[i] == "") || (thearray[i] == null) || (thearray == 'undefined') )
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return thearray.length;
|
||||
};
|
||||
|
||||
/**
|
||||
* Array: Add element to the stack
|
||||
* @param array Array
|
||||
* @param mixed New value
|
||||
*/
|
||||
this.array_pushstack = function ( thearray, newval )
|
||||
{
|
||||
var arraysize = this.array_stacksize(thearray);
|
||||
thearray[arraysize] = newval;
|
||||
};
|
||||
|
||||
/**
|
||||
* Array: Remove last array element
|
||||
* @param array Array
|
||||
* @return int Array length
|
||||
*/
|
||||
this.array_popstack = function( thearray )
|
||||
{
|
||||
var arraysize = this.array_stacksize( thearray );
|
||||
var theval = thearray[arraysize - 1];
|
||||
|
||||
delete thearray[arraysize - 1];
|
||||
return theval;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,559 +0,0 @@
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// IPS BASIC MENU CLASS
|
||||
// (c) 2005 Invision Power Services, Inc
|
||||
// ASSUMES "ips_global.js" has been loaded
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
ipsmenu = new ips_menu();
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// INIT Handler class
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function ips_menu()
|
||||
{
|
||||
this.menu_registered = new Array();
|
||||
this.menu_openfuncs = new Array();
|
||||
this.menu_over_css = new Array();
|
||||
this.menu_out_css = new Array();
|
||||
this.menu_open_event = new Array();
|
||||
this.dynamic_register = new Array();
|
||||
this.menu_cur_open = null;
|
||||
this.dynamic_html = null;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Register menu control ID (add to array)
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
ips_menu.prototype.register = function ( cid, callback, menu_over_css, menu_out_css, event_type )
|
||||
{
|
||||
if ( event_type )
|
||||
{
|
||||
this.menu_open_event[ cid ] = ( event_type == 'onmouseover' ) ? 'onmouseover' : 'onclick';
|
||||
}
|
||||
|
||||
this.menu_registered[ cid ] = new ips_menu_class( cid );
|
||||
|
||||
if ( callback )
|
||||
{
|
||||
this.menu_openfuncs[ cid ] = callback;
|
||||
}
|
||||
|
||||
if ( menu_over_css && menu_out_css )
|
||||
{
|
||||
this.menu_over_css[ cid ] = menu_over_css;
|
||||
this.menu_out_css[ cid ] = menu_out_css;
|
||||
}
|
||||
|
||||
return this.menu_registered[ cid ];
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Register menu control ID (add to array)
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
ips_menu.prototype.close = function ()
|
||||
{
|
||||
if ( this.menu_cur_open )
|
||||
{
|
||||
this.menu_registered[ this.menu_cur_open ].close();
|
||||
}
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// ips_menu_class: Object for each menu
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function ips_menu_class( cid )
|
||||
{
|
||||
this.cid = cid;
|
||||
this.initialized = false;
|
||||
|
||||
this.init_control_object();
|
||||
this.init_menu();
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// ips_menu_class: Initiate a single menu
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
ips_menu_class.prototype.init_control_object = function()
|
||||
{
|
||||
this.cid_obj = document.getElementById( this.cid );
|
||||
|
||||
//----------------------------------
|
||||
// Change cursor to show link
|
||||
//----------------------------------
|
||||
|
||||
try
|
||||
{
|
||||
this.cid_obj.style.cursor = "pointer";
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
this.cid_obj.style.cursor = "hand";
|
||||
}
|
||||
|
||||
this.cid_obj.unselectable = true;
|
||||
|
||||
if ( ipsmenu.menu_open_event[ this.cid ] == 'onmouseover' )
|
||||
{
|
||||
this.cid_obj.onmouseover = ips_menu_events.prototype.event_onclick;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.cid_obj.onclick = ips_menu_events.prototype.event_onclick;
|
||||
this.cid_obj.onmouseover = ips_menu_events.prototype.event_onmouseover;
|
||||
}
|
||||
|
||||
this.cid_obj.onmouseout = ips_menu_events.prototype.event_onmouseout;
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// ips_menu_class: Initiate a single menu
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
ips_menu_class.prototype.init_menu = function()
|
||||
{
|
||||
this.cid_menu_obj = document.getElementById( this.cid + '_menu' );
|
||||
|
||||
if ( this.cid_menu_obj )
|
||||
{
|
||||
//----------------------------------
|
||||
// Save CPU - already init?
|
||||
//----------------------------------
|
||||
|
||||
if ( this.initialized )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Pop-up menu obj (hidden div)
|
||||
//----------------------------------
|
||||
|
||||
this.cid_menu_obj.style.display = "none";
|
||||
this.cid_menu_obj.style.position = "absolute";
|
||||
this.cid_menu_obj.style.left = "0px";
|
||||
this.cid_menu_obj.style.top = "0px";
|
||||
this.cid_menu_obj.onclick = ipsclass.cancel_bubble_low;
|
||||
this.cid_menu_obj.zIndex = 50;
|
||||
|
||||
this.initialized = true;
|
||||
}
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// ips_menu_class: Open menu
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
ips_menu_class.prototype.open = function( obj )
|
||||
{
|
||||
//----------------------------------
|
||||
// Not init?
|
||||
//----------------------------------
|
||||
|
||||
if ( ! this.cid_menu_obj )
|
||||
{
|
||||
this.initialized = false;
|
||||
this.init_menu();
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Close current menu(s)
|
||||
//----------------------------------
|
||||
|
||||
if ( ipsmenu.menu_cur_open != null )
|
||||
{
|
||||
ipsmenu.menu_registered[ ipsmenu.menu_cur_open ].close();
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Save CPU - cur open clicked?
|
||||
//----------------------------------
|
||||
|
||||
if ( ipsmenu.menu_cur_open == obj.id )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Set current open menu
|
||||
//----------------------------------
|
||||
|
||||
ipsmenu.menu_cur_open = obj.id;
|
||||
|
||||
//----------------------------------
|
||||
// Get ID of menu DIV to show
|
||||
//----------------------------------
|
||||
|
||||
var left_px = ipsclass.get_obj_leftpos(obj);
|
||||
var top_px = ipsclass.get_obj_toppos(obj) + obj.offsetHeight;
|
||||
var ifid = obj.id;
|
||||
|
||||
//try
|
||||
//{
|
||||
// if ( is_safari && ! ipb_is_acp )
|
||||
// {
|
||||
// top_px += 20;
|
||||
// }
|
||||
//}
|
||||
//catch(error)
|
||||
//{
|
||||
// if ( is_safari )
|
||||
// {
|
||||
// top_px += 20;
|
||||
// }
|
||||
//}
|
||||
|
||||
//----------------------------------
|
||||
// Show menu DIV.. but keep it underneath
|
||||
//----------------------------------
|
||||
|
||||
this.cid_menu_obj.style.zIndex = -1;
|
||||
this.cid_menu_obj.style.display = "";
|
||||
|
||||
//----------------------------------
|
||||
// Try and keep it on screen
|
||||
//----------------------------------
|
||||
|
||||
var width = parseInt( this.cid_menu_obj.style.width ) ? parseInt( this.cid_menu_obj.style.width ) : this.cid_menu_obj.offsetWidth;
|
||||
|
||||
if ( (left_px + width) >= document.body.clientWidth )
|
||||
{
|
||||
left_px = left_px + obj.offsetWidth - width;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Firefox bump
|
||||
//-----------------------------------------
|
||||
|
||||
if ( is_moz )
|
||||
{
|
||||
top_px -= 1;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Finalize menu position
|
||||
//----------------------------------
|
||||
|
||||
this.cid_menu_obj.style.left = left_px + "px";
|
||||
this.cid_menu_obj.style.top = top_px + "px";
|
||||
this.cid_menu_obj.style.zIndex = 100;
|
||||
|
||||
//----------------------------------
|
||||
// Run a custom function?
|
||||
//----------------------------------
|
||||
|
||||
if ( ipsmenu.menu_openfuncs[ obj.id ] )
|
||||
{
|
||||
eval( ipsmenu.menu_openfuncs[ obj.id ] );
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Workaround for IE bug which shows
|
||||
// select boxes and other windows GUI
|
||||
// over divs. SHOW IFRAME
|
||||
//----------------------------------
|
||||
|
||||
if ( is_ie )
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( ! document.getElementById( 'if_' + obj.id ) )
|
||||
{
|
||||
var iframeobj = document.createElement('iframe');
|
||||
|
||||
iframeobj.src = 'javascript:;';
|
||||
iframeobj.id = 'if_' +obj.id;
|
||||
|
||||
document.getElementsByTagName('body').appendChild( iframeobj );
|
||||
}
|
||||
else
|
||||
{
|
||||
var iframeobj = document.getElementById( 'if_' +obj.id );
|
||||
}
|
||||
|
||||
iframeobj.scrolling = 'no';
|
||||
iframeobj.frameborder = 'no';
|
||||
iframeobj.className = 'iframeshim';
|
||||
iframeobj.style.position = 'absolute';
|
||||
|
||||
iframeobj.style.width = parseInt(this.cid_menu_obj.offsetWidth) + 'px';
|
||||
iframeobj.style.height = parseInt(this.cid_menu_obj.offsetHeight) + 'px';
|
||||
iframeobj.style.top = this.cid_menu_obj.style.top;
|
||||
iframeobj.style.left = this.cid_menu_obj.style.left;
|
||||
iframeobj.style.zIndex = 99;
|
||||
iframeobj.style.display = "block";
|
||||
|
||||
}
|
||||
catch(error)
|
||||
{
|
||||
//alert(error); // Oh dear, someones stolen the iframe
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Work around for safari which doesnt
|
||||
// allow a hrefs top be clickable in
|
||||
// a pop up div
|
||||
//----------------------------------
|
||||
|
||||
if ( is_safari )
|
||||
{
|
||||
try
|
||||
{
|
||||
mlinks = this.cid_menu_obj.getElementsByTagName('a');
|
||||
|
||||
for ( var i = 0 ; i <= mlinks.length ; i++ )
|
||||
{
|
||||
//----------------------------------
|
||||
// Ignore non links and links that end with #
|
||||
// As safari likes to do that with href='#' links
|
||||
//----------------------------------
|
||||
|
||||
if ( mlinks[i] != null
|
||||
&& mlinks[i].href != null
|
||||
&& mlinks[i].href
|
||||
&& ( mlinks[i].href.indexOf( '#', 0 ) != (mlinks[i].href.length - 1) )
|
||||
)
|
||||
{
|
||||
mlinks[i].onmousedown = ips_menu_events.prototype.event_safari_onclick_handler;
|
||||
mlinks[i].id = 'saf-link-' + this.cid + i;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( error )
|
||||
{
|
||||
//alert( error );
|
||||
}
|
||||
}
|
||||
|
||||
if ( this.cid_obj.editor_id )
|
||||
{
|
||||
this.cid_obj.state = true;
|
||||
IPS_editor[this.cid_obj.editor_id].set_menu_context(this.cid_obj, 'mousedown');
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// ips_menu_class: Close a menu
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
ips_menu_class.prototype.close = function()
|
||||
{
|
||||
if ( this.cid_menu_obj != null )
|
||||
{
|
||||
this.cid_menu_obj.style.display = "none";
|
||||
}
|
||||
else if ( ipsmenu.menu_cur_open != null )
|
||||
{
|
||||
ipsmenu.menu_registered[ ipsmenu.menu_cur_open ].cid_menu_obj.style.display = 'none';
|
||||
}
|
||||
|
||||
ipsmenu.menu_cur_open = null;
|
||||
|
||||
if ( this.cid_obj )
|
||||
{
|
||||
if ( ipsmenu.menu_out_css[ this.cid_obj.id ] )
|
||||
{
|
||||
this.cid_obj.className = ipsmenu.menu_out_css[ this.cid_obj.id ];
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Workaround for IE bug which shows
|
||||
// select boxes and other windows GUI
|
||||
// over divs. Hide IFRAME
|
||||
//----------------------------------
|
||||
|
||||
if ( is_ie )
|
||||
{
|
||||
try
|
||||
{
|
||||
document.getElementById( 'if_' + this.cid ).style.display = "none";
|
||||
}
|
||||
catch(error)
|
||||
{
|
||||
//alert(e);// Oh dear, someones stolen the iframe
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// IPS Editor stuff
|
||||
//-----------------------------------------
|
||||
|
||||
if ( this.cid_obj.editor_id )
|
||||
{
|
||||
this.cid_obj.state = false;
|
||||
IPS_editor[ this.cid_obj.editor_id ].set_menu_context( this.cid_obj, 'mouseout' );
|
||||
}
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// ACTION: If menu open and hover over another cid, close cur open new
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
ips_menu_class.prototype.hover = function(e)
|
||||
{
|
||||
if ( ipsmenu.menu_cur_open != null )
|
||||
{
|
||||
if ( ipsmenu.menu_registered[ ipsmenu.menu_cur_open ].cid != this.id )
|
||||
{
|
||||
this.open(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// INIT: ips menu events
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function ips_menu_events()
|
||||
{
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Safari: bug fix
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
ips_menu_events.prototype.event_safari_onclick_handler = function()
|
||||
{
|
||||
if ( this.id )
|
||||
{
|
||||
window.location = document.getElementById( this.id ).href;
|
||||
}
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Event: On mouseover
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
ips_menu_events.prototype.event_onmouseover = function(e)
|
||||
{
|
||||
e = ipsclass.cancel_bubble(e, true);
|
||||
ipsmenu.menu_registered[ this.id ].hover(this);
|
||||
|
||||
if ( ipsmenu.menu_over_css[ this.id ] )
|
||||
{
|
||||
this.className = ipsmenu.menu_over_css[ this.id ];
|
||||
}
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Event: On mouseout
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
ips_menu_events.prototype.event_onmouseout = function(e)
|
||||
{
|
||||
e = ipsclass.cancel_bubble(e, true);
|
||||
|
||||
if ( ipsmenu.menu_out_css[ this.id ] && ipsmenu.menu_cur_open != this.id )
|
||||
{
|
||||
this.className = ipsmenu.menu_out_css[ this.id ];
|
||||
}
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Event: On click
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
ips_menu_events.prototype.event_onclick = function(e)
|
||||
{
|
||||
e = ipsclass.cancel_bubble(e, true);
|
||||
|
||||
if ( ipsmenu.menu_cur_open == null )
|
||||
{
|
||||
if ( ipsmenu.menu_over_css[ this.id ] )
|
||||
{
|
||||
this.className = ipsmenu.menu_over_css[ this.id ];
|
||||
}
|
||||
|
||||
ipsmenu.menu_registered[ this.id ].open(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
// For the RTE, if we click from font to size, for example
|
||||
// we want the menu to open...
|
||||
|
||||
//ipsmenu.menu_registered[ this.id ].close();
|
||||
|
||||
if ( ipsmenu.menu_cur_open == this.id )
|
||||
{
|
||||
ipsmenu.menu_registered[ this.id ].close();
|
||||
|
||||
if ( ipsmenu.menu_out_css[ this.id ] )
|
||||
{
|
||||
this.className = ipsmenu.menu_out_css[ this.id ];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( ipsmenu.menu_over_css[ this.id ] )
|
||||
{
|
||||
this.className = ipsmenu.menu_over_css[ this.id ];
|
||||
}
|
||||
|
||||
ipsmenu.menu_registered[ this.id ].open(this);
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Global INIT
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function menu_do_global_init()
|
||||
{
|
||||
//----------------------------------
|
||||
// Close all menus on click
|
||||
//----------------------------------
|
||||
|
||||
document.onclick = menu_action_close;
|
||||
|
||||
//----------------------------------
|
||||
// Write HTML
|
||||
//----------------------------------
|
||||
|
||||
if ( ipsmenu.dynamic_html != null && ipsmenu.dynamic_html != '' )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Register
|
||||
//----------------------------------
|
||||
|
||||
if ( ipsmenu.dynamic_register.length )
|
||||
{
|
||||
for( var i=0; i < ipsmenu.dynamic_register.length; i++ )
|
||||
{
|
||||
if ( ipsmenu.dynamic_register[i] )
|
||||
{
|
||||
ipsmenu.register( ipsmenu.dynamic_register[i] );
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Global: Close menus from any app
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function menu_action_close(e)
|
||||
{
|
||||
try {
|
||||
if( e.button == 2 || e.button == 3 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch( acold ) {};
|
||||
|
||||
ipsmenu.close(e);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,569 +0,0 @@
|
||||
//------------------------------------------
|
||||
// Invision Power Board v2
|
||||
// Text Editor Global Functions
|
||||
// (c) 2006 Invision Power Services, Inc.
|
||||
//
|
||||
// http://www.invisionboard.com
|
||||
//------------------------------------------
|
||||
|
||||
var _options_done = 0;
|
||||
|
||||
/**
|
||||
* Check side panel
|
||||
*
|
||||
* @param string Editor ID
|
||||
*/
|
||||
function check_side_panel( editor_id )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Remove side panel?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( global_rte_remove_side_panel )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Turn off button.
|
||||
//-----------------------------------------
|
||||
|
||||
document.getElementById( 'rte-toggle-side-panel-button' ).style.display = 'none';
|
||||
return true;
|
||||
}
|
||||
|
||||
var _open = global_rte_side_panel_open;
|
||||
var _cookie = ipsclass.my_getcookie( 'rte-sidepanel' );
|
||||
|
||||
if ( _cookie == 'open' || _cookie == 'close' )
|
||||
{
|
||||
_open = ( _cookie == 'open' ) ? 1 : 0;
|
||||
}
|
||||
|
||||
if ( _open )
|
||||
{
|
||||
show_options_panel( editor_id, _open );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Show more options panel
|
||||
*
|
||||
* @param string Editor ID
|
||||
*/
|
||||
function show_options_panel( editor_id, force, start_emo )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Remove side panel?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( global_rte_remove_side_panel )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Turn off button.
|
||||
//-----------------------------------------
|
||||
|
||||
document.getElementById( 'rte-toggle-side-panel-button' ).style.display = 'none';
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Set start..
|
||||
//-----------------------------------------
|
||||
|
||||
if ( typeof( start_emo ) == 'undefined' )
|
||||
{
|
||||
start_emo = 0;
|
||||
}
|
||||
|
||||
var _editor = document.getElementById( editor_id + '_main-bar' );
|
||||
var _options = document.getElementById( editor_id + '_options-bar' );
|
||||
var _height = parseInt( _editor.offsetHeight );
|
||||
var _mode = 'open';
|
||||
var _more_less = '';
|
||||
|
||||
//-----------------------------------------
|
||||
// Clear out content
|
||||
//-----------------------------------------
|
||||
|
||||
_options.innerHTML = '';
|
||||
|
||||
//-----------------------------------------
|
||||
// Opening or closing?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( typeof( force ) != 'undefined' )
|
||||
{
|
||||
_mode = ( force == 1 ) ? 'open' : 'close';
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( _options._panel_open )
|
||||
{
|
||||
_mode = 'close';
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Set cookie
|
||||
//-----------------------------------------
|
||||
|
||||
ipsclass.my_setcookie( 'rte-sidepanel', _mode, 1 );
|
||||
|
||||
//-----------------------------------------
|
||||
// OPEN: Adjust editor to make room
|
||||
//-----------------------------------------
|
||||
|
||||
if( _mode == 'open' && _options_done == 1 )
|
||||
{
|
||||
_editor.style.width = '80%';
|
||||
|
||||
_options.style.width = 'auto';
|
||||
_options.style.height = 'auto';
|
||||
_options.style.display = 'block';
|
||||
_options._panel_open = 1;
|
||||
|
||||
document.getElementById( editor_id + '_spacer-bar' ).style.width = '4px';
|
||||
}
|
||||
if ( _mode == 'open' )
|
||||
{
|
||||
_editor.style.width = '80%';
|
||||
|
||||
if( is_opera )
|
||||
{
|
||||
_editor.style.width = '100%';
|
||||
_editor.style.display = 'block';
|
||||
}
|
||||
|
||||
_options.style.width = 'auto';
|
||||
_options.style.height = 'auto';
|
||||
_options.style.display = 'block';
|
||||
_options._panel_open = 1;
|
||||
|
||||
document.getElementById( editor_id + '_spacer-bar' ).style.width = '4px';
|
||||
|
||||
//-----------------------------------------
|
||||
// Build emoticons...
|
||||
//-----------------------------------------
|
||||
|
||||
var _main_div = document.createElement( 'div' );
|
||||
|
||||
_main_div.className = 'rte-option-emo-box';
|
||||
_main_div.style.width = '90%';
|
||||
|
||||
_main_div.innerHTML += '<div class="rte-menu-emo-header"><a href="#" style="text-decoration:none" onclick="return show_all_emoticons(\'' + editor_id + '\')">' + ips_language_array['emos_show_all'] + '</a></div>';
|
||||
|
||||
var _div = document.createElement( 'div' );
|
||||
_div.style.width = '100%';
|
||||
_div.style.height = '120px';
|
||||
_div.style.overflow = 'auto';
|
||||
_div.style.overflowY = 'auto';
|
||||
_div.style.overflowX = 'auto';
|
||||
|
||||
|
||||
var table = document.createElement('table');
|
||||
table.cellPadding = 0;
|
||||
table.cellSpacing = 0;
|
||||
table.border = 0;
|
||||
table.width = '99%';
|
||||
|
||||
|
||||
var i = 0;
|
||||
var perrow = 3;
|
||||
var show_emos = 12;
|
||||
var show_rows = show_emos / perrow;
|
||||
var max_emos = 0;
|
||||
var _previous = 0;
|
||||
var _next = 0;
|
||||
|
||||
//-----------------------------------------
|
||||
// Get max. emos
|
||||
//-----------------------------------------
|
||||
|
||||
for( var emo in ips_smilie_items )
|
||||
{
|
||||
max_emos++;
|
||||
}
|
||||
|
||||
for( var emo in ips_smilie_items )
|
||||
{
|
||||
var _tmp = ips_smilie_items[ emo ].split( "," );
|
||||
var _id = _tmp[0] - 1;
|
||||
|
||||
if ( _id < start_emo || _id >= ( show_emos + start_emo ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( i % perrow == 0 )
|
||||
{
|
||||
var tr = table.insertRow(-1);
|
||||
}
|
||||
|
||||
i++;
|
||||
|
||||
var div = document.createElement('div');
|
||||
var img = '<img src="' + global_rte_emoticons_url + '/' + _tmp[1] + '" style="vertical-align:middle" border="0" id="smid_' + _tmp[0] + '" /> ';
|
||||
div.innerHTML = img;
|
||||
|
||||
var td = tr.insertCell(-1);
|
||||
td.width = '33%';
|
||||
td.align = 'center';
|
||||
td.className = 'rte-menu-emo-box';
|
||||
td.appendChild(div);
|
||||
|
||||
td.cmd = 'emoticons';
|
||||
td.editor_id = editor_id;
|
||||
td.id = editor_id + '_emoticon_' + _tmp[0];
|
||||
td.emo_id = _tmp[0];
|
||||
td.emo_image = _tmp[1];
|
||||
td.emo_code = emo;
|
||||
td.onclick = ips_editor_events.prototype.emoticon_onclick;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// More?
|
||||
//-----------------------------------------
|
||||
|
||||
_div.appendChild( table );
|
||||
_main_div.appendChild( _div );
|
||||
|
||||
if ( start_emo > 0 )
|
||||
{
|
||||
if ( start_emo + i < max_emos )
|
||||
{
|
||||
_previous = start_emo - show_emos;
|
||||
}
|
||||
else
|
||||
{
|
||||
_previous = start_emo - show_emos;
|
||||
}
|
||||
|
||||
_more_less = '<div style="float:left"><a href="#" style="text-decoration:none" onclick="return show_options_panel(\'' + editor_id + '\', ' + '1' + ',' + _previous + ')">' + ips_language_array['emos_show_prev'] + '</a></div>';
|
||||
}
|
||||
|
||||
if ( show_emos + start_emo < max_emos )
|
||||
{
|
||||
if ( start_emo < 1 )
|
||||
{
|
||||
_next = start_emo + show_emos;
|
||||
}
|
||||
else
|
||||
{
|
||||
_next = start_emo + show_emos;
|
||||
}
|
||||
|
||||
_more_less += '<div style="float:right"><a href="#" style="text-decoration:none" onclick="return show_options_panel(\'' + editor_id + '\', ' + '1' + ',' + _next + ');">' + ips_language_array['emos_show_next'] + '</a></div>';
|
||||
}
|
||||
|
||||
if ( _more_less )
|
||||
{
|
||||
var _div = document.createElement('div');
|
||||
_div.className = "rte-menu-emo-header";
|
||||
_div.style.height = '17px';
|
||||
_div.innerHTML = _more_less;
|
||||
|
||||
_main_div.appendChild( _div );
|
||||
}
|
||||
|
||||
_options.appendChild( _main_div );
|
||||
|
||||
//-----------------------------------------
|
||||
// Special Items
|
||||
//-----------------------------------------
|
||||
|
||||
var _main_div = document.createElement( 'div' );
|
||||
|
||||
_main_div.className = 'rte-option-emo-box';
|
||||
_main_div.style.width = '90%';
|
||||
|
||||
_main_div.innerHTML += '<div class="rte-menu-emo-header">'+ips_language_array['ed_quick_access']+'</div>';
|
||||
|
||||
var _div = document.createElement( 'div' );
|
||||
_div.style.width = '100%';
|
||||
|
||||
|
||||
var table = document.createElement('table');
|
||||
table.cellPadding = 0;
|
||||
table.cellSpacing = 0;
|
||||
table.border = 0;
|
||||
table.width = '99%';
|
||||
|
||||
var i = 0;
|
||||
var perrow = 3;
|
||||
|
||||
for( var i in IPS_editor[ editor_id ].ips_special_items )
|
||||
{
|
||||
var tr = table.insertRow(-1);
|
||||
var option = tr.insertCell(-1);
|
||||
var img = ( typeof IPS_editor[ editor_id ].ips_special_items[i][1] != 'undefined' ) ? '<img src="' + global_rte_images_url + IPS_editor[ editor_id ].ips_special_items[i][1] + '" style="vertical-align:middle" border="" /> ' : '';
|
||||
option.innerHTML = img + IPS_editor[ editor_id ].ips_special_items[i][0];
|
||||
option.className = 'rte-menu-face';
|
||||
option.style.textAlign = 'left';
|
||||
option.style.paddingLeft = '2px';
|
||||
option.cmd = 'module_load',
|
||||
option.loader_key = i.replace( 'cmd_loader_', '' );
|
||||
option.editor_id = editor_id;
|
||||
option.onmouseover = option.onclick = option.onmouseout = option.onmouseup = option.onmousedown = ips_editor_events.prototype.special_onmouse_event;
|
||||
}
|
||||
|
||||
_div.appendChild( table );
|
||||
_main_div.appendChild( _div );
|
||||
_options.appendChild( _main_div );
|
||||
|
||||
_options_done = 1;
|
||||
|
||||
ipsclass.set_unselectable( _options );
|
||||
}
|
||||
else
|
||||
{
|
||||
_editor.style.width = '100%';
|
||||
|
||||
document.getElementById( editor_id + '_spacer-bar' ).style.width = '0px';
|
||||
|
||||
_options.style.width = '0px';
|
||||
_options.style.display = 'none';
|
||||
_options._panel_open = 0;
|
||||
//_options.innerHTML = '';
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Switch between STD and RTE editors on the fly
|
||||
*
|
||||
* @param string Editor ID
|
||||
*/
|
||||
function switch_editor_mode( editor_id )
|
||||
{
|
||||
//----------------------------------
|
||||
// INIT
|
||||
//----------------------------------
|
||||
|
||||
var url = ipb_var_base_url+'act=xmlout&do=post-editorswitch';
|
||||
var fields = new Array();
|
||||
|
||||
if ( use_enhanced_js )
|
||||
{
|
||||
var new_mode = IPS_editor[ editor_id ].is_rte ? 0 : 1;
|
||||
|
||||
if ( IPS_editor[ editor_id ].is_loading )
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
IPS_editor[ editor_id ].is_loading = 1;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Close menus
|
||||
//-----------------------------------------
|
||||
|
||||
if ( typeof( ipsmenu ) != 'undefined' )
|
||||
{
|
||||
ipsmenu.close();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Collect Info
|
||||
//-----------------------------------------
|
||||
|
||||
var _file_path = IPS_editor[ editor_id ].file_path;
|
||||
var _is_ie = IPS_editor[ editor_id ].is_ie;
|
||||
var _is_moz = IPS_editor[ editor_id ].is_moz;
|
||||
|
||||
//----------------------------------
|
||||
// Populate fields
|
||||
//----------------------------------
|
||||
|
||||
fields['md5check'] = ipb_md5_check;
|
||||
fields['act'] = 'xmlout';
|
||||
fields['do'] = 'post-editorswitch';
|
||||
fields['to_rte'] = new_mode;
|
||||
fields['Post'] = IPS_editor[ editor_id ].editor_get_contents();
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Main function to do on request
|
||||
// Must be defined first!!
|
||||
/*--------------------------------------------*/
|
||||
|
||||
do_request_function = function()
|
||||
{
|
||||
//----------------------------------
|
||||
// Ignore unless we're ready to go
|
||||
//----------------------------------
|
||||
|
||||
if ( ! xmlobj.readystate_ready_and_ok() )
|
||||
{
|
||||
xmlobj.show_loading();
|
||||
return;
|
||||
}
|
||||
|
||||
xmlobj.hide_loading();
|
||||
|
||||
//-----------------------------------------
|
||||
// Kill editor
|
||||
//-----------------------------------------
|
||||
|
||||
IPS_editor[ editor_id ].destruct();
|
||||
|
||||
//----------------------------------
|
||||
// INIT
|
||||
//----------------------------------
|
||||
|
||||
var text = xmlobj.xmlhandler.responseText;
|
||||
|
||||
var matches = text.match( /&#([0-9]+);/g );
|
||||
|
||||
if ( matches )
|
||||
{
|
||||
for ( var i = 0; typeof( matches[i] ) != 'undefined'; i++ )
|
||||
{
|
||||
if ( sm = matches[i].match( /^&#([0-9]+);$/ ) )
|
||||
{
|
||||
text = text.replace( sm[0], String.fromCharCode(sm[1]) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
text = text.replace( /&(lt|gt|quot);/ig, "&$1;" );
|
||||
text = text.replace( /"/g, '"' );
|
||||
|
||||
// Fix emoticons for ACP
|
||||
text = text.replace( /([^\/])style_emoticons\/$1([a-zA-Z0-9]+)/ig, global_rte_emoticons_url );
|
||||
|
||||
//-----------------------------------------
|
||||
// BBCode specific fixes
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! new_mode )
|
||||
{
|
||||
// Move closing tags on a new line up one
|
||||
text = text.replace( /(?:\n|\r){1,}(\[\/\w{1,}\])/g, "$1" );
|
||||
|
||||
// Make sure list bullets are on a new line
|
||||
text = text.replace( /(\S{1})\[\*\]/g, "$1\n[*]" );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get rid of old thing
|
||||
//-----------------------------------------
|
||||
|
||||
IPS_editor[ editor_id ] = null;
|
||||
|
||||
//-----------------------------------------
|
||||
// INIT New
|
||||
//-----------------------------------------
|
||||
|
||||
IPS_editor[ editor_id ] = new ips_text_editor( editor_id, new_mode, new_mode == 1 ? 0 : 1, _file_path, text );
|
||||
|
||||
//-----------------------------------------
|
||||
// Other set up
|
||||
//-----------------------------------------
|
||||
|
||||
// Set up defaults
|
||||
IPS_editor[ editor_id ].allow_advanced = 0;
|
||||
IPS_editor[ editor_id ].forum_fix_ie_newlines = 1;
|
||||
|
||||
// Add bbcode items
|
||||
for( var i in ips_bbcode_items )
|
||||
{
|
||||
IPS_editor[ editor_id ].module_add_item( 'bbcodeloader{id=' + i + '}', ips_language_array['insert_prefix'] + ": " + ips_bbcode_items[ i ]['title'] , 'rte-ipd-tag.png' );
|
||||
}
|
||||
|
||||
IPS_editor[ editor_id ].editor_check_focus();
|
||||
|
||||
//-----------------------------------------
|
||||
// Fix up forms
|
||||
//-----------------------------------------
|
||||
|
||||
document.getElementById( editor_id + '_wysiwyg_used' ).value = new_mode;
|
||||
};
|
||||
|
||||
//----------------------------------
|
||||
// LOAD XML
|
||||
//----------------------------------
|
||||
|
||||
xmlobj = new ajax_request();
|
||||
xmlobj.onreadystatechange( do_request_function );
|
||||
var xmlreturn = xmlobj.process( url, 'POST', xmlobj.format_for_post(fields) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show all emoticons
|
||||
*
|
||||
* @param string Editor ID
|
||||
*/
|
||||
function show_all_emoticons( editor_id )
|
||||
{
|
||||
IPS_editor[ editor_id ].emoticon_window_id = window.open( ipb_var_base_url + "act=legends&CODE=emoticons&editor_id=" + editor_id,"Legends","width=250,height=500,resizable=yes,scrollbars=yes");
|
||||
|
||||
menu_action_close();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show BBCode pop-up
|
||||
*
|
||||
*/
|
||||
function bbc_pop()
|
||||
{
|
||||
window.open( ipb_var_base_url + "act=legends&CODE=bbcode","Legends","width=700,height=500,resizable=yes,scrollbars=yes");
|
||||
}
|
||||
|
||||
/**
|
||||
* Legacy code validate form
|
||||
*
|
||||
*/
|
||||
function ValidateForm()
|
||||
{
|
||||
return validate_form();
|
||||
}
|
||||
|
||||
/**
|
||||
* IPB specific.
|
||||
*
|
||||
*/
|
||||
function validate_form()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Check for uploads...
|
||||
//-----------------------------------------
|
||||
|
||||
try
|
||||
{
|
||||
if ( ipsattach.has_upload_pending )
|
||||
{
|
||||
if ( confirm( ipb_global_lang['post_upload_not_empty'] ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
}
|
||||
|
||||
for ( var i in IPS_editor )
|
||||
{
|
||||
if( typeof( IPS_editor[i] ) != 'object' )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var return_var = IPS_editor[ i ].update_for_form_submit();
|
||||
|
||||
if ( return_var == false )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1,819 +0,0 @@
|
||||
//------------------------------------------
|
||||
// Invision Power Board v2
|
||||
// Text Editor Lite
|
||||
// (c) 2006 Invision Power Services, Inc.
|
||||
//
|
||||
// http://www.invisionboard.com
|
||||
//------------------------------------------
|
||||
|
||||
var IPS_Lite_Editor = new Array();
|
||||
|
||||
/**
|
||||
* Text editor lite!
|
||||
*
|
||||
* @param string Editor ID
|
||||
*/
|
||||
function ips_text_editor_lite( editor_id )
|
||||
{
|
||||
this.editor_id = editor_id;
|
||||
this.control_obj = document.getElementById( editor_id + '-controls' );
|
||||
this.initialized = false;
|
||||
this.buttons = new Array();
|
||||
this.fonts = new Array();
|
||||
this.state = new Array();
|
||||
this.text_obj = document.getElementById( this.editor_id + '_textarea' );
|
||||
this.open_brace = '[';
|
||||
this.close_brace = ']';
|
||||
this.editor_document = this.text_obj;
|
||||
this.editor_window = this.editor_document;
|
||||
this._ie_cache = null;
|
||||
this.is_ie = is_ie;
|
||||
this.is_moz = is_moz;
|
||||
this.is_opera = is_opera;
|
||||
this.has_focus = false;
|
||||
this.emoticon_window_id = null;
|
||||
|
||||
//-----------------------------------------
|
||||
// Do some set up
|
||||
//-----------------------------------------
|
||||
|
||||
this.init = function()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
var controls = new Array();
|
||||
|
||||
if ( ! this.control_obj )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Grab all buttons
|
||||
// 2 step 'cos moz goes into infinite loop otherwise
|
||||
//-----------------------------------------
|
||||
|
||||
var items = this.control_obj.getElementsByTagName("DIV");
|
||||
|
||||
for ( var i = 0 ; i < items.length ; i++ )
|
||||
{
|
||||
if ( ( items[i].className == 'rte-normal' || items[i].className == 'rte-menu-button' || items[i].className == 'rte-normal-menubutton' ) && items[i].id )
|
||||
{
|
||||
controls[ controls.length ] = items[i].id;
|
||||
}
|
||||
}
|
||||
|
||||
for ( var i = 0 ; i < controls.length ; i++ )
|
||||
{
|
||||
var control = document.getElementById( controls[i] );
|
||||
|
||||
if ( control.className == 'rte-normal' )
|
||||
{
|
||||
this.init_editor_button( control );
|
||||
}
|
||||
else if ( control.className == 'rte-menu-button' || control.className == 'rte-normal-menubutton' )
|
||||
{
|
||||
this.init_editor_popup_button( control );
|
||||
}
|
||||
}
|
||||
|
||||
//ipsclass.set_unselectable( this.control_obj );
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up focus
|
||||
//-----------------------------------------
|
||||
|
||||
this.text_obj.onfocus = ips_editor_events.prototype.editor_window_onfocus;
|
||||
this.text_obj.onblur = ips_editor_events.prototype.editor_window_onblur;
|
||||
|
||||
if ( this.editor_document.addEventListener )
|
||||
{
|
||||
this.editor_document.addEventListener('keypress', ips_editor_events.prototype.editor_document_onkeypress, false);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Refocus editor check
|
||||
*/
|
||||
this.editor_check_focus = function()
|
||||
{
|
||||
if ( ! this.text_obj.has_focus )
|
||||
{
|
||||
if ( this.is_opera )
|
||||
{
|
||||
this.text_obj.focus();
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
this.text_obj.focus();
|
||||
}
|
||||
catch(err)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
/**
|
||||
* INIT Editor Button
|
||||
* Initialize an editor button (bold, italic, etc)
|
||||
*
|
||||
* @param object Button DIV object
|
||||
*/
|
||||
this.init_editor_button = function( obj )
|
||||
{
|
||||
obj.cmd = obj.id.replace( new RegExp( '^' + this.editor_id + '_cmd_(.+?)$' ), '$1' );
|
||||
obj.editor_id = this.editor_id;
|
||||
|
||||
//-----------------------------------------
|
||||
// Add to buttons array
|
||||
//-----------------------------------------
|
||||
|
||||
this.buttons[ obj.cmd ] = obj;
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up defaults
|
||||
//-----------------------------------------
|
||||
|
||||
obj.state = false;
|
||||
obj.mode = 'normal';
|
||||
obj.real_type = 'button';
|
||||
|
||||
obj.onclick = ips_editor_events.prototype.button_onmouse_event;
|
||||
obj.onmousedown = ips_editor_events.prototype.button_onmouse_event;
|
||||
obj.onmouseover = ips_editor_events.prototype.button_onmouse_event;
|
||||
obj.onmouseout = ips_editor_events.prototype.button_onmouse_event;
|
||||
};
|
||||
|
||||
/**
|
||||
* Toggle button context
|
||||
* Toggles the menu's class for mouseover, select, etc
|
||||
*
|
||||
* @param object menu object
|
||||
* @param object state
|
||||
* @param object type
|
||||
*/
|
||||
this.set_button_context = function(obj, state, type)
|
||||
{
|
||||
if (typeof type == 'undefined')
|
||||
{
|
||||
type = 'button';
|
||||
}
|
||||
|
||||
switch (obj.state)
|
||||
{
|
||||
case true:
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case 'mouseout':
|
||||
{
|
||||
this.editor_set_ctl_style(obj, 'button', 'selected');
|
||||
break;
|
||||
}
|
||||
case 'mouseover':
|
||||
case 'mousedown':
|
||||
case 'mouseup':
|
||||
{
|
||||
this.editor_set_ctl_style(obj, type, 'down');
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case 'mouseout':
|
||||
{
|
||||
this.editor_set_ctl_style(obj, type, 'normal');
|
||||
break;
|
||||
}
|
||||
case 'mousedown':
|
||||
{
|
||||
this.editor_set_ctl_style(obj, type, 'down');
|
||||
break;
|
||||
}
|
||||
case 'mouseover':
|
||||
case 'mouseup':
|
||||
{
|
||||
this.editor_set_ctl_style(obj, type, 'hover');
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Sets the editor button control style
|
||||
*
|
||||
* @var object Button Object
|
||||
* @var string Control Type
|
||||
* @var string Control Mode
|
||||
*/
|
||||
this.editor_set_ctl_style = function( obj, type, mode )
|
||||
{
|
||||
if ( obj.mode != mode )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Add in -menu class
|
||||
//-----------------------------------------
|
||||
|
||||
var extra = '';
|
||||
|
||||
if ( type == 'menu' )
|
||||
{
|
||||
extra = '-menu';
|
||||
}
|
||||
else if ( type == 'menubutton' )
|
||||
{
|
||||
extra = '-menubutton';
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Add in -color if it's a color box
|
||||
//-----------------------------------------
|
||||
|
||||
extra += obj.colorname ? '-color' : '';
|
||||
|
||||
//-----------------------------------------
|
||||
// Add in -emo if it's an emo
|
||||
//-----------------------------------------
|
||||
|
||||
extra += obj.emo_id ? '-emo' : '';
|
||||
|
||||
//-----------------------------------------
|
||||
// Set mote...
|
||||
//-----------------------------------------
|
||||
|
||||
obj.mode = mode;
|
||||
|
||||
try
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
case "normal":
|
||||
{
|
||||
// Normal
|
||||
obj.className = 'rte-normal' + extra;
|
||||
}
|
||||
break;
|
||||
|
||||
case "hover":
|
||||
{
|
||||
// Hover
|
||||
obj.className = 'rte-hover' + extra;
|
||||
}
|
||||
break;
|
||||
|
||||
case "selected":
|
||||
case "down":
|
||||
{
|
||||
// On
|
||||
obj.className = 'rte-selected' + extra;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Format Text
|
||||
*
|
||||
* @var event Event Object
|
||||
* @var string Formatted command
|
||||
* @var string Formatting command extra
|
||||
*/
|
||||
this.format_text = function(e, command, arg)
|
||||
{
|
||||
e = ipsclass.cancel_bubble( e, true );
|
||||
|
||||
//-----------------------------------------
|
||||
// Special considerations...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( command.match( /resize_/ ) )
|
||||
{
|
||||
this.resize_editorbox( command.replace( /.+?resize_(up|down)/, "$1" ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Special considerations...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( command.match( /emoticon/ ) )
|
||||
{
|
||||
this.show_all_emoticons();
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Continue...
|
||||
//-----------------------------------------
|
||||
|
||||
this.editor_check_focus();
|
||||
|
||||
if ( this[ command ] )
|
||||
{
|
||||
var return_val = this[ command ](e);
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
var return_val = this.apply_formatting( command, false, (typeof arg == 'undefined' ? true : arg) );
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
var return_val = false;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Check focus
|
||||
//-----------------------------------------
|
||||
|
||||
this.editor_check_focus();
|
||||
|
||||
return return_val;
|
||||
};
|
||||
|
||||
/**
|
||||
* STD:
|
||||
* Create link override
|
||||
*/
|
||||
this.createlink = function()
|
||||
{
|
||||
var _url = prompt( ipb_global_lang['editor_enter_url'], 'http://' );
|
||||
|
||||
if ( ! _url || _url == null || _url == 'http://' )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var _text = this.get_selection();
|
||||
_text = _text ? _text : prompt( ipb_global_lang['editor_enter_title'] );
|
||||
|
||||
if( !_text || _text == null )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
this.wrap_tags( 'url', _url, _text);
|
||||
};
|
||||
|
||||
/**
|
||||
* STD:
|
||||
* Insert image override
|
||||
*/
|
||||
this.insertimage = function()
|
||||
{
|
||||
var _text = this.get_selection();
|
||||
var _url = prompt( ipb_global_lang['editor_enter_image'], _text ? _text : "http://" );
|
||||
|
||||
if( !_url || _url == null || _url == 'http://' )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
this.wrap_tags( 'img', false, _url );
|
||||
};
|
||||
|
||||
/**
|
||||
* STD:
|
||||
* IPB Quote override
|
||||
*/
|
||||
this.ipb_quote = function()
|
||||
{
|
||||
var _text = this.get_selection();
|
||||
this.wrap_tags( 'quote', false, _text );
|
||||
};
|
||||
|
||||
/**
|
||||
* STD:
|
||||
* IPB code override
|
||||
*/
|
||||
this.ipb_code = function()
|
||||
{
|
||||
var _text = this.get_selection();
|
||||
this.wrap_tags( 'code', false, _text );
|
||||
};
|
||||
|
||||
/**
|
||||
* STD:
|
||||
* Apply formatting
|
||||
*/
|
||||
this.apply_formatting = function(cmd, dialog, argument)
|
||||
{
|
||||
// undo & redo array pops
|
||||
|
||||
switch (cmd)
|
||||
{
|
||||
case 'bold':
|
||||
case 'italic':
|
||||
case 'underline':
|
||||
{
|
||||
this.wrap_tags(cmd.substr(0, 1), false);
|
||||
return;
|
||||
}
|
||||
|
||||
case 'justifyleft':
|
||||
case 'justifycenter':
|
||||
case 'justifyright':
|
||||
{
|
||||
this.wrap_tags(cmd.substr(7), false);
|
||||
return;
|
||||
}
|
||||
|
||||
case 'indent':
|
||||
{
|
||||
this.wrap_tags(cmd, false);
|
||||
return;
|
||||
}
|
||||
|
||||
case 'createlink':
|
||||
{
|
||||
var sel = this.get_selection();
|
||||
|
||||
if (sel)
|
||||
{
|
||||
this.wrap_tags('url', argument);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.wrap_tags('url', argument, argument);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
case 'fontname':
|
||||
{
|
||||
this.wrap_tags('font', argument);
|
||||
return;
|
||||
}
|
||||
|
||||
case 'fontsize':
|
||||
{
|
||||
this.wrap_tags('size', argument);
|
||||
return;
|
||||
}
|
||||
|
||||
case 'forecolor':
|
||||
{
|
||||
this.wrap_tags('color', argument);
|
||||
return;
|
||||
}
|
||||
|
||||
case 'backcolor':
|
||||
{
|
||||
this.wrap_tags('background', argument);
|
||||
return;
|
||||
}
|
||||
|
||||
case 'insertimage':
|
||||
{
|
||||
this.wrap_tags('img', false, argument);
|
||||
return;
|
||||
}
|
||||
|
||||
case 'strikethrough':
|
||||
{
|
||||
this.wrap_tags('strike', false);
|
||||
return;
|
||||
}
|
||||
|
||||
case 'superscript':
|
||||
{
|
||||
this.wrap_tags('sup', false);
|
||||
return;
|
||||
}
|
||||
|
||||
case 'subscript':
|
||||
{
|
||||
this.wrap_tags('sub', false);
|
||||
return;
|
||||
}
|
||||
|
||||
case 'removeformat':
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Wrap Tags
|
||||
*
|
||||
* @param string Tag to wrap
|
||||
* @param boolean Has optional params
|
||||
* @param string Selected Text
|
||||
*/
|
||||
this.wrap_tags = function(tag_name, has_option, selected_text)
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Fix up for HTML use
|
||||
//-----------------------------------------
|
||||
|
||||
var tag_close = tag_name;
|
||||
|
||||
//-----------------------------------------
|
||||
// Got selected text?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( typeof selected_text == 'undefined' )
|
||||
{
|
||||
selected_text = this.get_selection();
|
||||
|
||||
selected_text = (selected_text === false) ? '' : new String(selected_text);
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Using option?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( has_option === true )
|
||||
{
|
||||
var option = prompt( ips_language_array['js_rte_optionals'] ? ips_language_array['js_rte_optionals'] : "Enter the optional arguments for this tag", '');
|
||||
|
||||
if ( option )
|
||||
{
|
||||
var opentag = this.open_brace + tag_name + '="' + option + '"' + this.close_brace;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if ( has_option !== false )
|
||||
{
|
||||
var opentag = this.open_brace + tag_name + '="' + has_option + '"' + this.close_brace;
|
||||
}
|
||||
else
|
||||
{
|
||||
var opentag = this.open_brace + tag_name + this.close_brace;
|
||||
}
|
||||
|
||||
var closetag = this.open_brace + '/' + tag_close + this.close_brace;
|
||||
|
||||
var text = opentag + selected_text + closetag;
|
||||
|
||||
this.insert_text( text );
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Wrap tag: Lite
|
||||
* Quick method of below
|
||||
*
|
||||
* @param string Start text
|
||||
* @param string Close text
|
||||
*/
|
||||
this.wrap_tags_lite = function( start_text, close_text )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Got selected text?
|
||||
//-----------------------------------------
|
||||
|
||||
selected_text = this.get_selection();
|
||||
selected_text = (selected_text === false) ? '' : new String(selected_text);
|
||||
|
||||
this.insert_text( start_text + selected_text + close_text );
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
/**
|
||||
* STD:
|
||||
* Get Editor Contents
|
||||
*/
|
||||
this.editor_get_contents = function()
|
||||
{
|
||||
return this.editor_document.value;
|
||||
};
|
||||
|
||||
/**
|
||||
* STD:
|
||||
* Get Selected Text
|
||||
*/
|
||||
this.get_selection = function()
|
||||
{
|
||||
if ( typeof(this.editor_document.selectionStart) != 'undefined' )
|
||||
{
|
||||
return this.editor_document.value.substr(this.editor_document.selectionStart, this.editor_document.selectionEnd - this.editor_document.selectionStart);
|
||||
}
|
||||
else if ( ( document.selection && document.selection.createRange ) || this._ie_cache )
|
||||
{
|
||||
return this._ie_cache ? this._ie_cache.text : document.selection.createRange().text;
|
||||
}
|
||||
else if ( window.getSelection )
|
||||
{
|
||||
return window.getSelection() + '';
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* STD:
|
||||
* Insert HTML
|
||||
*/
|
||||
this.insert_text = function(text)
|
||||
{
|
||||
if( this.editor_check_focus() == false )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (typeof(this.editor_document.selectionStart) != 'undefined')
|
||||
{
|
||||
var open = this.editor_document.selectionStart + 0;
|
||||
var st = this.editor_document.scrollTop;
|
||||
|
||||
this.editor_document.value = this.editor_document.value.substr(0, this.editor_document.selectionStart) + text + this.editor_document.value.substr(this.editor_document.selectionEnd);
|
||||
|
||||
// Don't adjust selection if we're simply adding <b></b>, etc
|
||||
if ( ! text.match( new RegExp( "\\" + this.open_brace + "(\\S+?)" + "\\" + this.close_brace + "\\" + this.open_brace + "/(\\S+?)" + "\\" + this.close_brace ) ) )
|
||||
{
|
||||
this.editor_document.selectionStart = open;
|
||||
this.editor_document.selectionEnd = open + text.length;
|
||||
this.editor_document.scrollTop = st;
|
||||
}
|
||||
}
|
||||
else if ( ( document.selection && document.selection.createRange ) || this._ie_cache )
|
||||
{
|
||||
var sel = this._ie_cache ? this._ie_cache : document.selection.createRange();
|
||||
sel.text = text.replace(/\r?\n/g, '\r\n');
|
||||
sel.select();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.editor_document.value += text;
|
||||
}
|
||||
|
||||
this._ie_cache = null;
|
||||
};
|
||||
|
||||
/**
|
||||
* Show all emoticons
|
||||
*
|
||||
* @param string Editor ID
|
||||
*/
|
||||
this.show_all_emoticons = function()
|
||||
{
|
||||
if ( typeof( this.emoticon_window_id ) != null )
|
||||
{
|
||||
this.emoticon_window_id = window.open( ipb_var_base_url + "act=legends&CODE=emoticons&_lite=1&editor_id=" + editor_id,"Legends","width=250,height=500,resizable=yes,scrollbars=yes");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.emoticon_window_id.focus();
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
/**
|
||||
* STD:
|
||||
* Insert an emoticon
|
||||
*/
|
||||
this.insert_emoticon = function( emo_id, emo_image, emo_code, event )
|
||||
{
|
||||
emo_code = ipsclass.un_htmlspecialchars( emo_code );
|
||||
|
||||
this.wrap_tags_lite( " " + emo_code, " ");
|
||||
|
||||
if ( this.is_ie )
|
||||
{
|
||||
if ( IPS_Lite_Editor[ this.editor_id ].emoticon_window_id != '' && typeof( IPS_Lite_Editor[ this.editor_id ].emoticon_window_id ) != 'undefined' )
|
||||
{
|
||||
IPS_Lite_Editor[ this.editor_id ].emoticon_window_id.focus();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Resize editor
|
||||
*
|
||||
* @param string Up (smaller) Down (Larger)
|
||||
*/
|
||||
|
||||
this.resize_editorbox = function( direction )
|
||||
{
|
||||
var inc_value = 100;
|
||||
var current_height = parseInt( this.text_obj.style.height );
|
||||
var new_height = 0;
|
||||
current_height = current_height ? current_height : 200;
|
||||
|
||||
//-----------------------------------------
|
||||
// If we're not going smaller than 300...
|
||||
//-----------------------------------------
|
||||
|
||||
if ( current_height >= 50 )
|
||||
{
|
||||
if ( direction == 'up' )
|
||||
{
|
||||
new_height = current_height - inc_value;
|
||||
}
|
||||
else
|
||||
{
|
||||
new_height = current_height + inc_value;
|
||||
}
|
||||
|
||||
if ( new_height > 149 )
|
||||
{
|
||||
this.text_obj.style.height = new_height + 'px';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
// =============================================================================
|
||||
// Text editor event functions
|
||||
// =============================================================================
|
||||
|
||||
/**
|
||||
* Class initialization
|
||||
*/
|
||||
function ips_editor_events()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles mouse events for buttons
|
||||
*
|
||||
* @param event Event Object
|
||||
*/
|
||||
ips_editor_events.prototype.button_onmouse_event = function(e)
|
||||
{
|
||||
if ( is_ie )
|
||||
{
|
||||
e = ipsclass.cancel_bubble(e, true);
|
||||
}
|
||||
|
||||
if ( e.type == 'click' )
|
||||
{
|
||||
IPS_Lite_Editor[this.editor_id].format_text(e, this.cmd, false, true);
|
||||
}
|
||||
|
||||
IPS_Lite_Editor[this.editor_id].set_button_context(this, e.type);
|
||||
};
|
||||
|
||||
/**
|
||||
* Sets the focus for the editor window
|
||||
*
|
||||
* @param event Event Object
|
||||
*/
|
||||
ips_editor_events.prototype.editor_window_onfocus = function(e)
|
||||
{
|
||||
this.has_focus = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* Sets unfocus for the editor window
|
||||
*
|
||||
* @param event Event Object
|
||||
*/
|
||||
|
||||
ips_editor_events.prototype.editor_window_onblur = function(e)
|
||||
{
|
||||
this.has_focus = false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Handles editor document key-press event
|
||||
*
|
||||
* @param event Event Object
|
||||
*/
|
||||
ips_editor_events.prototype.editor_document_onkeypress = function(e)
|
||||
{
|
||||
if ( e.ctrlKey )
|
||||
{
|
||||
switch (String.fromCharCode(e.charCode).toLowerCase())
|
||||
{
|
||||
case 'b': cmd = 'bold'; break;
|
||||
case 'i': cmd = 'italic'; break;
|
||||
case 'u': cmd = 'underline'; break;
|
||||
default: return;
|
||||
}
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
IPS_Lite_Editor[this.editor_id].apply_formatting(cmd, false, null);
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
@@ -1,397 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// IPS XML HTTP REQUEST
|
||||
//------------------------------------------------------------------------------
|
||||
// Supports Safari, Mozilla 1.3+ (Firefox, etc) and IE 5.5+
|
||||
// (c) 2005 Invision Power Services, Inc.
|
||||
// http://www.invisionpower.com
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// New object
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function ajax_request()
|
||||
{
|
||||
this.isIE = false;
|
||||
this.allow_use = use_enhanced_js ? true : false;
|
||||
this.xmlhandler = null;
|
||||
this.error_string = '';
|
||||
this.nocache = true;
|
||||
this.do_request_functon = function() {};
|
||||
this.loading_fired = 0;
|
||||
this.centerdiv = null;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Initiate
|
||||
/*--------------------------------------------*/
|
||||
|
||||
ajax_request.prototype.xml_init = function()
|
||||
{
|
||||
try
|
||||
{
|
||||
//------------------------------------------------
|
||||
// Moz, Safari, Opera
|
||||
//------------------------------------------------
|
||||
|
||||
this.xmlhandler = new XMLHttpRequest();
|
||||
this.ie = false;
|
||||
this.allow_use = true;
|
||||
return true;
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
try
|
||||
{
|
||||
//------------------------------------------------
|
||||
// IE
|
||||
//------------------------------------------------
|
||||
|
||||
this.xmlhandler = new ActiveXObject('Microsoft.XMLHTTP');
|
||||
this.ie = true;
|
||||
this.allow_use = true;
|
||||
return true;
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
this.ie = true;
|
||||
this.allow_use = false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Actually send data
|
||||
/*--------------------------------------------*/
|
||||
|
||||
ajax_request.prototype.process = function( url, type, post )
|
||||
{
|
||||
//------------------------------------------------
|
||||
// The 'post' variable needs to be in the following format:
|
||||
//
|
||||
// var=content&var2=content&var3=content
|
||||
//
|
||||
// All values need to be escaped with encodeURIComponent();
|
||||
//------------------------------------------------
|
||||
|
||||
type = type == "POST" ? "POST" : "GET";
|
||||
|
||||
//------------------------------------------------
|
||||
// Use nocache where possible...
|
||||
//------------------------------------------------
|
||||
|
||||
if ( this.nocache == true && type == 'GET' )
|
||||
{
|
||||
url = this.nocache_url( url );
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
// Make sure we're initialized
|
||||
//------------------------------------------------
|
||||
|
||||
if ( ! this.xmlhandler )
|
||||
{
|
||||
this.xml_init();
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
// Only go when ready
|
||||
//------------------------------------------------
|
||||
|
||||
if ( ! this.readystate_not_ready() )
|
||||
{
|
||||
this.xmlhandler.open(type, url, true);
|
||||
|
||||
if ( type == "GET" )
|
||||
{
|
||||
this.xmlhandler.send(null);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( typeof( this.xmlhandler.setRequestHeader ) != "undefined" )
|
||||
{
|
||||
this.xmlhandler.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
|
||||
}
|
||||
|
||||
this.xmlhandler.send( post );
|
||||
}
|
||||
|
||||
if ( this.xmlhandler.readyState == 4 && this.xmlhandler.status == 200 )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// retrieve text of an XML document element, including
|
||||
// elements using namespaces
|
||||
/*--------------------------------------------*/
|
||||
|
||||
ajax_request.prototype.get_element_text_ns = function(prefix, local, parentElem, index)
|
||||
{
|
||||
var result = "";
|
||||
|
||||
if ( prefix && this.isIE )
|
||||
{
|
||||
//-------------------------------
|
||||
// IE
|
||||
//-------------------------------
|
||||
|
||||
result = parentElem.getElementsByTagName(prefix + ":" + local)[index];
|
||||
}
|
||||
else
|
||||
{
|
||||
//-------------------------------
|
||||
// Safari, Gecko
|
||||
//-------------------------------
|
||||
|
||||
result = parentElem.getElementsByTagName(local)[index];
|
||||
}
|
||||
|
||||
if ( result )
|
||||
{
|
||||
if (result.childNodes.length > 1)
|
||||
{
|
||||
return result.childNodes[1].nodeValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
return result.firstChild.nodeValue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "n/a";
|
||||
}
|
||||
};
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Make sure URL is not cached
|
||||
/*--------------------------------------------*/
|
||||
|
||||
ajax_request.prototype.nocache_url = function (url)
|
||||
{
|
||||
var sep = ( -1 < url.indexOf("?") ) ? "&" : "?";
|
||||
var mydate = new Date();
|
||||
var newurl = url + sep + "__=" + mydate.getTime();
|
||||
return newurl;
|
||||
};
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Takes an array of:
|
||||
// array[ field ] = value
|
||||
// and returns a nice encoded POST string
|
||||
/*--------------------------------------------*/
|
||||
|
||||
ajax_request.prototype.format_for_post = function( arrayfields )
|
||||
{
|
||||
var str = '';
|
||||
|
||||
try
|
||||
{
|
||||
for( var i in arrayfields )
|
||||
{
|
||||
str += i + '=' + this.encodeurl(arrayfields[i]) + '&';
|
||||
}
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
}
|
||||
|
||||
return str;
|
||||
};
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Hand roll encode URL to UTF-8
|
||||
/*--------------------------------------------*/
|
||||
|
||||
ajax_request.prototype.encodeurl = function( url )
|
||||
{
|
||||
//-------------------------------
|
||||
// Ensure we have a string
|
||||
//-------------------------------
|
||||
|
||||
url = url.toString();
|
||||
|
||||
var regcheck = url.match(/[\x90-\xFF]/g);
|
||||
|
||||
if ( regcheck )
|
||||
{
|
||||
for (var i = 0; i < i.length; i++)
|
||||
{
|
||||
url = url.replace(regcheck[i], '%u00' + (regcheck[i].charCodeAt(0) & 0xFF).toString(16).toUpperCase());
|
||||
}
|
||||
}
|
||||
|
||||
return escape(url).replace(/\+/g, "%2B");
|
||||
};
|
||||
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Check to ensure ready state-ness
|
||||
/*--------------------------------------------*/
|
||||
|
||||
ajax_request.prototype.readystate_not_ready = function()
|
||||
{
|
||||
return ( this.xmlhandler.readyState && ( this.xmlhandler.readyState < 4 ) );
|
||||
};
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Check to ensure ready state-ness
|
||||
/*--------------------------------------------*/
|
||||
|
||||
ajax_request.prototype.readystate_ready_and_ok = function()
|
||||
{
|
||||
return ( this.xmlhandler.readyState == 4 && this.xmlhandler.status == 200 ) ? true : false;
|
||||
};
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Onready state change event handler
|
||||
/*--------------------------------------------*/
|
||||
|
||||
ajax_request.prototype.onreadystatechange = function( event )
|
||||
{
|
||||
//------------------------------------------------
|
||||
// Make sure we're initialized
|
||||
//------------------------------------------------
|
||||
|
||||
if ( ! this.xmlhandler )
|
||||
{
|
||||
this.xml_init();
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
// Make sure its a function event
|
||||
//------------------------------------------------
|
||||
|
||||
if ( typeof(event) == 'function' )
|
||||
{
|
||||
this.xmlhandler.onreadystatechange = event;
|
||||
}
|
||||
};
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Show loading layer
|
||||
/*--------------------------------------------*/
|
||||
|
||||
ajax_request.prototype.show_loading = function( message )
|
||||
{
|
||||
if ( ! this.loading_fired )
|
||||
{
|
||||
this.loading_fired = 1;
|
||||
|
||||
//------------------------------------------------
|
||||
// Change text?
|
||||
//------------------------------------------------
|
||||
|
||||
if ( message )
|
||||
{
|
||||
document.getElementById( 'loading-layer-text' ).innerHTML = message;
|
||||
}
|
||||
|
||||
this.centerdiv = new center_div();
|
||||
this.centerdiv.divname = 'loading-layer';
|
||||
this.centerdiv.move_div();
|
||||
|
||||
//------------------------------------------------
|
||||
// Add the shadow
|
||||
//------------------------------------------------
|
||||
|
||||
add_shadow('loading-layer-shadow', 'loading-layer-inner');
|
||||
}
|
||||
|
||||
return;
|
||||
};
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Hide loading layer
|
||||
/*--------------------------------------------*/
|
||||
|
||||
ajax_request.prototype.hide_loading = function()
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( this.centerdiv && this.centerdiv.divobj )
|
||||
{
|
||||
this.centerdiv.hide_div();
|
||||
}
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
}
|
||||
|
||||
this.loading_fired = 0;
|
||||
|
||||
return;
|
||||
};
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Execute javascript returned from the HTML
|
||||
/*--------------------------------------------*/
|
||||
|
||||
ajax_request.prototype.execute_javascript = function( source_code )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
var text_blocks = new Array();
|
||||
var max_iteration = 50;
|
||||
var i = 0;
|
||||
|
||||
//-----------------------------------------
|
||||
// Got javascript?
|
||||
// We force [^`] to make it match any character
|
||||
// except a black-tick as JS doesn't have
|
||||
// single line pattern matching.
|
||||
//-----------------------------------------
|
||||
|
||||
while ( _match = source_code.match( new RegExp( "<script\\s+?type=['\"]text/javascript['\"]>([^`]+?)</script>", "i" ) ) )
|
||||
{
|
||||
i++;
|
||||
|
||||
if ( i >= max_iteration )
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
text_blocks[ text_blocks.length ] = _match[1];
|
||||
source_code = source_code.replace( _match[0], '' );
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if ( text_blocks.length )
|
||||
{
|
||||
for ( i = 0 ; i < text_blocks.length ; i++ )
|
||||
{
|
||||
eval( text_blocks[ i ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(error)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// IPB thinks we can use fancy JS, lets see...
|
||||
/*--------------------------------------------*/
|
||||
|
||||
try
|
||||
{
|
||||
if ( use_enhanced_js )
|
||||
{
|
||||
use_enhanced_js = ajax_request.prototype.xml_init() ? 1 : 0;
|
||||
}
|
||||
}
|
||||
catch(error)
|
||||
{
|
||||
var use_enhanced_js = 0;
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<html>␍<head><title>Invision Power Board - Bulletin Board System</title></head>␍<body>␍<h1>403: Invision Power Board -> Forbidden</h1>␍<hr>␍You have reached this Page in error, please use␍your back button to return to Invision Board.␍<hr>␍<a href="http://anonym.to/http://www.invisionboard.com/">Invision Power Board</a>␍</body>␍</html>
|
||||
@@ -1,311 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// IPS JS: Cell select
|
||||
// (c) 2005 Invision Power Services, Inc.
|
||||
// http://www.invisionpower.com
|
||||
// Matt Mecham (29/11/05)
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
var _cell_select;
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Initiate object
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function cell_select()
|
||||
{
|
||||
/**
|
||||
* CSS: Table cell row OFF
|
||||
*
|
||||
* @var INT
|
||||
*/
|
||||
this.css_row_off = 'tablerow1';
|
||||
|
||||
/**
|
||||
* CSS: Table cell row ON
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
this.css_row_on = 'tablerow2selected';
|
||||
|
||||
/**
|
||||
* String: TR row ID part
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
this.row_tr_id = 'arow';
|
||||
|
||||
/**
|
||||
* String: Checkbox ID part
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
this.row_checkbox_id = 'acid';
|
||||
|
||||
/**
|
||||
* String: ID name of toggle all box
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
this.toggle_all_name = 'cellselect-cball';
|
||||
|
||||
/**
|
||||
* String: ID of toggle all box
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
this.toggle_all_id = '';
|
||||
|
||||
/**
|
||||
* String: Flag to see if we have a toggle all box
|
||||
*
|
||||
* @var object
|
||||
*/
|
||||
this.toggle_all_flag = 0;
|
||||
|
||||
/**
|
||||
* Array: Selected IDs array
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
this.selected_ids = new Array();
|
||||
|
||||
/**
|
||||
* Array: Total possible cbs
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
this.total_ids = 0;
|
||||
|
||||
/**
|
||||
* Store CSS rows for the original row
|
||||
*/
|
||||
this.store_css_row = new Array();
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Initiate object
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
cell_select.prototype.init = function()
|
||||
{
|
||||
//----------------------------------
|
||||
// Check for toggle all box
|
||||
//----------------------------------
|
||||
|
||||
try
|
||||
{
|
||||
this.toggle_all_id = document.getElementById( this.toggle_all_name );
|
||||
this.toggle_all_flag = 1;
|
||||
this.toggle_all_id.checked = false;
|
||||
}
|
||||
catch(error)
|
||||
{
|
||||
this.toggle_all_flag = 0;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Check checked boxes
|
||||
//----------------------------------
|
||||
|
||||
var checkboxes = document.getElementsByTagName('INPUT');
|
||||
|
||||
_cell_select = this;
|
||||
|
||||
//----------------------------------
|
||||
// Sort through and grab links
|
||||
//----------------------------------
|
||||
|
||||
for ( var i = 0 ; i < checkboxes.length ; i++ )
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( ! checkboxes[i].id )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( checkboxes[i].getAttribute('type') != 'checkbox' )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
catch(error)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var cbid = checkboxes[i].id;
|
||||
var cbname = cbid.replace( /^(.*)-(\d+)$/, "$1" );
|
||||
var cbnum = this.get_id_from_text( checkboxes[i].id );
|
||||
|
||||
//----------------------------------
|
||||
// Work with it?
|
||||
//----------------------------------
|
||||
|
||||
if ( cbname == this.row_checkbox_id )
|
||||
{
|
||||
if ( checkboxes[i].getAttribute('checked') || checkboxes[i].checked )
|
||||
{
|
||||
this.row_change_color( cbnum );
|
||||
this.selected_ids[ cbnum ] = 1;
|
||||
this.total_ids++;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.selected_ids[ cbnum ] = 0;
|
||||
this.total_ids++;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Toggle all row has been clicked
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
cell_select.prototype.row_toggle_all = function()
|
||||
{
|
||||
//----------------------------------
|
||||
// Using a toggle all?
|
||||
//----------------------------------
|
||||
|
||||
if ( ! this.toggle_all_flag )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Grab initial state
|
||||
//----------------------------------
|
||||
|
||||
var checkstate = this.toggle_all_id.checked;
|
||||
|
||||
//----------------------------------
|
||||
// Spread the love
|
||||
//----------------------------------
|
||||
|
||||
var checkboxes = document.getElementsByTagName('INPUT');
|
||||
|
||||
//----------------------------------
|
||||
// Sort through and grab links
|
||||
//----------------------------------
|
||||
|
||||
for ( var i = 0 ; i < checkboxes.length ; i++ )
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( ! checkboxes[i].id )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( checkboxes[i].getAttribute('type') != 'checkbox' )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
catch(error)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var cbid = checkboxes[i].id;
|
||||
var cbname = cbid.replace( /^(.*)-(\d+)$/, "$1" );
|
||||
var cbnum = this.get_id_from_text( checkboxes[i].id );
|
||||
|
||||
//----------------------------------
|
||||
// Work with it?
|
||||
//----------------------------------
|
||||
|
||||
if ( cbname == this.row_checkbox_id )
|
||||
{
|
||||
checkboxes[i].checked = checkstate;
|
||||
this.selected_ids[ cbnum ] = checkstate ? 0 : 1;
|
||||
this.row_change_color( cbnum );
|
||||
this.selected_ids[ cbnum ] = checkstate ? 1 : 0;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// A row has been clicked
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
cell_select.prototype.row_clicked = function( row_id )
|
||||
{
|
||||
//----------------------------------
|
||||
// Change color
|
||||
//----------------------------------
|
||||
|
||||
this.row_change_color( row_id );
|
||||
|
||||
//----------------------------------
|
||||
// Reset flag
|
||||
//----------------------------------
|
||||
|
||||
this.selected_ids[ row_id ] = ( this.selected_ids[ row_id ] ) ? 0 : 1;
|
||||
|
||||
//----------------------------------
|
||||
// Test toggle all box
|
||||
//----------------------------------
|
||||
|
||||
if ( this.toggle_all_flag )
|
||||
{
|
||||
var c = 0;
|
||||
|
||||
for( var i in this.selected_ids )
|
||||
{
|
||||
if ( this.selected_ids[i] )
|
||||
{
|
||||
c++;
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Number of 'on' not equal to total?
|
||||
//----------------------------------
|
||||
|
||||
if ( c != this.total_ids )
|
||||
{
|
||||
this.toggle_all_id.checked = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.toggle_all_id.checked = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Change color
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
cell_select.prototype.row_change_color = function( row_id )
|
||||
{
|
||||
//----------------------------------
|
||||
// Get Row TDs...
|
||||
//----------------------------------
|
||||
|
||||
var tds = document.getElementById( this.row_tr_id + '-' + row_id ).getElementsByTagName('TD');
|
||||
|
||||
//----------------------------------
|
||||
// Sort through and grab links
|
||||
//----------------------------------
|
||||
|
||||
var _cell = ( this.store_css_row[ row_id ] ) ? this.store_css_row[ row_id ] : this.css_row_off;
|
||||
|
||||
for ( var i = 0 ; i < tds.length ; i++ )
|
||||
{
|
||||
tds[i].className = ( this.selected_ids[ row_id ] ) ? _cell : this.css_row_on;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Grab ID from string
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
cell_select.prototype.get_id_from_text = function( id )
|
||||
{
|
||||
return id.replace( /.*(?:\-|_)(\d+)/, "$1" );
|
||||
};
|
||||
@@ -1,910 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// IPS JS: Drag Move
|
||||
// (c) 2005 Invision Power Services, Inc.
|
||||
// http://www.invisionpower.com
|
||||
// Matt Mecham (27/07/05)
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
var drag_move = new dragmove();
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Initiate object
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function dragmove()
|
||||
{
|
||||
/*
|
||||
* Portion of ID name without "-{id}" for
|
||||
* drag handles (object which initiates drag)
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
this.var_drag_handle_id_text = null;
|
||||
|
||||
/*
|
||||
* URL to redirect to after change
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
this.var_bounce_url = null;
|
||||
|
||||
/*
|
||||
* Portion of ID name without "-{id}" for
|
||||
* hidden drag elements. These are HTML
|
||||
* blobs which actually get made visible
|
||||
* and are dragged.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
this.var_drag_draggable_id_text = null;
|
||||
|
||||
/*
|
||||
* Portion of ID name without "-{id}" for
|
||||
* drag objects (the actual drag container)
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
this.var_drag_object_id_text = null;
|
||||
|
||||
/*
|
||||
* Portion of ID name for the
|
||||
* row which is altered when the drag is
|
||||
* started AND a TARGET copy is created
|
||||
* over it when dragging started
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
this.var_original_row_text = null;
|
||||
|
||||
/*
|
||||
* Current dragged ID
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
this.current_id = null;
|
||||
|
||||
/*
|
||||
* Drag in progress
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
this._drag_in_progress = null;
|
||||
|
||||
/**
|
||||
* Target IDs (Populated in DHTML)
|
||||
* Must be in the format as follows:
|
||||
* <element id="{this.var_drag_target_id_text}-{id}"></element>
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
this.var_target_ids = new Array();
|
||||
|
||||
/**
|
||||
* Parent IDs (Populated in DHTML)
|
||||
* Must be in the format as follows:
|
||||
* <element id="{this.var_drag_target_id_text}-{id}"></element>
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
this.var_parent_ids = new Array();
|
||||
|
||||
/**
|
||||
* Process parent IDs?
|
||||
* Turn off to not restrict actions
|
||||
* based on parents
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
this.var_parent_process = 1;
|
||||
|
||||
/*
|
||||
* CSS classname of layer that is
|
||||
* drawn above the row when a move
|
||||
* is started
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
this.var_hide_row_classname = 'dragmove-hide';
|
||||
|
||||
/*
|
||||
* CSS classname of target mouseover
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
this.var_target_over_classname = 'tablerow3';
|
||||
|
||||
/*
|
||||
* CSS classname of target mouseout
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
this.var_target_out_classname = 'tablerow2';
|
||||
|
||||
/*
|
||||
* ID of target over
|
||||
* set by mouseover. cleared by mouseout
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
this.var_target_over_id = null;
|
||||
|
||||
/*
|
||||
* URL of Ajax request
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
this.var_ajax_url = null;
|
||||
|
||||
/*
|
||||
* Array of FAKE TARGETS
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
this._TARGETS = new Array();
|
||||
|
||||
/*
|
||||
* Array of FAKE TARGETS DImensions
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
this.dims = new Array();
|
||||
|
||||
/*
|
||||
* Array of unmoveable objects
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
this.UNMOVEABLES = new Array();
|
||||
|
||||
/*
|
||||
* ID of "Unmoveable" alert object
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
this.UNMOVEABLES_id = 'dragmove-unmoveable';
|
||||
|
||||
/*
|
||||
* Array of ALL parent ids for a certain ID
|
||||
* Traversing up the parent tree
|
||||
*
|
||||
* var @array
|
||||
*/
|
||||
this.parent_id_tree = new Array();
|
||||
|
||||
/*
|
||||
* Array of ALL children ids for a certain ID
|
||||
* Traversing up the parent tree
|
||||
*
|
||||
* var @array
|
||||
*/
|
||||
this.child_id_tree = new Array();
|
||||
|
||||
/*
|
||||
* Array of ALL children ids / parent
|
||||
* structure
|
||||
*
|
||||
* var @array
|
||||
*/
|
||||
this.child_id_array = new Array();
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Initiate draggable objects
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
dragmove.prototype.drag_init = function()
|
||||
{
|
||||
//----------------------------------
|
||||
// Get page links...
|
||||
// Gah.. another safari bug
|
||||
//----------------------------------
|
||||
|
||||
var draghandles = document.getElementsByTagName('*');
|
||||
|
||||
//----------------------------------
|
||||
// Sort through and grab topic links
|
||||
//----------------------------------
|
||||
|
||||
for ( var i = 0 ; i <= draghandles.length ; i++ )
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( ! draghandles[i].id )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var linkid = draghandles[i].id;
|
||||
var linkname = linkid.replace( /^(.*)-(\d+)$/, "$1" );
|
||||
var thisid = this.get_id_from_text( draghandles[i].id );
|
||||
|
||||
//----------------------------------
|
||||
// SET UP DRAG HANDLES
|
||||
//----------------------------------
|
||||
|
||||
if ( linkname == this.var_drag_handle_id_text )
|
||||
{
|
||||
var drag_main_obj = document.getElementById( this.var_drag_draggable_id_text + '-' + thisid );
|
||||
var drag_handle_obj = document.getElementById( this.var_drag_handle_id_text + '-' + thisid );
|
||||
|
||||
draghandles[i].style.cursor = "move";
|
||||
|
||||
Drag.init( drag_handle_obj, drag_main_obj );
|
||||
|
||||
drag_main_obj.onDrag = function(x, y, e) { dragmove_events.prototype.event_drag_ging( x, y, e ); };
|
||||
drag_main_obj.onDragStart = function(x, y, e) { dragmove_events.prototype.event_drag_start( x, y, e ); };
|
||||
drag_main_obj.onDragEnd = function(x, y, e) { dragmove_events.prototype.event_drag_end( x, y, e ); };
|
||||
|
||||
//----------------------------------
|
||||
// This has to be after Drag.init
|
||||
// to replace mouseover handler
|
||||
//----------------------------------
|
||||
|
||||
drag_handle_obj.onmouseover = dragmove_events.prototype.event_mouseover;
|
||||
drag_handle_obj.onmouseout = dragmove_events.prototype.event_mouseout;
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Create child / parent structure
|
||||
//----------------------------------
|
||||
|
||||
if ( this.var_parent_ids.length )
|
||||
{
|
||||
for( var i in this.var_parent_ids )
|
||||
{
|
||||
if ( ! this.child_id_array[ this.var_parent_ids[i] ] )
|
||||
{
|
||||
this.child_id_array[ this.var_parent_ids[i] ] = new Array();
|
||||
}
|
||||
|
||||
this.child_id_array[ this.var_parent_ids[i] ][ this.child_id_array[ this.var_parent_ids[i] ].length ] = i;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Add ID to UNMOVEABLES array
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
dragmove.prototype.get_parents_array = function( root_tid )
|
||||
{
|
||||
if ( this.var_parent_ids[ root_tid ] )
|
||||
{
|
||||
this.parent_id_tree[ this.parent_id_tree.length ] = this.var_parent_ids[ root_tid ];
|
||||
|
||||
this.get_parents_array( this.var_parent_ids[ root_tid ] );
|
||||
}
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Add ID to UNMOVEABLES array
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
dragmove.prototype.get_children_array = function( root_tid )
|
||||
{
|
||||
if ( this.child_id_array[ root_tid ] )
|
||||
{
|
||||
for( var i in this.child_id_array[ root_tid ] )
|
||||
{
|
||||
this.child_id_tree[ this.child_id_tree.length ] = this.child_id_array[ root_tid ][i];
|
||||
|
||||
this.get_children_array( this.child_id_array[ root_tid ][i] );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Add ID to UNMOVEABLES array
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
dragmove.prototype.add_id_to_unmoveables = function( tid )
|
||||
{
|
||||
this.UNMOVEABLES[ tid ] = tid;
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Add ID to target array
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
dragmove.prototype.add_id_to_targets = function( tid )
|
||||
{
|
||||
this.var_target_ids[ tid ] = 1;
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Add ID to target array
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
dragmove.prototype.add_id_to_parents = function( tid, parent_id )
|
||||
{
|
||||
this.var_parent_ids[ tid ] = parent_id == 'root' ? 0 : parseInt(parent_id);
|
||||
};
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Get TID from ID
|
||||
/*--------------------------------------------*/
|
||||
|
||||
dragmove.prototype.get_id_from_text = function( id )
|
||||
{
|
||||
return id.replace( /.*\-(\d+)/, "$1" );
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Initiate events object
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function dragmove_events()
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// TARGET EVENT: Mouseover
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
dragmove_events.prototype.event_TARGET_mouseover = function(e)
|
||||
{
|
||||
//-------------------------------
|
||||
// Already over a target
|
||||
//-------------------------------
|
||||
|
||||
if ( drag_move.var_target_over_id )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// Not dragging?
|
||||
//-------------------------------
|
||||
|
||||
if ( ! drag_move._drag_in_progress )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// No? Get one then
|
||||
//-------------------------------
|
||||
|
||||
drag_move.var_target_over_id = drag_move.get_id_from_text( this.id );
|
||||
|
||||
//-------------------------------
|
||||
// Can we actually mouse over this?
|
||||
// Check parents to make sure we're not
|
||||
// trying to move a child into its existing
|
||||
// parent. Also don't allow to drop over
|
||||
// oneself
|
||||
//-------------------------------
|
||||
|
||||
if ( drag_move.var_parent_process && drag_move.current_id )
|
||||
{
|
||||
//-------------------------------
|
||||
// Move into self
|
||||
//-------------------------------
|
||||
|
||||
if ( drag_move.var_target_over_id == drag_move.current_id )
|
||||
{
|
||||
//-------------------------------
|
||||
// Yeah.. so don't do anything
|
||||
//-------------------------------
|
||||
|
||||
drag_move.var_target_over_id = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// Move into current parent
|
||||
//-------------------------------
|
||||
|
||||
if ( drag_move.var_target_over_id == drag_move.var_parent_ids[ drag_move.current_id ] )
|
||||
{
|
||||
//-------------------------------
|
||||
// Yeah.. so don't do anything
|
||||
//-------------------------------
|
||||
|
||||
drag_move.var_target_over_id = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// Make sure we're not moving into
|
||||
// own parents
|
||||
//-------------------------------
|
||||
|
||||
drag_move.child_id_tree = new Array();
|
||||
|
||||
drag_move.get_children_array( drag_move.current_id );
|
||||
|
||||
// Add in current ID
|
||||
drag_move.child_id_tree[ drag_move.child_id_tree.length ] = drag_move.current_id;
|
||||
|
||||
for( var i in drag_move.child_id_tree )
|
||||
{
|
||||
if ( drag_move.var_target_over_id == drag_move.child_id_tree[i] )
|
||||
{
|
||||
//-------------------------------
|
||||
// Yeah.. so don't do anything
|
||||
//-------------------------------
|
||||
|
||||
drag_move.var_target_over_id = null;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var target_obj = document.getElementById( drag_move.var_original_row_text + '-' + drag_move.var_target_over_id );
|
||||
|
||||
//-------------------------------
|
||||
// Store old classname...
|
||||
//-------------------------------
|
||||
|
||||
drag_move.var_target_out_classname = target_obj.className;
|
||||
|
||||
//-------------------------------
|
||||
// Change classname...
|
||||
//-------------------------------
|
||||
|
||||
target_obj.className = drag_move.var_target_over_classname;
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// TARGET EVENT: Mouseout
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
dragmove_events.prototype.event_TARGET_mouseout = function(e)
|
||||
{
|
||||
//-------------------------------
|
||||
// Not touched a target?
|
||||
//-------------------------------
|
||||
|
||||
if ( ! drag_move.var_target_over_id )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// Not dragging?
|
||||
//-------------------------------
|
||||
|
||||
if ( ! drag_move._drag_in_progress )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// Get obj
|
||||
//-------------------------------
|
||||
|
||||
var target_obj = document.getElementById( drag_move.var_original_row_text + '-' + drag_move.var_target_over_id );
|
||||
|
||||
//-------------------------------
|
||||
// Store old classname...
|
||||
//-------------------------------
|
||||
|
||||
target_obj.className = drag_move.var_target_out_classname;
|
||||
|
||||
//-------------------------------
|
||||
// Clear target ID
|
||||
//-------------------------------
|
||||
|
||||
drag_move.var_target_over_id = null;
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// MAIN EVENT: Mouseover
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
dragmove_events.prototype.event_mouseover = function(e)
|
||||
{
|
||||
//-------------------------------
|
||||
// Already dragging?
|
||||
//-------------------------------
|
||||
|
||||
if ( drag_move.current_id )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// Unmoveable?
|
||||
//-------------------------------
|
||||
|
||||
var check_for_id = drag_move.UNMOVEABLES[ drag_move.get_id_from_text( this.id ) ];
|
||||
|
||||
if ( check_for_id )
|
||||
{
|
||||
var alert_object = null;
|
||||
|
||||
//-------------------------------
|
||||
// Attempt to get DIV
|
||||
//-------------------------------
|
||||
|
||||
try
|
||||
{
|
||||
alert_object = document.getElementById( drag_move.UNMOVEABLES_id );
|
||||
}
|
||||
catch(error)
|
||||
{
|
||||
drag_move.UNMOVEABLES_id = null;
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// Yeah, so draw alert and return
|
||||
//-------------------------------
|
||||
|
||||
if ( alert_object )
|
||||
{
|
||||
var drag_root_obj = document.getElementById( drag_move.var_drag_handle_id_text + '-' + check_for_id );
|
||||
|
||||
alert_object.style.top = ipsclass.get_obj_toppos( drag_root_obj ) - 4 + 'px';
|
||||
alert_object.style.left = ipsclass.get_obj_leftpos( drag_root_obj ) + 22 + 'px';
|
||||
alert_object.style.position = 'absolute';
|
||||
alert_object.style.display = '';
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// No? Get one then
|
||||
//-------------------------------
|
||||
|
||||
drag_move.current_id = drag_move.get_id_from_text( this.id );
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// MAIN EVENT: Mouseout
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
dragmove_events.prototype.event_mouseout = function(e)
|
||||
{
|
||||
//-------------------------------
|
||||
// Unmoveable?
|
||||
//-------------------------------
|
||||
|
||||
var check_for_id = drag_move.UNMOVEABLES[ drag_move.get_id_from_text( this.id ) ];
|
||||
|
||||
if ( check_for_id )
|
||||
{
|
||||
var alert_object = null;
|
||||
|
||||
//-------------------------------
|
||||
// Attempt to get DIV
|
||||
//-------------------------------
|
||||
|
||||
try
|
||||
{
|
||||
alert_object = document.getElementById( drag_move.UNMOVEABLES_id );
|
||||
}
|
||||
catch(error)
|
||||
{
|
||||
drag_move.UNMOVEABLES_id = null;
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// Yeah, so draw alert and return
|
||||
//-------------------------------
|
||||
|
||||
if ( alert_object )
|
||||
{
|
||||
alert_object.style.display = 'none';
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// Release current drag ID
|
||||
// only if a drag is not in
|
||||
// progress
|
||||
//-------------------------------
|
||||
|
||||
if ( ! drag_move._drag_in_progress )
|
||||
{
|
||||
drag_move.current_id = null;
|
||||
}
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// DRAG EVENT: DRAG IN PROGRESS (No, not men in dresses)
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
dragmove_events.prototype.event_drag_ging = function( x, y )
|
||||
{
|
||||
if ( is_ie )
|
||||
{
|
||||
var bingo = 0;
|
||||
|
||||
if ( drag_move.var_target_ids.length )
|
||||
{
|
||||
for ( var i in drag_move.var_target_ids )
|
||||
{
|
||||
if ( x >= drag_move.dims[ i ]['x1']
|
||||
&& x <= drag_move.dims[ i ]['x2']
|
||||
&& y >= drag_move.dims[ i ]['y1']
|
||||
&& y <= drag_move.dims[ i ]['y2']
|
||||
)
|
||||
{
|
||||
bingo = 1;
|
||||
this.id = i;
|
||||
dragmove_events.prototype.event_TARGET_mouseover();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! bingo )
|
||||
{
|
||||
dragmove_events.prototype.event_TARGET_mouseout();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// DRAG START: Gentlemen, start your dresses!
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
dragmove_events.prototype.event_drag_start = function( x, y )
|
||||
{
|
||||
//-------------------------------
|
||||
// Time for hidden div to make
|
||||
// a showing...
|
||||
//-------------------------------
|
||||
|
||||
if ( drag_move.current_id )
|
||||
{
|
||||
var drag_main_obj = document.getElementById( drag_move.var_drag_draggable_id_text + '-' + drag_move.current_id );
|
||||
var drag_root_obj = document.getElementById( drag_move.var_drag_object_id_text + '-' + drag_move.current_id );
|
||||
var drag_orig_obj = document.getElementById( drag_move.var_original_row_text + '-' + drag_move.current_id );
|
||||
|
||||
//-------------------------------
|
||||
// For some reason, Safari wants
|
||||
// to be relative..
|
||||
//-------------------------------
|
||||
|
||||
if ( is_safari )
|
||||
{
|
||||
drag_root_obj.style.position = 'relative';
|
||||
}
|
||||
|
||||
drag_main_obj.style.top = ipsclass.get_obj_toppos( drag_root_obj ) + 'px';
|
||||
drag_main_obj.style.left = ipsclass.get_obj_leftpos( drag_root_obj ) + 'px';
|
||||
drag_main_obj.style.position = 'absolute';
|
||||
drag_main_obj.style.display = 'block';
|
||||
drag_main_obj.style.zIndex = 1000;
|
||||
|
||||
//-------------------------------
|
||||
// Set up TARGETS
|
||||
//-------------------------------
|
||||
|
||||
if ( drag_move.var_target_ids.length )
|
||||
{
|
||||
for ( var i in drag_move.var_target_ids )
|
||||
{
|
||||
var main_obj = document.getElementById( drag_move.var_original_row_text + '-' + i );
|
||||
|
||||
//-------------------------------
|
||||
// For some reason, Safari wants
|
||||
// to be relative..
|
||||
//-------------------------------
|
||||
|
||||
if ( is_safari )
|
||||
{
|
||||
main_obj.style.position = 'relative';
|
||||
}
|
||||
|
||||
if ( is_ie )
|
||||
{
|
||||
//-------------------------------
|
||||
// IE has problems with onmouseover
|
||||
// and zIndex.. couldn't resolve it
|
||||
// so cheated. slower, hence IE only
|
||||
// Gen co-ord maps of targets
|
||||
//-------------------------------
|
||||
|
||||
drag_move.dims[ i ] = new Array();
|
||||
|
||||
drag_move.dims[ i ]['x1'] = ipsclass.get_obj_leftpos(main_obj);
|
||||
drag_move.dims[ i ]['x2'] = drag_move.dims[i]['x1'] + main_obj.offsetWidth;
|
||||
drag_move.dims[ i ]['y1'] = ipsclass.get_obj_toppos(main_obj) - 20;
|
||||
|
||||
// We need to leave a gutter at the bottom / top of each target area to allow
|
||||
// the mouse out event to fire otherwise two targets together will show as one
|
||||
// big target
|
||||
drag_move.dims[ i ]['y2'] = drag_move.dims[i]['y1'] + main_obj.offsetHeight - 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
var targetobj = document.createElement('div');
|
||||
targetobj.id = drag_move.var_original_row_text + '-TARGET-' + i;
|
||||
targetobj.style.background = 'transparent';
|
||||
targetobj.style.position = 'absolute';
|
||||
targetobj.style.left = ipsclass.get_obj_leftpos(main_obj) + 'px';
|
||||
targetobj.style.top = ipsclass.get_obj_toppos(main_obj) + 'px';
|
||||
targetobj.style.width = main_obj.offsetWidth + 'px';
|
||||
targetobj.style.height = main_obj.offsetHeight + 'px';
|
||||
targetobj.style.zIndex = 1000;
|
||||
|
||||
document.body.appendChild(targetobj);
|
||||
|
||||
drag_move._TARGETS[ drag_move._TARGETS.length ] = targetobj;
|
||||
|
||||
targetobj.onmouseover = dragmove_events.prototype.event_TARGET_mouseover;
|
||||
targetobj.onmouseout = dragmove_events.prototype.event_TARGET_mouseout;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// Alter original row
|
||||
//-------------------------------
|
||||
|
||||
if ( ! document.getElementById( drag_move.var_original_row_text + '-HIDDEN-' + drag_move.current_id ) )
|
||||
{
|
||||
var newdiv = document.createElement('DIV');
|
||||
newdiv.id = drag_move.var_original_row_text + '-HIDDEN-' + drag_move.current_id;
|
||||
newdiv.className = (is_ie ) ? drag_move.var_hide_row_classname+'-ie' : drag_move.var_hide_row_classname+'-moz';
|
||||
newdiv.style.position = 'absolute';
|
||||
newdiv.style.top = ipsclass.get_obj_toppos( drag_root_obj ) + 'px';
|
||||
newdiv.style.left = ipsclass.get_obj_leftpos( drag_root_obj ) + 'px';
|
||||
newdiv.style.width = drag_orig_obj.offsetWidth + 'px';
|
||||
newdiv.style.height = drag_orig_obj.offsetHeight + 'px';
|
||||
|
||||
document.body.appendChild(newdiv);
|
||||
}
|
||||
else
|
||||
{
|
||||
var newdiv = document.getElementById( drag_move.var_original_row_text + '-HIDDEN-' + drag_move.current_id );
|
||||
newdiv.style.display = '';
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// Set drag flag
|
||||
//-------------------------------
|
||||
|
||||
drag_move._drag_in_progress = 1;
|
||||
}
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// DRAG START: Time to remove the makeup
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
dragmove_events.prototype.event_drag_end = function( x, y )
|
||||
{
|
||||
//-------------------------------
|
||||
// Hide DIV
|
||||
//-------------------------------
|
||||
|
||||
if ( drag_move.current_id )
|
||||
{
|
||||
var drag_main_obj = document.getElementById( drag_move.var_drag_draggable_id_text + '-' + drag_move.current_id );
|
||||
var drag_root_obj = document.getElementById( drag_move.var_drag_object_id_text + '-' + drag_move.current_id );
|
||||
var drag_orig_obj = document.getElementById( drag_move.var_original_row_text + '-' + drag_move.current_id );
|
||||
|
||||
//-------------------------------
|
||||
// Hide draggable thing
|
||||
//-------------------------------
|
||||
|
||||
drag_main_obj.style.display = 'none';
|
||||
|
||||
//-------------------------------
|
||||
// Hide row cover
|
||||
//-------------------------------
|
||||
|
||||
if ( document.getElementById( drag_move.var_original_row_text + '-HIDDEN-' + drag_move.current_id ) )
|
||||
{
|
||||
document.getElementById( drag_move.var_original_row_text + '-HIDDEN-' + drag_move.current_id ).style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// CLEAR TARGETS
|
||||
//-------------------------------
|
||||
|
||||
if ( drag_move._TARGETS )
|
||||
{
|
||||
for ( var i in drag_move._TARGETS )
|
||||
{
|
||||
document.body.removeChild( drag_move._TARGETS[i] );
|
||||
}
|
||||
|
||||
drag_move._TARGETS = new Array();
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// Did we drop on a target?
|
||||
//-------------------------------
|
||||
|
||||
if ( drag_move.var_target_over_id )
|
||||
{
|
||||
var new_parent_id = drag_move.var_target_over_id;
|
||||
var page_id = drag_move.current_id;
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Main function to do on request
|
||||
// Must be defined first!!
|
||||
/*--------------------------------------------*/
|
||||
|
||||
do_request_function = function()
|
||||
{
|
||||
//----------------------------------
|
||||
// Ignore unless we're ready to go
|
||||
//----------------------------------
|
||||
|
||||
if ( ! xmlobj.readystate_ready_and_ok() )
|
||||
{
|
||||
xmlobj.show_loading( "Move in progress..." );
|
||||
return;
|
||||
}
|
||||
|
||||
xmlobj.hide_loading();
|
||||
|
||||
//----------------------------------
|
||||
// INIT
|
||||
//----------------------------------
|
||||
|
||||
var returned = xmlobj.xmlhandler.responseText;
|
||||
|
||||
if ( returned.match( /<null>(0|-|\=)<\/null>/ ) )
|
||||
{
|
||||
alert( "Error occured, move not completed " + returned );
|
||||
}
|
||||
else
|
||||
{
|
||||
window.location = drag_move.var_bounce_url;
|
||||
}
|
||||
};
|
||||
|
||||
//----------------------------------
|
||||
// LOAD XML
|
||||
//----------------------------------
|
||||
|
||||
xmlobj = new ajax_request();
|
||||
xmlobj.onreadystatechange( do_request_function );
|
||||
xmlobj.process( drag_move.var_ajax_url +'&pid='+page_id+'&new_parent_id='+new_parent_id );
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// Release current drag ID
|
||||
//-------------------------------
|
||||
|
||||
drag_move.current_id = null;
|
||||
|
||||
//-------------------------------
|
||||
// Set drag flag
|
||||
//-------------------------------
|
||||
|
||||
drag_move._drag_in_progress = null;
|
||||
|
||||
//-------------------------------
|
||||
// Change colour back...
|
||||
//-------------------------------
|
||||
|
||||
if ( drag_move.var_target_over_id )
|
||||
{
|
||||
//-------------------------------
|
||||
// Get obj
|
||||
//-------------------------------
|
||||
|
||||
var target_obj = document.getElementById( drag_move.var_original_row_text + '-' + drag_move.var_target_over_id );
|
||||
|
||||
//-------------------------------
|
||||
// Store old classname...
|
||||
//-------------------------------
|
||||
|
||||
target_obj.className = drag_move.var_target_out_classname;
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// Clear target ID
|
||||
//-------------------------------
|
||||
|
||||
drag_move.var_target_over_id = null;
|
||||
};
|
||||
@@ -1,402 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// IPS JS: Form Functions
|
||||
// (c) 2005 Invision Power Services, Inc.
|
||||
// http://www.invisionpower.com
|
||||
// Matt Mecham (17/10/05)
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
var _form_functions = null;
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Initiate object
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function form_functions()
|
||||
{
|
||||
/**
|
||||
* Name: Form
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
this.name_form = 'mainform';
|
||||
|
||||
/**
|
||||
* ID: Form
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
this.obj_form = null;
|
||||
|
||||
/**
|
||||
* ID: Form Edited
|
||||
*
|
||||
* @var INT
|
||||
*/
|
||||
this.form_edited = 1;
|
||||
|
||||
/**
|
||||
* NAME: Edit hold
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
this.name_edit_hold = 'page-edit-hold';
|
||||
|
||||
/**
|
||||
* ID: Edit hold
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
this.id_edit_hold = null;
|
||||
|
||||
/**
|
||||
* Saved onsubmit handlers
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
this.form_onsubmit_saved = null;
|
||||
|
||||
/**
|
||||
* Array of form BUTTON div id names
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
this.form_button_divs = new Array();
|
||||
|
||||
/**
|
||||
* Array of form LINK div id names
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
this.form_link_divs = new Array();
|
||||
|
||||
/**
|
||||
* Array of form EVAL div id names
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
this.form_eval_divs = new Array();
|
||||
|
||||
/**
|
||||
* CSS styles: Button off
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
this.css_formbutton_off = 'formbutton-off';
|
||||
|
||||
/**
|
||||
* CSS styles: Button on
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
this.css_formbutton_on = 'formbutton-on';
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Initiate object
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
form_functions.prototype.init = function()
|
||||
{
|
||||
//----------------------------------
|
||||
// Get form object
|
||||
//----------------------------------
|
||||
|
||||
this.obj_form = document.getElementById( this.name_form );
|
||||
|
||||
//----------------------------------
|
||||
// Already got a submit handler?
|
||||
//----------------------------------
|
||||
|
||||
if ( this.obj_form.onsubmit )
|
||||
{
|
||||
this.form_onsubmit_saved = this.obj_form.onsubmit;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Got the hold box?
|
||||
//----------------------------------
|
||||
|
||||
try
|
||||
{
|
||||
this.id_edit_hold = document.getElementById( this.name_edit_hold );
|
||||
}
|
||||
catch(error)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Get page links...
|
||||
// Gah.. another safari bug
|
||||
//----------------------------------
|
||||
|
||||
var inputs = this.obj_form.getElementsByTagName('INPUT');
|
||||
|
||||
_form_functions = this;
|
||||
|
||||
//----------------------------------
|
||||
// Sort through and grab links
|
||||
//----------------------------------
|
||||
|
||||
for ( var i = 0 ; i <= inputs.length ; i++ )
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( inputs[i].type == 'hidden' )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
catch(error)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
inputs[i].onchange = this.form_event_edited;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Form check...
|
||||
//----------------------------------
|
||||
|
||||
this.obj_form.onsubmit = this.form_submit;
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Initiate object
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
form_functions.prototype.add_submit_event = function( div_id, field_name, init_value, onsubmit_value )
|
||||
{
|
||||
var div_obj = null;
|
||||
|
||||
//----------------------------------
|
||||
// Make sure we got one...
|
||||
//----------------------------------
|
||||
|
||||
try
|
||||
{
|
||||
div_obj = document.getElementById( div_id );
|
||||
}
|
||||
catch( error )
|
||||
{
|
||||
alert( "Could not initialize field: " + div_id );
|
||||
return false;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Add hidden field to form...
|
||||
//----------------------------------
|
||||
|
||||
if ( field_name )
|
||||
{
|
||||
var field = document.createElement('input');
|
||||
|
||||
field.type = 'hidden';
|
||||
field.value = init_value;
|
||||
field.name = field_name;
|
||||
field.id = 'field--x--' + div_id;
|
||||
|
||||
this.obj_form.appendChild( field );
|
||||
|
||||
this.form_button_divs[ div_id ] = onsubmit_value;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Add event handlers...
|
||||
//----------------------------------
|
||||
|
||||
div_obj.onmouseover = this.form_button_mouseover;
|
||||
div_obj.onmouseout = this.form_button_mouseout;
|
||||
div_obj.onclick = this.form_button_submit;
|
||||
|
||||
div_obj.className = this.css_formbutton_off;
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Add EVAL event
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
form_functions.prototype.add_eval_event = function( div_id, eval_code )
|
||||
{
|
||||
var div_obj = null;
|
||||
|
||||
//----------------------------------
|
||||
// Make sure we got one...
|
||||
//----------------------------------
|
||||
|
||||
try
|
||||
{
|
||||
div_obj = document.getElementById( div_id );
|
||||
}
|
||||
catch( error )
|
||||
{
|
||||
alert( "Could not initialize event: " + div_id );
|
||||
return false;
|
||||
}
|
||||
|
||||
this.form_eval_divs[ div_id ] = eval_code;
|
||||
|
||||
//----------------------------------
|
||||
// Add event handlers...
|
||||
//----------------------------------
|
||||
|
||||
div_obj.onmouseover = this.form_button_mouseover;
|
||||
div_obj.onmouseout = this.form_button_mouseout;
|
||||
div_obj.onclick = this.form_button_eval_click;
|
||||
|
||||
div_obj.className = this.css_formbutton_off;
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Add LINK event
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
form_functions.prototype.add_link_event = function( div_id, link_url )
|
||||
{
|
||||
var div_obj = null;
|
||||
|
||||
//----------------------------------
|
||||
// Make sure we got one...
|
||||
//----------------------------------
|
||||
|
||||
try
|
||||
{
|
||||
div_obj = document.getElementById( div_id );
|
||||
}
|
||||
catch( error )
|
||||
{
|
||||
alert( "Could not initialize event: " + div_id );
|
||||
return false;
|
||||
}
|
||||
|
||||
this.form_link_divs[ div_id ] = link_url;
|
||||
|
||||
//----------------------------------
|
||||
// Add event handlers...
|
||||
//----------------------------------
|
||||
|
||||
div_obj.onmouseover = this.form_button_mouseover;
|
||||
div_obj.onmouseout = this.form_button_mouseout;
|
||||
div_obj.onclick = this.form_button_link_click;
|
||||
|
||||
div_obj.className = this.css_formbutton_off;
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Div EVAL has been clicked...
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
form_functions.prototype.form_button_eval_click = function()
|
||||
{
|
||||
try
|
||||
{
|
||||
eval( _form_functions.form_eval_divs[ this.id ] );
|
||||
}
|
||||
catch( error )
|
||||
{
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Div Link has been clicked...
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
form_functions.prototype.form_button_link_click = function()
|
||||
{
|
||||
try
|
||||
{
|
||||
window.location = _form_functions.form_link_divs[ this.id ];
|
||||
}
|
||||
catch( error )
|
||||
{
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// The form has changed...
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
form_functions.prototype.form_button_submit = function()
|
||||
{
|
||||
try
|
||||
{
|
||||
var field_obj = document.getElementById( 'field--x--' + this.id );
|
||||
field_obj.value = _form_functions.form_button_divs[ this.id ];
|
||||
}
|
||||
catch( error )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Submit..
|
||||
//----------------------------------
|
||||
|
||||
_form_functions.form_submit();
|
||||
_form_functions.obj_form.submit();
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// The form has changed...
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
form_functions.prototype.form_button_mouseover = function()
|
||||
{
|
||||
this.className = _form_functions.css_formbutton_on;
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// The form has changed...
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
form_functions.prototype.form_button_mouseout = function()
|
||||
{
|
||||
this.className = _form_functions.css_formbutton_off;
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// The form has changed...
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
form_functions.prototype.form_event_edited = function()
|
||||
{
|
||||
_form_functions.form_edited = 1;
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// The form has changed...
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
form_functions.prototype.form_submit = function()
|
||||
{
|
||||
var retval = true;
|
||||
|
||||
if ( _form_functions.form_edited )
|
||||
{
|
||||
//alert ("Form edited" );
|
||||
}
|
||||
|
||||
if ( _form_functions.form_onsubmit_saved )
|
||||
{
|
||||
eval( 'tmpsubmit = ' + _form_functions.form_onsubmit_saved );
|
||||
retval = tmpsubmit();
|
||||
}
|
||||
|
||||
return retval;
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// The form has changed...
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
form_functions.prototype.document_onblur = function()
|
||||
{
|
||||
if ( _form_functions.form_edited )
|
||||
{
|
||||
//alert ("Form edited" );
|
||||
}
|
||||
};
|
||||
@@ -1,184 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// IPS JS: Tabby Cat.
|
||||
// (c) 2005 Invision Power Services, Inc.
|
||||
// http://www.invisionpower.com
|
||||
// Matt Mecham (02/11/05)
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
var _tab_factory;
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Initiate object
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function tab_factory()
|
||||
{
|
||||
/**
|
||||
* ID: CSS: Tab off class
|
||||
*
|
||||
* @var INT
|
||||
*/
|
||||
this.css_tab_off = 'taboff';
|
||||
|
||||
/**
|
||||
* ID: Form
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
this.css_tab_on = 'tabon';
|
||||
|
||||
/**
|
||||
* String: Part tab set up
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
this.string_tab_id = 'tabtab';
|
||||
|
||||
/**
|
||||
* String: Part tab pane
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
this.string_tab_pane = 'tabpane';
|
||||
|
||||
/**
|
||||
* String: Tab array
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
this.stored_tabs = new Array();
|
||||
|
||||
/**
|
||||
* String: Panes array
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
this.stored_panes = new Array();
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Initiate object
|
||||
function tab_factory_init_tabs() { }
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
tab_factory.prototype.init_tabs = function()
|
||||
{
|
||||
//----------------------------------
|
||||
// Get page divs...
|
||||
//----------------------------------
|
||||
|
||||
var divs = document.getElementsByTagName('DIV');
|
||||
var divcount = 0;
|
||||
|
||||
_tab_factory = this;
|
||||
|
||||
//----------------------------------
|
||||
// Sort through and grab links
|
||||
//----------------------------------
|
||||
|
||||
for ( var i = 0 ; i <= divs.length ; i++ )
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( ! divs[i].id )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
catch(error)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var divid = divs[i].id;
|
||||
var divname = divid.replace( /^(.*)-(\d+)$/, "$1" );
|
||||
var divnum = this.get_id_from_text( divs[i].id );
|
||||
|
||||
//----------------------------------
|
||||
// Work with it?
|
||||
//----------------------------------
|
||||
|
||||
if ( divname == this.string_tab_id )
|
||||
{
|
||||
this.stored_tabs[ divnum ] = divs[i];
|
||||
|
||||
divs[i].style.cursor = 'pointer';
|
||||
|
||||
divs[i].onclick = this.toggle_tabs;
|
||||
|
||||
//----------------------------------
|
||||
// Set correct classes / display
|
||||
//----------------------------------
|
||||
|
||||
this.stored_panes[ divnum ] = document.getElementById( this.string_tab_pane + '-' + divnum );
|
||||
|
||||
if ( divcount == 0 )
|
||||
{
|
||||
// First tab...
|
||||
divs[i].className = this.css_tab_on;
|
||||
divs[i].style.display = 'block';
|
||||
|
||||
this.stored_panes[ divnum ].style.display = 'block';
|
||||
}
|
||||
else
|
||||
{
|
||||
// Second tab
|
||||
divs[i].className = this.css_tab_off;
|
||||
divs[i].style.display = 'block';
|
||||
|
||||
this.stored_panes[ divnum ].style.display = 'none';
|
||||
}
|
||||
|
||||
divcount++;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// The form has changed...
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
tab_factory.prototype.toggle_tabs = function(event)
|
||||
{
|
||||
//-------------------------------
|
||||
// No? Get one then
|
||||
//-------------------------------
|
||||
|
||||
var tabid = _tab_factory.get_id_from_text( this.id );
|
||||
|
||||
//-------------------------------
|
||||
// Got it?
|
||||
//-------------------------------
|
||||
|
||||
for ( var i in _tab_factory.stored_tabs )
|
||||
{
|
||||
if ( i == tabid )
|
||||
{
|
||||
_tab_factory.stored_tabs[ i ].style.display = 'block';
|
||||
_tab_factory.stored_tabs[ i ].className = _tab_factory.css_tab_on;
|
||||
_tab_factory.stored_panes[ i ].style.display = 'block';
|
||||
}
|
||||
else
|
||||
{
|
||||
_tab_factory.stored_tabs[ i ].style.display = 'block';
|
||||
_tab_factory.stored_tabs[ i ].className = _tab_factory.css_tab_off;
|
||||
_tab_factory.stored_panes[ i ].style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
// Stop scrolling to top of the page...
|
||||
ipsclass.cancel_bubble( event );
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Grab ID from string
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
tab_factory.prototype.get_id_from_text = function( id )
|
||||
{
|
||||
return id.replace( /.*\-(\d+)/, "$1" );
|
||||
};
|
||||
@@ -1,559 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// IPS JS: Content Pages Functions
|
||||
// (c) 2005 Invision Power Services, Inc.
|
||||
// http://www.invisionpower.com
|
||||
// Matt Mecham (27/07/05)
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
var _this;
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Initiate object
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
function titleedit()
|
||||
{
|
||||
this.var_ajax_url = null;
|
||||
|
||||
// Click delay
|
||||
this.var_click_delay = 1200;
|
||||
|
||||
this.var_link_id_text = 'pages-link';
|
||||
this.var_span_id_text = 'pages-page';
|
||||
this.var_div_main = 'pages-main';
|
||||
|
||||
// Language
|
||||
this.lang_click_and_hold = null;
|
||||
|
||||
// Internal stuff
|
||||
this._tid_timeout = null;
|
||||
this._new_text = null;
|
||||
this._tid_links_init = 0;
|
||||
this._tid_date = new Array();
|
||||
this._span_contents = new Array();
|
||||
this._link_contents = new Array();
|
||||
|
||||
/**
|
||||
* Array of uneditable IDs
|
||||
*
|
||||
*/
|
||||
this.UNEDITABLES = new Array();
|
||||
|
||||
/**
|
||||
* ID part of uneditable alert box
|
||||
*
|
||||
*/
|
||||
|
||||
this.uneditable_id_text = 'titleedit-uneditable';
|
||||
|
||||
// Set up divs
|
||||
this.div_main_wrap = document.getElementById( this.var_div_main );
|
||||
|
||||
/**
|
||||
* Type of edit box required
|
||||
* Allowed: text, textarea
|
||||
*/
|
||||
this.edit_box = 'text';
|
||||
this.edit_box_ta_rows = 5;
|
||||
this.edit_box_ta_cols = 45;
|
||||
|
||||
/**
|
||||
* Allows the use of a secret DIV
|
||||
* to keep the content updated
|
||||
* Leave blank to not use
|
||||
*/
|
||||
this.var_real_id_text = '';
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Initiate object
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
titleedit.prototype.init = function()
|
||||
{
|
||||
//----------------------------------
|
||||
// Get page links...
|
||||
// Gah.. another safari bug
|
||||
//----------------------------------
|
||||
|
||||
var pagelinks = document.getElementsByTagName('*');
|
||||
|
||||
_this = this;
|
||||
|
||||
//----------------------------------
|
||||
// Sort through and grab topic links
|
||||
//----------------------------------
|
||||
|
||||
for ( var i = 0 ; i <= pagelinks.length ; i++ )
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( ! pagelinks[i].id )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var linkid = pagelinks[i].id;
|
||||
var linkname = linkid.replace( /^(.*)-(\d+)$/, "$1" );
|
||||
var linknum = linkid.replace( /^(.*)-(\d+)$/, "$2" );
|
||||
|
||||
if ( linkname == this.var_link_id_text )
|
||||
{
|
||||
if ( this.UNEDITABLES[ linknum ] )
|
||||
{
|
||||
pagelinks[i].onmouseover = this.title_mouseover;
|
||||
pagelinks[i].onmouseout = this.title_mouseout;
|
||||
}
|
||||
else
|
||||
{
|
||||
pagelinks[i].onmousedown = this.title_mousedown;
|
||||
pagelinks[i].onmouseup = this.title_mouseup;
|
||||
|
||||
if ( ! this._tid_links_init )
|
||||
{
|
||||
pagelinks[i].title = pagelinks[i].title ? pagelinks[i].title + ". " + this.lang_click_and_hold : this.lang_click_and_hold;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this._tid_links_init = 1;
|
||||
};
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Mouseover: Show alert
|
||||
/*--------------------------------------------*/
|
||||
|
||||
|
||||
titleedit.prototype.title_mouseover = function( event )
|
||||
{
|
||||
//----------------------------------
|
||||
// Prevent link loading
|
||||
//----------------------------------
|
||||
|
||||
event = ipsclass.cancel_bubble( event, true );
|
||||
|
||||
//----------------------------------
|
||||
// Get TID
|
||||
//----------------------------------
|
||||
|
||||
var tid = _this.get_tid_from_id( this.id );
|
||||
|
||||
//-------------------------------
|
||||
// Unmoveable?
|
||||
//-------------------------------
|
||||
|
||||
var check_for_id = _this.UNEDITABLES[ tid ];
|
||||
|
||||
if ( check_for_id )
|
||||
{
|
||||
var alert_object = null;
|
||||
|
||||
//-------------------------------
|
||||
// Attempt to get DIV
|
||||
//-------------------------------
|
||||
|
||||
try
|
||||
{
|
||||
alert_object = document.getElementById( _this.uneditable_id_text );
|
||||
}
|
||||
catch(error)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// Yeah, so draw alert and return
|
||||
//-------------------------------
|
||||
|
||||
if ( alert_object )
|
||||
{
|
||||
var root_obj = document.getElementById( _this.var_link_id_text + '-' + check_for_id );
|
||||
|
||||
//-------------------------------
|
||||
// For some reason, Safari wants
|
||||
// to be relative..
|
||||
//-------------------------------
|
||||
|
||||
if ( is_safari )
|
||||
{
|
||||
root_obj.style.position = 'relative';
|
||||
}
|
||||
|
||||
alert_object.style.top = ipsclass.get_obj_toppos( root_obj ) - 4 + 'px';
|
||||
alert_object.style.left = ipsclass.get_obj_leftpos( root_obj ) + 5 + root_obj.offsetWidth + 'px';
|
||||
alert_object.style.position = 'absolute';
|
||||
alert_object.style.display = '';
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Mouseout: Hide alert
|
||||
/*--------------------------------------------*/
|
||||
|
||||
|
||||
titleedit.prototype.title_mouseout = function( event )
|
||||
{
|
||||
//----------------------------------
|
||||
// Prevent link loading
|
||||
//----------------------------------
|
||||
|
||||
event = ipsclass.cancel_bubble( event, true );
|
||||
|
||||
//----------------------------------
|
||||
// Get TID
|
||||
//----------------------------------
|
||||
|
||||
var tid = _this.get_tid_from_id( this.id );
|
||||
|
||||
//-------------------------------
|
||||
// Unmoveable?
|
||||
//-------------------------------
|
||||
|
||||
var check_for_id = _this.UNEDITABLES[ tid ];
|
||||
|
||||
if ( check_for_id )
|
||||
{
|
||||
var alert_object = null;
|
||||
|
||||
//-------------------------------
|
||||
// Attempt to get DIV
|
||||
//-------------------------------
|
||||
|
||||
try
|
||||
{
|
||||
alert_object = document.getElementById( _this.uneditable_id_text );
|
||||
}
|
||||
catch(error)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// Yeah, so draw alert and return
|
||||
//-------------------------------
|
||||
|
||||
if ( alert_object )
|
||||
{
|
||||
alert_object.style.display = 'none';
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Mousedown, start timer
|
||||
/*--------------------------------------------*/
|
||||
|
||||
|
||||
titleedit.prototype.title_mousedown = function( event )
|
||||
{
|
||||
//----------------------------------
|
||||
// Prevent link loading
|
||||
//----------------------------------
|
||||
|
||||
event = ipsclass.cancel_bubble( event, true );
|
||||
|
||||
//----------------------------------
|
||||
// Get TID
|
||||
//----------------------------------
|
||||
|
||||
var tid = _this.get_tid_from_id( this.id );
|
||||
|
||||
//----------------------------------
|
||||
// Start...
|
||||
//----------------------------------
|
||||
|
||||
_this._tid_date[ tid ] = _this.get_time_now();
|
||||
|
||||
//----------------------------------
|
||||
// Start loop
|
||||
//----------------------------------
|
||||
|
||||
_this._tid_timeout = setTimeout( "_this.link_event_timer("+tid+")", 5 );
|
||||
};
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Event, loop
|
||||
/*--------------------------------------------*/
|
||||
|
||||
|
||||
titleedit.prototype.link_event_timer = function( tid )
|
||||
{
|
||||
//----------------------------------
|
||||
// Get time now
|
||||
//----------------------------------
|
||||
|
||||
var timenow = this.get_time_now();
|
||||
|
||||
//----------------------------------
|
||||
// Click held for 1.5 s+?
|
||||
//----------------------------------
|
||||
|
||||
if ( timenow > 0 && this._tid_date[tid] > 0 && ( (timenow - this._tid_date[tid] ) > this.var_click_delay ) )
|
||||
{
|
||||
//----------------------------------
|
||||
// Yeah.. wipe tid time and convert
|
||||
//----------------------------------
|
||||
|
||||
this._tid_date[tid] = 0;
|
||||
this.span_to_input( tid );
|
||||
return false;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Not wiped? loop on!
|
||||
//----------------------------------
|
||||
|
||||
if ( this._tid_date[tid] > 0 )
|
||||
{
|
||||
this._tid_timeout = setTimeout( "_this.link_event_timer("+tid+")", 5 );
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Turn topic title into text input
|
||||
/*--------------------------------------------*/
|
||||
|
||||
|
||||
titleedit.prototype.span_to_input = function( tid )
|
||||
{
|
||||
//----------------------------------
|
||||
// Using fancy js?
|
||||
//----------------------------------
|
||||
|
||||
if ( ! use_enhanced_js )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
this._span_contents[ tid ] = document.getElementById( this.var_span_id_text + '-' + tid ).innerHTML;
|
||||
this._link_contents[ tid ] = document.getElementById( this.var_link_id_text + '-' + tid ).innerHTML;
|
||||
|
||||
var value = '';
|
||||
|
||||
//----------------------------------
|
||||
// Using hidden div or not?
|
||||
//----------------------------------
|
||||
|
||||
if ( this.var_real_id_text )
|
||||
{
|
||||
value = document.getElementById( this.var_real_id_text + '-' + tid ).innerHTML;
|
||||
}
|
||||
else
|
||||
{
|
||||
value = this._link_contents[ tid ];
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Show edit box
|
||||
//----------------------------------
|
||||
|
||||
if ( this.edit_box == 'text' )
|
||||
{
|
||||
value = value.replace( /"/g, '"');
|
||||
document.getElementById(this.var_span_id_text + '-' + tid ).innerHTML = '<input id="edit-'+tid+'" class="dny-edit-title" type="text" size="30" onblur="_this.edit_blur(\''+tid+'\')" onkeypress="_this.edit_keypress(event, \''+tid+'\')" value="'+value+'" />';
|
||||
}
|
||||
else
|
||||
{
|
||||
value = value.replace( /<\/textarea>/g, '</textarea>');
|
||||
document.getElementById(this.var_span_id_text + '-' + tid ).innerHTML = '<textarea id="edit-'+tid+'" class="dny-edit-title" cols="'+this.edit_box_ta_cols+'" rows="'+this.edit_box_ta_rows+'" onblur="_this.edit_blur(\''+tid+'\')" onkeypress="_this.edit_keypress(event, \''+tid+'\')">'+value+'</textarea>';
|
||||
}
|
||||
|
||||
document.getElementById( 'edit-' + tid ).focus();
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Mouseup? Cancel timer to kill the loop
|
||||
/*--------------------------------------------*/
|
||||
|
||||
titleedit.prototype.title_mouseup = function( event )
|
||||
{
|
||||
//----------------------------------
|
||||
// Prevent link loading
|
||||
//----------------------------------
|
||||
|
||||
event = ipsclass.cancel_bubble( event, true );
|
||||
|
||||
//----------------------------------
|
||||
// Get TID
|
||||
//----------------------------------
|
||||
|
||||
var tid = _this.get_tid_from_id( this.id );
|
||||
|
||||
//----------------------------------
|
||||
// Reset timer
|
||||
//----------------------------------
|
||||
|
||||
_this._tid_date[tid] = 0;
|
||||
};
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// BLUR HANDLER
|
||||
/*--------------------------------------------*/
|
||||
|
||||
|
||||
titleedit.prototype.edit_blur = function( tid, type )
|
||||
{
|
||||
_this._new_text = document.getElementById( 'edit-' + tid ).value;
|
||||
|
||||
if ( _this._new_text != "" )
|
||||
{
|
||||
_this.title_save( tid, _this._new_text, type );
|
||||
}
|
||||
};
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// KEY PRESS HANDLER
|
||||
/*--------------------------------------------*/
|
||||
|
||||
|
||||
titleedit.prototype.edit_keypress = function( evt, tid, type )
|
||||
{
|
||||
evt = (evt) ? evt : window.event;
|
||||
_this._new_text = document.getElementById( 'edit-' + tid ).value;
|
||||
|
||||
// Make sure we're not using a text area
|
||||
if ( _this.edit_box == 'text' )
|
||||
{
|
||||
if ( ( evt.keyCode == 13 || evt.keyCode == 3 ) && _this._new_text != "" )
|
||||
{
|
||||
_this.title_save( tid, _this._new_text, type );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// UDPATE DB
|
||||
/*--------------------------------------------*/
|
||||
|
||||
|
||||
titleedit.prototype.title_save = function( tid, new_text, type )
|
||||
{
|
||||
var donotedit = 0;
|
||||
|
||||
if ( new_text == _this._span_contents[ tid ] )
|
||||
{
|
||||
donotedit = 1;
|
||||
}
|
||||
|
||||
document.getElementById( _this.var_span_id_text + '-' + tid ).innerHTML = _this._span_contents[ tid ];
|
||||
document.getElementById( _this.var_link_id_text + '-' + tid ).innerHTML = new_text;
|
||||
|
||||
//----------------------------------
|
||||
// Using hidden div or not?
|
||||
//----------------------------------
|
||||
|
||||
if ( _this.var_real_id_text )
|
||||
{
|
||||
document.getElementById( _this.var_real_id_text + '-' + tid ).innerHTML = new_text;
|
||||
}
|
||||
|
||||
//----------------------------------
|
||||
// Re-check topic links
|
||||
//----------------------------------
|
||||
|
||||
_this.init();
|
||||
|
||||
if ( donotedit )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var fields = new Array();
|
||||
|
||||
//----------------------------------
|
||||
// Populate fields
|
||||
//----------------------------------
|
||||
|
||||
fields['tid'] = tid;
|
||||
fields['name'] = new_text;
|
||||
fields['md5check'] = ipb_md5_check;
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Main function to do on request
|
||||
// Must be defined first!!
|
||||
/*--------------------------------------------*/
|
||||
|
||||
do_request_function = function()
|
||||
{
|
||||
//----------------------------------
|
||||
// Ignore unless we're ready to go
|
||||
//----------------------------------
|
||||
|
||||
if ( ! xmlobj.readystate_ready_and_ok() )
|
||||
{
|
||||
xmlobj.show_loading("Saving...");
|
||||
return;
|
||||
}
|
||||
|
||||
xmlobj.hide_loading();
|
||||
|
||||
//----------------------------------
|
||||
// INIT
|
||||
//----------------------------------
|
||||
|
||||
var returned = xmlobj.xmlhandler.responseText;
|
||||
|
||||
if ( returned.match( /<null>(0|-|\=)<\/null>/ ) )
|
||||
{
|
||||
alert( "Error occured, not saved" );
|
||||
}
|
||||
};
|
||||
|
||||
//----------------------------------
|
||||
// LOAD XML
|
||||
//----------------------------------
|
||||
|
||||
xmlobj = new ajax_request();
|
||||
xmlobj.onreadystatechange( do_request_function );
|
||||
xmlobj.process( _this.var_ajax_url, 'POST', xmlobj.format_for_post(fields) );
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Get time now
|
||||
/*--------------------------------------------*/
|
||||
|
||||
|
||||
titleedit.prototype.get_time_now = function()
|
||||
{
|
||||
var mydate = new Date();
|
||||
return mydate.getTime();
|
||||
};
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Get TID from ID
|
||||
/*--------------------------------------------*/
|
||||
|
||||
|
||||
titleedit.prototype.get_tid_from_id = function( id )
|
||||
{
|
||||
return id.replace( /.*\-(\d+)/, "$1" );
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Add ID to UNMOVEABLES array
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
titleedit.prototype.add_id_to_uneditables = function( tid )
|
||||
{
|
||||
this.UNEDITABLES[ tid ] = tid;
|
||||
};
|
||||
@@ -1,299 +0,0 @@
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// Title: Tigra Calendar
|
||||
// URL: http://www.softcomplex.com/products/tigra_calendar/
|
||||
// Version: 3.2 (American date format)
|
||||
// Date: 10/14/2002 (mm/dd/yyyy)
|
||||
// Note: Permission given to use this script in ANY kind of applications if
|
||||
// header lines are left unchanged.
|
||||
// Note: Script consists of two files: calendar?.js and calendar.html
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// if two digit year input dates after this year
|
||||
// considered 20 century.
|
||||
/*--------------------------------------------*/
|
||||
|
||||
var NUM_CENTYEAR = 30;
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// is time input control required by default
|
||||
/*--------------------------------------------*/
|
||||
|
||||
var BUL_TIMECOMPONENT = false;
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// are year scrolling buttons required by default
|
||||
/*--------------------------------------------*/
|
||||
|
||||
var BUL_YEARSCROLL = true;
|
||||
|
||||
var calendars = [];
|
||||
var RE_NUM = /^\-?\d+$/;
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Create object
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function calendar_us(obj_target)
|
||||
{
|
||||
//-------------------------------
|
||||
// assigning methods
|
||||
//-------------------------------
|
||||
|
||||
this.gen_date = cal_gen_date2;
|
||||
this.gen_time = cal_gen_time2;
|
||||
this.gen_tsmp = cal_gen_tsmp2;
|
||||
this.prs_date = cal_prs_date2;
|
||||
this.prs_time = cal_prs_time2;
|
||||
this.prs_tsmp = cal_prs_tsmp2;
|
||||
this.popup = cal_popup2;
|
||||
|
||||
//-------------------------------
|
||||
// validate input parameters
|
||||
//-------------------------------
|
||||
|
||||
if (!obj_target)
|
||||
{
|
||||
return cal_error("Error calling the calendar: no target control specified");
|
||||
}
|
||||
|
||||
if (obj_target.value == null)
|
||||
{
|
||||
return cal_error("Error calling the calendar: parameter specified is not valid target control");
|
||||
}
|
||||
|
||||
this.target = obj_target;
|
||||
this.time_comp = BUL_TIMECOMPONENT;
|
||||
this.year_scroll = BUL_YEARSCROLL;
|
||||
|
||||
//-------------------------------
|
||||
// register in global collections
|
||||
//-------------------------------
|
||||
|
||||
this.id = calendars.length;
|
||||
calendars[this.id] = this;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// POP-UP Calendar
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function cal_popup2 (str_datetime, already_opened)
|
||||
{
|
||||
this.dt_current = this.prs_tsmp(str_datetime ? str_datetime : this.target.value);
|
||||
|
||||
if (!this.dt_current)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// If already open, don't load path...
|
||||
//-------------------------------
|
||||
|
||||
if ( already_opened )
|
||||
{
|
||||
calendar_url = 'calendar.html';
|
||||
}
|
||||
else
|
||||
{
|
||||
calendar_url = ipb_skin_url + '/calendar.html';
|
||||
}
|
||||
|
||||
var obj_calwindow = window.open(
|
||||
calendar_url + '?datetime=' + this.dt_current.valueOf()+ '&id=' + this.id,
|
||||
'Calendar', 'width=200,height='+(this.time_comp ? 215 : 190)+
|
||||
',status=no,resizable=no,top=200,left=200,dependent=yes,alwaysRaised=yes'
|
||||
);
|
||||
|
||||
obj_calwindow.opener = window;
|
||||
obj_calwindow.focus();
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// timestamp generating function
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function cal_gen_tsmp2 (dt_datetime)
|
||||
{
|
||||
return(this.gen_date(dt_datetime) + ' ' + this.gen_time(dt_datetime));
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// date generating function
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function cal_gen_date2 (dt_datetime)
|
||||
{
|
||||
return (
|
||||
(dt_datetime.getMonth() < 9 ? '0' : '') + (dt_datetime.getMonth() + 1) + "/"
|
||||
+ (dt_datetime.getDate() < 10 ? '0' : '') + dt_datetime.getDate() + "/"
|
||||
+ dt_datetime.getFullYear()
|
||||
);
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// time generating function
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function cal_gen_time2 (dt_datetime)
|
||||
{
|
||||
return (
|
||||
(dt_datetime.getHours() < 10 ? '0' : '') + dt_datetime.getHours() + ":"
|
||||
+ (dt_datetime.getMinutes() < 10 ? '0' : '') + (dt_datetime.getMinutes()) + ":"
|
||||
+ (dt_datetime.getSeconds() < 10 ? '0' : '') + (dt_datetime.getSeconds())
|
||||
);
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// timestamp parsing function
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function cal_prs_tsmp2 (str_datetime)
|
||||
{
|
||||
//-------------------------------
|
||||
// if no parameter specified return current timestamp
|
||||
//-------------------------------
|
||||
|
||||
if (!str_datetime)
|
||||
{
|
||||
return (new Date());
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// if positive integer treat as milliseconds from epoch
|
||||
//-------------------------------
|
||||
|
||||
if (RE_NUM.exec(str_datetime))
|
||||
{
|
||||
return new Date(str_datetime);
|
||||
}
|
||||
|
||||
//-------------------------------
|
||||
// else treat as date in string format
|
||||
//-------------------------------
|
||||
|
||||
var arr_datetime = str_datetime.split(' ');
|
||||
|
||||
return this.prs_time(arr_datetime[1], this.prs_date(arr_datetime[0]));
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// date parsing function
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function cal_prs_date2 (str_date)
|
||||
{
|
||||
var arr_date = str_date.split('/');
|
||||
|
||||
if (arr_date.length != 3) return alert ("Invalid date format: '" + str_date + "'.\nFormat accepted is dd-mm-yyyy.");
|
||||
if (!arr_date[1]) return alert ("Invalid date format: '" + str_date + "'.\nNo day of month value can be found.");
|
||||
if (!RE_NUM.exec(arr_date[1])) return alert ("Invalid day of month value: '" + arr_date[1] + "'.\nAllowed values are unsigned integers.");
|
||||
if (!arr_date[0]) return alert ("Invalid date format: '" + str_date + "'.\nNo month value can be found.");
|
||||
if (!RE_NUM.exec(arr_date[0])) return alert ("Invalid month value: '" + arr_date[0] + "'.\nAllowed values are unsigned integers.");
|
||||
if (!arr_date[2]) return alert ("Invalid date format: '" + str_date + "'.\nNo year value can be found.");
|
||||
if (!RE_NUM.exec(arr_date[2])) return alert ("Invalid year value: '" + arr_date[2] + "'.\nAllowed values are unsigned integers.");
|
||||
|
||||
var dt_date = new Date();
|
||||
dt_date.setDate(1);
|
||||
|
||||
if (arr_date[0] < 1 || arr_date[0] > 12) return alert ("Invalid month value: '" + arr_date[0] + "'.\nAllowed range is 01-12.");
|
||||
dt_date.setMonth(arr_date[0]-1);
|
||||
|
||||
if (arr_date[2] < 100) arr_date[2] = Number(arr_date[2]) + (arr_date[2] < NUM_CENTYEAR ? 2000 : 1900);
|
||||
dt_date.setFullYear(arr_date[2]);
|
||||
|
||||
var dt_numdays = new Date(arr_date[2], arr_date[0], 0);
|
||||
dt_date.setDate(arr_date[1]);
|
||||
if (dt_date.getMonth() != (arr_date[0]-1)) return alert ("Invalid day of month value: '" + arr_date[1] + "'.\nAllowed range is 01-"+dt_numdays.getDate()+".");
|
||||
|
||||
return (dt_date)
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// time parsing function
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function cal_prs_time2 (str_time, dt_date)
|
||||
{
|
||||
if (!dt_date)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var arr_time = String(str_time ? str_time : '').split(':');
|
||||
|
||||
if (!arr_time[0])
|
||||
{
|
||||
dt_date.setHours(0);
|
||||
}
|
||||
else if (RE_NUM.exec(arr_time[0]))
|
||||
{
|
||||
if (arr_time[0] < 24)
|
||||
{
|
||||
dt_date.setHours(arr_time[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
return cal_error ("Invalid hours value: '" + arr_time[0] + "'.\nAllowed range is 00-23.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return cal_error ("Invalid hours value: '" + arr_time[0] + "'.\nAllowed values are unsigned integers.");
|
||||
}
|
||||
|
||||
if (!arr_time[1])
|
||||
{
|
||||
dt_date.setMinutes(0);
|
||||
}
|
||||
else if (RE_NUM.exec(arr_time[1]))
|
||||
{
|
||||
if (arr_time[1] < 60)
|
||||
{
|
||||
dt_date.setMinutes(arr_time[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
return cal_error ("Invalid minutes value: '" + arr_time[1] + "'.\nAllowed range is 00-59.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return cal_error ("Invalid minutes value: '" + arr_time[1] + "'.\nAllowed values are unsigned integers.");
|
||||
}
|
||||
|
||||
if (!arr_time[2])
|
||||
{
|
||||
dt_date.setSeconds(0);
|
||||
}
|
||||
|
||||
else if (RE_NUM.exec(arr_time[2]))
|
||||
{
|
||||
if (arr_time[2] < 60)
|
||||
{
|
||||
dt_date.setSeconds(arr_time[2]);
|
||||
}
|
||||
else
|
||||
{
|
||||
return cal_error ("Invalid seconds value: '" + arr_time[2] + "'.\nAllowed range is 00-59.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return cal_error ("Invalid seconds value: '" + arr_time[2] + "'.\nAllowed values are unsigned integers.");
|
||||
}
|
||||
|
||||
dt_date.setMilliseconds(0);
|
||||
return dt_date;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
// Error
|
||||
/*--------------------------------------------*/
|
||||
|
||||
function cal_error (str_message)
|
||||
{
|
||||
alert (str_message);
|
||||
return null;
|
||||
}
|
||||
@@ -1,147 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// IPS JS: HIERARCHICAL DISPLAY FUNCTIONS
|
||||
// (c) 2005 Invision Power Services, Inc.
|
||||
// http://www.invisionpower.com
|
||||
// Matt Mecham (13/12/05)
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
function hierarchical()
|
||||
{
|
||||
/**
|
||||
* Class variables.
|
||||
*
|
||||
* @var string Cookie name
|
||||
* @var string Refresh display URL
|
||||
* @var string First part of the image ID title string
|
||||
*/
|
||||
|
||||
this.cookie_name = '';
|
||||
this.location_url = '';
|
||||
this.toggle_image_id_name = 'hier-toggle';
|
||||
|
||||
/**
|
||||
* INIT: Grabs IDs from the HTML and
|
||||
* sets up the various functions
|
||||
*/
|
||||
|
||||
this.init = function()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Do DIVs
|
||||
//-----------------------------------------
|
||||
|
||||
var divs = document.getElementsByTagName('IMG');
|
||||
|
||||
//----------------------------------
|
||||
// Sort through and grab links
|
||||
//----------------------------------
|
||||
|
||||
for ( var i = 0 ; i < divs.length ; i++ )
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( ! divs[i].id )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
catch(error)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var divid = divs[i].id;
|
||||
var divname = ipsclass.get_name_from_text( divid );
|
||||
var divnum = ipsclass.get_id_from_text( divid );
|
||||
|
||||
//----------------------------------
|
||||
// Work with it?
|
||||
//----------------------------------
|
||||
|
||||
if ( divname == this.toggle_image_id_name )
|
||||
{
|
||||
divs[i].style.cursor = 'pointer';
|
||||
divs[i].toggle_image_id_name = this.toggle_image_id_name;
|
||||
divs[i].location_url = this.location_url;
|
||||
divs[i].cookie_name = this.cookie_name;
|
||||
divs[i].toggle_id = divnum;
|
||||
divs[i].onclick = hierarchical_events.prototype.toggle_folder;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper function
|
||||
*/
|
||||
function hierarchical_events()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle Folder Action
|
||||
* @param object Event Object
|
||||
*/
|
||||
hierarchical_events.prototype.toggle_folder = function( e )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Check..
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! this.cookie_name )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Cancel event bubbling
|
||||
//-----------------------------------------
|
||||
|
||||
e = ipsclass.cancel_bubble(e, true);
|
||||
|
||||
//-----------------------------------------
|
||||
// Set up
|
||||
//-----------------------------------------
|
||||
|
||||
var saved = new Array();
|
||||
var clean = new Array();
|
||||
var found_id = 0;
|
||||
|
||||
//-----------------------------------
|
||||
// Get any saved info
|
||||
//-----------------------------------
|
||||
|
||||
if ( tmp = ipsclass.my_getcookie( this.cookie_name ) )
|
||||
{
|
||||
saved = tmp.split(",");
|
||||
}
|
||||
|
||||
//-----------------------------------
|
||||
// Remove bit if exists
|
||||
//-----------------------------------
|
||||
|
||||
for( i = 0 ; i < saved.length; i++ )
|
||||
{
|
||||
if ( saved[i] != this.toggle_id && saved[i] != "" )
|
||||
{
|
||||
clean[clean.length] = saved[i];
|
||||
}
|
||||
else if ( saved[i] == this.toggle_id )
|
||||
{
|
||||
found_id = 1;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------
|
||||
// Not found the ID, so add it
|
||||
//-----------------------------------
|
||||
|
||||
if ( ! found_id )
|
||||
{
|
||||
clean[ clean.length ] = this.toggle_id;
|
||||
}
|
||||
|
||||
ipsclass.my_setcookie( this.cookie_name, clean.join(','), 1 );
|
||||
ipsclass.location_jump( this.location_url, true );
|
||||
};
|
||||
@@ -1,232 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
|
||||
<title>Invision Power Board Install Guide: Welcome</title>
|
||||
<style type='text/css' media='all'>
|
||||
@import url('docs.css');
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h2>File Structure and CHMOD values</h2>
|
||||
<br />
|
||||
<div class='content-text'>
|
||||
Below is a table showing the file structure and recommended CHMOD values for the file (and in the case of directories, the CHMOD
|
||||
values for the contents of the directories).<br>The CHMOD values are not needed for Windows based servers and can be safely ignored. The CHMOD
|
||||
values may vary from system to system, if in doubt, CHMOD everything to 0777.<br>Most systems will not need to CHMOD everything to install successfully,
|
||||
use the table below to determine what needs CHMOD'ding for installation, and what can be left until later.
|
||||
</div>
|
||||
|
||||
<table width='100%' align='center' cellpadding='4' cellspacing='0'>
|
||||
<tr>
|
||||
<td align='center'>
|
||||
<table width='100%' align='center' cellpadding='0' cellspacing='0' bgcolor='#BCBCBC'>
|
||||
<tr>
|
||||
<td>
|
||||
<table width='100%' align='center' cellpadding='4' cellspacing='1'>
|
||||
<tr>
|
||||
<td width='5%' bgcolor='#EEEEEE' style='font-size:10px'> </td>
|
||||
<td width='25%' bgcolor='#EEEEEE' style='font-size:10px'><b>File/Folder Name</b></td>
|
||||
<td width='20%' bgcolor='#EEEEEE' style='font-size:10px' align='center'><b>Item CHMOD Value</b></td>
|
||||
<td width='30%' bgcolor='#EEEEEE' style='font-size:10px' align='center'><b>Contents CHMOD Value</b></td>
|
||||
<td width='15%' bgcolor='#EEEEEE' style='font-size:10px' align='center'><b>CHMOD for install</b></td>
|
||||
<td width='15%' bgcolor='#EEEEEE' style='font-size:10px' align='center'><b>Can CHMOD later</b></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'><img src='images/folder.gif' border='0' alt='PHP file'></td>
|
||||
<td align='left' valign='middle' bgcolor='#FFFFFF'>admin</td>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'><span style='color:red'><b>YES</b></span></a>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'><img src='images/folder.gif' border='0' alt='folder'></td>
|
||||
<td align='left' valign='middle' bgcolor='#FFFFFF'><span style='color:blue'>cache</span></td>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>0755</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'><span style='color:red'><b>YES</b></span></a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'><img src='images/folder.gif' border='0' alt='folder'></td>
|
||||
<td align='left' valign='middle' bgcolor='#FFFFFF'><span style='color:blue'>cache/skin_cache</span></td>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>0755</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'><span style='color:red'><b>YES</b></span></a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'><img src='images/folder.gif' border='0' alt='folder'></td>
|
||||
<td align='left' valign='middle' bgcolor='#FFFFFF'><span style='color:blue'>cache/lang_cache</span></td>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>0755</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'><img src='images/file.gif' border='0' alt='PHP file'></td>
|
||||
<td align='left' valign='middle' bgcolor='#FFFFFF'>conf_global.php.dist</td>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>0666</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'><span style='color:red'><b>YES</b></span></a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'><img src='images/file.gif' border='0' alt='PHP file'></td>
|
||||
<td align='left' valign='middle' bgcolor='#FFFFFF'>index.php</td>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'><img src='images/folder.gif' border='0' alt='folder'></td>
|
||||
<td align='left' valign='middle' bgcolor='#FFFFFF'><span style='color:blue'>install</span></td>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'><img src='images/folder.gif' border='0' alt='folder'></td>
|
||||
<td align='left' valign='middle' bgcolor='#FFFFFF'><span style='color:blue'>ips_kernel</span></td>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'><img src='images/folder.gif' border='0' alt='folder'></td>
|
||||
<td align='left' valign='middle' bgcolor='#FFFFFF'><span style='color:blue'>jscripts</span></td>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'><img src='images/folder.gif' border='0' alt='folder'></td>
|
||||
<td align='left' valign='middle' bgcolor='#FFFFFF'><span style='color:blue'>lofiversion</span></td>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'><img src='images/folder.gif' border='0' alt='folder'></td>
|
||||
<td align='left' valign='middle' bgcolor='#FFFFFF'><span style='color:blue'>modules</span></td>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'><img src='images/folder.gif' border='0' alt='folder'></td>
|
||||
<td align='left' valign='middle' bgcolor='#FFFFFF'><span style='color:blue'>resources</span></td>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'><img src='images/folder.gif' border='0' alt='folder'></td>
|
||||
<td align='left' valign='middle' bgcolor='#FFFFFF'><span style='color:blue'>retail</span></td>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'><img src='images/folder.gif' border='0' alt='folder'></td>
|
||||
<td align='left' valign='middle' bgcolor='#FFFFFF'><span style='color:blue'>skin_acp</span></td>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'><img src='images/folder.gif' border='0' alt='folder'></td>
|
||||
<td align='left' valign='middle' bgcolor='#FFFFFF'><span style='color:blue'>sources</span></td>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'><img src='images/folder.gif' border='0' alt='folder'></td>
|
||||
<td align='left' valign='middle' bgcolor='#FFFFFF'><span style='color:blue'>style_avatars</span></td>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'><img src='images/folder.gif' border='0' alt='folder'></td>
|
||||
<td align='left' valign='middle' bgcolor='#FFFFFF'><span style='color:blue'>style_captcha</span></td>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'><img src='images/folder.gif' border='0' alt='folder'></td>
|
||||
<td align='left' valign='middle' bgcolor='#FFFFFF'><span style='color:blue'>style_emoticons</span></td>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>0755</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'><span style='color:red'><b>YES</b></span></a>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'><img src='images/folder.gif' border='0' alt='folder'></td>
|
||||
<td align='left' valign='middle' bgcolor='#FFFFFF'><span style='color:blue'>style_images</span></td>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>0755</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'><img src='images/folder.gif' border='0' alt='folder'></td>
|
||||
<td align='left' valign='middle' bgcolor='#FFFFFF'><span style='color:blue'>upgrade</span></td>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'><img src='images/folder.gif' border='0' alt='folder'></td>
|
||||
<td align='left' valign='middle' bgcolor='#FFFFFF'><span style='color:blue'>uploads</span></td>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>0777</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'><span style='color:red'><b>YES</b></span></a>
|
||||
<td align='center' valign='middle' bgcolor='#FFFFFF'>-</a>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,228 +0,0 @@
|
||||
BODY
|
||||
{
|
||||
background-color: #ffffff;
|
||||
font-family: Verdana, Tahoma, "Lucida Sans", "Lucida Sans Unicode", Arial, Sans-serif;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
#ipswrapper {
|
||||
width: 100%;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.main_shell {
|
||||
background-color: #6999DA;
|
||||
border: 1px solid #24426A;
|
||||
width: 706px;
|
||||
margin-left:auto;
|
||||
margin-right:auto;
|
||||
}
|
||||
|
||||
H1 {
|
||||
margin: 0px;
|
||||
background-image: url('images/title_bar.gif');
|
||||
padding: 7px 5px 6px 5px;
|
||||
font-size: 13px;
|
||||
color: #ffffff;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
H2 {
|
||||
margin: 0px;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
H3 {
|
||||
font-size: 11px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
TABLE {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.content-text
|
||||
{
|
||||
font-size: 12px;
|
||||
line-height: 150%;
|
||||
}
|
||||
|
||||
.content-next
|
||||
{
|
||||
margin-top: 10px;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
background-color: #EEE;
|
||||
padding: 6px;
|
||||
}
|
||||
|
||||
.content_shell {
|
||||
|
||||
margin: 0px 3px 3px 3px;
|
||||
border: 1px solid #24426A;
|
||||
border-top: 3px solid #24426A;
|
||||
background-image: url('images/main_bg.gif');
|
||||
background-repeat: repeat-x;
|
||||
background-color: #EFF2F7;
|
||||
}
|
||||
|
||||
.package {
|
||||
height: 517px;
|
||||
background-image: url('images/package_bg.gif');
|
||||
background-repeat: no-repeat;
|
||||
background-position: top-left;
|
||||
}
|
||||
|
||||
.content_wrap {
|
||||
width: 70%;
|
||||
height: 450px;
|
||||
float: right;
|
||||
margin: 6px 6px 4px 0px;
|
||||
padding: 10px;
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #000000;
|
||||
line-height: 150%;
|
||||
overflow-y:auto;
|
||||
overflow-x:hidden;
|
||||
-moz-border-radius: 10px;
|
||||
}
|
||||
|
||||
.install_info {
|
||||
float: left;
|
||||
margin: 10px 0px 0px 10px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.install_info H3 {
|
||||
font-size: 15px;
|
||||
color: #6D87A9;
|
||||
}
|
||||
|
||||
.install_info UL {
|
||||
margin: 0px;
|
||||
margin-top: 15px;
|
||||
padding-left: 25px;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
#progress .step_done {
|
||||
list-style-image: url('images/bullet_done.gif');
|
||||
color: #44638E;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
#progress .step_doing {
|
||||
list-style-image: url('images/bullet_doing.gif');
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#progress .step_notdone {
|
||||
list-style-image: url('images/bullet_notdone.gif');
|
||||
}
|
||||
|
||||
.warning {
|
||||
background-color: #EDF1AB;
|
||||
border: 1px solid #6E704B;
|
||||
padding: 5px;
|
||||
font-weight: bold;
|
||||
-moz-border-radius: 5px;
|
||||
|
||||
}
|
||||
|
||||
.hr {
|
||||
margin: 4px 6px 0px 6px;
|
||||
border-bottom: 1px solid #627686;
|
||||
}
|
||||
|
||||
.nav_button {
|
||||
background-color: #B3C9E6;
|
||||
border: 1px solid #24426A;
|
||||
font-size: 12px;
|
||||
padding: 3px 6px 3px 6px;
|
||||
-moz-border-radius: 5px;
|
||||
}
|
||||
|
||||
.copyright {
|
||||
width: 98%;
|
||||
text-align: right;
|
||||
font-size: 9px;
|
||||
color: #9EA7B3;
|
||||
padding-top: 3px;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
.eula {
|
||||
height: 210px;
|
||||
border: 1px solid #76774C;
|
||||
background-color: #FDFDD3;
|
||||
padding: 5px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
#auto_progress LI {
|
||||
list-style: none;
|
||||
color: #029901;
|
||||
font-size: 11px;
|
||||
font-weight: bold;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
.done_text {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#links {
|
||||
margin: 0px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
#links LI {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.float_img {
|
||||
float: left;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.info {
|
||||
background-color: #DCE6F3;
|
||||
border: 1px solid #5876A0;
|
||||
padding: 4px;
|
||||
line-height: 120%;
|
||||
-moz-border-radius: 7px;
|
||||
color: #1D3A60;
|
||||
}
|
||||
|
||||
.sql_form {
|
||||
width: 100%;
|
||||
font-size: 11px;
|
||||
border-top: 1px solid #6A6A6A;
|
||||
border-left: 1px solid #6A6A6A;
|
||||
border-right: 1px solid #A8A8A8;
|
||||
border-bottom: 1px solid #A8A8A8;
|
||||
}
|
||||
|
||||
FIELDSET {
|
||||
border: 1px solid #2D4461;
|
||||
background-color: #E6EBF1;
|
||||
margin-top: 5px;
|
||||
padding: 7px;
|
||||
-moz-border-radius: 7px;
|
||||
color: #2D4461;
|
||||
}
|
||||
|
||||
FIELDSET LEGEND {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
TABLE .title {
|
||||
color: #2D4461;
|
||||
font-weight: bold;
|
||||
padding-bottom: 3px;
|
||||
}
|
||||
|
||||
TABLE .content {
|
||||
padding-bottom: 3px;
|
||||
}
|
||||
@@ -1,293 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
|
||||
"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
|
||||
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
|
||||
|
||||
<title>Invision Install Guide: Help & FAQ</title>
|
||||
|
||||
<style>
|
||||
|
||||
BODY, TABLE { font-family: verdana, arial; font-size:12px; line-height:150% }
|
||||
|
||||
.title { background-image: url(tile_back.gif); font-family:arial; font-size:18px; color:white; font-weight:bold; height:40px }
|
||||
|
||||
.table1 { border:1px solid #999999 }
|
||||
|
||||
.table2 { border:1px dotted #999999 }
|
||||
|
||||
.menustrip { font-color:black; background-color:#EEEEEE; font-size:12px; height:24px }
|
||||
|
||||
a:link, a:visited, a:active { color:#000055 }
|
||||
|
||||
a:hover { color:#333377;text-decoration:underline }
|
||||
|
||||
.header { border-bottom:1px dashed #999999; font-family:Verdana, Arial; font-weight:bold; color:#4C77B6; font-size:20px; background-color:#FEFEFE; letter-spacing:-1px }
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body bgcolor="#FFFFFF" topmargin='5' leftmargin='0'>
|
||||
|
||||
|
||||
|
||||
<!-- Start content -->
|
||||
|
||||
|
||||
|
||||
<a name='top'></a>
|
||||
|
||||
<table width='95%' align='center' cellpadding='4' cellspacing='0'>
|
||||
|
||||
<tr>
|
||||
|
||||
<td align='center'>
|
||||
|
||||
<b>Sections:</b> <a href='help.html#install' target='bottom'>Installation Problems</a> | <a href='help.html#admin' target='bottom'>Admin CP Problems</a> | <a href='help.html#main' target='bottom'>Board Problems</a> | <a href='help.html#help' target='bottom'>Getting Further Help</a>
|
||||
|
||||
</td></tr>
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
|
||||
|
||||
<a name='install'></a>
|
||||
|
||||
<table width='95%' align='center' cellpadding='4' cellspacing='0'>
|
||||
|
||||
<tr>
|
||||
|
||||
<td class='header' align='left'>Installation Problems</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
|
||||
<td align='left'>
|
||||
|
||||
<b>When I run the installer, I get a page of code.</b>
|
||||
|
||||
<br>
|
||||
|
||||
If when accessing the installer via your web browser you receive a page of code and not the installation start screen, this means that either PHP has
|
||||
|
||||
not been installed or has not been configured properly. Please consult with your web host to see if this is the case.
|
||||
|
||||
<br><br>
|
||||
|
||||
<b>I get an error like this 'access denied for user@localhost using password YES' when I submit the main form.</b>
|
||||
|
||||
<br>
|
||||
|
||||
If you receive this error from mySQL it means that either the mySQL database name, mySQL username, mySQL password or mySQL host information is wrong. Please double check the information you
|
||||
|
||||
entered making sure that passwords are typed correctly. In some cases, this information is case sensitive. If this error persists, please consult with your web host to check that the information
|
||||
|
||||
you have is correct.
|
||||
|
||||
<br><br>
|
||||
|
||||
<b>After installing, I get this error 'Warning: fopen("/.install.lock", "w") - Permission denied ...'</b>
|
||||
|
||||
<br>
|
||||
|
||||
After installing, Invision Power Board attempts to create a "lock" file which disables the installation script. If you receive this error, the installer
|
||||
|
||||
has not been able to create this file. After you have logged into the Admin Center for the first time, you should remove the "install/index.php" script
|
||||
|
||||
from your server and only re-upload it if you wish to make a fresh install. You can then safely ignore this warning.
|
||||
|
||||
<br><br>
|
||||
|
||||
<b>When installing I get an error like this: 'WARNING! Could not locate 'conf_global.php'</b>
|
||||
|
||||
<br>
|
||||
|
||||
This error means that the installer could not "guess" the location of the file 'conf_global.php'. Make sure you have uploaded this file into the same directory that you
|
||||
|
||||
uploaded 'sm_install.php' into. If you have this file already uploaded and the CHMOD value has been set, then you can tell the installer where to look for this file by simply
|
||||
|
||||
opening 'sm_install.php' in your favourite text editor. Look near the top for "$root = "./";". Edit this to reflect your "real" path. Note, this is a path - not a URL, entering "http://www.domain.com" or similar will
|
||||
|
||||
result in an error. A path is literally the file path from the server root to the current directory (such as '/home/site/public_html/forums/'). More information is provided in the script near the top. When you have completed
|
||||
|
||||
the edit, simply save the file and re-upload to your server and re-run through your web browser.
|
||||
|
||||
</td></tr>
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
|
||||
|
||||
<a name='admin'></a>
|
||||
|
||||
<table width='95%' align='center' cellpadding='4' cellspacing='0'>
|
||||
|
||||
<tr>
|
||||
|
||||
<td class='header' align='left'>Admin CP Problems</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
|
||||
<td align='left'>
|
||||
|
||||
<b>No matter what I do, I can't stay logged into the Admin CP.</b>
|
||||
|
||||
<br>
|
||||
|
||||
For extra security, the Admin CP checks your IP address as part of the admin session validation. In some cases your IP address will change with each page request (especially if you are using a dial up ISP). You can
|
||||
|
||||
stop the Admin CP checking your IP address which will solve the problem.
|
||||
|
||||
<br>To do this, open up "admin.php" in your text editor. Near the top of the script change <span style='color:red'>$check_ip = 1;</span> to <span style='color:red'>$check_ip = 0;</span>. Save the file and re-upload to your
|
||||
|
||||
server.
|
||||
|
||||
<br>Although there is no immediate security risk to doing this, you should not disclose your admin session ID to anyone or post the link you are using for that admin CP session to anyone.
|
||||
|
||||
<br><br>
|
||||
|
||||
<b>When I try to access the Admin CP, the page is completely blank</b>
|
||||
|
||||
<br>
|
||||
|
||||
This problem could be the result of a few things.<br>
|
||||
|
||||
Firstly, open up "admin.php" in a text editor and near the top change: <span style='color:red'>$use_gzip = 1;</span> to <span style='color:red'>$use_gzip = 0;</span>. Save the file and re-upload to your
|
||||
|
||||
server.
|
||||
|
||||
<br>
|
||||
|
||||
If that doesn't solve the problem, check the CHMOD values on the directories you created during the installation process. If in doubt, CHMOD them to 0777 and any directories contained within.
|
||||
|
||||
</td></tr>
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
|
||||
|
||||
<a name='main'></a>
|
||||
|
||||
<table width='95%' align='center' cellpadding='4' cellspacing='0'>
|
||||
|
||||
<tr>
|
||||
|
||||
<td class='header' align='left'>General Board Problems</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
|
||||
<td align='left'>
|
||||
|
||||
<b>Every time I try to access a page on the forums it loads a blank page.</b>
|
||||
|
||||
<br>
|
||||
|
||||
Can you log into the Admin CP? If you do not know the url, enter the following into your web browser address bar <b>http://www.your-domain-here.com/forums/admin.php</b> (obviously using the correct URL to your board!).
|
||||
|
||||
<br>If the Admin CP loads first time, try the following:
|
||||
|
||||
<br>Click on "Board Settings" to expand the sub-menu. Click on "Basic Config". When the page has loaded, turn off the following: <b>Print HTTP headers?</b> and <b>DISABLE GZIP encoding?</b>. When complete, submit the form
|
||||
|
||||
and try to access your board again.
|
||||
|
||||
<br>
|
||||
|
||||
If it still loads a blank page, check the CHMOD values on the directories you created during the installation including any directories contained within. If in doubt, CHMOD to 0777.
|
||||
|
||||
<br><br>
|
||||
|
||||
<b>I am on a Windows server and I get an Internal Server Error when trying to access my board</b>
|
||||
|
||||
<br>
|
||||
|
||||
There is an option to disable the headers that Invision Power Board prints by default.
|
||||
|
||||
<br>Log into your Admin Control Panel, click on "Board Settings" to expand the sub-menu. Click on "Basic Config". When the page has loaded, turn off <b>Print HTTP headers?</b> and submit the form
|
||||
|
||||
and try to access your board again.
|
||||
|
||||
<br><br>
|
||||
|
||||
<b>I am on a Windows server and when I make a post I am taken to a blank page</b>
|
||||
|
||||
<br>
|
||||
|
||||
Some Windows based servers require a different HTTP protocol when redirecting HTTP requests, there is an option in the Admin Control Panel to overcome this.
|
||||
|
||||
<br>
|
||||
|
||||
Log into your Admin Control Panel, click on "Board Settings" to expand the sub-menu. Click on "Basic Config". Choose "Refresh (Windows Savvy) from the "Type of auto-redirect?" option. Submit the form.
|
||||
|
||||
</td></tr>
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
|
||||
|
||||
<a name='help'></a>
|
||||
|
||||
<table width='95%' align='center' cellpadding='4' cellspacing='0'>
|
||||
|
||||
<tr>
|
||||
|
||||
<td class='header' align='left'>Getting further help</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
|
||||
<td align='left'>
|
||||
|
||||
If you have a problem outside the ones solved in this guide, then don't panic!<br>
|
||||
|
||||
We have a large team of trained support professionals that <b>will</b> be able to provide a solution to your problems.<br>
|
||||
|
||||
Simply log into your client center and submit a ticket.
|
||||
|
||||
<br><br>
|
||||
|
||||
If you wish to contact us for non-technical issues, please visit our <a href='http://anonym.to/http://www.invisionpower.com/?contact' target='_blank'>Contact Page</a> which includes a handy email form, mailing address and telephone number.
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<!-- End content -->
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 172 B |
|
Before Width: | Height: | Size: 652 B |
|
Before Width: | Height: | Size: 1.4 KiB |
@@ -1,11 +0,0 @@
|
||||
<html>
|
||||
<head><title>Invision Power Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: Invision Power Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this Page in error, please use
|
||||
your back button to return to Invision Board.
|
||||
<hr>
|
||||
<a href="http://anonym.to/http://www.invisionboard.com/">Invision Power Board</a>
|
||||
</body>
|
||||
</html>␍
|
||||
|
Before Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
@@ -1,42 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
|
||||
<title>Invision Power Board Install Guide: Welcome</title>
|
||||
<style type='text/css' media='all'>
|
||||
@import url('docs.css');
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<h2>Installing: Step 1 - Uploading</h2>
|
||||
<br />
|
||||
<div class='content-text'>
|
||||
At this point, you should have the zip archive "unzipped" and the contents similar to those shown in the <a href='chmod.html' target='bottom'>structure and CHMOD guide</a>. If you
|
||||
do not have a similar structure, check to make sure you have your zip program preferences set to allow creation of directories and to preserve case and long filenames.
|
||||
<br><br>
|
||||
If you haven't done so already, create a new directory on your server named appropriately (if you wanted to access the forums via 'http://www.domain.com/forums/', create a directory called 'forums' in the
|
||||
'public_html' or 'www' directory on your webserver.
|
||||
<br><br>
|
||||
Using your FTP client, move into the directory you wish to upload to (if you followed the above advice, move into the newly created 'forums' directory.)
|
||||
<br><br>
|
||||
Using your FTP client, create the following directories "admin", "cache", "install", "ips_kernel", "jscripts", "lofiversion", "modules", "retail", "resources", "skin_acp", "sources", "style_avatars", "style_captcha", "style_emoticons", "style_images", "upgrade" and "uploads" <span style='color:blue'>(TIP: If your FTP client supports "Drag n' Drop" which most modern clients do, you can save yourself some time and effort by
|
||||
simply selecting all the files from the "unzipped" zip archive and drag them into your FTP client window, this will then copy all the files, creating the directories as it goes. If you choose
|
||||
to do this, you can safely ignore most of the following instruction, just remember to CHMOD as outlined in the stucture and CHMOD guide).</span>
|
||||
<br><br>
|
||||
Once the directories have been created, CHMOD "skin_cache" and "uploads" to 0755 (if you get permissions errors later on, you can CHMOD these to
|
||||
"0777"). Now, upload the contents of the files in your local folders (from the zip file) into the corresponding directories you've just created on your server. Some folders will contain other
|
||||
files and folders, upload them all - preserving the structure you have in your zip file (for example, upload the entire contents of the "html" folder on your computer to the "html" directory on the server).
|
||||
<br><br>
|
||||
Once you have finished uploading into the directories, upload the rest of the files "conf_global.php.dist" and "index.php" to the same place as you created the directories earlier (into "forums" for our example).
|
||||
<br><br>
|
||||
That's it, the hard work is now done! You can proceed to the next step.
|
||||
</div>
|
||||
|
||||
<div class='content-next'>
|
||||
<img src='images/bullet_doing.gif' alt='' style='vertical-align:middle' border='0' /> <a href='install2.html'>Next: Installation Step Two</a>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,47 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
|
||||
<title>Invision Power Board Install Guide: Welcome</title>
|
||||
<style type='text/css' media='all'>
|
||||
@import url('docs.css');
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<h2>Installing: Step 2 - Using the Installer</h2>
|
||||
<br />
|
||||
<div class='content-text'>
|
||||
An installer is provided to assist you in entering the information Invision Power Board needs to connect to your MySQL database and to create your new
|
||||
administrators account.
|
||||
<br><br>
|
||||
Run the installer file through your web browser by entering the URL to it into your browser address bar (if you have followed our example, type in
|
||||
<b>http://www.domain.com/forums/install/index.php</b>, naturally subsituting 'domain.com' for your web address.)
|
||||
<br><br>
|
||||
Clicking on proceed will present you with a simple information form. You will need to know your SQL username and password at this point. If you do not know it, please ask your web host - in most
|
||||
cases it is different from the FTP log in information.
|
||||
<br><br>The form is very straightfoward, with only the following points needing closer examination. If you do not know what your MySQL "host" is, try "localhost" (without the quotes). if the SQL server
|
||||
is on the same server as your website (and in most cases it is) this will suffice.
|
||||
<br>
|
||||
If you have created a new database for Invision Power Board, or wish to use an existing database, enter the name of the database in the appropriate field.<br><br>Unless you intend to install multiple copies of
|
||||
Invision Power Board into the same database, you can leave the "table prefix" blank. If you do not have a MySQL password (if you are installing Invision Power Board on your local server) this can be left blank.
|
||||
<br>
|
||||
After submitting the form, you will be informed of any errors - if you do get an error similar to "permission denied for user@localhost using password YES" - the chances are you have either your MySQL username, MySQL password
|
||||
or MySQL database name wrong. Consult with your webhost for the correct information and resubmit the form.
|
||||
<br><br>
|
||||
If the information is correct an IP.Board can connect to your database, you will be asked for your administrator login information. This is the information you will use to login to the board, and the admin control panel area.
|
||||
<br><br>
|
||||
If the installation was successful, you will receive notification to that effect.
|
||||
<br>
|
||||
Follow the link to finish off the installation and to log into your newly installed board. When the log in page loads, enter in the information you chose for your administrator account.
|
||||
<br>
|
||||
Once you are logged into the board, click on the "Admin CP" link found in the navigation bar to access the Administration Control Panel.
|
||||
</div>
|
||||
|
||||
<div class='content-next'>
|
||||
<img src='images/bullet_doing.gif' alt='' style='vertical-align:middle' border='0' /> <a href='install3.html'>Next: Installation Step Three</a>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,32 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
|
||||
<title>Invision Power Board Install Guide: Welcome</title>
|
||||
<style type='text/css' media='all'>
|
||||
@import url('docs.css');
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<h2>Installing: Step 3 - Post Installation</h2>
|
||||
<br />
|
||||
<div class='content-text'>
|
||||
The Invision Power Board administration control panel is a very sophisticated tool. This is where you can create new categories and forums for your board, as well
|
||||
as set bad word filters, edit emoticons, change the board colours and so on. We recommend you browse the documentation at <a href='http://www.invisionboard.com/'>Invision Power Board</a> before getting attempting some of the more complex operations.
|
||||
<br><br>
|
||||
<b>Lets get stuck in!</b>
|
||||
<br>
|
||||
The first thing you will need to do is remove the "install/index.php" file from your server; although Invision Power Board locks the installer after a successful install, it's always a good idea to remove the installer as re-running it
|
||||
<b>will delete your database tables</b>.
|
||||
<br><br>
|
||||
Congratulations! You have installed and set up your new Invision Power Board. If you ran into trouble, please click on the "Help!" link in the top menu bar for the FAQ and how to get support.
|
||||
</div>
|
||||
|
||||
<div class='content-next'>
|
||||
<img src='images/bullet_doing.gif' alt='' style='vertical-align:middle' border='0' /> <a href='chmod.html'>Next: CHMOD Guide</a>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,37 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
|
||||
<title>Invision Power Board Install Guide: Welcome</title>
|
||||
<style type='text/css' media='all'>
|
||||
@import url('docs.css');
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<h2>Requirements</h2>
|
||||
<br />
|
||||
<div class='content-text'>
|
||||
<em>The exact requirements will depend on many factors, your estimated board traffic being one.</em>
|
||||
<br />
|
||||
<br />
|
||||
You must have a webserver that has PHP 4.3.0 (or better) and MySQL 3.23 (or better) installed. If you are unsure whether your server has these
|
||||
programs installed, please check with your web host now. If you are capable, you can always <a href='http://www.php.net' target='_blank'>download PHP</a>
|
||||
and <a href='http://www.mysql.com' target='blank'>download mySQL</a> and install it yourself. If your web host does not support PHP or mySQL, consider hosting your entire web site or forums with <a href='http://www.ipshosting.com' target='blank'>IPS Hosting</a> services.
|
||||
<br>Invision Power Board works best on an Apache server, and is Apache 1 and Apache 2 savvy.
|
||||
<br><br>
|
||||
<b>General Requirements</b>
|
||||
<br>
|
||||
You <b>do not</b> need a new mySQL database as Invision Power Board supports table prefixes to prevent tables being overwritten.
|
||||
<br>You will also need the mySQL username and mySQL password for a mySQL user that has permission to "CREATE", "DROP" and "ALTER" tables.
|
||||
<br>You will need about 5mb of free web space and roughly 5mb of mySQL database space to allow installation and a moderately sized community.
|
||||
<br>If you are unsure on any of these points, please ask your webhost before proceeding.
|
||||
</div>
|
||||
|
||||
<div class='content-next'>
|
||||
<img src='images/bullet_doing.gif' alt='' style='vertical-align:middle' border='0' /> <a href='install1.html'>Next: Installation Step One</a>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,40 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
|
||||
<title>Invision Power Board Install Guide: Welcome</title>
|
||||
<style type='text/css' media='all'>
|
||||
@import url('docs.css');
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h2>Welcome to Invision Power Board!</h2>
|
||||
<br />
|
||||
<div class='content-text'>
|
||||
Welcome to Invision Power Board, a fast, efficient, scalable community solution written in PHP and using MySQL for database storage.
|
||||
<br><br>
|
||||
Invision Power Board also supports MSSQL and Oracle for database storage. It is very important to note that if you are using an alternate database storage method that you MUST download the driver files for the database engine you are using, and upload those files with the rest of the Invision Power Board files. The additional files you need can be downloaded from your client area. If you need assistance
|
||||
with this step, please do not hesitate to submit a ticket for official support.
|
||||
<br><br>
|
||||
This guide will help you through the installation process and get you on your way to setting up your own Invision Power Board.
|
||||
<br>
|
||||
Installation is very straight forward, only taking about 15 minutes from uploading the files to logging into your administration center.
|
||||
<br>
|
||||
<br>
|
||||
You will need an FTP (File Transfer Protocol) client, if you do not have one you can download <a href='http://www.smartftp.com' target='_blank'>Smart FTP for Windows</a> or
|
||||
<a href='http://www.interarchy.com' target='_blank'>InterArchy for Macintosh</a>. At the time of writing both websites have freeware or free trial versions available for download.
|
||||
<br>You do not need an indepth knowledge of PHP programming to install Invision Power Board, but a working knowledge of FTP functions is a plus.
|
||||
<br>
|
||||
<br>This guide assumes that you have successfully downloaded the latest release from <a href='http://www.invisionboard.com' target='_blank'>Invision Power Board</a> and have the Zip file "unzipped" and ready to go.
|
||||
<br>The instructions will term the zip file you downloaded as "the zip archive", the directories created by the unzipping process as "the local folders" and the directories on your website as
|
||||
"website directories" - this is to prevent confusion.
|
||||
<br><br>
|
||||
</div>
|
||||
|
||||
<div class='content-next'>
|
||||
<img src='images/bullet_doing.gif' alt='' style='vertical-align:middle' border='0' /> <a href='requirements.html'>Next: Requirements</a>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,57 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>IPS Installer</title>
|
||||
<style type='text/css' media='all'>
|
||||
@import url('data/docs.css');
|
||||
</style>
|
||||
<script type='text/javascript'>
|
||||
//<![CDATA[
|
||||
if (top.location != self.location) { top.location = self.location }
|
||||
var use_enhanced_js = 1;
|
||||
//]]>
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<p> </p>
|
||||
<p> </p>
|
||||
<div id='ipswrapper'>
|
||||
<div class='main_shell'>
|
||||
<h1><img src='data/images/package_icon.gif' align='absmiddle' /> Welcome to the Invision Power Board</h1>
|
||||
<div class='content_shell'>
|
||||
<div class='package'>
|
||||
<div>
|
||||
<div class='install_info'>
|
||||
<h3>Menu</h3>
|
||||
|
||||
<ul id='progress'>
|
||||
<li class='step_notdone'><a style='text-decoration:none' href='data/welcome.html' target='myframe'>Welcome</a></li>
|
||||
<li class='step_notdone'><a style='text-decoration:none' href='data/requirements.html' target='myframe'>Requirements</a></li>
|
||||
<li class='step_notdone'><a style='text-decoration:none' href='data/install1.html' target='myframe'>Install: Step One</a></li>
|
||||
<li class='step_notdone'><a style='text-decoration:none' href='data/install2.html' target='myframe'>Install: Step Two</a></li>
|
||||
<li class='step_notdone'><a style='text-decoration:none' href='data/install3.html' target='myframe'>Install: Step Three</a></li>
|
||||
<li class='step_notdone'><a style='text-decoration:none' href='data/chmod.html' target='myframe'>CHMOD Guide</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class='content_wrap'>
|
||||
<iframe name='myframe' src='data/welcome.html' style='width:100%;height:425px' border='0' style='border:0px; padding:0px' frameborder='0'></iframe>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<br clear='all' />
|
||||
<div style='clear: both;'></div>
|
||||
<div class='copyright'>
|
||||
© 2007 Invision Power Services, Inc.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,63 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>IPS Installer</title>
|
||||
<style type='text/css' media='all'>
|
||||
@import url('data/docs.css');
|
||||
</style>
|
||||
<script type='text/javascript'>
|
||||
//<![CDATA[
|
||||
if (top.location != self.location) { top.location = self.location }
|
||||
var use_enhanced_js = 1;
|
||||
//]]>
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<p> </p>
|
||||
<p> </p>
|
||||
<div id='ipswrapper'>
|
||||
<div class='main_shell'>
|
||||
<h1><img src='data/images/package_icon.gif' align='absmiddle' /> Welcome to the Invision Power Board</h1>
|
||||
<div class='content_shell'>
|
||||
<div class='package' style='text-align:middle;height:280px'>
|
||||
<div>
|
||||
|
||||
|
||||
<div class='content_wrap' style='width:650px; margin:6px 12px 6px 6px;height:220px'>
|
||||
|
||||
|
||||
<h2>Updating your IPB</h2>
|
||||
<br/ >
|
||||
If you're updating your IPB, then please do the following:
|
||||
<ul>
|
||||
<li><b>Important note:</b> If you are using a database driver OTHER than MySQL please be sure to download the files for your
|
||||
driver from your client area and upload those files along with the files in the next step. If you fail to do this, you
|
||||
will not receive the SQL updates you need</li>
|
||||
<li>Upload all the files contained in the "upload" folder of the download distribution. Don't forget
|
||||
to update files in the "resources" and "upgrades" folder.</li>
|
||||
<li>Run the upgrade system by accessing "upgrade/index.php" on your system (for example: www.domain.com/forum/upgrade/index.php)
|
||||
this will determine which upgrade modules need to be run and will rebuild your templates for you.</li>
|
||||
<li><strong>Your upgrade is now complete!</strong></li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<br clear='all' />
|
||||
<div style='clear: both;'></div>
|
||||
<div class='copyright'>
|
||||
© 2007 Invision Power Services, Inc.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,61 +1,39 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>IPS Installer</title>
|
||||
<style type='text/css' media='all'>
|
||||
@import url('InstallationGuide/data/docs.css');
|
||||
</style>
|
||||
<script type='text/javascript'>
|
||||
//<![CDATA[
|
||||
if (top.location != self.location) { top.location = self.location }
|
||||
var use_enhanced_js = 1;
|
||||
//]]>
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<p> </p>
|
||||
<p> </p>
|
||||
<div id='ipswrapper'>
|
||||
<div class='main_shell'>
|
||||
<h1><img src='InstallationGuide/data/images/package_icon.gif' align='absmiddle' /> Welcome to the Invision Power Board</h1>
|
||||
<div class='content_shell' style='height:250px'>
|
||||
<div class='package' style='text-align:middle; height:250px'>
|
||||
<div>
|
||||
|
||||
|
||||
<div class='content_wrap' style='width:650px; margin:6px 12px 6px 6px; height:210px'>
|
||||
|
||||
<br />
|
||||
|
||||
<div class='info' style='padding:10px; text-align: center'>
|
||||
<div style='font-size:20px; font-weight:bold'>I AM UPGRADING</div>
|
||||
<br />
|
||||
Click <a href='InstallationGuide/upgrading.html'>HERE</a> if you are upgrading your Invision Power Board from a previous version.
|
||||
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
<div class='warning' style='padding:10px; text-align: center'>
|
||||
<div style='font-size:20px; font-weight:bold'>I AM INSTALLING</div>
|
||||
<br />
|
||||
<div style='font-weight:normal'>Click <a href='InstallationGuide/install_guide.html'>HERE</a> if you are installing a new Invision Power Board.</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<br clear='all' />
|
||||
<div style='clear: both;'></div>
|
||||
<div class='copyright'>
|
||||
© 2007 Invision Power Services, Inc.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</body>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>IPS Community Suite Setup Guide</title>
|
||||
<style type='text/css' media='all'>
|
||||
@import url('data/install.css');
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id='ipbwrapper'>
|
||||
<div id='branding'>
|
||||
<div class='main_width'>
|
||||
<div class='logo'><img src='data/images/logo.png' /></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id='content'>
|
||||
|
||||
<div class='message'>
|
||||
<a href='http://external.ipslink.com/ipboard30/landing/?p=installation-guide'>Installing →
|
||||
</div>
|
||||
<br />
|
||||
|
||||
<div class='message'>
|
||||
<a href='http://external.ipslink.com/ipboard30/landing/?p=upgrade-guide'>Upgrading →
|
||||
</div>
|
||||
<br />
|
||||
|
||||
<div class='message'>
|
||||
<a href='http://external.ipslink.com/ipboard30/landing/?p=convert-guide'>Converting →
|
||||
</div>
|
||||
<br />
|
||||
|
||||
<div class='copyright'>
|
||||
© 2012 Invision Power Services, Inc.
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
After Width: | Height: | Size: 357 B |
|
After Width: | Height: | Size: 701 B |
|
After Width: | Height: | Size: 138 B |
@@ -0,0 +1 @@
|
||||
<html>␍<head><title>Invision Power Board - Bulletin Board System</title></head>␍<body>␍<h1>403: Invision Power Board -> Forbidden</h1>␍<hr>␍You have reached this Page in error, please use␍your back button to return to Invision Board.␍<hr>␍<a href="http://www.invisionpower.com">Invision Power Board</a>␍</body>␍</html>␍
|
||||
|
After Width: | Height: | Size: 778 B |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 294 B |
|
After Width: | Height: | Size: 213 B |
|
After Width: | Height: | Size: 295 B |
|
After Width: | Height: | Size: 138 B |
|
After Width: | Height: | Size: 3.1 KiB |
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> Forbidden</h1>
|
||||
<hr>
|
||||
You have reached this page in error, please use your back button to return to the forum.
|
||||
<hr>
|
||||
<a href="http://www.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,545 @@
|
||||
/**
|
||||
* Installer CSS
|
||||
* (c) Invision Power Services, Inc.
|
||||
*/
|
||||
|
||||
/*-----------------------------------------------*/
|
||||
/* This section resets default browser styles. */
|
||||
/* You shouldn't need to edit this section. */
|
||||
/*-----------------------------------------------*/
|
||||
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td { margin:0; padding:0; }
|
||||
table { border-collapse:collapse; border-spacing:0; }
|
||||
fieldset,img { border:0; }
|
||||
address,caption,cite,code,dfn,em,strong,th,var { font-style:normal; font-weight:normal; }
|
||||
ol,ul { list-style:none; }
|
||||
caption,th { text-align:left; }
|
||||
h1,h2,h3,h4,h5,h6 { font-size:100%; font-weight:normal; }
|
||||
q:before,q:after { content:''; }
|
||||
abbr,acronym { border:0; }
|
||||
hr { display: none; }
|
||||
|
||||
|
||||
html, body { /* Safari has trouble with bgcolor on body. Apply to html tag too. */
|
||||
background-color: #d8dde8;
|
||||
color: #5a5a5a;
|
||||
}
|
||||
|
||||
body {
|
||||
font: normal 13px helvetica, arial, sans-serif;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
input, select {
|
||||
font: normal 13px helvetica, arial, sans-serif;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #225985;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:hover { color: #328586; }
|
||||
|
||||
|
||||
/************************************************************************/
|
||||
/* LAYOUT */
|
||||
#content, .main_width {
|
||||
margin: 0 auto;
|
||||
width: 980px;
|
||||
}
|
||||
|
||||
#branding, #header_bar, #primary_nav { min-width: 980px; }
|
||||
/*#header_bar .main_width, #branding .main_width, #primary_nav .main_width { padding: 0 10px; }*/
|
||||
|
||||
/**
|
||||
* @key content
|
||||
* @group global
|
||||
* @colorize base
|
||||
* @title Main Content Area
|
||||
* @description The area that contains all page content
|
||||
* @default background
|
||||
*/
|
||||
#content {
|
||||
background: #fff;
|
||||
padding: 10px 10px;
|
||||
line-height: 120%;
|
||||
-webkit-box-shadow: 0 5px 9px rgba(0,0,0,0.1);
|
||||
-moz-box-shadow: 0 5px 9px rgba(0,0,0,0.1);
|
||||
box-shadow: 0 5px 9px rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
#branding {
|
||||
background: #0f3854 url(images/branding_bg.png) repeat-x;
|
||||
border-bottom: 1px solid #1b3759;
|
||||
min-height: 64px;
|
||||
}
|
||||
|
||||
#logo { display: inline; }
|
||||
|
||||
#primary_nav {
|
||||
background: #204066;
|
||||
font-size: 13px;
|
||||
padding: 4px 0 0 0;
|
||||
}
|
||||
|
||||
#community_app_menu > li { margin: 0px 3px 0 0; position: relative; }
|
||||
|
||||
/**
|
||||
* @key primarynav_inactive
|
||||
* @group header
|
||||
* @colorize base
|
||||
* @title Inactive App Tab
|
||||
* @description An inactive tab in the Primary Nav bar
|
||||
* @default background, color
|
||||
*/
|
||||
#community_app_menu > li > a {
|
||||
color: #c5d5e2;
|
||||
background: #1c3b5f;
|
||||
display: block;
|
||||
padding: 6px 15px 8px;
|
||||
text-shadow: 0px 1px 1px rgba(0,0,0,0.5);
|
||||
}
|
||||
|
||||
#community_app_menu > li > a:hover, #community_app_menu > li > a.menu_active { background: #173455; color: #fff; }
|
||||
|
||||
/**
|
||||
* @key primarynav_active
|
||||
* @group header
|
||||
* @colorize base
|
||||
* @title Active App Tab
|
||||
* @description An active tab in the Primary Nav bar
|
||||
* @default background, color
|
||||
*/
|
||||
#community_app_menu > li.active > a {
|
||||
background: #fff;
|
||||
color: #0b5794;
|
||||
font-weight: bold;
|
||||
margin-top: 0;
|
||||
text-shadow: none;
|
||||
}
|
||||
|
||||
.ipsList_inline > li {
|
||||
display: inline-block;
|
||||
margin: 0 3px;
|
||||
}
|
||||
.ipsList_inline > li:first-child { margin-left: 0; }
|
||||
.ipsList_inline > li:last-child { margin-right: 0; }
|
||||
.ipsList_inline.ipsList_reset > li:first-child { margin-left: 3px; }
|
||||
.ipsList_inline.ipsList_reset > li:last-child { margin-right: 3px; }
|
||||
.ipsList_inline.ipsList_nowrap { white-space: nowrap; }
|
||||
|
||||
|
||||
|
||||
|
||||
/* Utility styles */
|
||||
.right { float: right; }
|
||||
.left { float: left; }
|
||||
.hide { display: none; }
|
||||
.short { text-align: center; }
|
||||
.clear { clear: both; }
|
||||
.clearfix:after { content: ".";display: block;height: 0;clear: both;visibility: hidden;}
|
||||
.faded { opacity: 0.5 }
|
||||
.clickable { cursor: pointer; }
|
||||
.reset_cursor { cursor: default; }
|
||||
|
||||
/************************************************************************/
|
||||
/* LAYOUT SYSTEM */
|
||||
|
||||
.ipsLayout.ipsLayout_withleft { padding-left: 210px; }
|
||||
.ipsBox.ipsLayout.ipsLayout_withleft { padding-left: 220px; }
|
||||
.ipsLayout.ipsLayout_withright { padding-right: 210px; clear: left; }
|
||||
.ipsBox.ipsLayout.ipsLayout_withright { padding-right: 220px; }
|
||||
|
||||
/* Panes */
|
||||
.ipsLayout_content, .ipsLayout .ipsLayout_left, .ipsLayout_right { position: relative; }
|
||||
.ipsLayout_content { width: 100%; float: left; }
|
||||
.ipsLayout .ipsLayout_left { width: 200px; margin-left: -210px; float: left; }
|
||||
.ipsLayout .ipsLayout_right { width: 200px; margin-right: -210px; float: right; }
|
||||
|
||||
/* Wider sidebars */
|
||||
.ipsLayout_largeleft.ipsLayout_withleft { padding-left: 280px; }
|
||||
.ipsBox.ipsLayout_largeleft.ipsLayout_withleft { padding-left: 290px; }
|
||||
.ipsLayout_largeleft.ipsLayout .ipsLayout_left { width: 270px; margin-left: -280px; }
|
||||
.ipsLayout_largeright.ipsLayout_withright { padding-right: 280px; }
|
||||
.ipsBox.ipsLayout_largeright.ipsLayout_withright { padding-right: 290px; }
|
||||
.ipsLayout_largeright.ipsLayout .ipsLayout_right { width: 270px; margin-right: -280px; }
|
||||
|
||||
/* Narrow sidebars */
|
||||
.ipsLayout_smallleft.ipsLayout_withleft { padding-left: 150px; }
|
||||
.ipsBox.ipsLayout_smallleft.ipsLayout_withleft { padding-left: 160px; }
|
||||
.ipsLayout_smallleft.ipsLayout .ipsLayout_left { width: 140px; margin-left: -150px; }
|
||||
.ipsLayout_smallright.ipsLayout_withright { padding-right: 150px; }
|
||||
.ipsBox.ipsLayout_smallright.ipsLayout_withright { padding-right: 160px; }
|
||||
.ipsLayout_smallright.ipsLayout .ipsLayout_right { width: 140px; margin-right: -150px; }
|
||||
|
||||
/* Tiny sidebar */
|
||||
.ipsLayout_tinyleft.ipsLayout_withleft { padding-left: 50px; }
|
||||
.ipsBox.ipsLayout_tinyleft.ipsLayout_withleft { padding-left: 60px; }
|
||||
.ipsLayout_tinyleft.ipsLayout .ipsLayout_left { width: 40px; margin-left: -40px; }
|
||||
.ipsLayout_tinyright.ipsLayout_withright { padding-right: 50px; }
|
||||
.ipsBox.ipsLayout_tinyright.ipsLayout_withright { padding-right: 60px; }
|
||||
.ipsLayout_tinyright.ipsLayout .ipsLayout_right { width: 40px; margin-right: -40px; }
|
||||
|
||||
/* Big sidebar */
|
||||
.ipsLayout_bigleft.ipsLayout_withleft { padding-left: 330px; }
|
||||
.ipsBox.ipsLayout_bigleft.ipsLayout_withleft { padding-left: 340px; }
|
||||
.ipsLayout_bigleft.ipsLayout .ipsLayout_left { width: 320px; margin-left: -330px; }
|
||||
.ipsLayout_bigright.ipsLayout_withright { padding-right: 330px; }
|
||||
.ipsBox.ipsLayout_bigright.ipsLayout_withright { padding-right: 340px; }
|
||||
.ipsLayout_bigright.ipsLayout .ipsLayout_right { width: 320px; margin-right: -330px; }
|
||||
|
||||
/* Even Wider sidebars */
|
||||
.ipsLayout_hugeleft.ipsLayout_withleft { padding-left: 380px; }
|
||||
.ipsBox.ipsLayout_hugeleft.ipsLayout_withleft { padding-left: 390px; }
|
||||
.ipsLayout_hugeleft.ipsLayout .ipsLayout_left { width: 370px; margin-left: -380px; }
|
||||
.ipsLayout_hugeright.ipsLayout_withright { padding-right: 380px; }
|
||||
.ipsBox.ipsLayout_hugeright.ipsLayout_withright { padding-right: 390px; }
|
||||
.ipsLayout_hugeright.ipsLayout .ipsLayout_right { width: 370px; margin-right: -380px; }
|
||||
|
||||
.ipsBox { background: #ebf0f3; }
|
||||
.ipsBox, .ipsPad { padding: 9px; }
|
||||
.ipsPad_double { padding: 9px 19px; } /* 19px because it's still only 1px border to account for */
|
||||
.ipsBox_withphoto { margin-left: 65px; }
|
||||
|
||||
.ipsBox_container {
|
||||
background: #fff;
|
||||
border: 1px solid #dbe4ef;
|
||||
}
|
||||
.ipsBox_notice {
|
||||
padding: 10px;
|
||||
line-height: 1.6;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.ipsBox_container .ipsBox_notice { margin: -10px -10px 10px -10px; }
|
||||
.ipsPad_half { padding: 4px !important; }
|
||||
.ipsPad_left { padding-left: 9px; }
|
||||
.ipsPad_top { padding-top: 9px; }
|
||||
.ipsPad_top_slimmer { padding-top: 7px; }
|
||||
.ipsPad_top_half { padding-top: 4px; }
|
||||
.ipsPad_top_bottom { padding-top: 9px; padding-bottom: 9px; }
|
||||
.ipsPad_top_bottom_half { padding-top: 4px; padding-bottom: 4px; }
|
||||
.ipsMargin_top { margin-top: 9px; }
|
||||
|
||||
#progress { margin: 10px 0px 10px 40px }
|
||||
|
||||
#progress .step_done {
|
||||
list-style-image: url('images/bullet_done.gif');
|
||||
color: #44638E;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
#progress .step_doing {
|
||||
list-style-image: url('images/bullet_doing.gif');
|
||||
font-weight: bold;
|
||||
}
|
||||
#progress .step_doing p {
|
||||
color: gray;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
#progress .step_notdone {
|
||||
list-style-image: url('images/bullet_notdone.gif');
|
||||
}
|
||||
|
||||
.maintitle {
|
||||
background: #2c5687 url(images/maintitle.png) repeat-x top;
|
||||
color: #fff;
|
||||
padding: 10px 10px 11px;
|
||||
font-size: 16px;
|
||||
font-weight: 300;
|
||||
-moz-border-radius: 4px 4px 0 0;
|
||||
-webkit-border-top-left-radius: 4px;
|
||||
-webkit-border-top-right-radius: 4px;
|
||||
border-radius: 4px 4px 0 0;
|
||||
-webkit-box-shadow: inset 0px 1px 0 #528cbc;
|
||||
-moz-box-shadow: inset 0px 1px 0 #528cbc;
|
||||
box-shadow: inset 0px 1px 0 #528cbc;
|
||||
border-width: 1px 1px 0 1px;
|
||||
border-color: #316897;
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
.maintitle a { color: #fff; }
|
||||
|
||||
|
||||
#contentContainer {
|
||||
overflow: auto;
|
||||
overflow-y:auto;
|
||||
overflow-x:hidden;
|
||||
height: 550px;
|
||||
}
|
||||
|
||||
.input_text, .sql_form {
|
||||
padding: 4px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: #848484 #c1c1c1 #e1e1e1 #c1c1c1;
|
||||
background: #fff;
|
||||
-moz-border-radius: 2px;
|
||||
-webkit-border-radius: 2px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.input_text:focus {
|
||||
border-color: #4e4e4e #7c7c7c #a3a3a3 #7c7c7c;
|
||||
-webkit-box-shadow: 0px 0px 5px rgba(0,0,0,0.3);
|
||||
-moz-box-shadow: 0px 0px 5px rgba(0,0,0,0.3);
|
||||
box-shadow: 0px 0px 5px rgba(0,0,0,0.3);
|
||||
}
|
||||
|
||||
ipsType_pagetitle, .ipsType_subtitle {
|
||||
font: 300 26px/1.3 Helvetica, Arial, sans-serif;
|
||||
color: #323232;
|
||||
}
|
||||
.ipsType_subtitle { font-size: 18px; }
|
||||
.ipsType_sectiontitle {
|
||||
font-size: 16px;
|
||||
font-weight: normal;
|
||||
color: #595959;
|
||||
padding: 5px 0;
|
||||
border-bottom: 1px solid #ececec;
|
||||
}
|
||||
|
||||
.ipsType_pagedesc {
|
||||
color: #7f7f7f;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
|
||||
#login_controls {
|
||||
margin: 0 auto;
|
||||
width: 100%;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
#login_controls label {
|
||||
display: block;
|
||||
width: 35%;
|
||||
color: #000;
|
||||
float: left;
|
||||
clear: both;
|
||||
margin-bottom: 12px;
|
||||
text-align: right;
|
||||
padding-right: 15px;
|
||||
}
|
||||
|
||||
#login_controls input {
|
||||
margin-bottom: 12px;
|
||||
font-size: 12px;
|
||||
width: 45%;
|
||||
}
|
||||
|
||||
.nav_button, .button, .realbutton {
|
||||
-moz-border-radius-bottomleft:3px;
|
||||
-moz-border-radius-bottomright:3px;
|
||||
-moz-border-radius-topleft:3px;
|
||||
-moz-border-radius-topright:3px;
|
||||
background-color:#657B97;
|
||||
border:1px solid #3E546F;
|
||||
color:#FFFFFF;
|
||||
cursor:pointer;
|
||||
padding:3px;
|
||||
}
|
||||
|
||||
.message {
|
||||
padding: 10px 10px 10px 10px;
|
||||
margin-bottom: 6px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: #b0ce94;
|
||||
background-color: #f1f6ec;
|
||||
color: #3e4934;
|
||||
-moz-border-radius: 4px;
|
||||
-webkit-border-radius: 4px;
|
||||
line-height: 150%;
|
||||
}
|
||||
|
||||
.message.error {
|
||||
background-color: #f3dddd;
|
||||
border-color: #deb7b7;
|
||||
color: #281b1b;
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
.message.unspecific {
|
||||
background-color: #f3f3f3;
|
||||
border-color: #d4d4d4;
|
||||
color: #515151;
|
||||
clear: both;
|
||||
margin: 0 0 10px 0;
|
||||
}
|
||||
|
||||
.message.unspecific.note {
|
||||
background-color: #f9f7e0;
|
||||
border-color: #eadca0;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
|
||||
H1 {
|
||||
margin: 0px;
|
||||
/* -provide BG incase of missing img- */
|
||||
background-image: url('images/title_bar.gif');
|
||||
padding: 7px 5px 6px 5px;
|
||||
font-size: 13px;
|
||||
color: #ffffff;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
H2 {
|
||||
margin: 0px;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
H3 {
|
||||
font-size: 11px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.content_shell
|
||||
{
|
||||
margin: 0px 3px 3px 3px;
|
||||
border: 1px solid #24426A;
|
||||
border-top: 3px solid #24426A;
|
||||
background-repeat: repeat-x;
|
||||
background-color: #D5DDE5;
|
||||
}
|
||||
|
||||
.package {
|
||||
clear:both;
|
||||
height: 577px;
|
||||
}
|
||||
|
||||
.content_wrap {
|
||||
width: 70%;
|
||||
height: 480px;
|
||||
float: right;
|
||||
margin: 6px 6px 4px 0px;
|
||||
padding: 10px;
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #000000;
|
||||
line-height: 150%;
|
||||
overflow: auto;
|
||||
overflow-y:auto;
|
||||
overflow-x:hidden;
|
||||
}
|
||||
|
||||
.install_info {
|
||||
float: left;
|
||||
margin: -5px 0px 0px 10px;
|
||||
font-size: 12px;
|
||||
width: 23%;
|
||||
}
|
||||
|
||||
.install_info H3 {
|
||||
font-size: 15px;
|
||||
color: #6D87A9;
|
||||
}
|
||||
|
||||
.install_info UL {
|
||||
margin: 0px;
|
||||
margin-top: 15px;
|
||||
padding-left: 25px;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
|
||||
.warning {
|
||||
background-color: #EDF1AB;
|
||||
border: 1px solid #6E704B;
|
||||
padding: 5px;
|
||||
font-weight: bold;
|
||||
-moz-border-radius: 5px;
|
||||
overflow: auto;
|
||||
|
||||
}
|
||||
|
||||
.hr {
|
||||
margin: 4px 6px 0px 6px;
|
||||
border-bottom: 1px solid #627686;
|
||||
}
|
||||
|
||||
.copyright {
|
||||
width: 98%;
|
||||
text-align: right;
|
||||
font-size: 9px;
|
||||
color: #9EA7B3;
|
||||
padding-top: 3px;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
.eula {
|
||||
height: 400px;
|
||||
border: 1px solid #76774C;
|
||||
background-color: #FDFDD3;
|
||||
padding: 8px;
|
||||
overflow: auto;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
#auto_progress LI {
|
||||
list-style: none;
|
||||
color: #029901;
|
||||
font-size: 11px;
|
||||
font-weight: bold;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
.done_text {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#links {
|
||||
margin: 0px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
#links LI {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.float_img {
|
||||
float: left;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.info {
|
||||
background-color: #DCE6F3;
|
||||
border: 1px solid #5876A0;
|
||||
padding: 4px;
|
||||
line-height: 120%;
|
||||
-moz-border-radius: 7px;
|
||||
color: #1D3A60;
|
||||
}
|
||||
|
||||
.sql_form {
|
||||
width: 100%;
|
||||
|
||||
}
|
||||
|
||||
FIELDSET {
|
||||
padding: 10px 10px 10px 10px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: #d5dde5;
|
||||
background-color: #F1F4F7;
|
||||
color: #3e4934;
|
||||
-moz-border-radius: 4px;
|
||||
-webkit-border-radius: 4px;
|
||||
line-height: 150%;
|
||||
}
|
||||
|
||||
FIELDSET LEGEND {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
TABLE .title {
|
||||
color: #2D4461;
|
||||
font-weight: bold;
|
||||
padding-bottom: 6px;
|
||||
}
|
||||
|
||||
TABLE .content {
|
||||
padding-bottom: 6px;
|
||||
}
|
||||
@@ -0,0 +1,240 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+---------------------------------------------------------------------------
|
||||
| IP.Board v3.4.5
|
||||
| ========================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2008 Invision Power Services
|
||||
| http://www.invisionpower.com
|
||||
| ========================================
|
||||
+---------------------------------------------------------------------------
|
||||
| Invision Power Board IS NOT FREE SOFTWARE!
|
||||
+---------------------------------------------------------------------------
|
||||
| http://www.invisionpower.com/
|
||||
| > $Id: 10039 2011-12-20 19:49:28Z mmecham $
|
||||
| > $Revision: 10039 $
|
||||
| > $Date: 2011-12-20 14:49:28 -0500 (Tue, 20 Dec 2011) $
|
||||
+---------------------------------------------------------------------------
|
||||
*/
|
||||
@set_time_limit( 3600 );
|
||||
|
||||
/**
|
||||
* Main public executable wrapper.
|
||||
*
|
||||
* Set-up and load module to run
|
||||
*
|
||||
* @package IP.Board
|
||||
* @author Matt Mecham
|
||||
* @version 3.0
|
||||
*/
|
||||
|
||||
if ( is_file( './initdata.php' ) )
|
||||
{
|
||||
require_once( './initdata.php' );/*noLibHook*/
|
||||
}
|
||||
elseif ( is_file( '../initdata.php' ) )
|
||||
{
|
||||
require_once( '../initdata.php' );/*noLibHook*/
|
||||
}
|
||||
else
|
||||
{
|
||||
require_once( 'initdata.php' );/*noLibHook*/
|
||||
}
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );/*noLibHook*/
|
||||
|
||||
$reg = ipsRegistry::instance();
|
||||
$reg->init();
|
||||
|
||||
$moo = new moo( $reg );
|
||||
|
||||
class moo
|
||||
{
|
||||
private $processed = 0;
|
||||
private $parser;
|
||||
private $oldparser;
|
||||
private $start = 0;
|
||||
private $end = 0;
|
||||
|
||||
const TOPICS_PER_GO = 100;
|
||||
|
||||
function __construct( ipsRegistry $registry )
|
||||
{
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
$this->memberData = array();
|
||||
|
||||
/* Do we have a remote DB? */
|
||||
if ( $this->settings['archive_remote_sql_database'] && $this->settings['archive_remote_sql_user'] )
|
||||
{
|
||||
if ( ! is_object( $this->registry->dbFunctions()->getDB('remoteArchive') ) )
|
||||
{
|
||||
$this->registry->dbFunctions()->setDB( 'mysql', 'remoteArchive', array( 'sql_database' => $this->settings['archive_remote_sql_database'],
|
||||
'sql_user' => $this->settings['archive_remote_sql_user'],
|
||||
'sql_pass' => $this->settings['archive_remote_sql_pass'],
|
||||
'sql_host' => $this->settings['archive_remote_sql_host'],
|
||||
'sql_charset' => $this->settings['archive_remote_sql_charset'],
|
||||
'sql_tbl_prefix' => $this->settings['sql_tbl_prefix'],
|
||||
'catchConnectionError' => true ) );
|
||||
|
||||
|
||||
$this->remoteDB = $this->registry->dbFunctions()->getDB('remoteArchive');
|
||||
|
||||
/* Check for connection issue */
|
||||
if ( $this->remoteDB->error )
|
||||
{
|
||||
$this->connectError = $this->remoteDB->error;
|
||||
$this->remoteDB = null;
|
||||
|
||||
$this->registry->dbFunctions()->unsetDB('remoteArchive');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->remoteDB = $this->registry->dbFunctions()->getDB('remoteArchive');
|
||||
|
||||
/* Check for connection issue */
|
||||
if ( $this->remoteDB->error )
|
||||
{
|
||||
$this->connectError = $this->remoteDB->error;
|
||||
$this->remoteDB = null;
|
||||
|
||||
$this->registry->dbFunctions()->unsetDB('remoteArchive');
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->remoteDB = $this->DB;
|
||||
}
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'process':
|
||||
$this->process();
|
||||
break;
|
||||
default:
|
||||
$this->splash();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function show( $content, $url='' )
|
||||
{
|
||||
if ( $url )
|
||||
{
|
||||
$firstBit = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'];
|
||||
$refresh = "<meta http-equiv='refresh' content='0; url={$firstBit}?{$url}'>";
|
||||
}
|
||||
|
||||
if ( is_array( $content ) )
|
||||
{
|
||||
$content = implode( "<br />", $content );
|
||||
}
|
||||
|
||||
$html = <<<EOF
|
||||
<html>
|
||||
<head>
|
||||
<title>Archive Update</title>
|
||||
$refresh
|
||||
</head>
|
||||
<body>
|
||||
$content
|
||||
</body>
|
||||
</html>
|
||||
EOF;
|
||||
|
||||
print $html; exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* SPLASH
|
||||
*/
|
||||
function splash()
|
||||
{
|
||||
$txt = '';
|
||||
|
||||
if ( ! $this->remoteDB->checkForField( 'archive_forum_id', 'forums_archive_posts' ) )
|
||||
{
|
||||
$PRE = trim(ipsRegistry::dbFunctions()->getPrefix());
|
||||
|
||||
$this->remoteDB->query('ALTER TABLE ' . $PRE . 'forums_archive_posts ADD archive_forum_id INT(10) NOT NULL DEFAULT 0;');
|
||||
|
||||
$txt = "Adding archive_forum_id field to your database - Done<br />";
|
||||
}
|
||||
|
||||
$html = <<<EOF
|
||||
<strong>Archive Update for IP.Board 3.3.1</strong>
|
||||
<br />{$txt}
|
||||
<a href="?do=process">Continue</a>
|
||||
EOF;
|
||||
|
||||
$this->show( $html );
|
||||
}
|
||||
|
||||
/**
|
||||
* Process
|
||||
*/
|
||||
function process()
|
||||
{
|
||||
$id = intval( $this->request['id'] );
|
||||
$lastId = 0;
|
||||
$done = intval( $this->request['done'] );
|
||||
$cycleDone = 0;
|
||||
$content = array();
|
||||
|
||||
|
||||
/* skipping? */
|
||||
$total = $this->remoteDB->buildAndFetch( array( 'select' => 'count(*) as count',
|
||||
'from' => 'forums_archive_posts' ) );
|
||||
|
||||
/* Fetch batch */
|
||||
$this->remoteDB->build( array( 'select' => '*',
|
||||
'from' => 'forums_archive_posts',
|
||||
'where' => 'archive_topic_id > ' . $id,
|
||||
'limit' => array( 0, self::TOPICS_PER_GO ),
|
||||
'order' => 'archive_topic_id ASC' ) );
|
||||
|
||||
|
||||
$o = $this->remoteDB->execute();
|
||||
|
||||
while( $row = $this->remoteDB->fetch( $o ) )
|
||||
{
|
||||
$cycleDone++;
|
||||
$lastId = $row['archive_topic_id'];
|
||||
|
||||
$content[] = "Updating topics " . ( $done + $cycleDone ) . " (archive_topic_id: " . $row['archive_topic_id'] . ") of " . $total['count'];
|
||||
|
||||
/* Fetch the forum ID */
|
||||
$topic = $this->DB->buildAndFetch( array( 'select' => 'forum_id',
|
||||
'from' => 'topics',
|
||||
'where' => 'tid=' . intval( $row['archive_topic_id'] ) ) );
|
||||
|
||||
if ( $topic['forum_id'] )
|
||||
{
|
||||
$this->remoteDB->update( 'forums_archive_posts', array( 'archive_forum_id' => $topic['forum_id'] ), 'archive_topic_id=' . $row['archive_topic_id'] );
|
||||
}
|
||||
}
|
||||
|
||||
/* More? */
|
||||
if ( $cycleDone )
|
||||
{
|
||||
/* Reset */
|
||||
$done += $cycleDone;
|
||||
|
||||
$this->show( $content, "do=process&id=" . $lastId . "&done=" . $done );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->show( "Process complete" );
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,252 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+---------------------------------------------------------------------------
|
||||
| IP.Board v3.4.5
|
||||
| ========================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2008 Invision Power Services
|
||||
| http://www.invisionpower.com
|
||||
| ========================================
|
||||
+---------------------------------------------------------------------------
|
||||
| Invision Power Board IS NOT FREE SOFTWARE!
|
||||
+---------------------------------------------------------------------------
|
||||
| http://www.invisionpower.com/
|
||||
| > $Id: 10039 2011-12-20 19:49:28Z mmecham $
|
||||
| > $Revision: 10039 $
|
||||
| > $Date: 2011-12-20 14:49:28 -0500 (Tue, 20 Dec 2011) $
|
||||
+---------------------------------------------------------------------------
|
||||
*/
|
||||
@set_time_limit( 3600 );
|
||||
|
||||
/**
|
||||
* Main public executable wrapper.
|
||||
*
|
||||
* Set-up and load module to run
|
||||
*
|
||||
* @package IP.Board
|
||||
* @author Matt Mecham
|
||||
* @version 3.0
|
||||
*/
|
||||
|
||||
if ( is_file( './initdata.php' ) )
|
||||
{
|
||||
require_once( './initdata.php' );/*noLibHook*/
|
||||
}
|
||||
elseif ( is_file( '../initdata.php' ) )
|
||||
{
|
||||
require_once( '../initdata.php' );/*noLibHook*/
|
||||
}
|
||||
else
|
||||
{
|
||||
require_once( 'initdata.php' );/*noLibHook*/
|
||||
}
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );/*noLibHook*/
|
||||
|
||||
$reg = ipsRegistry::instance();
|
||||
$reg->init();
|
||||
|
||||
$moo = new moo( $reg );
|
||||
|
||||
class moo
|
||||
{
|
||||
private $processed = 0;
|
||||
private $parser;
|
||||
private $oldparser;
|
||||
private $start = 0;
|
||||
private $end = 0;
|
||||
|
||||
const TOPICS_PER_GO = 100;
|
||||
|
||||
function __construct( ipsRegistry $registry )
|
||||
{
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
$this->memberData = array();
|
||||
|
||||
/* Do we have a remote DB? */
|
||||
if ( $this->settings['archive_remote_sql_database'] && $this->settings['archive_remote_sql_user'] )
|
||||
{
|
||||
if ( ! is_object( $this->registry->dbFunctions()->getDB('remoteArchive') ) )
|
||||
{
|
||||
$this->registry->dbFunctions()->setDB( 'mysql', 'remoteArchive', array( 'sql_database' => $this->settings['archive_remote_sql_database'],
|
||||
'sql_user' => $this->settings['archive_remote_sql_user'],
|
||||
'sql_pass' => $this->settings['archive_remote_sql_pass'],
|
||||
'sql_host' => $this->settings['archive_remote_sql_host'],
|
||||
'sql_charset' => $this->settings['archive_remote_sql_charset'],
|
||||
'sql_tbl_prefix' => $this->settings['sql_tbl_prefix'],
|
||||
'catchConnectionError' => true ) );
|
||||
|
||||
|
||||
$this->remoteDB = $this->registry->dbFunctions()->getDB('remoteArchive');
|
||||
|
||||
/* Check for connection issue */
|
||||
if ( $this->remoteDB->error )
|
||||
{
|
||||
$this->connectError = $this->remoteDB->error;
|
||||
$this->remoteDB = null;
|
||||
|
||||
$this->registry->dbFunctions()->unsetDB('remoteArchive');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->remoteDB = $this->registry->dbFunctions()->getDB('remoteArchive');
|
||||
|
||||
/* Check for connection issue */
|
||||
if ( $this->remoteDB->error )
|
||||
{
|
||||
$this->connectError = $this->remoteDB->error;
|
||||
$this->remoteDB = null;
|
||||
|
||||
$this->registry->dbFunctions()->unsetDB('remoteArchive');
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->remoteDB = $this->DB;
|
||||
}
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'process':
|
||||
$this->process();
|
||||
break;
|
||||
default:
|
||||
$this->splash();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function show( $content, $url='' )
|
||||
{
|
||||
if ( $url )
|
||||
{
|
||||
$firstBit = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'];
|
||||
$refresh = "<meta http-equiv='refresh' content='0; url={$firstBit}?{$url}'>";
|
||||
}
|
||||
|
||||
if ( is_array( $content ) )
|
||||
{
|
||||
$content = implode( "<br />", $content );
|
||||
}
|
||||
|
||||
$html = <<<EOF
|
||||
<html>
|
||||
<head>
|
||||
<title>Archive Update</title>
|
||||
$refresh
|
||||
</head>
|
||||
<body>
|
||||
$content
|
||||
</body>
|
||||
</html>
|
||||
EOF;
|
||||
|
||||
print $html; exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* SPLASH
|
||||
*/
|
||||
function splash()
|
||||
{
|
||||
$txt = '';
|
||||
|
||||
$html = <<<EOF
|
||||
<strong>Archive Update for IP.Board 3.3.3</strong>
|
||||
<br />{$txt}
|
||||
<a href="?do=process">Continue</a>
|
||||
EOF;
|
||||
|
||||
$this->show( $html );
|
||||
}
|
||||
|
||||
/**
|
||||
* Process
|
||||
*/
|
||||
function process()
|
||||
{
|
||||
$data = $this->getRestoreData();
|
||||
$topics = array();
|
||||
|
||||
$this->DB->build( array( 'select' => 'tid',
|
||||
'from' => 'topics',
|
||||
'where' => 'topic_archive_status=4' ) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
$topics[ $row['tid'] ] = $row['tid'];
|
||||
}
|
||||
|
||||
/* get maxes */
|
||||
if ( count( $topics ) )
|
||||
{
|
||||
$this->DB->build( array( 'select' => 'topic_id, max(pid) as max',
|
||||
'from' => 'posts',
|
||||
'where' => 'topic_id IN( ' . implode( ',', $topics ) . ')',
|
||||
'group' => 'topic_id' ) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
$topics[ $row['topic_id'] ] = $row['max'];
|
||||
}
|
||||
}
|
||||
|
||||
$data['restore_manual_tids'] = $topics;
|
||||
|
||||
$this->setRestoreData( $data );
|
||||
|
||||
$this->show( "Process complete" );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get restore data
|
||||
*/
|
||||
public function getRestoreData()
|
||||
{
|
||||
$data = $this->DB->buildAndFetch( array( 'select' => '*',
|
||||
'from' => 'core_archive_restore' ) );
|
||||
|
||||
if ( IPSLib::isSerialized( $data['restore_manual_tids'] ) )
|
||||
{
|
||||
$data['restore_manual_tids'] = unserialize( $data['restore_manual_tids'] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$data['restore_manual_tids'] = array();
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set restore data
|
||||
* @param array
|
||||
*/
|
||||
public function setRestoreData( $data )
|
||||
{
|
||||
if ( is_array( $data['restore_manual_tids'] ) )
|
||||
{
|
||||
$data['restore_manual_tids'] = serialize( $data['restore_manual_tids'] );
|
||||
}
|
||||
|
||||
$data['restore_min_tid'] = intval( $data['restore_min_tid'] );
|
||||
$data['restore_max_tid'] = intval( $data['restore_max_tid'] );
|
||||
|
||||
$this->DB->delete( 'core_archive_restore');
|
||||
$this->DB->insert( 'core_archive_restore', $data );
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,166 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+---------------------------------------------------------------------------
|
||||
| IP.Board v3.4.5
|
||||
| ========================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2008 Invision Power Services
|
||||
| http://www.invisionpower.com
|
||||
| ========================================
|
||||
+---------------------------------------------------------------------------
|
||||
| Invision Power Board IS NOT FREE SOFTWARE!
|
||||
+---------------------------------------------------------------------------
|
||||
| http://www.invisionpower.com/
|
||||
| > $Id: 10039 2011-12-20 19:49:28Z mmecham $
|
||||
| > $Revision: 10039 $
|
||||
| > $Date: 2011-12-20 14:49:28 -0500 (Tue, 20 Dec 2011) $
|
||||
+---------------------------------------------------------------------------
|
||||
*/
|
||||
@set_time_limit( 3600 );
|
||||
|
||||
/**
|
||||
* Main public executable wrapper.
|
||||
*
|
||||
* Set-up and load module to run
|
||||
*
|
||||
* @package IP.Board
|
||||
* @author Matt Mecham
|
||||
* @version 3.0
|
||||
*/
|
||||
|
||||
if ( is_file( './initdata.php' ) )
|
||||
{
|
||||
require_once( './initdata.php' );/*noLibHook*/
|
||||
}
|
||||
elseif ( is_file( '../initdata.php' ) )
|
||||
{
|
||||
require_once( '../initdata.php' );/*noLibHook*/
|
||||
}
|
||||
else
|
||||
{
|
||||
require_once( 'initdata.php' );/*noLibHook*/
|
||||
}
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );/*noLibHook*/
|
||||
|
||||
$reg = ipsRegistry::instance();
|
||||
$reg->init();
|
||||
|
||||
$moo = new moo( $reg );
|
||||
|
||||
class moo
|
||||
{
|
||||
private $processed = 0;
|
||||
private $parser;
|
||||
private $oldparser;
|
||||
private $start = 0;
|
||||
private $end = 0;
|
||||
|
||||
const TOPICS_PER_GO = 100;
|
||||
|
||||
function __construct( ipsRegistry $registry )
|
||||
{
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
$this->memberData = array();
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'media':
|
||||
$this->media();
|
||||
break;
|
||||
default:
|
||||
$this->splash();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function show( $content, $url='' )
|
||||
{
|
||||
if ( $url )
|
||||
{
|
||||
$firstBit = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'];
|
||||
$refresh = "<meta http-equiv='refresh' content='0; url={$firstBit}?{$url}'>";
|
||||
}
|
||||
|
||||
if ( is_array( $content ) )
|
||||
{
|
||||
$content = implode( "<br />", $content );
|
||||
}
|
||||
|
||||
$html = <<<EOF
|
||||
<html>
|
||||
<head>
|
||||
<title>3.4.x Post Repair</title>
|
||||
$refresh
|
||||
</head>
|
||||
<body>
|
||||
$content
|
||||
</body>
|
||||
</html>
|
||||
EOF;
|
||||
|
||||
print $html; exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* SPLASH
|
||||
*/
|
||||
function splash()
|
||||
{
|
||||
$txt = '';
|
||||
|
||||
$html = <<<EOF
|
||||
<strong>Please select a tool</strong>
|
||||
<br />{$txt}
|
||||
<a href="?do=media">Fix MEDIA (Youtube, etc)</a>
|
||||
EOF;
|
||||
|
||||
$this->show( $html );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fix up media stuffs
|
||||
*/
|
||||
function media()
|
||||
{
|
||||
$this->DB->build( array( 'select' => '*',
|
||||
'from' => 'posts',
|
||||
'where' => "post LIKE '%<object%'" ) );
|
||||
|
||||
$o = $this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch( $o ) )
|
||||
{
|
||||
$original = $row['post'];
|
||||
|
||||
preg_match_all( '#<object(.+?)</object>#i', $row['post'], $matches, PREG_SET_ORDER );
|
||||
|
||||
foreach( $matches as $val )
|
||||
{
|
||||
preg_match( '#http(?:s)?://(?:www.)?youtube.com/v/([\d\w-_]{4,})(&\S+?)?#', $row['post'], $matches );
|
||||
|
||||
if ( $matches[1] )
|
||||
{
|
||||
$row['post'] = str_replace( $val[0], '[media]http://youtube.com/watch?v=' . $matches[1] . '[/media]', $row['post'] );
|
||||
}
|
||||
}
|
||||
|
||||
if ( $row['post'] && $row['pid'] && ( $original != $row['post'] ) )
|
||||
{
|
||||
$this->DB->update( 'posts', array( 'post' => $row['post'] ), 'pid=' . intval( $row['pid'] ) );
|
||||
|
||||
$output .= "Fixed Post Id: " . $row['pid'] . '<br />';
|
||||
}
|
||||
}
|
||||
|
||||
$this->show( "<h2>Complete</h2>" . $output );
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,236 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* Main public executable wrapper.
|
||||
* Set-up and load module to run
|
||||
* Last Updated: $Date: 2011-03-31 11:17:44 +0100 (Thu, 31 Mar 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 8229 $
|
||||
*
|
||||
*/
|
||||
|
||||
define( 'IPB_THIS_SCRIPT', 'admin' );
|
||||
|
||||
if ( is_file( './initdata.php' ) )
|
||||
{
|
||||
require_once( './initdata.php' );/*noLibHook*/
|
||||
}
|
||||
else
|
||||
{
|
||||
require_once( '../initdata.php' );/*noLibHook*/
|
||||
}
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsController.php' );/*noLibHook*/
|
||||
|
||||
$reg = ipsRegistry::instance();
|
||||
$reg->init();
|
||||
|
||||
$moo = new moo( $reg );
|
||||
|
||||
class moo
|
||||
{
|
||||
function __construct( ipsRegistry $registry )
|
||||
{
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
$this->_doLang();
|
||||
$this->_doSkins();
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuild langs
|
||||
*/
|
||||
protected function _doSkins()
|
||||
{
|
||||
/* INIT */
|
||||
$start = time();
|
||||
$output = array();
|
||||
$errors = array();
|
||||
|
||||
/* Grab class */
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinImportExport.php' );/*noLibHook*/
|
||||
|
||||
$skinFunctions = new skinImportExport( $this->registry );
|
||||
|
||||
|
||||
/* Grab skin data */
|
||||
$this->DB->build( array( 'select' => '*',
|
||||
'from' => 'skin_collections' ) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
/* Bit of jiggery pokery... */
|
||||
if ( $row['set_key'] == 'default' )
|
||||
{
|
||||
$row['set_key'] = 'root';
|
||||
$row['set_id'] = 0;
|
||||
}
|
||||
|
||||
$skinSets[ $row['set_key'] ] = $row;
|
||||
}
|
||||
|
||||
/* Templates */
|
||||
foreach( ipsRegistry::$applications as $appDir => $appData )
|
||||
{
|
||||
foreach( $skinSets as $skinKey => $skinData )
|
||||
{
|
||||
$_PATH = IPSLib::getAppDir( $appDir ) . '/xml/';
|
||||
|
||||
$output[] = "Upgrading {$skinData['set_name']} for $appDir templates...";
|
||||
|
||||
if ( is_file( $_PATH . $appDir . '_' . $skinKey . '_templates.xml' ) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Install
|
||||
//-----------------------------------------
|
||||
|
||||
$return = $skinFunctions->importTemplateAppXML( $appDir, $skinKey, $skinData['set_id'], TRUE );
|
||||
|
||||
$output[] = intval( $return['insertCount'] ) . " added, " . intval( $return['updateCount'] ) . " templates updated";
|
||||
}
|
||||
|
||||
if ( is_file( $_PATH . $appDir . '_' . $skinKey . '_css.xml' ) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Install
|
||||
//-----------------------------------------
|
||||
|
||||
$return = $skinFunctions->importCSSAppXML( $appDir, $skinKey, $skinData['set_id'] );
|
||||
|
||||
$output[] = intval( $return['insertCount'] ) . " {$skinData['set_name']} CSS files inserted";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Replacements */
|
||||
foreach( $skinSets as $skinKey => $skinData )
|
||||
{
|
||||
if ( is_file( IPS_ROOT_PATH . 'setup/xml/skins/replacements_' . $skinKey . '.xml' ) )
|
||||
{
|
||||
$skinFunctions->importReplacementsXMLArchive( file_get_contents( IPS_ROOT_PATH . 'setup/xml/skins/replacements_' . $skinKey . '.xml' ), $skinKey );
|
||||
|
||||
$output[] = $skinKey . " replacements rebuilt";
|
||||
}
|
||||
}
|
||||
|
||||
/* reset ID */
|
||||
//$skinSets['root']['set_id'] = 1;
|
||||
|
||||
/* Recache */
|
||||
foreach( $skinSets as $skinKey => $skinData )
|
||||
{
|
||||
$skinFunctions->rebuildPHPTemplates( $skinData['set_id'] );
|
||||
|
||||
if ( $skinFunctions->fetchErrorMessages() !== FALSE )
|
||||
{
|
||||
$output[] = implode( "<br />", $skinFunctions->fetchErrorMessages() );
|
||||
}
|
||||
|
||||
$skinFunctions->rebuildCSS( $skinData['set_id'] );
|
||||
|
||||
if ( $skinFunctions->fetchErrorMessages() !== FALSE )
|
||||
{
|
||||
$output[] = implode( "<br />", $skinFunctions->fetchErrorMessages() );
|
||||
}
|
||||
|
||||
$skinFunctions->rebuildReplacementsCache( $skinData['set_id'] );
|
||||
|
||||
if ( $skinFunctions->fetchErrorMessages() !== FALSE )
|
||||
{
|
||||
$output[] = implode( "<br />", $skinFunctions->fetchErrorMessages() );
|
||||
}
|
||||
|
||||
$output[] = $skinKey . " recached";
|
||||
}
|
||||
|
||||
/* recache other */
|
||||
$skinFunctions->rebuildSkinSetsCache();
|
||||
|
||||
$this->_print( implode( "\n", $output ) );
|
||||
|
||||
$end = time();
|
||||
$tkn = ( $end - $start) / 60;
|
||||
|
||||
$this->_print( "COMPLETE. Took " . $tkn . "m\n" );
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuild langs
|
||||
*/
|
||||
protected function _doLang()
|
||||
{
|
||||
/* Grab class */
|
||||
require_once( IPS_ROOT_PATH . 'applications/core/modules_admin/languages/manage_languages.php' );/*noLibHook*/
|
||||
$lang = new admin_core_languages_manage_languages( $this->registry );
|
||||
$lang->makeRegistryShortcuts( $this->registry );
|
||||
|
||||
$start = time();
|
||||
|
||||
foreach( ipsRegistry::$applications as $app => $app_data )
|
||||
{
|
||||
$output[] = "Upgrading ADMIN languages...";
|
||||
$_PATH = IPSLib::getAppDir( $app ) . '/xml/';
|
||||
|
||||
/* Loop through the xml directory and look for lang packs */
|
||||
try
|
||||
{
|
||||
foreach( new DirectoryIterator( $_PATH ) as $f )
|
||||
{
|
||||
if( preg_match( "#(admin|public)_(.+?)_language_pack.xml#", $f->getFileName() ) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Import and cache
|
||||
//-----------------------------------------
|
||||
|
||||
$output[] = "Importing " . $f->getFileName();
|
||||
|
||||
$this->request['file_location'] = $_PATH . $f->getFileName();
|
||||
$lang->imprtFromXML( true, true, true, $app );
|
||||
}
|
||||
}
|
||||
} catch ( Exception $e ) {}
|
||||
}
|
||||
|
||||
$this->_print( implode( "\n", $output ) );
|
||||
$this->_print( "\nAll languages imported and recached" );
|
||||
|
||||
$end = time();
|
||||
$tkn = ( $end - $start) / 60;
|
||||
|
||||
$this->_print( "\COMPLETE. Took " . $tkn . "m\n" );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Out to stdout
|
||||
*/
|
||||
protected function _print( $message, $newline="\n" )
|
||||
{
|
||||
print nl2br( preg_replace( "#\n{1,}#", "\n", $message ) );
|
||||
}
|
||||
}
|
||||
|
||||
exit();
|
||||
|
||||
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,303 @@
|
||||
#!/usr/local/bin/php
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* Main public executable wrapper.
|
||||
* Set-up and load module to run
|
||||
* Last Updated: $Date: 2012-06-06 15:26:34 -0400 (Wed, 06 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10878 $
|
||||
*
|
||||
*/
|
||||
|
||||
define( 'IPS_IS_SHELL', TRUE );
|
||||
define( 'IPB_THIS_SCRIPT', 'admin' );
|
||||
|
||||
if ( is_file( './initdata.php' ) )
|
||||
{
|
||||
require_once( './initdata.php' );/*noLibHook*/
|
||||
}
|
||||
elseif ( is_file( '../initdata.php' ) )
|
||||
{
|
||||
require_once( '../initdata.php' );/*noLibHook*/
|
||||
}
|
||||
else
|
||||
{
|
||||
require_once( 'initdata.php' );/*noLibHook*/
|
||||
}
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsController.php' );/*noLibHook*/
|
||||
|
||||
$reg = ipsRegistry::instance();
|
||||
$reg->init();
|
||||
|
||||
$moo = new moo( $reg );
|
||||
|
||||
class moo
|
||||
{
|
||||
function __construct( ipsRegistry $registry )
|
||||
{
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
$this->stdin = fopen('php://stdin', 'r');
|
||||
|
||||
$this->_print( "--------------------------------------------\nWelcome to the IP.Board Shell Get Stuff Ready For Release Tool\n--------------------------------------------\n" );
|
||||
$this->_print( "What do you wish to do? [l=Rebuild and Export Lang, s=Rebuild and Export Skins, a=Both]\nEnter: " );
|
||||
|
||||
$option = $this->_fetchOption();
|
||||
|
||||
switch( $option )
|
||||
{
|
||||
case 'l':
|
||||
$this->_doLang();
|
||||
break;
|
||||
case 's':
|
||||
$this->_doSkins();
|
||||
break;
|
||||
case 'a':
|
||||
$this->_doLang();
|
||||
$this->_doSkins();
|
||||
break;
|
||||
default:
|
||||
$this->_print( "\nIncorrect option" );
|
||||
exit();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuild langs
|
||||
*/
|
||||
protected function _doSkins()
|
||||
{
|
||||
/* INIT */
|
||||
$start = time();
|
||||
$messages = array();
|
||||
$errors = array();
|
||||
|
||||
/* Grab class */
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinImportExport.php' );/*noLibHook*/
|
||||
|
||||
$this->skinFunctions = new skinImportExport( $this->registry );
|
||||
|
||||
/* This is which skins we want to export for default installations */
|
||||
$skinIDs = array_values( $this->skinFunctions->remapData['export'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Can do .. stuff?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! is_writable( IPS_ROOT_PATH . 'setup/xml/skins' ) )
|
||||
{
|
||||
$this->_print( 'Cannot write to /admin/setup/xml/skins' );
|
||||
exit();
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Rebuild stuff
|
||||
//-----------------------------------------
|
||||
|
||||
foreach( $skinIDs as $id )
|
||||
{
|
||||
$msg = $this->skinFunctions->rebuildMasterCSS( $id );
|
||||
$messages[] = "<strong>CSS Rebuilt for $id</strong>";
|
||||
$messages = array_merge( $messages, $msg, $this->skinFunctions->fetchMessages( TRUE ) );
|
||||
$errors = array_merge( $errors , $this->skinFunctions->fetchErrorMessages( TRUE ) );
|
||||
|
||||
$msg = $this->skinFunctions->rebuildMasterFromPHP( $id );
|
||||
$messages[] = "<strong>HTML Rebuilt for $id</strong>";
|
||||
$messages = array_merge( $messages, $msg, $this->skinFunctions->fetchMessages( TRUE ) );
|
||||
$errors = array_merge( $errors , $this->skinFunctions->fetchErrorMessages( TRUE ) );
|
||||
|
||||
$msg = $this->skinFunctions->rebuildMasterReplacements( $id );
|
||||
$messages[] = "<strong>Replacements Rebuilt for $id</strong>";
|
||||
$messages = array_merge( $messages, (array)$msg, $this->skinFunctions->fetchMessages( TRUE ) );
|
||||
$errors = array_merge( $errors , $this->skinFunctions->fetchErrorMessages( TRUE ) );
|
||||
}
|
||||
|
||||
/* Got any errors? */
|
||||
if ( count( $errors ) )
|
||||
{
|
||||
$this->_print( 'ERROR: ' . implode( "\n *", $errors ) );
|
||||
//exit();
|
||||
}
|
||||
|
||||
$this->skinFunctions->rebuildTreeInformation();
|
||||
$this->skinFunctions->rebuildSkinSetsCache();
|
||||
|
||||
//-----------------------------------------
|
||||
// Rebuild skin caches
|
||||
//-----------------------------------------
|
||||
|
||||
foreach( $skinIDs as $id )
|
||||
{
|
||||
$setData = $this->skinFunctions->fetchSkinData( $id );
|
||||
|
||||
$key = $setData['set_key'];
|
||||
|
||||
if ( $id > 0 )
|
||||
{
|
||||
$this->skinFunctions->rebuildPHPTemplates( $id );
|
||||
$messages[] = "<strong>PHP Templates Recached for $key</strong>";
|
||||
$messages = array_merge( $messages, $this->skinFunctions->fetchMessages( TRUE ) );
|
||||
$errors = array_merge( $errors , $this->skinFunctions->fetchErrorMessages( TRUE ) );
|
||||
|
||||
$this->skinFunctions->rebuildCSS( $id );
|
||||
$messages[] = "<strong>CSS Recached for $key</strong>";
|
||||
$messages = array_merge( $messages, $this->skinFunctions->fetchMessages( TRUE ) );
|
||||
$errors = array_merge( $errors , $this->skinFunctions->fetchErrorMessages( TRUE ) );
|
||||
|
||||
$this->skinFunctions->rebuildReplacementsCache( $id );
|
||||
$messages[] = "<strong>Replacements Recached for $key</strong>";
|
||||
$messages = array_merge( $messages, $this->skinFunctions->fetchMessages( TRUE ) );
|
||||
$errors = array_merge( $errors , $this->skinFunctions->fetchErrorMessages( TRUE ) );
|
||||
}
|
||||
|
||||
/* Build and write XML files for replacements and CSS */
|
||||
$replacementsXML = $this->skinFunctions->generateReplacementsXML( $id, FALSE );
|
||||
|
||||
@unlink( IPS_ROOT_PATH . 'setup/xml/skins/replacements_' . $key . '.xml', $replacementsXML );
|
||||
|
||||
if ( $replacementsXML )
|
||||
{
|
||||
if ( ! @file_put_contents( IPS_ROOT_PATH . 'setup/xml/skins/replacements_' . $key . '.xml', $replacementsXML ) )
|
||||
{
|
||||
$errors[] = "Cannot write: " . IPS_ROOT_PATH . 'setup/xml/skins/replacements_' . $key . '.xml';
|
||||
}
|
||||
else
|
||||
{
|
||||
$messages[] = "Written: " . IPS_ROOT_PATH . 'setup/xml/skins/replacements_' . $key . '.xml';
|
||||
}
|
||||
}
|
||||
|
||||
/* Export all CSS - Function loops through all skin sets */
|
||||
$this->skinFunctions->exportAllAppCSS( $id );
|
||||
$messages[] = "<strong>App CSS Written For $key</strong>";
|
||||
$messages = array_merge( $messages, $this->skinFunctions->fetchMessages( TRUE ) );
|
||||
$errors = array_merge( $errors , $this->skinFunctions->fetchErrorMessages( TRUE ) );
|
||||
|
||||
/* Export all CSS - Function loops through all skin sets */
|
||||
$this->skinFunctions->exportAllAppTemplates( $id );
|
||||
$messages[] = "<strong>App XML Written For $key</strong>";
|
||||
$messages = array_merge( $messages, $this->skinFunctions->fetchMessages( TRUE ) );
|
||||
$errors = array_merge( $errors , $this->skinFunctions->fetchErrorMessages( TRUE ) );
|
||||
|
||||
/* Got any errors? */
|
||||
if ( count( $errors ) )
|
||||
{
|
||||
$this->_print( 'ERROR: ' . implode( "\n *", $errors ) );
|
||||
//exit();
|
||||
}
|
||||
}
|
||||
|
||||
/* Generate skin sets XML */
|
||||
$skinSetXML = $this->skinFunctions->generateMasterSkinSetXML( $skinIDs );
|
||||
|
||||
@unlink( IPS_ROOT_PATH . 'setup/xml/skins/setsData.xml' );
|
||||
|
||||
if ( ! @file_put_contents( IPS_ROOT_PATH . 'setup/xml/skins/setsData.xml', $skinSetXML ) )
|
||||
{
|
||||
$errors[] = "Cannot write:: " . IPS_ROOT_PATH . 'setup/xml/skins/setsData.xml';
|
||||
}
|
||||
else
|
||||
{
|
||||
$messages[] = "Written: " . IPS_ROOT_PATH . 'setup/xml/skins/setsData.xml';
|
||||
}
|
||||
|
||||
$this->_print( implode( "\n", $messages ) );
|
||||
|
||||
$end = time();
|
||||
$tkn = ( $end - $start) / 60;
|
||||
|
||||
$this->_print( "COMPLETE. Took " . $tkn . "m\n" );
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuild langs
|
||||
*/
|
||||
protected function _doLang()
|
||||
{
|
||||
/* Grab class */
|
||||
require_once( IPS_ROOT_PATH . 'applications/core/modules_admin/languages/manage_languages.php' );/*noLibHook*/
|
||||
$lang = new admin_core_languages_manage_languages( $this->registry );
|
||||
$lang->makeRegistryShortcuts( $this->registry );
|
||||
|
||||
$start = time();
|
||||
|
||||
foreach( ipsRegistry::$applications as $app => $app_data )
|
||||
{
|
||||
$this->_print("\nStarting App: " . $app_data['app_title'] );
|
||||
$_start = time();
|
||||
|
||||
/* Stuff the post array */
|
||||
$_POST['apps'] = array( $app => $app );
|
||||
$msgs = $lang->importFromCacheFiles( FALSE );
|
||||
|
||||
$_end = time();
|
||||
$_tkn = ( $_end - $_start) / 60;
|
||||
|
||||
$this->_print( "\nDone. Took " . $_tkn . "m\n" . implode( "\n", $msgs ) );
|
||||
}
|
||||
|
||||
$this->_print( "\nAll languages imported" );
|
||||
|
||||
foreach( ipsRegistry::$applications as $app_dir => $app_data )
|
||||
{
|
||||
$this->_print("\nExporting XML for App: " . $app_data['app_title'] );
|
||||
|
||||
$this->request['app_dir'] = $app_dir;
|
||||
|
||||
$this->request['type'] = 'admin';
|
||||
$lang->languageExportToXML( 1, 1 );
|
||||
|
||||
$this->request['type'] = 'public';
|
||||
$lang->languageExportToXML( 1, 1 );
|
||||
}
|
||||
|
||||
$end = time();
|
||||
$tkn = ( $end - $start) / 60;
|
||||
|
||||
$this->_print( "\nCOMPLETE. Took " . $tkn . "m\n" );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Out to stdout
|
||||
*/
|
||||
protected function _print( $message, $newline="\n" )
|
||||
{
|
||||
$stdout = fopen('php://stdout', 'w');
|
||||
fwrite( $stdout, $message . $newline );
|
||||
fclose( $stdout );
|
||||
}
|
||||
|
||||
/* Fetch option
|
||||
*
|
||||
*/
|
||||
protected function _fetchOption()
|
||||
{
|
||||
return trim( fgets( $this->stdin ) );
|
||||
}
|
||||
}
|
||||
|
||||
exit();
|
||||
|
||||
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,285 @@
|
||||
#!/usr/local/bin/php
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* Rebuilds stuff from XML
|
||||
* Last Updated: $Date: 2012-06-06 15:26:34 -0400 (Wed, 06 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: ips_terabyte $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10878 $
|
||||
*
|
||||
*/
|
||||
|
||||
define( 'IPS_IS_SHELL', TRUE );
|
||||
define( 'IPB_THIS_SCRIPT', 'admin' );
|
||||
|
||||
if ( is_file( './initdata.php' ) )
|
||||
{
|
||||
require_once( './initdata.php' );/*noLibHook*/
|
||||
}
|
||||
elseif ( is_file( '../initdata.php' ) )
|
||||
{
|
||||
require_once( '../initdata.php' );/*noLibHook*/
|
||||
}
|
||||
else
|
||||
{
|
||||
require_once( 'initdata.php' );/*noLibHook*/
|
||||
}
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsController.php' );/*noLibHook*/
|
||||
|
||||
$reg = ipsRegistry::instance();
|
||||
$reg->init();
|
||||
|
||||
/* Ensure it's CLI */
|
||||
$cli = php_sapi_name() === 'cli';
|
||||
|
||||
if ( ! $cli )
|
||||
{
|
||||
print "<html><head><title>Warning</title></head>\n";
|
||||
print "<body style='text-align:center'>\n";
|
||||
print "This script is meant to be run via command line<br />\n";
|
||||
print "More information:<br />\n";
|
||||
print "<a href=\"http://www.google.com/search?hl=en&q=php+cli+windows\" target=\"_blank\">http://www.google.com/search?hl=en&q=php+cli+windows</a><br />\n";
|
||||
print "This script will not run through a webserver.<br />\n";
|
||||
print "</body></html>\n";
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
print "\n ";
|
||||
print "\n (_) _ __ ____ ";
|
||||
print "\n | || '_ \ / ___' ";
|
||||
print "\n | || |_) | \__. ";
|
||||
print "\n | || .__/.\___ \ ";
|
||||
print "\n |_||_| |_______/ \n\n";
|
||||
|
||||
$moo = new moo( $reg );
|
||||
|
||||
class moo
|
||||
{
|
||||
function __construct( ipsRegistry $registry )
|
||||
{
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
$this->stdin = fopen('php://stdin', 'r');
|
||||
|
||||
$this->_print( "--------------------------------------------\nWelcome to the IN_DEV build tool" );
|
||||
$this->_print( "This tool will create the required directories and files to run in IN_DEV\n--------------------------------------------\n" );
|
||||
|
||||
/* Is IN_DEV on? */
|
||||
if ( ! IN_DEV )
|
||||
{
|
||||
$this->_print( "IN_DEV is not on. Please edit 'conf_global.php' and add: define( 'IN_DEV', 1 );" );
|
||||
exit();
|
||||
}
|
||||
|
||||
/* Can we write into require folders? */
|
||||
$req = array( 'cache', 'cache/skin_cache', 'cache/lang_cache', 'cache/lang_cache/1', PUBLIC_DIRECTORY . '/style_css' );/*noLibHook*/
|
||||
$stop = false;
|
||||
|
||||
foreach( $req as $r )
|
||||
{
|
||||
if ( ! is_dir( DOC_IPS_ROOT_PATH . $r ) )
|
||||
{
|
||||
$this->_print( "Cannot locate: $r - please CHMOD appropriately and re-run" );
|
||||
$stop = true;
|
||||
}
|
||||
|
||||
if ( ! is_writable( DOC_IPS_ROOT_PATH . $r ) )
|
||||
{
|
||||
$this->_print( "Cannot write to: $r - please CHMOD appropriately and re-run" );
|
||||
$stop = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $stop )
|
||||
{
|
||||
exit();
|
||||
}
|
||||
|
||||
$this->_print( "Hit Any Key To Continue: " );
|
||||
|
||||
$option = $this->_fetchOption();
|
||||
|
||||
/* Export all skins required */
|
||||
$this->_doSkins();
|
||||
|
||||
/* Export all language bits */
|
||||
$this->_doLang();
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuild skins
|
||||
*/
|
||||
protected function _doSkins()
|
||||
{
|
||||
/* INIT */
|
||||
$start = time();
|
||||
$output = array();
|
||||
$errors = array();
|
||||
|
||||
/* Grab class */
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinImportExport.php' );/*noLibHook*/
|
||||
|
||||
$skinFunctions = new skinImportExport( $this->registry );
|
||||
|
||||
/* Fetch master dirs */
|
||||
$master = $skinFunctions->fetchMasterKeys();
|
||||
|
||||
if ( ! count( $master ) )
|
||||
{
|
||||
$this->_print( "Could not locate any master skin keys" );
|
||||
exit();
|
||||
}
|
||||
|
||||
/* PHP */
|
||||
foreach( $master as $m )
|
||||
{
|
||||
$path = ( $m == 'root' ) ? IPS_CACHE_PATH . 'cache/skin_cache/master_skin' : IPS_CACHE_PATH . 'cache/skin_cache/master_skin_' . $m;
|
||||
$path = ( $m == 'xmlskin' ) ? IPS_CACHE_PATH . 'cache/skin_cache/master_skin_xml' : $path;
|
||||
|
||||
if ( is_dir( $path ) )
|
||||
{
|
||||
$this->_print( "$path already exists..." );
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( ! mkdir( $path, IPS_FOLDER_PERMISSION ) )
|
||||
{
|
||||
$this->_print( "Could not create $path" );
|
||||
exit();
|
||||
}
|
||||
else
|
||||
{
|
||||
@chmod( $path, IPS_FOLDER_PERMISSION );
|
||||
$this->_print( "$path created..." );
|
||||
}
|
||||
}
|
||||
|
||||
/* CSS */
|
||||
foreach( $master as $m )
|
||||
{
|
||||
$path = ( $m == 'root' ) ? DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_css/master_css' : DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_css/master_css_' . $m;
|
||||
$path = ( $m == 'xmlskin' ) ? DOC_IPS_ROOT_PATH . PUBLIC_DIRECTORY . '/style_css/master_css_xml' : $path;
|
||||
|
||||
if ( is_dir( $path ) )
|
||||
{
|
||||
$this->_print( "$path already exists..." );
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( ! mkdir( $path, IPS_FOLDER_PERMISSION ) )
|
||||
{
|
||||
$this->_print( "Could not create $path" );
|
||||
exit();
|
||||
}
|
||||
else
|
||||
{
|
||||
@chmod( $path, IPS_FOLDER_PERMISSION );
|
||||
$this->_print( "$path created..." );
|
||||
}
|
||||
}
|
||||
|
||||
/* Now create master dirs for PHP */
|
||||
foreach( $master as $m )
|
||||
{
|
||||
$dir = ( $m == 'root' ) ? 'master_skin' : 'master_skin_' . $m;
|
||||
$dir = ( $m == 'xmlskin' ) ? 'master_skin_xml' : $dir;
|
||||
|
||||
$skinFunctions->writeMasterSkin( $m, $dir );
|
||||
|
||||
$this->_print( "PHP templates written for $m" );
|
||||
}
|
||||
|
||||
/* Now create master dirs for CSS */
|
||||
foreach( $master as $m )
|
||||
{
|
||||
$dir = ( $m == 'root' ) ? 'master_css' :'master_css_' . $m;
|
||||
$dir = ( $m == 'xmlskin' ) ? 'master_css_xml' : $dir;
|
||||
|
||||
$skinFunctions->writeMasterSkinCss( $m, $dir );
|
||||
|
||||
$this->_print( "CSS written for $m" );
|
||||
}
|
||||
|
||||
/* Now create master dirs for replacements */
|
||||
foreach( $master as $m )
|
||||
{
|
||||
$dir = ( $m == 'root' ) ? 'master_skin' : 'master_skin_' . $m;
|
||||
$dir = ( $m == 'xmlskin' ) ? 'master_skin_xml' : $dir;
|
||||
|
||||
$skinFunctions->writeMasterSkinReplacements( $m, $dir );
|
||||
|
||||
$this->_print( "Replacements written for $m" );
|
||||
}
|
||||
|
||||
|
||||
$end = time();
|
||||
$tkn = ( $end - $start) / 60;
|
||||
|
||||
$this->_print( "COMPLETE. Took " . $tkn . "m\n" );
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuild langs
|
||||
*/
|
||||
protected function _doLang()
|
||||
{
|
||||
/* INIT */
|
||||
$start = time();
|
||||
|
||||
/* Grab class */
|
||||
require_once( IPS_ROOT_PATH . 'applications/core/modules_admin/languages/manage_languages.php' );/*noLibHook*/
|
||||
$lang = new admin_core_languages_manage_languages( $this->registry );
|
||||
$lang->makeRegistryShortcuts( $this->registry );
|
||||
|
||||
$lang->cacheToDisk( 'master' );
|
||||
|
||||
$end = time();
|
||||
$tkn = ( $end - $start) / 60;
|
||||
|
||||
$this->_print( "Master languages written" );
|
||||
$this->_print( "COMPLETE. Took " . $tkn . "m\n" );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Out to stdout
|
||||
*/
|
||||
protected function _print( $message, $newline="\n" )
|
||||
{
|
||||
$stdout = fopen('php://stdout', 'w');
|
||||
fwrite( $stdout, $message . $newline );
|
||||
fclose( $stdout );
|
||||
}
|
||||
|
||||
/* Fetch option
|
||||
*
|
||||
*/
|
||||
protected function _fetchOption()
|
||||
{
|
||||
return trim( fgets( $this->stdin ) );
|
||||
}
|
||||
}
|
||||
|
||||
exit();
|
||||
|
||||
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,280 @@
|
||||
<?php
|
||||
|
||||
define( 'IPB_VERSION', '3.4' );
|
||||
|
||||
?>
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
||||
<title>IP.Board <?php print IPB_VERSION; ?> - Requirements Checker</title>
|
||||
<style type='text/css'>
|
||||
.pass {
|
||||
color: green;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.fail {
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.warn {
|
||||
color: orange;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.what-you-should-do {
|
||||
color: grey;
|
||||
font-size: 12px;
|
||||
font-style: italic;
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
border-bottom: 1px solid black;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 2px;
|
||||
padding: 4px;
|
||||
border-bottom: 1px dotted grey;
|
||||
font-size: 15px;
|
||||
font-family: "Arial, Verdana";
|
||||
}
|
||||
|
||||
p.final {
|
||||
border-bottom: 0px;
|
||||
padding-top: 20px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1>IP.Board <?php print IPB_VERSION; ?> Requirements Checker</h1>
|
||||
|
||||
<?php
|
||||
|
||||
$extensions = get_loaded_extensions();
|
||||
$version = phpversion();
|
||||
$minVersion = '5.2.0';
|
||||
|
||||
//-----------------------------------------
|
||||
// Checking against required version
|
||||
//-----------------------------------------
|
||||
|
||||
$checkRequiredVersion = version_compare( $minVersion, $version, '<=' );
|
||||
flushOutput( "Проверка версии PHP (минимум - {$minVersion})...", $checkRequiredVersion, "Вы должны установить PHP версии {$minVersion} или выше для запуска IP.Board " . IPB_VERSION . ". Сейчас работает версия {$version}. Пожалуйста, свяжитесь с вашим хостинг-провайдером для обновления PHP до версии {$minVersion} или выше." );
|
||||
|
||||
print "<p>You are running PHP <strong>{$version}</strong></p>";
|
||||
|
||||
//-----------------------------------------
|
||||
// Check for zend guard
|
||||
//-----------------------------------------
|
||||
|
||||
$hasZend = false;
|
||||
|
||||
if ( function_exists( 'zend_loader_enabled' ) )
|
||||
{
|
||||
if ( @zend_loader_enabled() === true )
|
||||
{
|
||||
$hasZend = true;
|
||||
}
|
||||
}
|
||||
|
||||
flushOutput( "Только для IP.Nexus: Проверка обработки скриптов, закодированных Zend Guard...", $hasZend, "Ваш сервер не может обрабатывать закодированные скрипты IP.Nexus. Это не влияет на IP.Board, IP.Downloads. IP.Blog, IP.Gallery, IP.Content, IP.Chat" );
|
||||
|
||||
//-----------------------------------------
|
||||
// Memory limit
|
||||
//-----------------------------------------
|
||||
|
||||
$_memLimit = null;
|
||||
$_recLimit = 128;
|
||||
|
||||
if( @ini_get('memory_limit') )
|
||||
{
|
||||
$_memLimit = @ini_get('memory_limit');
|
||||
}
|
||||
|
||||
if( $_memLimit )
|
||||
{
|
||||
$_intLimit = $_memLimit;
|
||||
$_intRec = $_recLimit * 1024 * 1024;
|
||||
|
||||
preg_match( "#^(\d+)(\w+)$#", strtolower($_intLimit), $match );
|
||||
|
||||
if( $match[2] == 'g' )
|
||||
{
|
||||
$_intLimit = intval( $_intLimit ) * 1024 * 1024 * 1024;
|
||||
}
|
||||
else if ( $match[2] == 'm' )
|
||||
{
|
||||
$_intLimit = intval( $_intLimit ) * 1024 * 1024;
|
||||
}
|
||||
else if ( $match[2] == 'k' )
|
||||
{
|
||||
$_intLimit = intval( $_intLimit ) * 1024;
|
||||
}
|
||||
else
|
||||
{
|
||||
$_intLimit = intval( $_intLimit );
|
||||
}
|
||||
|
||||
if( $_intLimit >= $_intRec )
|
||||
{
|
||||
flushOutput( "Проверка выделения памяти ({$_recLimit}M или больше рекомендуется)...", true, "Ваш сервер ограничивает объем выделяемой памяти(memory_limit): {$_memLimit}" );
|
||||
}
|
||||
else
|
||||
{
|
||||
flushOutput( "Проверка выделения памяти ({$_recLimit}M или больше рекомендуется)...", 2, "Ваш сервер ограничивает объем выделяемой памяти(memory_limit): {$_memLimit}. Вы можете использовать IP.Board, но свяжитесь с вашим хостинг-провайдером и попросите его увеличить memory_limit до {$_recLimit}M, чтобы избежать ошибок в будущем. Возможно прекращение работы скриптов при обработке больших объемов данных" );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
flushOutput( "Проверка выделения памяти ({$_recLimit}M или больше рекомендуется)...", 2, "Не удалось получить значение переменной memory_limit" );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Checking for SPL
|
||||
//-----------------------------------------
|
||||
|
||||
$splExists = in_array( 'SPL', $extensions );
|
||||
flushOutput( "Проверка SPL...", $splExists, "IP.Board " . IPB_VERSION . " требуется расширение PHP SPL. Пожалуйста, свяжитесь с вашим хостинг-провайдером для установки <a href='http://www.php.net/manual/ru/spl.setup.php'>библиотеки SPL</a>." );
|
||||
|
||||
//-----------------------------------------
|
||||
// Checking for DOM XML
|
||||
//-----------------------------------------
|
||||
|
||||
$domXML = in_array( 'dom', $extensions );
|
||||
flushOutput( "Проверка обработки DOM XML...", $domXML, "IP.Board " . IPB_VERSION . " требуется расширение обработчика DOM XML. Пожалуйста, свяжитесь с вашим хостинг-провайдером для установки <a href='http://www.php.net/manual/ru/dom.setup.php'>библиотеки libxml2</a>." );
|
||||
|
||||
//-----------------------------------------
|
||||
// Check for GD2
|
||||
//-----------------------------------------
|
||||
|
||||
$gd2 = in_array( 'gd', $extensions );
|
||||
flushOutput( "Проверка библиотеки GD...", $gd2, "IP.Board " . IPB_VERSION . " требуется библиотека GD2. Пожалуйста, свяжитесь с вашим хостинг-провайдером для установки <a href='http://us.php.net/manual/ru/image.setup.php'>библиотеки libgd</a>." );
|
||||
|
||||
if( function_exists( 'gd_info' ) )
|
||||
{
|
||||
$gdInfo = gd_info();
|
||||
$fail = true;
|
||||
|
||||
if( $gdInfo["GD Version"] )
|
||||
{
|
||||
preg_match( "/.*?([\d\.]+).*?/", $gdInfo["GD Version"], $matches );
|
||||
|
||||
if( $matches[1] )
|
||||
{
|
||||
$compareVersions = version_compare( '2.0', $matches[1], '<=' );
|
||||
|
||||
if( !$compareVersions )
|
||||
{
|
||||
$fail = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
flushOutput( "Проверка GD2...", $fail, "Библиотека GD установлена, но IP.Board " . IPB_VERSION . " требуется библиотека GD версии 2. Версия переданная вашим сервером '{$gdInfo['GD Version']}'. Пожалуйста убедитесь, что используете GD версии 2, и обновите <a href='http://us.php.net/manual/ru/image.setup.php'>библиотеку libgd</a> при необходимости." );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Checking for mysql extension
|
||||
//-----------------------------------------
|
||||
|
||||
$mysql = in_array( 'mysql', $extensions );
|
||||
$mysqli = in_array( 'mysqli', $extensions );
|
||||
flushOutput( "Проверка mysql...", ( $mysql OR $mysqli ), "Ваш сервер не имеет библиотеки mysql, попросите хостера установить поддержку <a href='http://us.php.net/manual/ru/mysqli.setup.php'>mysqli</a>." );
|
||||
|
||||
if( $mysql AND !$mysqli )
|
||||
{
|
||||
flushOutput( "Проверка поддержки mysqli...", false, "Расширение mysqli рекомендуется вместо стандартного интерфейса mysql. Форум может обойтись и без него, но, если возможно, установите <a href='http://us.php.net/manual/ru/mysqli.setup.php'>его</a> для улучшения скорости и безопасности работы." );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Checking for JSON
|
||||
//-----------------------------------------
|
||||
|
||||
$json = in_array( 'json', $extensions );
|
||||
flushOutput( "Проверка JSON...", $json, "Расширение PHP JSON необходимо для функционирования форума. Узнайте как установить <a href='http://us.php.net/manual/ru/json.setup.php'>расширение json</a>." );
|
||||
|
||||
//-----------------------------------------
|
||||
// Checking for openSSL
|
||||
//-----------------------------------------
|
||||
|
||||
$openssl = in_array( 'openssl', $extensions ) ? true : 2;
|
||||
flushOutput( "Проверка openSSL...", $openssl, "OpenSSL необходим для модулей связи с Facebook, Twitter, и модуля Subscription Manager. Если вы не используете ни один из этих модулей, то можно обойтись без этого расширения, иначе вам необходимо установить<a href='http://us2.php.net/manual/ru/openssl.installation.php'> расширение openssl</a>." );
|
||||
|
||||
//-----------------------------------------
|
||||
// Suhosin
|
||||
//-----------------------------------------
|
||||
|
||||
if( extension_loaded( 'suhosin' ) )
|
||||
{
|
||||
$_postMaxVars = @ini_get('suhosin.post.max_vars');
|
||||
$_reqMaxVars = @ini_get('suhosin.request.max_vars');
|
||||
$_getMaxLen = @ini_get('suhosin.get.max_value_length');
|
||||
$_postMaxLen = @ini_get('suhosin.post.max_value_length');
|
||||
$_reqMaxLen = @ini_get('suhosin.request.max_value_length');
|
||||
$_reqMaxVar = @ini_get('suhosin.request.max_varname_length');
|
||||
|
||||
$_indPMV = $_postMaxVars < 4096 ? 2 : true;
|
||||
$_indRMV = $_reqMaxVars < 4096 ? 2 : true;
|
||||
$_indGML = $_getMaxLen < 2000 ? 2 : true;
|
||||
$_indPML = $_postMaxLen < 1000000 ? 2 : true;
|
||||
$_indRML = $_reqMaxLen < 1000000 ? 2 : true;
|
||||
$_indRMVL = $_reqMaxVar < 350 ? 2 : true;
|
||||
|
||||
flushOutput( "suhosin.post.max_vars (4096 or better recommended)...", $_indPMV, "Your value: {$_postMaxVars}. Can prevent some forms (especially in the ACP) from saving properly." );
|
||||
flushOutput( "suhosin.request.max_vars (4096 or better recommended)...", $_indRMV, "Your value: {$_reqMaxVars}. Can prevent some forms (especially in the ACP) from saving properly." );
|
||||
flushOutput( "suhosin.get.max_value_length (2000 or better recommended)...", $_indGML, "Your value: {$_postMaxLen}. Can prevent very long URLs from loading correctly." );
|
||||
flushOutput( "suhosin.post.max_value_length (1000000 or better recommended)...", $_indPML, "Your value: {$_postMaxLen}. Can prevent very large posts or other form submissions from saving properly." );
|
||||
flushOutput( "suhosin.request.max_value_length (1000000 or better recommended)...", $_indRML, "Your value: {$_reqMaxLen}. Can prevent very large posts or other form submissions from saving properly." );
|
||||
flushOutput( "suhosin.request.max_varname_length (350 or better recommended)...", $_indRMVL, "Your value: {$_reqMaxVar}. Can prevent long friendly URLs from loading correctly." );
|
||||
}
|
||||
|
||||
$testtext="тестовый текст в кодировке utf-8";
|
||||
$pcre=($testtext == preg_replace( '/(^|\W)дир(\W|$)/iu', "\\1замена\\2", $testtext ))?true:false;
|
||||
flushOutput( "Проверка расширения PCRE на правильную работу со строками в формате UTF-8...", $pcre, "Библиотека PCRE неправильно обрабатывает регулярные выражения в кодировке UTF-8, обратитесь к хостинг-провайдеру для исправления этой ошибки. Неправильная работа этой функции может привести к ошикам при работе с русскими именами пользователей, ошибкам фильтра нецензурных слов и т.д." );
|
||||
|
||||
|
||||
flushOutput( 'Проверка функции filter_var()...', function_exists ( 'filter_var' ), 'Функция отсутствует, это может привести к фатальным ошибкам php и остановке выполнения скриптов' );
|
||||
//-----------------------------------------
|
||||
// Flush output function
|
||||
//-----------------------------------------
|
||||
|
||||
function flushOutput( $checking, $result, $errorText )
|
||||
{
|
||||
print "<p>" . $checking;
|
||||
|
||||
if( $result === 2 )
|
||||
{
|
||||
print "<span class='warn'>ВНИМАНИЕ</span><br /><span class='what-you-should-do'>{$errorText}</span>";
|
||||
}
|
||||
else if( !$result )
|
||||
{
|
||||
print "<span class='fail'>ОШИБКА</span><br /><span class='what-you-should-do'>{$errorText}</span>";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<span class='pass'>ОК</span>";
|
||||
}
|
||||
|
||||
print "</p>";
|
||||
|
||||
flush();
|
||||
@ob_flush();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<p class='final'>Имейте в виду, что MySQL версии 4.1 или выше (MySQL 5.0 рекомендуется) необходим IP.Board <?php print IPB_VERSION; ?>. Попросите администратора вашего сервера проверить версию MySQL если не уверены.</p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,200 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+---------------------------------------------------------------------------
|
||||
| IP.Board v3.4.5
|
||||
| ========================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2008 Invision Power Services
|
||||
| http://www.invisionpower.com
|
||||
| ========================================
|
||||
+---------------------------------------------------------------------------
|
||||
| Invision Power Board IS NOT FREE SOFTWARE!
|
||||
+---------------------------------------------------------------------------
|
||||
| http://www.invisionpower.com/
|
||||
| > $Id: galleryRebuild4_php.php 10039 2011-12-20 19:49:28Z mmecham $
|
||||
| > $Revision: 10039 $
|
||||
| > $Date: 2011-12-20 14:49:28 -0500 (Tue, 20 Dec 2011) $
|
||||
+---------------------------------------------------------------------------
|
||||
*/
|
||||
@set_time_limit( 3600 );
|
||||
|
||||
/**
|
||||
* Main public executable wrapper.
|
||||
*
|
||||
* Set-up and load module to run
|
||||
*
|
||||
* @package IP.Board
|
||||
* @author Matt Mecham
|
||||
* @version 3.0
|
||||
*/
|
||||
|
||||
if ( is_file( './initdata.php' ) )
|
||||
{
|
||||
require_once( './initdata.php' );/*noLibHook*/
|
||||
}
|
||||
else
|
||||
{
|
||||
require_once( '../initdata.php' );/*noLibHook*/
|
||||
}
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );/*noLibHook*/
|
||||
|
||||
$reg = ipsRegistry::instance();
|
||||
$reg->init();
|
||||
|
||||
$moo = new moo( $reg );
|
||||
|
||||
class moo
|
||||
{
|
||||
private $processed = 0;
|
||||
private $parser;
|
||||
private $oldparser;
|
||||
private $start = 0;
|
||||
private $end = 0;
|
||||
|
||||
function __construct( ipsRegistry $registry )
|
||||
{
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
$this->memberData = array();
|
||||
|
||||
switch( $this->request['do'] )
|
||||
{
|
||||
case 'save':
|
||||
$this->save();
|
||||
break;
|
||||
default:
|
||||
$this->splash();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function show( $content, $url='' )
|
||||
{
|
||||
if ( $url )
|
||||
{
|
||||
$firstBit = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'];
|
||||
$refresh = "<meta http-equiv='refresh' content='0; url={$firstBit}?{$url}'>";
|
||||
}
|
||||
|
||||
if ( is_array( $content ) )
|
||||
{
|
||||
$content = implode( "<br />", $content );
|
||||
}
|
||||
|
||||
$html = <<<EOF
|
||||
<html>
|
||||
<head>
|
||||
<title>Group Edit BitWise</title>
|
||||
$refresh
|
||||
</head>
|
||||
<body>
|
||||
$content
|
||||
</body>
|
||||
</html>
|
||||
EOF;
|
||||
|
||||
print $html; exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* SPLASH
|
||||
*/
|
||||
function splash()
|
||||
{
|
||||
/* Unpack bitwise fields */
|
||||
$_tmp = IPSBWOptions::thaw( 0, 'groups', 'global' );
|
||||
$groups = $this->caches['group_cache'];
|
||||
|
||||
foreach( $_tmp as $k => $v )
|
||||
{
|
||||
$radio .= "<tr>
|
||||
<td><strong>{$k}</strong></td>
|
||||
<td><input type='radio' name='bitwise[$k]' value='leave' checked='checked' /> <em>Leave as per group</em></td>
|
||||
<td><input type='radio' name='bitwise[$k]' value='1' /> <span style='color:green'>ON</span></td>
|
||||
<td><input type='radio' name='bitwise[$k]' value='0' /> <span style='color:red'>OFF</span></td>
|
||||
</tr>";
|
||||
|
||||
}
|
||||
|
||||
foreach( $groups as $id => $data )
|
||||
{
|
||||
$groupHTML .= "<div><input type='checkbox' name='groups[$id]' value='1' /> " . $data['g_title'] . "</div>\n";
|
||||
}
|
||||
|
||||
$html = <<<EOF
|
||||
<form action="?do=save" method="POST">
|
||||
Bitwise Values
|
||||
<table>{$radio}</table>
|
||||
<br />
|
||||
Apply to groups:
|
||||
{$groupHTML}
|
||||
<br />
|
||||
<input type="submit" value="Save" />
|
||||
</form>
|
||||
EOF;
|
||||
|
||||
$this->show( $html );
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert images
|
||||
*/
|
||||
function save()
|
||||
{
|
||||
$gids = $_POST['groups'];
|
||||
$bitwise = $_POST['bitwise'];
|
||||
$groups = $this->caches['group_cache'];
|
||||
|
||||
foreach( $gids as $id => $val )
|
||||
{
|
||||
$thisGroup = $groups[ $id ];
|
||||
|
||||
foreach( $bitwise as $k => $v )
|
||||
{
|
||||
if ( $v != 'leave' )
|
||||
{
|
||||
$thisGroup[ $k ] = intval( $v );
|
||||
}
|
||||
}
|
||||
|
||||
$g_bitoptions = IPSBWOPtions::freeze( $thisGroup, 'groups', 'global' );
|
||||
|
||||
$this->DB->update( 'groups', array( 'g_bitoptions' => $g_bitoptions ), 'g_id=' . $id );
|
||||
}
|
||||
|
||||
$this->rebuildGroupCache();
|
||||
|
||||
$this->show('Done');
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuilds the group cache
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function rebuildGroupCache()
|
||||
{
|
||||
$cache = array();
|
||||
|
||||
$this->DB->build( array( 'select' => '*',
|
||||
'from' => 'groups',
|
||||
'order' => 'g_title ASC' ) );
|
||||
$this->DB->execute();
|
||||
|
||||
while ( $i = $this->DB->fetch() )
|
||||
{
|
||||
$cache[ $i['g_id'] ] = IPSMember::unpackGroup( $i );
|
||||
}
|
||||
|
||||
$this->cache->setCache( 'group_cache', $cache, array( 'array' => 1 ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@@ -1,266 +0,0 @@
|
||||
<?
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board
|
||||
| ========================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2004 Invision Power Services, Inc
|
||||
| http://www.invisionpower.com
|
||||
| ========================================
|
||||
| Web: http://www.invisionpower.com
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > IP Chat => IPB Bridge Script
|
||||
| > Script written by Matt Mecham
|
||||
| > Date started: 17th February 2003 (Updated: 1 July 2004)
|
||||
| > Updated for 2.1.x: Thu 6th October 2005
|
||||
|
|
||||
+--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* SIGMACHAT auth file.
|
||||
*
|
||||
* Set-up and load module to run
|
||||
*
|
||||
* @package InvisionPowerBoard
|
||||
* @author Matt Mecham
|
||||
* @version 2.1
|
||||
*/
|
||||
|
||||
/**
|
||||
* Script type
|
||||
*
|
||||
*/
|
||||
define( 'IPB_THIS_SCRIPT', 'public' );
|
||||
define( 'IPB_LOAD_SQL' , 'queries' );
|
||||
|
||||
require_once( './init.php' );
|
||||
|
||||
//===========================================================================
|
||||
// MAIN PROGRAM
|
||||
//===========================================================================
|
||||
|
||||
$INFO = array();
|
||||
|
||||
//--------------------------------
|
||||
// Load our classes
|
||||
//--------------------------------
|
||||
|
||||
require_once ROOT_PATH . "sources/ipsclass.php";
|
||||
require_once KERNEL_PATH . "class_converge.php";
|
||||
require_once ROOT_PATH . "conf_global.php";
|
||||
|
||||
# Initiate super-class
|
||||
$ipsclass = new ipsclass();
|
||||
$ipsclass->vars = $INFO;
|
||||
|
||||
//--------------------------------
|
||||
// The clocks a' tickin'
|
||||
//--------------------------------
|
||||
|
||||
$Debug = new Debug;
|
||||
$Debug->startTimer();
|
||||
|
||||
//--------------------------------
|
||||
// Load the DB driver and such
|
||||
//--------------------------------
|
||||
|
||||
$ipsclass->init_db_connection();
|
||||
|
||||
//--------------------------------
|
||||
// Set up our vars
|
||||
//--------------------------------
|
||||
|
||||
$ipsclass->parse_incoming();
|
||||
|
||||
//--------------------------------
|
||||
// Set converge
|
||||
//--------------------------------
|
||||
|
||||
$ipsclass->converge = new class_converge( $ipsclass->DB );
|
||||
|
||||
//--------------------------------
|
||||
// Start off the cache array
|
||||
//--------------------------------
|
||||
|
||||
$ipsclass->cache_array = array('rss_calendar', 'rss_export','components','banfilters', 'settings', 'group_cache', 'systemvars', 'skin_id_cache', 'forum_cache', 'moderators', 'stats', 'languages');
|
||||
|
||||
|
||||
//===========================================================================
|
||||
// Get cache...
|
||||
//===========================================================================
|
||||
|
||||
$ipsclass->init_load_cache( $ipsclass->cache_array );
|
||||
|
||||
//--------------------------------
|
||||
// Initialize the FUNC
|
||||
//--------------------------------
|
||||
|
||||
$ipsclass->initiate_ipsclass();
|
||||
|
||||
//===========================================================================
|
||||
// AUTHORIZE...
|
||||
//===========================================================================
|
||||
|
||||
define( 'DENIED', 0 );
|
||||
define( 'ACCESS', 1 );
|
||||
define( 'ADMIN' , 2 );
|
||||
|
||||
$allowed_groups = $ipsclass->vars['chat_admin_groups'];
|
||||
$access_groups = $ipsclass->vars['chat_access_groups'];
|
||||
$autologin = 0;
|
||||
$allow_guest_access = $ipsclass->vars['chat_allow_guest'] == 1 ? ACCESS : DENIED;
|
||||
|
||||
// Stupid PHP changing it's mind on HTTP args
|
||||
|
||||
$username = $_GET['username'] != "" ? $_GET['username'] : $HTTP_GET_VARS['username'];
|
||||
$password = $_GET['password'] != "" ? $_GET['password'] : $HTTP_GET_VARS['password'];
|
||||
$ip = $_GET['ip'] != "" ? $_GET['ip'] : $HTTP_GET_VARS['ip'];
|
||||
|
||||
//----------------------------------------------
|
||||
// Test for autologin.
|
||||
//----------------------------------------------
|
||||
|
||||
if ( preg_match( "/^(?:[0-9a-z]){32}$/", $password ) )
|
||||
{
|
||||
$autologin = 1;
|
||||
}
|
||||
|
||||
//----------------------------------------------
|
||||
// Remove URL encoding (%20, etc)
|
||||
//----------------------------------------------
|
||||
|
||||
$username = $ipsclass->parse_clean_value(urldecode(trim($username)));
|
||||
$password = $ipsclass->parse_clean_value(urldecode(trim($password)));
|
||||
$ip = $ipsclass->parse_clean_value(urldecode(trim($ip)));
|
||||
|
||||
//----------------------------------------------
|
||||
// Main code
|
||||
//----------------------------------------------
|
||||
|
||||
// Start off with the lowest accessibility
|
||||
|
||||
$output_int = $allow_guest_access;
|
||||
$output_name = "";
|
||||
|
||||
//------------------------------
|
||||
// Attempt to find the user
|
||||
//------------------------------
|
||||
|
||||
$ipsclass->DB->build_query( array( 'select' => 'm.mgroup, m.name, m.members_display_name, m.id, c.*',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => "m.members_l_display_name='".$ipsclass->DB->add_slashes(strtolower($username))."'",
|
||||
'limit' => array( 0, 1 ),
|
||||
'add_join' => array( 1 => array( 'type' => 'left',
|
||||
'from' => array( 'members_converge' => 'c' ),
|
||||
'where' => 'c.converge_email=m.email',
|
||||
) )
|
||||
) );
|
||||
$ipsclass->DB->exec_query();
|
||||
|
||||
|
||||
if ( ! $member = $ipsclass->DB->fetch_row() )
|
||||
{
|
||||
die_nice();
|
||||
|
||||
//-- script exits --//
|
||||
}
|
||||
|
||||
|
||||
if ( ! $member['id'] )
|
||||
{
|
||||
// No member found - allow guest access?
|
||||
|
||||
die_nice($allow_guest_access);
|
||||
|
||||
//-- script exits --//
|
||||
}
|
||||
|
||||
//------------------------------
|
||||
// Update passy
|
||||
//------------------------------
|
||||
|
||||
if ( ! $autologin )
|
||||
{
|
||||
$md5_password = md5( md5( $member['converge_pass_salt'] ) . md5($password) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$md5_password = $password;
|
||||
}
|
||||
|
||||
//------------------------------
|
||||
// Check password - member exists
|
||||
//------------------------------
|
||||
|
||||
if ( $password != "" )
|
||||
{
|
||||
// Password was entered..
|
||||
|
||||
if ( $md5_password != $member['converge_pass_hash'] )
|
||||
{
|
||||
// Password incorrect..
|
||||
|
||||
die_nice();
|
||||
|
||||
//-- script exits --//
|
||||
}
|
||||
else
|
||||
{
|
||||
$output_int = ACCESS;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// No password entered - die!
|
||||
// Do not allow guest access on reg. name
|
||||
|
||||
die_nice();
|
||||
|
||||
//-- script exits --//
|
||||
}
|
||||
|
||||
|
||||
//------------------------------
|
||||
// Do we have any access?
|
||||
//------------------------------
|
||||
|
||||
|
||||
if ( ! preg_match( "/(^|,)".$member['mgroup']."(,|$)/", $access_groups ) )
|
||||
{
|
||||
die_nice();
|
||||
}
|
||||
|
||||
//------------------------------
|
||||
// Do we have admin access?
|
||||
//------------------------------
|
||||
|
||||
if ( preg_match( "/(^|,)".$member['mgroup']."(,|$)/", $allowed_groups ) )
|
||||
{
|
||||
$output_int = ADMIN;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------
|
||||
// Spill the beans
|
||||
//------------------------------
|
||||
|
||||
print "SCRAS^1.1\nAUTH^".$output_int."\nUID^".intval($member['id'])."\n";
|
||||
|
||||
exit();
|
||||
|
||||
|
||||
function die_nice( $access=0 )
|
||||
{
|
||||
global $ipsclass;
|
||||
|
||||
// Simply error out silently, showing guest access only for the user
|
||||
$ipsclass->DB->close_db();
|
||||
print $access;
|
||||
exit();
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,268 @@
|
||||
#!/usr/local/bin/php
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* Rebuilds stuff from XML
|
||||
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10721 $
|
||||
*
|
||||
*/
|
||||
|
||||
define( 'IPS_IS_SHELL', TRUE );
|
||||
define( 'IPB_THIS_SCRIPT', 'admin' );
|
||||
|
||||
if ( is_file( './initdata.php' ) )
|
||||
{
|
||||
require_once( './initdata.php' );/*noLibHook*/
|
||||
}
|
||||
else
|
||||
{
|
||||
require_once( '../initdata.php' );/*noLibHook*/
|
||||
}
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsController.php' );/*noLibHook*/
|
||||
|
||||
$reg = ipsRegistry::instance();
|
||||
$reg->init();
|
||||
|
||||
$moo = new moo( $reg );
|
||||
|
||||
class moo
|
||||
{
|
||||
function __construct( ipsRegistry $registry )
|
||||
{
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
$this->stdin = fopen('php://stdin', 'r');
|
||||
|
||||
$this->_print( "--------------------------------------------\nWelcome to the IP.Board Shell Rebuild Stuff From XML Tool\n--------------------------------------------\n" );
|
||||
$this->_print( "What do you wish to do? [l=Rebuild Lang, s=Rebuild Skins, b=Both]\nEnter: " );
|
||||
|
||||
$option = $this->_fetchOption();
|
||||
|
||||
switch( $option )
|
||||
{
|
||||
case 'l':
|
||||
$this->_doLang();
|
||||
break;
|
||||
case 's':
|
||||
$this->_doSkins();
|
||||
break;
|
||||
case 'b':
|
||||
$this->_doLang();
|
||||
$this->_doSkins();
|
||||
break;
|
||||
default:
|
||||
$this->_print( "\nIncorrect option" );
|
||||
exit();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuild langs
|
||||
*/
|
||||
protected function _doSkins()
|
||||
{
|
||||
/* INIT */
|
||||
$start = time();
|
||||
$output = array();
|
||||
$errors = array();
|
||||
|
||||
/* Grab class */
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinImportExport.php' );/*noLibHook*/
|
||||
|
||||
$skinFunctions = new skinImportExport( $this->registry );
|
||||
|
||||
|
||||
/* Grab skin data */
|
||||
$this->DB->build( array( 'select' => '*',
|
||||
'from' => 'skin_collections' ) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch() )
|
||||
{
|
||||
/* Bit of jiggery pokery... */
|
||||
if ( $row['set_key'] == 'default' )
|
||||
{
|
||||
$row['set_key'] = 'root';
|
||||
$row['set_id'] = 0;
|
||||
}
|
||||
|
||||
$skinSets[ $row['set_key'] ] = $row;
|
||||
}
|
||||
|
||||
/* Templates */
|
||||
foreach( ipsRegistry::$applications as $appDir => $appData )
|
||||
{
|
||||
foreach( $skinSets as $skinKey => $skinData )
|
||||
{
|
||||
$_PATH = IPSLib::getAppDir( $appDir ) . '/xml/';
|
||||
|
||||
$output[] = "Upgrading {$skinData['set_name']} for $appDir templates...";
|
||||
|
||||
if ( is_file( $_PATH . $appDir . '_' . $skinKey . '_templates.xml' ) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Install
|
||||
//-----------------------------------------
|
||||
|
||||
$return = $skinFunctions->importTemplateAppXML( $appDir, $skinKey, $skinData['set_id'], TRUE );
|
||||
|
||||
$output[] = intval( $return['insertCount'] ) . " added, " . intval( $return['updateCount'] ) . " templates updated";
|
||||
}
|
||||
|
||||
if ( is_file( $_PATH . $appDir . '_' . $skinKey . '_css.xml' ) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Install
|
||||
//-----------------------------------------
|
||||
|
||||
$return = $skinFunctions->importCSSAppXML( $appDir, $skinKey, $skinData['set_id'] );
|
||||
|
||||
$output[] = intval( $return['insertCount'] ) . " {$skinData['set_name']} CSS files inserted";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Replacements */
|
||||
foreach( $skinSets as $skinKey => $skinData )
|
||||
{
|
||||
if ( is_file( IPS_ROOT_PATH . 'setup/xml/skins/replacements_' . $skinKey . '.xml' ) )
|
||||
{
|
||||
$skinFunctions->importReplacementsXMLArchive( file_get_contents( IPS_ROOT_PATH . 'setup/xml/skins/replacements_' . $skinKey . '.xml' ), $skinKey );
|
||||
|
||||
$output[] = $skinKey . " replacements rebuilt";
|
||||
}
|
||||
}
|
||||
|
||||
/* reset ID */
|
||||
$skinSets['root']['set_id'] = 1;
|
||||
|
||||
/* Recache */
|
||||
foreach( $skinSets as $skinKey => $skinData )
|
||||
{
|
||||
$skinFunctions->rebuildPHPTemplates( $skinData['set_id'] );
|
||||
|
||||
if ( $skinFunctions->fetchErrorMessages() !== FALSE )
|
||||
{
|
||||
$output[] = implode( "<br />", $skinFunctions->fetchErrorMessages() );
|
||||
}
|
||||
|
||||
$skinFunctions->rebuildCSS( $skinData['set_id'] );
|
||||
|
||||
if ( $skinFunctions->fetchErrorMessages() !== FALSE )
|
||||
{
|
||||
$output[] = implode( "<br />", $skinFunctions->fetchErrorMessages() );
|
||||
}
|
||||
|
||||
$skinFunctions->rebuildReplacementsCache( $skinData['set_id'] );
|
||||
|
||||
if ( $skinFunctions->fetchErrorMessages() !== FALSE )
|
||||
{
|
||||
$output[] = implode( "<br />", $skinFunctions->fetchErrorMessages() );
|
||||
}
|
||||
|
||||
$output[] = $skinKey . " recached";
|
||||
}
|
||||
|
||||
/* recache other */
|
||||
$skinFunctions->rebuildSkinSetsCache();
|
||||
|
||||
$this->_print( implode( "\n", $output ) );
|
||||
|
||||
$end = time();
|
||||
$tkn = ( $end - $start) / 60;
|
||||
|
||||
$this->_print( "COMPLETE. Took " . $tkn . "m\n" );
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuild langs
|
||||
*/
|
||||
protected function _doLang()
|
||||
{
|
||||
/* Grab class */
|
||||
require_once( IPS_ROOT_PATH . 'applications/core/modules_admin/languages/manage_languages.php' );/*noLibHook*/
|
||||
$lang = new admin_core_languages_manage_languages( $this->registry );
|
||||
$lang->makeRegistryShortcuts( $this->registry );
|
||||
|
||||
$start = time();
|
||||
|
||||
foreach( ipsRegistry::$applications as $app => $app_data )
|
||||
{
|
||||
$output[] = "Upgrading ADMIN languages...";
|
||||
$_PATH = IPSLib::getAppDir( $app ) . '/xml/';
|
||||
|
||||
/* Loop through the xml directory and look for lang packs */
|
||||
try
|
||||
{
|
||||
foreach( new DirectoryIterator( $_PATH ) as $f )
|
||||
{
|
||||
if( preg_match( "#(admin|public)_(.+?)_language_pack.xml#", $f->getFileName() ) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Import and cache
|
||||
//-----------------------------------------
|
||||
|
||||
$output[] = "Importing " . $f->getFileName();
|
||||
|
||||
$this->request['file_location'] = $_PATH . $f->getFileName();
|
||||
$lang->imprtFromXML( true, true, true, $app );
|
||||
}
|
||||
}
|
||||
} catch ( Exception $e ) {}
|
||||
}
|
||||
|
||||
$this->_print( implode( "\n", $output ) );
|
||||
$this->_print( "\nAll languages imported and recached" );
|
||||
|
||||
$end = time();
|
||||
$tkn = ( $end - $start) / 60;
|
||||
|
||||
$this->_print( "\COMPLETE. Took " . $tkn . "m\n" );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Out to stdout
|
||||
*/
|
||||
protected function _print( $message, $newline="\n" )
|
||||
{
|
||||
$stdout = fopen('php://stdout', 'w');
|
||||
fwrite( $stdout, $message . $newline );
|
||||
fclose( $stdout );
|
||||
}
|
||||
|
||||
/* Fetch option
|
||||
*
|
||||
*/
|
||||
protected function _fetchOption()
|
||||
{
|
||||
return trim( fgets( $this->stdin ) );
|
||||
}
|
||||
}
|
||||
|
||||
exit();
|
||||
|
||||
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,266 @@
|
||||
#!/usr/local/bin/php
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* Main public executable wrapper.
|
||||
* Set-up and load module to run
|
||||
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10721 $
|
||||
*
|
||||
*/
|
||||
|
||||
define( 'IPS_IS_SHELL', TRUE );
|
||||
define( 'IPB_THIS_SCRIPT', 'admin' );
|
||||
|
||||
if ( is_file( './initdata.php' ) )
|
||||
{
|
||||
require_once( './initdata.php' );/*noLibHook*/
|
||||
}
|
||||
else
|
||||
{
|
||||
require_once( '../initdata.php' );/*noLibHook*/
|
||||
}
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsController.php' );/*noLibHook*/
|
||||
|
||||
$reg = ipsRegistry::instance();
|
||||
$reg->init();
|
||||
|
||||
/* Ensure it's CLI */
|
||||
$cli = php_sapi_name() === 'cli';
|
||||
|
||||
if ( ! $cli )
|
||||
{
|
||||
print "<html><head><title>Warning</title></head>\n";
|
||||
print "<body style='text-align:center'>\n";
|
||||
print "This script is meant to be run via command line<br />\n";
|
||||
print "More information:<br />\n";
|
||||
print "<a href=\"http://www.google.com/search?hl=en&q=php+cli+windows\" target=\"_blank\">http://www.google.com/search?hl=en&q=php+cli+windows</a><br />\n";
|
||||
print "This script will not run through a webserver.<br />\n";
|
||||
print "</body></html>\n";
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
print "\n ";
|
||||
print "\n (_) _ __ ____ ";
|
||||
print "\n | || '_ \ / ___' ";
|
||||
print "\n | || |_) | \__. ";
|
||||
print "\n | || .__/.\___ \ ";
|
||||
print "\n |_||_| |_______/ \n\n";
|
||||
|
||||
$moo = new moo( $reg );
|
||||
|
||||
class moo
|
||||
{
|
||||
function __construct( ipsRegistry $registry )
|
||||
{
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
$this->stdin = fopen('php://stdin', 'r');
|
||||
|
||||
/* Gallery Object */
|
||||
require_once( IPSLib::getAppDir('gallery') . '/sources/classes/gallery.php' );/*noLibHook*/
|
||||
$registry->setClass( 'gallery', new ipsGallery( $registry ) );
|
||||
|
||||
$this->albums = $this->registry->gallery->helper('albums');
|
||||
$this->images = $this->registry->gallery->helper('image');
|
||||
$this->moderate = $this->registry->gallery->helper('moderate');
|
||||
|
||||
/* Load up gallery boyo */
|
||||
$this->_print( "--------------------------------------------\nWelcome to the IP.Gallery Rebuild Tool\n--------------------------------------------\n" );
|
||||
$this->_print( "[0] Rebuild All Albums Node Data (Node level, left and right indexes)" );
|
||||
$this->_print( "[1] Rebuild Album Data (Cover image, comment counts, etc)" );
|
||||
$this->_print( "[2] Rebuild Album Permissions (Ensures inherited permissions are OK)" );
|
||||
$this->_print( "[3] Rebuild Image File Data (Thumbnail images, etc)" );
|
||||
$this->_print( "[4] Rebuild Image SEO Data" );
|
||||
|
||||
$this->_print( "Enter Choice: ", "" );
|
||||
|
||||
$option = $this->_fetchOption();
|
||||
|
||||
if ( stristr( $option, 'look' ) )
|
||||
{
|
||||
$this->_print("\nYou see a forest full of shadows. In the distance smoke rises from a small building. There is a troll here." );
|
||||
exit;
|
||||
}
|
||||
|
||||
switch( $option )
|
||||
{
|
||||
case 0:
|
||||
$this->_albumNodes();
|
||||
break;
|
||||
case 1:
|
||||
$this->_albumData();
|
||||
break;
|
||||
case 2:
|
||||
$this->_albumPermissions();
|
||||
break;
|
||||
case 3:
|
||||
$this->_images();
|
||||
break;
|
||||
case 4:
|
||||
$this->_seoImages();
|
||||
break;
|
||||
case 99:
|
||||
$this->_print("\n100!");
|
||||
break;
|
||||
default:
|
||||
$this->_print("\nThat wasn't a real option and I strongly believe you knew that");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuild All Nodes
|
||||
*/
|
||||
protected function _albumNodes()
|
||||
{
|
||||
$this->albums->rebuildNodeTree();
|
||||
|
||||
$this->_print("Node Tree rebuilt");
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuild All Permissions
|
||||
*/
|
||||
protected function _albumPermissions()
|
||||
{
|
||||
$this->moderate->resetPermissions(0);
|
||||
|
||||
$this->_print("Permissions rebuilt");
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuild All Album Data
|
||||
*/
|
||||
protected function _albumData()
|
||||
{
|
||||
$done = 0;
|
||||
$this->DB->build( array( 'select' => '*',
|
||||
'from' => 'gallery_albums_main',
|
||||
'where' => '1=1' ) );
|
||||
|
||||
$o = $this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch( $o ) )
|
||||
{
|
||||
$done++;
|
||||
$this->albums->resync( $row );
|
||||
}
|
||||
|
||||
$this->_print("Album Data rebuilt");
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuild Images
|
||||
*/
|
||||
protected function _images()
|
||||
{
|
||||
/* INIT */
|
||||
$start = time();
|
||||
$done = 0;
|
||||
|
||||
$this->DB->build( array( 'select' => '*',
|
||||
'from' => 'gallery_images',
|
||||
'order' => 'id ASC' ) );
|
||||
|
||||
$o = $this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch( $o ) )
|
||||
{
|
||||
$done++;
|
||||
|
||||
$this->images->resync( $row );
|
||||
$this->images->buildSizedCopies( $row );
|
||||
|
||||
if ( $done % 50 == 0 )
|
||||
{
|
||||
$this->_print( "Completed... " . $done . " (IMG ID=" . $row['id'] . " total=" . ( $done ) . ")" );
|
||||
}
|
||||
|
||||
/* Clear cached queries */
|
||||
$this->DB->obj['cached_queries'] = array();
|
||||
}
|
||||
|
||||
$end = time();
|
||||
$tkn = ( $end - $start) / 60;
|
||||
|
||||
$this->_print( "Finished Images. Took " . $tkn . "m\n" );
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuild Images
|
||||
*/
|
||||
protected function _seoImages()
|
||||
{
|
||||
/* INIT */
|
||||
$start = time();
|
||||
$done = 0;
|
||||
|
||||
$this->DB->build( array( 'select' => '*',
|
||||
'from' => 'gallery_images',
|
||||
'order' => 'id ASC' ) );
|
||||
|
||||
$o = $this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch( $o ) )
|
||||
{
|
||||
$done++;
|
||||
|
||||
$this->DB->update( 'gallery_images', array( 'caption_seo' => IPSText::makeSeoTitle( $row['caption'] ) ), 'id=' . $row['id'] );
|
||||
|
||||
if ( $done % 50 == 0 )
|
||||
{
|
||||
$this->_print( "Completed... " . $done . " (IMG ID=" . $row['id'] . " total=" . ( $done ) . ")" );
|
||||
}
|
||||
|
||||
/* Clear cached queries */
|
||||
$this->DB->obj['cached_queries'] = array();
|
||||
}
|
||||
|
||||
$end = time();
|
||||
$tkn = ( $end - $start) / 60;
|
||||
|
||||
$this->_print( "Finished Images. Took " . $tkn . "m\n" );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Out to stdout
|
||||
*/
|
||||
protected function _print( $message, $newline="\n" )
|
||||
{
|
||||
$stdout = fopen('php://stdout', 'w');
|
||||
fwrite( $stdout, $message . $newline );
|
||||
fclose( $stdout );
|
||||
}
|
||||
|
||||
/* Fetch option
|
||||
*
|
||||
*/
|
||||
protected function _fetchOption()
|
||||
{
|
||||
return trim( fgets( $this->stdin ) );
|
||||
}
|
||||
}
|
||||
|
||||
exit();
|
||||
@@ -0,0 +1,122 @@
|
||||
#!/usr/local/bin/php
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* Main public executable wrapper.
|
||||
* Set-up and load module to run
|
||||
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10721 $
|
||||
*
|
||||
*/
|
||||
|
||||
define( 'IPS_IS_SHELL', TRUE );
|
||||
define( 'IPB_THIS_SCRIPT', 'public' );
|
||||
|
||||
if ( is_file( './initdata.php' ) )
|
||||
{
|
||||
require_once( './initdata.php' );/*noLibHook*/
|
||||
}
|
||||
else
|
||||
{
|
||||
require_once( '../initdata.php' );/*noLibHook*/
|
||||
}
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsController.php' );/*noLibHook*/
|
||||
|
||||
$reg = ipsRegistry::instance();
|
||||
$reg->init();
|
||||
|
||||
$moo = new moo( $reg );
|
||||
|
||||
class moo
|
||||
{
|
||||
function __construct( ipsRegistry $registry )
|
||||
{
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
$this->stdin = fopen('php://stdin', 'r');
|
||||
|
||||
$this->_print( "--------------------------------------------\nWelcome to the IP.Gallery Images SEO Fixer\n--------------------------------------------\n" );
|
||||
$this->_print( "Start from row?\nEnter: " );
|
||||
|
||||
$start = intval( $this->_fetchOption() );
|
||||
|
||||
$this->_print( "Do X rows\nEnter: " );
|
||||
|
||||
$end = intval( $this->_fetchOption() );
|
||||
|
||||
$this->_doImages( $start, $end );
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuild Images
|
||||
*/
|
||||
protected function _doImages( $_start, $end )
|
||||
{
|
||||
/* INIT */
|
||||
$start = time();
|
||||
$done = 0;
|
||||
|
||||
$this->DB->build( array( 'select' => '*',
|
||||
'from' => 'gallery_images',
|
||||
'order' => 'id ASC',
|
||||
'limit' => array( $_start, $end ) ) );
|
||||
|
||||
$t = $this->DB->execute();
|
||||
|
||||
while( $row = $this->DB->fetch( $t ) )
|
||||
{
|
||||
$this->DB->update( 'gallery_images', array( 'caption_seo' => IPSText::makeSeoTitle( $row['caption'] ) ), 'id=' . $row['id'] );
|
||||
$done++;
|
||||
|
||||
if ( $done % 250 == 0 )
|
||||
{
|
||||
$this->_print( "Completed... " . $done . " (IMG ID=" . $row['file_id'] . " total=" . ( $_start + $done ) . ")" );
|
||||
}
|
||||
|
||||
/* Clear cached queries */
|
||||
$this->DB->obj['cached_queries'] = array();
|
||||
}
|
||||
|
||||
$end = time();
|
||||
$tkn = ( $end - $start) / 60;
|
||||
|
||||
$this->_print( "FINISHED Images. Took " . $tkn . "m\n" );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Out to stdout
|
||||
*/
|
||||
protected function _print( $message, $newline="\n" )
|
||||
{
|
||||
$stdout = fopen('php://stdout', 'w');
|
||||
fwrite( $stdout, $message . $newline );
|
||||
fclose( $stdout );
|
||||
}
|
||||
|
||||
/* Fetch option
|
||||
*
|
||||
*/
|
||||
protected function _fetchOption()
|
||||
{
|
||||
return trim( fgets( $this->stdin ) );
|
||||
}
|
||||
}
|
||||
|
||||
exit();
|
||||
@@ -0,0 +1,326 @@
|
||||
#!/usr/local/bin/php
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* Main public executable wrapper.
|
||||
* Set-up and load module to run
|
||||
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 10721 $
|
||||
*
|
||||
*/
|
||||
|
||||
define( 'IPS_IS_SHELL', TRUE );
|
||||
define( 'IPB_THIS_SCRIPT', 'public' );
|
||||
define( 'IPS_CLI_MEMORY_DEBUG', false );
|
||||
|
||||
if ( is_file( './initdata.php' ) )
|
||||
{
|
||||
require_once( './initdata.php' );/*noLibHook*/
|
||||
}
|
||||
else
|
||||
{
|
||||
require_once( '../initdata.php' );/*noLibHook*/
|
||||
}
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsController.php' );/*noLibHook*/
|
||||
|
||||
$reg = ipsRegistry::instance();
|
||||
$reg->init();
|
||||
|
||||
$moo = new moo( $reg );
|
||||
|
||||
class moo
|
||||
{
|
||||
protected $processed = 0;
|
||||
protected $start = 0;
|
||||
protected $end = 0;
|
||||
|
||||
function __construct( ipsRegistry $registry )
|
||||
{
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
$this->memberData = array();
|
||||
$this->stdin = fopen('php://stdin', 'r');
|
||||
|
||||
$this->_print( "--------------------------------------------\nWelcome to the IP.Board PM Re-Builder\n--------------------------------------------\n" );
|
||||
|
||||
$this->_print( "Start at row (Enter 0 to start from the very first entry)\nEnter: " );
|
||||
|
||||
$this->start = intval( $this->_fetchOption() );
|
||||
|
||||
$this->_print( "Process X rows (Enter 0 to process all rows)\nEnter: " );
|
||||
|
||||
$this->end = intval( $this->_fetchOption() );
|
||||
|
||||
if ( $this->start == 0 )
|
||||
{
|
||||
$this->_print( "No starting ID? Do you want to remove all current PMs to start again? (y/n): " );
|
||||
|
||||
$delete = $this->_fetchOption();
|
||||
|
||||
if ( $delete == 'y' )
|
||||
{
|
||||
/* Ditch current data */
|
||||
$this->DB->delete( 'message_posts' );
|
||||
$this->DB->delete( 'message_topics' );
|
||||
$this->DB->delete( 'message_topic_user_map' );
|
||||
}
|
||||
}
|
||||
|
||||
while( ( $result = $this->_process() ) !== FALSE )
|
||||
{
|
||||
$this->_print( $result );
|
||||
}
|
||||
|
||||
/* We're done.. */
|
||||
$this->_print( "COMPLETE" );
|
||||
}
|
||||
|
||||
/**
|
||||
* Actually process it
|
||||
*/
|
||||
protected function _process()
|
||||
{
|
||||
if ( ! $this->end OR ( $this->end > $this->processed ) )
|
||||
{
|
||||
/* More to do... */
|
||||
$batch = 250;
|
||||
$_s = $this->processed + $this->start;
|
||||
$_e = ( $this->end AND $this->end < $batch ) ? $this->end : $batch;
|
||||
$this->processed = $_s + $batch;
|
||||
$this->start = 0;
|
||||
$converted = 0;
|
||||
$seen = 0;
|
||||
|
||||
/* Select max topic ID thus far */
|
||||
$_tmp = $this->DB->buildAndFetch( array( 'select' => 'MAX(mt_id) as max',
|
||||
'from' => 'message_topics' ) );
|
||||
|
||||
$topicID = intval( $_tmp['max'] );
|
||||
|
||||
$this->DB->build( array( 'select' => '*',
|
||||
'from' => 'message_text',
|
||||
'order' => 'msg_id ASC',
|
||||
'limit' => array( $_s, $_e ) ) );
|
||||
|
||||
$o = $this->DB->execute();
|
||||
|
||||
while( $post = $this->DB->fetch( $o ) )
|
||||
{
|
||||
$seen++;
|
||||
|
||||
/* Make sure all data is valid */
|
||||
if ( intval( $post['msg_sent_to_count'] ) < 1 )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/* a little set up */
|
||||
$oldTopics = array();
|
||||
|
||||
/* Now fetch all topics */
|
||||
$this->DB->build( array( 'select' => '*',
|
||||
'from' => 'message_topics_old',
|
||||
'where' => 'mt_msg_id=' . intval( $post['msg_id'] ) ) );
|
||||
|
||||
$t = $this->DB->execute();
|
||||
|
||||
while( $topic = $this->DB->fetch( $t ) )
|
||||
{
|
||||
/* Got any data? */
|
||||
if ( ! $topic['mt_from_id'] OR ! $topic['mt_to_id'] )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$oldTopics[ $topic['mt_id'] ] = $topic; # Luke added that space. That's his first contribution to the code vaults at IPS.
|
||||
}
|
||||
|
||||
/* Attempt to free memory */
|
||||
$this->DB->freeResult( $t );
|
||||
|
||||
/* Fail safe */
|
||||
if ( ! count( $oldTopics ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Increment number */
|
||||
$topicID++;
|
||||
|
||||
/* Add in the post */
|
||||
$this->DB->insert( 'message_posts', array( 'msg_topic_id' => $topicID,
|
||||
'msg_date' => $post['msg_date'],
|
||||
'msg_post' => $post['msg_post'],
|
||||
'msg_post_key' => $post['msg_post_key'],
|
||||
'msg_author_id' => $post['msg_author_id'],
|
||||
'msg_ip_address' => $post['msg_ip_address'],
|
||||
'msg_is_first_post' => 1 ) );
|
||||
$postID = $this->DB->getInsertId();
|
||||
|
||||
/* Update attachments */
|
||||
$this->DB->update( 'attachments', array( 'attach_rel_id' => $postID ), "attach_rel_module='msg' AND attach_rel_id=".$post['msg_id'] );
|
||||
|
||||
/* Define some stuff. "To" member is added last in IPB 2 */
|
||||
$_tmp = $oldTopics;
|
||||
ksort( $_tmp );
|
||||
$topicData = array_pop( $_tmp );
|
||||
$_invited = array();
|
||||
$_seenOwner = array();
|
||||
$_isDeleted = 0;
|
||||
|
||||
/* Add the member rows */
|
||||
foreach( $oldTopics as $mt_id => $data )
|
||||
{
|
||||
/* Prevent SQL error with unique index: Seen the owner ID already? */
|
||||
if ( $_seenOwner[ $data['mt_owner_id'] ] )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$_seenOwner[ $data['mt_owner_id'] ] = $data['mt_owner_id'];
|
||||
|
||||
/* Build invited - does not include 'to' person */
|
||||
if ( $data['mt_owner_id'] AND ( $post['msg_author_id'] != $data['mt_owner_id'] ) AND ( $topicData['mt_to_id'] != $data['mt_owner_id'] ) )
|
||||
{
|
||||
$_invited[ $data['mt_owner_id'] ] = $data['mt_owner_id'];/*noLibHook*/
|
||||
}
|
||||
|
||||
$_isSent = ( $data['mt_vid_folder'] == 'sent' ) ? 1 : 0;
|
||||
$_isDraft = ( $data['mt_vid_folder'] == 'unsent' ) ? 1 : 0;
|
||||
|
||||
$this->DB->insert( 'message_topic_user_map', array( 'map_user_id' => $data['mt_owner_id'],
|
||||
'map_topic_id' => $topicID,
|
||||
'map_folder_id' => ( $_isDraft ) ? 'drafts' : 'myconvo',
|
||||
'map_read_time' => ( $data['mt_user_read'] ) ? $data['mt_user_read'] : ( $data['mt_read'] ? time() : 0 ),
|
||||
'map_user_active' => 1,
|
||||
'map_user_banned' => 0,
|
||||
'map_has_unread' => 0,//( $data['mt_read'] ) ? 0 : 1,
|
||||
'map_is_system' => 0,
|
||||
'map_last_topic_reply' => $post['msg_date'],
|
||||
'map_is_starter' => ( $data['mt_owner_id'] == $post['msg_author_id'] ) ? 1 : 0 ) );
|
||||
|
||||
}
|
||||
|
||||
/* Now, did we see the author? If not, add them too but as inactive */
|
||||
if ( ! $_seenOwner[ $post['msg_author_id'] ] )
|
||||
{
|
||||
$_isDeleted = 1;
|
||||
|
||||
/*$this->DB->insert( 'message_topic_user_map', array( 'map_user_id' => $post['msg_author_id'],
|
||||
'map_topic_id' => $topicID,
|
||||
'map_folder_id' => 'myconvo',
|
||||
'map_read_time' => 0,
|
||||
'map_user_active' => 0,
|
||||
'map_user_banned' => 0,
|
||||
'map_has_unread' => 0,
|
||||
'map_is_system' => 0,
|
||||
'map_is_starter' => 1 ) );*/
|
||||
}
|
||||
|
||||
$_isSent = ( $topicData['mt_vid_folder'] == 'sent' ) ? 1 : 0;
|
||||
$_isDraft = ( $topicData['mt_vid_folder'] == 'unsent' ) ? 1 : 0;
|
||||
|
||||
/* This is for MSSQL. I need a quick fix. This is it. Enjoy. */
|
||||
if ( method_exists( $this->DB, 'setTableIdentityInsert' ) )
|
||||
{
|
||||
$this->DB->setTableIdentityInsert( 'message_topics', 'ON' );
|
||||
}
|
||||
|
||||
/* Add the topic */
|
||||
$this->DB->insert( 'message_topics', array( 'mt_id' => $topicID,
|
||||
'mt_date' => $topicData['mt_date'],
|
||||
'mt_title' => $topicData['mt_title'],
|
||||
'mt_starter_id' => $post['msg_author_id'],
|
||||
'mt_start_time' => $post['msg_date'],
|
||||
'mt_last_post_time' => $post['msg_date'],
|
||||
'mt_invited_members' => serialize( array_keys( $_invited ) ),
|
||||
'mt_to_count' => count( array_keys( $_invited ) ) + 1,
|
||||
'mt_to_member_id' => $topicData['mt_to_id'],
|
||||
'mt_replies' => 0,
|
||||
'mt_last_msg_id' => $postID,
|
||||
'mt_first_msg_id' => $postID,
|
||||
'mt_is_draft' => $_isDraft,
|
||||
'mt_is_deleted' => $_isDeleted,
|
||||
'mt_is_system' => 0 ) );
|
||||
|
||||
/* This is for MSSQL. I need a quick fix. This is it. Enjoy. */
|
||||
if ( method_exists( $this->DB, 'setTableIdentityInsert' ) )
|
||||
{
|
||||
$this->DB->setTableIdentityInsert( 'message_topics', 'OFF' );
|
||||
}
|
||||
|
||||
$converted++;
|
||||
}
|
||||
}
|
||||
|
||||
/* Attempt to free memory */
|
||||
$this->DB->freeResult( $o );
|
||||
|
||||
/* Clear cached queries */
|
||||
$this->DB->obj['cached_queries'] = array();
|
||||
|
||||
/* Memory Debug */
|
||||
if ( IPS_CLI_MEMORY_DEBUG )
|
||||
{
|
||||
IPSDebug::setMemoryDebugFlag( "Done", 0 );
|
||||
|
||||
foreach( IPSDebug::$memory_debug as $i )
|
||||
{
|
||||
$this->_print( "Debug:... " . $i[0] . ' - ' . IPSLib::sizeFormat( $i[1] ) );
|
||||
}
|
||||
|
||||
/* Reset */
|
||||
IPSDebug::$memory_debug = array();
|
||||
}
|
||||
|
||||
if ( $seen )
|
||||
{
|
||||
/* Check for more.. */
|
||||
return "Checked {$seen}, Completed... " . $this->processed . "(last ID=[ " . $topicID . " ] )";
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Out to stdout
|
||||
*/
|
||||
protected function _print( $message, $newline="\n" )
|
||||
{
|
||||
$stdout = fopen('php://stdout', 'w');
|
||||
fwrite( $stdout, $message . $newline );
|
||||
fclose( $stdout );
|
||||
}
|
||||
|
||||
/* Fetch option
|
||||
*
|
||||
*/
|
||||
protected function _fetchOption()
|
||||
{
|
||||
return trim( fgets( $this->stdin ) );
|
||||
}
|
||||
}
|
||||
|
||||
exit();
|
||||
|
||||
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,615 @@
|
||||
#!/usr/local/bin/php
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* Main public executable wrapper.
|
||||
* Set-up and load module to run
|
||||
* Last Updated: $Date: 2013-02-05 06:22:45 -0500 (Tue, 05 Feb 2013) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: mmecham $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 11935 $
|
||||
*
|
||||
*/
|
||||
|
||||
define( 'IPS_IS_SHELL', TRUE );
|
||||
define( 'IPB_THIS_SCRIPT', 'public' );
|
||||
define( 'IPS_CLI_MEMORY_DEBUG', false );
|
||||
|
||||
if ( is_file( './initdata.php' ) )
|
||||
{
|
||||
require_once( './initdata.php' );/*noLibHook*/
|
||||
}
|
||||
else
|
||||
{
|
||||
require_once( '../initdata.php' );/*noLibHook*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );/*noLibHook*/
|
||||
require_once( IPS_ROOT_PATH . 'sources/base/ipsController.php' );/*noLibHook*/
|
||||
|
||||
$reg = ipsRegistry::instance();
|
||||
$reg->init();
|
||||
|
||||
$moo = new moo( $reg );
|
||||
|
||||
class moo
|
||||
{
|
||||
protected $processed = 0;
|
||||
protected $parser;
|
||||
protected $oldparser;
|
||||
protected $start = 0;
|
||||
protected $end = 0;
|
||||
|
||||
function __construct( ipsRegistry $registry )
|
||||
{
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
$this->memberData = array();
|
||||
$this->stdin = fopen('php://stdin', 'r');
|
||||
|
||||
//-----------------------------------------
|
||||
// Get new parser and old parser
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( IPS_ROOT_PATH . "sources/handlers/han_parse_bbcode.php" );/*noLibHook*/
|
||||
$this->parser = new parseBbcode( $this->registry );
|
||||
$this->oldparser = new parseBbcode( $this->registry, 'legacy' );
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/text/parser.php', 'classes_text_parser' );
|
||||
$this->newParser = new $classToLoad();
|
||||
|
||||
//-----------------------------------------
|
||||
// Show options
|
||||
//-----------------------------------------
|
||||
|
||||
$this->_print( "--------------------------------------------\nWelcome to the IP.Board Post Content Re-Builder\n--------------------------------------------\n" );
|
||||
$this->_print( "What do you wish to build?\n(c=Calendar Events, a=Announcements, x=Personal Conversations, s=Signatures, m=About me, p=posts, o=Remove Orphaned Posts)\nEnter: " );
|
||||
|
||||
$option = $this->_fetchOption();
|
||||
|
||||
switch( $option )
|
||||
{
|
||||
case 'c':
|
||||
$this->_doPosts('cal');
|
||||
break;
|
||||
case 'a':
|
||||
$this->_doPosts('announce');
|
||||
break;
|
||||
case 'x':
|
||||
$this->_doPosts('pms');
|
||||
break;
|
||||
case 's':
|
||||
$this->_doPosts('sigs');
|
||||
break;
|
||||
case 'm':
|
||||
$this->_doPosts('aboutme');
|
||||
break;
|
||||
case 'p':
|
||||
$this->_doPosts('posts');
|
||||
break;
|
||||
case 'o':
|
||||
$this->_doOrphanedPosts();
|
||||
break;
|
||||
default:
|
||||
$this->_doPosts('posts');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuild data
|
||||
*/
|
||||
protected function _doOrphanedPosts()
|
||||
{
|
||||
$batch = 250;
|
||||
$c = -1;
|
||||
$bucket = array();
|
||||
|
||||
/* Lets grab the highest and lowest IDs */
|
||||
$rows = $this->DB->buildAndFetch( array( 'select' => "count(pid) AS CNT, max(pid) AS MAX, min(pid) as MIN",
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 't.tid IS NULL',
|
||||
'add_join' => array( array( 'select' => 't.*',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 't.tid=p.topic_id' ) ) ) );
|
||||
|
||||
if ( empty( $rows['CNT'] ) )
|
||||
{
|
||||
$this->_print( "No orphaned posts have been found" );
|
||||
exit();
|
||||
}
|
||||
|
||||
$this->DB->build( array( 'select' => 'pid, from_unixtime(post_date) as time',
|
||||
'from' => 'posts',
|
||||
'where' => 'pid IN( ' . $rows['MIN'] . ',' . $rows['MAX'] . ')' ) );
|
||||
|
||||
$this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
$posts[ $r['pid'] ] = $r['time'];
|
||||
}
|
||||
|
||||
$this->_print( "--------------------------------------------\n" . $rows['CNT'] . " orphaned posts found\n--------------------------------------------\n" );
|
||||
$this->_print( "Oldest: PID:" . $rows['MIN'] . " - Date: " . $posts[ $rows['MIN'] ] );
|
||||
$this->_print( "Newest: PID:" . $rows['MAX'] . " - Date: " . $posts[ $rows['MAX'] ] );
|
||||
$this->_print( "Continue? (y/n):" );
|
||||
|
||||
$option = $this->_fetchOption();
|
||||
|
||||
if ( $option != 'y' )
|
||||
{
|
||||
$this->_print("Nothing deleted");
|
||||
exit();
|
||||
}
|
||||
|
||||
$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'forums' ) . '/sources/classes/moderate.php', 'moderatorLibrary', 'forums' );
|
||||
$this->modLibrary = new $classToLoad( $this->registry );
|
||||
|
||||
/* Still here? */
|
||||
$this->DB->build( array( 'select' => "pid",
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'where' => 't.tid IS NULL',
|
||||
'add_join' => array( array( 'select' => 't.*',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => 't.tid=p.topic_id' ) ) ) );
|
||||
|
||||
$o = $this->DB->execute();
|
||||
|
||||
while( $post = $this->DB->fetch( $o ) )
|
||||
{
|
||||
$c++;
|
||||
|
||||
$bucket[] = $post['pid'];
|
||||
|
||||
if ( $c % $batch )
|
||||
{
|
||||
$this->modLibrary->postDeleteFromDb( $bucket, true, true );
|
||||
$this->_print( $c . ' deleted' );
|
||||
|
||||
//$this->_print( var_export( $bucket, true ) );
|
||||
|
||||
$bucket = array();
|
||||
$c = 0;
|
||||
}
|
||||
}
|
||||
|
||||
$this->_print( "All done" );
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuild data
|
||||
*/
|
||||
protected function _doPosts( $type )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Set up
|
||||
//-----------------------------------------
|
||||
|
||||
$last = 0;
|
||||
$output = array();
|
||||
$types = array( 'posts', 'pms', 'cal', 'announce', 'sigs', 'aboutme' );
|
||||
$type = in_array( $type, $types ) ? $type : 'posts';
|
||||
$groupCache = $this->caches['group_cache'];
|
||||
|
||||
$this->_print( "Start at ID (Enter 0 to start from the very first entry)\nEnter: " );
|
||||
|
||||
$this->start = intval( $this->_fetchOption() );
|
||||
|
||||
$this->_print( "Process X rows (Enter 0 to process all rows)\nEnter: " );
|
||||
|
||||
$this->end = intval( $this->_fetchOption() );
|
||||
|
||||
//-----------------------------------------
|
||||
// Process batches...
|
||||
//-----------------------------------------
|
||||
|
||||
while( ( $result = $this->_process( $type ) ) !== FALSE )
|
||||
{
|
||||
$this->_print( $result );
|
||||
}
|
||||
|
||||
/* We're done.. */
|
||||
$this->_print( "COMPLETE" );
|
||||
|
||||
/* Update isRebuilt cache */
|
||||
$sections = array();
|
||||
$alreadyRebuilt = $this->DB->buildAndFetch( array( 'select' => 'cs_value', 'from' => 'cache_store', 'where' => "cs_key='isRebuilt'" ) );
|
||||
|
||||
if( $alreadyRebuilt['cs_value'] )
|
||||
{
|
||||
$sections = explode( ',', $alreadyRebuilt['cs_value'] );
|
||||
}
|
||||
|
||||
$sections[] = $type;
|
||||
|
||||
$this->DB->replace( 'cache_store', array( 'cs_key' => 'isRebuilt', 'cs_value' => implode( ',', $sections ) ), array( "cs_key" ) );
|
||||
|
||||
/* Drop cache */
|
||||
if ( $type == 'posts' )
|
||||
{
|
||||
$this->DB->delete( 'content_cache_posts' );
|
||||
}
|
||||
else if ( $type == 'sigs' )
|
||||
{
|
||||
$this->DB->delete( 'content_cache_sigs' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Actually process
|
||||
*
|
||||
*/
|
||||
protected function _process( $type )
|
||||
{
|
||||
if ( $this->end == 0 OR ( $this->end > $this->processed ) )
|
||||
{
|
||||
/* More to do... */
|
||||
$batch = 250;
|
||||
$_s = intval( $this->start );
|
||||
$done = 0;
|
||||
$this->processed += $batch;
|
||||
|
||||
/* On mssql, the select query blocks all the updates. Doing this causes the engine not to lock */
|
||||
if ( method_exists( $this->DB, 'setQueryRowLocking' ) )
|
||||
{
|
||||
$this->DB->setQueryRowLocking( 'OFF' );
|
||||
}
|
||||
|
||||
switch( $type )
|
||||
{
|
||||
case 'cal':
|
||||
$this->DB->build( array( 'select' => 'e.*',
|
||||
'from' => array( 'cal_events' => 'e' ),
|
||||
'order' => 'e.event_id ASC',
|
||||
'where' => 'e.event_id > ' . $_s,
|
||||
'limit' => array( $batch ),
|
||||
'add_join' => array( 1 => array( 'type' => 'left',
|
||||
'select' => 'm.member_group_id, m.mgroup_others',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => "m.member_id=e.event_member_id"
|
||||
) )
|
||||
) );
|
||||
break;
|
||||
|
||||
case 'announce':
|
||||
$this->DB->build( array( 'select' => 'a.*',
|
||||
'from' => array( 'announcements' => 'a' ),
|
||||
'order' => 'a.announce_id ASC',
|
||||
'where' => 'a.announce_id > ' . $_s,
|
||||
'limit' => array( $batch ),
|
||||
'add_join' => array( 1 => array( 'type' => 'left',
|
||||
'select' => 'm.member_group_id, m.mgroup_others',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => "m.member_id=a.announce_member_id"
|
||||
) )
|
||||
) );
|
||||
break;
|
||||
|
||||
case 'pms':
|
||||
$this->DB->build( array( 'select' => 'p.*',
|
||||
'from' => array( 'message_posts' => 'p' ),
|
||||
'order' => 'p.msg_id ASC',
|
||||
'where' => 'p.msg_id > ' . $_s,
|
||||
'limit' => array( $batch ),
|
||||
'add_join' => array( 1 => array( 'type' => 'left',
|
||||
'select' => 'm.member_group_id, m.mgroup_others',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => "m.member_id=p.msg_author_id"
|
||||
) )
|
||||
) );
|
||||
break;
|
||||
|
||||
case 'sigs':
|
||||
$this->DB->build( array( 'select' => 'me.signature, me.pp_member_id',
|
||||
'from' => array( 'profile_portal' => 'me' ),
|
||||
'order' => 'me.pp_member_id ASC',
|
||||
'where' => "me.signature IS NOT NULL AND me.signature != '' AND me.pp_member_id > " . $_s,
|
||||
'limit' => array( $batch ),
|
||||
'add_join' => array( 1 => array( 'type' => 'left',
|
||||
'select' => 'm.member_group_id, m.mgroup_others, m.members_display_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => "m.member_id=me.pp_member_id"
|
||||
) )
|
||||
) );
|
||||
break;
|
||||
|
||||
case 'aboutme':
|
||||
$this->DB->build( array( 'select' => 'pp.pp_about_me, pp.pp_member_id',
|
||||
'from' => array( 'profile_portal' => 'pp' ),
|
||||
'order' => 'pp.pp_member_id ASC',
|
||||
'where' => "pp.pp_about_me != '' AND pp.pp_about_me IS NOT NULL AND pp.pp_member_id > " . $_s,
|
||||
'limit' => array( $batch ),
|
||||
'add_join' => array( 1 => array( 'type' => 'left',
|
||||
'select' => 'm.member_group_id, m.mgroup_others, m.members_display_name',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => "m.member_id=pp.pp_member_id"
|
||||
) )
|
||||
) );
|
||||
break;
|
||||
|
||||
case 'posts':
|
||||
$this->DB->build( array( 'select' => 'p.*',
|
||||
'from' => array( 'posts' => 'p' ),
|
||||
'order' => 'p.pid ASC',
|
||||
'where' => 'p.pid > ' . $_s,
|
||||
'limit' => array( $batch ),
|
||||
'add_join' => array( 1 => array( 'type' => 'left',
|
||||
'select' => 't.forum_id',
|
||||
'from' => array( 'topics' => 't' ),
|
||||
'where' => "t.tid=p.topic_id"
|
||||
),
|
||||
2 => array( 'type' => 'left',
|
||||
'select' => 'm.member_group_id, m.mgroup_others',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => "m.member_id=p.author_id"
|
||||
),
|
||||
3 => array( 'type' => 'left',
|
||||
'select' => 'f.*',
|
||||
'from' => array( 'forums' => 'f' ),
|
||||
'where' => "t.forum_id=f.id"
|
||||
) ) ) );
|
||||
break;
|
||||
}
|
||||
|
||||
$outer = $this->DB->execute();
|
||||
|
||||
//-----------------------------------------
|
||||
// Process...
|
||||
//-----------------------------------------
|
||||
|
||||
while( $r = $this->DB->fetch( $outer ) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Reset
|
||||
//-----------------------------------------
|
||||
|
||||
$this->parser->quote_open = $this->oldparser->quote_open = 0;
|
||||
$this->parser->quote_closed = $this->oldparser->quote_closed = 0;
|
||||
$this->parser->quote_error = $this->oldparser->quote_error = 0;
|
||||
$this->parser->error = $this->oldparser->error = '';
|
||||
$this->parser->image_count = $this->oldparser->image_count = 0;
|
||||
$this->parser->parsing_mgroup = $this->oldparser->parsing_mgroup = $r['member_group_id'];
|
||||
$this->parser->parsing_mgroup_others = $this->oldparser->parsing_mgroup_others = $r['mgroup_others'];
|
||||
|
||||
/* Clear cached queries */
|
||||
$this->DB->obj['cached_queries'] = array();
|
||||
|
||||
$this->memberData['g_bypass_badwords'] = $this->caches['group_cache'][ $r['member_group_id'] ]['g_bypass_badwords'];
|
||||
|
||||
switch( $type )
|
||||
{
|
||||
case 'cal':
|
||||
$this->parser->parse_smilies = $this->oldparser->parse_smilies = $r['event_smilies'];
|
||||
$this->parser->parse_html = $this->oldparser->parse_html = 0;
|
||||
$this->parser->parse_bbcode = $this->oldparser->parse_bbcode = 1;
|
||||
$this->parser->parsing_section = 'calendar';
|
||||
|
||||
$rawpost = $this->oldparser->preEditParse( $r['event_content'] );
|
||||
break;
|
||||
|
||||
case 'announce':
|
||||
$this->parser->parse_smilies = $this->oldparser->parse_smilies = 1;
|
||||
$this->parser->parse_html = $this->oldparser->parse_html = $r['announce_html_enabled'];
|
||||
$this->parser->parse_bbcode = $this->oldparser->parse_bbcode = 1;
|
||||
$this->parser->parse_nl2br = $this->oldparser->parse_nl2br = $r['announce_nlbr_enabled'];
|
||||
$this->parser->parsing_section = 'announcement';
|
||||
|
||||
$rawpost = $this->oldparser->preEditParse( $r['announce_post'] );
|
||||
break;
|
||||
|
||||
case 'pms':
|
||||
$this->parser->parse_smilies = $this->oldparser->parse_smilies = 1;
|
||||
$this->parser->parse_html = $this->oldparser->parse_html = $this->caches['group_cache'][ $r['member_group_id'] ]['g_dohtml'];
|
||||
$this->parser->parse_bbcode = $this->oldparser->parse_bbcode = 1;
|
||||
$this->parser->parse_nl2br = $this->oldparser->parse_nl2br = 1;
|
||||
$this->parser->parsing_section = 'pms';
|
||||
|
||||
$rawpost = $this->oldparser->preEditParse( $r['msg_post'] );
|
||||
break;
|
||||
|
||||
case 'sigs':
|
||||
$this->parser->parse_smilies = $this->oldparser->parse_smilies = 0;
|
||||
$this->parser->parse_html = $this->oldparser->parse_html = $this->caches['group_cache'][ $r['member_group_id'] ]['g_dohtml'];
|
||||
$this->parser->parse_bbcode = $this->oldparser->parse_bbcode = 1;
|
||||
$this->parser->parse_nl2br = $this->oldparser->parse_nl2br = 1;
|
||||
$this->parser->parsing_section = 'signatures';
|
||||
|
||||
$rawpost = $this->oldparser->preEditParse( $r['signature'] );
|
||||
break;
|
||||
|
||||
case 'aboutme':
|
||||
$this->parser->parse_smilies = $this->oldparser->parse_smilies = 1;
|
||||
$this->parser->parse_html = $this->oldparser->parse_html = $this->caches['group_cache'][ $r['member_group_id'] ]['g_dohtml'];
|
||||
$this->parser->parse_bbcode = $this->oldparser->parse_bbcode = 1;
|
||||
$this->parser->parse_nl2br = $this->oldparser->parse_nl2br = 1;
|
||||
$this->parser->parsing_section = 'aboutme';
|
||||
|
||||
$rawpost = $this->oldparser->preEditParse( $r['pp_about_me'] );
|
||||
break;
|
||||
|
||||
case 'posts':
|
||||
$allowHtml = ( $r['post_htmlstate'] && $r['use_html'] && $this->caches['group_cache'][ $r['member_group_id'] ]['g_dohtml'] );
|
||||
|
||||
$this->newParser->set( array( 'parseArea' => 'topics',
|
||||
'memberData' => $r,
|
||||
'parseBBCode' => $r['use_ibc'],
|
||||
'parseHtml' => $allowHtml,
|
||||
'parseEmoticons' => $r['use_emo'] ) );
|
||||
|
||||
$rawpost = $this->newParser->BBCodeToHtml( $r['post'] );
|
||||
break;
|
||||
}
|
||||
|
||||
/* @link http://community.invisionpower.com/tracker/issue-36434-rebuild-post-content-remove-break-from-post-content/ New parser retains <br>, legacy retains \n */
|
||||
if ( $type == 'posts' || $type == 'sigs' )
|
||||
{
|
||||
/* Anything special here? */
|
||||
$newpost = $rawpost;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( strstr( $rawpost, "\n" ) )
|
||||
{
|
||||
$rawpost = nl2br( $rawpost );
|
||||
}
|
||||
|
||||
$newpost = $this->parser->preDbParse( $rawpost );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Remove old \' escaping
|
||||
//-----------------------------------------
|
||||
|
||||
$newpost = str_replace( "\\'", "'", $newpost );
|
||||
|
||||
//-----------------------------------------
|
||||
// Convert old dohtml?
|
||||
//-----------------------------------------
|
||||
|
||||
$htmlstate = 0;
|
||||
|
||||
if ( strstr( strtolower($newpost), '[dohtml]' ) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Can we use HTML?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $type == 'posts' AND $this->registry->class_forums->forum_by_id[ $r['forum_id'] ]['use_html'] )
|
||||
{
|
||||
$htmlstate = 2;
|
||||
}
|
||||
|
||||
$newpost = preg_replace( "#\[dohtml\]#i" , "", $newpost );
|
||||
$newpost = preg_replace( "#\[/dohtml\]#i", "", $newpost );
|
||||
}
|
||||
else
|
||||
{
|
||||
$htmlstate = intval( $r['post_htmlstate'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Convert old attachment tags
|
||||
//-----------------------------------------
|
||||
|
||||
$newpost = preg_replace( "#\[attachmentid=(\d+?)\]#is", "[attachment=\\1:attachment]", $newpost );
|
||||
|
||||
if ( $newpost OR $type == 'sigs' OR $type == 'aboutme' )
|
||||
{
|
||||
switch( $type )
|
||||
{
|
||||
case 'posts':
|
||||
$this->DB->update( 'posts', array( 'post' => $newpost, 'post_htmlstate' => $htmlstate ), 'pid='.$r['pid'] );
|
||||
$string = substr( $r['post'], 0, 30 ) . '...';
|
||||
$last = $r['pid'];
|
||||
break;
|
||||
|
||||
case 'pms':
|
||||
$this->DB->update( 'message_posts', array( 'msg_post' => $newpost ), 'msg_id='.$r['msg_id'] );
|
||||
$string = substr( $r['msg_post'], 0, 30 ) . '...';
|
||||
$last = $r['msg_id'];
|
||||
break;
|
||||
|
||||
case 'sigs':
|
||||
$this->DB->update( 'profile_portal', array( 'signature' => $newpost ), 'pp_member_id='.$r['pp_member_id'] );
|
||||
$string = substr( $r['members_display_name'], 0, 30 ) . '...';
|
||||
$last = $r['pp_member_id'];
|
||||
break;
|
||||
|
||||
case 'aboutme':
|
||||
$this->DB->update( 'profile_portal', array( 'pp_about_me' => $newpost ), 'pp_member_id='.$r['pp_member_id'] );
|
||||
$string = substr( $r['post'], 0, 30 ) . '...';
|
||||
$last = $r['pp_member_id'];
|
||||
break;
|
||||
|
||||
case 'cal':
|
||||
$this->DB->update( 'cal_events', array( 'event_content' => $newpost ), 'event_id='.$r['event_id'] );
|
||||
$string = substr( $r['event_content'], 0, 30 ) . '...';
|
||||
$last = $r['event_id'];
|
||||
break;
|
||||
|
||||
case 'announce':
|
||||
$this->DB->update( 'announcements', array( 'announce_post' => $newpost ), 'announce_id='.$r['announce_id'] );
|
||||
$string = substr( $r['announce_post'], 0, 30 ) . '...';
|
||||
$last = $r['announce_id'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
unset( $r );
|
||||
$done++;
|
||||
}
|
||||
|
||||
if ( method_exists( $this->DB, 'setQueryRowLocking' ) )
|
||||
{
|
||||
$this->DB->setQueryRowLocking( 'ON' );
|
||||
}
|
||||
}
|
||||
|
||||
/* Attempt to free memory */
|
||||
$this->DB->freeResult( $outer );
|
||||
|
||||
/* Memory Debug */
|
||||
if ( IPS_CLI_MEMORY_DEBUG )
|
||||
{
|
||||
IPSDebug::setMemoryDebugFlag( "Done", 0 );
|
||||
|
||||
foreach( IPSDebug::$memory_debug as $i )
|
||||
{
|
||||
$this->_print( "Debug:... " . $i[0] . ' - ' . IPSLib::sizeFormat( $i[1] ) );
|
||||
}
|
||||
|
||||
/* Reset */
|
||||
IPSDebug::$memory_debug = array();
|
||||
}
|
||||
|
||||
if ( $done )
|
||||
{
|
||||
$this->start = intval( $last );
|
||||
return "Completed... " . $this->processed . "(last ID[ " . $last . " ] " . str_replace( "\n", "", $string ) . ")";
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Out to stdout
|
||||
*/
|
||||
protected function _print( $message, $newline="\n" )
|
||||
{
|
||||
$stdout = fopen('php://stdout', 'w');
|
||||
fwrite( $stdout, $message . $newline );
|
||||
fclose( $stdout );
|
||||
}
|
||||
|
||||
/* Fetch option
|
||||
*
|
||||
*/
|
||||
protected function _fetchOption()
|
||||
{
|
||||
return trim( fgets( $this->stdin ) );
|
||||
}
|
||||
}
|
||||
|
||||
exit();
|
||||
|
||||
|
||||
|
||||
?>
|
||||
@@ -1,18 +0,0 @@
|
||||
-----------------------------------------------------
|
||||
IP.Board 2.3.0+ Rebuild Post Tool
|
||||
(c) Invision Power Services, Inc. 2007
|
||||
@author: Matt - June 2007
|
||||
-----------------------------------------------------
|
||||
OVERVIEW:
|
||||
This tool is run via command line to prevent the usual PHP timeout errors. It is also
|
||||
significantly quicker to run as it's capable of parsing up to 10,000 posts a minute.
|
||||
|
||||
USAGE:
|
||||
Simply upload the file 'rebuildposts.php' into your root IP.Board folder. This is the folder
|
||||
that contains your 'index.php' and 'init.php' files.
|
||||
|
||||
Log into your server via SSH, then Change Directory to your root IP.Board folder. Run the tool
|
||||
by typing: "php rebuildposts.php" (without the quotes).
|
||||
|
||||
Follow the onscreen prompts to select which type of post you wish to rebuild along with the
|
||||
starting ID you wish to use and how many posts you wish to rebuild.
|
||||