How To Call Files From The Default Folder? »  Show posts from    to     

Icy Phoenix


English Chit Chat - How To Call Files From The Default Folder?



mort [ Sun 09 Nov, 2014 02:09 ]
Post subject: How To Call Files From The Default Folder?
Can someone show me how to call the files from the default theme folder before overwriting them with the theme files in question - Or point me to where Icy Phoenix does it?

Thanks...


Informpro [ Sun 09 Nov, 2014 16:16 ]
Post subject: Re: How To Call Files From The Default Folder?
Hey,

I'm not sure what you mean. IP should by default look in the default/ folder if it can't find it in your custom template folder.


mort [ Tue 11 Nov, 2014 10:52 ]
Post subject: Re: How To Call Files From The Default Folder?
Yeah! Well my senility is taking over and I assumed that MG would have made it more complicated than it needs to be....

So! without being code "specific" something like this should suffice?

Code: [Hide] [Select]
$dir = 'templates/';
$something = 'default';
if(exist($dir/$something)) {$template = '$something && $template';}
if(!exists($dir/$something)){echo 'Youv\'e deleted the Default theme STUPID';}




Mighty Gorgon [ Sun 16 Nov, 2014 10:33 ]
Post subject: Re: How To Call Files From The Default Folder?
The code used for Icy Phoenix is much more complex, because template system uses cache.

Anyway you can do something like this (taken from my plugins code) to assign a path:

Code: [Hide] [Select]
/*
* Get template file: check if template file exists and set the correct path to template file
*/
function get_tpl_file($tpl_base_path, $tpl_file)
{
global $theme;

$tpl_path = $tpl_base_path . 'default/' . $tpl_file;
$tpl_temp_file = $tpl_base_path . $theme['template_name'] . '/' . $tpl_file;
if (@file_exists($tpl_temp_file))
{
$tpl_path = $tpl_temp_file;
}
return $tpl_path;
}


mort [ Mon 01 Dec, 2014 08:15 ]
Post subject: Re: How To Call Files From The Default Folder?
Quote:
because template system uses cache.


Thanks Luca,

So does this games thing..

Now I'm about to start bumbling and bungling my way through this.

I doubt my ability to get it to work - But at least it'll keep me out of the pubs for a while...




Powered by Icy Phoenix