Recent Topics

1 Mar 26, 2005 16:34    

Hello all,

I am a newbie to B2Evo. What a powerful package! Would love to see it as a Mambo Component.

(FYI for Mambo users)
Running Mambo 4.5.1 with PHPShop. Tried MamBlog but Mamblog does not have complete structure to work properly with Mambo 4.5.1 and PHPShop. It was a choice between running Mambo 4.5.0 with a working MamBlog for 4.5.0 and a suspect PHPShop, or running Mambo 4.5.1 with a suspect Mamblog and a working PHPShop... I had to choose the latter...

Anyways, I have the Basic Skin running in a Mambo wrapper and my problem is that if a user posts any kind of link it opens in the parent window (wrapper). I would like user posted links that are entered to open in a new window.

Is this configuarble somewhere? ... any suggestions would be greatly appreciated as I am not a PHP guru (am learning though!) TIA, Brad :D

(edit)
Looked at the evo_tables and found the evo_posts $post_url field. Is there a way in PHP to post an attribute like target="_blank" when the functions_bpost.php is called?

3 Mar 26, 2005 17:32

THANX WHOO! Exactly what I needed was found in that post :D !

In the /b2evocore/_class_item.php


if( $add_link && (!empty($this->url)) ) 
{ 
   $title = '<a href="'.$this->url.'" target="_blank" title="link opens new window">'.$title.'</a>'; 
}

Thanx again, Brad

4 Mar 26, 2005 17:44

youre welcome :) that was easy!

5 Mar 26, 2005 18:53

Here is the next dilemma...

the user hard codes a link like http://www.theirsite.com within the body of the post... and that link opens in the parent window. (not on this board, though, links open in new window)

Where is java script that ties to the 'Link' button when adding/editing the body of a post?

found a post: http://forums.b2evolution.net/viewtopic.php?t=1744

[from post]
Or, you can use this method, which is a little more complicated, and just as valid, but complies more with the "spirit" of the w3c's recommendation, since the "rel=external" tells us some semantic relevance about the link. Of course, you might not want to have all external links open in separate windows.
1. Put 'rel="external"' in the A element.
2. Put this function in the HEAD section of the page:


<script type="text/javascript"> 
function externalLinks() 
{ 
    if (!document.getElementsByTagName) return; 
    var anchors = document.getElementsByTagName("a"); 
    for (var i=0; i<anchors.length; i++) 
    { 
        var anchor = anchors[i]; 
        if (anchor.getAttribute("href") && 
        anchor.getAttribute("rel") == "external") 
        anchor.target = "_blank"; 
    } 
} 
window.onload = externalLinks; 
</script>

If I knew where to put this snippet I could test, but don't know what file/where the REL and Javascript go? (b2edit.php, _formatting.php?)


Form is loading...