Simple Machines Community Forum

SMF Support => SMF 2.1.x Support => Topic started by: petre_vitan on June 21, 2022, 12:00:28 PM

Title: A little help please - move footer to be framed in theme
Post by: petre_vitan on June 21, 2022, 12:00:28 PM
Sorry, I'm writing with google translate.
Recently I also use this wonderful platform but I want to make some changes to a theme and it is beyond me. I want the footer to be framed in the theme, as I tried to explain in the picture.
I probably need to make a change to index.template.php but I don't know where and how.
Thanks for the help.
(https://i.imgur.com/pQ3eOFL.png)
Title: Re: A little help please
Post by: Kindred on June 21, 2022, 12:52:52 PM
alot of that depends on the theme that you use -- but realistically, you don't need to actually MOVE any code (because what you are asking would actually be moderatedly complicated to do, code-wise).

However, lucky for you -- You can make a few minor edits to the CSS to change the LOOK so that it looks like the footer content is within the same boundaries are the forum content.
Title: Re: A little help please
Post by: Arantor on June 21, 2022, 01:09:59 PM
Um, you're just moving the code inside template_body_below() (it's literally all in there), moving the first echo down. Then changing style to suit.
Title: Re: A little help please
Post by: petre_vitan on June 21, 2022, 01:43:26 PM
A little more explicit if possible. Where exactly should I move the function code template_body_below (), after or before which code?
Title: Re: A little help please
Post by: Arantor on June 21, 2022, 01:45:28 PM
No, you're changing the code inside that function. I'm on mobile so I can't really explain, but template_body_below in the index template file deals with everything from after all the content to the end of the footer. Look in the file, you should see an echo statement ending all the main divs that are the content, then the footer.
Title: Re: A little help please
Post by: Kindred on June 21, 2022, 02:27:00 PM
hmmm.....


Oh yeah, I forgot that the divs closing are in the template_body_below.   I was working under the (mistaken) recall that the divs got closed in the content section.



However, I still think it can be done with only CSS in that theme...
Title: Re: A little help please
Post by: Arantor on June 21, 2022, 02:27:38 PM
Probably, but it's also super fiddly CSS.
Title: Re: A little help please
Post by: petre_vitan on June 21, 2022, 11:26:16 PM
Thank you all for your help. I will make a backup copy of the theme files and then try until I succeed.
I wish you a wonderful day, beautiful people.
Title: Re: A little help please - move footer to be framed in theme
Post by: Antechinus on June 22, 2022, 04:49:36 PM
Quote from: Kindred on June 21, 2022, 02:27:00 PMHowever, I still think it can be done with only CSS in that theme...
Personally, I would not attempt to do it via CSS only, I would change the markup.
Title: Re: A little help please - move footer to be framed in theme
Post by: petre_vitan on July 01, 2022, 11:18:14 PM
I leave an answer to solve the problem for which I opened this topic.
The line is searched for in the index.template.php file
global $context, $txt, $scripturl, $modSettings;and immediately after this line the following code is searched, cut and pasted:
  // Show the footer with copyright, terms and help links.
  echo '
  <div id="footer">
      <div class="inner_wrap">';

  // There is now a global "Go to top" link at the right.
  echo '
      <ul>
        <li class="floatright"><a href="', $scripturl, '?action=help">', $txt['help'], '</a> ', (!empty($modSettings['requireAgreement'])) ? '| <a href="' . $scripturl . '?action=agreement">' . $txt['terms_and_rules'] . '</a>' : '', ' | <a href="#header">', $txt['go_up'], ' &#9650;</a>
<br /><div id="elemID031021" style="line-height:16px;text-align:center;position:relative;z-index:100000;"><div><a title="forum visits ip addresses free software" href="https://www.tracemyip.org/pv1-3-39755-2"><img src="//s3.tracemyip.org/tracker/1218/4684NR-IPIB/62897/12/njsUrl/" alt="forum visits ip addresses free software" referrerPolicy="no-referrer-when-downgrade" style="border:0px;" /></a></div><div><a href="https://www.tracemyip.org/pv1-3-39755-2">quick stats</a></div></div>
</li>';
  // Show the load time?
  if ($context['show_load_time'])
      echo '
      <li class="floatright clear">', sprintf($txt['page_created_full'], $context['load_time'], $context['load_queries']), '</li>';
echo '
        <li class="copyright">', theme_copyright(), '</li>
                  <li>Vag Club Auto &copy 2022</li>
      </ul>';

The result will be the one in the picture below.
(https://i.imgur.com/pF8BuK2.png)

(I translate via Google)