Description: This allows a user selected sidebar (left/right/off) of IIP pal boxes. It's fully configurable, you you can decide what boxes you want to display, and in what order they display.
Version 1.1 fixes the issue of "headers already sent" errors on some servers.
Working under: Instructions written for UBB.Threads 6.3, but probably could be interpreted to 6.2.
Any pre-requisites: IIP 5.3 or 5.3.1
Author(s): JustDave from chattersonline.com for discussions and bugs go to www.ubbdev.com
Date: 4/15/03
Credits: JoshPet for putting the instructions together
Database Altered: Yes, one field added to the w3t_Users table to store the user's sidebar preference.
New Files: sidebar_leftopen.tmpl, sidebar_leftclose.tmpl, sidebar_rightopen.tmpl, sidebar_rightclose.tmpl, sidebarpal.php
Notes: This is based on JustDave's sidebar mod. He had put together a sidebarpal.php script which we were using here, and had planned on including it in the next release in IIP. But he's been away for a while, and so many people keep asking for it, hopefully he won't mind that I put this together and released it.
[b]Updated - 4/18/03 - to fix things looking off center when you weren't using 100% table widths.
I should move left/right based on your user preferences.
Like it does here.
Will it not switch sides for you?
I'd check and make sure the new preference is getting stored in the database in changedisplay.php when you make the change. 1 for left, 2 for right, 0 off.
Okay yes I remembered that after posting. Okay here is a summary of what I see
The sidebar works fine on the left except there is no break between the forums and sidebar.
The sidebar when switched to the right half the boxes come up SQL ERROR database only visable to administrator and half work when on forum list or postlist. Now it works fine in other site pages like extras and places like my home and who's online. The error only happens when on the forumlist or postlist
Actually the Photopost stuff is called in between and as part of the main index. The sidebar is not called till after the forum closes. It only happens on the main index I see what your getting at. Let me get a clean no Photopost index and test that.
Yep I tested it and yep I found a buggy. Adding Photopost to the main index messes with the sidebar. I removed Photopost and it works on the right. However Photopost is more important to me though. Just let me know what ideas' ya have so we can play and get this one stomped.
I myself am at a loss at my Photopost template would mess it up. Maybe the calls between two databases.
This is the same code that UBB.threads formerly used to manually "register" global variables, that Rick went to great lengths to get rid of using get_input().
Cosmetic problem: the sidebar and other forum stuff in the middle of the page appear to be aligned left, while the top menu and footer are center-aligned.
I notice that problem doesn't occur here. In fact, it looks like the stuff in the middle is in its own table cell.
Any ideas? Is it possible that other files need to be modified for this hack?
The easy answer.... in my instructions was that it run best in 100% width. Otherwise it looks off center.
This problem seemed to exist in JustDave's user selectable sidebar mod... which is what I merged the sidebar pal he was using here with. The advice was always to run 100%
When I first tried to track that down... I assumed we needed an "align" center" to the td tag... but that's not it.
I never could solve it before.
Edit: I fixed it and will update the Zips momentarily.
Dave in sidebar_leftopen.tmpl and sidebar_rightopen.tmpl
Okay well something is going on weird. I uploaded the new templates and sidebarpal and it does space fine with a 95% width
I had to add in the left open like it has in the rightclose so there is a space inbetween the sidebar and forum.
However now this is totally weird. My Photopost categories on the photopost hack to display on main forum is gone. The featured photo's are there. I have no idea what is going on. Photopost categories are there in photopost. The only change made is with this new sidebarpal script and they did not come back with it set to blank in theme-inc.php
Okay the sidebar worked except for the right before now I updated the sidebarpal and I get version mismatch. I am using 5.3.1. It is a version mismatch with 5.3 or 5.3.1 running.
That's kind of a bogus error. The $VERSION variable was getting lost.
I discovered you needed to add $VERSION to the global call in the header or else you got it on the left.
I don't knwo why you'd get it on the right. $VERSION is used in the footer and already in the global call down there.
You can get around it by removing or commenting out this from the sidebarpal.php
if (!stristr($VERSION,"6.2") and !stristr($VERSION,"6.3")) { $VersionNotice = "<br /><br /><strong><span class="standouttext">Version missmatch!</span> IIP $palVersion will not work with UBB.threads™ $VERSION.</strong>"; }
It's just the check that it's the right version of threads. But when threads upgrades, you'll most likely need to update the sidebarpal if you get errors.
Unfortunately, this hack also suffers from the "never updating IIPs" for those who have active boards. Everytime someone loads this page, it resets the date variable so that an IIP never times out as long as people are hitting the page within the interval.
To fix this, I added the code below (in bold) to the sidebarpal.php:
if ( $date > ($LastCacheTime+600) ) $LastCacheTime = 0;
if (empty($forcepublic)) { [/]
then a little lower:
[] }
if ( $LastCacheTime != 0 ) $date = $LastCacheTime;
$date_q = addslashes($date);[/]
Basically, I'm telling the IIPs to do a refresh ever 10 minutes. Putting LastCacheTime to 0 forces a refresh and I have all the defaults set to 15 minutes.
I know its a little kludgy, but otherwise the pages never update (unless nobody is on my site for 15 minutes!)
Maybe Michael is the best to answer this one. Josh I added the version call to the header in ubbt-inc The sidebar works on the left just like it did in the last version. Now with your latest version it is even worse on the right tables everywhere sql errors etc. Now I see Michael has it working on the right. Any Ideas Michael?
Just another little note also. I notice at 100% everything views fine. at 95% it is centered so you fixed that yet if you have extra content like photopost those tables are smaller than threads ones. This does validate so I looked through and just figured I need a drink. To better explain threads when set to 95% when the Photopost tables go to 90% This sidebar is killing me. I have rechecked hacking over a dozen times and this darn thing does not like my site or something.
Dumb luck, I suppose; I dont recall making any changes to get it to work (never didn't work for me). I did have to cleanup the code I posted above and take out a couple <br /> tags for spacing - and I noticed the instructions didnt always match the code I had (6.2.3), but I figured out what needed to be done.
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.