What source is the following in?

Started by Jotade29, December 25, 2022, 12:21:45 AM

Previous topic - Next topic

Jotade29

Hello, I am trying to root out the following functions. Within profile -> appearance and design, the quick moderation and sidebar menu options. In the profile_template is the following

function template_profile_theme_settings()
{
(...)
<li>
<input type="hidden" name="default_options[use_sidebar_menu]" value="0" />
<label for="use_sidebar_menu"><input type="checkbox" name="default_options[use_sidebar_menu]" id="use_sidebar_menu" value="1"', !empty($context['member']['options']['use_sidebar_menu']) ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['use_sidebar_menu'], '</label>
</li>
<li>
<label for="display_quick_mod">', $txt['display_quick_mod'], '</label>
<select name="default_options[display_quick_mod]" id="display_quick_mod">
<option value="0"', empty($context['member']['options']['display_quick_mod']) ? ' selected="selected"' : '', '>', $txt['display_quick_mod_none'], '</option>
<option value="1"', !empty($context['member']['options']['display_quick_mod']) && $context['member']['options']['display_quick_mod'] == 1 ? ' selected="selected"' : '', '>', $txt['display_quick_mod_check'], '</option>
<option value="2"', !empty($context['member']['options']['display_quick_mod']) && $context['member']['options']['display_quick_mod'] != 1 ? ' selected="selected"' : '', '>', $txt['display_quick_mod_image'], '</option>
</select>
</li>
(...)
}

I want to eliminate the query to the database to modify those fields, which are found in the themes table.
I emphasize, I want to remove it, not just hide that field.

I would like to know in which source I can eliminate that query, since in the respective ones to the profile, profile_modify, profile... I can't find it. Thank you. My version is 2.0.19. Sorry for my bad english!!
Quote from: Diego Andrés on August 12, 2023, 02:20:18 AMI'm afraid convincing Jotade to upgrade to SMF 2.1 will require bigger effort than your work sanitizing Unicode characters  :laugh:

Kindred

Why?

Please explain the reasoning/ultimate goal...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Jotade29

Hello Kindred, thanks for ur answer. I just don't want that option. I think the reason is the least of it, jaja  :P . If you know, please tell me where I can modify that query to the database.
Quote from: Diego Andrés on August 12, 2023, 02:20:18 AMI'm afraid convincing Jotade to upgrade to SMF 2.1 will require bigger effort than your work sanitizing Unicode characters  :laugh:

Kindred

What you say makes very little sense.

You don't want that option.  Ok. sure.   hide the setting in the profile settings (although I think it's a mistake to remove that option)

However, editing your sources to remove things like this mean that you potentially break future upgrades which would then have to be manually applied...     all for a code change that does not save you more than a nanosecond of processing time when it's even called.

In short...  I can't recommend hacking the code for this.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Jotade29

Quote from: Kindred on December 27, 2022, 10:52:19 AMWhat you say makes very little sense.

You don't want that option.  Ok. sure.   hide the setting in the profile settings (although I think it's a mistake to remove that option)

However, editing your sources to remove things like this mean that you potentially break future upgrades which would then have to be manually applied...     all for a code change that does not save you more than a nanosecond of processing time when it's even called.

In short...  I can't recommend hacking the code for this.


Kindred, as I always tell you, thank you very much for your support, for explaining things to me. I don't want the sidebar, because on certain sites with my theme, I have to be touching the design, since for example, I have modified the profile in a dynamic way, and it has compatibility problems when the sidebar is there. Anyone with knowledge about this, however much the option is hidden, can activate it, and it is not what I want.

I have modified many things from SMF, manyyyyyyyyyyy... As you said, this can be a headache when it comes to updating, but all the installations I do, I do manually, and ordered with many different comments, so there's no problem .

Finally, I have already found the function, and I have modified it so that for the sidebar_menu variable (sql) only a user_admin can make changes.

Cheers and thank you again!!
Quote from: Diego Andrés on August 12, 2023, 02:20:18 AMI'm afraid convincing Jotade to upgrade to SMF 2.1 will require bigger effort than your work sanitizing Unicode characters  :laugh:

Advertisement: