TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,004
  • Total Topics: 21,330
  • Online today: 219
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 82
  • Total: 82

banner changing or suggestions

Started by rbh, January 05, 2006, 01:53:26 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

rbh

 is it possible to have the logo banner change when a different link is clicked? my site will have a certain label, but my forums will be called something else so i was wondering if something like this would be possible. if not, what might you suggest for displaying the forum name when they visit it as opposed to always seeing the mainpage banner?

IchBin

Where is the link that you want to change your logo/banner?

rbh

IchBin....well, there isn't one exactly. i keep tearing it down and setting it back up while experimenting with different things. after looking through some things i dont think i can do it. the logo i was wanting to change is the smflogo.gif . i see how to change it, but i am not sure about it loading a different logo when the forums are clicked. i think i need to try something different, maybe with putting different banners in top blocks, if its possible to control the blocks in a way that when you are the mainpage certain blocks will show, then when you click on forums, a new set of blocks will show. if thats even possible to do, then i think maybe putting a mainpage logo in one top box, then the forums logo in another top box then settings those blocks to only show when you are in certain areas of the site.

am i too damn confusing yet??? ;D :uglystupid2:

Rasyr

There is a way to do it...

Basically, you need a script that determines what page you are on. I am not quite sure how to do that, but basically what you want to do is
take these lines:

<td align="right" class="catbg">
<img src="', $settings['images_url'], '/smflogo.gif" style="margin: 2px;" alt="" />
</td>



and change them to something like the following:


<td align="right" class="catbg">';
         if (**this page = forums**)
        {
      <img src="', $settings['images_url'], '/NewImg.gif" style="margin: 2px;" alt="" />
        }
        else
        {
              <img src="', $settings['images_url'], '/smflogo.gif" style="margin: 2px;" alt="" />
        }         
echo '
                </td>


The part I am not sure of is how to determine if you are on the forum pages or not (the IF statement) as there are at least three or more different arguments that go with the url that are used for the forums (action=forum; board=xx; topic=xx; etc.).

IchBin

Those were exactly my thoughts Rasyr before I saw your post. Nice work! Now if we just new exactly how to code it. :)

Rasyr

I have almost no knowledge of php programming. Just a warning here, so you know that I am just making a guess here.

It occurred to me that the best way to find out where we are would be to look at the arguments after the url. In the block below, I have a little something that calls for the  $_REQUEST['action'] variable and displays it (I put it in a phpbox for testing). However, I am not sure how to get those arguments that are not actions (i.e. the board=, topic=, etc..).

If anybody knows how to do that, then we can build the IF block's conditional statement so that it reads if($_REQUEST['action']=='forum' || xx== ('board' || 'topic' ||etc..))



if (!isset($_REQUEST['action'])){
      $foo = 'forum';}
else {
      $foo = $_REQUEST['action'];}

if ($foo == 'forum'){
    echo ' <b>We are in the forums</b>';}
else {
   echo '<b>we are in '.  $foo . '</b>';}


Rasyr

boooyah!!!

I think that I got this figured out!! (thanks to pouring over the different files!! I found the answer scattered through the QueryString.php file).

In index.template.php, take these lines:

<td align="right" class="catbg">
<img src="', $settings['images_url'], '/smflogo.gif" style="margin: 2px;" alt="" />
</td>



and change them to something like the following:


<td align="right" class="catbg">';
         if ($_REQUEST['action'] == 'forum' || isset($_REQUEST['board']) || isset($_REQUEST['topic']))
        {
      <img src="', $settings['images_url'], '/NewImg.gif" style="margin: 2px;" alt="" />
        }
        else
        {
              <img src="', $settings['images_url'], '/smflogo.gif" style="margin: 2px;" alt="" />
        }         
echo '
                </td>



If you want to give that IF Statement a test drive before changing your file, just copy and paste the following code into a phpblock and watch what it says as you move around the forums and the rest of the site...



if ($_REQUEST['action'] == 'forum' || isset($_REQUEST['board']) || isset($_REQUEST['topic']))
{
    echo ' <b>We are in the forums</b>';
}
else
{
   echo '<b>We are someplace else</b>';
}


rbh

rasyr, i see where this will work if i can't get the banner changed because the short code you posted to put in a phpblock worked. if i cant get the actual forum logo to change then i can at least work with the changing information in the phpblock to do what i am wanting. now, here is whats not working in editing my index.template.php. i looked for the line you have posted but couldn't find it. instead i find this.

// This part is the logo and forum name.  You should be able to change this to whatever you want...
echo '
<img src="', $settings['images_url'], '/smflogo.gif" style="width: 250px; float: ', !$context['right_to_left'] ? 'right' : 'left', ';" alt="" />';
if (empty($settings['header_logo_url']))
echo '
<span style="font-family: Georgia, sans-serif; font-size: xx-large;">', $context['forum_name'], '</span>';
else
echo '
<img src="', $settings['header_logo_url'], '" alt="', $context['forum_name'], '" border="0" />';
// TinyPortal
     if($context['TPortal']['showtop']==1)
     {
// TinyPortal end


so with that, what would i replace with your code to test with?

Rasyr

okay, that looks like you are using 1.1 RC1 and Tp 0.75

sooo... change

       // This part is the logo and forum name.  You should be able to change this to whatever you want...
echo '
<img src="', $settings['images_url'], '/smflogo.gif" style="width: 250px; float: ', !$context['right_to_left'] ? 'right' : 'left', ';" alt="" />';
if (empty($settings['header_logo_url']))
echo '
<span style="font-family: Georgia, sans-serif; font-size: xx-large;">', $context['forum_name'], '</span>';
else
echo '
<img src="', $settings['header_logo_url'], '" alt="', $context['forum_name'], '" border="0" />';
// TinyPortal
     if($context['TPortal']['showtop']==1)
     {
// TinyPortal end



to


// This part is the logo and forum name.  You should be able to change this to whatever you want...

if ($_REQUEST['action'] == 'forum' || isset($_REQUEST['board']) || isset($_REQUEST['topic']))
{
echo '
<img src="', $settings['images_url'], '/MYLogo.gif" style="width: 250px; float: ', !$context['right_to_left'] ? 'right' : 'left', ';" alt="" />';
}
else
{
echo '
<img src="', $settings['images_url'], '/smflogo.gif" style="width: 250px; float: ', !$context['right_to_left'] ? 'right' : 'left', ';" alt="" />';
}
if (empty($settings['header_logo_url']))
echo '
<span style="font-family: Georgia, sans-serif; font-size: xx-large;">', $context['forum_name'], '</span>';
else
echo '
<img src="', $settings['header_logo_url'], '" alt="', $context['forum_name'], '" border="0" />';
// TinyPortal
     if($context['TPortal']['showtop']==1)
     {
// TinyPortal end


MyLogo. gif should be the name of your banner for your forums. This replaces the SMF Logo with your logo. The image file for your logo should be in the images directory within the theme's folder, and you will likely want to change the with within the style element to  match the actual width of your image.

The important part is the if/else statement that I wrapped around the smflogo.gif line. With that if/else statement, You could change the whole header portion if you wanted to.

In fact, when I upgrade my main forums to include TP, I need to remember this bit of code so that I can do the same thing (alhough I will be pretty much replacing that whole header - but there is one image of the header that I will want to change when users are in the actual forums.


rbh

#9
well, that is deffinately the result i am looking for. it changes the banners exactly how i was wanting. i need to play around with sizing but other then that, it's almost perfect. the only problem i have it it has messed with the buttons of the site. they were once a row of tabs , the oxygen theme, but have now been replaced with buttons and some of them have turned into links instead of buttons. :D i will continue to mess around with it tomorrow, but you are hitting the nail on the head with what i was looking for. thank you greatly for the effort you are putting into this!  ;D

heres a picture of the banner area and effected buttons.


This website is proudly hosted on Crocweb Cloud Website Hosting.