#136 small tweaks to phpslash-ft

enhancement
closed-fixed
Joe Stewart
5
2014-08-22
2002-01-15
Aaron Seth
No

I found a problem in article.php3 when displaying in
"printer friendly" format. Basically concatenating
$_PSL[rooturl] + $_PSL[phpself] creates an incorrect
URL if your phpslash site is not in the Apache
"DirectoryRoot". For example, imagine that rooturl is
"http://www.mysite.org/news", and PHP_SELF is
"/news/article.php3" leading to a concatenated URL of
"http://www.phpslash.org/news/news/article.php3".

My fix was to hardcode the "article.php3" name. I've
included this fix and another small typo fix. (If you
want I can submit a patch, but they seemed too small to
warrant that :)

cvs server: Diffing .
Index: article.php3
===================================================================
RCS file:
/cvsroot/phpslash/phpslash-ft/public_html/article.php3,v
retrieving revision 1.55
diff -u -r1.55 article.php3
--- article.php3 2002/01/08 21:43:57 1.55
+++ article.php3 2002/01/15 08:32:08
@@ -56,7 +56,7 @@

$t->set_file(article, "article-pf.tpl");
$t->set_var(array(
- STORY_URL =>
"".$_PSL[rooturl].$_PSL[phpself]."?story_id=".$story_id."",
+ STORY_URL =>
$_PSL[rooturl]."/article.php3?story_id=".$story_id."",
SITENAME => $_PSL[site_name],
PAGETITLE => $pagetitle,
TITLE => $ttitle,
Index: indextpl3col.php3
===================================================================
RCS file:
/cvsroot/phpslash/phpslash-ft/public_html/indextpl3col.php3,v
retrieving revision 1.12
diff -u -r1.12 indextpl3col.php3
--- indextpl3col.php3 2001/12/14 22:14:36 1.12
+++ indextpl3col.php3 2002/01/15 08:32:08
@@ -47,7 +47,7 @@
));

$template->set_var(array(
- ROOTDIR => $_PSL[rootdir],
+ ROOTDIR => $_PSL[rooturl],
IMAGEDIR => $_PSL[imageurl],
BREADCRUMB => $breadcrumb,
STORY_COLUMN => $allstories,

Discussion

  • Aaron Seth
    Aaron Seth
    2002-01-15

    Logged In: YES
    user_id=362364

    Sorry about the diff formatting. I'll attach a file next
    time. -Aaron

     
  • Joe Stewart
    Joe Stewart
    2002-01-15

    Logged In: YES
    user_id=77269

    Corrected in CVS. The indextpl3col.php3 will probably be
    removed as it's not needed anymore. For three columns now,
    just assign the blocks to left and right columns.

     
  • Joe Stewart
    Joe Stewart
    2002-01-15

    • assigned_to: nobody --> joestewart
    • status: open --> closed-fixed
     
  • Joe Stewart
    Joe Stewart
    2002-01-15

    Logged In: YES
    user_id=77269

    This problem has been corrected in the CVS. Please update your
    copy of PHPSlash, or wait for the next release.