add php content in the theme add php content in the theme
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

add php content in the theme

Started by djriknet1, January 24, 2007, 03:26:31 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

djriknet1

Dear everybody,

I Like to have this:
<link rel="StyleSheet" href="dtree.css" type="text/css" />
<script type="text/javascript" src="dtree.js"></script>

<?php

require_once (
"../gallery/outside/cpmfetch.php");
require_once ("../gallery/outside/plugins/dtree.php");
$objCpm = new cpm("../gallery/outside/cpmfetch_config.php");
$dtree = new cpm_dtree($objCpm);
print $dtree->getHeaderContent();

?>



in the head of the template, and this:


<div class="dtree">
<p><a href="javascript: d.openAll();">open all</a> | <a href="javascript: d.closeAll();">close all</a></p>

<?php print $dtree->getTree(); ?>


</div>



somewhere in the code where the anycontent cannot be used (side navigation bar)

the thing i like to display is visable here:
http://www.tropicalview.net/newsletter/index.php


Please let me know, if i just put those 2 parts in the template.html it doesn't work, so i think it should be located in the theme.php.

For the ones who like to see the code, i will attach the index.php as shown  above  and a zip of my theme

Greetings

Hendrik

Gizmo

Try the {CUSTOM_HEADER} or {CUSTOM_FOOTER} tags. Check the manual or search the forum for info on these.
Did you read the manual first???? Taking 2 minutes to backup your files can save you hours of wondering what you screwed up.
Billy Bullock - BullsEyePhotos Blog of Indecision

djriknet1

if i put this part: 

<?php

require_once (
"../gallery/outside/cpmfetch.php");
require_once ("../gallery/outside/plugins/dtree.php");
$objCpm = new cpm("../gallery/outside/cpmfetch_config.php");
$dtree = new cpm_dtree($objCpm);
print $dtree->getHeaderContent();

?>



in a tree.php file
and include this in custom header:
/gallery/tree.php


I will get this:

getHeaderContent(); ?>   

in top of my page.


Still the same, the require_once will not be used it seems.

Gizmo

If you're going to be using this in your gallery then why not just follow the steps in the DTree post. Only if you wish to show this structure on an external webpage do you need to use cpmFetch.
Did you read the manual first???? Taking 2 minutes to backup your files can save you hours of wondering what you screwed up.
Billy Bullock - BullsEyePhotos Blog of Indecision

djriknet1

Toghether with Vuud, we programmed it in cmpfetch.
and now it's working very fast, instead of about 4 seconds to collect the information with the normal DTREE

So I like to use it with the CMPFetch

vuud

Quote from: Gizmo on January 24, 2007, 04:21:02 PM
If you're going to be using this in your gallery then why not just follow the steps in the DTree post. Only if you wish to show this structure on an external webpage do you need to use cpmFetch.

Hey Gizmo,

For speeds-sake using it outside of a template and inside a template, we integrated dtree with cpmfetch.  Its actually really really fast - I ended up having to make two SQL calls to get all the information (breaking cpmfetch's long standing tradition of one sql call for anything).  I took a look at the existing code in that link and there were a great many SQL calls being made.  So the larger your gallery, the more calls it had to make...

The only reason I ended up at two calls was that I could not come up with one SQL call that would include both empty categories and albums unassigned.  Ah well. 

I have not checked, but cpmfetch should also use the existing connection, so there is no extra DB connection delay.  I think.

Take care,

Vuud



Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

Gizmo

Sorry, I didn't know you were developing a new tool. I couldn't find any reference with dtree and cmpFetch but this sounds like a better solution if you can reduce the loading time by that much. :D  Not sure why it's not working using the {CUSTOM_HEADER} tag but if you attach the dtree.php file, I'll be happy to help in anyway I can. I assume the dtree.php file referenced above is different than the one that came with the original plugin.
Did you read the manual first???? Taking 2 minutes to backup your files can save you hours of wondering what you screwed up.
Billy Bullock - BullsEyePhotos Blog of Indecision