Welcome to Geeklog, Anonymous Friday, December 27 2024 @ 01:49 am EST
Geeklog Forums
Random image from Media gallery to header
Babooya
Anonymous
Howdy!
How would I move the random image block from Media Gallery to display in the header area. I want to display a random image everytime a user comes to the site (kinda in the area of the logo). Any help would be appreciated.
How would I move the random image block from Media Gallery to display in the header area. I want to display a random image everytime a user comes to the site (kinda in the area of the logo). Any help would be appreciated.
9
9
Quote
Status: offline
mevans
Forum User
Full Member
Registered: 02/08/04
Posts: 393
Location:Texas
Babooya,
Moving the random image block to the header isn't that difficult, if you have a good understanding of html, etc.
You need to call the php function for the random block in header.thtml, insert the following line of code where you want the random block to display:
That could replace your logo in your header.thtml as an example.
You will probably want to edit the template that I used for the random block, probably remove the 'Browse Album' that shows underneath the image. That template is random_block.thtml and it is located in the plugins/mediagallery/templates/ directory.
Let me know if this gets you started.
Thanks!
Mark
Moving the random image block to the header isn't that difficult, if you have a good understanding of html, etc.
You need to call the php function for the random block in header.thtml, insert the following line of code where you want the random block to display:
Text Formatted Code
<?php echo phpblock_mg_randommedia(); ?>That could replace your logo in your header.thtml as an example.
You will probably want to edit the template that I used for the random block, probably remove the 'Browse Album' that shows underneath the image. That template is random_block.thtml and it is located in the plugins/mediagallery/templates/ directory.
Let me know if this gets you started.
Thanks!
Mark
10
9
Quote
Babooya
Anonymous
Thanks for the quick reply...that worked! I just need to adjust the size. Do I hardcode that in the random_block.thtml file or do I change the variable?
12
9
Quote
Status: offline
mevans
Forum User
Full Member
Registered: 02/08/04
Posts: 393
Location:Texas
Probably the best way to change the size is to change the code. See this wiki entry for instructions on how to change the size in the code.
Thanks!
Mark
Thanks!
Mark
12
8
Quote
Babooya
Anonymous
Last time...honest
Your advice has been right on. Can I ask how to have it display on the homepage only...Thanks in advance!
Your advice has been right on. Can I ask how to have it display on the homepage only...Thanks in advance!
9
11
Quote
Status: offline
mevans
Forum User
Full Member
Registered: 02/08/04
Posts: 393
Location:Texas
Babooya,
I'm not sure I can answer your last question, as far as I know, Geeklog calls the same header for all pages, there isn't anything to say use this header for the home page and another for different pages.
I haven't searched the forums to see if there are any discussions about using a custom header per page/area. You might check that. Maybe if this is doable someone who knows a little more about the subject might chime in.
Thanks!
Mark
I'm not sure I can answer your last question, as far as I know, Geeklog calls the same header for all pages, there isn't anything to say use this header for the home page and another for different pages.
I haven't searched the forums to see if there are any discussions about using a custom header per page/area. You might check that. Maybe if this is doable someone who knows a little more about the subject might chime in.
Thanks!
Mark
9
9
Quote
All times are EST. The time is now 01:49 am.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content