Basic problem for advanced developper (include PHP)

More
13 years 7 months ago #10484 by ulounge
Hello,

We're using Joomla + a gavick template + Flexicontent.
Besides I inject personal php code through a functions.php file.

My problem is to know where to put it in order to access it everywhere.

So far, I put it in :
templates > gk_gamebox > layouts > default.php

This allows me to put it before HTML is generated by the gavick template.

The problem is, this way Flexicontent do not catch variables, functions, etc... from my functions.php :'(

So I put functions.php in Flexicontent templates, and this is bad cause :

- The php code is just in a div, if i need it in head or before, I'm stuck in Flexi.

- I got to put the inclusion on every Flexicontent template I use... >:(

And know I got to put a google map in the Flexicontent... and here is how it has to be done :

<?php
include_once("../include/GoogleMap.php");
include_once("../include/JSMin.php");

$MAP_OBJECT = new GoogleMapAPI(); $MAP_OBJECT->_minify_js = isset($_REQUEST["min"])?FALSE:TRUE;
$MAP_OBJECT->setDSN("mysql://user:password@localhost/db_name");
$MAP_OBJECT->addMarkerByAddress("Denver, CO","Marker Title", "Marker Description");
$MAP_OBJECT->addMarkerByAddress("Los Angeles, CA","Marker2 Title", "Marker2 Description");
?>
<html>
<head>
<?=$MAP_OBJECT->getHeaderJS();?>
<?=$MAP_OBJECT->getMapJS();?>
</head>
<body>
<?=$MAP_OBJECT->printOnLoad();?>
<?=$MAP_OBJECT->printMap();?>
<?=$MAP_OBJECT->printSidebar();?>
</body>
</html>


As you can see you have to include PHP stuff before the HTML tag, between HEADS ones, and in the BODY... eheh, here we are...

So if you put it all in the Gavick template, no prob.
But if you put the "before HTML" part and "HEAD" part in Gavick and the body one in Flexi, it goes like my functions.php inclusion in Gavick, it does not work... Variables, objects, functions, do not go through Flexi.

In this case Jumi like modules, do not help.

So here is my question

Is there a way for Joomla to be flexible with personal PHP code ? Is there a way to put it where we want and be able to acces data from everywhere ?

and for this case in particular :

Is the a way to access in Flexi, my PHP datas which are included in Gavick template ?

Thanks for your help

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.245 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline