News:

Wondering if this will always be free?  See why free is better.

Main Menu

Core Features 'image' Bug - SMF 2.0.2

Started by Matthew K., January 31, 2012, 12:21:17 AM

Previous topic - Next topic

Matthew K.

In the comment right above the $core_features array, an optional parameter is given for defining a custom 'image' variable.

./Sources/ManageSettings.php
/* This is an array of all the features that can be enabled/disabled - each option can have the following:
title - Text title of this item (If standard string does not exist).
desc - Description of this feature (If standard string does not exist).
image - Custom image to show next to feature.
settings - Array of settings to change (For each name => value) on enable - reverse is done for disable. If > 1 will not change value if set.
setting_callback- Function that returns an array of settings to save - takes one parameter which is value for this feature.
save_callback - Function called on save, takes state as parameter.
*/


Although the variable 'image' is not hooked up in the code itself.

Here's the fix...which would be fantastic to have in the next patch.

./Sources/ManageSettings.php
Code (Find) Select
$context['features'][$id] = array(
'title' => isset($feature['title']) ? $feature['title'] : $txt['core_settings_item_' . $id],

Code (Add After) Select
'image' => isset($feature['image']) ? $feature['image'] : '',

./Themes/default/Admin.template.php
Code (Find) Select
<img class="features_image png_fix" src="', $settings['default_images_url'], '/admin/feature_', $id, '.png" alt="', $feature['title'], '" />
Code (Replace) Select
<img class="features_image png_fix" src="', $settings['default_images_url'], '/admin/', !empty($feature['image']) ? $feature['image'] : 'feature_' . $id . '.png', '" alt="', $feature['title'], '" />

emanuele



Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Advertisement: