But the code don't work. I notice that the getGroupDuplicates return
1, or in my "article" i have uploaded two images also i have one
duplicate field "image" with two uploaded images (label are "image" &
"image(2)").
I don't understand why you use the getGroupDuplicates? In the
documentation i read : Get number of group duplicates given field
name. Or i want the number of duplicates fields "image" why use a
group function? :-§
Sorry for my english and thanx again.
On 20 mar, 17:13, Rich <rich.b.des...@gmail.com> wrote:
<ul><li> <?php echo get
('track',$i,1)?></li></ul>
<?php endfor;?>
It kinda works, the loop itterates for the amount of duplicate fields
(tracks) but only returns the first value...then the last value, n-1
times.
So for example I have the tracks:
1. "Intro"
2. "Into the Infinity of Thoughts"
3. "The Burning Shadows of Silence"
4. "Cosmic Keys to My Creations and Times"
5. "Beyond the Great Vast Forest"
6. "Towards the Pantheon"
7. "The Majesty of the Night Sky"
8. "I Am the Black Wizards"
9. "Inno a Satana"
The above code returns:
1. "Intro"
2. "Inno a Satana"
3. "Inno a Satana"
4. "Inno a Satana"
5. "Inno a Satana"
6. "Inno a Satana"
7. "Inno a Satana"
8. "Inno a Satana"
9. "Inno a Satana"
<ul><li> <?php echo get
('track',1,$i)?></li></ul>
<?php endfor;?>
In the line :<?php echo get('track',$i,1)?> the $i variable represents
the group or you need to have the duplicate field in the variable for
that just do this : <?php echo get('track',1,$i)?>
I hope this work for you
Thanx
On 23 mar, 20:30, Karl <audioundergrou...@googlemail.com> wrote:
> <ul><li> <?php echo get
> ('track',$i,1)?></li></ul>
> <?php endfor;?>
> It kinda works, the loop itterates for the amount ofduplicatefields
> (tracks) but only returns the first value...then the last value, n-1
> times.
> So for example I have the tracks:
> 1. "Intro"
> 2. "Into the Infinity of Thoughts"
> 3. "The Burning Shadows of Silence"
> 4. "Cosmic Keys to My Creations and Times"
> 5. "Beyond the Great Vast Forest"
> 6. "Towards the Pantheon"
> 7. "The Majesty of the Night Sky"
> 8. "I Am the Black Wizards"
> 9. "Inno a Satana"
> The above code returns:
> 1. "Intro"
> 2. "Inno a Satana"
> 3. "Inno a Satana"
> 4. "Inno a Satana"
> 5. "Inno a Satana"
> 6. "Inno a Satana"
> 7. "Inno a Satana"
> 8. "Inno a Satana"
> 9. "Inno a Satana"
I have successfully created a loop like you good folks have been
discussing here but then a problem cropped up when I removed one of
the duplicates.
I had created a list of staff members for a company page but when
number 2 on the list left and a replacement joined the CMS operaration
fell down.
The space created by the deletion in the sequence of IDs was filled on
the web page by a duplicate of a name from further down the list and
the replacement does not appear at all. I am thiking that this problem
is caused by the hole in the sequence. Whereas i had IDs 1 to 9, now I
have IDs 1 to 10 except number 2 is missing.
Reading back I don't think I was very clear with my explanation of my
problem.
The basic issue is that when I loop Group Duplicates everything worked
well until I had to delete an entry from the middle of the duplicate
list. The loop still counts the now deleted ID and displays the wrong
information.
Please let me know if anybody has a solution to this. If I create a
new group duplicate it adds it to the bottom as opposed to using the
deleted ID.
> Reading back I don't think I was very clear with my explanation of my
> problem.
> The basic issue is that when I loop Group Duplicates everything worked
> well until I had to delete an entry from the middle of theduplicate
> list. The loop still counts the now deleted ID and displays the wrong
> information.
> Please let me know if anybody has a solution to this. If I create a
> new groupduplicateit adds it to the bottom as opposed to using the
> deleted ID.
> Reading back I don't think I was very clear with my explanation of my
> problem.
> The basic issue is that when I loop Group Duplicates everything worked
> well until I had to delete an entry from the middle of the duplicate
> list. The loop still counts the now deleted ID and displays the wrong
> information.
> Please let me know if anybody has a solution to this. If I create a
> new group duplicate it adds it to the bottom as opposed to using the
> deleted ID.
> <ul><li> <?php echo get
> ('albimg',1,$i)?></li></ul>
> I just get the same albimg for both groups.
> On Mar 27, 7:36 am, eyegaze <m.a.cana...@eyegaze.tv> wrote:
> > Hi
> > Reading back I don't think I was very clear with my explanation of my
> > problem.
> > The basic issue is that when I loop Group Duplicates everything worked
> > well until I had to delete an entry from the middle of theduplicate
> > list. The loop still counts the now deleted ID and displays the wrong
> > information.
> > Please let me know if anybody has a solution to this. If I create a
> > new groupduplicateit adds it to the bottom as opposed to using the
> > deleted ID.
> > <ul><li> <?php echo get
> > ('albimg',1,$i)?></li></ul>
> > I just get the same albimg for both groups.
> > On Mar 27, 7:36 am, eyegaze <m.a.cana...@eyegaze.tv> wrote:
> > > Hi
> > > Reading back I don't think I was very clear with my explanation of my
> > > problem.
> > > The basic issue is that when I loop Group Duplicates everything worked
> > > well until I had to delete an entry from the middle of theduplicate
> > > list. The loop still counts the now deleted ID and displays the wrong
> > > information.
> > > Please let me know if anybody has a solution to this. If I create a
> > > new groupduplicateit adds it to the bottom as opposed to using the
> > > deleted ID.
> > > On Mar 27, 7:36 am, eyegaze <m.a.cana...@eyegaze.tv> wrote:
> > > > Hi
> > > > Reading back I don't think I was very clear with my explanation of my
> > > > problem.
> > > > The basic issue is that when I loop Group Duplicates everything worked
> > > > well until I had to delete an entry from the middle of theduplicate
> > > > list. The loop still counts the now deleted ID and displays the wrong
> > > > information.
> > > > Please let me know if anybody has a solution to this. If I create a
> > > > new groupduplicateit adds it to the bottom as opposed to using the
> > > > deleted ID.
> > > > I just get the same albimg for both groups.
> > > > On Mar 27, 7:36 am, eyegaze <m.a.cana...@eyegaze.tv> wrote:
> > > > > Hi
> > > > > Reading back I don't think I was very clear with my explanation of my
> > > > > problem.
> > > > > The basic issue is that when I loop Group Duplicates everything worked
> > > > > well until I had to delete an entry from the middle of theduplicate
> > > > > list. The loop still counts the now deleted ID and displays the wrong
> > > > > information.
> > > > > Please let me know if anybody has a solution to this. If I create a
> > > > > new groupduplicateit adds it to the bottom as opposed to using the
> > > > > deleted ID.
how to display all the fields clear and works well! But do the
duplication of 3 photos for example, No. 1 = 1.jpg, No. 2 = 2.jpg, No. 3 =
3.jpg all displayed excellent! Now remove the number 2 and then
refresh the page! Conclusion incorrect! In this case, total = 2,
picture number 2 should be = 3.jpg! Ie after removing duplicate photos
of his id is not changed!
I'm not sure to understand what you're saying.
It works perfectly for me even if I remove duplicated images. Well,
actually, duplicated groups : I tried to duplicate image fields inside
a group but they keep disappearing when I save my post. So I didn't
even try to use them in my theme.
There must be a huge problem with the way id are dispatched, if that
is what you are pointing.
But I believe each image you insert should have at least a description
associated (which could be useful in many ways : title, alt,
caption...), so the duplicated groups will do for me.
On Jun 4, 5:13 am, Maguar <michaelyu...@yandex.ru> wrote:
> > > > > I just get the same albimg for both groups.
> > > > > On Mar 27, 7:36 am, eyegaze <m.a.cana...@eyegaze.tv> wrote:
> > > > > > Hi
> > > > > > Reading back I don't think I was very clear with my explanation of my
> > > > > > problem.
> > > > > > The basic issue is that when I loop Group Duplicates everything worked
> > > > > > well until I had to delete an entry from the middle of theduplicate
> > > > > > list. The loop still counts the now deleted ID and displays the wrong
> > > > > > information.
> > > > > > Please let me know if anybody has a solution to this. If I create a
> > > > > > new groupduplicateit adds it to the bottom as opposed to using the
> > > > > > deleted ID.
> how to display all the fields clear and works well! But do the
> duplication of 3 photos for example, No. 1 = 1.jpg, No. 2 = 2.jpg, No. 3 =
> 3.jpg all displayed excellent! Now remove the number 2 and then
> refresh the page! Conclusion incorrect! In this case, total = 2,
> picture number 2 should be = 3.jpg! Ie after removing duplicate photos
> of his id is not changed!
I faced with the same problem and after spent 1 hours to look through
the internet, I found the solution.
In the file get-custom.php add this function:
/** Developed by Thang
* Return a array with the all distinct values in one array
*
* @param string $groupName
*/
function getDistinctGroupOrder(){
global $post,$wpdb;
$elements = $wpdb->get_results("SELECT DISTINCT group_count FROM
".RC_CWP_TABLE_POST_META." WHERE post_id = ".$post->ID." ORDER BY
order_id ASC");
foreach($elements as $element){
$order[] = $element->group_count;
}
return $order;
}
---------------------------------------------------
Here is my for loop:
$group_orders = getDistinctGroupOrder();
foreach($group_orders as $group_order)
{
$value= get('field',$group_order,1);
> > > > > I just get the same albimg for both groups.
> > > > > On Mar 27, 7:36 am, eyegaze <m.a.cana...@eyegaze.tv> wrote:
> > > > > > Hi
> > > > > > Reading back I don't think I was very clear with my explanation of my
> > > > > > problem.
> > > > > > The basic issue is that when I loop Group Duplicates everything worked
> > > > > > well until I had to delete an entry from the middle of theduplicate
> > > > > > list. The loop still counts the now deleted ID and displays the wrong
> > > > > > information.
> > > > > > Please let me know if anybody has a solution to this. If I create a
> > > > > > new groupduplicateit adds it to the bottom as opposed to using the
> > > > > > deleted ID.
> how to display all the fields clear and works well! But do the
> duplication of 3 photos for example, No. 1 = 1.jpg, No. 2 = 2.jpg, No. 3 =
> 3.jpg all displayed excellent! Now remove the number 2 and then
> refresh the page! Conclusion incorrect! In this case, total = 2,
> picture number 2 should be = 3.jpg! Ie after removing duplicate photos
> of his id is not changed!
> I faced with the same problem and after spent 1 hours to look through
> the internet, I found the solution.
> In the file get-custom.php add this function:
> /** Developed by Thang
> * Return a array with the all distinct values in one array
> *
> * @param string $groupName
> */
> function getDistinctGroupOrder(){
> global $post,$wpdb;
> $elements = $wpdb->get_results("SELECT DISTINCT group_count FROM
> ".RC_CWP_TABLE_POST_META." WHERE post_id = ".$post->ID." ORDER BY
> order_id ASC");
> foreach($elements as $element){
> $order[] = $element->group_count;
> }
> return $order;
> }
> ---------------------------------------------------
> Here is my for loop:
> $group_orders = getDistinctGroupOrder();
> foreach($group_orders as $group_order)
> {
> $value= get('field',$group_order,1);
> > > > > > I just get the same albimg for both groups.
> > > > > > On Mar 27, 7:36 am, eyegaze <m.a.cana...@eyegaze.tv> wrote:
> > > > > > > Hi
> > > > > > > Reading back I don't think I was very clear with my explanation of my
> > > > > > > problem.
> > > > > > > The basic issue is that when I loop Group Duplicates everything worked
> > > > > > > well until I had to delete an entry from the middle of theduplicate
> > > > > > > list. The loop still counts the now deleted ID and displays the wrong
> > > > > > > information.
> > > > > > > Please let me know if anybody has a solution to this. If I create a
> > > > > > > new groupduplicateit adds it to the bottom as opposed to using the
> > > > > > > deleted ID.
> > how to display all the fields clear and works well! But do the
> > duplication of 3 photos for example, No. 1 = 1.jpg, No. 2 = 2.jpg, No. 3 =
> > 3.jpg all displayed excellent! Now remove the number 2 and then
> > refresh the page! Conclusion incorrect! In this case, total = 2,
> > picture number 2 should be = 3.jpg! Ie after removing duplicate photos
> > of his id is not changed!
> THANG!!!-
> You did it! Thank you so much! Ive spent hours trying to figure this
> out. The Flutter Devs need to implement your Function.
> Thanks again
> On Jun 24, 8:31 am, thang <lequocthang...@gmail.com> wrote:
> > I faced with the same problem and after spent 1 hours to look through
> > the internet, I found the solution.
> > In the file get-custom.php add this function:
> > /** Developed by Thang
> > * Return a array with the all distinct values in one array
> > *
> > * @param string $groupName
> > */
> > function getDistinctGroupOrder(){
> > global $post,$wpdb;
> > $elements = $wpdb->get_results("SELECT DISTINCT group_count FROM
> > ".RC_CWP_TABLE_POST_META." WHERE post_id = ".$post->ID." ORDER BY
> > order_id ASC");
> > > > > > > I just get the same albimg for both groups.
> > > > > > > On Mar 27, 7:36 am, eyegaze <m.a.cana...@eyegaze.tv> wrote:
> > > > > > > > Hi
> > > > > > > > Reading back I don't think I was very clear with my explanation of my
> > > > > > > > problem.
> > > > > > > > The basic issue is that when I loop Group Duplicates everything worked
> > > > > > > > well until I had to delete an entry from the middle of theduplicate
> > > > > > > > list. The loop still counts the now deleted ID and displays the wrong
> > > > > > > > information.
> > > > > > > > Please let me know if anybody has a solution to this. If I create a
> > > > > > > > new groupduplicateit adds it to the bottom as opposed to using the
> > > > > > > > deleted ID.
> > > how to display all the fields clear and works well! But do the
> > > duplication of 3 photos for example, No. 1 = 1.jpg, No. 2 = 2.jpg, No. 3 =
> > > 3.jpg all displayed excellent! Now remove the number 2 and then
> > > refresh the page! Conclusion incorrect! In this case, total = 2,
> > > picture number 2 should be = 3.jpg! Ie after removing duplicate photos
> > > of his id is not changed!
okay, so assuming that this doesn't get fixed by the flutter devs, i
see two fixes here for do-it-yourselfers. Bedoz's and thang's. both
look pretty similar, in the way they access the wp db directly. it
looks like Bedoz's only gets one field at a time, but it would be
fairly trivial to rewrite this as a loop-of-loops that got ALL fields.
also they each say to place them in different files.
does anyone have any opinions or critique? is one method more
reliable? is there something missing? most importantly, do they in
fact produce ALL groups/fields and NONE of the deleted groups/fields?
personally, if i'm going to continue using flutter, it's pretty
important to have codified solutions to stuff like this so that i can
use my time on other things.
cheers all & good work!
On Jul 1, 9:40 pm, lacohido <lacoh...@gmail.com> wrote:
> THANG!!!-
> You did it! Thank you so much! Ive spent hours trying to figure this
> out. The Flutter Devs need to implement your Function.
> Thanks again
> On Jun 24, 8:31 am, thang <lequocthang...@gmail.com> wrote:
> > I faced with the same problem and after spent 1 hours to look through
> > the internet, I found the solution.
> > In the file get-custom.php add this function:
> > /** Developed by Thang
> > * Return a array with the all distinct values in one array
> > *
> > * @param string $groupName
> > */
> > function getDistinctGroupOrder(){
> > global $post,$wpdb;
> > $elements = $wpdb->get_results("SELECT DISTINCT group_count FROM
> > ".RC_CWP_TABLE_POST_META." WHERE post_id = ".$post->ID." ORDER BY
> > order_id ASC");
> > > > > > > I just get the same albimg for both groups.
> > > > > > > On Mar 27, 7:36 am, eyegaze <m.a.cana...@eyegaze.tv> wrote:
> > > > > > > > Hi
> > > > > > > > Reading back I don't think I was very clear with my explanation of my
> > > > > > > > problem.
> > > > > > > > The basic issue is that when I loop Group Duplicates everything worked
> > > > > > > > well until I had to delete an entry from the middle of theduplicate
> > > > > > > > list. The loop still counts the now deleted ID and displays the wrong
> > > > > > > > information.
> > > > > > > > Please let me know if anybody has a solution to this. If I create a
> > > > > > > > new groupduplicateit adds it to the bottom as opposed to using the
> > > > > > > > deleted ID.
> > > how to display all the fields clear and works well! But do the
> > > duplication of 3 photos for example, No. 1 = 1.jpg, No. 2 = 2.jpg, No. 3 =
> > > 3.jpg all displayed excellent! Now remove the number 2 and then
> > > refresh the page! Conclusion incorrect! In this case, total = 2,
> > > picture number 2 should be = 3.jpg! Ie after removing duplicate photos
> > > of his id is not changed!
Thang, brilliance. You just saved my recursive butt.
One slight change to your code, to allow for code that requires
multiple duplicate groups on the same page (as mine does)
/** Developed by Thang
* Return a array with the all distinct values in one array
*
* @param string $groupName
*/
function getDistinctGroupOrder($field_name){
global $post,$wpdb;
$elements = $wpdb->get_results("SELECT DISTINCT group_count FROM
".RC_CWP_TABLE_POST_META." WHERE post_id = ".$post->ID." AND
field_name = '".$field_name."' ORDER BY order_id ASC");
foreach($elements as $element){
$order[] = $element->group_count;
}
return $order;
}
Same usage, just specify a specific field name in the group:
> okay, so assuming that this doesn't get fixed by the flutter devs, i
> see two fixes here for do-it-yourselfers. Bedoz's and thang's. both
> look pretty similar, in the way they access the wp db directly. it
> looks like Bedoz's only gets one field at a time, but it would be
> fairly trivial to rewrite this as a loop-of-loops that got ALL fields.
> also they each say to place them in different files.
> does anyone have any opinions or critique? is one method more
> reliable? is there something missing? most importantly, do they in
> fact produce ALL groups/fields and NONE of the deleted groups/fields?
> personally, if i'm going to continue using flutter, it's pretty
> important to have codified solutions to stuff like this so that i can
> use my time on other things.
> cheers all & good work!
> On Jul 1, 9:40 pm, lacohido <lacoh...@gmail.com> wrote:
> > THANG!!!-
> > You did it! Thank you so much! Ive spent hours trying to figure this
> > out. The Flutter Devs need to implement your Function.
> > Thanks again
> > On Jun 24, 8:31 am, thang <lequocthang...@gmail.com> wrote:
> > > I faced with the same problem and after spent 1 hours to look through
> > > the internet, I found the solution.
> > > In the file get-custom.php add this function:
> > > /** Developed by Thang
> > > * Return a array with the all distinct values in one array
> > > *
> > > * @param string $groupName
> > > */
> > > function getDistinctGroupOrder(){
> > > global $post,$wpdb;
> > > $elements = $wpdb->get_results("SELECT DISTINCT group_count FROM
> > > ".RC_CWP_TABLE_POST_META." WHERE post_id = ".$post->ID." ORDER BY
> > > order_id ASC");
> > > > > > > > I just get the same albimg for both groups.
> > > > > > > > On Mar 27, 7:36 am, eyegaze <m.a.cana...@eyegaze.tv> wrote:
> > > > > > > > > Hi
> > > > > > > > > Reading back I don't think I was very clear with my explanation of my
> > > > > > > > > problem.
> > > > > > > > > The basic issue is that when I loop Group Duplicates everything worked
> > > > > > > > > well until I had to delete an entry from the middle of theduplicate
> > > > > > > > > list. The loop still counts the now deleted ID and displays the wrong
> > > > > > > > > information.
> > > > > > > > > Please let me know if anybody has a solution to this. If I create a
> > > > > > > > > new groupduplicateit adds it to the bottom as opposed to using the
> > > > > > > > > deleted ID.
> > > > how to display all the fields clear and works well! But do the
> > > > duplication of 3 photos for example, No. 1 = 1.jpg, No. 2 = 2.jpg, No. 3 =
> > > > 3.jpg all displayed excellent! Now remove the number 2 and then
> > > > refresh the page! Conclusion incorrect! In this case, total = 2,
> > > > picture number 2 should be = 3.jpg! Ie after removing duplicate photos
> > > > of his id is not changed!
I know this is a bit old but I wanted to add something that I found.
As you guys mentioned above, if you delete an entry the system still
wants to show something there. I ran into this problem not with
duplicate groups or fields but just using Flutter code inside a loop.
When an entry was deleted it just pulled up an empty space where the
content used to be. Here's what I ended up doing and it works well:
<!-- check to see if there's actually content filled in. -->
<?php
$content = get_post_meta($post->ID, 'book_title', true);
if ($content) { ?>
Flutter code and other content here
<?php } else { ?>
<?php } ?>
Basically it just checks to see if there's actually content filled
in. If the space for the old post is still there on the server (even
though it was deleted) the content will be blank. If it's blank then
it returns nothing and moves onto the next post. Just replace
'book_title' with one of the names of your fields.
> On Aug 4, 3:17 pm, snackd <snackdetec...@gmail.com> wrote:
> > okay, so assuming that this doesn't get fixed by the flutter devs, i
> > see two fixes here for do-it-yourselfers. Bedoz's and thang's. both
> > look pretty similar, in the way they access the wp db directly. it
> > looks like Bedoz's only gets one field at a time, but it would be
> > fairly trivial to rewrite this as a loop-of-loops that got ALL fields.
> > also they each say to place them in different files.
> > does anyone have any opinions or critique? is one method more
> > reliable? is there something missing? most importantly, do they in
> > fact produce ALL groups/fields and NONE of the deleted groups/fields?
> > personally, if i'm going to continue using flutter, it's pretty
> > important to have codified solutions to stuff like this so that i can
> > use my time on other things.
> > cheers all & good work!
> > On Jul 1, 9:40 pm, lacohido <lacoh...@gmail.com> wrote:
> > > THANG!!!-
> > > You did it! Thank you so much! Ive spent hours trying to figure this
> > > out. The Flutter Devs need to implement your Function.
> > > Thanks again
> > > On Jun 24, 8:31 am, thang <lequocthang...@gmail.com> wrote:
> > > > I faced with the same problem and after spent 1 hours to look through
> > > > the internet, I found the solution.
> > > > In the file get-custom.php add this function:
> > > > /** Developed by Thang
> > > > * Return a array with the all distinct values in one array
> > > > *
> > > > * @param string $groupName
> > > > */
> > > > function getDistinctGroupOrder(){
> > > > global $post,$wpdb;
> > > > $elements = $wpdb->get_results("SELECT DISTINCT group_count FROM
> > > > ".RC_CWP_TABLE_POST_META." WHERE post_id = ".$post->ID." ORDER BY
> > > > order_id ASC");
> > > > > > > > > What if you haveduplicatefields with a group that can be
> > > > > > > > > duplicated? I can't get it to work...using this right now.
> > > > > > > > > I just get the same albimg for both groups.
> > > > > > > > > On Mar 27, 7:36 am, eyegaze <m.a.cana...@eyegaze.tv> wrote:
> > > > > > > > > > Hi
> > > > > > > > > > Reading back I don't think I was very clear with my explanation of my
> > > > > > > > > > problem.
> > > > > > > > > > The basic issue is that when I loop Group Duplicates everything worked
> > > > > > > > > > well until I had to delete an entry from the middle of theduplicate
> > > > > > > > > > list. The loop still counts the now deleted ID and displays the wrong
> > > > > > > > > > information.
> > > > > > > > > > Please let me know if anybody has a solution to this. If I create a
> > > > > > > > > > new groupduplicateit adds it to the bottom as opposed to using the
> > > > > > > > > > deleted ID.
> > > > > how to display all the fields clear and works well! But do the
> > > > > duplication of 3 photos for example, No. 1 = 1.jpg, No. 2 = 2.jpg, No. 3 =
> > > > > 3.jpg all displayed excellent! Now remove the number 2 and then
> > > > > refresh the page! Conclusion incorrect! In this case, total = 2,
> > > > > picture number 2 should be = 3.jpg! Ie after removingduplicatephotos
> > > > > of his id is not changed!