Ad blocker detected: Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker on our website.
I'm trying to get Phoca to work on my joomla 1.7.3 site. I know i need to alter my template file located in
templates/your-template/html/com_content/article/default.php. I've seen similar questions answered by giving the phoca-pdf-installation-and-usage link. This does not help at all as my code does not look anything like the example given. It looks like this
<?php
defined('_JEXEC') or die;
require_once dirname(__FILE__) . str_replace('/', DIRECTORY_SEPARATOR, '/../../../functions.php');
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
$component = new ArtxContent($this, $this->params);
$article = $component->article('article', $this->item, $this->item->params, array('print' => $this->print));
echo $component->beginPageContainer('item-page');
if (strlen($article->pageHeading))
echo $component->pageHeading($article->pageHeading);
$params = $article->getArticleViewParameters();
if (strlen($article->title)) {
$params['header-text'] = $this->escape($article->title);
if (strlen($article->titleLink))
$params['header-link'] = $article->titleLink;
}
// Change the order of "if" statements to change the order of article metadata header items.
if (strlen($article->created))
$params['metadata-header-icons'][] = "<span class=\"art-postdateicon\">" . $article->createdDateInfo($article->created) . "</span>";
if (strlen($article->modified))
$params['metadata-header-icons'][] = "<span class=\"art-postdateicon\">" . $article->modifiedDateInfo($article->modified) . "</span>";
if (strlen($article->published))
$params['metadata-header-icons'][] = "<span class=\"art-postdateicon\">" . $article->publishedDateInfo($article->published) . "</span>";
if (strlen($article->author))
$params['metadata-header-icons'][] = "<span class=\"art-postauthoricon\">" . $article->authorInfo($article->author, $article->authorLink) . "</span>";
if ($article->printIconVisible)
$params['metadata-header-icons'][] = $article->printIcon();
if ($article->emailIconVisible)
$params['metadata-header-icons'][] = $article->emailIcon();
if ($article->editIconVisible)
$params['metadata-header-icons'][] = $article->editIcon();
if (strlen($article->hits))
$params['metadata-header-icons'][] = $article->hitsInfo($article->hits);
// Build article content
$content = '';
if (!$article->introVisible)
$content .= $article->event('afterDisplayTitle');
$content .= $article->event('beforeDisplayContent');
if (strlen($article->toc))
$content .= $article->toc($article->toc);
if (strlen($article->text))
$content .= $article->text($article->text);
if ($article->introVisible)
$content .= $article->intro($article->intro);
if (strlen($article->readmore))
$content .= $article->readmore($article->readmore, $article->readmoreLink);
$content .= $article->event('afterDisplayContent');
$params['content'] = $content;
// Change the order of "if" statements to change the order of article metadata footer items.
if (strlen($article->category))
$params['metadata-footer-icons'][] = "<span class=\"art-postcategoryicon\">"
. $article->categories($article->parentCategory, $article->parentCategoryLink, $article->category, $article->categoryLink)
. "</span>";
// Render article
echo $article->article($params);
echo $component->endPageContainer();
What in the world do i need to add to make the blasted icon show on the frontend?! i've tried comparing the native joomla files which are fine, but i don't know enough about php to know how to alter the above code.
I replaced the code with what you provided and got
Fatal error: Call to a member function get() on a non-object in /home/content/75/3187575/html/abramspc/administrator/components/com_phocapdf/helpers/phocapdf.php on line 65
Well you are on the right track, now the icon shows up but there is a rendering problem, I tried both force down and inline pop up settings and this is the result.
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 16 bytes) in /home/content/75/3187575/html/abramspc/administrator/components/com_phocapdf/assets/tcpdf/tcpdf.php on line 6912
both scripts created the pdf icon and allowed the page to display. the icon forces the other icons to wrap from 1 line to 3 lines, you can see here http://heymelby.com/abramspc/dispute-resolution. I tried removing icons in the backend by hiding them and they are still there.
I do not need your template! But the info that this is an Artisteer template explains the weird code! (^_^) Anyway! The error is caused by a php setting which limit the allowed memory size to 32MB. If possible edit the php.ini file (on linux you can find it in most cases in /etc/php5/apache2/) and set memory_limit to a higher value. If you have no access to this file you can maybe set it in the .htaccess file (php_value memory_size 64M for example). If this doesn't work, please contact your hoster. About the "new line" thing: You have to customize /JOOMLAROOT/administrator/components/com_phocapdf/helpers/phocapdf.php. Serach for the getPhocaPDF function and delete the parts where <li class="print-icon"> and </li> is added to the output.
I change the php5.ini file to allow for larger files and it still chokes on it.
with these settings
memory_limit = 64M
upload_max_filesize = 192M
post_max_size = 100M
file_uploads = On
i get
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 9116 bytes) in /home/content/75/3187575/html/abramspc/administrator/components/com_phocapdf/assets/tcpdf/tcpdf.php on line 19406
i upped the mem limit to 164 and get this result
Fatal error: Maximum execution time of 30 seconds exceeded in /home/content/75/3187575/html/abramspc/administrator/components/com_phocapdf/assets/tcpdf/tcpdf.php on line 18077
i'm going to try upgrading to php 5.3 and reinstall the plugin and component and see if that helps.
Hi, check the html of produced content - maybe it was saved to complicated which can have problems while processing it in TCPDF class (for example - if someone copy the code from Word processor, thousands of unnecessary styles, etc. are copied too)
Artisteer template should (I think) have no influence on the PDF as only the content from article is loaded to PDF, not the whole designed site but ... maybe it loads a lot of classes, so it can take some memory ... but no experiences with Artisteer
Happy to report that all is well on a fresh install. The issue ended up being database related. I did a fresh install on a new database AFTER setting php5.ini file size limits and tmp folder locations. Somehow setting the limits after installing the plugin and joomla did not mix well.
Happy to report that after doing that with all the code help from above (thanks you) the pocha plugin seems to be working well.
here is alink showing it working http://heymelby.com/joomart/using-jooml ... -beginners
thanks for everything!