Stubborn Variable

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ZED28
Forum Newbie
Posts: 2
Joined: Sun May 18, 2003 10:00 am

Stubborn Variable

Post by ZED28 »

Okay, I'm REAL new to PHP but have a handle on some of the fundamental stuff, or at least I'm starting to. I run a PHP Nuke site and I want to have a set of Topic icons that are made for specific themes so I'm trying to modify some of the code in certain modules to pull the topic icons from the themes - instead of the default location. I have successfully modified some code like "submit_news.php" using similar strings but THIS one has me stumped! I've chopped out a part of the code that I'm having problems with. This is the topics.php file from the \Admin\Modules section...

Code: Select all

if (!eregi("admin.php", $_SERVERї'PHP_SELF'])) { die ("Access Denied"); }
$result = sql_query("select radmintopic, radminsuper from ".$prefix."_authors where aid='$aid'", $dbi);
list($radmintopic, $radminsuper) = sql_fetch_row($result, $dbi);
if (($radmintopic==1) OR ($radminsuper==1)) {

/*********************************************************/
/* Topics Manager Functions                              */
/*********************************************************/

function topicsmanager() {
    global $prefix, $dbi, $ThemeSel;
    include("header.php");
    GraphicAdmin();
    OpenTable();
    echo "<center><font class="title"><b>"._TOPICSMANAGER."</b></font></center>";
    CloseTable();
    echo "<br>";
    OpenTable();
    echo "<center><font class="option"><b>"._CURRENTTOPICS."</b></font><br>"._CLICK2EDIT."</font></center><br>"
	."<table border="0" width="100%" align="center" cellpadding="2">";
    $count = 0;
    $result = sql_query("select topicid, topicname, topicimage, topictext from ".$prefix."_topics order by topicname", $dbi);
    while(list($topicid, $topicname, $topicimage, $topictext) = sql_fetch_array($result, $dbi)) &#123;
    echo "<td align="center"><a href="admin.php?op=topicedit&topicid=$topicid"><img src="themes/$ThemeSel/images/topics/$topicimage" border="0" alt=""></a><br>"
    &#125;
I added the variable called "$ThemeSel" to the global list first, then modified the last line of code to pull information from it - except that it's not reading the value of the $ThemeSel" variable for some reason. If I replace the variable with the name of the theme, it works just fine so it is the variable that's causing the problem.

Please please please, you code gurus out there, just cast your experienced eyes over this for just a second! LOL

I know this isn't a hardcore Nuke support forum but figured the syntax is the problem here - that and I'm sure there are more experienced folk here anyways! :wink:

Many thanks!
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

where's $ThemeSel supposed to be set?
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

A long time ago I got hold of nuke, planning to adapt it for a new site. It was such a hideous mess I wrote my own CMS instead.

Many people do seem to use it and like it, but I'd recommend you chuck it away and start from scratch.
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

Me too. But that's only if you're comfortable with coding your own CMS.

If not, there is a great array of CMS's out their with easier to navigate source.
ZED28
Forum Newbie
Posts: 2
Joined: Sun May 18, 2003 10:00 am

Post by ZED28 »

volka wrote:where's $ThemeSel supposed to be set?
Okay, remembering I'm new here so writing my own CMS is completely out of the question! LOL As far as telling you where this variable is supposed to be set, I guess I need a little more of an explanation! :oops:
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

Then i guess you might want to grab one from the link i posted. :wink:
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

LOL As far as telling you where this variable is supposed to be set, I guess I need a little more of an explanation!
hm, why did you came up with $ThemeSel? Somehow the name must have come into existance (at least in your mind ;) ).
Simply declaring

Code: Select all

global $GetBillsFunds;
doesn't make me rich (what a pitty :D)
Post Reply