Welcome to Geeklog, Anonymous Monday, March 04 2024 @ 11:21 pm EST

Geeklog Forums

Link Plugin, open in new Window


Ronald

Anonymous
artistic
I'm very impressed with GL 1.5, and even more with the new options in the LINK plugin. However there is one small detail I would like to open the selection in a new window...aka open _blank...

I did a quick search, but couldn't a quick fix to change this...

Maybe somebody can help me...

With kind regards,

Ronald
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
Change the template of the linkitems, look for the template in plugins/links/templates/
Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

Ronald

Anonymous
Indeed, that worked fine in GL 1.4.1, but this is GL 1.5 and linkdetails.thtml are not the same anymore...
 Quote

Status: offline

jmucchiello

Forum User
Full Member
Registered: 08/29/05
Posts: 985
Yeah, the links plugin now uses the COM_createLink function. It takes all control away from the theme maker.
 Quote

Ronald

Anonymous
Now we know where not to look to fix it, does anybody knows how we can change the open in new window option?
 Quote

Status: offline

jmucchiello

Forum User
Full Member
Registered: 08/29/05
Posts: 985
You need to find the call to COM_createLink in the links/index.php and add array('target' => '_new'Wink to the $attr parameter.
 Quote

Ronald

Anonymous
curious
Sorry jmucchiello,

I'm not a programmer, I have some knowledge of HTML, maybe you can be more specific what I need to change.

So much thanks in advance.....

Ronald
 Quote

Status: offline

jmucchiello

Forum User
Full Member
Registered: 08/29/05
Posts: 985
Sorry. I don't have the time to actually make a patch. Make feature request in the bug tracker. (click the "report a bug" link on the left under "support" and maybe it will get into a future release of GL.
 Quote

Ronald

Anonymous
Nobody have an idea how to make the link plugin to open links in a new window?
 Quote

ironmax

Anonymous
To make that link open in a new window. All you should have to do is what jmucchiello said by looking for the COM_createLink in the /public_html/links/index.php file. There are 4 COM_createLink var in the file. Find the first one at about line 359.

Text Formatted Code

    $html = COM_createLink($content, $url, $attr);
 


Just above that, you will see this.
Text Formatted Code


    $content = stripslashes ($A['title']);
    $attr = array(
        'title' => stripslashes ($A['url']),
        'class' => 'ext-link');
    $html = COM_createLink($content, $url, $attr);
    $template->set_var ('link_html', $html);
 


You will need to change line 356 to read like this.
Text Formatted Code

    $attr = array('target' => '_new',
 


So the entire code area looks like this after you are done.
Text Formatted Code

    $content = stripslashes ($A['title']);
    $attr = array('target' => '_new',
        'title' => stripslashes ($A['url']),
        'class' => 'ext-link');
    $html = COM_createLink($content, $url, $attr);
    $template->set_var ('link_html', $html);

 


It was tested and works. If anyone else finds a problem with it, please make the corrections here.

Michael
 Quote

Ronald

Anonymous
cheerful
Nice Ironmax,

You made it so simple.... And you help me sooooo much

Thanks...
 Quote

All times are EST. The time is now 11:21 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content