The Advanced Image Editor which appears in WYSIWYG mode by clicking the IMG icon allows users to upload IMGs from their computer and position them. However, this is not working on VaultWiki pages.
The problem was that vBulletin never announced the change and it is not documented anywhere that the feature even exists, but it appears the code was added in 4.0.3.
To fix articles, edit
vault/tab/edit.php. Find:
Code:
require_once(DIR . '/includes/functions_file.php');
$attachinfo = array(
'auth_type' => (empty($_SERVER['AUTH_USER']) AND empty($_SERVER['REMOTE_USER'])) ? 0 : 1,
'posthash' => $posthash,
'poststarttime' => $poststarttime,
'userid' => $vbulletin->userinfo['userid'],
'contenttypeid' => $contenttypeid,
'max_file_size' => fetch_max_upload_size(),
);
Replace with:
Code:
require_once(DIR . '/includes/functions_file.php');
$contenttypeid = vB_Types::instance()->getContentTypeId("VaultWiki_VaultArticle");
if (VAULT_403_COMPAT)
{
$attachinfo = fetch_attachmentinfo($posthash, $poststarttime, $contenttypeid);
}
else
{
$attachinfo = array(
'auth_type' => (empty($_SERVER['AUTH_USER']) AND empty($_SERVER['REMOTE_USER'])) ? 0 : 1,
'posthash' => $posthash,
'poststarttime' => $poststarttime,
'userid' => $vbulletin->userinfo['userid'],
'contenttypeid' => $contenttypeid,
'max_file_size' => fetch_max_upload_size(),
);
}
To fix comments, edit
vault/tab/discussion.php. Find:
Code:
require_once(DIR . '/includes/functions_file.php');
$attachinfo = array(
'auth_type' => (empty($_SERVER['AUTH_USER']) AND empty($_SERVER['REMOTE_USER'])) ? 0 : 1,
'posthash' => $posthash,
'poststarttime' => $poststarttime,
'userid' => $vbulletin->userinfo['userid'],
'contenttypeid' => $contenttypeid,
'max_file_size' => fetch_max_upload_size()
'values' => array(
't' => $threadinfo['threadid']
)
);
Replace with:
Code:
require_once(DIR . '/includes/functions_file.php');
if (VAULT_403_COMPAT)
{
$attachinfo = fetch_attachmentinfo($posthash, $poststarttime, $contenttypeid);
}
else
{
$attachinfo = array(
'auth_type' => (empty($_SERVER['AUTH_USER']) AND empty($_SERVER['REMOTE_USER'])) ? 0 : 1,
'posthash' => $posthash,
'poststarttime' => $poststarttime,
'userid' => $vbulletin->userinfo['userid'],
'contenttypeid' => $contenttypeid,
'max_file_size' => fetch_max_upload_size()
);
}
$attachinfo['values'] = array(
't' => $threadinfo['threadid']
);