Page 1 of 1

Print Tag

Posted: Fri Oct 20, 2006 8:53 am
by brownrl
Hello All,

I made small change to the print tag ( function.print.php ). I was having issue using the tag when wanting to make a print of a news article and I would guess if using other modules as well. I would assume this more than likely doesn't work if you are using clean URLs...

Comment out near line 68 where you have:

#$page_url = $gCms->config['root_url'].'/index.php?'....

and put this below to rebuild the URL "better"?

Code: Select all

                foreach( $_GET as $k => $v )
                {
                        $page_url .= "&".$k."=".$v;
                }

                $page_url = ereg_replace( "^&" , "?" , $page_url );
                $page_url = $page_url . "&print=true";
For now I haven't thought about how safe this is or wether I reinvented the wheel. Can someone from CMS org take a look and let us know if this code is something that should or shouldn't be done.


Regards
Rob