Welcome to Geeklog, Anonymous Thursday, April 18 2024 @ 08:17 pm EDT

Geeklog Forums

Clarification on New Window on a link


Status: offline

ola_one

Forum User
Full Member
Registered: 06/28/03
Posts: 186
Really sorry to bother you all againl, but I went through the thread of a previous post, and I found that I needed to insert target=_blank in lib-common.php to enable new windows to open when one clicks on a link within Geeklog. Right now, when I click on a link, the new link takes over the browser, and I am out of Geeklog.

However, I am lost as to where exactly to insert the information.

I know that it is supposed to be within the following, but where exactly is the problem for me:

Text Formatted Code
{
                        $newlinks [] = '<a href="' . $lcount . '" title="'
                            . $A['title'] . '">' . substr( $A['title'], 0, 16 )
                            . '...</a>' . LB;
                    }
                    else
                    {
                        $newlinks[] = '<a href="' . $lcount . '">'
                            . substr( $A['title'], 0, $itemlen ) . '</a>' . LB;
 


Should it be within the brackets after $newlinks, or should it be after a href or $lcount?

I am tempted to put it within the brackets but thought to ask first before messing up.

Thanks again

Ola
 Quote

Status: offline

Turias

Forum User
Full Member
Registered: 10/20/03
Posts: 807
stick it between the 'a' and the 'href' giving you

Text Formatted Code
'<a target="_blank" href="'
 
 Quote

Status: offline

ola_one

Forum User
Full Member
Registered: 06/28/03
Posts: 186
Thanks Turias,

I have done as you said, but the window did not open in a separate page.

Text Formatted Code
{
                    $newlinks [] = '<a target="_blank" href="' . $lcount . '" title="'
                        . $A['title'] . '">' . substr( $A['title'], 0, 16 )
                        . '...</a>' . LB;
                }
                else
                {
                    $newlinks[] = '<a target="_blank" href="' . $lcount . '">'
                        . substr( $A['title'], 0, $itemlen ) . '</a>' . LB;
                }
 


My linkdetails.thtml looks like the follwoing:

Text Formatted Code
<li>
  <strong><a href="{link_url}" target="_blank">{link_name}</a></strong> ({link_hits}) {link_edit}<br>
  {link_description}
</li>
 


Is there something that I am missing?

Thansk
 Quote

Status: offline

Turias

Forum User
Full Member
Registered: 10/20/03
Posts: 807
I don't even know what link you are clicking.
 Quote

Status: offline

ola_one

Forum User
Full Member
Registered: 06/28/03
Posts: 186
Sorry about that, I am trying to click the following:

http://www.adeseyeogunlewe.com

You will see a drop down box at the right in a weather block. The weather is coming directly from Yahoo Weather. If you pick any of the towns, it takes you to yahoo weather forecast for that town, but the page overwrites the above homw page.

Thanks
 Quote

Status: offline

Turias

Forum User
Full Member
Registered: 10/20/03
Posts: 807
You're going to have to edit the code for that dropdown. It has nothing to do with lib-common.php or any of the files involved in the hack I previously posted.
 Quote

Status: offline

ola_one

Forum User
Full Member
Registered: 06/28/03
Posts: 186
Thanks again, but can you guide me as to what I need to include in the code for the dropdown.

Regards
 Quote

Status: offline

Turias

Forum User
Full Member
Registered: 10/20/03
Posts: 807
Text Formatted Code
function goToURL(form) {

        var myindex=form.select1.selectedIndex
        if(!myindex=="")
        {
        window.location.href=form.select1.options[myindex].value;
       
        }
}

function goToURL2(form) {
        var myindex=form.select2.selectedIndex

        if(!myindex=="")
        {
        window.open(form.select2.options[myindex].value);
       
        }
}
 


becomes

Text Formatted Code

function goToURL(form) {

        var myindex=form.select1.selectedIndex
        if(!myindex=="")
        {
        window.open(form.select1.options[myindex].value);
        }
}

function goToURL2(form) {
        var myindex=form.select2.selectedIndex

        if(!myindex=="")
        {
        window.open(form.select2.options[myindex].value);
       
        }
}
 
 Quote

Status: offline

ola_one

Forum User
Full Member
Registered: 06/28/03
Posts: 186
Thanks a BILLION Turias. You are the MAN!!!
 Quote

All times are EDT. The time is now 08:17 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