JMM Posted March 21, 2024 Report Share Posted March 21, 2024 TNG 14.x Hello, folks, When we display browsemedia.php (by selecting All Media, Documents, Photos, etc.), over in the Linked to column, by default TNG displays perhaps a maximum of about a dozen or so individuals for each media item. If more than that number of individuals are linked to a media item, TNG displays ['More Links'] after the last person, which when clicked on takes the user to the actual media item (showmedia.php), with more individuals listed in the details near the bottom in that page's Linked to section. Sometime earlier this year or last year, someone told me how to increase the number of individuals in the Linked to column for each media item. An example of the increased number of individuals linked can be see here on THIS page. If you look at the 4th media item (Paget) on that page, notice that I have 81 individuals listed. However, I need to drastically increase the number of individuals linked, but my problem is that I can't remember where to make that change, nor who was the person in the forums that told me how to do that . I've searched the forums here, my PMs, and my personal email, but I am unable to find where I was told what to change. And I don't think that it is a Mod on my site that has increased that number. So my 1st question is: what file do I modify, and exactly what in that file do I modify, in order for browsemedia.php to display more individuals in the Linked to column? Now, I just noticed for that same 4th media item on that page, that although browsemedia shows the first 81 individuals before the ['More Links'] is displayed, the showmedia.php page for that same 4th media item shows the next 54 individuals linked to that 4th media item, and the users needs to keep pressing ['More Links'] to see the next group of individuals, etc. So my 2nd question is: where is it defined to only show on the showmedia.php page 54 individuals at a time, as I would like to be able to change it so that showmedia.php shows all of the remaining individual linked to each media item... if possible. Thank you in advance, and have yourselves a great day. Regards, John Quote Link to comment Share on other sites More sharing options...
GOGGS Posted March 21, 2024 Report Share Posted March 21, 2024 The short answer is that this page (like a lot of others) uses SQL "paging" which shows a batch of results, with a page length (e.g. 100 rows) and an offset from the 1st row (the "page"). The SQL clause is LIMIT x OFFSET y so in my example, the 3rd page would be LIMIT 100 OFFSET 3 for rows 301-400. the browsemedia.php file uses your $maxsearchresults setting from configuration (but doubles it ??), and adds the offset to see more when over this amount. You may have your max search results set at 40 (?), and thus the behavior. You could change the value from 40 or since this "doubling" before paging exists in this php file, maybe change that? Look at line 58 (at least in v13) and change $maxsearchresults *= 2; to *= 4; or 8, or ??? That's a quick thought; that page is complex (for what it seems to be doing)... Cheers GOGGS Quote Link to comment Share on other sites More sharing options...
Katryne Posted March 21, 2024 Report Share Posted March 21, 2024 John, I just tried to modify this setting : Max Search Results in Setup >> Configuration >> General Settings >> Miscellaneous and it does the trick. Quote Link to comment Share on other sites More sharing options...
GOGGS Posted March 21, 2024 Report Share Posted March 21, 2024 Actually John, after trying something, there's a line that limits the results in the query more directly. Line 190 $maxplus = $maxsearchresults + 1; If you change that line to $maxplus = $maxsearchresults + 100; (for example), in your case you would get 80 + 100 or 180. I think this is where you could change it to get the number you want to limit in that column before getting the "More Links" hyperlink... GOGGS Quote Link to comment Share on other sites More sharing options...
GOGGS Posted March 21, 2024 Report Share Posted March 21, 2024 @Katryne thanks for validating that! The only thing I don't like about changing that, is that it's universal, and would affect your "people" search, etc... GOGGS Quote Link to comment Share on other sites More sharing options...
Ken Roy Posted March 21, 2024 Report Share Posted March 21, 2024 You would need to ask Darrin to add a Max Search for Media similar to the Max Search for DNA Test that is different than the universal Max Search. Quote Link to comment Share on other sites More sharing options...
GOGGS Posted March 21, 2024 Report Share Posted March 21, 2024 39 minutes ago, Ken Roy said: You would need to ask Darrin to add a Max Search for Media similar to the Max Search for DNA Test that is different than the universal Max Search. Agreed. But this seems like a very specialized use case, compared to having a photo (e.g.) linked to the person that's in it... GOGGS Quote Link to comment Share on other sites More sharing options...
Katryne Posted March 21, 2024 Report Share Posted March 21, 2024 I have got a wedding photo with 96 persons or a settlement map with 20 settlers. This can happen. Quote Link to comment Share on other sites More sharing options...
JMM Posted March 21, 2024 Author Report Share Posted March 21, 2024 4 hours ago, GOGGS said: Actually John, after trying something, there's a line that limits the results in the query more directly. Line 190 $maxplus = $maxsearchresults + 1; If you change that line to $maxplus = $maxsearchresults + 100; (for example), in your case you would get 80 + 100 or 180. I think this is where you could change it to get the number you want to limit in that column before getting the "More Links" hyperlink... Bingo. That worked. I changed it to: $maxplus = $maxsearchresults + 210; ...and it seems to have done the trick! Thanks, Gary. Just trying to allow my users to see information without having to keep clicking the ['More Links'] hyperlink, for the very-few images that I have with many people linked to them. Thanks again, everyone, and have yourselves a great day. Regards, John Quote Link to comment Share on other sites More sharing options...
JMM Posted April 3, 2024 Author Report Share Posted April 3, 2024 A couple of weeks ago, Gary (GOGGS) came up with a solution to the Linked to column height on media pages. Thanks again, Gary. Chances are that there are not many TNG sites with media linked to a large number of users, but there are at least a few sites (such as Katryne's) that have at least 1 media item with many people linked to them. If anyone else is now using Gary's solution too, you may wish to take a look & try Robin Richmond's Browsemedia Medialinks mod. What it does is reduce the number of linked-to individuals to about 9 people, but it then adds vertical scroll-bars on the right for each media item with more than 9 individuals, as you can see HERE with one of my media types. It also shows the number of linked-to individuals for each media items, as well as an unobtrusive Expand button for each media item, which when clicked expands the linked-to items to show them all without needing to scroll (and without needing to use Gary's solution). I just thought that I would mention the above, as the hack in this post is no longer needed. On my sites, I countinue to use Gary's hack, so that if I ever uninstall the Browsemedia Medialinks mod for whatever reason, my media items will still show everyone linked to them . Regards & have a great day, John Quote Link to comment Share on other sites More sharing options...
stores Posted April 3, 2024 Report Share Posted April 3, 2024 Thank you for that bit of info John, and i thank Robin for the mod. I had to remove "Media_display_columns_V12.1.0.0" mod to install it but no problem as i like the new look on my tng 13 site. Happy Hunting all, Jim Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.