In the cell that contains<p>', $txt['started_by'], ' ', $topic['first_post']['member']['link'], '
<small id="pages' . $topic['first_post']['id'] . '">', $topic['pages'], '</small>
</p>
I'd like to check for each cell if the topic has multiple pages, and if so, define a different class for a potion of the code. is there a variable that asks if the topic has more than one page?
The only one is $topic['pages']
Lainaus käyttäjältä: live627 - kesäkuu 27, 2014, 02:14:42 AP
The only one is $topic['pages']
Thanks so much! This works for me:
// Is this topic new? (assuming they are logged in!)
if ($topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $topic['new_href'], '" id="newicon' . $topic['first_post']['id'] . '"><img src="', $settings['lang_images_url'], '/new.gif" alt="', $txt['new'], '" /></a>';
// IF PAGES
if ($topic['pages'])
echo '
<p class="starty"><span id="bye' . $topic['first_post']['id'] . '">', $txt['started_by'], ' ', $topic['first_post']['member']['link'], '</span>
<span id="pages' . $topic['first_post']['id'] . '">Pages: ', $topic['pages'], '</span>
</p>';
// IF NO PAGES
if (!$topic['pages'])
echo '
<p class="startynopage"><span id="bye' . $topic['first_post']['id'] . '">', $txt['started_by'], ' ', $topic['first_post']['member']['link'], '</span>
<span id="pages' . $topic['first_post']['id'] . '">', $topic['pages'], '</span>
</p>';
echo '
</div>With some css:
.starty *[id*='pages'] { display: none; }
.starty:hover *[id*='pages'] { display: inline; }
.starty:hover *[id*='bye'] { display: none; }