[Feature request] Use Read more in Details button

Phoca Download - download manager
pweb
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 27 Aug 2010, 19:26
Location: Poland
Contact:

[Feature request] Use Read more in Details button

Post by pweb »

Hi,
I would like to have short intro text in Details button in category view
and full text in file view.

I think that Joomla Read More feature will be useful for this.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49144
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: [Feature request] Use Read more in Details button

Post by Jan »

Hi, added into feature request list.

Jan
If you find Phoca extensions useful, please support the project
pweb
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 27 Aug 2010, 19:26
Location: Poland
Contact:

Re: [Feature request] Use Read more in Details button

Post by pweb »

v1.3.7

file: components\com_phocadownload\models\file.php
method: getDocument

Code: Select all

	function getDocument( $fileId, $params, $limitstartUrl) {
		...
		
		if (empty($this->_document)) {	
			...
			
			// remove readmore tag
			$pattern = '#<hr\s+id=("|\')system-readmore("|\')\s*\/*>#i';
			$this->_document[0]->description	= preg_replace($pattern, ' ', $this->_document[0]->description);
			
		}
		return $this->_document;
	}
file: components\com_phocadownload\models\category.php
method: getDocumentList

Code: Select all

	function getDocumentList($categoryId, $params) {
		...
		
		if (empty($this->_document)) {	
			...
			
			// search for introtext
			$pattern = '#(.+)\s*<hr\s+id=("|\')system-readmore("|\')\s*\/*>#i';
			for ($i = 0; $i < count($this->_document); $i++) {
				$tagPos	= preg_match($pattern, $this->_document[$i]->description, $matches);
				if ($tagPos > 0) {
					$this->_document[$i]->description = $matches[1];
				}
			}
		}
		return $this->_document;
	}
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49144
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: [Feature request] Use Read more in Details button

Post by Jan »

Hi, thank you for this info.

Jan
If you find Phoca extensions useful, please support the project
Post Reply