Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Post Installation Help
Author Message
srhh
Involved
Involved



Joined: Dec 27, 2005
Posts: 296

PostPosted: Tue Oct 24, 2006 9:16 am Reply with quote

I want to make an image that says "Featured Articles" right above where the News starts on my homepage. I found if I put it right as the first thing in themes/story_home.html, it does what I want, except it puts the image above every news story in the index and I just want it at the top of the first.
How would I do this?
 
View user's profile Send private message
srhh







PostPosted: Tue Oct 24, 2006 10:59 am Reply with quote

Nevermind. Just decided it'd be easier to make a small little block to put on top of the news.
 
fkelly
Former Moderator in Good Standing



Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY

PostPosted: Tue Oct 24, 2006 11:20 am Reply with quote

I wish I had an easy answer. Let me explain the difficulty first. The news module reads all the news articles or at least it reads the number you have set in your storyhome variable or the site default number of stories in home if the storyhome variable isn't set. Then it goes thru all kinds of formatting permutations and finally calls the themeindex function of whatever theme you are using ONCE FOR EACH STORY.

The themeindex then does some more theme specific formatting and uses the story_home.html file as a "template" for presenting the story. So anything you stick in story_home will be repeated once for each story. The html file doesn't have any PHP logic in it so you can't say "just do this row once per news page presentation" by setting a flag. I guess you could hack the theme and create another html file that only gets presented once every time the news page is loaded. Or you could stick the image in the themeheader but only have it presented if you are in the news module.

The problem with any of these approaches is that they are non-standard and they will only work for a single theme that you've modified and so you'd have to modify a bunch of themes if you give users a choice. And some of the themes are structured differently (they don't use the html files) so you'd have to hack two different kinds of themes.

Maybe someone else can help you with a better approach than I've outlined but if I were you I'd forget the idea. Aside from the problems I've outlined you'd also have to take into account that when a new release comes out you'll have to reintegrate your hacks into the new version of code.
 
View user's profile Send private message Visit poster's website
evaders99
Former Moderator in Good Standing



Joined: Apr 30, 2004
Posts: 3221

PostPosted: Tue Oct 24, 2006 12:06 pm Reply with quote

The block there is the easiest approach. Smile
You could also edit the main theme.php

_________________
- Only registered users can see links on this board! Get registered or login! -

Need help? Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
srhh







PostPosted: Tue Oct 24, 2006 12:23 pm Reply with quote

I am at one with the Path of the Lazy, and my guru hath given me this key:

Code:
<?php


if (eregi("block-featured.php",$_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}

$content .= "<center><img src=\"images/featured.gif\"BORDER=0><br>Below are the five latest articles.<br><a href=\"content.html\">Click here for the archive of all the past featured articles and for other relevant content in the Library.</a><br ><a href=\"submit.html\">Or click here to submit your own article or news piece.</center>";

?>


Thanks for the info though. Its interesting to know how this stuff works.
I still will not convert to your blasphemous ideals of work. Wink
 
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Tue Oct 24, 2006 4:18 pm Reply with quote

If your really bored, drop by www.metopen.com Wink
 
View user's profile Send private message Send e-mail
srhh







PostPosted: Thu Oct 26, 2006 10:54 am Reply with quote

Never too bored for new shiny toys!
Thanks for the link!
 
fkelly







PostPosted: Thu Oct 26, 2006 2:03 pm Reply with quote

So you are using content and not news? That's what the code looks like. I'm just curious because I was thinking about this and I believe that if news is the module in home then it will be positioned automatically right below the message and I'm not sure how you'd stick another block in between them. I was thinking that a possible "hack" solution might be to put the text you want in the second message (you can have two of them) and that would appear right above the news block.
 
srhh







PostPosted: Thu Oct 26, 2006 5:04 pm Reply with quote

No, I just made the block with the featured articles graphic and placed it as 'center up' so it only shows on top of the five articles I have in home, which is what I was trying to do without making a block. But it looks prettier this way.
The MetHomepage and MetTopic modules look pretty cool and I'll probably end up switching over to them.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Post Installation Help

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©