● Forum News Small update

Fri Nov 19, 2021 4:02 pm
Clan Leader
Top Dog
Nuke Dev / Coder
3029 Posts
coRpSE
Currently Offline
Offline

Most Played:
This week: 32.4hrs.
Total Played: 62hrs.


  
Is this your job?
Reputation: 7363.5
votes: 7
There was a very small update for the Forums News module today. Something I just noticed today on my site and instantly annoyed the hell out of me, so I had to fix it.

Issue:
When viewing on your home page, like normal, you would see the amount of articles that you selected in the backend, but, when you went to the module view,
Please login to see this link
Get registered or Log in
, you would see the same amount, and in my case, it was 3. That did not look right at all, so I changed it, and now it is set to 10 when viewing the module view.

To add this to your site, you can just redownload the module and upload the single file public_html/modules/Forum_News/index.php to that folder location on your site, OR, you can be adventuress and try to do it your self. To do that, do the following instructions.


Manual Edit:
Open: public_html/modules/Forum_News/index.php

FIND:

PHP:  [ Select all ]

    // Number of results per page
    
if(isset($_GET['page']) && is_numeric($_GET['page'])) {
    
$currentPage = (int)$_GET['page'];
    }else{
    
$currentPage 1;
    } 

 
NEW LINE || AFTER ADD:

PHP:  [ Select all ]

// Per page alteration if on home page or in module view
    
$per_page = (defined('HOME_FILE')) ? $perpage '10'

 
SAVE & UPLOAD


That's it. Nothing to it. All I did was add in a ternary operator that will determine if you are viewing from the home page or not, and if not, set the count to 10.


Expand
Forums ©