Topic: Easy ? For Anybody That Isn't Me: Place a picture only on index.php

Hi All,

Quick questions... probably an easy answer:   How do I post a picture on the very top of the index.php page only?   I know how to edit the main.tpl file, but this is for all pages, I just want the image on the first / index.php page at the very top.

I give thanks in advance to thee masters-of-the-code!

Rob Ludlow 
www.Nifty-Stuff.com - Repository of all Stuff Nifty!
www.reviewum.com - Professor Ratings + Teacher Reviews

Re: Easy ? For Anybody That Isn't Me: Place a picture only on index.php

Define "very top."

Re: Easy ? For Anybody That Isn't Me: Place a picture only on index.php

Hey guardian34!  "very top" = above everything else.  For example, above "PunBB.org Forums" on this forum.  Again, just want it on the index page only.

Thanks!

Rob Ludlow 
www.Nifty-Stuff.com - Repository of all Stuff Nifty!
www.reviewum.com - Professor Ratings + Teacher Reviews

Re: Easy ? For Anybody That Isn't Me: Place a picture only on index.php

Use the #punindex ID.

Re: Easy ? For Anybody That Isn't Me: Place a picture only on index.php

elbekko, sounds good. Can you give me a quick walkthrough?  #punindex ID is in the css file right?

Can someone give me an example of where to insert the image call?

Thanks!

Rob Ludlow 
www.Nifty-Stuff.com - Repository of all Stuff Nifty!
www.reviewum.com - Professor Ratings + Teacher Reviews

Re: Easy ? For Anybody That Isn't Me: Place a picture only on index.php

Add this to your CSS:

#punindex #brdtitle { background: url(myimage.jpg) no-repeat; }

It'll only show up on the index smile

Re: Easy ? For Anybody That Isn't Me: Place a picture only on index.php

Will that show up as a background image, or as an image placed above the forum (like a header, but just on the index page)?

Thanks much guys... really appreciate it!

(this is exactly why I've donated to punbb... great application and great community)

Rob Ludlow 
www.Nifty-Stuff.com - Repository of all Stuff Nifty!
www.reviewum.com - Professor Ratings + Teacher Reviews

Re: Easy ? For Anybody That Isn't Me: Place a picture only on index.php

A background image wink

Re: Easy ? For Anybody That Isn't Me: Place a picture only on index.php

Thanks, but what I'm looking for is actually to be able to place an image above the forum, but just on the index page, not a background image.

Rob Ludlow 
www.Nifty-Stuff.com - Repository of all Stuff Nifty!
www.reviewum.com - Professor Ratings + Teacher Reviews

Re: Easy ? For Anybody That Isn't Me: Place a picture only on index.php

Any new thoughts on this?   I'd be surprised if there isn't a way to put an image at the very top of my index.php page.

Thanks!

Rob Ludlow 
www.Nifty-Stuff.com - Repository of all Stuff Nifty!
www.reviewum.com - Professor Ratings + Teacher Reviews

Re: Easy ? For Anybody That Isn't Me: Place a picture only on index.php

reviewum.com: what Bekko suggested will look like an image placed at the top of your forum (if I'm reading the CSS right).

12

Re: Easy ? For Anybody That Isn't Me: Place a picture only on index.php

As it is now it would show up as an image behind the title.

What you need to do is set the image as a background to div#punindex and then give div#punindex top padding equivelant to the height of the image which will push the rest of the board down below the image. Since the image and padding are actually set on div#punindex it will automatically only apply to to the index page as there is no div#punindex on any other page.

It will look exactly the same as if you put an image in main.tpl. The only thing you could do with a real image is use it as a link. Is that what you wanted to do? If not, there is no reason not to use a background image.

If you must use a real image then you have two choices: either add it in the code, or, add it in main.tpl which means it will be present on all pages and then simply hide the display of the image for any pages other than index with css.

Re: Easy ? For Anybody That Isn't Me: Place a picture only on index.php

Great suggestions, thanks guys!  Yes, I want to place an actual image at the top of the index.php page, not a link.   I'll do some experimenting and see if I can get it to work.

Thanks all!

Rob Ludlow 
www.Nifty-Stuff.com - Repository of all Stuff Nifty!
www.reviewum.com - Professor Ratings + Teacher Reviews

Re: Easy ? For Anybody That Isn't Me: Place a picture only on index.php

Well, here's a little more info.  I want to put the image (which is being called using a php script) into the header of the forum.  A few follow up questions:

1)  I just found out that the main.tpl file doesn't work with php includes (duh.. I guess I should have known that).  How do I get a php include header at the top of every page?

2)  Going back to my first request, best case scenerio would be to pull in the PHP include only into the forum index.php page.  Any way to do this easily?  Paul said to edit the code, but I don't have any idea where to do that.  I'm guessing it isn't as easy as sticking the following in the right place in the index file:
<?php include("/header.php"); ?>

Thanks in advance for any help you can provide!

Rob Ludlow 
www.Nifty-Stuff.com - Repository of all Stuff Nifty!
www.reviewum.com - Professor Ratings + Teacher Reviews

Re: Easy ? For Anybody That Isn't Me: Place a picture only on index.php

header.php is already included there.
Is what you want, a logo at the top of the page (where the text is at the top) ?
you could make like...header2.php (copy header.php)
and find the code where  it puts "PunBB.org Forums" or whatever your sites is....
and replace it with the image you want.
Then open index.php and change where it says header.php to header2.php
Then it should only affect the index page

Re: Easy ? For Anybody That Isn't Me: Place a picture only on index.php

teenagegluesniffer, you're a genius!  That worked like a charm!   I copied header.php to header2.php and in index.php I simply redirected the call to header to header2.

I then inserted my php include at the top of header 2 and voila... everything is working perfectly!

Thanks everyone!

Rob Ludlow 
www.Nifty-Stuff.com - Repository of all Stuff Nifty!
www.reviewum.com - Professor Ratings + Teacher Reviews