Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
duplicate fields - please help
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  24 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Rich  
View profile  
 More options Mar 17 2009, 12:36 pm
From: Rich <rich.b.des...@gmail.com>
Date: Tue, 17 Mar 2009 09:36:10 -0700 (PDT)
Local: Tues, Mar 17 2009 12:36 pm
Subject: duplicate fields - please help
Can someone please help me with this. I need to know how to call
duplicate fields in my template. Please help.

Thanks.
Rich


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
na...@freshout.us  
View profile  
 More options Mar 19 2009, 1:09 pm
From: na...@freshout.us
Date: Thu, 19 Mar 2009 10:09:46 -0700 (PDT)
Local: Thurs, Mar 19 2009 1:09 pm
Subject: Re: duplicate fields - please help
        <?php $total = getGroupDuplicates('Teamname');?>
        <?php for($i = 1; $i < $total+1; $i++):?>
            <div class="prow">
                <div class="pr-left"><img src="<?=PT()?>?src=<?=get
('Teamphoto',$i,1)?>&w=100"?></div>
                <div class="pr-right">
                    <p><strong><?php echo get('Teamname',$i,1);?></
strong><br /><?php echo get('Teambiography',$i,1);?></p>
                </div>
            </div>
        <?php endfor;?>
        </div>

On Mar 17, 12:36 pm, Rich <rich.b.des...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
swoosh  
View profile  
 More options Mar 20 2009, 11:46 am
From: swoosh <mathieu.houlb...@gmail.com>
Date: Fri, 20 Mar 2009 08:46:36 -0700 (PDT)
Local: Fri, Mar 20 2009 11:46 am
Subject: Re: duplicate fields - please help
How we know the group index??

I have duplicate fields, the name of the fields is 'image' and the
type 'image'. There are simply in a panel, i have no group.

How can access them?

On 19 mar, 18:09, na...@freshout.us wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rich  
View profile  
 More options Mar 20 2009, 12:13 pm
From: Rich <rich.b.des...@gmail.com>
Date: Fri, 20 Mar 2009 09:13:24 -0700 (PDT)
Local: Fri, Mar 20 2009 12:13 pm
Subject: Re: duplicate fields - please help
swoosh,

Try this:

<?php $total = getGroupDuplicates('image');?>
       <?php for($i = 1; $i < $total+1; $i++):?>
           <div class="prow">
              <img src="<?=PT()?>?src=<?=get
('image',$i,1)?>&w=100"?>
           </div>
       <?php endfor;?>

On Mar 20, 10:46 am, swoosh <mathieu.houlb...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
swoosh  
View profile  
 More options Mar 22 2009, 2:49 pm
From: swoosh <mathieu.houlb...@gmail.com>
Date: Sun, 22 Mar 2009 11:49:00 -0700 (PDT)
Subject: Re: duplicate fields - please help
Thanx for your help Rich.

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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Karl  
View profile  
 More options Mar 23 2009, 3:30 pm
From: Karl <audioundergrou...@googlemail.com>
Date: Mon, 23 Mar 2009 12:30:20 -0700 (PDT)
Local: Mon, Mar 23 2009 3:30 pm
Subject: Re: duplicate fields - please help
Sorry if im being really dense but its been a long few weeks. Im using
the following code for tracks in an album:

<?php $total = getFieldDuplicates('track', 1);?>
       <?php for($i = 1; $i < $total+1; $i++):?>

            <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"

Thanks in advance for any help


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
swoosh  
View profile  
 More options Mar 23 2009, 7:08 pm
From: swoosh <mathieu.houlb...@gmail.com>
Date: Mon, 23 Mar 2009 16:08:29 -0700 (PDT)
Local: Mon, Mar 23 2009 7:08 pm
Subject: Re: duplicate fields - please help
Ok it's work !!!

Karl try this :

<?php $total = getFieldDuplicates('track', 1);?>
       <?php for($i = 1; $i < $total+1; $i++):?>

            <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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Karl  
View profile  
 More options Mar 24 2009, 6:01 am
From: Karl <audioundergrou...@googlemail.com>
Date: Tue, 24 Mar 2009 03:01:56 -0700 (PDT)
Local: Tues, Mar 24 2009 6:01 am
Subject: Re: duplicate fields - please help
Arr wow, that has to go with one of the most blindingly obvious
mistakes any one has ever made!!!

Cheers Swoosh, it works a treat :)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
eyegaze  
View profile  
 More options Mar 25 2009, 8:27 am
From: eyegaze <m.a.cana...@eyegaze.tv>
Date: Wed, 25 Mar 2009 05:27:13 -0700 (PDT)
Local: Wed, Mar 25 2009 8:27 am
Subject: Re: duplicate fields - please help
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.

Any thought or ideas?

Many thanks
Neil


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
eyegaze  
View profile  
 More options Mar 27 2009, 7:36 am
From: eyegaze <m.a.cana...@eyegaze.tv>
Date: Fri, 27 Mar 2009 04:36:19 -0700 (PDT)
Local: Fri, Mar 27 2009 7:36 am
Subject: Re: duplicate fields - please help
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 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.

This is the code I am using:

<!-- Staff Member -->
<?php $i=1; ?>
  <?php $group_dup = getGroupDuplicates ("person_name"); ?>
        <?php for($i = 1; $i < $group_dup+1; $i++): ?>
        <div id="staff_member">
  <h3><? echo get("person_name", $i,1); ?> - <? echo get("job_title",
$groupIndex); ?></h3>
  <p><? echo get_image("person_photo", $i,1); ?>
  <? echo get("person_description", $i,1); ?></p></div>
 <?php endfor; ?>
<!-- End of Staff Member -->

Many thanks
Neil


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
CKeim  
View profile  
 More options Apr 10 2009, 12:38 am
From: CKeim <Caroline.K...@gmail.com>
Date: Thu, 9 Apr 2009 21:38:09 -0700 (PDT)
Local: Fri, Apr 10 2009 12:38 am
Subject: Re: duplicate fields - please help
What if you have duplicate fields with a group that can be
duplicated?  I can't get it to work...using this right now.

                                                        <?php query_posts('pagename=photos'); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
                                                <?php $fotal = getGroupDuplicates('photo-album-name');?>
        <?php for($b = 1; $b < $fotal+1; $b++):?>
            <div class="photo-album">
                <?php echo get('photo-album-name',$b,1);?><br />
<?php $total = getFieldDuplicates('albimg', 1);?>
       <?php for($i = 1; $i < $total+1; $i++):?>

            <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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
lacohido  
View profile  
 More options May 3 2009, 5:41 pm
From: lacohido <lacoh...@gmail.com>
Date: Sun, 3 May 2009 14:41:39 -0700 (PDT)
Local: Sun, May 3 2009 5:41 pm
Subject: Re: duplicate fields - please help
Im having the same Problem. Any Help with this?

On Mar 27, 4:36 am, eyegaze <m.a.cana...@eyegaze.tv> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bedoz  
View profile  
 More options May 7 2009, 9:33 am
From: Bedoz <bedo...@gmail.com>
Date: Thu, 7 May 2009 06:33:00 -0700 (PDT)
Subject: Re: duplicate fields - please help
i have the same problem how can i solve it?

Thank you

On 10 Apr, 06:38, CKeim <Caroline.K...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bedoz  
View profile  
 More options May 7 2009, 11:40 am
From: Bedoz <bedo...@gmail.com>
Date: Thu, 7 May 2009 08:40:44 -0700 (PDT)
Local: Thurs, May 7 2009 11:40 am
Subject: Re: duplicate fields - please help
i have found a solution for this problem.

i have rewritten get function using this into main.php

function get_fields($fieldName)
{
        global $post;
        global $wpdb;

        $result = $wpdb->get_results("
                SELECT meta_value
                FROM $wpdb->postmeta
                WHERE post_id = '$post->ID' and meta_key = '$fieldName'
                ORDER BY meta_id
        ", ARRAY_A );
        $i = 0;
        while (isset($result[$i]['meta_value'])) {
                $ret[] = $result[$i]['meta_value'];
                $i++;
        }
        return $ret;

}

it will return an array of all single or duplicated fields with name
given to function
Hope this help!

On 7 Mag, 15:33, Bedoz <bedo...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
gagou  
View profile  
 More options Jun 3 2009, 6:03 pm
From: gagou <g.stav...@gmail.com>
Date: Wed, 3 Jun 2009 15:03:22 -0700 (PDT)
Local: Wed, Jun 3 2009 6:03 pm
Subject: Re: duplicate fields - please help
The answer would be :
                        <ul>
                        <? echo $total = getGroupDuplicates ('your_item_id'); ?>
                    <?php for($i = 1; $i < $total+1; $i++):?>
                    <li>
                        <? echo get_image('your_item_id', $i); ?>
                    </li>
                    <?php endfor;?>
                        </ul>

Am I right
See ya...
On May 7, 5:40 pm, Bedoz <bedo...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Maguar  
View profile  
 More options Jun 3 2009, 11:13 pm
From: Maguar <michaelyu...@yandex.ru>
Date: Wed, 3 Jun 2009 20:13:03 -0700 (PDT)
Local: Wed, Jun 3 2009 11:13 pm
Subject: Re: duplicate fields - please help

On 4 июн, 05:03, gagou <g.stav...@gmail.com> wrote:

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!

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
gagou  
View profile  
 More options Jun 4 2009, 10:24 am
From: gagou <g.stav...@gmail.com>
Date: Thu, 4 Jun 2009 07:24:21 -0700 (PDT)
Local: Thurs, Jun 4 2009 10:24 am
Subject: Re: duplicate fields - please help
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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
thang  
View profile  
 More options Jun 24 2009, 11:31 am
From: thang <lequocthang...@gmail.com>
Date: Wed, 24 Jun 2009 08:31:59 -0700 (PDT)
Local: Wed, Jun 24 2009 11:31 am
Subject: Re: duplicate fields - please help
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);

}

-----------------------------------------------------

On Jun 4, 10:13 am, Maguar <michaelyu...@yandex.ru> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
lacohido  
View profile  
 More options Jul 1 2009, 9:40 pm
From: lacohido <lacoh...@gmail.com>
Date: Wed, 1 Jul 2009 18:40:03 -0700 (PDT)
Local: Wed, Jul 1 2009 9:40 pm
Subject: Re: duplicate fields - please help
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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
doc4  
View profile  
 More options Jul 13 2009, 1:32 am
From: doc4 <doc4des...@gmail.com>
Date: Sun, 12 Jul 2009 22:32:26 -0700 (PDT)
Local: Mon, Jul 13 2009 1:32 am
Subject: Re: duplicate fields - please help
I've written a tutorial on this same issue:

http://www.doc4design.com/articles/flutter-duplicate-fields/

Dale Crum
http://www.doc4design.com

On Jul 1, 8:40 pm, lacohido <lacoh...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
snackd  
View profile  
 More options Aug 4 2009, 4:17 pm
From: snackd <snackdetec...@gmail.com>
Date: Tue, 4 Aug 2009 13:17:06 -0700 (PDT)
Local: Tues, Aug 4 2009 4:17 pm
Subject: Re: duplicate fields - please help
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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nick Keenan  
View profile  
 More options Aug 18 2009, 2:04 pm
From: Nick Keenan <worldtheatre...@gmail.com>
Date: Tue, 18 Aug 2009 11:04:18 -0700 (PDT)
Local: Tues, Aug 18 2009 2:04 pm
Subject: Re: duplicate fields - please help
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:

$group_orders = getDistinctGroupOrder('duplicated-group-field');

***  Right?  This change doesn't screw anything up, right? ***

THANK YOU for figuring this out.

On Aug 4, 3:17 pm, snackd <snackdetec...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
JessN  
View profile  
 More options Sep 17 2009, 8:19 pm
From: JessN <jess.microme...@gmail.com>
Date: Thu, 17 Sep 2009 17:19:32 -0700 (PDT)
Local: Thurs, Sep 17 2009 8:19 pm
Subject: Re: duplicate fields - please help
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.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mroggle  
View profile  
 More options Sep 24 2009, 2:42 pm
From: mroggle <nopr...@gmail.com>
Date: Thu, 24 Sep 2009 11:42:38 -0700 (PDT)
Local: Thurs, Sep 24 2009 2:42 pm
Subject: Re: duplicate fields - please help
THANG and NICK, thank you so much for your solutions!!

i used Nicks modification, but changed it to "ORDER BY field_name",
which gave me all the control i needed!

one strange quirk tho, it didnt accept DESC instead of ASC. it just
kept returning it in descending order.

but, i threw in a good old array reverse before the output. is that
too mean?

thanks again, seriously!

On Aug 18, 7:04 pm, Nick Keenan <worldtheatre...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »