Recent Topics

1 Mar 22, 2007 20:19    

Wth the Help of "GreyBox" you can create really nice looking PopUps that do net get blocked from the Browser. I tried a little bit around and used it to show my comments in this kind of pop-up. So here i how it goes :) (examples are at the end of this posting)

First of all you need to enable your comments open up in pop-ups, you can find everything about this [url=http://doc.b2evolution.net/v-1-9/evoskins/_blogs---skins---_popup.php.html]right here[/url].

Now you need to "install" GreyBox on your Webspace which is pretty easy, just go [url=http://orangoo.com/labs/GreyBox/Download/]here[/url] and download it. "GreyBox" is of course for free.

Now unzip the package and upload the folder "greybox" to your webspace it's only about 50 kb big, so it won't take that long ;)

Open up the _main.php file of your style and copy this in your Header:


<script type="text/javascript">
    var GB_ROOT_DIR = "http://mydomain.com/greybox/";
</script>
<script type="text/javascript" src="http://mydomain.com/greybox/AJS.js"></script>
<script type="text/javascript" src="http://mydomain.com/greybox/AJS_fx.js"></script>
<script type="text/javascript" src="http://mydomain.com/greybox/gb_scripts.js"></script>
<link href="http://mydomain.com/greybox/gb_styles.css" rel="stylesheet" type="text/css" />

Of course you have to change the "mydomain.com" parts in the paths ;)

Now open up _item.class.php which you can normally find here:
/blogs/inc/MODEL/items/_item.class.php

Search for:


        if( !empty( $url ) )
        {
            echo '<a href="'.$url;
            echo '#'.$type.'" ';    // Position on feedback
            echo 'title="'.$title.'"';
            if( $use_popup ) echo ' onclick="b2open(this.href); return false"';
            echo '>';
        }


Which you can normally find somewhere around line 1655.

add after

echo 'title="'.$title.'"';


the line

echo ' rel="gb_page[WIDTH, HEIGHT]"';


Put in for "WIDTH" and "HEIGHT" the values you want for your pop-up

If you now click on your Feedback link, it will open up in a nice stylish pop-up :)

Once you've installed "GreyBox" you can also use it in your postings for showing images, imagesets and pages. For an Image you just have to copy this into your post:

<a href="URL" title="CAPTION" rel="gb_image[]">HTML</a>


and put in the values you want :)

If you want so see how it looks like with the feedback link you can check it out at my new blog [url=http://www.linkranch.net]linkranch.net
[/url] you just have to click the numbers under the links, which is mostly 0 by now ;)

Other examples for images, pages etc. you can find [url=http://orangoo.com/labs/greybox/normal_usage.html]here[/url].

IMPORTANT: Somehow the values for width and height of the pop-up feedback windows don't work :/ and i also think that this is not the best way to use it, but i at least gave all my best ;)

2 Mar 22, 2007 20:47

Are you using this feature? If so I've some bad news for you: Firefox opened the link in a new tab - not a popup. It might be different if I allowed javascripts from your site, but I haven't so ... (update: allowing javascript from your domain still results in a new tab instead of a popup)

Plus there's a "comments in popups" feature in b2evolution already. I don't know if greybox does it nicer than b2evolution, but it's there and AFAIK it works. Even if it opens in new tabs instead of popup windows in FF ;)

4 Mar 22, 2007 21:11

yahoo search and koders search opened new tabs. Everything else opened in the tab your link was in.

I *love* firefox as much as I hate uninvited popups!

One day I'll have to set up a test installation that tries to use popups for comments and see if it works in my browser. At this point I know that the file manager feature of b2evolution will launch a popup, but not much else. I haven't tested the popup feature though, so I should. Even if I don't want to use it I should learn about it right?


Form is loading...