• Resolved obedienceuk

    (@obedienceuk)


    I have a new WordPress site that I’m transferring from another one. On the other site I have ads and would like to transfer them over (manually, not anything automated). BUT when I try to add them to the WordPress site and associate them to a particular user (of which I have over 1900) the pulldown list is useless. It lists the users in probably database id sequence, so how am I supposed to find the user. (I’d like them in Username sequence, but don’t know how.)

    https://www.ads-software.com/extend/plugins/another-wordpress-classifieds-plugin/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter obedienceuk

    (@obedienceuk)

    Should have said the other site isn’t wordpress.

    We will have to address this in a patch, I think.

    As a workaround, you could hack the page frontend/templates/page-place-ad-users-dropdown.tpl.php and hack this section of code:

    <select id="place-ad-user-id" name="user_id">
        <option value="0"><?php _e('Select a User owner for this Ad', 'AWPCP') ?></option>
    
        <?php $selected = $user_id ?>
        <?php foreach ($users as $k => $user): ?>
        <option value="<?php echo esc_attr($user->ID) ?>" data-payment-terms="<?php echo esc_attr($user->payment_terms) ?>" <?php echo $selected == $user->ID ? 'selected="selected"' : '' ?>>
            <?php echo $user->display_name ?>
        </option>
        <?php endforeach ?>
    </select>

    If you use a PHP sorting routine on the variable $users, you can put them in alphabetical order.

    Thread Starter obedienceuk

    (@obedienceuk)

    Thanks. I found the code, but as a PHP dunce, I wouldn’t know what the PHP sorting routine is, or where to put it.

    After this line:

    <?php $selected = $user_id ?>

    Add this line:

    <?php asort($users); ?>

    That should do it. The semi-colon may or may not be required–I’d have to test to know for sure.

    Thread Starter obedienceuk

    (@obedienceuk)

    OK, thanks for trying, but neither worked.

    If PHP isn’t your forte, you might consider hiring a developer to help you out from oDesk: https://odesk.com

    Thread Starter obedienceuk

    (@obedienceuk)

    LOL

    I already have for my unique development (really)! But thought this was a ‘working’ plugin!

    It does indeed work. What you found was a minor issue with sorting. Since my hack wasn’t quite enough, the next recommendation I can make is to have someone else take a deeper look until we can get to this particular issue.

    Thread Starter obedienceuk

    (@obedienceuk)

    OK, thanks. But not a minor issue for me. I have an oDesk developer currently working on something for me, so I’ll see if he can do the hack for me.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘List of Users on Create Ad by Administrator’ is closed to new replies.