News:

Wondering if this will always be free?  See why free is better.

Main Menu

Paging

Started by mickjav, August 30, 2022, 05:18:09 PM

Previous topic - Next topic

mickjav

I've just added the below to my Artists recording system

$context['page_index_top'] = constructPageIndex($scripturl . '?action=music;area=artists;sa=home;art=' . $art . ';fmt=' . $f, $_GET['start'], $rec_total , 25);
This works without issue but I could like to use an anchor on the end of each page link Like

https://www.databasedreams.co.uk/charts/index.php?action=music;area=artists;sa=home;art=498661517;fmt=8;start=25#recs

Is there a way I could add the #recs element.

Thanks All the best mick

Diego Andrés

It would be after the url.
$scripturl '?action=music;area=artists;sa=home;art=' $art ';fmt=' $f$_GET['start'] . '#recs'

SMF Tricks - Free & Premium Responsive Themes for SMF.

mickjav

Quote from: Diego Andrés on August 30, 2022, 05:22:04 PMIt would be after the url.
$scripturl '?action=music;area=artists;sa=home;art=' $art ';fmt=' $f$_GET['start'] . '#recs'

Yes On each page link generated

mick

Diego Andrés

Yes just replace that first argument with that new url

SMF Tricks - Free & Premium Responsive Themes for SMF.

mickjav

Quote from: Diego Andrés on August 30, 2022, 05:29:29 PMYes just replace that first argument with that new url

Did Try That but generated This error "Uncaught Error: Cannot pass parameter 2 by reference in"


thanks mick

Diego Andrés

Sorry typed it on the phone. Your get is the second argument, first one is the url check the commas.

$scripturl '?action=music;area=artists;sa=home;art=' $art ';fmt=' $f
 . '#recs'

SMF Tricks - Free & Premium Responsive Themes for SMF.

mickjav

Quote from: Diego Andrés on August 30, 2022, 05:48:35 PMSorry typed it on the phone. Your get is the second argument, first one is the url check the commas.

$scripturl '?action=music;area=artists;sa=home;art=' $art ';fmt=' $f
 . '#recs'

Sure that was the way I had it before adding the Start Once the [start] was added the anchor didn't work as wasn't last item??


Do you know where the constructPageIndex function is I may just copy it into my module and edit as needed.

thanks mick

mickjav

Thought I would give it one more go lol

Tried

$context['page_index_top'] = constructPageIndex($scripturl . '?action=music;area=artists;sa=home;art=' . $art . ';fmt=' . $f . '#recs', $_GET['start'], $rec_total , 25);
And

$context['page_index_top'] = constructPageIndex($scripturl . '?action=music;area=artists;sa=home;art=' . $art . ';fmt=' . $f . ';#recs', $_GET['start'], $rec_total , 25);
Both mess the links up I.E. The format becomes 1#recs in both instances.

mick

Advertisement: