sNews Forum

sNews 1.7 (current stable version) => Patches/fixes => Topic started by: Patric Ahlqvist on March 26, 2009, 11:33:22 am

Title: FIX (double // on links to comments on extra pages)
Post by: Patric Ahlqvist on March 26, 2009, 11:33:22 am
UPDATE: This Patch is included in the current Official sNews 1.7 Download (http://snewscms.com/home/download/) as of April 15, 2010.

Okidoki... first Popoll, then I experienced a double slash on comments posted onto a new created PAGE (http://snewscms.com/forum/index.php?topic=8300.0). In the new comments function the comments where shown with an extra slash, making it not work. Then a fix making that work produced a odd result to other normal article comments. The newly created PAGE name where added to them links.

How ever in order to get rid of these double slashes, making every thing work a'ok again, please do this:

First, as always, make a copy of existing snews.php. Then inside function new_comments() find:
Code: [Select]
$link = isset($r['xsef']) ? $r['xsef'].'/'.$r['csef'] : $r['csef'];
$link .= '/'.$r['asef'];

Exchange that for (or comment it out):
Code: [Select]
unset($link);
if (isset($r['xsef'])) { $link = $r['xsef'].'/'; }
if (isset($r['csef'])) { $link .= $r['csef'].'/'; }             
$link .= $r['asef'];

All hail to the Matt (mdj (http://snewscms.com/forum/index.php?action=profile;u=8943)) for this as both Popi and I stood blindfoulded ready to get shot ;)