Author Topic: Admin setting to alter $num_new_images  (Read 3725 times)

0 Members and 1 Guest are viewing this topic.

Offline skidpics

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
Admin setting to alter $num_new_images
« on: October 05, 2007, 05:02:39 PM »
in the index file, there is $num_new_images, which controls the number of new images on the home page, and if installed, the number of random images displayed.  How can we make this an admin setting under the settings tab?  I would figure it would be integrated into the 'image settings', something that would ask, how many images would you like to show on the main page? 


Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Admin setting to alter $num_new_images
« Reply #1 on: October 05, 2007, 10:49:26 PM »
This is admin setting ... is in ACP - > Setting page ... image cells ...
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline Freddy99

  • Pre-Newbie
  • Posts: 3
    • View Profile
Re: Admin setting to alter $num_new_images
« Reply #2 on: July 30, 2008, 09:59:30 AM »
Hello!

No he meant this:

in index.php change from line 106 to 114:

$num_new_images = $config['image_cells'];
$howmany=9;
if ($_POST['setperpage']>=3)$howmany=$_POST['setperpage'];
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name")."
        FROM (".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
        LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
        WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id NOT IN (".get_auth_cat_sql("auth_viewcat", "NOTIN").")
        ORDER BY i.image_date DESC
        LIMIT $howmany";

In my honest optinion not being able to set this in the most recent version is a small bug.. should go to the core.. without $howmany hardcoded.

Best,
Freddy

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: Admin setting to alter $num_new_images
« Reply #3 on: July 30, 2008, 12:54:32 PM »
Hi Freddy,

... it's not a bug ... ;)
... but you are right with your opinion with the next version ...

FAQ -> How can I show more new images on home page? 
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...