Website help with PHP please

Started by Scummbuddy, Fri 11/08/2006 19:29:11

Previous topic - Next topic

Scummbuddy

Hello everyone. I am re-designing the Maniac Zombies website (Maniac Mansion/Day of the Tentacle fansite) and am turning to php for its benefits. I have a mock-up site of how it will look, and I found a tutorial on how to imbed the php news of wordpress into the site, which is one problem I'm having, but I can't seem to have a vertical scrolling box for the news section.

Here's the mock up to get a better idea of what I'm saying.

http://www.lucasstyle.com/mzombies2/index.htm

Yes, I know the comic viewer is overlapping. i'm going to recreate that bit and have it fit better.

-----------
So basically, is there a way to have just that small news box be scrollable and able to be updated easily. I once considered having a flash document that would be loaded into the window, but that wouldn't be that easy to update, plus adding hyperlinks and such wouldn't be easy either.
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

Radiant

Try a DIV with overflow set to scroll.

Oneway

What exactly is your problem you are having?
Were you unable to retrieve the data from the wordpress database or not able to make the scrolling box? Or maybe both?

If it's the first, try following the tutorial in an empty document. I mean without trying to place it directly into your website, but to see if you can actually get the news data from the database.
It will be easier to catch any errors popping up and finding where they originate from.

Once you are able to retrieve the data, place it all into one variable like so:
$news_data = "";
$news_data .= "Hi, this is the first news story.<p>";
$news_data .= "Hi, this is the second news story.<p>";
and so on.
This will probably have to be nested inside a 'for' or 'while' loop to run through all news items.

Then, with all the news data in one variable, you can easily embed it into your html part of the document:
<div style="overflow:auto;height:60px;"><?=$news_data?></div>

If you run into any problems with the php part, please provide us with a link to the tutorial, what step of the tutorial isn't working for you ,any errors and warnings you receive and possibly the line of code (and the one before it) to which the error refers.

Good luck!


@Radiant: setting the overflow to scroll will always show scrollbars, both horizontal and vertical. Setting it to auto will only show scrollbars when the content is bigger than the display area. As long as there are enough possibillities for the browser to break the lines, only the desired vertical scrolbars will appear.
Almost intentionally left blank.

Scummbuddy

Quote from: Radiant on Fri 11/08/2006 21:05:24
Try a DIV with overflow set to scroll.

Wow, I have no idea what that means.

Quote from: Oneway on Sat 12/08/2006 02:27:00
What exactly is your problem you are having?
Were you unable to retrieve the data from the wordpress database or not able to make the scrolling box? Or maybe both?

If it's the first, try following the tutorial in an empty document. I mean without trying to place it directly into your website, but to see if you can actually get the news data from the database.
It will be easier to catch any errors popping up and finding where they originate from.

Once you are able to retrieve the data, place it all into one variable like so:
$news_data = "";
$news_data .= "Hi, this is the first news story.<p>";
$news_data .= "Hi, this is the second news story.<p>";
and so on.
This will probably have to be nested inside a 'for' or 'while' loop to run through all news items.

Then, with all the news data in one variable, you can easily embed it into your html part of the document:
<div style="overflow:auto;height:60px;"><?=$news_data?></div>

If you run into any problems with the php part, please provide us with a link to the tutorial, what step of the tutorial isn't working for you ,any errors and warnings you receive and possibly the line of code (and the one before it) to which the error refers.

Good luck!


@Radiant: setting the overflow to scroll will always show scrollbars, both horizontal and vertical. Setting it to auto will only show scrollbars when the content is bigger than the display area. As long as there are enough possibillities for the browser to break the lines, only the desired vertical scrolbars will appear.

Here is the site [ http://lucasstyle.com/mzombies2/index.php ] with the wordpress pumping into it, and I'm sure I followed the tutorial correctly, but I spent a good afternoon trying to re-find the tutorial to show you all, with no luck. I'll continue to try and find it, but maybe I should ignore using wordpress?

I would really like to model a site practically after www.worldofmi.com, with the images/fan art integrated with a database for uploads and comments. I want a comment section for news and such that isnt only on the forums I set up.

I've got a long way to go. I'll continue to try and find the tutorial.
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

Esseb

Doesn't work in Opera or Firefox. I'd try to fix that problem first.

SMF spam blocked by CleanTalk