Permalink breaks record display of linked table

3 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: July 16, 2013   (RSS)

By jjem - July 11, 2013 - edited: July 16, 2013

Hi,

just bought the permalink add-on. Since then, for the records I entered a permalink, some information does not appear anymore. All other records which do not have a permalink set, this field is diplaying. Here is the page code at the top of the page:

<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php
$libraryPath = 'cmsAdmin/lib/viewer_functions.php';
$dirsToCheck = array('/chroot/home/jfzbinde/jfzbinden.ch/html/','','../','../../','../../../');
foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }
list($oeuvresRecords, $oeuvresMetaData) = getRecords(array(
'tableName' => 'oeuvres',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$oeuvresRecord = @$oeuvresRecords[0];
if (!$oeuvresRecord) { dieWith404("Record not found!"); }
?>
<?php list($editeursRecord) = getRecords(array(
'tableName' => 'editeurs',
'where' => "num = '{$oeuvresRecord['editeur']}'",
'limit' => '1',
));
$editeursRecord = @$editeursRecord[0]; // get first record
?>
<!DOCTYPE html>  etc.

and here is the concerned issue (in red). 

<dl class="dl-horizontal">
<?php if ($oeuvresRecord['texte'] != ""): ?><dt>Texte:</dt><dd><?php echo $oeuvresRecord['texte'] ?></dd><?php endif ?>
<?php if ($oeuvresRecord['instrumentation'] != ""): ?><dt>Instrumentation:</dt><dd><?php echo $oeuvresRecord['instrumentation'] ?></dd><?php endif ?>
<?php if ($oeuvresRecord['dedicace'] != ""): ?><dt>Dédicace:</dt><dd><em><?php echo $oeuvresRecord['dedicace'] ?></em></dd><?php endif ?>
<?php if ($oeuvresRecord['commande'] != ""): ?><dt>Commande:</dt><dd><?php echo $oeuvresRecord['commande'] ?></dd><?php endif ?>
<?php if ($oeuvresRecord['mouvements'] != ""): ?><dt>Mouvements:</dt><dd><?php echo $oeuvresRecord['mouvements'] ?></dd><?php endif ?>
<?php if ($editeursRecord['internet'] != ""): ?><dt>Editeur:</dt><dd><a href="http://<?php echo $editeursRecord['internet']; ?>" /><?php echo $editeursRecord['raison_sociale']; ?></a></dt><?php else: ?><dt>Editeur:</dt><dd><?php echo $editeursRecord['raison_sociale']; ?></dd><?php endif ?>
<?php if ($oeuvresRecord['remarques'] != ""): ?><dt>Remarques:</dt><dd><?php echo $oeuvresRecord['remarques'] ?></dd><?php endif ?>

<?php if ($oeuvresRecord['oe_creations'] != ""): ?><dt>Création:</dt><dd><?php echo join(', ', getListLabels('oeuvres', 'oe_creations', $oeuvresRecord['oe_creations'])); ?></dd><?php endif ?>
</dl>
<hr/>
<?php if (!$oeuvresRecord): ?>
No record found!<br/><br/>
<?php endif ?>
<!-- /STEP2: Display Records -->


<a href="<?php echo $oeuvresMetaData['_listPage']; ?>">&lt;&lt; Retour à la liste</a> -
<a href="mailto:?subject=<?php echo urlencode(thisPageUrl()) ?>">Envoyer cette page</a>

By gregThomas - July 16, 2013

Hi jjem,

What errors are you getting when the page loads? What happens if you use the showme function on the $editeursRecord:

<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php
$libraryPath = 'cmsAdmin/lib/viewer_functions.php';
$dirsToCheck = array('/chroot/home/jfzbinde/jfzbinden.ch/html/','','../','../../','../../../');
foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }
list($oeuvresRecords, $oeuvresMetaData) = getRecords(array(
'tableName' => 'oeuvres',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$oeuvresRecord = @$oeuvresRecords[0];
if (!$oeuvresRecord) { dieWith404("Record not found!"); }
?> 
<?php list($editeursRecord) = getRecords(array( 
'tableName' => 'editeurs', 
'where' => "num = '{$oeuvresRecord['editeur']}'", 
'limit' => '1', 
)); 
$editeursRecord = @$editeursRecord[0]; // get first record

showme($editeursRecord);
exit;

?> 

Please could you paste what is output from this code into a post for me?

If you run this code it will return an array of the items that are in the $editeursRecord if it has been created. This will allow me to see why the variables aren't appearing on the page.

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com