boardom Forum Index boardom
b2 message board
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Print Blog?
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    boardom Forum Index -> How to ?
View previous topic :: View next topic  
Author Message
MiniSizeIt



Joined: 02 Nov 2002
Posts: 70

PostPosted: Tue Nov 19, 2002 3:29 am    Post subject: Print Blog? Reply with quote

Is there an easy way to print entries? My entire blog is a journal. So each day I post about a page or so for that day. I basically just need a basic thing that allows me to have the Date and Title, when it was posted, and who it was posted by. It can be in basic text, doesn't need to be fancy. But is there any way I can do this? Would there be an easy way to create a print script that just takes everyday and shows the title, date, and post?

I was thinking of being able to pull the variables such as author and date and such as the template as it, but would there be an easy way to do it?

Thanks!
Back to top
View user's profile Send private message
GamerZ



Joined: 15 May 2002
Posts: 537
Location: Singapore

PostPosted: Tue Nov 19, 2002 7:25 am    Post subject: Reply with quote

something like tt ?
http://www.orientek.net/kore/gamerz/b2print.php?p=208
_________________

++ GamerZ.Per.Sg - Complex Simplicity
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
MiniSizeIt



Joined: 02 Nov 2002
Posts: 70

PostPosted: Tue Nov 19, 2002 12:54 pm    Post subject: Reply with quote

Yes, that looks like what I need.
Back to top
View user's profile Send private message
GamerZ



Joined: 15 May 2002
Posts: 537
Location: Singapore

PostPosted: Tue Nov 19, 2002 2:16 pm    Post subject: Reply with quote

here is the code from my site, feel free to modify it
[php:1:b94d5113fc]
<?
include ("b2config.php");
$db=mysql_connect($dbhost,$dbusername,$dbpassword) or die("Can not connect to the database");
mysql_select_db($dbname) or die("Can not to select the database");
$result = mysql_query("SELECT * FROM $tableusers, $tableposts, $tablecategories WHERE $tableposts.post_category = $tablecategories.cat_ID AND $tableposts.post_author = $tableusers.ID AND $tableposts.ID=$p",$db);
$myrow = mysql_fetch_array($result);
?>
<title>----------// |G|amerZ |P|ersonal |H|omepage --- [ Blogs » Print » <? echo $myrow[post_title] ?>]</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<center><font face="Verdana" size="3" color="#000000"><b>- GamerZ Personal Homepage - http://www.gamerz.per.sg -</b></font></center>
<table bgcolor="#000000" align="center" width="700" border="0" cellspacing="1" cellpadding="0">
<tr>
<td bgcolor="#FFFFFF">
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td>
<?
echo "<font face=\"Verdana\" size=\"3\" color=\"#000000\"><b>$myrow[post_title]</b></font><br>";
// Author Stuffs
$title = $myrow[post_title];
$cat = $myrow[cat_name];
$author = $myrow[user_nickname];
// Date Stuffs
$mydate = $myrow[post_date];
$mydateArray = explode("-", $mydate);
$dayhour = explode(" ", $mydateArray[2]);


echo "<font face=\"Verdana\" size=\"2\" color=\"#000000\">Posted by <b>".$author."</b> on ";
echo "<b>$dayhour[0].$mydateArray[1].$mydateArray[0]</b> @ <b>$dayhour[1]</b> in ";
echo "<b>".$cat."</b></font><br><br>";
$body = preg_replace("[\x5c\]","",$myrow[post_content]);
echo "<font face=\"Verdana\" size=\"2\" color=\"#000000\">".$body."</font>";
?>
<div align="left"><br><br><font face="Verdana" size="2" color="#000000">Article printed from GamerZ Personal Homepage : <b>http://www.gamerz.per.sg</b></font></div>
<div align="left"><font face="Verdana" size="2" color="#000000">Full article URL is : <b>http://www.orientek.net/kore/gamerz/?p=<? echo $p ?></b></font></div>
<div align="right"><br><br><font face="Verdana" size="2" color="#000000">Click <a href="javascript:window.print();">here</a> to print</font></div>
</td>
</tr>
</table>
</td>
</tr>
</table>

</body>
</html>
[/php:1:b94d5113fc]
_________________

++ GamerZ.Per.Sg - Complex Simplicity
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
MiniSizeIt



Joined: 02 Nov 2002
Posts: 70

PostPosted: Tue Nov 19, 2002 10:01 pm    Post subject: Reply with quote

Looks good.

Few questions though. Is there anyway to use variables like I do in the template for b2, such as <?php the_time() ?> and <?php bloginfo('name'); ?>?

Also how would I link my journal to the b2print.php script? Maybe next to the comments or under it, I could have "Print This Entry", and it'd take me to the b2print.php.

Thanks.
Back to top
View user's profile Send private message
Tanner



Joined: 06 Jul 2002
Posts: 55
Location: Germany

PostPosted: Tue Nov 19, 2002 11:37 pm    Post subject: Reply with quote

After my last conversation with Gamer this morning, a way to use could be:

<option value="b2print.php?p=<?php the_ID() ?>">- Print This BLOG</option>

b2print.php is that file with that piece of code from gamer see above.
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
MiniSizeIt



Joined: 02 Nov 2002
Posts: 70

PostPosted: Wed Nov 20, 2002 3:21 am    Post subject: Reply with quote

Thanks tanner.

This is gonna be great, the only things I need fixed are easier ways to format the date and such, plus is there a way to convert the smilies into real graphics, and have it print the graphics?

Thanks guys!
Back to top
View user's profile Send private message
MiniSizeIt



Joined: 02 Nov 2002
Posts: 70

PostPosted: Sun Nov 24, 2002 6:11 am    Post subject: Reply with quote

Anyone? I'd like to include it on my Blog, it's just I can't format the date correctly. Since I'll be printing these for our own records, I'd like it working properly.
Back to top
View user's profile Send private message
MiniSizeIt



Joined: 02 Nov 2002
Posts: 70

PostPosted: Thu Dec 12, 2002 1:54 pm    Post subject: Reply with quote

Hmmmm, sorry, but I'd really like to edit this and need some quick help on formatting the time into 12 hour time, and date, and things like that. Any help?
Back to top
View user's profile Send private message
scrazynet11



Joined: 18 Nov 2002
Posts: 41
Location: Rio de Janeiro, Brazil

PostPosted: Fri Dec 13, 2002 12:49 am    Post subject: date format Reply with quote

humm, don´t know about the smilies,,, but what date format u want?
_________________
- Scrazynet
"To be or not to be, that´s the mothephuc**ing Question "
http://www.loukelicioso.net
Back to top
View user's profile Send private message Visit poster's website AIM Address
MiniSizeIt



Joined: 02 Nov 2002
Posts: 70

PostPosted: Fri Dec 13, 2002 6:17 am    Post subject: Reply with quote

I figured out how to make the date to be:
month/day/year

But I don't want it to be military time. Right now this is how it looks:
Quote:
Title of Post
Posted by Author on 11/13/2002 @ 19:23:28 in Category


Instead of 19:23, I want it to say 7:23 PM. And I also want the smilies I have to show up as graphics, and not the text for each smiley.

Thanks, I'd greatly appreciate any help.
Back to top
View user's profile Send private message
dtdgoomba



Joined: 05 Aug 2002
Posts: 179
Location: Cambridge, MA

PostPosted: Fri Dec 13, 2002 6:36 am    Post subject: Reply with quote

If you log in to your blog, go to options, you should see a list of all the php date/time variables you can use. From there, you'll get the link to php.net where there is more info on them. Yours probably has to do with putting an H instead of h.

if you call a date from a mysql statement and not a php statement, ie in a SELECT statement, the variables are different and listed on mysql.com in their docs.

I'm heading to bed but hopefully I'll have more time to look at the date array tomorrow and be more specific. I'm just trying to point in the right direction (hopefully) for now...

'nite
Back to top
View user's profile Send private message Visit poster's website
MiniSizeIt



Joined: 02 Nov 2002
Posts: 70

PostPosted: Sat Dec 14, 2002 4:55 pm    Post subject: Reply with quote

Thanks dtdgoomba... I don't really know PHP so I don't know where to start this out... But if you have any time to help me out more, I'd really appreciate it!
Back to top
View user's profile Send private message
MiniSizeIt



Joined: 02 Nov 2002
Posts: 70

PostPosted: Wed Dec 18, 2002 5:43 am    Post subject: Reply with quote

Anything?
Back to top
View user's profile Send private message
macshack



Joined: 17 Jul 2002
Posts: 1204
Location: Phoenix, Az

PostPosted: Thu Dec 19, 2002 1:20 am    Post subject: Reply with quote

Show us the code that is producing the output you want to have changed.

michael e
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    boardom Forum Index -> How to ? All times are GMT + 1 Hour
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
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


Powered by phpBB 2 © 2001, 2002 phpBB Group