Author Topic: Random pictures  (Read 216714 times)

0 Members and 2 Guests are viewing this topic.

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Random pictures
« Reply #75 on: August 03, 2007, 01:12:19 AM »
Quote
Is it working for you at the moment?

Not install for me. Try on fresh ?
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 sydawn

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Random pictures
« Reply #76 on: August 03, 2007, 01:41:32 PM »
Hello

Did a fresh install and get this:

http://66.79.166.100/raw.JPG

All my files are media files, does that have anything 2 do with it?

Anyhow, the problem is here




Code: [Select]
$num_new_images = $config['image_cells'];

$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_viewimage", "NOTIN").", ".get_auth_cat_sql("auth_viewcat", "NOTIN")."))
       ORDER BY RAND()
       LIMIT $num_new_images";

Almost done I hope  :D

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Random pictures
« Reply #77 on: August 03, 2007, 01:59:29 PM »
Quote
All my files are media files, does that have anything 2 do with it?

This happend when upload image from ACP - > add images. Possible add image in thumbnail to media (accident). ;)
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 sydawn

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Random pictures
« Reply #78 on: August 03, 2007, 03:20:39 PM »
Hello

No, even doing it manually or adding into folder and then saying check new images, it adds them all fine, but when it comes to the detail page it has that 404 message.

The problem seems to be in the WHERE.... line
« Last Edit: August 03, 2007, 03:32:41 PM by sydawn »

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Random pictures
« Reply #79 on: August 03, 2007, 05:15:06 PM »
404 error page not WHERE - it mean page not found ... server return error ...
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 sydawn

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Random pictures
« Reply #80 on: August 03, 2007, 05:43:41 PM »
Well,

If I put what you suggested earliar:
Code: [Select]
WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id IN (".get_auth_cat_sql("auth_viewcat", $cat_id).")

Then the video plays but the SAME error code comes and NO thumbnails appear.

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Random pictures
« Reply #81 on: August 03, 2007, 08:33:31 PM »
Have .htaccess file from media ? If so, could not load for this . . .
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 ashfaq

  • Full Member
  • ***
  • Posts: 128
    • View Profile
Re: Random pictures
« Reply #82 on: September 04, 2007, 04:44:33 AM »
I am using this mod but it shows random thumbnails only on home page and didnt show on categories or any other page, plz tell me how to show random thumbnails on category pages also ?

Check it here: www.deskbeauty.com

Offline Mr_LovaLove

  • Full Member
  • ***
  • Posts: 233
  • Unkown
    • View Profile
Re: Random pictures
« Reply #83 on: September 05, 2007, 02:33:50 PM »
@ashfaq

i dont know if its correct to add the random in the details.html O_o

i checked ur site

seems u designed to not have the random

anyway, i didnt get ur question correctly

but u can take the image code lang and the thumb and  put anywhere  u want

ex:

for me {random_cat_image}

if you dont have it

plz try search engine for this fourm


search: {random_cat_image}

you will find it ! or use words

hope this help  you to get the differences between site random and cat random

English Please :@

Offline ashfaq

  • Full Member
  • ***
  • Posts: 128
    • View Profile
Re: Random pictures
« Reply #84 on: September 05, 2007, 05:28:24 PM »
I have sloved everything but this random images are not showing on details page.

Offline skidpics

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
Re: Random pictures
« Reply #85 on: September 26, 2007, 05:27:04 AM »
Quote from: Bomba
with this code it shows the same number of random images as the new images, but i would like to show only 6 random images.

my index shows 2 rows of new images (12 new images) and for the random images i just want 1 row (6 images)
on top of the code I posted (before/above the code), add this line:
Code: [Select]
$num_new_images = $config['image_cells'];
Where do we edit to show lets say 20 random images? 

Offline skidpics

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
Re: Random pictures
« Reply #86 on: October 05, 2007, 04:15:35 PM »
How would you include it into the home.html calling it via a require?

I like to my addons to be included, rather than copy / pasted into the template files.  This makes it easier to keep up with.

I am having a bit of a problem getting the random block to work like this.

Here is what I have in a random_image.php file:

Quote
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="head1">
<table width="100%" border="0" cellspacing="0" cellpadding="4">
 <tr>
  <td class="head1" valign="top">{lang_random_image}</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="head1">{random_images}</td>
</tr>
 </table>

Here is how I am trying to call it in the home.html template page: 

Quote
<?php
 require "{template_url}/addons/random_image.php";
?>


The code works if I paste it directly, but calling it as 'require' does not.. I want it working more like a 'plugin' style, to keep the code clean..

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Random pictures
« Reply #87 on: October 05, 2007, 08:55:24 PM »
Quote
The code works if I paste it directly, but calling it as 'require' does not.. I want it working more like a 'plugin' style, to keep the code clean..

You no can include PHP file in HTML template if EXEC_PHP_CODE is off from includes/constants.php file. If want it clean, no include PHP file in HTML - include PHP with PHP and register in HTML + parse. ;)
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 ashfaq

  • Full Member
  • ***
  • Posts: 128
    • View Profile
Re: Random pictures
« Reply #88 on: October 22, 2007, 03:35:37 AM »
This mod works but it also randomize category title, check my site http://www.deskbeauty.com
You told to put this code just on index.php but i put that code also on categories.php to show random thumbs on categories and it works great but it also randomize the category title, plz tell me how to solve this problem ? that it randomize thumbnails but not category title.
 I have also attached my category.php

Offline ashfaq

  • Full Member
  • ***
  • Posts: 128
    • View Profile
Re: Random pictures
« Reply #89 on: October 24, 2007, 03:35:22 AM »
This mod works but it also randomize category title, check my site http://www.deskbeauty.com
You told to put this code just on index.php but i put that code also on categories.php to show random thumbs on categories and it works great but it also randomize the category title, plz tell me how to solve this problem ? that it randomize thumbnails but not category title.
 I have also attached my category.php

Will anyone plz help ?