View previous topic :: View next topic |
Author |
Message |
MiniSizeIt
Joined: 02 Nov 2002 Posts: 70
|
Posted: Tue Nov 19, 2002 3:29 am Post subject: Print Blog? |
|
|
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 |
|
 |
GamerZ
Joined: 15 May 2002 Posts: 537 Location: Singapore
|
|
Back to top |
|
 |
MiniSizeIt
Joined: 02 Nov 2002 Posts: 70
|
Posted: Tue Nov 19, 2002 12:54 pm Post subject: |
|
|
Yes, that looks like what I need. |
|
Back to top |
|
 |
GamerZ
Joined: 15 May 2002 Posts: 537 Location: Singapore
|
Posted: Tue Nov 19, 2002 2:16 pm Post subject: |
|
|
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 |
|
 |
MiniSizeIt
Joined: 02 Nov 2002 Posts: 70
|
Posted: Tue Nov 19, 2002 10:01 pm Post subject: |
|
|
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 |
|
 |
Tanner
Joined: 06 Jul 2002 Posts: 55 Location: Germany
|
Posted: Tue Nov 19, 2002 11:37 pm Post subject: |
|
|
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 |
|
 |
MiniSizeIt
Joined: 02 Nov 2002 Posts: 70
|
Posted: Wed Nov 20, 2002 3:21 am Post subject: |
|
|
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 |
|
 |
MiniSizeIt
Joined: 02 Nov 2002 Posts: 70
|
Posted: Sun Nov 24, 2002 6:11 am Post subject: |
|
|
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 |
|
 |
MiniSizeIt
Joined: 02 Nov 2002 Posts: 70
|
Posted: Thu Dec 12, 2002 1:54 pm Post subject: |
|
|
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 |
|
 |
scrazynet11
Joined: 18 Nov 2002 Posts: 41 Location: Rio de Janeiro, Brazil
|
Posted: Fri Dec 13, 2002 12:49 am Post subject: date format |
|
|
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 |
|
 |
MiniSizeIt
Joined: 02 Nov 2002 Posts: 70
|
Posted: Fri Dec 13, 2002 6:17 am Post subject: |
|
|
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 |
|
 |
dtdgoomba
Joined: 05 Aug 2002 Posts: 179 Location: Cambridge, MA
|
Posted: Fri Dec 13, 2002 6:36 am Post subject: |
|
|
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 |
|
 |
MiniSizeIt
Joined: 02 Nov 2002 Posts: 70
|
Posted: Sat Dec 14, 2002 4:55 pm Post subject: |
|
|
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 |
|
 |
MiniSizeIt
Joined: 02 Nov 2002 Posts: 70
|
Posted: Wed Dec 18, 2002 5:43 am Post subject: |
|
|
Anything? |
|
Back to top |
|
 |
macshack
Joined: 17 Jul 2002 Posts: 1204 Location: Phoenix, Az
|
Posted: Thu Dec 19, 2002 1:20 am Post subject: |
|
|
Show us the code that is producing the output you want to have changed.
michael e |
|
Back to top |
|
 |
|