Alphabetically display the createdBy select user pull down

5 posts by 2 authors in: Forums > CMS Builder
Last Post: November 28, 2013   (RSS)

By Dave - November 28, 2013

Hi Jerry, 

Yea, I think that would be a good feature.  I've made this update for the next release in /cmsAdmin/lib/common.php

I added the code in red:

// show pulldown when editor clicks "change" beside "Created By" on edit page in CMS
function ajaxGetUsersAsPulldown() {
global $TABLE_PREFIX, $hasEditorAccess, $tableName;
if (!$hasEditorAccess) { return ''; } // must have section admin access

// get users with access to this section
$query = "SELECT u.num, u.username
FROM {$TABLE_PREFIX}accounts u
JOIN {$TABLE_PREFIX}_accesslist a ON u.num = a.userNum
WHERE a.accessLevel > 1 AND a.tableName IN ('all','$tableName')
ORDER BY username";
$users = mysql_fetch($query);

Let me know if that works for you.

Dave Edis - Senior Developer
interactivetools.com

Hi Dave,

Thanks for this.

I think the code you wanted me to update might actually be in cmsAdmin/lib/menu/default/common.php

But when I add the code you suggested, I'm throwing this error at the top of the record list ...

: Cannot modify header information - headers already sent by (output started at /home/k9class/public_html/cmsAdmin/lib/menus/default/common.php:1065) in /home/k9class/public_html/cmsAdmin/lib/menus/header.php on line 2

Best,

Jerry

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

By Dave - November 28, 2013

Hi Jerry, 

I think the code you wanted me to update might actually be in cmsAdmin/lib/menu/default/common.php

Yep that's right, thanks!

But when I add the code you suggested, I'm throwing this error at the top of the record list ...

: Cannot modify header information - headers already sent by (output started at /home/k9class/public_html/cmsAdmin/lib/menus/default/common.php:1065) in /home/k9class/public_html/cmsAdmin/lib/menus/header.php on line 2

Are you running the latest version?  It sounds like some whitespace or extra characters might have been accidentally updated when you edited the file.  You should be able to modify the MySQL query without issue.  I'd try reverting back, and then making the change again, and if still no luck then just email me the CMS/FTP login details and I can take a look for you (to dave@interactivetools.com, don't post login details to the forum).

Thanks!

Dave Edis - Senior Developer
interactivetools.com

Thanksgiving dinner's over and I'm stuffed.

Don't know why, but I revised a fresh copy of the file and it worked as planned.

Thanks for this and for including it in the next upgrade.

Best,

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php