PDA

View Full Version : Need to be tricky, here


Ddr
1-10-04, 02:21 PM
Please bear with me as I try to explain the evolution of this problem and what the need is. Some background information will save everyone some time by making any suggestions you offer more valid.

I have a small, private BB using Invision Powerboard 1.2. I had a nice idea that has become much more work than I thought it was going to be. (Gee, and that NEVER happens in web design *lol*) I wanted to create a thread that had a random image displayed each time a member viewed or refreshed my post.

What went wrong? Including code is severely limited by the Board. I can post a single image. That's easy. Simple HTML is permitted with Admin permissions. However, I couldn't use the random pic script in PHP in my post. I couldn't use a PHP Include to call the script if it was off-board, either.

So the next logical step was to create a separate page, off-board, to run the PHP script and just use a simple "a href" tag in my post to point the viewer to a new window with the random pics. I saw two choices here..."target=_blank", which works, but is a deprecated tag, or javascript to call the page and set it's parameters. I will save you a long story and just say that the Board didn't like javascript. So this left me with having to use the "target=" tag. This brings us to where I need some help. It could be that I have been using WYSIWYG editors too long and have forgotten some basics, but I am stumped.

The pics that I want to show in the new window are relatively small. I edited them down to save on bandwitdth usage. Therefore, I dont need a full sized window to show them. If I was able to use javascript, I would have made the window 400 x 350 pixels, only given it the menu bar, made it resizable, and specified it's location on the screen as Top Left. But I can't use javascript in my thread to direct how and where the popup window will be created. Is there another way to get this done? I really dont want full a full window to pop up and mask my Board. My small pics will look dismal in a large, mostly blank window, too.

I am not all that good with CSS, but I think it only guides the content of the page, not the layout of the browser, right? Is there a way to use javascript in the popup window's own <head> html that would redesign the browser layout?

Thanks in advance for any suggestions.

Oh, one idea I had, but really dont want to use, is to make the link on the Board go to a regular html page which redirects the viewer to a different page. I could then use javascript to close the redirection page and create the popup picture viewing window any size and with the attributes I want.

Oh, and Happy New Year!

Dale

YvetteKuhns
1-10-04, 03:58 PM
You may be able to use an iframe, but I don't know if that will still work. Did you try posting the code for an iframe? The iframe can call an includes such as an external javascript page (randomimage.js) that does what you want in the post. I am not sure this will work since I didn't try it.

Jade Dragon
1-10-04, 07:10 PM
As with most php driven boards they are compiled through a series of templates. Once you find the correct template you can insert the code to be called (usually through an array by assigning a variable). Then you can use your variable and insert it to the template where ever you want the random to appear.

Most boards limit the code changes done by admin panels to prevent users from deleting core code.

In several programs I have created the actual random coding on a seperate file, then I assign the variable to a php include line for that file.

It's been almost a year since I looked at Invision Board, so it's gonna take a wee bit for me to get you proper directions.

edit Didn't realize they charge for their board now, I sent you a pm.

=)
Jade

Ddr
1-10-04, 08:30 PM
What I wanted to accomplish here isn't worth all the time I have into this already....and certainly not worth asking you, Jade, to spend your valuable time trying to sort out the Invision PowerBoard code for this.

I will try Yvette's suggestion of an Iframe. If I cant get that to work either, then I will go with the redirect idea. I already have my flat file galleries made and the PHP page with the script loaded up on the site. I just have to make the redirect page.....a simple matter, really.

Thanks for your help

Dale

YvetteKuhns
1-10-04, 08:33 PM
I don't use Invision Board and I know that others have had difficulty editing the code without messing up something. That is why I gave a simple fix. It isn't a major issue to pull hair over, but it is nice to get things working they way you like. Good luck.

Ddr
1-10-04, 09:02 PM
*giving you a big ol' smooch on the cheek*

I was able to call the page with the php script in an iframe. Thanks so much for that idea. A few tweaks to the code in the iframe and target page and I will have exactly what I wanted.

Thanks again,

Dale

(and no, I never smooched Jack for giving me help, either)

YvetteKuhns
1-10-04, 09:22 PM
I never smooched Jack for giving me help, either

I would! :D I think that Ram Def XT program was worth it.

Glad to help. It was much easier than messing with the code. ;)