• Welcome to Simple Machines Community Forum. Please login or sign up.
January 26, 2022, 07:21:18 PM

News:

SMF 2.0.19 has been released! Please update. Read more.


Getting link counter to work in Search.php

Started by spiros, October 02, 2021, 02:31:09 PM

Previous topic - Next topic

spiros

I am trying to use $link['counter'] in Search.php like this:

'link' => '<a href="#ref_' . $link['counter'] . '" aria-label="Jump up" title="Jump up"><i class="fas fa-angle-up"></i></a> <a href="' . $scripturl . '?topic=' . $message['id_topic'] . '.0" target="mytargeta">' . $message['first_subject'] . '</a>',

So that this bit

' . $link['counter'] . '"
Produces the number for the respective go to topic anchor on top. The html output indicates that it is not parsed:
<a href="#ref_" aria-label="Jump up" title="Jump up"><i class="fas fa-angle-up"></i></a>
For the time being I use a generic anchor to the first topic (#ref_1) in all cases. Test search results

Steve

Please do not PM me for support.

Bugo


spiros


Advertisement: