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, 65 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
biersack
Nuke Cadet
Nuke Cadet


Joined: Dec 04, 2003
Posts: 5


PostPosted: Wed Feb 11, 2004 3:07 am Reply with quoteBack to top

There is a little problem (I test by your site cpg and it exist too) :

Test :
make the (module) block small and then reactualize (or change module).
it works...
make the same block big and reactualize (or change module), it will be always small..


(big=with content
small=only title)
thanks
Find all posts by biersackView user's profileSend private message
MikieMouse
Private
Private


Joined: Aug 15, 2003
Posts: 43

Location: Colorado, USA

PostPosted: Tue Feb 17, 2004 1:43 pm Reply with quoteBack to top

Okay, trying to piece together the various aspects of this hack from the forum but am unsuccessful. Is there a mod, or a set of instructions that I can download somewhere to implement this? I know I missed a key step or screwed something up cuz the test site I tried it on (www.ehpdesigns.com) now how no blocks listed...lol.

Any help would be great. Very Happy

_________________
I suffer from Janet Reno penis envy
Find all posts by MikieMouseView user's profileSend private messageVisit poster's websiteAIM Address
djmaze
Captain
Captain


Joined: Nov 29, 2003
Posts: 566

Location: Netherlands

PostPosted: Tue Feb 17, 2004 2:05 pm Reply with quoteBack to top

Since to much peeps have problems i will create a ZIP with all the parts and instructions.

_________________
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
MikieMouse
Private
Private


Joined: Aug 15, 2003
Posts: 43

Location: Colorado, USA

PostPosted: Tue Feb 17, 2004 2:25 pm Reply with quoteBack to top

Just downloaded the BETA for CPG Nuke from your site (which includes the instructions for the collapsable blocks...but you knew that...its your site...lol). Am in the process of uploading that over what was there to see how its working.

Then I'll see if I can incorporate it into other themes. Will also check out the zip file you make available just in case I screw up and miss a step (and that's bound to happen as I'm doing all this while at work).

I thank you for all the help you provide us. Smile

_________________
I suffer from Janet Reno penis envy
Find all posts by MikieMouseView user's profileSend private messageVisit poster's websiteAIM Address
Seventys
Sergeant
Sergeant


Joined: Aug 11, 2003
Posts: 78


PostPosted: Tue Feb 17, 2004 2:34 pm Reply with quoteBack to top

Here here ! Just love the option, love to be able to get it to work right......
Find all posts by SeventysView user's profileSend private message
MikieMouse
Private
Private


Joined: Aug 15, 2003
Posts: 43

Location: Colorado, USA

PostPosted: Wed Feb 18, 2004 8:41 am Reply with quoteBack to top

Any update on when that zip file will be available?

_________________
I suffer from Janet Reno penis envy
Find all posts by MikieMouseView user's profileSend private messageVisit poster's websiteAIM Address
shedrock
Nuke Soldier
Nuke Soldier


Joined: Aug 14, 2003
Posts: 19

Location: Canada

PostPosted: Sat Mar 06, 2004 5:31 pm Reply with quoteBack to top

Now that I have this block feature working on php-nuke. Can someone tell me why I had to make modifications to the blocks.php file, the news index file and soforth. Before I did all of it, I just changed 2 areas in the mainfile.php file, modified the theme.php file and added the script to the header.php file and it worked great. It is just driving me crazy not knowing what the results would be if I didn't add all the rest of changes to the other files as per the instructions in this thread.

Thanks for any advice here.
Shedrock

_________________
http://lorkan.com
Find all posts by shedrockView user's profileSend private messageSend e-mailVisit poster's websiteICQ Number
MikieMouse
Private
Private


Joined: Aug 15, 2003
Posts: 43

Location: Colorado, USA

PostPosted: Sat Mar 06, 2004 6:09 pm Reply with quoteBack to top

Shedrock, can you post the simple steps that you took that worked? I've attempted to sift through and run the steps in this thread and its just not taking. Any advise/hints/etc would be awesome!

_________________
I suffer from Janet Reno penis envy
Find all posts by MikieMouseView user's profileSend private messageVisit poster's websiteAIM Address
shedrock
Nuke Soldier
Nuke Soldier


Joined: Aug 14, 2003
Posts: 19

Location: Canada

PostPosted: Sat Mar 06, 2004 6:44 pm Reply with quoteBack to top

ok, all I did was the following:

First Step:
header.php file where i added this just below the favico.ico line:

Code:
echo "<script type=\"text/javascript\" src=\"includes/blockscript.js\"></script>\n";


Second Step:
Code:
mainfile.php:

function render_blocks($side, $blockfile, $title, $content, $bid, $url) {
if ($url == "") {
if ($blockfile == "") {
if ($side == "c" || $side == "d") {
themecenterbox($title, $content);
} else {
themesidebox($title, $content, $bid);
}
} else {
blockfileinc($title, $blockfile, ($side == "c" || $side == "d"), $bid);
}
} else {
headlines($bid,($side == "c" || $side == "d"));
}
}


then:

Code:
function blockfileinc($title, $blockfile, $side=0, $bid) {
$blockfiletitle = $title;
$file = @file("blocks/$blockfile");
if (!$file) {
$content = _BLOCKPROBLEM;
} else {
include("blocks/$blockfile");
}
if ($content == "") {
$content = _BLOCKPROBLEM2;
}
if ($side == 1) {
themecenterbox($blockfiletitle, $content);
} else {
themesidebox($blockfiletitle, $content, $bid);
}
}


Third Step:
theme.php

This is exactly how my body code is:
Code:
    echo "<body bgcolor=\"#848E5C\" text=\"#000000\" leftmargin=\"10\" topmargin=\"10\" marginwidth=\"10\" marginheight=\"10\">
<script language=\"JavaScript\" type=\"text/javascript\">
<!--
    imagepath = 'themes/Ambience/images/';
//-->
</script>";


next is the function themesidebox:

Code:
function themesidebox($title, $content, $bid=0) {
    $display[0] = "";
    $display[1] = "none";
    $display[2] = "themes/Ambience/images/minus.gif";
    if (isset($_COOKIE["block".$bid])) {
        if ($_COOKIE["block".$bid] == "yes") {
            //block is collapsed so hide it
            $display[0] = "none";
            $display[1] = "";
            $display[2] = "themes/Ambience/images/plus.gif";
        }
    }


then the rest of your code here, which in my case is:

Code:
echo"<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border:0px solid #9D9D9D; border-collapse: collapse\" bordercolor=\"#DCDCDC\" width=\"160\" id=\"AutoNumber2\" height=\"25\">"
  . "<tr><td background=\"themes/Network/forums/images/cellpic3.gif\" width=\"160\" height=\"25\">";
    echo "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"1\" border=\"0\"> <tr><td>\n";
    echo "</td>\n";
    echo "<td><b><font size=\"2\" color=\"#0B2943\"><img align=\"right\" alt=\"[x]\" title=\"Show/hide content\" id=\"pic$bid\" src=\"$display[2]\" onclick=\"xyzswitch('$bid');\" style=\"cursor:pointer\">&nbsp;&nbsp;$title</font></b></td>\n";
    echo "<td align=\"right\"></td></tr></table>\n";
    echo "</td></tr><tr><td align=\"center\" valign=\"top\">\n"
    ."<div id=\"pe$bid\" style=\"display:$display[0];\">\n";
    echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\" bgcolor=\"#9D9D9D\"><tr><td width=\"100%\">\n";
    echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"4\" bgcolor=\"#EFEFEF\"><tr><td width=\"100%\">\n";
    echo "$content\n";
    echo "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tr><td>\n";
    echo "<img src=\"themes/Ambience/images/pixel.gif\" width=\"1\" height=\"4\" alt=\"\" border=\"0\"></td></tr></table>\n";
    echo "</td></tr></table>\n";
    echo "</td></tr></table>\n"
    ."</div>\n"
    ."<div id=\"ph$bid\" style=\"display:$display[1];\"></div>\n";
    echo "</td></tr><tr>\n";
    echo "<td align=\"center\" valign=\"bottom\">\n";
    echo "</td></tr></table>\n";
    echo "<script language=\"JavaScript\" type=\"text/javascript\">
        <!--
        addblock('$bid');
        //-->
        </script><br>\n\n\n";
}
?>


NOTE: You have to add the rest of the changes to the other files, such as the News article.php file, the blocks.php file as the threads in here discussed. I however did not add anything else but what I have shown you here, at least not yet. But I have not run in to a problem yet.

Make sure you have the blockscript.js file located in your /includes/ directory. If you want to have a look at my local site. You can check it at:
http://mmon.no-ip.com:8081

You can also contact me via ICQ: 111408927

_________________
http://lorkan.com
Find all posts by shedrockView user's profileSend private messageSend e-mailVisit poster's websiteICQ Number
MikieMouse
Private
Private


Joined: Aug 15, 2003
Posts: 43

Location: Colorado, USA

PostPosted: Sun Mar 07, 2004 7:08 am Reply with quoteBack to top

Thank you so much...will follow those steps.

Went to your site (awesome by the way). But I did find that when I tested your blocks, that once I collapsed them and moved on to another page that there were numerous javascript errors and the blocks no longer expanded until I deleted my cookies. I use IE 6.0, not sure which browsers you've test it with.

_________________
I suffer from Janet Reno penis envy
Find all posts by MikieMouseView user's profileSend private messageVisit poster's websiteAIM Address
shedrock
Nuke Soldier
Nuke Soldier


Joined: Aug 14, 2003
Posts: 19

Location: Canada

PostPosted: Sun Mar 07, 2004 7:24 am Reply with quoteBack to top

That could have been because I was working on it probably while you were checking it out. I was trying to get it to work on another theme. I am currently using IE6 as well and checked it all of this morning and had no problems so far. I was also trying to get it to work with the postnuke method but the blocks don't stay close on a screen change. It woul dbe nice if we didn't have to modify the core files of php-nuke. This way anyone can apply this feature without any problems. Anyway, I'll keep trying to get it to function without the core modifications and if I do get it to work I'll post it in here.

If you need any help, please let me know.

Thanks
Shedrock

_________________
http://lorkan.com
Find all posts by shedrockView user's profileSend private messageSend e-mailVisit poster's websiteICQ Number
shedrock
Nuke Soldier
Nuke Soldier


Joined: Aug 14, 2003
Posts: 19

Location: Canada

PostPosted: Sun Mar 07, 2004 8:21 am Reply with quoteBack to top

What i have noticed is the following:

If i add: function adminblock($bid)
on my local site, it works great. If I add this function on my hosted site, it does not work and I get an error in the adminblock section. I memoved the $bid so it now looks like:
function adminblock() - Any ideas as to why this was a problem?

See it work here: http://lorkan.com

Thanks for any help here.
Shedrock Very Happy

_________________
http://lorkan.com

Last edited by shedrock on Thu May 27, 2004 5:06 pm; edited 1 time in total
Find all posts by shedrockView user's profileSend private messageSend e-mailVisit poster's websiteICQ Number
macros14
Nuke Soldier
Nuke Soldier


Joined: Feb 16, 2004
Posts: 28


PostPosted: Wed Mar 10, 2004 11:50 am Reply with quoteBack to top

For auto theme, like the theme AT-PMS, for the forums, how do you turn off the right blocks?? I am not exactly sure using auto theme
Find all posts by macros14View user's profileSend private message
Corduroy
Nuke Cadet
Nuke Cadet


Joined: Jan 17, 2004
Posts: 3


PostPosted: Mon Mar 22, 2004 3:53 pm Reply with quoteBack to top

*bump*
I do need help with this one... I'll wait for the zip file.
Find all posts by CorduroyView user's profileSend private message
Kinetix
Corporal
Corporal


Joined: Aug 16, 2003
Posts: 52


PostPosted: Sun May 30, 2004 5:19 pm Reply with quoteBack to top

Hey DJMaze, hope you don't mind, but I took the liberty of updating your javascript. If you're setting those cookies, why not use them? This will actually SAVE the cookie and every visit to the site, the blocks will remain like they were the last time the user changed them. Enjoy Wink

blockscript.js:
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,Days) {
 var today = new Date();
 var expire = new Date();
 if (Days==null || Days==0) Days=1;
 expire.setTime(today.getTime() + 3600000*24*Days);
 document.cookie = Name+"="+escape(Value) + ";expires="+expire.toGMTString();
}

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++) {
    abcswitch(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("blockdown") != -1) {
    icoID.src = imagepath+"blockup.gif";
    SetCookie('block'+bid,'yes',365);
  } else {
    icoID.src = imagepath+"blockdown.gif";
    DeleteCookie('block'+bid);
  }
}
function abcswitch(bid) {
    var blockopen=GetCookie('block'+bid);
    var bpe=document.getElementById('ph'+bid);
    var bph=document.getElementById('pe'+bid);
    var bico=document.getElementById('pic'+bid);
    if (blockopen != null) {
      bph.style.display="none";
      bpe.style.display="none";
      bico.src = imagepath+"blockup.gif";
    } else {
      bph.style.display="";
      bpe.style.display="";
      bico.src = imagepath+"blockdown.gif";
    }
}
function xyzswitch(bid) {
    xswitch(document.getElementById('ph'+bid));
    xswitch(document.getElementById('pe'+bid));
    icoswitch(bid);
}
function addblock(bid) {
    var blockopen=GetCookie('block'+bid);
    if (blockopen != null) {
        blockarrayint += 1;
        blockarray[blockarrayint] = bid;
    }
}


PS: Wow, I was so blind I didn't notice this thread had 8 pages. I figured it was only one page, so... Sorry if this code has already been made and posted by someone.

PPS: Isn't there an easier way? Instead of using all the BIDs, you could use something like this in your script:
Code:
  global $blockids;
  if (!isset($blockids)) {
    $blockids = 1;
  }
  else {
    $blockids++;
  }

And instead of using $bid in your script, you'd use $blockids and you wouldn't need to edit all those other files.

_________________
http://www.ikrontik.tk/
Ikrontik Server & Web Developer
So maybe I like posting my website in my sig, maybe google likes to cache it.
Find all posts by KinetixView user's profileSend private messageVisit poster's website
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.324 Seconds - 138 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::