11unset( $xoopsOption[
'nocommon'] );
13include(
'../mainfile.php' );
15echo
'<h2>wizard/install_UpdateSmilies_go.inc</h2>';
17$result = $xoopsDB->query(
'SELECT * FROM ' . $xoopsDB->prefix(
'smiles' ) );
19$title = _INSTALL_L155;
21if ( ! defined(
'XOOPS_UPLOAD_PATH' ) ) {
22 define(
'XOOPS_UPLOAD_PATH',
'../uploads' );
25while ( $smiley = $xoopsDB->fetchArray( $result ) ) {
26 if ( file_exists(
'../images/smilies/' . $smiley[
'smile_url'] ) && (
false !== $fp = fopen(
'../images/smilies/' . $smiley[
'smile_url'],
'rb' ) ) ) {
27 $binary = fread( $fp, filesize(
'../images/smilies/' . $smiley[
'smile_url'] ) );
29 if ( ! preg_match(
"/\.([a-zA-Z0-9]+)$/", $smiley[
'smile_url'], $matched ) ) {
32 $newsmiley = uniqid(
'smil',
true ) .
'.' . strtolower( $matched[1] );
33 if (
false !== $fp = fopen( XOOPS_UPLOAD_PATH .
'/' . $newsmiley,
'wb' ) ) {
34 if ( - 1 !== fwrite( $fp, $binary ) ) {
35 $xoopsDB->query(
'UPDATE ' . $xoopsDB->prefix(
'smiles' ) .
" SET smile_url='" . $newsmiley .
"' WHERE id=" . $smiley[
'id'] );
36 $content .= _OKIMG . sprintf( _INSTALL_L154, $smiley[
'smile_url'] ) .
'<br>';
38 $content .= _NGIMG . sprintf( _INSTALL_L153, $smiley[
'smile_url'] ) .
'<br>';
43 $content .= _OKIMG . sprintf( _INSTALL_L152, $smiley[
'smile_url'] ) .
'<br>';
47$result = $xoopsDB->query(
'SELECT * FROM ' . $xoopsDB->prefix(
'ranks' ) );
49while ( $rank = $xoopsDB->fetchArray( $result ) ) {
50 if ( file_exists(
'../images/ranks/' . $rank[
'rank_image'] ) &&
false !== $fp = fopen(
'../images/ranks/' . $rank[
'rank_image'],
'rb' ) ) {
51 $binary = fread( $fp, filesize(
'../images/ranks/' . $rank[
'rank_image'] ) );
53 if ( ! preg_match(
"/\.([a-zA-Z0-9]+)$/", $rank[
'rank_image'], $matched ) ) {
56 $newrank = uniqid(
'rank',
true ) .
'.' . strtolower( $matched[1] );
57 if (
false !== $fp = fopen( XOOPS_UPLOAD_PATH .
'/' . $newrank,
'wb' ) ) {
58 if ( - 1 !== fwrite( $fp, $binary ) ) {
59 $content .= _OKIMG . sprintf( _INSTALL_L154, $rank[
'rank_image'] ) .
'<br>';
60 $xoopsDB->query(
'UPDATE ' . $xoopsDB->prefix(
'ranks' ) .
" SET rank_image='" . $newrank .
"' WHERE rank_id=" . $rank[
'rank_id'] );
62 $content .= _NGIMG . sprintf( _INSTALL_L153, $rank[
'rank_image'] ) .
'<br>';
67 $content .= _OKIMG . sprintf( _INSTALL_L152, $rank[
'rank_image'] ) .
'<br>';
71$b_next = [
'updateAvatars', _INSTALL_L14 ];
73include
'./install_tpl.php';