This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

integrate into a php page
#1
Smile 

Hello and congrats for this system, works great. I have done the tests on the php page and it works with seperate database pages.

Now I have tried to integrate into the cms php page but cannot get it to work. It keeps loading something. Being it is not a <!DOCTYPE html> but actual php with theme attached I need to convert the code or set it so the so there is not need of the <?php and ?> as these are already at top and bottom of page. 

Example

<?
// 
// ------------------------------------------------------------------------- //
//               based on run-cms: Content Management for the Masses                  //
//                       < http://www.runcms.com >                          //
// ------------------------------------------------------------------------- //
// Original Author: David
// Author Website : http://www.dcgsnc.com
// Licence Type   : GPL
// ------------------------------------------------------------------------- //
include("header.php");
include(XOOPS_ROOT_PATH."/modules/variations/cache/config.php");
include(XOOPS_ROOT_PATH."/modules/variations/include/functions.php");


include_once(XOOPS_ROOT_PATH."/modules/variations/class/arbre.php");
$mytree = new XoopsArbre($db->prefix("variant_categories"),"cid","pid");


if($xoopsConfig['startpage'] == "variations"){
$xoopsOption['show_rblock'] =1;
include(XOOPS_ROOT_PATH."/header.php");
make_cblock();
echo "<br />";
}else{
$xoopsOption['show_rblock'] =0;
include(XOOPS_ROOT_PATH."/header.php");
}

#  function index
#####################################################
function index() {
global $db, $xoopsConfig, $xoopsUser, $moderated, $myts, $mytree, $souscat, $classm, $nbsouscat, $meta, $newann, $affichnbann;

    OpenTable();
##################### TITLE #######################  
        echo "<table width='100%' border='0' class='bg2' cellpadding='1' cellspacing='0' align='center'><tr><td>";         
        echo "<table width='100%' border='0' bgcolor='#FFFFFF' cellpadding='8' cellspacing='0' align='center' height='60'>";
        echo "<tr><td><font size='5' color='#007DCC'><b>$title</b></font><br /><font color='#98A4B9'><I>$type no$lid / "._VAR_VIEW2." no$view</I></font><br />";
         if ($code19) { echo "<IMG SRC=\"images/level/$code19.gif\" align=\"absmiddle\">"; }
        echo "</td><td align='right'>";
if ( $xoopsUser ) {
if ( $xoopsUser->isAdmin() ) { echo "<A HREF=\"admin/index.php?op=AnnoncesModAnnonce&lid=$lid\"><IMG SRC=\"images/modif.gif\" align=\"absmiddle\" BORDER=0 ALT=\""._VAR_MODADMIN."\"></A>&nbsp;<A HREF=\"supprann.php?op=AnnoncesDel&lid=$lid\"><IMG SRC=\"images/del.gif\" align=\"absmiddle\" border=0 ALT=\""._BOX_SUPPRANN."\"></a>&nbsp;&nbsp;"; }}
          if ($mem) { echo "<IMG SRC=\"images/mem/$mem.png\" align=\"absmiddle\">"; }
          echo "</td></tr></table>";  
 echo "</td></tr></table><br /><br />";

<?php
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<title>Example</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>
<body>
<?php
$cmtx_parameters = 'lid';
$cmtx_identifier = 'cmtx_url';
$cmtx_reference = 'Page One';
$cmtx_path = '../../myreview/';
require $cmtx_path . 'includes/commentics.php'; //don't edit this line
?>

include(XOOPS_ROOT_PATH."/footer.php");
 CloseTable();

}

---------------------------------------------------------------
the idea is to have the original theme but have the details of the item you are reviewing. 

Thanks I hope its clear enough as I am not a super specialist in php

regards David
Reply
#2

I managed to get it integrated into the page with the following

session_start();
echo "<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8'/></head><body>";
$cmtx_parameters = 'lid';
$cmtx_identifier = 'cmtx_url';
$cmtx_reference = 'Page One';
$cmtx_path = '../../myreview/';
require $cmtx_path . 'includes/commentics.php';
echo "</body></html>";

however it is loading something that I cannot identify

David
Reply
#3

After hours of search and test, I am down to a problem of header. It seems both use a theme and once you integrate into your theme it does a permenant search and does not let you insert comments. Easy to verify as I delete the header but keep the footer and all works well. As soon as I integrate the theme it goes. I found a post where you could delete the ajax at head.php, but this will only take out the permanent search but still does not insert comments. Anyone has any ideas would be great

thanks much david
Reply
#4

Hi David,

Try removing the session_start() line because your CMS probably has its own session.

Can you explain a bit more about how it's not letting you insert comments? Any error messages?

Also a link to the page would be really useful.

Have you completed the interview?
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by drwx
29-Jun-2023, 09:34 AM
Last Post by Steven
04-Jul-2020, 06:46 PM
Last Post by MattyP
13-Apr-2020, 08:33 PM
Last Post by Steven
20-Mar-2017, 09:09 PM
Last Post by Steven
04-Mar-2016, 06:53 PM
Last Post by Steven
21-Sep-2015, 05:40 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)