Small Backend Changes
Offline
Code Tsar
Posts:
Threads:
#1
This post has been hidden based on your content filter selections.
If you're using MyBB, presumably you are comfortable with some code-related fiddling! There are a couple of steps to take in file manager to get this skin working just right.

By default, the quick theme select dropdown can only be in the footer. To render the template outside of the footer:

in global.php, find

Code:
// Are we showing the quick theme selection box?
$theme_select = $theme_options = '';
if($mybb->settings['showthemeselect'] != 0)
{
...
}

cut and paste above, in line 950:

Code:
}

(LINE 950) // PASTE THIS CODE HERE

$jsTemplates = array();
foreach (array('modal', 'modal_button') as $template) {
    eval('$jsTemplates["'.$template.'"] = "'.$templates->get($template, 1, 0).'";');
    $jsTemplates[$template] = str_replace(array("\n","\r"), array("\\\n", ""), addslashes($jsTemplates[$template]));
}

You can now move the quick theme selector wherever you want!
(This post was last modified: 12-29-2023, 02:47 PM by gist.)
Offline
Code Tsar
Posts:
Threads:
#2
This post has been hidden based on your content filter selections.
I've added two small PHP files that do the following:

fetch_user_details.php returns all of a user's custom fields based on their user id, in a json object. This info is used to populate the user info modal, which pops up when properly-classed usernames are clicked, instead of taking you to the profile page. More info about this in the header template.

If you don't want to use this, that's fine! Just remove the associated script, and profile links will take you straight to the profile page again, no matter their class.



recent_threads.php fetches the 10 most recent threads (change this easily in the file), and returns them in a json format, which is used to populate the recent threads section of the index page. Again, feel free to omit this and change that section to something else. Just remove the clearly labeled recent threads section of the script in the header. Note that it does automatically take the current user's usergroup into account when choosing which posts to display. It could easily be updated to show threads from only selected forums.



You do not need to add any templates or do anything extra for these to function. It's all built right into the script. Just add the php files to your board. Or dont!
(This post was last modified: 02-26-2024, 09:36 PM by gist.)
Attached Files
.php recent_threads.php (Size: 1.88 KB / Downloads: 1)
.php fetch_user_details.php (Size: 1.34 KB / Downloads: 1)
visibility
Users browsing this thread: 1 Guest(s)
Forum Jump: