PDF

More
16 years 3 weeks ago #3809 by vlester
Replied by vlester on topic PDF

accoman wrote: Je n'ai plus le message d'erreur mais j'ai juste le titre qui s'affiche et le reste s'est page blanche

Je pense que c'est parce que tu as ajouté l'accolade fermée après " echo $item->text;"
Il faut en fait l'ajouter juste avant.
Code:
<?php /** * @version 1.5 beta 5 $Id: view.pdf.php 183 2009-11-18 10:30:48Z vistamedia $ * @package Joomla * @subpackage FLEXIcontent * @copyright (C) 2009 Emmanuel Danan - www.vistamedia.fr * @license GNU/GPL v2 * * FLEXIcontent is a derivative work of the excellent QuickFAQ component * @copyright (C) 2008 Christoph Lukes * see www.schlu.net for more information * * FLEXIcontent is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ defined( '_JEXEC' ) or die( 'Restricted access' ); jimport( 'joomla.application.component.view'); /** * HTML Item View class for the FLEXIcontent component * * @package Joomla * @subpackage FLEXIcontent * @since 1.0 */ class FlexicontentViewItems extends JView { function display($tpl = null) { global $mainframe; $dispatcher =& JDispatcher::getInstance(); // Initialize some variables $item = & $this->get('Item'); $params = & $mainframe->getParams('com_flexicontent'); $fields = & $this->get( 'Extrafields' ); $tags = null; $categories = null; $favourites = null; $favoured = null; // process the new plugins JPluginHelper::importPlugin('content', 'image'); $dispatcher->trigger('onPrepareContent', array (& $item, & $params, 0)); $document = &JFactory::getDocument(); // set document information ?> <div style="font-family:times, garamond;text-align:justify;text-indent:0px;"> <?php $document->setTitle($item->title); $document->setName($item->alias); $document->setDescription($item->metadesc); $document->setMetaData('keywords', $item->metakey); // prepare header lines $document->setHeader($this->_getHeaderText($item, $params)); if (is_array($tab)) { foreach ($fields as $field) { if ($field->iscore == 1 || $field->field_type == ('image' || 'file')) { /* $results = $dispatcher->trigger('onDisplayCoreFieldValue', array( &$field, $item, &$params, $tags, $categories, $favourites, $favoured )); */ } else { $results = $dispatcher->trigger('onDisplayFieldValue', array( &$field, $item )); echo $field->label . ': '; echo $field->display . '<br />'; } } } echo $item->text; } function _getHeaderText(& $item, & $params) { // Initialize some variables $text = ''; if ($params->get('show_author')) { // Display Author name $text .= "\n"; $text .= JText::_( 'FLEXI_WRITTEN_BY' ).' '. ($item->created_by_alias ? $item->created_by_alias : $item->author); } if ($params->get('show_create_date') && $params->get('show_author')) { // Display Separator $text .= "\n"; } if ($params->get('show_create_date')) { // Display Created Date if (intval($item->created)) { $create_date = JHTML::_('date', $item->created, JText::_( 'DATE_FORMAT_LC2' )); $text .= $create_date; } } if ($params->get('show_modify_date') && ($params->get('show_author') || $params->get('show_create_date'))) { // Display Separator $text .= " - "; } if ($params->get('show_modify_date')) { // Display Modified Date if (intval($item->modified)) { $mod_date = JHTML::_('date', $item->modified); $text .= JText::_( 'FLEXI_LAST_REVISED' ).' '.$mod_date; } } return $text; } } ?> </div>
J'ai ajouté des CSS mais tu peux bien sûr les supprimer.

Please Log in or Create an account to join the conversation.

More
16 years 3 weeks ago #3813 by accoman
Replied by accoman on topic PDF
Rien a faire toujours page blance
voilà le code
<?php
/**
* @version 1.5 beta 5 $Id: view.pdf.php 183 2009-11-18 10:30:48Z vistamedia $
* @package Joomla
* @subpackage FLEXIcontent
* @copyright (C) 2009 Emmanuel Danan - www.vistamedia.fr
* @license GNU/GPL v2
*
* FLEXIcontent is a derivative work of the excellent QuickFAQ component
* @copyright (C) 2008 Christoph Lukes
* see www.schlu.net for more information
*
* FLEXIcontent is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/

defined( '_JEXEC' ) or die( 'Restricted access' );

jimport( 'joomla.application.component.view');

/**
* HTML Item View class for the FLEXIcontent component
*
* @package Joomla
* @subpackage FLEXIcontent
* @since 1.0
*/
class FlexicontentViewItems extends JView
{
function display($tpl = null)
{
global $mainframe;

$dispatcher =& JDispatcher::getInstance();

// Initialize some variables
$item = & $this->get('Item');
$params = & $mainframe->getParams('com_flexicontent');
$fields = & $this->get( 'Extrafields' );

$tags = null;
$categories = null;
$favourites = null;
$favoured = null;

// process the new plugins
JPluginHelper::importPlugin('content', 'image');
$dispatcher->trigger('onPrepareContent', array (& $item, & $params, 0));

$document = &JFactory::getDocument();

// set document information
$document->setTitle($item->title);
$document->setName($item->alias);
$document->setDescription($item->metadesc);
$document->setMetaData('keywords', $item->metakey);

// prepare header lines
$document->setHeader($this->_getHeaderText($item, $params));

if (is_array($tab))
{
foreach ($fields as $field)
{
if ($field->iscore == 1 || $field->field_type == ('image' || 'file'))
{
/*
$results = $dispatcher->trigger('onDisplayCoreFieldValue', array( &$field, $item, &$params, $tags, $categories, $favourites, $favoured ));
*/
}


else
{
$results = $dispatcher->trigger('onDisplayFieldValue', array( &$field, $item ));
echo $field->label . ': ';
echo $field->display . '<br />';
}
}
}
echo $item->text;
}

function _getHeaderText(& $item, & $params)
{
// Initialize some variables
$text = '';

if ($params->get('show_author')) {
// Display Author name
$text .= "\n";
$text .= JText::_( 'FLEXI_WRITTEN_BY' ).' '. ($item->created_by_alias ? $item->created_by_alias : $item->author);
}

if ($params->get('show_create_date') && $params->get('show_author')) {
// Display Separator
$text .= "\n";
}

if ($params->get('show_create_date')) {
// Display Created Date
if (intval($item->created)) {
$create_date = JHTML::_('date', $item->created, JText::_( 'DATE_FORMAT_LC2' ));
$text .= $create_date;
}
}

if ($params->get('show_modify_date') && ($params->get('show_author') || $params->get('show_create_date'))) {
// Display Separator
$text .= " - ";
}

if ($params->get('show_modify_date')) {
// Display Modified Date
if (intval($item->modified)) {
$mod_date = JHTML::_('date', $item->modified);
$text .= JText::_( 'FLEXI_LAST_REVISED' ).' '.$mod_date;
}
}
return $text;
}
}
?>
Quand je copie le code que tu ma donné j'ai le message suivant
Code: Select all

Please Log in or Create an account to join the conversation.

More
16 years 1 week ago #4181 by accoman
Replied by accoman on topic PDF
Bonjour pas de solution ?
j'ai crue comprendre que flexi ne prenait pas en compte les champs que l'on a crée dans un PDF.
Je vais changer de CCK domage il me plaisait bien,
ou trouver un autre solution afin de proposer des pdf de catalogue aux visiteurs de mon site
Si quelqu'un à une idée
Amicalement

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Save