Niko
  • Administrator

      Reputation : 319
      Registered on : 2012-02-22
      Posts : 2366
      School of codes courses: coming soon
    Print topics in your forum


    You can print topics in your forum :bene:

    Set up


    First add this script in your javascript panel (ACP)

    Code:

    function printit(){ 
    if (window.print) {
        window.print() ; 
    } else {
        var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
    document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
        WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box    WebBrowser1.outerHTML = ""; 
    }
    }

    Now, add this html code where you want.. For example in templates :Good:

    Code:
    <form><input type=button value="Print" name="Print" onClick="printit()"></form>
    You can also use this code to put it automatically
    Code:
    <script Language="Javascript"> 
    var NS = (navigator.appName == "Netscape");
    var VERSION = parseInt(navigator.appVersion);
    if (VERSION > 3) {
        document.write('<form><input type=button value="Print" name="Print" onClick="printit()"></form>');       
    }
    </script>

    Done :birra:

    Technical problems


    The tutorial was tested on this forum and with the browser Google Chrome; If you notice that the tutorial doesn't work for a browser or for a version of forum (PhpBB2, PhpBB3, PunBB, Invision) contact an administrator and we will fill this field with your reporting.

    Thanks, the staff
    For every problem or question please, contact us in the section Support for the tutorials, The staff will answer you as soon as it is possible...


    Friendly,
    The team of the Forum of Codes.



    Niko wants you in the team Guest

    Community manager and Administrator at Forumattivo.com

    MartinoPio
    • Veteran staff member

        Reputation : 14
        Registered on : 2012-02-25
        Posts : 98
      Cool Lighthouse 'a demo at my site;)

      Nick
      • Manager

          Reputation : 20
          Registered on : 2012-04-01
          Posts : 407
        This sounds really neat. I'll try it sometime soon. :)



        Print topics in your forum 15px10
        Nathan
        • Veteran staff member

            Reputation : 7
            Registered on : 2012-06-26
            Posts : 108
          any demo here?

          fascicularia
          • ****


              Reputation : 0
              Registered on : 2012-05-05
              Posts : 51
            script inutile vu que la fonction est déjà implantée. Si encore, il permettait d'imprimer un message spécifique...