|
View previous topic :: View next topic
|
| Author |
Message |
Dave9
EVO User

Joined: 07-Nov-2009 Posts: 70 Location: The insane assylum~ a quiet peaceful place to change your mind Offline
EVO Version: evo2.0.7basic/evo2.0.7extreme/evo2.0.7extreme2/evo2.1.0 rev1536
|
Posted: 11 Dec 2009
|
|
Post subject: Question regarding some custom ATO settings
|
|
|
I am trying to implament a choice of footers through the ATO panel, I have not really had an issue with prior versions including rev 761 but I now cannot seem to make it happen with the most recent changes to the code.
|
Code:
|
// GIVE A CHOICE OF FOOTERS
$choice == $ThemeInfo['footer'];
if ($choice == "yes")
{
$footer = "1";
}
if ($choice == "no")
{
$footer = "0";
}
if ($footer == "1")
{
include_once(NUKE_THEMES_DIR.$theme_name."/images/ft/footer.php");
}
if ($footer == "0")
{
include_once(NUKE_THEMES_DIR.$theme_name."/footer.php");
}
|
this is basically my really crude block of code, maybe someone can show me a better way to implement this?
|
Last edited by Dave9 on 11 Dec 2009; edited 1 time in total
|
|
|
Back to top
|
|
|
ReOrGaNiSaTiOn
EVO World Team

Joined: 03-Jan-2006 Posts: 11731 Location: Als Schwabe in Sachsen-Anhalt Offline
EVO Version: - Developer Edition -
|
Posted: 11 Dec 2009
|
|
Post subject: Re: New problem regarding some custom ATO settings
|
|
|
Hi,
in the function themefooter() isn't $Themeinfo imported as global (Standard).
Maybe this could cause the problem ??
A shorter way of coding:
$ThemeInfo['footer'] = (exists($ThemeInfo['footer']) && !empty($ThemeInfo['footer') ? $ThemeInfo['footer'] : 'no');
switch ($ThemeInfo['footer']) {
case 'yes': include_once(NUKE_THEMES_DIR.$theme_name."/images/ft/footer.php"); break;
case 'no': include_once(NUKE_THEMES_DIR.$theme_name."/footer.php"); break;
default: include_once(NUKE_THEMES_DIR.$theme_name."/footer.php"); break;
}
You may get a E-Warning if $ThemeInfo['footer'] isn't filled in your way. This is why I added the line for filling the variable with a default value.
Greetings
Reo
|
|
|
|
Back to top
|
|
|
Dave9
EVO User

Joined: 07-Nov-2009 Posts: 70 Location: The insane assylum~ a quiet peaceful place to change your mind Offline
EVO Version: evo2.0.7basic/evo2.0.7extreme/evo2.0.7extreme2/evo2.1.0 rev1536
|
Posted: 11 Dec 2009
|
|
Post subject: Re: Question regarding some custom ATO settings
|
|
|
|
Quote:
|
|
You may get a E-Warning if $ThemeInfo['footer'] isn't filled in your way. This is why I added the line for filling the variable with a default value.
|
I had not thought about that actually and that is a brilliant call on your behalf... bad bad bad Blockhead
Thank you for posting this solution
BH
|
|
|
|
Back to top
|
|
|
ReOrGaNiSaTiOn
EVO World Team

Joined: 03-Jan-2006 Posts: 11731 Location: Als Schwabe in Sachsen-Anhalt Offline
EVO Version: - Developer Edition -
|
Posted: 11 Dec 2009
|
|
Post subject: Re: Question regarding some custom ATO settings
|
|
|
Did you test it ? I mean, didn't you import $ThemeInfo as global to the function ??
|
|
|
|
Back to top
|
|
|
Dave9
EVO User

Joined: 07-Nov-2009 Posts: 70 Location: The insane assylum~ a quiet peaceful place to change your mind Offline
EVO Version: evo2.0.7basic/evo2.0.7extreme/evo2.0.7extreme2/evo2.1.0 rev1536
|
Posted: 11 Dec 2009
|
|
Post subject: Re: Question regarding some custom ATO settings
|
|
yes in the past I had used $ThemeInfo as a global, in 2.1.0 I do not see it being called as a global through function themefooter(). I have not added it as of yet but have not been able to make it work as of yet either. If I place your code in I get an errorr message: Fatal error: Call to undefined function exists() in C:\wamp\www\210a\themes\IC_Thornz210\theme.php on line 215
if I negate: $ThemeInfo['footer'] = (exists($ThemeInfo['footer']) && !empty($ThemeInfo['footer']) ? $ThemeInfo['footer'] : 'no');
I get a footer and no error messages, but of course cannot make them switch, I was very tired last night and couldn't muster up the energy to keep pushing forward so I will pick at it some more today and see if I can get it to happen.
Thank you for helping with this ReO you absolutely rock my brotha of anotha motha much respect and gratitude for your work
dave9/BH
GMT-9
|
|
|
|
Back to top
|
|
|
ReOrGaNiSaTiOn
EVO World Team

Joined: 03-Jan-2006 Posts: 11731 Location: Als Schwabe in Sachsen-Anhalt Offline
EVO Version: - Developer Edition -
|
Posted: 12 Dec 2009
|
|
Post subject: Re: Question regarding some custom ATO settings
|
|
|
sorry ... did a wrong run !!
Replace "exists" with "isset" ....
|
|
|
|
Back to top
|
|
|
Dave9
EVO User

Joined: 07-Nov-2009 Posts: 70 Location: The insane assylum~ a quiet peaceful place to change your mind Offline
EVO Version: evo2.0.7basic/evo2.0.7extreme/evo2.0.7extreme2/evo2.1.0 rev1536
|
Posted: 12 Dec 2009
|
|
Post subject: Re: Question regarding some custom ATO settings
|
|
yes coding GOD they say ...hahahaha
I am able to now make it work just fine, with an un handled exception now taken care of .. thank you
has been a long but extremely smooth day for me today, this is the icing on the cake!!
thank you so much ReO
|
|
|
|
Back to top
|
|
|
Dave9
EVO User

Joined: 07-Nov-2009 Posts: 70 Location: The insane assylum~ a quiet peaceful place to change your mind Offline
EVO Version: evo2.0.7basic/evo2.0.7extreme/evo2.0.7extreme2/evo2.1.0 rev1536
|
Posted: 12 Dec 2009
|
|
Post subject: Re: Question regarding some custom ATO settings
|
|
|
Is it possible to call to style.css, to switch from style.css to style2.css or something to that nature? I cant really see where style is called from exactly..
|
|
|
|
Back to top
|
|
|
ReOrGaNiSaTiOn
EVO World Team

Joined: 03-Jan-2006 Posts: 11731 Location: Als Schwabe in Sachsen-Anhalt Offline
EVO Version: - Developer Edition -
|
Posted: 13 Dec 2009
|
|
Post subject: Re: Question regarding some custom ATO settings
|
|
|
Hi,
style.css is called from header.php.
A Stylesheet must be linked als linkref inside header informations. So there is the place to look for.
To make a switch which is independet on selection of your themeinfo or something like that, you have to call a new function inside your theme.php. This function call must be placed before the linkref is made to the stylesheet.
Because this all happens inside header-informations, you must make shure, that no informations are send outside allowed http-header informations - otherwise you will get a "header allready sent" error.
Greetings
Reo
|
|
|
|
Back to top
|
|
|
Dave9
EVO User

Joined: 07-Nov-2009 Posts: 70 Location: The insane assylum~ a quiet peaceful place to change your mind Offline
EVO Version: evo2.0.7basic/evo2.0.7extreme/evo2.0.7extreme2/evo2.1.0 rev1536
|
Posted: 13 Dec 2009
|
|
Post subject: Re: Question regarding some custom ATO settings
|
|
ah.. okay shaking my head I swear I looked almost everywhere else before asking that question. Thank you again ReO..
I will try not to bug ya with too many stupid questions I promise.. BTW the sig works now thank you for that as well
BH
|
|
|
|
Back to top
|
|
|
|
|