execute php code in kubrik sidebar execute php code in kubrik sidebar
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

execute php code in kubrik sidebar

Started by Col. Kurtz, August 24, 2005, 09:42:12 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Col. Kurtz

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?


Col. Kurtz

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

Nibbler


Col. Kurtz

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);

Col. Kurtz

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');

Nibbler

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();
}

Col. Kurtz

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?

Nibbler

Use a path as instructed, not an url.

Col. Kurtz

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

Nibbler

I don't know enough about serendipity to be able to help you with that I'm afraid.

Col. Kurtz