how to include a .php file in my cpg 1.3x standalone? how to include a .php file in my cpg 1.3x standalone?
 

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

how to include a .php file in my cpg 1.3x standalone?

Started by SnakeBite, November 22, 2005, 09:26:06 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

SnakeBite

Hello,
obviouly I am not yet allowed to start a new thread.
I've got a quite simple question for you I think ;)
I want to include a php file into my cpg 1.32 (standalone) with transmission theme.
Where (in which file(s)) do I have to include it?
My standart language for the gallery is german.
I plan to have the php file on the left site under the "register" button.

Thanks.



SnakeBite

Hi,
i have a problem, i edited the file (theme.php) as it is mentioned in the FAQ and i Put in the code:

if(empty($custom_header)){
      include('../../../website/path/file.php');
      static $custom_header = ob_get_contents();
      ob_clean();
   }


but an error occured:

Parse error: parse error, unexpected '(', expecting ',' or ';' in /usr/export/www/vhosts/funnetwork/hosting/mysnakebite/coppermine/themes/transmission/theme.php on line 889


and line 889 said:
Quotestatic $custom_header = ob_get_contents();

Thanks.

Joachim Müller


SnakeBite

Oh yeas sorry I missed that one.
But can you tell me why there only stands
Quote{CUSTOM_HEADER}
and why there isn`t my php file that i want to include there.
May i put in the wrong directory in the theme.php?

Thanks

Nibbler



Nibbler

You have added your {CUSTOM_HEADER} tag after the {GALLERY} tag. This makes it a custom footer, not a custom header. You need to edit the function pagefooter() instead of pageheader(). Search the board for more details.

SnakeBite

#9
Hi,
now I inserted it before the {GALLERY} tag and it is still just the text showing in the gallery :(

Edit: I tested to modify the page footer like the guy did in this thread: http://forum.coppermine-gallery.net/index.php?topic=19936.0
// Function for writing a pagefooter
function pagefooter()
{
    global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_SERVER_VARS;
    global $USER, $USER_DATA, $ALBUM_SET, $CONFIG, $time_start, $query_stats, $queries;;
    global $template_footer;

     if(empty($custom_footer)){
       include('http://www.mystaffie.com/_footer.php');
       /*static*/ $custom_footer = ob_get_contents();
       ob_clean();
      }   

    if ($CONFIG['debug_mode']==1 || ($CONFIG['debug_mode']==2 && GALLERY_ADMIN_MODE)) {
    cpg_debug_output();
    }
   
    $template_vars = array(
      '{CUSTOM_FOOTER}' => $custom_footer,
        );

    echo template_eval($template_footer, $template_vars);
}


But that doesn't work at all.
If I do so, it looks like this:
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fimg516.imageshack.us%2Fimg516%2F2069%2Ferror3wi.jpg&hash=e29ff759628a2256b31bc8611fdfa3f342aa16a4)
(only powered by... and the flags)

Help is appreciated,
thanks

Nibbler

There's a lot of additional html in that file, it's more than just a footer. You'll need to add in extra tables to your template.html for it to produce valid html.

SnakeBite

Hi,
oh I feared that :(
Is it maybe possible that you can help me with that?
Via ICQ or PN?

lokking hopefully,
Thanks

SnakeBite

#12
Hi,
I added another table but it doesn't work at all.

Please help me.
Can you perhaps post how to add a proper table in here (template.html) to include a custom footer:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="{LANG_DIR}">
  <head>
    <title>
      {TITLE}
    </title>
    {META} 
    <meta content="text/html; charset={CHARSET}">
    <meta content="no-cache">
    <link rel="stylesheet" type="text/css" href="themes/transmission/style.css">
    <style type="text/css">
    .encoding {
       display:{ENCODING};
       border-collapse:collapse;
    }
    </style>
<script type="text/javascript" src="scripts.js">
</script>
  </head>
  <body>

    <table border="0" width="100%" height="100%" cellpadding="0" cellspacing="0" style="border-collapse: collapse;background-color: #6c6c6c;" bordercolor="#111111">
      <tr>
        <td background="themes/transmission/images/transmission_LEFT.gif" width="25"><img src="themes/transmission/images/transmission_LEFT.gif" width="25" height="50"></td>
        <td colspan="2">
          <table cellpadding="0" cellspacing="0" border="0">
            <tr>
              <td><img src="themes/transmission/images/transmission_TITLEC1.gif" class="title_image_left" width="15" height="50"></td>
              <td width="100%" height="50" background="themes/transmission/images/transmission_TITLEC2.gif">
                <div class="gal_name">
                  {GAL_NAME}
                </div>
              </td>
              <td><img src="themes/transmission/images/transmission_TITLEC3.gif" class="title_image_right" width="15" height="50"></td>
            </tr>
          </table>
        </td>
        <td background="themes/transmission/images/transmission_RIGHT.gif" width="25"><img src="themes/transmission/images/transmission_RIGHT.gif" width="25" height="50"></td>
      </tr>
      <tr height="100%" valign="top">
        <td background="themes/transmission/images/transmission_LEFT.gif" width="25">
        </td>
        <td style="width:1%">
          <table cellpadding="0" cellspacing="0" class="content_area">
            <tr>
              <td style="background:url(themes/transmission/images/transmission_R1C1.gif);width:7px;height:25px"><img src="themes/transmission/images/transmission_R1C1.gif" width="7" height="25">
              </td>
              <td style="background:url(themes/transmission/images/transmission_R1C2.gif);width:8px;height:25px"><img src="themes/transmission/images/transmission_R1C2.gif" width="8" height="25">
              </td>
              <td width="100%" style="background:url(themes/transmission/images/transmission_R1C3.gif);height:25px"><span class="menu_title">control panel</span></td>
              <td style="background:url(themes/transmission/images/transmission_R1C4.gif);width:9px;height:25px"><img src="themes/transmission/images/transmission_R1C4.gif" width="9" height="25">
              </td>
              <td style="background:url(themes/transmission/images/transmission_R1C5.gif);width:6px;height:25px"><img src="themes/transmission/images/transmission_R1C5.gif" width="6" height="25">
              </td>
            </tr>
            <tr>
              <td style="background:url(themes/transmission/images/transmission_R2C1.gif);width:7px;height:25px"><img src="themes/transmission/images/transmission_R2C1.gif" width="7" height="25">
              </td>
              <td colspan="3" style="background-color:#5B5B5B;text-align:center;">{MAIN_MENU2}<img class="topmenu_transmission" src="themes/transmission/images/transmission.gif" width="120" height="21"><br>
              {MAIN_MENU1}</td>
              <td style="background:url(themes/transmission/images/transmission_R2C5.gif);width:6px;height:25px"><img src="themes/transmission/images/transmission_R2C5.gif" width="6" height="25">
              </td>
            </tr>
            <tr>
              <td style="background:url(themes/transmission/images/transmission_R3C1.gif);width:7px;height:5px"><img src="themes/transmission/images/transmission_R3C1.gif" width="7" height="5"></td>
              <td colspan="3" style="background:url(themes/transmission/images/transmission_R3C2.gif);height:5px">
              </td>
              <td style="background:url(themes/transmission/images/transmission_R3C5.gif);width:6px;height:5px"><img src="themes/transmission/images/transmission_R3C5.gif" width="6" height="5"></td>
            </tr>
          </table>
        </td>
        <td>
          <table border="0" cellpadding="0" cellspacing="0" class="content_area" width="100%">
            <tr>
              <td style="background:url(themes/transmission/images/transmission_R1C1.gif);width:7px;height:25px"><img src="themes/transmission/images/transmission_R1C1.gif" width="7" height="25">
              </td>
              <td style="background:url(themes/transmission/images/transmission_R1C2.gif);width:8px;height:25px"><img src="themes/transmission/images/transmission_R1C2.gif" width="8" height="25">
              </td>
              <td width="100%" style="background:url(themes/transmission/images/transmission_R1C3.gif);height:25px"><span class="menu_title">transmission</span></td>
              <td style="background:url(themes/transmission/images/transmission_R1C4.gif);width:9px;height:25px"><img src="themes/transmission/images/transmission_R1C4.gif" width="9" height="25">
              </td>
              <td style="background:url(themes/transmission/images/transmission_R1C5.gif);width:6px;height:25px"><img src="themes/transmission/images/transmission_R1C5.gif" width="6" height="25">
              </td>
            </tr>
            <tr>
              <td style="background:url(themes/transmission/images/transmission_R2C1.gif);width:7px;height:25px"><img src="themes/transmission/images/transmission_R2C1.gif" width="7" height="25">
              </td>
              <td colspan="3" style="background-color:#5B5B5B;">
                <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%">
                  <tr>
                    <td align="right" valign="top" style="background-color:#5B5B5B;"><img src="themes/transmission/images/transbox.gif" width="126" height="13"></td>
                  </tr>
                </table>
                {ADMIN_MENU}{GALLERY}
              </td>
              <td style="background:url(themes/transmission/images/transmission_R2C5.gif);width:6px;height:25px"><img src="themes/transmission/images/transmission_R2C5.gif" width="6" height="25">
              </td>
            </tr>
            <tr>
              <td style="background:url(themes/transmission/images/transmission_R3C1.gif);width:7px;height:5px"><img src="themes/transmission/images/transmission_R3C1.gif" width="7" height="5"></td>
              <td colspan="3" style="background:url(themes/transmission/images/transmission_R3C2.gif);height:5px">
              </td>
              <td style="background:url(themes/transmission/images/transmission_R3C5.gif);width:6px;height:5px"><img src="themes/transmission/images/transmission_R3C5.gif" width="6" height="5"></td>
            </tr>
          </table>
        </td>
        <td background="themes/transmission/images/transmission_RIGHT.gif" width="25">
        </td>
      </tr>

SnakeBite

Hi,
just to show you what my problem is/what I am trying to do:
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fimg11.imageshack.us%2Fimg11%2F2144%2Fgallery5fn.jpg&hash=dadd8df34425fe71e9cf843b90a6b0d0e655721d)


Thanks

SnakeBite