View previous topic :: View next topic |
Author |
Message |
nessahead
Joined: 12 Mar 2002 Posts: 312 Location: Los Angeles, CA
|
Posted: Sun Apr 28, 2002 5:20 am Post subject: Making your own template the easy way |
|
|
If you know a little HTML, it really isn't that hard to make a custom template. The easy way to think of it is just go ahead and make your html layout. Then, you have to put the following at the top in order for b2 to work:
Code: | <?php /* Don't remove this line, it calls the b2 function files ! */ $blog=1; include ("blog.header.php"); ?> |
Then, wherever you want the blog stuff to show up, put this:
Code: | <!-- // b2 loop start -->
<?php while($row = mysql_fetch_object($result)) { start_b2(); ?>
<?php the_date("d.m.y","<h1>","</h1>"); ?>
<p>
<?php permalink_anchor(); ?>
<strong><?php the_title(); ?></strong> (category: <strong><?php the_category() ?></strong>)<br />
<?php the_content(); ?><?php link_pages("<br />Pages: ","<br />","number") ?>
<br />
<em>posted by <strong><?php the_author() ?></strong> @ <a href="<?php permalink_link() ?>"><?php the_time() ?></a></em>
<br />
<a href="<?php comments_link() ?>"><?php comments_number("no comments", "1 comment", "% comments") ?></a>
</p>
<?php include ("b2comments.php"); ?>
<!-- // this is just the end of the motor - don't touch that line either :) -->
<?php } ?> |
Now, all the stuff like <?php the_author() ?> and whatnot are variables for what b2 will put in there. If you want the authorname to be bold, just but <b></b> tags around it and so on. If you want something in a seperate paragraph, just stick it in <p></p> tags. If something is showing up that you don't want, just delete it.
If you want more info on what kinds of variables you can use, read the readme.html file. (It's also on cafelog at http://www.cafelog.com/readme.html)
I think the thing is that people aren't too sure exactly what is necessary to make it work and what is just there to make it look nice and that's why they're having so many problems with editing the bundled index.php or b2.php. |
|
Back to top |
|
 |
maka
Joined: 09 May 2002 Posts: 4 Location: Oklahoma
|
Posted: Thu May 09, 2002 4:49 am Post subject: i tried this but... |
|
|
hey, i tried this, but i'm still getting the default boring page! i wanted to make my blog match the rest of my website...what did i do wrong???
here's my b2.php:
Code: | <?php /* Don't remove this line, it calls the b2 function files ! */ $blog=1; include ("blog.header.php"); ?>
<html>
<head>
<title></title>
</head>
<body background="b2-img/background.jpg" bgcolor="#BFE7FF">
<p align="center"><img border="0" src="b2-img/my_journal_banner.gif" width="600" height="60"></p>
<p align="center"><a href="../all_about_me.htm"><img border="0" src="b2-img/backbutton.gif" width="100" height="20"></a><a href="http://www.maka.net/maka/"><img border="0" src="b2-img/homebutton.gif" width="100" height="20"></a><a href="../my_poetry.htm"><img border="0" src="b2-img/nextbutton.gif" width="100" height="20"></a></p>
<p align="center"> </p>
<!-- // b2 loop start -->
<?php while($row = mysql_fetch_object($result)) { start_b2(); ?>
<?php the_date("d.m.y","<h1>","</h1>"); ?>
<p>
<?php permalink_anchor(); ?>
<strong><?php the_title(); ?></strong> (category: <strong><?php the_category() ?></strong>)<br />
<?php the_content(); ?><?php link_pages("<br />Pages: ","<br />","number") ?>
<br />
<em>posted by <strong><?php the_author() ?></strong> @ <a href="<?php permalink_link() ?>"><?php the_time() ?></a></em>
<br />
<a href="<?php comments_link() ?>"><?php comments_number("no comments", "1 comment", "% comments") ?></a>
</p>
<?php include ("b2comments.php"); ?>
<!-- // this is just the end of the motor - don't touch that line either -->
<?php } ?>
<p align="center"> </p>
<h3 align="center"><font color="#000099"><em><small><font face="Comic Sans MS">The
family behind <FONT="COMIC Sans MS? size="2">
Maka.Net is a</font></small> <font face="Comic Sans MS"><small>stay-at-home mom
and two beautiful homeschooled boys. If you believe in stay-at-home parents and
want to help us stay together, you can bid on our <a href="http://www.maka.net/auctions/">auctions</a>,
purchase a <a href="http://www.maka.net/psychic/howtoget.htm">psychic reading</a>,
or <a href="https://www.paypal.com/xclick/business=ebay%2540maka.net">make a
donation</a>.</small></font></em></font></h3>
<!-- STARTING OF V3EXCHANGE.COM BANNER CODE -->
<center><script LANGUAGE="JavaScript">
<!-- Hide script contents from old browsers.
var random_v3exchange_stamp = Math.floor(Math.random() * 1000000000);
document.write('<A HREF="http://ads.v3exchange.com/clickme?469810:88811:' + random_v3exchange_stamp + '"' + ' target="_top">');
document.write('<IMG SRC="http://ads.v3exchange.com/showme?469810:88811:' + random_v3exchange_stamp + '"' + ' WIDTH=468 height=60 border=0 HSPACE=0 VSPACE=0 ALT="Part of the v3exchange.com network!"><br>');
document.write('</A>');
document.write('<a href="http://www.v3exchange.com" target="_top">');
document.write('<img src="http://www.v3exchange.com/img/menu.gif" width=468 height=16 border=0 hspace=0 vspace=0></a>');
// End hiding here -->
</script>
<NOSCRIPT>
<a HREF="http://ads.v3exchange.com/clickme?469810:88811:0" target="_top">
<p><img SRC="http://ads.v3exchange.com/showme?469810:88811:0" border="0" HSPACE="0" VSPACE="0" ALT="Part of the v3exchange.com network!"><br>
</a><a href="http://www.v3exchange.com" target="_top"><img src="http://www.v3exchange.com/img/menu.gif" border="0" hspace="0" vspace="0" width="468" height="16"></a>
</NOSCRIPT>
</center> <!-- END OF V3EXCHANGE.COM BANNER CODE -->
<p align="center"> </p>
</body>
</html>
|
and the blog is at http://www.maka.net/maka/blog/ _________________ Love & Light....
Maka, single stay-at-home bad-ass crunchy mama
to Daystar (fsbc 6/23/91),
to Griffin (uhb 7/11/99),
and to many other babies never held in arms! |
|
Back to top |
|
 |
nessahead
Joined: 12 Mar 2002 Posts: 312 Location: Los Angeles, CA
|
|
Back to top |
|
 |
WhizzZ
Joined: 22 May 2002 Posts: 2
|
Posted: Fri May 24, 2002 12:18 pm Post subject: help :) |
|
|
i've got this error ...
Warning: Supplied argument is not a valid MySQL result resource in /usr/home/usfclan/public_html/index.php on line 60
:cry:
why??
<?php while($row = mysql_fetch_object($result)) { start_b2(); ?>
<font face="Verdana" style="font-size: 7pt"><b>
<?php the_date() ?><br>
<?php the_title() ?></b> - <?php the_time() ?> by <a href="mailto:<?php the_author_email() ?>">
<?php the_author() ?></a> - <a href="<?php comments_link() ?>">
<?php comments_number("0 comments","1 comment","% comments") ?></a>
</font><br>
<font face="Verdana" size="1">
<?php the_content() ?>
<p>
<?php include("news/b2comments.php") ?> </p></font>
<?php } ?>
http://hp.bubix.net/~usfclan/
Tks |
|
Back to top |
|
 |
nessahead
Joined: 12 Mar 2002 Posts: 312 Location: Los Angeles, CA
|
Posted: Fri May 24, 2002 8:33 pm Post subject: |
|
|
Did you fix it? I don't see that error on your page  _________________ raar! |
|
Back to top |
|
 |
M@2T
Joined: 23 Apr 2002 Posts: 63 Location: England
|
Posted: Mon May 27, 2002 10:39 pm Post subject: |
|
|
Hey there (again) :)
Used your little sweet way of using b2, I used the php include before, but I thought it was about time i used it correctly.
Although im still having the same little anoying problem as before, for some reason each part of the b2 stuff seems to be put on it's own line!
Even "@" symbols etc.
I copied the code that you gave so its the same, it's strange because this is exactly what happens when I use the php include also.
(although I did add in the style info, although when this style it used on a normal page it works fine, all on one line etc.
It's been temp uploaded here.
http://www.akf.34sp.com/b2index.php
Maybe some1 could give me a hand? many thanx!
----------------
Edit, humz thats strange, uploaded it with out the pics, and now the spaces are no so many. Hold that thought a while! cheers.
--- |
|
Back to top |
|
 |
haley.k
Joined: 27 Jun 2002 Posts: 8
|
Posted: Fri Jul 19, 2002 6:03 am Post subject: |
|
|
I tried this and this is what I got where my blog should be:
","
"); ?>
(category: )
Pages: ","
","number") ?>
posted by @
|
|
Back to top |
|
 |
nessahead
Joined: 12 Mar 2002 Posts: 312 Location: Los Angeles, CA
|
Posted: Fri Jul 19, 2002 7:05 am Post subject: |
|
|
Make sure the file you're using ends with .php (not .html) _________________ raar! |
|
Back to top |
|
 |
haley.k
Joined: 27 Jun 2002 Posts: 8
|
Posted: Fri Jul 19, 2002 3:24 pm Post subject: |
|
|
I got this:
Warning: Failed opening 'blog.header.php' for inclusion (include_path='.:/usr/local/apacheD/php/lib/php') in /home/haleybop/public_html/index.php on line 3
Warning: Supplied argument is not a valid MySQL result resource in /home/haleybop/public_html/index.php on line 66
I'm positive that I've uploaded everything and did everything else right. |
|
Back to top |
|
 |
nessahead
Joined: 12 Mar 2002 Posts: 312 Location: Los Angeles, CA
|
Posted: Fri Jul 19, 2002 5:09 pm Post subject: |
|
|
Sorry, I don't know what that message means
Maybe you could do a search in the "Bugs" or "How To" section? _________________ raar! |
|
Back to top |
|
 |
haley.k
Joined: 27 Jun 2002 Posts: 8
|
Posted: Thu Jul 25, 2002 5:46 pm Post subject: |
|
|
I've got it working in a table now, but now the absolute positioning for the other things on the page won't work. :[ Know how I could fix it?
http://nerakyelah.org/journal/index2.php |
|
Back to top |
|
 |
epolady
Joined: 30 Jul 2002 Posts: 800 Location: Texas
|
Posted: Tue Jul 30, 2002 6:37 pm Post subject: |
|
|
issue resolved.
Last edited by epolady on Wed Oct 29, 2003 6:59 pm; edited 1 time in total |
|
Back to top |
|
 |
Fleshmaker
Joined: 20 Aug 2002 Posts: 2
|
Posted: Tue Aug 20, 2002 9:47 pm Post subject: |
|
|
Ok, I did exactly what was said to do, and everything works perfectly fine. But I liked having my comments in the pop-up window. Do you think you can instruct me how to get this working again?
I'd greatly appreciate it  |
|
Back to top |
|
 |
Cyberian75
Joined: 26 Sep 2002 Posts: 1285 Location: Oregon
|
Posted: Fri Oct 04, 2002 7:36 pm Post subject: |
|
|
In any circumstance, you should not delete:
Code: | <?php /* Don't remove this line, it calls the b2 function files ! */ $blog=1; include ("blog.header.php"); ?> |
The include "blog.header.php" makes b2 work. Also, if you get an error message "unable to find blog.heade.php for inclusion", that means you configured b2config.php wrong--especially siteurl and serverpath. Furthermore, the file index.php or b2.php should be within the directory where b2 is installed. _________________ Michael P.
 |
|
Back to top |
|
 |
Cyberian75
Joined: 26 Sep 2002 Posts: 1285 Location: Oregon
|
Posted: Fri Oct 04, 2002 7:44 pm Post subject: |
|
|
Fleshmaker,
Refer to b2.php file if you haven't modified it and copy over php statements that start with b2comments. _________________ Michael P.
 |
|
Back to top |
|
 |
|