Customizing SSI.php

Started by Maisumi, September 21, 2009, 07:52:06 PM

Previous topic - Next topic

Maisumi

Hi, its me again.

Now that I've got my SSI.php set up (I will write a guide on how to add this to your homepage I promise!), I'd like to customize how it looks on my homepage. As of now, all it shows is the following:

Topic title
Today at 07:46:09 PM by Maisumi
Content
//---END OF SSI.PHP CONTENT---

However I want it to look like this:

Lorem Ipsum being the title. Under this blue header would be the content of the forum post. I also want the 1 Comment(s)| Write a Comment link to be underneath the content.

Arantor has told me that HTML is hard coded into PHP. But is there a way to code this to an external stylesheet?

SoLoGHoST

#1
Ok, I'm not sure what you want exactly, but does This Page do what you want sort of??  I know you want the topic title, etc..  But is this sort of what you want?  Basically gets all posts/topics from specified board(s) and randomly displays them at a set Interval.  Well, let me know, k?  Could easily be recoded to add more to it than just the message and a link to the actual message.

External Stylesheet should be no problem either.

Arantor

As I think I mentioned you can use your own HTML pretty easily, by using the 'array' option as the last option in ssi_boardNews, meaning you don't even have to touch SSI.php, though sure you can use a stylesheet to manage it.

Please give me an example of the code you want to use (with an example topic contents) and I'll write you the code for it without modifying SSI.php. (Recommended to not touch it because of potential changes in updates)
Holder of controversial views, all of which my own.


Maisumi

Um, here it is:

<style type="text/css" />
div#forumhead {
background-image: url(images/forumhead.png);
height: 30px;
width: 570px;
font: "Trebuchet MS", Arial, Helvetica, sans-serif
color: #475457;
}

h1 {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size: 14px;
color: #475457;
text-align: left;
}

h2 {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size: 10px;
color: #475457;
text-align: left;
}

p {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size: 12px;
color: #475457;
text-align: left;
}

</style>
</head>

<body>
<div="forumhead">
<h1>Topic Title</h1>
    <h2>Posted by Admin at 8:17 on Saturday, September 9,2009</h2>
    <p>Content</p>
</div>


</body>
</html>

Arantor

What is div="forumhead" supposed to be, that's neither an id or a class.
Holder of controversial views, all of which my own.


Maisumi

Ah sorry forgot that ;-; it's div id.

Arantor

So essentially you want the block that turns ssi_boardNews into generating:

<h1></h1> with the topic title, <h2></h2> with the posted by notice, and <p> containing the content (note that it may already be wrapped in a <p>)

Just want to be clear before I start.
Holder of controversial views, all of which my own.


Maisumi

Yes, and <h1></h1> & <h2></h2> are on the blue image which is this:

<p> contains the contents, yes.

Arantor

To be added into the page where SSI has been included. Sorry for the delay; the last couple of days has been very busy.

<div="forumhead">
<?php

$array
= ssi_boardNews(2, 1, null, 2000, 'array');

foreach(
$array as $post) {
 echo
' <h1>', $post['subject'], '</h1>
   <h2>Posted by '
, $post['poster']['link'], ' at ', date('G:i \o\n l, F j, Y', $post['timestamp']), '</h2>
   <p>'
, $post['body'], '</p>
   '
, $post['comment_link'];
}

?>
</div>


The div is of course your own code.
Holder of controversial views, all of which my own.


Maisumi

#9
Thank you so much Arantor!

I'm having an error, though:



Fatal error: Call to undefined function ssi_boardnews() in /home/maisumi/public_html/index.php on line 42

Arantor

Is SSI.php loaded earlier on in index.php?
Holder of controversial views, all of which my own.


Maisumi

Ah... Careless mistake ;-; Thank you! It works now =]

Advertisement: