SMFPT - Suporte e Manutenção de Fórum em Português

Actualizar SMFPT ( upgrade/Update ) Automatico e Manual => SMF 2.0 => Tópico iniciado por: candidosa2 em 18 de Julho de 2015, 11:38

Título: SMF 2.0.9 para SMF 2.0.10
Enviado por: candidosa2 em 18 de Julho de 2015, 11:38
./index.php

Find:

Código: [Seleccione]
* @version 2.0.9
Replace With:

Código: [Seleccione]
* @version 2.0.10

Find:

Código: [Seleccione]
$forum_version = 'SMF 2.0.9';
Replace With:

Código: [Seleccione]
$forum_version = 'SMF 2.0.10';

./Themes/default/languages/index.english.php

Find:
Código: [Seleccione]
// Version: 2.0.8;
Replace With:
Código: [Seleccione]
// Version: 2.0.10;

Find:
Código: [Seleccione]
2014
Replace With:
Código: [Seleccione]
2015
./Themes/default/scripts/script.js

Find:
Código: [Seleccione]
var is_ff = (ua.indexOf('firefox') != -1 || ua.indexOf('iceweasel') != -1 || ua.indexOf('icecat') != -1 || ua.indexOf('shiretoko') != -1 || ua.indexOf('minefield') != -1) && !is_opera;
Replace With:
Código: [Seleccione]
var is_ff = (ua.indexOf('firefox') != -1 || ua.indexOf('iceweasel') != -1 || ua.indexOf('icecat') != -1 || ua.indexOf('shiretoko') != -1 || ua.indexOf('minefield') != -1 || ua.indexOf('PaleMoon') != -1) && !is_opera;

Find:
Código: [Seleccione]
if ('oThemeOptions' in this.opt && this.opt.oThemeOptions.bUseThemeSettings)
Replace With:
Código: [Seleccione]
if (!bInit && 'oThemeOptions' in this.opt && this.opt.oThemeOptions.bUseThemeSettings)
./Themes/default/Search.template.php

Find:
Código: [Seleccione]
* @version 2.0
Replace With:

Código: [Seleccione]
* @version 2.0.10
Esta operação não é essencial para a instalação da presente mod.


Find:

                        
Código: [Seleccione]
<li class="board" style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;">
<label for="brd', $board['id'], '"><input type="checkbox" id="brd', $board['id'], '" name="brd[', $board['id'], ']" value="', $board['id'], '"', $board['selected'] ? ' checked="checked"' : '', ' class="input_check" /> ', $board['name'], '</label>
</li>';

Replace With:

                        
Código: [Seleccione]
<li class="board">
<label for="brd', $board['id'], '" style="margin-', $context['right_to_left'] ? 'right' : 'left', ': ', $board['child_level'], 'em;"><input type="checkbox" id="brd', $board['id'], '" name="brd[', $board['id'], ']" value="', $board['id'], '"', $board['selected'] ? ' checked="checked"' : '', ' class="input_check" /> ', $board['name'], '</label>
</li>';

./Sources/ManageServer.php

Find:

Código: [Seleccione]
* @version 2.0.9
Replace With:

Código: [Seleccione]
* @version 2.0.10

Find:

               
Código: [Seleccione]
$context['config_vars'][$config_var[1]]['value'] = unserialize($context['config_vars'][$config_var[1]]['value']);
$context['config_vars'][$config_var[1]]['value'] = !empty($context['config_vars'][$config_var[1]]['value']) ? unserialize($context['config_vars'][$config_var[1]]['value']) : array();

Replace With:

               $context['config_vars'][$config_var[1]]['value'] = !empty($context['config_vars'][$config_var[1]]['value']) ? unserialize($context['config_vars'][$config_var[1]]['value']) : array();

Esta operação não é essencial para a instalação da presente mod.

./Sources/Subs-Post.php

Find:

Código: [Seleccione]
* @version 2.0.9
Replace With:

Código: [Seleccione]
* @version 2.0.10
Esta operação não é essencial para a instalação da presente mod.


Find:

                  
Código: [Seleccione]
$htmlfunc = create_function('$m', 'return \'[html]\' . strtr(un_htmlspecialchars("$m[1]"), array("\n" => \' \', \' \' => \' \', \'[\' => \'[\', \']\' => \']\')) . \'[/html]\';');
Replace With:

                  $
Código: [Seleccione]
htmlfunc = create_function('$m', 'return \'[html]\' . strtr(un_htmlspecialchars("$m[1]"), array("\n" => \' \', \'  \' => \' \', \'[\' => \'[\', \']\' => \']\')) . \'[/html]\';');
Esta operação não é essencial para a instalação da presente mod.

./Sources/ManageAttachments.php

Find:

Código: [Seleccione]
* @version 2.0
Replace With:

Código: [Seleccione]
* @version 2.0.10
Esta operação não é essencial para a instalação da presente mod.


Find:
Código: [Seleccione]
$date .= sprintf(\'<br />%1$s <a href="%2$s?topic=%3$d.0.msg%4$d#msg%4$d">%5$s</a>\', $txt[\'in\'], $scripturl, $rowData[\'id_topic\'], $rowData[\'id_msg\'], $rowData[\'subject\']);
Replace With:

Código: [Seleccione]
$date .= sprintf(\'<br />%1$s <a href="%2$s?topic=%3$d.msg%4$d#msg%4$d">%5$s</a>\', $txt[\'in\'], $scripturl, $rowData[\'id_topic\'], $rowData[\'id_msg\'], $rowData[\'subject\']);
./Sources/Subs-Package.php

Find:

Código: [Seleccione]
* @version 2.0.9
Replace With:

Código: [Seleccione]
* @version 2.0.10
Esta operação não é essencial para a instalação da presente mod.


Find:

      
Código: [Seleccione]
// Windows doesn't seem to care about the memory_limit.
if (!empty($modSettings['package_disable_cache']) || ini_set('memory_limit', '128M') !== false || strpos(strtolower(PHP_OS), 'win') !== false)
Replace With: [Select]

      
Código: [Seleccione]
// Windows doesn't seem to care about the memory_limit.
if (!empty($modSettings['package_disable_cache']) || @ini_set('memory_limit', '128M') !== false || strpos(strtolower(PHP_OS), 'win') !== false)


Find: [Select]

      
Código: [Seleccione]
// Try to increase the memory limit - we don't want to run out of ram!
if (!empty($modSettings['package_disable_cache']) || ini_set('memory_limit', '128M') !== false || strpos(strtolower(PHP_OS), 'win') !== false)

Replace With:

      
Código: [Seleccione]
// Try to increase the memory limit - we don't want to run out of ram!
if (!empty($modSettings['package_disable_cache']) || @ini_set('memory_limit', '128M') !== false || strpos(strtolower(PHP_OS), 'win') !== false)


Find:

      
Código: [Seleccione]
if ($current['type'] == 5 && substr($current['filename'], -1) != '/')
$current['filename'] .= '/';

foreach ($current as $k => $v)
{
if (in_array($k, $octdec))
$current[$k] = octdec(trim($v));
else
$current[$k] = trim($v);
}

Replace With:

      
Código: [Seleccione]
foreach ($current as $k => $v)
{
if (in_array($k, $octdec))
$current[$k] = octdec(trim($v));
else
$current[$k] = trim($v);
}

if ($current['type'] == 5 && substr($current['filename'], -1) != '/')
$current['filename'] .= '/';

./Sources/Post.php

Find:

Código: [Seleccione]
* @version 2.0.9
Replace With:

 
Código: [Seleccione]
* @version 2.0.10
Esta operação não é essencial para a instalação da presente mod.


Find:

   
Código: [Seleccione]
if (isset($_REQUEST['preview']))
{
checkSession();
return Post();
}

Replace With:

   
Código: [Seleccione]
if (isset($_REQUEST['preview']))
{
if (checkSession('post', '', false) != '')
{
loadLanguage('Errors');
$context['post_errors']['message'][] = $txt['error_session_timeout'];
unset ($_POST['preview'], $_REQUEST['xml']); // just in case
}
return Post();
}

Esta operação não é essencial para a instalação da presente mod.

./Themes/default/scripts/fader.js

Find:

   
Código: [Seleccione]
// Try to find the fore- and background colors.
if ('currentStyle' in this.oFaderHandle)

Replace With:

   
Código: [Seleccione]
// Try to find the fore- and background colors.
var modern_browser = 'MozOpacity' in this.oFaderHandle.style || 'Opacity' in this.oFaderHandle.style || 'filter' in this.oFaderHandle.style;
if ('currentStyle' in this.oFaderHandle && !modern_browser)


Find:

   
Código: [Seleccione]
else if (!('opera' in window) && 'defaultView' in document)
Replace With: [Select]

else if (!('opera' in window) && 'defaultView' in document && !modern_browser)

./Themes/default/Post.template.php

Find:

Código: [Seleccione]
* @version 2.0
Replace With:

Código: [Seleccione]
* @version 2.0.10
Esta operação não é essencial para a instalação da presente mod.


Find:
Código: [Seleccione]
\'question\', \'topic\'
Replace With: [Select]
\'question\', \'topic\', ', JavaScriptEscape($context['session_var']), '

./Sources/Subscriptions-PayPal.php

Find:

Código: [Seleccione]
* @version 2.0.3
Replace With: [Select]

Código: [Seleccione]
* @version 2.0.10
Esta operação não é essencial para a instalação da presente mod.


Find:

      
Código: [Seleccione]
$setting_data = array(
array('text', 'paypal_email', 'subtext' => $txt['paypal_email_desc']),
);

Replace With:

      
Código: [Seleccione]
/// We add email and additional emails (the latter for recurring payments)
$setting_data = array(
array('text', 'paypal_email', 'subtext' => $txt['paypal_email_desc']),
array('text', 'paypal_additional_emails', 'subtext' =>  $txt['paypal_additional_emails_desc']),
);


Find:

      
Código: [Seleccione]
if (strtolower($_POST['mc_currency']) != $modSettings['paid_currency_code'])
Replace With:

      i
Código: [Seleccione]
f (strtolower($_POST['mc_currency']) != strtolower($modSettings['paid_currency_code']))

Find:
      
Código: [Seleccione]
if ($modSettings['paypal_email'] != $_POST['business'] && (empty($modSettings['paypal_additional_emails']) || !in_array($_POST['business'], explode(',', $modSettings['paypal_additional_emails']))))
return false;

Replace With:

      
Código: [Seleccione]
if (strtolower($modSettings['paypal_email']) != strtolower($_POST['business']) && (empty($modSettings['paypal_additional_emails']) || !in_array(strtolower($_POST['business']), explode(',', strtolower($modSettings['paypal_additional_emails'])))))
return false;


Find:

      
Código: [Seleccione]
// Check that this is intended for us.
if ($modSettings['paypal_email'] != $_POST['business'] && (empty($modSettings['paypal_additional_emails']) || !in_array($_POST['business'], explode(',', $modSettings['paypal_additional_emails']))))

Replace With:

      
Código: [Seleccione]
// Check that this is intended for us.
if (strtolower($modSettings['paypal_email']) != strtolower($_POST['business']) && (empty($modSettings['paypal_additional_emails']) || !in_array(strtolower($_POST['business']), explode(',', strtolower($modSettings['paypal_additional_emails'])))))

./Themes/default/languages/ManagePaid.english.php

Find:

Código: [Seleccione]
// Version: 2.0; ManagePaid
Replace With:

Código: [Seleccione]
// Version: 2.0.10; ManagePaid
This operation isn't vital to the installation of this mod.


Find:

Código: [Seleccione]
$txt['paid_note'] = '<strong class="alert">Note:</strong><br />For subscriptions to be automatically updated for your users, you
will need to setup a return URL for each of your payment methods. For all payment types, this return URL should be set as:<br /><br />
&nbsp;&nbsp;&bull;&nbsp;&nbsp;<strong>' . $boardurl . '/subscriptions.php</strong><br /><br />
You can edit the link for paypal directly, by clicking <a href="https://www.paypal.com/us/cgi-bin/webscr?cmd=_profile-ipn-notify" target="_blank">here</a>.<br />
For the other gateways (If installed) you can normally find it in your customer panels, usually under the term &quot;Return URL&quot; or &quot;Callback URL&quot;.';

Replace With:
Código: [Seleccione]
$txt['paid_note'] = '<strong class="alert">Note:</strong><br />
SMF currently supports <strong>PayPal</strong> as the installed payment method.<br />
&nbsp;&nbsp;&bull;&nbsp;&nbsp;It is not necessary to enable IPN in your PayPal account; if you do, the forum will receive payment notifications for all payments made to your account, and this will generate Paid Subscriptions errors for payments that are not subscription related.<br />
&nbsp;&nbsp;&bull;&nbsp;&nbsp;You must have a business or premier account to use recurring payments.<br />
&nbsp;&nbsp;&bull;&nbsp;&nbsp;You must provide your primary PayPal email address for validation purposes.<br /><br />

If you install a different payment gateway, you may need to set up a return URL for payment notification.   For all payment types, this return URL should be set as:<br /><br />
&nbsp;&nbsp;&bull;&nbsp;&nbsp;<strong>' . $boardurl . '/subscriptions.php</strong><br /><br />
You can normally find it in your customer panels, usually under the term &quot;Return URL&quot; or &quot;Callback URL&quot;.<br /><br /><br />';



Find:

Código: [Seleccione]
// View subscription strings.
Replace With:

Código: [Seleccione]
$txt['paypal_additional_emails'] = 'Primary PayPal email address';
$txt['paypal_additional_emails_desc'] = 'If different (for business account)';

// View subscription strings.

./Themes/default/languages/ManagePaid.english-utf8.php

Find:

Código: [Seleccione]
// Version: 2.0; ManagePaid
Replace With: [Select]

Código: [Seleccione]
// Version: 2.0.10; ManagePaid
Esta operação não é essencial para a instalação da presente mod.


Find:

Código: [Seleccione]
// View subscription strings.
Replace With:

Código: [Seleccione]
$txt['paypal_additional_emails'] = 'Primary PayPal email address';
$txt['paypal_additional_emails_desc'] = 'If different (for business account)';

// View subscription strings.

Esta operação não é essencial para a instalação da presente mod.

./Sources/Packages.php


Find:

Código: [Seleccione]
* @version 2.0.9
Replace With:

Código: [Seleccione]
* @version 2.0.10
Find:

Código: [Seleccione]
$context['redirect_text'] = !empty($action['filename']) && file_exists($boarddir . '/Packages/temp/' . $context['base_path'] . $action['filename']) ? file_get_contents($boarddir . '/Packages/temp/' . $context['base_path'] . $action['filename']) : ($context['uninstalling'] ? $txt['package_uninstall_done'] : $txt['package_installed_done']);
Replace With: [Select]
$context['redirect_text'] = !empty($action['filename']) && file_exists($boarddir . '/Packages/temp/' . $context['base_path'] . $action['filename']) ? $smcFunc['htmlspecialchars'](file_get_contents($boarddir . '/Packages/temp/' . $context['base_path'] . $action['filename'])) : ($context['uninstalling'] ? $txt['package_uninstall_done'] : $txt['package_installed_done']);

./SSI.php


Find:

Código: [Seleccione]
* @version 2.0.7
Replace With:

Código: [Seleccione]
* @version 2.0.10

Find:

   
Código: [Seleccione]
// Check if they can vote.
Replace With:

   
Código: [Seleccione]
// Check if they can vote.
$already_voted = false;

Find:

   
Código: [Seleccione]
elseif ($user_info['is_guest'] && $row['guest_vote'] && (!isset($_COOKIE['guest_poll_vote']) || !in_array($row['id_poll'], explode(',', $_COOKIE['guest_poll_vote']))))
$allow_vote = true;
elseif ($user_info['is_guest'])
$allow_vote = false;

Replace With:

   
Código: [Seleccione]
elseif ($user_info['is_guest'])
{
// There's a difference between "allowed to vote" and "already voted"...
$allow_vote = $row['guest_vote'];

// Did you already vote?
if (isset($_COOKIE['guest_poll_vote']) && in_array($row['id_poll'], explode(',', $_COOKIE['guest_poll_vote'])))
{
$already_voted = true;
}
}


Find:

      
Código: [Seleccione]
$allow_vote = $smcFunc['db_num_rows']($request) == 0;
Replace With:

      
Código: [Seleccione]
$allow_vote = $smcFunc['db_num_rows']($request) == 0;
$already_voted = $allow_vote;


Find:

   
Código: [Seleccione]
$allow_view_results = allowedTo('moderate_board') || $row['hide_results'] == 0 || ($row['hide_results'] == 1 && !$allow_vote) || $is_expired;
Replace With:

   
Código: [Seleccione]
$allow_view_results = allowedTo('moderate_board') || $row['hide_results'] == 0 || ($row['hide_results'] == 1 && $already_voted) || $is_expired;

Find:

   
Código: [Seleccione]
elseif ($return['allow_view_results'])
Replace With:

   
Código: [Seleccione]
else

Find:

      
Código: [Seleccione]
foreach ($return['options'] as $option)
echo '
<dt>', $option['option'], '</dt>
<dd>

Replace With:

      
Código: [Seleccione]
foreach ($return['options'] as $option)
{
echo '
<dt>', $option['option'], '</dt>
<dd>';

if ($return['allow_view_results'])
{
echo '

Find:

                  
Código: [Seleccione]
', $option['votes'], ' (', $option['percent'], '%)
</dd>';
echo '
</dl>
<strong>', $txt['poll_total_voters'], ': ', $return['total_votes'], '</strong>

Replace With:

                  
Código: [Seleccione]
', $option['votes'], ' (', $option['percent'], '%)';
}

echo '
</dd>';
}

echo '
</dl>', ($return['allow_view_results'] ? '
<strong>'. $txt['poll_total_voters'] .': '. $return['total_votes'] .'</strong>' : ''), '


Find:

   
Código: [Seleccione]
}
// Cannot see it I'm afraid!
else
echo $txt['poll_cannot_see'];
Replace With: [Select]

}

./Sources/Load.php

Find:

Código: [Seleccione]
* @version 2.0.9
Replace With:

Código: [Seleccione]
* @version 2.0.10

Find:

Código: [Seleccione]
return ' . strtr($ent_check[0], array('&' => '&amp;')) . 'htmlspecialchars($string, $quote_style, ' . ($utf8 ? '\'UTF-8\'' : '$charset') . ')' . $ent_check[1] . ';'),
Replace With:

Código: [Seleccione]
return ' . ($utf8 ? '$smcFunc[\'fix_utf8mb4\'](' : '') . strtr($ent_check[0], array('&' => '&amp;')) . 'htmlspecialchars($string, $quote_style, ' . ($utf8 ? '\'UTF-8\'' : '$charset') . ')' . $ent_check[1] . ($utf8 ? ')' : '') . ';'),
'fix_utf8mb4' => create_function('$string', '
$i = 0;
$len = strlen($string);
$new_string = \'\';
while ($i < $len)
{
$ord = ord($string[$i]);
if ($ord < 128)
{
$new_string .= $string[$i];
$i++;
}
elseif ($ord < 224)
{
$new_string .= $string[$i] . $string[$i+1];
$i += 2;
}
elseif ($ord < 240)
{
$new_string .= $string[$i] . $string[$i+1] . $string[$i+2];
$i += 3;
}
elseif ($ord < 248)
{
// Magic happens.
$val = (ord($string[$i]) & 0x07) << 18;
$val += (ord($string[$i+1]) & 0x3F) << 12;
$val += (ord($string[$i+2]) & 0x3F) << 6;
$val += (ord($string[$i+3]) & 0x3F);
$new_string .= \'&#\' . $val . \';\';
$i += 4;
}
}
return $new_string;'),

./Sources/ManageNews.php

Find:

Código: [Seleccione]
* @version 2.0.5
Replace With:
Código: [Seleccione]
* @version 2.0.10

Find:

         
Código: [Seleccione]
AND (COALESCE(bg.expire_time, 1=1) OR bg.expire_time > {int:current_time})
Replace With:

         
Código: [Seleccione]
AND (bg.expire_time IS NULL OR bg.expire_time > {int:current_time})
./Sources/DbPackages-postgresql.php

Find:

Código: [Seleccione]
* @version 2.0
Replace With:

Código: [Seleccione]
* @version 2.0.10

Find:

         
Código: [Seleccione]
$setTo = isset($column_info['default']) ? $column_info['default'] : '';
Replace With:

         
Código: [Seleccione]
$setTo = isset($column_info['default']) ? $column_info['default'] : (strpos($old_info['type'], 'int') !== false ? 0 : '');

Find:

            
Código: [Seleccione]
WHERE ' . $column_info['name'] . ' = NULL',
Replace With:

            
Código: [Seleccione]
WHERE ' . $column_info['name'] . ' IS NULL',