Author Topic: ** Random images not working, and top images also not working **  (Read 19105 times)

0 Members and 1 Guest are viewing this topic.

Offline zakaria666

  • Full Member
  • ***
  • Posts: 211
    • View Profile
I dont understand what the problem is :cry:

Basicailly, when user logs out of 4images, there are no RANDOM pictures being displayed on the left of the screen. Actually no images what so ever are being displayed on the front of the 4images user interface.

example go on  VANO's website http://4images.vano.org/ajaxcomments/index.php

he has images displayed on the front, new images, etc and even on the top images things are displayed. But for me when user is logged in then things are displayed, when user is not logged in nothing is displayed on front screen, its completly dead?

this is what is says on the front screen...

Categories
No categories found.
 

0 images in 0 categories.

New images
 
Currently there are no new images.
 

Currently active users: 1
There are currently 0 registered user(s) (0 among them invisible) and 1 guest(s) online.

 
 


what may be the problem?
thanks
« Last Edit: August 01, 2010, 05:19:07 PM by zakaria666 »

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: ** Random images not working, and top images also not working **
« Reply #1 on: August 01, 2010, 05:37:13 PM »
Two words: category permissions

If you set "view category" or "view images" permissions to anything other then "guest", then guests will not be able see the categories/images.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline zakaria666

  • Full Member
  • ***
  • Posts: 211
    • View Profile
Re: ** Random images not working, and top images also not working **
« Reply #2 on: August 01, 2010, 05:44:20 PM »
dude uuuuuuuu r a genius, i dont understand how did u even know that was the problem. U r so amazing bro,..

Sir u r a bloody genius. So on the side on the screen where the random pictures get shown is it only suppose to be 1 image per shown that is random per upload. Is there a way to tweak it so that for example 10 random new images are shown on the side of the homepage screen?

God bless u VANo

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline zakaria666

  • Full Member
  • ***
  • Posts: 211
    • View Profile
Re: ** Random images not working, and top images also not working **
« Reply #4 on: August 02, 2010, 10:46:02 PM »
Hello vano, thanks for the great links bro, I taken ur code which is without caches so new image every refresh however i want the image to go down a line, so basically with this code what happens is this.. firstly the code is below that i put into index.php and change {random_image} to {random_images}

Code: [Select]
//------------------------------------
//------- Random Images --------------
//------------------------------------
$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 IN (".get_auth_cat_sql("auth_viewcat").")
        ORDER BY RAND()
        LIMIT $num_new_images";
// end new
$result = $site_db->query($sql);
$num_rows = $site_db->get_numrows($result);

if (!$num_rows)  {
  $random_images = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"><tr class=\"imagerow1\"><td>";
//  $random_images .= $lang['no_new_images'];
  $random_images .= "</td></tr></table>";
}
else  {
  $random_images = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">";
  $count = 0;
  $bgcounter = 0;
  while ($image_row = $site_db->fetch_array($result)){
    if ($count == 0) {
      $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
      $random_images .= "<tr class=\"imagerow".$row_bg_number."\">\n";
    }
    $random_images .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";

    show_image($image_row);
    $random_images .= $site_template->parse_template("thumbnail_bit");
    $random_images .= "\n</td>\n";
    $count++;
    if ($count == $config['image_cells']) {
      $random_images .= "</tr>\n";
      $count = 0;
    }
  } // end while

  if ($count > 0)  {
    $leftover = ($config['image_cells'] - $count);
    if ($leftover >= 1) {
      for ($f = 0; $f < $leftover; $f++) {
        $random_images .= "<td width=\"".$imgtable_width."\">\n&nbsp;\n</td>\n";
      }
      $random_images .= "</tr>\n";
    }
  }
  $random_images .= "</table>\n";
} // end else


$site_template->register_vars("random_images", $random_images);
unset($random_images);

//----- End Random Images---------


Before


After



I want it to go down in one single line, but as u can see what happens after is it goes into 2 lines. Is there a way i can tweak this sir to let it go down in 1 line?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: ** Random images not working, and top images also not working **
« Reply #5 on: August 02, 2010, 10:54:59 PM »
In the code you posted replace all $config['image_cells'] with 1
It should do it.

P.S.
Next time please reply to the topic you have question about (the code you showed is from another topic, obviously) to avoid confusion and unnecessary questions for others who might be looking for the same solution.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline zakaria666

  • Full Member
  • ***
  • Posts: 211
    • View Profile
Re: ** Random images not working, and top images also not working **
« Reply #6 on: August 02, 2010, 11:32:17 PM »
OMg thank u for the reply, i promise i wont do it again im sorry, but now i have another issue, and i dont know where to reply here or on the other topic, i mean

Now when i go into my html home index when i log out no images are shown, its not the permissions but i think it was something from ur pervious topic which u can let a user display an XX about of pictures, i cant seem to find it, ive been trying to search for it. it was the option of u letting us display an XX amount of images on the index, and i think this maybe causing the problem. If not, i dont know what is because i replaced home.html and i replaced index.php.

when i also on top images while logged out i cannot ee the images when i log in i can, im 100% sure its not the permissions because i didnt even touch it.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: ** Random images not working, and top images also not working **
« Reply #7 on: August 02, 2010, 11:43:12 PM »
what are the permission on your categories?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline zakaria666

  • Full Member
  • ***
  • Posts: 211
    • View Profile
Re: ** Random images not working, and top images also not working **
« Reply #8 on: August 02, 2010, 11:49:56 PM »
Only for registered users. So everything should be fine, but its not :-(

I attempted to do ur code, of making random pictures be sown on the side, then i undone it, and then reverted it back to default, then i logged off and nothing was showing, no images no random images, with the random images table on the table, its a little off on the random section. as u can see from the image below the random section isnt align to the column it a milimetre off.

also no images being shown. I really dont know why this is happening, i have put back the default, index.php and home.html and i am still having this problem




Do u want to have a look and browse the site ???

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: ** Random images not working, and top images also not working **
« Reply #9 on: August 03, 2010, 12:28:17 AM »
when you logout you become guest, not registered user...
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline zakaria666

  • Full Member
  • ***
  • Posts: 211
    • View Profile
Re: ** Random images not working, and top images also not working **
« Reply #10 on: August 03, 2010, 12:44:57 AM »
but how do i become guest, if so how do i fix it sir? Sir i promise u i havent touched anything i swear on my mothers life, i just logged out and it was blank, i mean its strange, how do i fix it
« Last Edit: August 03, 2010, 12:55:09 AM by zakaria666 »

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: ** Random images not working, and top images also not working **
« Reply #11 on: August 03, 2010, 01:12:50 AM »
Guest is a visitor who is not logged in.
Registered member is a visitor who is logged in with a regular member account
Administrator is a visitor who is logged with an administrator account.

I hope this clears thing up a bit.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline zakaria666

  • Full Member
  • ***
  • Posts: 211
    • View Profile
Re: ** Random images not working, and top images also not working **
« Reply #12 on: August 03, 2010, 02:14:03 AM »
hello  i just want to apologize, u r a good person and im very sorry for asking alot of questions, please dont hesitate to tell me to stop, i can be a handful at times.

Sir i have a question, can i ask u to do me a favour, i have a problem with the table section in the random section, basicailly what has happened is that the table is shifted and is not in line with the column? As u can see from the arrow below where it is pointing at,  could u please advice me on what u may think is the problem,.,,




Rembrandt

  • Guest
Re: ** Random images not working, and top images also not working **
« Reply #13 on: August 03, 2010, 05:23:57 AM »
...
 basicailly what has happened is that the table is shifted and is not in line with the column? ...
search in your templates/home.html
Code: [Select]
{if random_image}
                  <table width="150" border="0" cellspacing="0" cellpadding="0">
and replace:
Code: [Select]
{if random_image}
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">

mfg Andi

Offline zakaria666

  • Full Member
  • ***
  • Posts: 211
    • View Profile
Re: ** Random images not working, and top images also not working **
« Reply #14 on: August 03, 2010, 06:32:00 PM »
Hello remembrant,

i installed the mod http://www.4homepages.de/forum/index.php?topic=3529.0 photo of the day, i then placed the    {potd_image}  next to the random pictures and the same problem of the tables shifting has occured, previously my problem was the random table but that has since been fixed with ur help but now its the photo of the day thats giving me problems... as u can see below... any tips