8: Undefined index: use_image_buttons

Started by mehrtadbir, October 10, 2013, 05:43:02 PM

Previous topic - Next topic

mehrtadbir

Hello

I have 2 errors . Please help me to fix it.


irmeta.com/meta/profile
8: Undefined index: use_image_buttons
File: /*/Themes/default/Profile.template.php
Line: 92


72:
// Don't show an icon if they haven't specified a website.
73:
if ($context['member']['website']['url'] !== '' && !isset($context['disabled_fields']['website']))
74:
echo '
75:
<li><a href="', $context['member']['website']['url'], '" title="' . $context['member']['website']['title'] . '" target="_blank" class="new_win">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/www_sm.gif" alt="' . $context['member']['website']['title'] . '" />' : $txt['www']), '</a></li>';
76:
77:
// Are there any custom profile fields for the summary?
78:
if (!empty($context['custom_fields']))
79:
{
80:
foreach ($context['custom_fields'] as $field)
81:
if (($field['placement'] == 1 || empty($field['output_html'])) && !empty($field['value']))
82:
echo '
83:
<li class="custom_field">', $field['output_html'], '</li>';
84:
}
85:
86:
echo '
87:
', !isset($context['disabled_fields']['icq']) && !empty($context['member']['icq']['link']) ? '<li>' . $context['member']['icq']['link'] . '</li>' : '', '
88:
', !isset($context['disabled_fields']['msn']) && !empty($context['member']['msn']['link']) ? '<li>' . $context['member']['msn']['link'] . '</li>' : '', '
89:
', !isset($context['disabled_fields']['aim']) && !empty($context['member']['aim']['link']) ? '<li>' . $context['member']['aim']['link'] . '</li>' : '', '
90:
', !isset($context['disabled_fields']['yim']) && !empty($context['member']['yim']['link']) ? '<li>' . $context['member']['yim']['link'] . '</li>' : '', '
91:
</ul>
==>92:
<span id="userstatus">', $context['can_send_pm'] ? '<a href="' . $context['member']['online']['href'] . '" title="' . $context['member']['online']['label'] . '" rel="nofollow">' : '', $settings['use_image_buttons'] ? '<img src="' . $context['member']['online']['image_href'] . '" alt="' . $context['member']['online']['text'] . '" align="middle" />' : $context['member']['online']['text'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $context['member']['online']['text'] . '</span>' : '';
93:
94:
// Can they add this member as a buddy?
95:
if (!empty($context['can_have_buddy']) && !$context['user']['is_owner'])
96:
echo '
97:
<br /><a href="', $scripturl, '?action=buddies;sa=add;u=', $context['member']['id'], ';', $context['session_var'], '=', $context['session_id'], '">[', $txt['buddy_add'], ']</a>';
98:
99:
echo '
100:
</span>';
101:
102:
echo '
103:
<p id="infolinks">';
104:
105:
if (!$context['user']['is_owner'] && $context['can_send_pm'])
106:
echo '
107:
<a href="', $scripturl, '?action=pm;sa=send;u=', $context['id_member'], '">', $txt['profile_sendpm_short'], '</a><br />';
108:
echo '
109:
<a href="', $scripturl, '?action=profile;area=showposts;u=', $context['id_member'], '">', $txt['showPosts'], '</a><br />
110:
<a href="', $scripturl, '?action=profile;area=statistics;u=', $context['id_member'], '">', $txt['statPanel'], '</a>
111:
</p>';
112:




irmeta.com/meta/profile
8: Undefined index: use_image_buttons
File: /*/Themes/default/Profile.template.php
Line: 75


55:
<h3 class="catbg">
56:
<span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" class="icon" />', $txt['summary'], '</span>
57:
</h3>
58:
</div>
59:
<div id="basicinfo">
60:
<div class="windowbg">
61:
<span class="topslice"><span></span></span>
62:
<div class="content flow_auto">
63:
<div class="username"><h4>', $context['member']['name'], ' <span class="position">', (!empty($context['member']['group']) ? $context['member']['group'] : $context['member']['post_group']), '</span></h4></div>
64:
', $context['member']['avatar']['image'], '
65:
<ul class="reset">';
66:
67:
// What about if we allow email only via the forum??
68:
if ($context['member']['show_email'] === 'yes' || $context['member']['show_email'] === 'no_through_forum' || $context['member']['show_email'] === 'yes_permission_override')
69:
echo '
70:
<li><a href="', $scripturl, '?action=emailuser;sa=email;uid=', $context['member']['id'], '" title="', $context['member']['show_email'] == 'yes' || $context['member']['show_email'] == 'yes_permission_override' ? $context['member']['email'] : '', '" rel="nofollow"><img src="', $settings['images_url'], '/email_sm.gif" alt="', $txt['email'], '" /></a></li>';
71:
72:
// Don't show an icon if they haven't specified a website.
73:
if ($context['member']['website']['url'] !== '' && !isset($context['disabled_fields']['website']))
74:
echo '
==>75:
<li><a href="', $context['member']['website']['url'], '" title="' . $context['member']['website']['title'] . '" target="_blank" class="new_win">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/www_sm.gif" alt="' . $context['member']['website']['title'] . '" />' : $txt['www']), '</a></li>';
76:
77:
// Are there any custom profile fields for the summary?
78:
if (!empty($context['custom_fields']))
79:
{
80:
foreach ($context['custom_fields'] as $field)
81:
if (($field['placement'] == 1 || empty($field['output_html'])) && !empty($field['value']))
82:
echo '
83:
<li class="custom_field">', $field['output_html'], '</li>';
84:
}
85:
86:
echo '
87:
', !isset($context['disabled_fields']['icq']) && !empty($context['member']['icq']['link']) ? '<li>' . $context['member']['icq']['link'] . '</li>' : '', '
88:
', !isset($context['disabled_fields']['msn']) && !empty($context['member']['msn']['link']) ? '<li>' . $context['member']['msn']['link'] . '</li>' : '', '
89:
', !isset($context['disabled_fields']['aim']) && !empty($context['member']['aim']['link']) ? '<li>' . $context['member']['aim']['link'] . '</li>' : '', '
90:
', !isset($context['disabled_fields']['yim']) && !empty($context['member']['yim']['link']) ? '<li>' . $context['member']['yim']['link'] . '</li>' : '', '
91:
</ul>
92:
<span id="userstatus">', $context['can_send_pm'] ? '<a href="' . $context['member']['online']['href'] . '" title="' . $context['member']['online']['label'] . '" rel="nofollow">' : '', $settings['use_image_buttons'] ? '<img src="' . $context['member']['online']['image_href'] . '" alt="' . $context['member']['online']['text'] . '" align="middle" />' : $context['member']['online']['text'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $context['member']['online']['text'] . '</span>' : '';
93:
94:
// Can they add this member as a buddy?
95:
if (!empty($context['can_have_buddy']) && !$context['user']['is_owner'])


and I installed bellow MODs:

1. Show your social networks 4.0
2. SMF Classifieds 3.0.1
3. Edit All Message Titles 0.1.1
4. Ultimate Profile 0.9.1
5. markItUp! for SMF 0.5.2
6. SMFPacks: SEO Pro Mod 1.1.6
7. Delete emails 1.1
8. Similar Topics 0.6
9. SMF 2.0.5 Update 1.0
10. Anti-SID(PHPSESSID) canonical tag 0.6
11. Drafts 1.1.4
12. Remove Help From Menu 1.0
13. SimpleDesk - Integrated Helpdesk for Simple Machines Forum 2.0
14. SMF 2.0.4 Update 1.0
15. SMF 2.0.3 Update 1.0
16. CSS Message Boxes 1.1
17. Tagging System SMFSIMPLE 1.0
18. Good Post/Bad Post Mod 2.0.4
19. Welcome Back 1.0
20. SimpleAds 1.0.1
21. [BBCode] Overline 1.0
22. Negative Text BBCode 1.3
23. [BBCode] Blink 1.0
24. [BBCode] Dotted Underline 1.0
25. Tidy Child Boards 1.4
26. Downloads System 1.5.2
27. SMFShop 3.2.1
28. Karma Description Mod 2.7.1
29. SimplePortal 2.3.5


I attach Profile.template.php for caution
تالار گفتگوی تخصصی متا    دفتر تلفن مشاغل   سامانه پیام کوتاه ویژه اعضای دفتر تلفن مشاغل     شبکه تجارت الکترونیک البرز

Matthew K.

There are a couple instances of "$settings['use_image_buttons']", but nothing checks to see if that variable is set (in this case), change those instances to "isset($settings['use_image_buttons'])", and it should fix those errors.

mehrtadbir

when I replace "isset($settings['use_image_buttons'])" direct admin display this PM


Command Returned


Details

And it does not save
تالار گفتگوی تخصصی متا    دفتر تلفن مشاغل   سامانه پیام کوتاه ویژه اعضای دفتر تلفن مشاغل     شبکه تجارت الکترونیک البرز

Matthew K.

What do you mean by that? What is your updated code?

mehrtadbir

#4
I have similar errors

irmeta.com/meta/p139;area=showposts;start=435
8: Undefined index: use_image_buttons
File: /*/Sources/Subs.php
Line: 3967


3947:
// Trim characters before and after and add slashes for database insertion.
3948:
$returned_words = array();
3949:
foreach ($words as $word)
3950:
if (($word = trim($word, '-_\'')) !== '')
3951:
$returned_words[] = $max_chars === null ? $word : substr($word, 0, $max_chars);
3952:
3953:
// Filter out all words that occur more than once.
3954:
return array_unique($returned_words);
3955:
}
3956: }
3957:
3958: // Creates an image/text button
3959: function create_button($name, $alt, $label = '', $custom = '', $force_use = false)
3960: {
3961:
global $settings, $txt, $context;
3962:
3963:
// Does the current loaded theme have this and we are not forcing the usage of this function?
3964:
if (function_exists('template_create_button') && !$force_use)
3965:
return template_create_button($name, $alt, $label = '', $custom = '');
3966:
==>3967:
if (!$settings['use_image_buttons'])
3968:
return $txt[$alt];
3969:
elseif (!empty($settings['use_buttons']))
3970:
return '<img src="' . $settings['images_url'] . '/buttons/' . $name . '" alt="' . $txt[$alt] . '" ' . $custom . ' />' . ($label != '' ? '<strong>' . $txt[$label] . '</strong>' : '');
3971:
else
3972:
return '<img src="' . $settings['lang_images_url'] . '/' . $name . '" alt="' . $txt[$alt] . '" ' . $custom . ' />';
3973: }
3974:
3975: // Empty out the cache folder.
3976: function clean_cache($type = '')
3977: {
3978:
global $cachedir, $sourcedir;
3979:
3980:
// No directory = no game.
3981:
if (!is_dir($cachedir))
3982:
return;
3983:
3984:
// Remove the files in SMF's own disk cache, if any
3985:
$dh = opendir($cachedir);
3986:
while ($file = readdir($dh))
3987:
{
تالار گفتگوی تخصصی متا    دفتر تلفن مشاغل   سامانه پیام کوتاه ویژه اعضای دفتر تلفن مشاغل     شبکه تجارت الکترونیک البرز

mehrtadbir

Quote from: Labradoodle-360 on October 10, 2013, 06:54:59 PM
What do you mean by that? What is your updated code?
I hope to be understood , My version is 2.0.5



It's a screenshot
Quote from: Labradoodle-360 on October 10, 2013, 05:52:54 PM
There are a couple instances of "$settings['use_image_buttons']", but nothing checks to see if that variable is set (in this case), change those instances to "isset($settings['use_image_buttons'])", and it should fix those errors.
I can't save file for this change
تالار گفتگوی تخصصی متا    دفتر تلفن مشاغل   سامانه پیام کوتاه ویژه اعضای دفتر تلفن مشاغل     شبکه تجارت الکترونیک البرز

Matthew K.

Line 3967 of your Subs.php: if (!$settings['use_image_buttons']) change that to: if (!isset($settings['use_image_buttons']))

Advertisement: