You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 136 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Collapse Blocks on phpnuke [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
Henrick
Private
Private


Joined: Jun 02, 2003
Posts: 35


PostPosted: Tue Jul 08, 2003 7:36 am Reply with quoteBack to top

Sorry if this is the wrong forum, but Im wondering if anyone has created an addon to be able to do this. PostNuke has some code for this, and I found the link below that allows you to be able to collapse blocks on a page. Im going to attempt to hack this into my site, but I wanted to ask if someone hasnt done this already for phpnuke.

http://www.baohx.com/Downloads+main.html - The code tip is under G-Blocks and the site has it, so you can see what Im talking about.

Thanks.
Find all posts by HenrickView user's profileSend private message
Djtale
Nuke Cadet
Nuke Cadet


Joined: Aug 01, 2003
Posts: 7


PostPosted: Fri Aug 01, 2003 1:16 am Reply with quoteBack to top

I'm using the collapsing block script of postnuke for phpnuke. But I can't save the configuration into a cookie.

If you need help I can help you to install the script but I need help to make the cookie working.

By the way, I'm using the DeepBlue theme.

Bye.
Find all posts by DjtaleView user's profileSend private message
djmaze
Captain
Captain


Joined: Nov 29, 2003
Posts: 566

Location: Netherlands

PostPosted: Tue Dec 16, 2003 7:13 pm Reply with quoteBack to top

Since i made the CPG language selector with Scott which stays on the current page and doesn't loop back to index.php here is what i wanna do:

Instead of using a cookie save the information in the nuke_users database, so it doesn't matter on which computer the member is logged.

This needs some bigtime coding and anonymous uses cookie so who would help me
Find all posts by djmazeView user's profileSend private messageVisit poster's website
abracadaver
Corporal
Corporal


Joined: Aug 29, 2003
Posts: 57

Location: Katy, TX

PostPosted: Tue Dec 16, 2003 7:53 pm Reply with quoteBack to top

New version of the free and commercial AutoTheme will have this built-in. Due out next week I hope.

-Shawn

_________________
Get the AutoTheme HTML Theme System HERE!
Find all posts by abracadaverView user's profileSend private messageVisit poster's website
djmaze
Captain
Captain


Joined: Nov 29, 2003
Posts: 566

Location: Netherlands

PostPosted: Wed Dec 17, 2003 1:14 pm Reply with quoteBack to top

abracadaver wrote:
free and commercial AutoTheme


i don't like that "commercial" part of it.
Since we all programming for free and put loads of time in it i don't think people would pay $19,95 or even more when you use code that is downloadable for free anywhere.

Let's put it freeware and if someone has a commercial site he has to pay since he is gaining money from site.

If not i keep programming untill i implemented it and free for download.
Just my donation to the Nuke community.

_________________
Famous people never give their signature Rolling Eyes
http://www.cpgnuke.com <- back online thanks to dedicatednow.com
Don't ask me to be admin on your site please Exclamation
Find all posts by djmazeView user's profileSend private messageVisit poster's website
abracadaver
Corporal
Corporal


Joined: Aug 29, 2003
Posts: 57

Location: Katy, TX

PostPosted: Wed Dec 17, 2003 4:33 pm Reply with quoteBack to top

Quote:
i don't like that "commercial" part of it.

Nobody's asking you to. That's why there is a Free GPL version. Very Happy

Quote:
i don't think people would pay $19,95 or even more when you use code that is downloadable for free anywhere.

I bet the hundreds and hundreds of AutoTheme purchasers are mystified Wink AutoTheme commercial version code is not downloadable from anywhere for free. Only the free version, and there are many more features in the commercial version than in the free one.

If you haven't used it, the Free GPL version is the premier theme solution that is multi-platform and has hundreds of themes in circulation. It's the best thing going, even for those who are familiar with PHP and PHP-Nuke themeing. It does many things that most Nuke themers don't know how to do, even with PHP, and this is all done with HTML and an admin interface.

There are so many that find the Free GPL version so great, that they purchase the commercial version. I haven't had any complaints. Smile

Thanks!
-Shawn

_________________
Get the AutoTheme HTML Theme System HERE!
Find all posts by abracadaverView user's profileSend private messageVisit poster's website
djmaze
Captain
Captain


Joined: Nov 29, 2003
Posts: 566

Location: Netherlands

PostPosted: Sun Dec 21, 2003 10:06 pm Reply with quoteBack to top

Ok collapse blocks working, see it on the coppermine homepage.
Soon the info how this can be implemented will be released.

Images can be setup themedepended.

_________________
Famous people never give their signature Rolling Eyes
http://www.cpgnuke.com <- back online thanks to dedicatednow.com
Don't ask me to be admin on your site please Exclamation
Find all posts by djmazeView user's profileSend private messageVisit poster's website
Henrick
Private
Private


Joined: Jun 02, 2003
Posts: 35


PostPosted: Tue Dec 23, 2003 2:16 pm Reply with quoteBack to top

Excellent.. This looks great djmaze
Find all posts by HenrickView user's profileSend private message
Djtale
Nuke Cadet
Nuke Cadet


Joined: Aug 01, 2003
Posts: 7


PostPosted: Tue Dec 23, 2003 3:04 pm Reply with quoteBack to top

Cool but each time you refresh the page blocks are
uncollapsed. There should be a cookie somewhere to keep the configuration of the page in memory.
Find all posts by DjtaleView user's profileSend private message
djmaze
Captain
Captain


Joined: Nov 29, 2003
Posts: 566

Location: Netherlands

PostPosted: Tue Dec 23, 2003 8:11 pm Reply with quoteBack to top

there is a cookie saved for each collapsed block but somehow the <body onload=> javascript doesn't work on some systems.

Could you tell me which browser you use djtale ?

_________________
Famous people never give their signature Rolling Eyes
http://www.cpgnuke.com <- back online thanks to dedicatednow.com
Don't ask me to be admin on your site please Exclamation
Find all posts by djmazeView user's profileSend private messageVisit poster's website
Djtale
Nuke Cadet
Nuke Cadet


Joined: Aug 01, 2003
Posts: 7


PostPosted: Wed Dec 24, 2003 4:00 am Reply with quoteBack to top

djmaze wrote:
there is a cookie saved for each collapsed block but somehow the <body onload=> javascript doesn't work on some systems.

Could you tell me which browser you use djtale ?
I'm using Iexplorer 6.0.2800
Find all posts by DjtaleView user's profileSend private message
Henrick
Private
Private


Joined: Jun 02, 2003
Posts: 35


PostPosted: Wed Dec 24, 2003 6:29 am Reply with quoteBack to top

The settings are holding for me just fine. IE 6.0.2800
Find all posts by HenrickView user's profileSend private message
djmaze
Captain
Captain


Joined: Nov 29, 2003
Posts: 566

Location: Netherlands

PostPosted: Wed Dec 24, 2003 9:58 am Reply with quoteBack to top

To change your theme and use this cool feature you have to do the following:

  1. Create file "includes/blockscript.js" and this content:
    Code:
    function GetCookie(name) {
      var arg=name+"=";
      var alen = arg.length;
      var clen = document.cookie.length;
      var i  = 0;
      while (i < clen) {
        var j = i + alen;
        if (document.cookie.substring(i,j) == arg)
          return getCookieVal (j);
        i = document.cookie.indexOf(" ", i) + 1;
        if (i == 0) break;
      }
    return null;
    }
    function getCookieVal (offset) {
       var endstr = document.cookie.indexOf (";", offset);
         if (endstr == 1)
           endstr = document.cookie.length;
         return unescape(document.cookie.substring(offset, endstr));
    }
    function SetCookie (name, value, expires) {
      var exp = new Date();
      var expiro = (exp.getTime() + (24 * 60 * 60 * 1000 * expires));
      exp.setTime(expiro);
      var expstr = "; expires=" + exp.toGMTString();
      document.cookie = name + "=" + escape(value) + expstr;
    }
    function DeleteCookie(name){
      if (GetCookie(name)) {
        document.cookie = name + "=" + "; expires = Thu, 01-Jan-70 00:00:01 GMT";
        }
    }
    blockarray = new Array();
    var blockarrayint = -1;
    var imagepath = "images/";
    function doblocks(imgpath) {
      if (imgpath != null) imagepath = imgpath;
      for (var q = 0; q < blockarray.length; q++) {
        xyzswitch(blockarray[q]);
      }
    }
    function xswitch(listID) {
        if(listID.style.display=="none") {
          listID.style.display="";
        } else {
          listID.style.display="none";
        }
    }
    function icoswitch(bid) {
      icoID = document.getElementById('pic'+bid);
      if(icoID.src.indexOf("minus") != -1) {
            icoID.src = imagepath+"plus.gif";
        SetCookie('block'+bid,'yes',365);
      } else {
        icoID.src = imagepath+"minus.gif";
        DeleteCookie('block'+bid);
      }
    }
    function xyzswitch(bid) {
        xswitch(document.getElementById('ph'+bid));
        xswitch(document.getElementById('pe'+bid));
        icoswitch(bid);
    }

  2. Open header.php and change
    Code:
    echo "<LINK REL=\"StyleSheet\" HREF=\"themes/$ThemeSel/style/style.css\" TYPE=\"text/css\">\n\n\n";
    into this
    Code:
    echo "<LINK REL=\"StyleSheet\" HREF=\"themes/$ThemeSel/style/style.css\" TYPE=\"text/css\">\n";
    echo "<script type=\"text/javascript\" src=\"includes/blockscript.js\"></script>\n\n";


  3. Open your phpnuke theme.php (for ex. "themes\Anagram\theme.php")

    • in file goto "function themeheader() {" and add the following to your <body> tag:
      Code:
      onLoad=\"doblocks('themes/Anagram/images/');\"

    • function themesidebox($title, $content) needs some more advanced editing
    • add just below "function themesidebox($title, $content) {"
      Code:
      $bid = str_replace(" ", "", $title);

    • add BEFORE or AFTER "$title":
      Code:
      ."<img id=\"pic$bid\" src=\"themes/Anagram/images/minus.gif\" onclick=\"xyzswitch('$bid');\">\n"
              ."<script language=\"JavaScript\" type=\"text/javascript\">\n<!--\n"
              ."var blockopen=GetCookie('block".$bid."'); \n"
              ."if (blockopen != null) {\n"
              ."  blockarrayint += 1;\n"
              ."  blockarray[blockarrayint] = \"".$bid."\";\n"
              ."}\n"
              ."//-->\n</script>\n"

    • add BEFORE $content:

      Code:
      ."<div id=\"pe$bid\" style=\"display:show;\">\n"

    • add AFTER $content:
      Code:
      ."</div>\n"
          ."<div id=\"ph$bid\" style=\"display:none;\"> </div>\n";


  4. create 2 images "minus.gif" and "plus.gif" to your themes "images" (themes/Anagram/images) directory.

Here's the Anagram theme example:
Code:
themeheader()
echo "<body bgcolor=\"#ffffff\" text=\"#000000\" onLoad=\"doblocks('themes/Anagram/images/');\">\n";

function themesidebox($title, $content) {
    $bid = str_replace(" ", "", $title);
    echo "<table border=\"0\" cellpadding=\"1\" cellspacing=\"0\" width=\"150\">\n"
    ."<tr><td>\n"

    ."<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" bgcolor=\"#EEEEEE\" width=\"100%\">\n"
    ."<tr><td align=left>"
    ."<img id=\"pic$bid\" src=\"themes/Anagram/images/minus.gif\" onclick=\"xyzswitch('$bid');\">\n"
        ."<script language=\"JavaScript\" type=\"text/javascript\">\n<!--\n"
        ."var blockopen=GetCookie('block".$bid."'); \n"
        ."if (blockopen != null) {\n"
        ."  blockarrayint += 1;\n"
        ."  blockarray[blockarrayint] = \"".$bid."\";\n"
        ."}\n"
        ."//-->\n</script>\n"
    ."<font class=\"content\" color=\"#363636\"><b>$title</b></font></td>\n"
    ."</tr>\n"
    ."</table>\n"

    ."</td>\n"
    ."</tr>\n"
    ."</table>\n"

    ."<div id=\"pe$bid\" style=\"display:show;\">\n"
    ."<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" width=\"150\">\n"
    ."<tr valign=\"top\"><td>\n"
    ."$content\n"
    ."</td></tr></table><br>\n"
    ."</div>\n"
    ."<div id=\"ph$bid\" style=\"display:none;\"> </div>\n";
}


Don't forget to change "themes/Anagram/" to your themepath!

Finally.... Good luck and have fun!

_________________
Famous people never give their signature Rolling Eyes
http://www.cpgnuke.com <- back online thanks to dedicatednow.com
Don't ask me to be admin on your site please Exclamation
Find all posts by djmazeView user's profileSend private messageVisit poster's website
Henrick
Private
Private


Joined: Jun 02, 2003
Posts: 35


PostPosted: Fri Dec 26, 2003 7:50 am Reply with quoteBack to top

This is just too cool.. Thanks for pulling this together.
Find all posts by HenrickView user's profileSend private message
cricker69
Nuke Soldier
Nuke Soldier


Joined: Oct 25, 2003
Posts: 19

Location: San Diego, CA

PostPosted: Wed Jan 07, 2004 11:54 pm Reply with quoteBack to top

DJMaze-
Bravo! Now that's good! I installed this in just a few minutes and it make such a huge difference in site presentation! Now, the members don't have to look at the blocks if they don't want to...

Thanks! I look forward to seeing what you come up with next.
-Cricker
Find all posts by cricker69View user's profileSend private messageVisit poster's websiteYahoo Messenger
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
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



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by TOGETHER TEAM srl ITALY http://www.togetherteam.it - DONDELEO E-COMMERCE http://www.DonDeLeo.com - TUTTISU E-COMMERCE http://www.tuttisu.it
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.765 Seconds - 84 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::