Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest sNews - sNews 1.7 - with its own forums - for discussion and user mods.

Pages: [1] 2 3

Author Topic: double // on links to comments on extra pages  (Read 6051 times)

poppoll

  • Full Member
  • ***
  • Karma: 47
  • Posts: 199
    • Poppoll's sNews playground
double // on links to comments on extra pages
« on: March 07, 2009, 03:48:07 am »

When somebody comments on a extra page the link in the comments (right part of the site) gets a double //
e g http://nieuwerkerken-aalst.be/snews//sspgallery/Comment#1.

To see it go to my site and hit the comments tab and mouseover the Keyrocks comment.
If you click the comment you get an error.  :'(

PP
« Last Edit: March 07, 2009, 03:52:10 am by poppoll »
Logged

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
Re: double // on links to comments on extra pages
« Reply #1 on: March 07, 2009, 02:51:58 pm »

Oh, haven't seen that. Have to drive my kid to McDonalds now, but I'll try and dublicate that when I get home and post back... That way we can't have it, right 
Logged
"It's only dead fish that goes with the flow... "
Updated

Joost

  • Guest
Re: double // on links to comments on extra pages
« Reply #2 on: March 07, 2009, 03:10:21 pm »

Oh, haven't seen that. Have to drive my kid to McDonalds now, but I'll try and dublicate that when I get home and post back... That way we can't have it, right 

I want a Happy Meal...... please? :-* :-* .....can I have one?  :-* And a large coke. :P
Logged

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
Re: double // on links to comments on extra pages
« Reply #3 on: March 07, 2009, 03:48:17 pm »

Got'cha one IK meal instead (to support the local hockey team) and a large coke. Sits on my kitchen table waiting for you ;)...

Although, I can not duplicate this problemo... I have a page "about" on which I enabled comments, posted one, and there was no extra /... All good.
« Last Edit: March 07, 2009, 03:49:53 pm by Patric Ahlqvist »
Logged
"It's only dead fish that goes with the flow... "
Updated

poppoll

  • Full Member
  • ***
  • Karma: 47
  • Posts: 199
    • Poppoll's sNews playground
Re: double // on links to comments on extra pages
« Reply #4 on: March 07, 2009, 10:35:53 pm »

I just did a fresh install, no mods.
Made a page and still have the double //
PS on local host there is no error when clicking the comment link, but the double // is there.
Strange..
PP
Logged

Nicu Alecu

  • Full Member
  • ***
  • Karma: 12
  • Posts: 224
    • BLUEBYTE.ro // IT consultant
Re: double // on links to comments on extra pages
« Reply #5 on: March 07, 2009, 11:38:06 pm »

I just did a fresh install, no mods.

Just did the same, Pop. Added the page, made the comment ... no double slash here, and I did the test on a shared host.
Logged

poppoll

  • Full Member
  • ***
  • Karma: 47
  • Posts: 199
    • Poppoll's sNews playground
Re: double // on links to comments on extra pages
« Reply #6 on: March 08, 2009, 01:17:42 am »

Think I found it
Did some trial and error, because I'm not a PHP guy. ;)
Replaced
Code: [Select]
$link .= '/'.$r['asef'];With:
Code: [Select]
$link .= $r['asef'];
And the double // is gone.
Can someone plaese confirm, if this is the right way
Thanks
Poppoll
Logged

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
Re: double // on links to comments on extra pages
« Reply #7 on: March 08, 2009, 05:01:44 am »

Popi, you'll have to look at the construction of $link to verify, but most likely it's "$_SITE.categorySEF.'/'..." which already has a trailing slash at the end, generally. So if you're getting the correct output now (and no strange links in other places) then it's safe to assume it's correct.
Logged

poppoll

  • Full Member
  • ***
  • Karma: 47
  • Posts: 199
    • Poppoll's sNews playground
Re: double // on links to comments on extra pages
« Reply #8 on: March 08, 2009, 09:22:19 am »

Thanks Fred.
changed it.
PP
Logged

Rui Mendes

  • Development,Testing, Support
  • Hero Member
  • *****
  • Karma: 195
  • Posts: 1009
  • sNews1.7
    • Comunidade Portuguesa
Re: double // on links to comments on extra pages
« Reply #9 on: March 09, 2009, 11:36:20 pm »

Pop can you try this

Replace this
Quote
$link = isset($r['xsef']) ? $r['xsef'].'/'.$r['csef'] : $r['csef'];
$link .= '/'.$r['asef'];

with this
Quote
$link = isset($r['xsef']) ? $r['xsef'] : '';
$link .= !empty($link) ? '/'.$r['csef'] : '';
$link .= !empty($link) && !empty($r['asef']) ? '/'.$r['asef'] : '';

Logged
Need a Job on Europe. Linkdin - Facebook / Group

poppoll

  • Full Member
  • ***
  • Karma: 47
  • Posts: 199
    • Poppoll's sNews playground
Re: double // on links to comments on extra pages
« Reply #10 on: March 09, 2009, 11:49:55 pm »

Thanks Rui for the replay
But if I change it back to your code the // is back.
Search no further, it works with removing the / in
Code: [Select]
$link .= '/'.$r['asef'];
Thanks again
Poppoll
Logged

Rui Mendes

  • Development,Testing, Support
  • Hero Member
  • *****
  • Karma: 195
  • Posts: 1009
  • sNews1.7
    • Comunidade Portuguesa
Re: double // on links to comments on extra pages
« Reply #11 on: March 10, 2009, 12:07:28 am »

Pop can you make tests with comments in articles inside categories and subcategories.

I suspect something won't work with your code.

If I'm right, one other solution is
Replace
Quote
$link .= '/'.$r['asef'];
with this
Quote
$link .= $link != '/' ? '/'.$r['asef'] : '';
Logged
Need a Job on Europe. Linkdin - Facebook / Group

poppoll

  • Full Member
  • ***
  • Karma: 47
  • Posts: 199
    • Poppoll's sNews playground
Re: double // on links to comments on extra pages
« Reply #12 on: March 10, 2009, 12:17:20 am »

Rui,
You're right there is a problem when I make a comment in articles inside categories
Did the replacement, but still have the double //
PP
Logged

Rui Mendes

  • Development,Testing, Support
  • Hero Member
  • *****
  • Karma: 195
  • Posts: 1009
  • sNews1.7
    • Comunidade Portuguesa
Re: double // on links to comments on extra pages
« Reply #13 on: March 10, 2009, 12:29:02 am »

To find the problem, please do this:
after $link add this line and tell me the results
Quote
echo 'xsef='.$r['xsef'].'<br />csef='.$r['csef'].'<br />asef'.$r['asef'].'<br />commentspage'.l('comment_pages').'<br />';
Logged
Need a Job on Europe. Linkdin - Facebook / Group

poppoll

  • Full Member
  • ***
  • Karma: 47
  • Posts: 199
    • Poppoll's sNews playground
Re: double // on links to comments on extra pages
« Reply #14 on: March 10, 2009, 12:34:36 am »

Rui this is what  I get when i click the comments tab:
Code: [Select]
xsef=java
csef=sub2-java
asefcode-highlighter-css
commentspagec_
# Paul (cgfvxfbvbxbxcb)
xsef=java
csef=sub1-java
aseftest-code-highlighter
commentspagec_
# PP (mijn commentaar)
xsef=
csef=
asefsspgallery
commentspagec_
# PP (this a test comment)
xsef=
csef=snews
asefwelcome-to-snews-17
commentspagec_
# test matcap v2 (input type=...)
xsef=
csef=snews
asefwelcome-to-snews-17
commentspagec_
# Poppoll (test security)
xsef=
csef=
asefmosh-gallery
commentspagec_
# Poppoll (fdgfg)
xsef=
csef=snews
asefwelcome-to-snews-17
commentspagec_
# PP (Test comment)
Logged
Pages: [1] 2 3