forum.coppermine-gallery.net
Support => cpg1.3.x Support => Older/other versions => cpg1.3 Themes/Skins/Templates => Topic started by: Col. Kurtz on August 24, 2005, 09:42:12 pm
-
Hello,
Is it possible to execute php code from another program in the kubrick template sidebar?
I use Serendipity ( a blog software) and my own modified kubrick theme in both applications. IŽd llike to show things from an Serendipity plugin. I was told to enter 3 lines of code if I can execute php there.
Is this possible?
If yes: Where to put those 3 lines?
-
Set it up a custom header/footer as in the docs.
http://coppermine.sourceforge.net/faq.php#customHeader
-
I followed those instructions, changed the path and get this error:
Parse error: parse error, unexpected '(', expecting ',' or ';' in /www/htdocs/w0058a3a/cm/themes/test/theme.php on line 777
-
Please post your changes.
-
function pageheader($section, $meta = '')
{
global $CONFIG, $THEME_DIR;
global $template_header, $lang_charset, $lang_text_dir;
if(empty($custom_header)){
include('http://www.test.hohle-phrasen.de/s9y/serendipity_config.inc.php');
static $custom_header = ob_get_contents();
ob_clean();
}
header('P3P: CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"');
user_save_profile();
$template_vars = array(
'{LANG_DIR}' => $lang_text_dir,
'{TITLE}' => $CONFIG['gallery_name'].' - '.$section,
'{CHARSET}' => $CONFIG['charset'] == 'language file' ? $lang_charset : $CONFIG['charset'],
'{META}' => $meta,
'{GAL_NAME}' => $CONFIG['gallery_name'],
'{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],
'{MAIN_MENU}' => theme_main_menu(),
'{ADMIN_MENU}' => theme_admin_mode_menu(),
'{CUSTOM_HEADER}' => $custom_header,
);
echo template_eval($template_header, $template_vars);
-
The code I was supposed to enter is:
include_once "/path/to/serendipity/serendipity_config.inc.php";
serendipity_plugin_api::generate_plugins('*', '', false, 'serendipity_plugin_linklist');
serendipity_plugin_api::generate_plugins('*', '', false, 'serendipity_plugin_recententries');
-
Change this
if(empty($custom_header)){
include('http://www.test.hohle-phrasen.de/s9y/serendipity_config.inc.php');
static $custom_header = ob_get_contents();
ob_clean();
}
to this
if(empty($custom_header)){
include_once "/path/to/serendipity/serendipity_config.inc.php";
serendipity_plugin_api::generate_plugins('*', '', false, 'serendipity_plugin_linklist');
serendipity_plugin_api::generate_plugins('*', '', false, 'serendipity_plugin_recententries');
static $custom_header;
$custom_header = ob_get_contents();
ob_clean();
}
-
done
new error message:
Warning: pageheader(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /www/htdocs/w0058a3a/cm/themes/test/theme.php on line 777
Warning: pageheader(http://www.test.hohle.phrasen.de/s9y/serendipity_config.inc.php): failed to open stream: Success in /www/htdocs/w0058a3a/cm/themes/test/theme.php on line 777
Warning: pageheader(): Failed opening 'http://www.test.hohle.phrasen.de/s9y/serendipity_config.inc.php' for inclusion (include_path='.:/usr/share/php') in /www/htdocs/w0058a3a/cm/themes/test/theme.php on line 777
Fatal error: Undefined class name 'serendipity_plugin_api' in /www/htdocs/w0058a3a/cm/themes/test/theme.php on line 778
looks like this is not working huh?
-
Use a path as instructed, not an url.
-
hmm ok
now it tries to access a file from the s9y folder, and cannot find it in the cpg folder.
"The requested URL /cm/serendipity_admin.php was not found on this server."
hmm
-
I don't know enough about serendipity to be able to help you with that I'm afraid.
-
Ok thank you anyway.