1)
Looking at some HTML generated in a photo category view i found this:
HTML Code:
<a href='http://www.teflon.net/forum/local_links.php?catid=7&linkid=54'>PictureTitle1</a>
There is two interesting things in this line of HTML:
- The quotes are singlequotes, not doublequotes
- Ampersand is coded as "&" instead of "&"
I believe it ought to be something like this:
HTML Code:
<a href="http://www.teflon.net/forum/local_links.php?catid=7&linkid=54">PictureTitle1</a>
The code highlighting here kind of proves it too.
2)
I had a look in local_links.php and found this line:
PHP Code:
$pagenav = construct_page_nav($pagenumber, $perpage, $thits, $LINKS_SCRIPT.".php?action=ratelink&catid=$catid&linkid=$linkid&lpage=$lpage&ratesort=$ratesort", "&pp=$perpage");
I would rewrite it as:
PHP Code:
$pagenav = construct_page_nav($pagenumber, $perpage, $thits, $LINKS_SCRIPT.'.php?action=ratelink&catid=$catid&linkid=$linkid&lpage=$lpage&ratesort=$ratesort', '&pp=$perpage');
Substituting as follows
- doublequotes ==> singlequotes
- & ==> &
3)
Also, if a variable is not inserted via template processing, then i would use the following syntax consistently:
PHP Code:
$x = 'Something '$included.' in this string!';
Rather than the following syntax:
PHP Code:
$x = "Something $included in this string!";
4)
Embracing the use of singlequoted strings in PHP when targetting HTML output makes it possible to simply write:
PHP Code:
$webContents .= '<td width="200" align="'.$myAlignment.'"><a href="http://www.teflon.net/"><img src="http://www.teflon.net/images/puttycake.jpg" border="0" alt="[FISH!]"></a>
</td>
';
The opposite is of course true for MySQL queries, where it should be something like this:
PHP Code:
$queryString="SELECT boneid, furtype FROM bowser WHERE bowzerid = '".addslashes($BowzerID)."' and benevolent = 'YES'";
I guess it is quite some work to rewrite the code for the LDM. Lots of code there.
But it is very well worth it, since it is such a good product.