Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1] 2   Go Down

Author Topic: Invalid argument supplied for foreach() in..  (Read 19848 times)

0 Members and 1 Guest are viewing this topic.

hilophilo

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Invalid argument supplied for foreach() in..
« on: November 19, 2003, 04:38:32 pm »

Warning: Invalid argument supplied for foreach() in /.../gallery/themes/hardwired/theme.php on line 1131

i get this warning in the album page. how do i get rid of it?
Logged

hilophilo

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Invalid argument supplied for foreach() in..
« Reply #1 on: November 24, 2003, 09:37:03 am »

i seem to get this problem again . Its when i made a album and made it private for only memebers to see it. And when i come back to the gallery front page and try to access my albums it says that line...
Warning: Invalid argument supplied ...
Logged

Oasis

  • VIP
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 252
  • iNSiGNiA
    • Pixnet Gallery
Invalid argument supplied for foreach() in..
« Reply #2 on: November 24, 2003, 02:28:05 pm »

in the theme.php of the theme you are using, find

Code: [Select]
foreach($alb_list as $album) {
$count ++;

$params = array('{COL_WIDTH}' =>
$column_width,
'{ALBUM_TITLE}' => $album['album_title'],
'{THUMB_CELL_WIDTH}' => $thumb_cell_width,
'{ALB_LINK_TGT}' => "thumbnails.php?album=
{$album['aid']}",
'{ALB_LINK_PIC}' => $album['thumb_pic'],
'{ADMIN_MENU}' => $album['album_adm_menu'],
'{ALB_DESC}' => $album['album_desc'],
'{ALB_INFOS}' => $album['album_info'],
);

echo template_eval($album_cell, $params);

if ($count % $columns == 0 && $count < count
($alb_list)) {
echo $rows_separator;
}
}

and add before it
Code: [Select]
if (is_array($alb_list)) {
and after it
Code: [Select]
}
Logged
Pixnet Gallery: http://www.pixnet.net
iNSiGNiA Weblog: http://www.jayliu.org

hilophilo

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Invalid argument supplied for foreach() in..
« Reply #3 on: November 24, 2003, 10:03:13 pm »

the warnings is gone but now i cant view, edit my album, etc.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Invalid argument supplied for foreach() in..
« Reply #4 on: November 24, 2003, 10:17:08 pm »

Oasis has taken a look into this - seems to be related to wrong coppermine setup, please check the tracker # 825373

GauGau
Logged

Oasis

  • VIP
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 252
  • iNSiGNiA
    • Pixnet Gallery
Invalid argument supplied for foreach() in..
« Reply #5 on: November 25, 2003, 01:12:52 am »

OK, this is going to require some more work than I thought.... For the time being, if you want it to work correctly, go to the configuration screen of coppermine, and turn "Show private album Icon to unlogged user" to "Yes". This will solve the problems temporarily (until we find a fix for it)

Let me check this..
Is this what you did: You created an album with the admin accout, and set it so that only members of a certain group can see it, then you can't edit it anymore. Am I correct?

@gaugau: It doesn't seem to be a setup problem. It happens on a clean install too.
Logged
Pixnet Gallery: http://www.pixnet.net
iNSiGNiA Weblog: http://www.jayliu.org

hilophilo

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Invalid argument supplied for foreach() in..
« Reply #6 on: November 25, 2003, 02:01:38 am »

thats right.
Logged

Oasis

  • VIP
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 252
  • iNSiGNiA
    • Pixnet Gallery
Invalid argument supplied for foreach() in..
« Reply #7 on: November 25, 2003, 02:23:18 am »

For now, set "Show private album Icon to unlogged user" to "Yes"

and you will be able to see/edit the album
Logged
Pixnet Gallery: http://www.pixnet.net
iNSiGNiA Weblog: http://www.jayliu.org

Tarique Sani

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 2712
    • http://tariquesani.net
Invalid argument supplied for foreach() in..
« Reply #8 on: November 25, 2003, 03:13:25 am »

The show_private part of the code looks different from the one I coded

@Oasis: Look at
Code: [Select]
theme_display_album_list($alb_list, $nbAlb, $cat, $PAGE, $totalPages); and the code before Line 422 in index.php

@DJMaze: We are using CVS do not leave messy commented out code - delete code if you are commiting, Add comments of changes done in code as well as CVS comment
Logged
SANIsoft PHP applications for E Biz

scharn

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Excellent
« Reply #9 on: November 26, 2003, 06:33:54 am »

I too have been noticing this exact problem.  Adding a reply for my personal benefit in case the thread discussion continues.
Logged

Oasis

  • VIP
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 252
  • iNSiGNiA
    • Pixnet Gallery
Invalid argument supplied for foreach() in..
« Reply #10 on: November 27, 2003, 06:42:04 pm »

Sorry for the delay, here is the fix. Please tell me if it doesn't work (and if it does):

In index.php, find:
Code: [Select]

        if ($count > 0) {
            $visibility = $alb_thumb['visibility'];

and replace with:
Code: [Select]
           $visibility = $alb_thumb['visibility'];
        if ($count > 0) {


Then, find:
Code: [Select]
       } else {
            $image_size = compute_img_size(100, 75, $CONFIG['alb_list_thumb_size']);
            $alb_list[$alb_idx]['thumb_pic'] = "<img src=\"images/nopic.jpg\" {$image_size['geom']} alt=\"\" border=\"0\" class=\"image\" />";
   }

and replace with:
Code: [Select]
       } else {
            if ($visibility == '0' || $visibility == (FIRST_USER_CAT + USER_ID) || strstr(USER_GROUP_SET, $visibility)) {
            $image_size = compute_img_size(100, 75, $CONFIG['alb_list_thumb_size']);
            $alb_list[$alb_idx]['thumb_pic'] = "<img src=\"images/nopic.jpg\" {$image_size['geom']} alt=\"\" border=\"0\" class=\"image\" />";
   }
}


Last, of course, if you haven't already done so, wrap the problematic foreach code (in you theme.php) in between the code as posted previously.

Please tell me if this fixes you problems.
Logged
Pixnet Gallery: http://www.pixnet.net
iNSiGNiA Weblog: http://www.jayliu.org

hilophilo

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Invalid argument supplied for foreach() in..
« Reply #11 on: December 08, 2003, 09:05:14 pm »

works great now. thanks.  :lol:
Logged

Lovato

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Dont work
« Reply #12 on: December 09, 2003, 03:47:37 pm »

Hi... these changes does not work.. :/
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Dont work
« Reply #13 on: December 09, 2003, 05:36:59 pm »

Quote from: "Lovato"
Hi... these changes does not work.. :/
hmmm, others reported it works fine for them. Got a link so we can take a look for ourselves?

GauGau
Logged

simplythi

  • Coppermine newbie
  • Offline Offline
  • Posts: 19
error out of the blue.
« Reply #14 on: December 12, 2003, 08:56:43 pm »

Warning: Invalid argument supplied for foreach() in /home/noono/public_html/themes/noono/theme.php on line 1100

Can someone help me figure out what this error is, it just came on one day. I dont understand why.
Logged

sjakie70

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Warning: Invalid argument supplied for foreach() in /data/me
« Reply #15 on: December 18, 2003, 10:33:59 am »

I changed the album propeties and now i get dies strange error mesage

Warning: Invalid argument supplied for foreach() in /data/members/paid/w/e/wedano.com/htdocs/foto/themes/igames/theme.php on line 1159

whats wrong ??
url : foto.wedano.com

click on the mooie meisjes album, and there it is

resolved thnx
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Invalid argument supplied for foreach() in..
« Reply #16 on: December 18, 2003, 02:06:46 pm »

moved/merged your posting to the thread dealing with foreach-issue.

GauGau

P.S. Above link may lead to partial nudity, be warned (at least that's what I think "meisjes" means...)
Logged

d3

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Invalid argument supplied for foreach() in..
« Reply #17 on: December 24, 2003, 02:57:03 pm »

I tried the fix, but it's still not working:

http://d3.neopages.net/gallery
Logged

Sert Turk

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
Invalid argument supplied for foreach() in..
« Reply #18 on: January 15, 2004, 07:37:32 pm »

OK,I did both code changes and it got rid of the error I was getting (Warning: Invalid argument supplied for foreach() in /home/apollo5/public_html/akgun/themes/hardwired/theme.php on line 1131)

But now ,I don't see any albums.It just says 1 Albums but no tubmnail or edit options at all.I only see Random Pictures and Last editions.

Any ideas?
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Invalid argument supplied for foreach() in..
« Reply #19 on: January 15, 2004, 09:45:26 pm »

have you set the 'show private icon to unlogged user' in config to YES.
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here
Pages: [1] 2   Go Up
 

Page created in 0.025 seconds with 18 queries.