i’m such a coder….

Site News

on July 5, 2003

NOT! smile

Mind you I hacked my first pMachine backend file today!

Not a big deal….. I have set up a 26 things site for my friend Jay (look familiar?) and because PM doesn’t have popup comments I had to find a hack to do it. Found popup stuff easily enough but if you use a different page in the popup window PM still loads the standard comments page when you preview or submit the comments – bummer.  I found what I needed to change in the file that contains the commenting backend code OK but it only works for one weblog so that left Jay with a commenting page that didn’t return to itself.  I though I could let it go…….

Anyway long story short – I found a command called elseif and figured that might work – and it did! so now Jay and I both have comment pages the way I wanted them to work.

This is all I had to do – change this:

$returnto .= get_pref(“comments_page_$weblog”);

to this (most of this from the web):

if($weblog == “26things”) {

$returnto .= “../26things/pop_comments.php”;

} else {

$returnto .= get_pref(“comments_page_$weblog”);

}



to this:



if($weblog == “26things”) {

$returnto .= “../26things/pop_comments.php”;

} elseif($weblog == “jay”) {

$returnto .= “../../jay/pop_comments.php”;

} else {

$returnto .= get_pref(“comments_page_$weblog”);

}


—–

  • Facebook
  • Twitter

Comments are closed.