Ana Sayfa Joomla Notlari Joomla Remository Yorum Bölümünde JComments Bileşenini Kullanmak
Joomla ile yapılan sitelerde dosya indirme bileşeni olarak Remository yoğunlukla kullanılır. Remository'nin yorum bölümü çok kullanışsız olmasından dolayı JComments Yorum Bileşeni ile entegre edeceğiz.

Çözüm önerisi JComments sitesinden geliyor ve oldukça kolay bir işlem sonucunda Remository yorum kısmında artık Jcomments yönetimi ele alacak.

remositoryFileInfoHTML.php isimli dosyayı düzenlemek için /components/com_remository/v-classes klasörüne girin. Dosya içerisinde şu kod bloğunu bulun:

Remository ve Jcomments Entegrasyonu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
if ($this->repository->Allow_Comments) {
$commentsdb = remositoryComment::getComments($file->id);
if ($commentsdb){
$this->tabcnt = 1;
$legend = _DOWN_COMMENTS;
foreach ($commentsdb as $comment) {
$this->showComment($legend, $comment);
// Uncomment the next line if you want to restrict to a single comment
// if ($comment->userid == $this->remUser->id) $hascommented = true;
}
}
else {
$legend = $this->remUser->isLogged() ? _DOWN_FIRST_COMMENT : _DOWN_FIRST_COMMENT_NL;
$this->fileOutputBox('', '<strong>'.$legend.'</strong>');
}
if ($this->remUser->isLogged() AND empty($hascommented)) $this->commentBox($file);
// include_once('components/com_reviews/reviews.class.php');
// include_once('components/com_reviews/reviews.html.php');
// echo HTML_reviews::listItemCommentsHTML('com_remository',$file->id);
// echo HTML_reviews::solicitCommentHTML('com_remository', $file->id, "&....
}


Bu kod bloğunun tamamını silip yerine aşağıdaki kodu yapıştırmanız yeterli olacaktır.

Joomla Remository ve JComments Entegrasyonu
1
2
3
4
5
6
7
if ($this->repository->Allow_Comments) {
$commentsAPI = JPATH_SITE.DS.'components'.DS.'com_jcomments'.DS.'jcomments.php';
if (file_exists($commentsAPI)) {
require_once($commentsAPI);
echo JComments::showComments($file->id, 'com_remository', $file->filetitle);
}
}


Dosyanın düzenlenmiş halini indirip direkt sitenize belirtmiş olduğumuz klasöre yükleyebilirsiniz.

Dosya Başlığı: Remository ve JComments Bileşeni Entegrasyonu (Details)
Dosya Türü: rar
Dosya Boyutu: 4.36 Kb
Lisans:
İndirilme: 45


Yorumlar  

 
0 #1 Ömer Faruk Özkan 09-01-2012 12:17
Paylasım için çok teşekkürler :)
Alıntı | Yöneticiye raporla
 

Yorum ekle


Güvenlik kodu
Yenile

Web Statistics