Select Expand BBCodes -vs- Printer Friendly MOD
 
 
Post new topic   Reply to topic   printer-friendly view    phpMiX.org Forum Index -> phpBB MODs -> Select Expand BBCodes
View previous topic :: View next topic  
Author Message
RvdH
Junior Member
Junior Member


Joined: 28 Dec 2004
Posts: 22
Location: The Netherlands

PostPosted: Wed Dec 29, 2004 12:40 am    Post subject: Re: Problem with Select Expand BBcodes MOD Reply with quote

Another thingy i just noticed here on your site (and on mine)...

Whenever someone presses the "print this page" button shouldn't all quotes and codes be expanded by default?

RvdH
 
Back to top
View user's profile Send private message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Wed Dec 29, 2004 4:32 pm    Post subject: Re: Select Expand BBCodes -vs- Printer Friendly MOD Reply with quote

RvdH wrote:
Whenever someone presses the "print this page" button shouldn't all quotes and codes be expanded by default?

Good one. Please, let me think about it.

I'll try to post here... as soon as I find a workaround...

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Wed Dec 29, 2004 6:11 pm    Post subject: Re: Select Expand BBCodes -vs- Printer Friendly MOD Reply with quote

Well, I have made a quick hack that is working now here. Use the printerFriendly button to see how it works.

Here it is:

Code:
#
# ---[ OPEN ]----------
#
templates/whatever/printer_header.tpl
#
# ---[ FIND ]----------
#
</head>
#
# ---[ BEFORE ADD ]----------
#
<script language="javascript" type="text/javascript">
<!--
var printerFriendlyModIsHere = true;
//-->
</script>
#
# ---[ SAVE ]----------
#


Code:
#
# ---[ OPEN ]----------
#
templates/select_expand_bbcodes.js
#
# ---[ FIND ]----------
#
_SXBB.prototype.genCmd = function(cmd, txt)
{
#
# ---[ AFTER ADD ]----------
#
   if( typeof(printerFriendlyModIsHere) != 'undefined' )
   {
      return '';
   }
#
# ---[ FIND ]----------
#
   for( var id in SXBB ) SXBB[id].resize(cmd);
#
# ---[ REPLACE WITH ]----------
#
   for( var id in SXBB )
   {
      SXBB[id].resize(cmd);
      if( typeof(printerFriendlyModIsHere) != 'undefined' )
      {
         var cmd = SXBB[id].T['expand'];
         setTimeout("SXBB['"+id+"'].resize('"+cmd+"');", 100);
      }
   }
#
# ---[ SAVE ]----------
#


Question

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
RvdH
Junior Member
Junior Member


Joined: 28 Dec 2004
Posts: 22
Location: The Netherlands

PostPosted: Wed Dec 29, 2004 6:14 pm    Post subject: Re: Select Expand BBCodes -vs- Printer Friendly MOD Reply with quote

Works, allthough it maybe better to completly disable "Contract"

mmm, don't seem to have a file called "printer_header.tpl"

only a file called "viewtopic_print.tpl"
If i insert your code in this file nothing happens

RvdH
 
Back to top
View user's profile Send private message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Wed Dec 29, 2004 6:22 pm    Post subject: Re: Select Expand BBCodes -vs- Printer Friendly MOD Reply with quote

ok, check the changes to select_expand_bbcodes.js.

I have edited my previous post. Wink

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
RvdH
Junior Member
Junior Member


Joined: 28 Dec 2004
Posts: 22
Location: The Netherlands

PostPosted: Wed Dec 29, 2004 6:37 pm    Post subject: Re: Select Expand BBCodes -vs- Printer Friendly MOD Reply with quote

ignore my previous message i edited...seems it works by editing "viewtopic_print.tpl"

only all code blocks are extracted by default (not only in the printpage)

here it doesn't...weird...guess i did something wrong in the *.js file

Issue still is there, followed your mods but still it shows extracted by default like: THIS

RvdH
 
Back to top
View user's profile Send private message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Wed Dec 29, 2004 6:48 pm    Post subject: Re: Select Expand BBCodes -vs- Printer Friendly MOD Reply with quote

This is probably a PN implementation issue. Razz

Open your viewtopic.php file. Can you see something like this?

Code:
if(isset($HTTP_GET_VARS['printertopic']))
{
   include($phpbb_root_path . 'includes/page_header_printer.'.$phpEx);
} else
{
   include($phpbb_root_path . 'includes/page_header.'.$phpEx);
}


I do, and my page_header_printer.php has this code:

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


The trick is define the printerFriendlyModIsHere variable before the code in select_expand_bbcodes.js is executed.

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
RvdH
Junior Member
Junior Member


Joined: 28 Dec 2004
Posts: 22
Location: The Netherlands

PostPosted: Wed Dec 29, 2004 6:58 pm    Post subject: Re: Select Expand BBCodes -vs- Printer Friendly MOD Reply with quote

Nothing like that in viewtopic,
But i have a printview.php ?
 
Back to top
View user's profile Send private message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Wed Dec 29, 2004 7:19 pm    Post subject: Re: Select Expand BBCodes -vs- Printer Friendly MOD Reply with quote

Yup! There's a little typo in your select_expand_bbcodes.js

Code:
_SXBB.prototype.genCmd = function(cmd, txt)
   if( typeof(printerFriendlyModIsHere) != 'undefined' )
   {
      return '';
   }
{
   return '&nbsp;&nbsp;<a class="genmed" style="text-decoration:none;" href="javascript:void(0)" onclick="SXBB[\''+this.id+'\'].'+cmd+'(\''+txt+'\');" onfocus="this.blur();"><b>'+txt+'</b></a>&nbsp;';
}


Should be:

Code:
_SXBB.prototype.genCmd = function(cmd, txt)
{
   if( typeof(printerFriendlyModIsHere) != 'undefined' )
   {
      return '';
   }
   return '&nbsp;&nbsp;<a class="genmed" style="text-decoration:none;" href="javascript:void(0)" onclick="SXBB[\''+this.id+'\'].'+cmd+'(\''+txt+'\');" onfocus="this.blur();"><b>'+txt+'</b></a>&nbsp;';
}

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
RvdH
Junior Member
Junior Member


Joined: 28 Dec 2004
Posts: 22
Location: The Netherlands

PostPosted: Wed Dec 29, 2004 7:32 pm    Post subject: Re: Select Expand BBCodes -vs- Printer Friendly MOD Reply with quote

Yes , that was causing it to not function...now it's working perfect!

Thanks 4 your help Smile


RvdH
 
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    phpMiX.org Forum Index -> phpBB MODs -> Select Expand BBCodes All times are GMT + 1 Hour
 
Page 1 of 1


 
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
You cannot attach files in this forum
You can download files in this forum