Version 1.3.0
This commit is contained in:
1 parent
7ef3d1712a
commit
f87d29ba65
290 files changed
+50206
-17930
No files matched your search
@@ -2,15 +2,17 @@
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Board v1.1
|
||||
| Invision Power Board v1.3 Final
|
||||
| ========================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001,2002 Invision Power Services
|
||||
| http://www.ibforums.com
|
||||
| (c) 2001 - 2003 Invision Power Services
|
||||
| http://www.invisionpower.com
|
||||
| ========================================
|
||||
| Web: http://www.ibforums.com
|
||||
| Email: phpboards@ibforums.com
|
||||
| Licence Info: phpib-licence@ibforums.com
|
||||
| Web: http://www.invisionboard.com
|
||||
| Time: Sun, 04 Jan 2004 00:30:16 GMT
|
||||
| Release: 28e7bfb25f08ac72a789cb1b172fa185
|
||||
| Email: matt@invisionpower.com
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > Skin -> Image Macro functions
|
||||
@@ -22,7 +24,11 @@
|
||||
*/
|
||||
|
||||
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
$idx = new ad_settings();
|
||||
@@ -33,7 +39,20 @@ class ad_settings {
|
||||
var $base_url;
|
||||
|
||||
function ad_settings() {
|
||||
global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;
|
||||
global $IN, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;
|
||||
|
||||
//---------------------------------------
|
||||
// Kill globals - globals bad, Homer good.
|
||||
//---------------------------------------
|
||||
|
||||
$tmp_in = array_merge( $_GET, $_POST, $_COOKIE );
|
||||
|
||||
foreach ( $tmp_in as $k => $v )
|
||||
{
|
||||
unset($$k);
|
||||
}
|
||||
|
||||
//---------------------------------------
|
||||
|
||||
switch($IN['code'])
|
||||
{
|
||||
@@ -95,7 +114,7 @@ class ad_settings {
|
||||
|
||||
function import()
|
||||
{
|
||||
global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_FILES;
|
||||
global $IN, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_FILES;
|
||||
|
||||
$FILE_NAME = $HTTP_POST_FILES['FILE_UPLOAD']['name'];
|
||||
$FILE_SIZE = $HTTP_POST_FILES['FILE_UPLOAD']['size'];
|
||||
@@ -160,7 +179,7 @@ class ad_settings {
|
||||
|
||||
if ( ! preg_match( "/~=~/", $data ) )
|
||||
{
|
||||
$ADMIN->error("This file does not appear to be a valid Invision Board macro file");
|
||||
$ADMIN->error("This file does not appear to be a valid Invision Power Board macro file");
|
||||
}
|
||||
|
||||
//-------------------------------------
|
||||
@@ -208,9 +227,11 @@ class ad_settings {
|
||||
$v = "";
|
||||
}
|
||||
|
||||
$row['macro_replace'] = str_replace( '\n', "\n", $v);
|
||||
|
||||
$str = $DB->compile_db_insert_string( array (
|
||||
'macro_value' => stripslashes($k),
|
||||
'macro_replace' => stripslashes($v),
|
||||
'macro_value' => $std->txt_stripslashes($k),
|
||||
'macro_replace' => $v,
|
||||
'macro_set' => $new_id,
|
||||
'can_remove' => 1,
|
||||
) );
|
||||
@@ -240,21 +261,21 @@ class ad_settings {
|
||||
|
||||
function edit_set_name()
|
||||
{
|
||||
global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS;
|
||||
global $IN, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS;
|
||||
|
||||
if ($IN['id'] == "")
|
||||
{
|
||||
$ADMIN->error("You must specify an existing macro set ID, go back and try again");
|
||||
}
|
||||
|
||||
$DB->query("SELECT * FROM ibf_macro WHERE macro_id='".$IN['id']."'");
|
||||
$DB->query("SELECT * FROM ibf_macro WHERE macro_set='".$IN['id']."'");
|
||||
|
||||
if ( ! $row = $DB->fetch_row() )
|
||||
{
|
||||
$ADMIN->error("Could not retrieve the record from the DB");
|
||||
}
|
||||
|
||||
$DB->query("UPDATE ibf_macro_name SET set_name='{$IN['macro_name']}' WHERE set_id='".$IN['id']."'");
|
||||
$DB->query("UPDATE ibf_macro_name SET set_name='{$IN['setname']}' WHERE set_id='".$IN['id']."'");
|
||||
|
||||
$ADMIN->done_screen("Macro Set Updated", "Manage Macro Set {$row['macro_name']}", "act=image&code=edit&id={$row['macro_set']}" );
|
||||
|
||||
@@ -266,7 +287,7 @@ class ad_settings {
|
||||
|
||||
function macro_remove()
|
||||
{
|
||||
global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS;
|
||||
global $IN, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS;
|
||||
|
||||
if ($IN['mid'] == "")
|
||||
{
|
||||
@@ -289,7 +310,7 @@ class ad_settings {
|
||||
|
||||
function macro_edit()
|
||||
{
|
||||
global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS;
|
||||
global $IN, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS;
|
||||
|
||||
if ($IN['mid'] == "")
|
||||
{
|
||||
@@ -303,8 +324,8 @@ class ad_settings {
|
||||
$ADMIN->error("Could not retrieve the record from the DB");
|
||||
}
|
||||
|
||||
$key = str_replace( "'", "\\'", stripslashes($HTTP_POST_VARS['macro_value']) );
|
||||
$val = str_replace( "'", "\\'", stripslashes($HTTP_POST_VARS['macro_replace']) );
|
||||
$key = str_replace( "'", "\\'", $std->txt_safeslashes($HTTP_POST_VARS['macro_value']) );
|
||||
$val = str_replace( "'", "\\'", $std->txt_UNhtmlspecialchars($std->txt_safeslashes($HTTP_POST_VARS['macro_replace']) ) );
|
||||
|
||||
$DB->query("UPDATE ibf_macro SET macro_value='$key', macro_replace='$val' WHERE macro_id='".$IN['mid']."'");
|
||||
|
||||
@@ -317,7 +338,7 @@ class ad_settings {
|
||||
|
||||
function macro_add()
|
||||
{
|
||||
global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS;
|
||||
global $IN, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS;
|
||||
|
||||
if ($IN['id'] == "")
|
||||
{
|
||||
@@ -332,8 +353,8 @@ class ad_settings {
|
||||
}
|
||||
|
||||
$str = $DB->compile_db_insert_string( array (
|
||||
'macro_value' => stripslashes($HTTP_POST_VARS['macro_value']),
|
||||
'macro_replace' => stripslashes($HTTP_POST_VARS['macro_replace']),
|
||||
'macro_value' => $std->txt_safeslashes($HTTP_POST_VARS['macro_value']),
|
||||
'macro_replace' => $std->txt_UNhtmlspecialchars($std->txt_safeslashes($HTTP_POST_VARS['macro_replace'])),
|
||||
'can_remove' => 1,
|
||||
'macro_set' => $row['macro_set']
|
||||
) );
|
||||
@@ -350,7 +371,7 @@ class ad_settings {
|
||||
|
||||
function macro_form($type='edit')
|
||||
{
|
||||
global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;
|
||||
global $IN, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;
|
||||
|
||||
|
||||
if ($type == 'edit')
|
||||
@@ -431,7 +452,7 @@ class ad_settings {
|
||||
|
||||
$ADMIN->html .= $SKIN->add_td_row( array(
|
||||
"Macro Replacement",
|
||||
$SKIN->form_textarea('macro_replace', $row['macro_replace']),
|
||||
$SKIN->form_textarea('macro_replace', $std->txt_htmlspecialchars($row['macro_replace']) ),
|
||||
) );
|
||||
|
||||
$ADMIN->html .= $SKIN->end_form($button);
|
||||
@@ -448,7 +469,7 @@ class ad_settings {
|
||||
|
||||
function export()
|
||||
{
|
||||
global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;
|
||||
global $IN, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;
|
||||
|
||||
if ($IN['id'] == "")
|
||||
{
|
||||
@@ -477,6 +498,11 @@ class ad_settings {
|
||||
{
|
||||
$row['macro_replace'] = "*UNASSIGNED*";
|
||||
}
|
||||
|
||||
// Fix newlines..
|
||||
|
||||
$row['macro_replace'] = str_replace( "\n", '\n', str_replace("\r", "\n", $row['macro_replace'] ) );
|
||||
|
||||
$contents .= $row['macro_value']."~=~".$row['macro_replace']."\n";
|
||||
}
|
||||
|
||||
@@ -496,7 +522,7 @@ class ad_settings {
|
||||
|
||||
function add_macro_set()
|
||||
{
|
||||
global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS;
|
||||
global $IN, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS;
|
||||
|
||||
if ($IN['id'] == "")
|
||||
{
|
||||
@@ -532,8 +558,8 @@ class ad_settings {
|
||||
while( $row = $DB->fetch_row($q1) )
|
||||
{
|
||||
$str = $DB->compile_db_insert_string( array (
|
||||
'macro_value' => stripslashes($row['macro_value']),
|
||||
'macro_replace' => stripslashes($row['macro_replace']),
|
||||
'macro_value' => $std->txt_stripslashes($row['macro_value']),
|
||||
'macro_replace' => $std->txt_stripslashes($row['macro_replace']),
|
||||
'macro_set' => $new_id,
|
||||
'can_remove' => 1,
|
||||
) );
|
||||
@@ -554,7 +580,7 @@ class ad_settings {
|
||||
|
||||
function remove()
|
||||
{
|
||||
global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS;
|
||||
global $IN, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS;
|
||||
|
||||
//+-------------------------------
|
||||
|
||||
@@ -580,7 +606,7 @@ class ad_settings {
|
||||
|
||||
function show_macros()
|
||||
{
|
||||
global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;
|
||||
global $IN, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;
|
||||
|
||||
//+-------------------------------
|
||||
|
||||
@@ -629,7 +655,7 @@ class ad_settings {
|
||||
|
||||
$ADMIN->html .= $SKIN->add_td_row( array(
|
||||
"Macro Set Title",
|
||||
$SKIN->form_input('macro_name', $row['set_name']),
|
||||
$SKIN->form_input('setname', $row['set_name']),
|
||||
) );
|
||||
|
||||
$ADMIN->html .= $SKIN->end_form("Edit Macro Title");
|
||||
@@ -667,7 +693,14 @@ class ad_settings {
|
||||
$real = substr( $real, 0, 52 ) . '...';
|
||||
}
|
||||
|
||||
$preview = str_replace( "<#IMG_DIR#>", $skin['img_dir'], $row['macro_replace'] );
|
||||
if ( $INFO['preview'] == 0 )
|
||||
{
|
||||
$preview = '<em>Disabled via ACP Prefs</em>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$preview = str_replace( "<#IMG_DIR#>", $skin['img_dir'], $row['macro_replace'] );
|
||||
}
|
||||
|
||||
$remove = "Cannot remove";
|
||||
|
||||
@@ -704,7 +737,7 @@ class ad_settings {
|
||||
|
||||
function list_current()
|
||||
{
|
||||
global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;
|
||||
global $IN, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;
|
||||
|
||||
$form_array = array();
|
||||
|
||||
@@ -741,7 +774,7 @@ class ad_settings {
|
||||
continue;
|
||||
}
|
||||
|
||||
$ADMIN->html .= $SKIN->add_td_row( array( "<b>".stripslashes($r['set_name'])."</b>",
|
||||
$ADMIN->html .= $SKIN->add_td_row( array( "<b>".$std->txt_stripslashes($r['set_name'])."</b>",
|
||||
"<#X-{$r['macro_set']}#>",
|
||||
"<center><a href='".$SKIN->base_url."&act=image&code=export&id={$r['macro_set']}'>Export</a></center>",
|
||||
"<center><a href='".$SKIN->base_url."&act=image&code=edit&id={$r['macro_set']}'>Edit</a></center>",
|
||||
@@ -784,7 +817,7 @@ class ad_settings {
|
||||
while ( $r = $DB->fetch_row() )
|
||||
{
|
||||
|
||||
$ADMIN->html .= $SKIN->add_td_row( array( "<b>".stripslashes($r['set_name'])."</b>",
|
||||
$ADMIN->html .= $SKIN->add_td_row( array( "<b>".$std->txt_stripslashes($r['set_name'])."</b>",
|
||||
"<center><a href='".$SKIN->base_url."&act=image&code=export&id={$r['set_id']}'>Export</a></center>",
|
||||
"<center><a href='".$SKIN->base_url."&act=image&code=edit&id={$r['set_id']}'>Edit</a></center>",
|
||||
"<center><a href='javascript:checkdelete(\"act=image&code=remove&id={$r['set_id']}\")'>Remove</a></center>",
|
||||
|
||||
Reference in new issue
Block a user