[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

severnet
Registered User
Posts: 14
Joined: Mon Jul 10, 2006 10:36 pm
Location: Saint-Petersburg, Russia
Contact:

Post by severnet »

1. What is the SE Friendly Board mod? Can you link me to this mod?

http://www.phpbbguru.net/community/download.php?id=129
2. Post your complete page_tail.php code and page_header.php code.

http://slil.ru/23064959
moodgard
Registered User
Posts: 316
Joined: Sun Feb 08, 2004 8:05 pm

Post by moodgard »

Open page_header_printer.php

Code: Select all

FIND:

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


AFTER, ADD:

Code: Select all

// [begin] SE Friendly Board mod
function replace_mod_rewrite($s)
{
	$url_in = array(
		// Don't want 2 pages with simular content 		
		"'(?<!/)viewforum.php\?f=([0-9]+)&topicdays=([0-9]+)&start=0'",
		// Basic forum pagination link
		"'(?<!/)viewforum.php\?f=([0-9]+)&topicdays=([0-9]+)&start=([0-9]+)'",
		// Basic forum link
		"'(?<!/)viewforum.php\?f=([0-9]+)'",

		// Don't want 2 pages with simular content
		"'(?<!/)viewtopic.php\?t=([0-9]+)&postdays=([0-9]+)&postorder=([a-zA-Z]+)&start=0'",
		// Basic topic pagination link
		"'(?<!/)viewtopic.php\?t=([0-9]+)&postdays=([0-9]+)&postorder=([a-zA-Z]+)&start=([0-9]+)'",
		// 2 pages again
		"'(?<!/)viewtopic.php\?t=([0-9]+)&start=0&postdays=([0-9]+)&postorder=([a-zA-Z]+)&highlight=([a-zA-Z0-9%+]*)'",
		// Topic link at the top of the page
		"'(?<!/)viewtopic.php\?t=([0-9]+)&start=([0-9]+)&postdays=([0-9]+)&postorder=([a-zA-Z]+)&highlight=([a-zA-Z0-9%+]*)'",
		// 2 pages again
		"'(?<!/)viewtopic.php\?t=([0-9]+)&start=0'",
		// Topic pagination at forum view
		"'(?<!/)viewtopic.php\?t=([0-9]+)&start=([0-9]+)'",
		// Topic links from search
		"'(?<!/)viewtopic.php\?t=([0-9]+)&highlight=([a-zA-Z0-9%+]*)'",
		// Basic topic link
		"'(?<!/)viewtopic.php\?t=([0-9]+)'",

		// Basic post link
		"'(?<!/)viewtopic.php\?p=([0-9]+)'"
	);

	$url_out = array(
		'forum$1.html',
		'forum$1-$3.html',
		'forum$1.html',
		'topic$1.html',
		'topic$1-$4.html',
		'topic$1.html',
		'topic$1-$2.html',
		'topic$1.html',
		'topic$1-$2.html',
		'topic$1.html',
		'topic$1.html',
		'post$1.html'
	);

	$s = preg_replace($url_in, $url_out, $s);

	// Processing invalid links
	$s = str_replace('.html&', '.html?', $s);
	$s = str_replace('.html&', '.html?', $s);

	return $s;
}
Save & Close files and check it out.
severnet
Registered User
Posts: 14
Joined: Mon Jul 10, 2006 10:36 pm
Location: Saint-Petersburg, Russia
Contact:

Post by severnet »

moodgard
Registered User
Posts: 316
Joined: Sun Feb 08, 2004 8:05 pm

Post by moodgard »

This is what I see - an error message:

http://s110.photobucket.com/albums/n94/ ... h=imgAnch1


Did you say it works if you set GZip off?
severnet
Registered User
Posts: 14
Joined: Mon Jul 10, 2006 10:36 pm
Location: Saint-Petersburg, Russia
Contact:

Post by severnet »

moodgard, look it once again (now with your fix). :wink:
Did you say it works if you set GZip off?

Yep. :(
User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Post by igorw »

"replace_mod_rewrite()", this looks like some URL manipulation MOD :)
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three
severnet
Registered User
Posts: 14
Joined: Mon Jul 10, 2006 10:36 pm
Location: Saint-Petersburg, Russia
Contact:

Post by severnet »

eviL<3 wrote: "replace_mod_rewrite()", this looks like some URL manipulation MOD :)

http://freestudents.ru/forum/forum1.html (for guests) = http://freestudents.ru/forum/viewforum.php?f=1 (for users)
moodgard
Registered User
Posts: 316
Joined: Sun Feb 08, 2004 8:05 pm

Post by moodgard »

severnet wrote: moodgard, look it once again (now with your fix). :wink:


Looks good to me:

http://s110.photobucket.com/albums/n94/ ... h=imgAnch2

http://s110.photobucket.com/albums/n94/ ... h=imgAnch1

There's a Divide by Zero on bottom of the page, you can eliminate that by changing this code in page_tail.php ; honestly there's too much going on with your mods!

Code: Select all

FIND: 
    $gzip_stats = round( strlen($compress) / strlen($uncompress) * 100);

Code: Select all

REPLACE WITH:

   if (strlen($uncompress) == 0){
      $gzip_stats=0;
     }
   else {
    $gzip_stats = round( strlen($compress) / strlen($uncompress) * 100);
    }
artiprinted
Registered User
Posts: 52
Joined: Wed Aug 09, 2006 1:11 pm

Not compatible with Quick Reply

Post by artiprinted »

When you click the printer button you get,
Template->loadfile(): No file specified for handle qrbody
severnet
Registered User
Posts: 14
Joined: Mon Jul 10, 2006 10:36 pm
Location: Saint-Petersburg, Russia
Contact:

Post by severnet »

Template->loadfile(): No file specified for handle qrbody

What will you recommend me? :?:
Officeforum
Registered User
Posts: 6
Joined: Fri Jul 28, 2006 5:39 pm

Post by Officeforum »

Hi all, :lol:

Is there anybody arround running CH 2.1.6 Hierarchy mod by phirtiik with the easyprintmod installed?

I tried to alter the code to get it up but I'm getting no where. It would be great if it has allready been done by a more knowledgable person.

Thanks. :wink:
Officeforum
Registered User
Posts: 6
Joined: Fri Jul 28, 2006 5:39 pm

Post by Officeforum »

Hi Guys, :D

Could that be that there is nobody using this mod in combination with CH 2.1.6 by phirtiik? :wink:
severnet
Registered User
Posts: 14
Joined: Mon Jul 10, 2006 10:36 pm
Location: Saint-Petersburg, Russia
Contact:

Post by severnet »

Warning: Cannot modify header information - headers already sent by (output started at /home/www/freestudents/htdocs/forum/includes/page_tail.php:145) in /home/www/freestudents/htdocs/forum/includes/page_tail.php on line 182

Warning: Cannot modify header information - headers already sent by (output started at /home/www/freestudents/htdocs/forum/includes/page_tail.php:145) in /home/www/freestudents/htdocs/forum/includes/page_tail.php on line 182

Warning: Division by zero in /home/www/freestudents/htdocs/forum/includes/page_tail.php on line 197
saaiberke
Registered User
Posts: 1126
Joined: Wed Jul 20, 2005 8:13 am
Location: Gent/Belgium
Contact:

Post by saaiberke »

Great mod! I installed it a few weeks ago. My users are very happy with it, they are even so happy they ask me the same for the private messages. Is there any way to have a print button in their private message section?

Grtz,

Nic
kdtcat
Registered User
Posts: 8
Joined: Tue Nov 22, 2005 1:32 pm
Location: Wiesbaden, Germany

Post by kdtcat »

Hi folks,

is there an easy hack to restrict print function for logged in Users only?

Klaus
have a nice day
Post Reply

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