Created
May 5, 2018 11:02
-
-
Save CB9TOIIIA/2f2fabfc862e5f33fe8b57ab42380db1 to your computer and use it in GitHub Desktop.
Знаете ли вы, что:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################## | |
if(isset($this->item->id)) { | |
$db = JFactory::getDBO(); | |
$db->setQuery("SELECT `introtext` FROM `#__content` WHERE `state`='1' AND `catid`='8' ORDER BY RAND() LIMIT 9"); | |
$rowznaete = $db->loadObjectList(); | |
echo '<div id="rand_block"> | |
<span class="namerand">Знаете ли вы, что:</span>'; | |
$cunt='0'; | |
foreach ($rowznaete as $znaete) { | |
$cunt ++; | |
$znaeteintro = strip_tags($znaete->introtext,'<sup>'); | |
if($cunt =='1') { | |
echo '<p id="rn'.$cunt.'" class="replika" style="display:block;">'.$znaeteintro.'</p>'."\n"; | |
} else { | |
echo '<p id="rn'.$cunt.'" class="replika" style="display:none;">'.$znaeteintro.'</p>'."\n"; | |
} | |
} | |
echo '</div>'."\n"; | |
} | |
################################## |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment