https://www.icyphoenix.com/viewtopic.php?f=17&t=9340
-----------------------------------
mort
Sun 09 Nov, 2014 02:09

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... :P


-----------------------------------
Informpro
Sun 09 Nov, 2014 16:16

Re: How To Call Files From The Default Folder?
-----------------------------------
Hey,

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


-----------------------------------
mort
Tue 11 Nov, 2014 10:52

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.... :twisted: 

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

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

 :mricy:  :mrgreen:  :mrblue:  :mrorange:  :mrviolet:  :mryellow:


-----------------------------------
Mighty Gorgon
Sun 16 Nov, 2014 10:33

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:

[codeblock]	/*
	* 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;
	}[/codeblock]


-----------------------------------
mort
Mon 01 Dec, 2014 08:15

Re: How To Call Files From The Default Folder?
-----------------------------------
[quote]because template system uses cache.[/quote]

Thanks Luca,

So does this games thing..  :? 

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

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


