After I saw Lightbox in action, I wanted to include this. I soon found a website that had the plugin for PHP-Nuke (here), but I had to pay to download the files, I hate that.
So I tried this myself, and it wasn't that difficult. Demo picture of my cat, just click it:



Tested on 7.9 and 8.0 , so this should work for you too.

See Read More for the details.

Simple steps to add Lightbox to PHPNuke:

  • download Lightbox

  • copy the files to your html-directory:
    /css to /css (new directory)
    /js to /js (new directory)
    the contents of /images to /images

 

  • edit header.php to include files

    (bold part is new, your file may be a little different as it may be another version of PHP-Nuke)




    include("includes/meta.php");
    include("includes/javascript.php");
    echo "<script type=\"text/javascript\" src=\"js/prototype.js\"></script>
     <script type=\"text/javascript\" src=\"js/scriptaculous.js?load=effects,builder\"></script>
     <script type=\"text/javascript\" src=\"js/lightbox.js\"></script>\n";


    if (file_exists("themes/$ThemeSel/images/favicon.ico")) {
    echo "<link REL=\"shortcut icon\" HREF=\"themes/$ThemeSel/images/favicon.ico\" TYPE=\"image/x-icon\">\n";
    }
    echo "<link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS\" href=\"backend.php\">\n";
    echo "<LINK REL=\"StyleSheet\" HREF=\"themes/$ThemeSel/style/style.css\" TYPE=\"text/css\">\n\n\n";
    if (file_exists("includes/custom_files/custom_head.php")) {
    include_once("includes/custom_files/custom_head.php");
    }
    echo "\n\n\n</head>\n\n";
    if (file_exists("includes/custom_files/custom_header.php")) {
    include_once("includes/custom_files/custom_header.php");
    }
    echo "<LINK REL=\"StyleSheet\" HREF=\"css/lightbox.css\" TYPE=\"text/css\">\n\n";
    themeheader();

  • edit mainfile.php

  • Original filter for anchor-tag commented out and replaced

    Borrowed from karakas-online.de


    function check_html ($str, $strip="") {
    /* The core of this code has been lifted from phpslash */
    /* which is licenced under the GPL. */
    include("config.php");
    if ($strip == "nohtml")
    $AllowableHTML=array('');
    $str = stripslashes($str); $str = eregi_replace("<[[:space:]]*([^>]*)[[:space:]]*>",'<\\1>', $str);
    // Delete all spaces from html tags .

    // change tag-filtering for anchors
    // $str = eregi_replace("<a[^>]*href[[:space:]]*=[[:space:]]*\"?[[:space:]]*([^\" >]*)[[:space:]]*\"?[^>]*>",'<a href="/\\1">', $str);
    // Delete all attribs from Anchor, except an href, double quoted.

    $htmlAttributes = array("charset",
    "coords",
    "hreflang",
    "rev",
    "shape",
    "type",
    "class",
    "style",
    "dir",
    "lang",
    "xml:lang",
    "tabindex",
    "accesskey",
    "onfocus",
    "onblur",
    "onclick",
    "ondblclick",
    "onmousedown",
    "onmouseup",
    "onmouseover",
    "onmousemove",
    "onmouseout",
    "onkeypress",
    "onkeydown",
    "onkeyup"
    );


    foreach ($htmlAttributes as $attrib) {
    $searchString =
    $attrib."[[:space:]]*=[[:space:]]*\"[^\"]*\"";
    $str = eregi_replace($searchString, '', $str);
    $searchString = $attrib."[[:space:]]*=[[:space:]]*'[^']*'";
    $str = eregi_replace($searchString, '', $str);
    $searchString = $attrib."[[:space:]]*=[[:space:]]*[^ ]*[[:space:]]";
    $str = eregi_replace($searchString, '', $str);
    }
  • edit config.php to allow images in stories


  • One line changed, added img to the allowable tags.

    Borrowed from karakas-online.de

    $AllowableHTML = array("b"=>1,"i"=>1,"strike"=>1,"div"=>2,"u"=>1,"a"=>2,"em"=>1,"br"=>1,"strong"=>1,"blockquote"=>1,"tt"=>1,"li"=>1,"ol"=>1,"ul"=>1);
    $CensorList = array

    $AllowableHTML = array("img"=>2,"b"=>1,"i"=>1,"strike"=>1,"div"=>2,"u"=>1,"a"=>2,"em"=>1,"br"=>1,"strong"=>1,"blockquote"=>1,"tt"=>1,"li"=>1,"ol"=>1,"ul"=>1);
    $CensorList = array