1. Nikolai
  2. Български
  3. Thursday, 16 February 2012
  4.  Subscribe via email
Здравей, Даниел,
може ли да ми удариш едно рамо? Опитвам да вкарам пхп код в {body}-то на шаблона, но...не мога да го подкарам
ето и кодът:
<?php $user =& JFactory::getUser();
if ($user->guest) { ?>нещо си<?php } ?>
но не ще и не ще. къде бъркам?
Responses (5)
Daniel Dimitrov
Support team
Accepted Answer Pending Moderation
Няма да стане, понеже това си е html file и ние го парсваме сами. CComment5 ще ползва joomla template системата и там такъв код би функционирал.

При версия 4, ще трябва да се занимаваш с промени директно в php класовете.

components/com_comment/classes/joomlacomment/JOSC_post.php в този файл погледни post_htmlCode функцията. Там може би ще ти стане ясно как заменяма {podobni_stringowe} с някакъв output. Тъпа работа :(, но преди 6 години нямаше joomla templating... и това си беше добър начин за работа...

Поздрави,
Даниел
Please if you use our extensions be so kind and review them at JED
Matukio | Hotspots Pro | CComment Pro
  1. more than a month ago
  2. Български
  3. # 1
Accepted Answer Pending Moderation
Благодаря за инфото, ще опитам от там.
Само че подобен път при мен липсва - модифицирал съм версията за мои цели, и затова стоя с първата ваша версия, която съм качил - !JoComment 4.0 beta1
сега ще погледна в components/com_comment/joscomment/comment.class.php
поздрави
  1. more than a month ago
  2. Български
  3. # 2
Accepted Answer Pending Moderation
:) Да, точно там:
/*
* construct HTML (by replacement...)
*/
$html .= "<div id='comment'>";

$html .= $this->_body;

$html = JOSC_utils::checkBlock('library', $this->_template_library, $html); /* js scripts ... */
$html = JOSC_utils::checkBlock('ads', false, $html, $this->insertAds());
$html = JOSC_utils::checkBlock('menu', false, $html, $this->insertMenu());
$html = JOSC_utils::checkBlock('post', false, $html, $this->insertComments());
/*number of comments - it is better to do it here as we already have populated the $this->_total variable */
$html = str_replace('{NUMBER_OF_COMMENTS}', $this->_number_of_comments , $html);
$html = JOSC_utils::checkBlock('form', false, $html, $this->insertForm());
$html = JOSC_utils::checkBlock('pagenav', false, $html, $this->insertPageNav());
$html = JOSC_utils::checkBlock('poweredby', false, $html, $this->insertPoweredby());
}
остава само да го направя както ми трябва
благодаря отново, Даниел
  1. more than a month ago
  2. Български
  3. # 3
Daniel Dimitrov
Support team
Accepted Answer Pending Moderation
аааа, точно в comment.class.php e JOSC_post класа. В новата версия всичките класове които са в comment.class.php са пръснати в отделни файлове...

Поздрави,
Даниел
Please if you use our extensions be so kind and review them at JED
Matukio | Hotspots Pro | CComment Pro
  1. more than a month ago
  2. Български
  3. # 4
Accepted Answer Pending Moderation
:) Наложи ми се да правя доработка на една преработка от преди доста време. И за да не губя време - питаh гугъл, който ме прати индиректно във форума.
Целият пост си е офтопик, но...поздрави от последния мохикан - !JoComment 4.0 beta1 (може да е последен, ама е модерно оборудван с rich snippets)
  1. more than a month ago
  2. Български
  3. # 5
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Last questions

J5 compatibility for Hotspots
Hi guys, Just started to update my old J3x website. Is there J5 compatibility p...
1 Replies
Posted on Monday, 24 February 2025
  • #Hotspots
  • #hotspots Joomla 5
Text size in the comment input form
Hello. How can I increase the font size in the comment input field? For examp...
0 Replies
Posted on Wednesday, 26 February 2025
  • #CComment 6
Problem with enlarged image
Hello. When you click on the image in the comments, it does not appear in the ce...
1 Replies
Posted on Wednesday, 26 February 2025
Black square instead of images in comments
Hello. In comments instead of images I see black squares. Here is an example. h...
0 Replies
Posted on Wednesday, 26 February 2025
  • #ccoment pro
Link bug in comment emails
Hello. The site has three languages. For example, a user left a comment on an a...
3 Replies
Posted on Saturday, 15 April 2023