[2.0.7] Printer-friendly topic mod

The cleanup is complete. This forum is now read only.

Rating:

Excellent!
48
45%
Very Good
26
25%
Good
11
10%
Fair
9
8%
Poor
12
11%
 
Total votes: 106

Cliff
Registered User
Posts: 79
Joined: Sat Jun 08, 2002 1:13 am
Location: Boston, MA

Post by Cliff » Thu Nov 13, 2003 4:20 am

Thanks for this mod.

I edited the symbols that were displayed on the mouse over for the printer button. I don't understand why they were symbols.

When the Printer Friendly page opens what are the three blocks that look like:

Image

Am I able to interact with these? If so, how can I add instructions? Also what exactly is the 0_o?

Thanks for the help!

Svyatozar
Registered User
Posts: 153
Joined: Fri Apr 12, 2002 5:38 am

Post by Svyatozar » Thu Nov 13, 2003 2:47 pm

Scottydog,
the end looks perfect. The error is somewere in the file. Probably it's a missing } somewhere. Looks like your error has to do with context.

Cliff:
You can use the fields in the top to select a range of messages to be printed.
The number in the first box corresponds to the number of the first message to be printed.
The number in the second box corresponds to the number of the last message to be printed.
If you look closely, each message has a number to the left. Put them in the boxes and hit the submit button which looks like tape recorder O_o
If you put a negative number in the second box, then it will indicate number of messages to print rather than last message in the range.

You can also add this info to your forum in the FAQ section. Eventually it will be done automatically.

Have fun!

Svyatozar
Registered User
Posts: 153
Joined: Fri Apr 12, 2002 5:38 am

Post by Svyatozar » Thu Nov 13, 2003 3:50 pm

For those who use odd themes: To fix problem with fonts, replace your includes/page_header_printer.php with this following file, which safely makes this mod theme-independent. I will include this new version of the file in the next release of the mod.

Code: Select all

<?php
/***************************************************************************
 *                           page_header_printer.php
 *                            -------------------
 *   begin                : Saturday, Feb 13, 2001
 *   copyright            : (C) 2001 The phpBB Group
 *   email                : support@phpbb.com
 *   modified             : (C) 2003 Svyatozar svyatozar@pochtamt.ru
 *                          for a new mod 'printer_topic'
 *
 *   page_header_printer.php,v 2.0 2003/11/13
 *
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

if ( !defined('IN_PHPBB') )
{
	die("Hacking attempt");
}

define('HEADER_INC', true);

//
// gzip_compression
//
$do_gzip_compress = FALSE;
if($board_config['gzip_compress'])
{
	$phpver = phpversion();

	if($phpver >= '4.0.4pl1')
	{
		if(extension_loaded('zlib'))
		{
			ob_start('ob_gzhandler');
		}
	}
	else if($phpver > '4.0')
	{
		if(strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip'))
		{
			if(extension_loaded('zlib'))
			{
				$do_gzip_compress = TRUE;
				ob_start();
				ob_implicit_flush(0);

				header('Content-Encoding: gzip');
			}
		}
	}
}

$template->set_filenames(array(
	'header' => 'printer_header.tpl')
);

// Format Timezone. We are unable to use array_pop here, because of PHP3 compatibility
$l_timezone = explode('.', $board_config['board_timezone']);
$l_timezone = (count($l_timezone) > 1 && $l_timezone[count($l_timezone)-1] != 0) ? $lang[sprintf('%.1f', $board_config['board_timezone'])] : $lang[number_format($board_config['board_timezone'])];
//
// The following assigns all _common_ variables that may be used at any point
// in a template. Note that all URL's should be wrapped in append_sid, as
// should all S_x_ACTIONS for forms.
//
$template->assign_vars(array(
	'SITENAME' => $board_config['sitename'],
	'PAGE_TITLE' => $page_title,

	'L_ADMIN' => $lang['Admin'], 
	'L_USERNAME' => $lang['Username'],
	'L_PASSWORD' => $lang['Password'],
	'L_INDEX' => $lang['Forum_Index'],
	'L_REGISTER' => $lang['Register'],
	'L_PROFILE' => $lang['Profile'],
	'L_SEARCH' => $lang['Search'],
	'L_PRIVATEMSGS' => $lang['Private_msgs'],
	'L_MEMBERLIST' => $lang['Memberlist'],
	'L_FAQ' => $lang['FAQ'],
	'L_USERGROUPS' => $lang['Usergroups'],
	'L_FORUM' => $lang['Forum'],
	'L_TOPICS' => $lang['Topics'],
	'L_REPLIES' => $lang['Replies'],
	'L_VIEWS' => $lang['Views'],
	'L_POSTS' => $lang['Posts'],
	'L_LASTPOST' => $lang['Last_Post'],
	'L_MODERATOR' => $lang['Moderator'],
	'L_NONEWPOSTS' => $lang['No_new_posts'],
	'L_NEWPOSTS' => $lang['New_posts'],
	'L_POSTED' => $lang['Posted'],
	'L_JOINED' => $lang['Joined'],
	'L_AUTHOR' => $lang['Author'],
	'L_MESSAGE' => $lang['Message'],
	'L_BY' => $lang['by'],

	'U_INDEX' => append_sid('index.'.$phpEx),

	'S_TIMEZONE' => sprintf($lang['All_times'], $l_timezone), 
	'S_LOGIN_ACTION' => append_sid('../login.'.$phpEx),
	'S_JUMPBOX_ACTION' => append_sid('../viewforum.'.$phpEx),
	'S_CURRENT_TIME' => sprintf($lang['Current_time'], create_date($board_config['default_dateformat'], time(), $board_config['board_timezone'])), 
	'S_CONTENT_DIRECTION' => $lang['DIRECTION'], 
	'S_CONTENT_ENCODING' => $lang['ENCODING'], 
	'S_CONTENT_DIR_LEFT' => $lang['LEFT'], 
	'S_CONTENT_DIR_RIGHT' => $lang['RIGHT'], 

	'T_HEAD_STYLESHEET' => $theme['head_stylesheet'],
	'T_BODY_BACKGROUND' => "",
	'T_BODY_BGCOLOR' => '#'."ffffff",
	'T_BODY_TEXT' => '#'."000000",
	'T_BODY_LINK' => '#'."000000",
	'T_BODY_VLINK' => '#'."000000",
	'T_BODY_ALINK' => '#'."000000",
	'T_BODY_HLINK' => '#'."000000",
	'T_TR_COLOR1' => '#'."ffffff",
	'T_TR_COLOR2' => '#'."ffffff",
	'T_TR_COLOR3' => '#'."ffffff",
	'T_TR_CLASS1' => "",
	'T_TR_CLASS2' => "",
	'T_TR_CLASS3' => "",
	'T_TH_COLOR1' => '#'."ffffff",
	'T_TH_COLOR2' => '#'."ffffff",
	'T_TH_COLOR3' => '#'."ffffff",
	'T_TH_CLASS1' => "",
	'T_TH_CLASS2' => "",
	'T_TH_CLASS3' => "",
	'T_TD_COLOR1' => '#'."ffffff",
	'T_TD_COLOR2' => '#'."ffffff",
	'T_TD_COLOR3' => '#'."ffffff",
	'T_TD_CLASS1' => "",
	'T_TD_CLASS2' => "",
	'T_TD_CLASS3' => "",
	'T_FONTFACE1' => "Verdana, Arial, Helvetica, sans-serif",
	'T_FONTFACE2' => "Trebuchet MS",
	'T_FONTFACE3' => "Courier, Courier New, sans-serif",
	'T_FONTSIZE1' => "10",
	'T_FONTSIZE2' => "11",
	'T_FONTSIZE3' => "12",
	'T_FONTCOLOR1' => '#'."444444",
	'T_FONTCOLOR2' => '#'."000000",
	'T_FONTCOLOR3' => '#'."000000",
	'T_SPAN_CLASS1' => "",
	'T_SPAN_CLASS2' => "",
	'T_SPAN_CLASS3' => "")
);


$template->pparse('header');

?>

User avatar
Partybuster
Registered User
Posts: 29
Joined: Wed Feb 05, 2003 10:11 pm

Post by Partybuster » Thu Nov 13, 2003 11:55 pm

Thanks, this new file makes this mod work great with my fiblue3d template

[]InTeR[]
Registered User
Posts: 1
Joined: Fri Nov 14, 2003 10:46 am

Auto print the print page...

Post by []InTeR[] » Fri Nov 14, 2003 10:51 am

Code: Select all

# 
#-----[ FIND ]------------------------------------------ 
# 

</head>

<body bgcolor="white" text="black" link="black" vlink="black">

# 
#-----[ REPLACE WITH ]------------------------------------------ 
#

<script language="JavaScript1.2">
<!--
  function doPrint(){
    this.print();
    history.go(-1);
  }
//-->
</script>
</head>

<body bgcolor="white" text="black" link="black" vlink="black" onLoad="doPrint();">

Don't know if anyone what to use this, but i do :)

Svyatozar
Registered User
Posts: 153
Joined: Fri Apr 12, 2002 5:38 am

Post by Svyatozar » Sun Nov 16, 2003 8:36 am

1.0.7 is out! Download ilink is my first message in this topic. Hopefully the mod database will get updated too.

- I added faq section
- all the bug fixed again
- fixed if {} stuff
- very stable now

This is the first truly stable release. Thanks for all the bug reports. I appreciate your help testing. I know that easymod does not do uninstall yet (am I up-to-date?), so I will provide update scripts in the future.

Have fun, everyone!

[]InTeR[]: I would not recommend doing that, since printing is done only after all the range / pagination adjustments are done. I would let the reader press the browser's printer button when ready.

Scottydog, I sent you a private message. Hope that solves the problem.

Zoombini: so you want all the boxes selected by default, right? I will think about how to do that. Thanks for the idea.

elfy
Registered User
Posts: 25
Joined: Sat Jan 05, 2002 5:42 am
Location: Poland

Post by elfy » Tue Nov 18, 2003 10:59 pm

I have 1.0.6 installed. Do you have some instruction for update from 1.06->1.0.7?
Will I have to do once again all steps from install.txt file?

Greetz

Svyatozar
Registered User
Posts: 153
Joined: Fri Apr 12, 2002 5:38 am

Post by Svyatozar » Wed Nov 19, 2003 12:41 am

Hello!

My answer is Yes, an update from 1.0.6 to 1.0.7 has to be done by hand by going through both install.txt scripts. In the future, I will consider including update scripts, but they will start with version 1.0.7.

Sorry for inconvenience. I am still learning.

All the best!
elfy wrote: I have 1.0.6 installed. Do you have some instruction for update from 1.06->1.0.7?
Will I have to do once again all steps from install.txt file?

Greetz

transitbus
Registered User
Posts: 410
Joined: Sat Sep 06, 2003 5:05 am

Post by transitbus » Wed Nov 19, 2003 7:52 am

Code: Select all

What is the :| |: button for
?!? Where is this button at?

Also putting -1 in the left box does this :
Warning: odbc_exec(): SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Line 8: Incorrect syntax near 'LIMIT'., SQL state 37000 in SQLExecDirect in D:\forum\db\mssql-odbc.php on line 117

Warning: Cannot modify header information - headers already sent by (output started at D:\forum\db\mssql-odbc.php:117) in D:\forum\includes\page_header.php on line 474

Warning: Cannot modify header information - headers already sent by (output started at D:\forum\db\mssql-odbc.php:117) in D:\forum\includes\page_header.php on line 476

Warning: Cannot modify header information - headers already sent by (output started at D:\forum\db\mssql-odbc.php:117) in D:\forum\includes\page_header.php on line 477
Thanks for proving my point...

Running -> Windows 2003 Standard sp1 :: MS-Sql Server 2000 sp4 :: IIS 6 :: php 4.4.0 isapi mode :: phpbb 2.0.16 <-

Svyatozar
Registered User
Posts: 153
Joined: Fri Apr 12, 2002 5:38 am

Post by Svyatozar » Wed Nov 19, 2003 4:28 pm

Button :| |: is in the top left corner of the printable output, and it is seen only when there is patination. If's purpose is to remove pagination.

I see no reason to put negative value into the left box. However, if you have an error even with values 1 1 for the two boxes, that's a bug. I have not tested this mod on Ms Sql, actually.

Good luck!

User avatar
Aahz
Registered User
Posts: 39
Joined: Sun Nov 02, 2003 9:44 pm
Location: ...Behind The Curtain
Contact:

Post by Aahz » Fri Nov 21, 2003 1:59 pm

There seems to be a conflict with netclectic's Today At/Yesterday At MOD here .

On all of my printable pages the date/time for every message states only "Today at" regardless of when the message was actually posted.

You can see the problem on my forums at http://forums.auraltradition.com

-Aahz
Last edited by Aahz on Fri Nov 21, 2003 2:05 pm, edited 1 time in total.

User avatar
Aahz
Registered User
Posts: 39
Joined: Sun Nov 02, 2003 9:44 pm
Location: ...Behind The Curtain
Contact:

Post by Aahz » Fri Nov 21, 2003 2:03 pm

BTW, I'm using phpBB 2.0.6 and version 1.0.7 of this MOD

-Aahz

Svyatozar
Registered User
Posts: 153
Joined: Fri Apr 12, 2002 5:38 am

Post by Svyatozar » Fri Nov 21, 2003 2:41 pm

Hello!

I could not find mod "Today at" on phpbb.com or on phpbbhacks.com
Can you drop me a download link please?

Regards

User avatar
Aahz
Registered User
Posts: 39
Joined: Sun Nov 02, 2003 9:44 pm
Location: ...Behind The Curtain
Contact:

Post by Aahz » Fri Nov 21, 2003 4:04 pm

Sorry, thought I'd included the link. It's at http://www.phpbb.com/phpBB/viewtopic.php?t=109399

-Aahz

User avatar
Mike Panic
Registered User
Posts: 61
Joined: Fri Feb 28, 2003 10:15 pm
Contact:

Post by Mike Panic » Sat Nov 22, 2003 7:22 am

installed on www.iphotoforum.com/forum/ w/ almost no problem other then a %s listed before the link back to the forum index on the printer pages... o well
MikePanic.com Online Photography Porfolio
iPhotoForum.com The Definitive Photography Community
GetTipsy.com FREE drink recipes & mixes!!
PimpMyCase.com Upload and vote on modded systems for FREE

Post Reply

Return to “[2.0.x] MOD Database Cleanup”