MGCJerry
01-06-2008, 02:33 PM
I have this bit of code that I'm using to create an admin control panel for a CMS but I have encountered something really aggrivating. Is this normal behavior under PHP or is there something funny going on.
I've setup a PHPNuke admin style "links" "modules" file structure but it appears anything with the name "sponsor" or "sponsors" is unset when I try echoing it... However, the behavior is odd since I can echo the variable by itself, but it will not echo with the rest of the content.
Heres my code:
admin/links/links.sponsors.php <--- admin panel info only...
* First input variable is the link to that particular admin module... Which when set to "Sponsor" or "Sponsors", becomes null.
* 2nd variable is the "title", or the name that shows up in the admin panel.. Which when set to "Sponsor" or "Sponsors", becomes null.
* 3rd variable is the icon. Also of which if the image is named "Sponsor" or "sponsors", is also NULLED out.
* 4th variable is the admin module version
<?php
adminlink("admin.php?action=sponsors", "Sponsors", "banners.gif", "1.0");
?>
now the main bit of code is this....
function adminlink($url, $xtitle, $image, $ver='') {
global $counter;
if(file_exists("images/admin/".$image)) {
$img = "<img src=\"images/admin/$image\" border=\"0\" alt=\"$xtitle\" title=\"$xtitle\"><br>";
}
// I can echo $url, $img, $xtitle here just fine by itself if it is set as sponsor or sponsors...
if($ver) {
$ver = "<br>v$ver";
}
echo " <td class=\"admin\" align=\"center\" valign=\"top\" width=\"16%\"> <a href=\"$url\">\n"
." $img<b>$xtitle</b></a>$ver</td>\n";
// HOWEVER, it will not echo in the above line.. it is NULL...
//If it is set as sponsor or sponsors, only the version shows up
if ($counter == 5) {
echo " </tr><tr>";
$counter = 0;
} else {
$counter++;
}
}
Everything else works fine when I assign any other text. So its nothing else in the code...
Any ideas? I'm lost.
I've setup a PHPNuke admin style "links" "modules" file structure but it appears anything with the name "sponsor" or "sponsors" is unset when I try echoing it... However, the behavior is odd since I can echo the variable by itself, but it will not echo with the rest of the content.
Heres my code:
admin/links/links.sponsors.php <--- admin panel info only...
* First input variable is the link to that particular admin module... Which when set to "Sponsor" or "Sponsors", becomes null.
* 2nd variable is the "title", or the name that shows up in the admin panel.. Which when set to "Sponsor" or "Sponsors", becomes null.
* 3rd variable is the icon. Also of which if the image is named "Sponsor" or "sponsors", is also NULLED out.
* 4th variable is the admin module version
<?php
adminlink("admin.php?action=sponsors", "Sponsors", "banners.gif", "1.0");
?>
now the main bit of code is this....
function adminlink($url, $xtitle, $image, $ver='') {
global $counter;
if(file_exists("images/admin/".$image)) {
$img = "<img src=\"images/admin/$image\" border=\"0\" alt=\"$xtitle\" title=\"$xtitle\"><br>";
}
// I can echo $url, $img, $xtitle here just fine by itself if it is set as sponsor or sponsors...
if($ver) {
$ver = "<br>v$ver";
}
echo " <td class=\"admin\" align=\"center\" valign=\"top\" width=\"16%\"> <a href=\"$url\">\n"
." $img<b>$xtitle</b></a>$ver</td>\n";
// HOWEVER, it will not echo in the above line.. it is NULL...
//If it is set as sponsor or sponsors, only the version shows up
if ($counter == 5) {
echo " </tr><tr>";
$counter = 0;
} else {
$counter++;
}
}
Everything else works fine when I assign any other text. So its nothing else in the code...
Any ideas? I'm lost.
