include SMF's ssi.php in anycontent include SMF's ssi.php in anycontent
 

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

include SMF's ssi.php in anycontent

Started by evillive, August 09, 2004, 03:32:57 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

evillive

I have searched and searched but have yet found a solution for my problem. I currenty have a site running SMF in our site template we have a section for site stats which uses smf SSI to include board stats, members, login and logout functions. I was able to get copermine to use the site template but the php in the tempalte.html did not work. After searching I found a use any content to create the section I wanted to show up and included it in the tempalte.html file,

this is what I used in anycontent.php

<?php require("/hsphere/local/home/mysite/mysite.com/yabbse_test/SSI.php"); ?>

<tr>
  <td class="tableb" >&nbsp; </td>
</tr>
<table width="150" border="0">
  <tr>
    <td><div align="center"><font color="#FFFFFF" size="2" face="Geneva, Arial, Helvetica, sans-serif">
        <?php ssi_whosOnline(); ?>
        </font><br>
        <br>
        <font size="2" face="Geneva, Arial, Helvetica, sans-serif">
        <?php ssi_boardStats(); ?>
        </font><br>
        <br>
        <font size="2" face="Geneva, Arial, Helvetica, sans-serif">
        <?php ssi_login(); ?>
        <?php ssi_welcome(); ?>
        <br>
        <?php ssi_logout(); ?>
        </font></div></td>
  </tr>
</table>



in my template.html I added <?php include 'anycontent.php'; ?>

and now I get this

Fatal error: Cannot redeclare db_query() (previously declared in /hsphere/local/home/mysite/mysite.com/myfolder/ds_album/include/functions.inc.php:71) in /hsphere/local/home/mysite/mysite.com/yabbse_test/Sources/Subs.php on line 104

any help ?

kegobeer

First:  I don't think this is the correct forum for the question.  I'm sure it will get moved to the correct board by a moderator.

Second: The reason you get that error is because SMF and Coppermine use the same names for their database connection functions.  You can't use SMF's SSI.php file at all with Coppermine.  All log in and log out functions must be done via the forums and not by using any of SMF's ssi functions.

I side stepped the problem by writing code that pulls the latests updates from my Coppermine gallery, and I put it in ssi.php.  Then I made a start page and included ssi.php so I had all the SMF functions and my custom function.  I don't display any SMF specific items on my Coppermine gallery - all login and logout functions are routed to my SMF forums.

You can check out my site to see what I did.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

Joachim Müller

I had this problem as well when I experimented with SMF's ssi.php inside anycontent. There are several identical function names that exist both in coppermine and SMF, that's why this fails. As a workaround you could rename the functions and function calls in coppermine (some php knowledge required). If you're not into coding I suggest you do as Kegobeer recommended and use his hack.

The devel team has this issue on the agenda for the next version: we will have to rename some coppermine functions to avoid collissions with other software.

GauGau

P.S. please use a better subject for your support request next time you post... ;)