| Author |
Message |
Guest
Guest

|
Posted:
Tue Jan 28, 2003 3:57 pm |
  |
I replaced all of the refs to the Directory name of my theme with the variable $thename and then placed the statement $thename = "Default"; at the top of the theme file. I also put $thename as a global in all the functions that call it.
It doesn't work!!! When I view the source of the rendered page it's src=themes//images/logo.gif instead of src=themes/Default/images/logo.gif. Am I doing something wrong? the bgcolors are working... Do I need to declare $thename somewhere else? |
|
|
 |
 |
ArtificialIntel

Joined: Jan 31, 2004
Posts: -88
|
Posted:
Tue Jan 28, 2003 4:02 pm |
  |
exqueeze me?
What is this in relation to?
ArtificialIntel |
|
|
   |
 |
Guest
Guest

|
Posted:
Tue Jan 28, 2003 4:17 pm |
  |
|
 |
 |
Guest

|
Posted:
Tue Jan 28, 2003 4:21 pm |
  |
Say the folder name is FOLDER.
$thename = "FOLDER"; is declared at the top of theme.php.
$thename is placed in all the calls to the folder like for images and whatnot. $thename is also a global for all of the functions that call it.
But, the end result is a blank space. The call is for whatever reason never completed. I dont get an error, I just get a broken image. |
|
|
 |
 |
ArtificialIntel

Joined: Jan 31, 2004
Posts: -88
|
Posted:
Tue Jan 28, 2003 4:24 pm |
  |
have you tried doing it like:
| Code: |
| "bla bla bla" .$thename. "/directory off whatever" |
ArtificialIntel |
|
|
   |
 |
Zhen-Xjell
Nuke Cops Founder


Joined: Nov 14, 2002
Posts: 5939
|
Posted:
Tue Jan 28, 2003 4:37 pm |
  |
You would need to pass that variable within the function calls itself. |
_________________ Paul Laudanski, Microsoft MVP Windows-Security
CastleCops: [de] [en] [wiki] |
|
     |
 |
Guest

|
Posted:
Tue Jan 28, 2003 4:42 pm |
  |
I'll try that, but why wont it work the way it is? the bgcolor1 and 2 declares work just fine. I don't get it. |
|
|
 |
 |
ArtificialIntel

Joined: Jan 31, 2004
Posts: -88
|
Posted:
Tue Jan 28, 2003 4:47 pm |
  |
add it to thte "globals bla bla bla" list at the beginning of each function in the theme
ArtificialIntel |
|
|
   |
 |
Guest

|
Posted:
Tue Jan 28, 2003 4:49 pm |
  |
i did that in the beginning... without the global I get a warning at the top of the rendered page. with the global in p,ace, i just get broken images... |
|
|
 |
 |
ArtificialIntel

Joined: Jan 31, 2004
Posts: -88
|
Posted:
Tue Jan 28, 2003 4:49 pm |
  |
between each of the globals should be a , and at the end, there should be a ;
ArtificialIntel |
|
|
   |
 |
Guest

|
Posted:
Tue Jan 28, 2003 4:55 pm |
  |
Here it is... thinned out of course... THe kicker is that everything works except for the references to $thename.
| Code: |
<?php
$thename = "FOLDERNAME";
$lnkcolor = "#035D8A";
$bgcolor1 = "#FFFFFF";
$bgcolor2 = "#FFFFFF";
$bgcolor3 = "#FFFFE6";
$bgcolor4 = "#FFFFFF";
$textcolor1 = "FFFFFF";
$textcolor2 = "000000";
$hr = 1; # 1 to have horizonal rule in comments instead of table bgcolor
function themeheader() {
global $thename, $cookie, $user, $slogan, $sitename, $prefix, $user_prefix, $db, $banners;
echo "<tr><td><a href=\"index.php\"><img src=themes/$thename/images/logo.gif Alt=\"$slogan\" border=0 align=left vspace=0 hspace=0></a>\n";
?> |
the above code would render like this...
blah blah... src=themes//images/logo.gif .....blah blah |
|
|
 |
 |
ArtificialIntel

Joined: Jan 31, 2004
Posts: -88
|
Posted:
Tue Jan 28, 2003 5:00 pm |
  |
change the echo line to:
| Code: |
| echo "<tr><td><a href=\"index.php\"><img src=\"themes/" .$thename. "/images/logo.gif\" Alt=\"$slogan\" border=0 align=left vspace=0 hspace=0></a>\n"; |
Artificialintel |
|
|
   |
 |
Guest

|
Posted:
Tue Jan 28, 2003 5:08 pm |
  |
| Zhen-Xjell wrote: |
| You would need to pass that variable within the function calls itself. |
Renaming theme/$thename to theme/"$thename"/ resulted in the blank space like before...
I declared $themename in each function and it works great... But wwwwhhhyyyyy is it woprking this way?
I'm lost.. But at least my themes are a little easier to manipulate now.. |
|
|
 |
 |
ArtificialIntel

Joined: Jan 31, 2004
Posts: -88
|
Posted:
Tue Jan 28, 2003 5:11 pm |
  |
maybe $thename is used elsewhere. Who knows
ArtificialIntel |
|
|
   |
 |
Guest

|
Posted:
Tue Jan 28, 2003 5:13 pm |
  |
I already thought of that... On the chance that an error wasn't being returned I renamed $thename to $thename123 and got the same end result... I'll write my thesis on this if I can ever figure it out...  |
|
|
 |
 |
|
|